]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] m68knommu/5206 check timer irq pending
authorGreg Ungerer <gerg@snapgear.com>
Sun, 25 May 2003 13:34:55 +0000 (06:34 -0700)
committerJaroslav Kysela <perex@suse.cz>
Sun, 25 May 2003 13:34:55 +0000 (06:34 -0700)
Add a function to allow checking if the timer interrupt is pending for
the m68knommu/5206 CPU.  This is used by the architecture timer code for
microsecond accurate time calculations.

arch/m68knommu/platform/5206/config.c

index 33bdfd095280f5ee004fce82efd6ba5260d9521a..e0406c2e2479ee153e24e2f70d213f995496425e 100644 (file)
@@ -79,6 +79,20 @@ void mcf_settimericr(unsigned int timer, unsigned int level)
 
 /***************************************************************************/
 
+int mcf_timerirqpending(int timer)
+{
+       unsigned int imr = 0;
+
+       switch (timer) {
+       case 1:  imr = MCFSIM_IMR_TIMER1; break;
+       case 2:  imr = MCFSIM_IMR_TIMER2; break;
+       default: break;
+       }
+       return (mcf_getipr() & imr);
+}
+
+/***************************************************************************/
+
 void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);