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

arch/m68knommu/platform/5249/config.c

index 046bb1f3d93453ff2986a84d415c3d3f55f04d6d..5d09dcf110b7f8d762766ecc80317b464d40f54f 100644 (file)
@@ -78,6 +78,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);