Commit 6ef4015d authored by Greg Ungerer's avatar Greg Ungerer Committed by Jaroslav Kysela

[PATCH] m68knommu/5272 check timer irq pending

Add a function to allow checking if the timer interrupt is pending for
the m68knommu/5272 CPU.  This is used by the architecture timer code for
microsecond accurate time calculations.
parent f3ef0059
......@@ -70,17 +70,24 @@ void mcf_autovector(unsigned int vec)
void mcf_settimericr(int timer, int level)
{
volatile unsigned long *icrp;
unsigned int icr;
switch (timer) {
case 2: icr = MCFSIM_ICR2; break;
case 3: icr = MCFSIM_ICR3; break;
case 4: icr = MCFSIM_ICR4; break;
default: icr = MCFSIM_ICR1; break;
if ((timer >= 1 ) && (timer <= 4)) {
icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
*icrp = (0x8 | level) << ((4 - timer) * 4);
}
}
/***************************************************************************/
icrp = (volatile unsigned long *) (MCF_MBAR + icr);
*icrp = (0x8 | level) << ((4 - timer) * 4);
int mcf_timerirqpending(int timer)
{
volatile unsigned long *icrp;
if ((timer >= 1 ) && (timer <= 4)) {
icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
return (*icrp & (0x8 << ((4 - timer) * 4)));
}
return 0;
}
/***************************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment