Timer service enhanced for sleep

This commit is contained in:
Amit Mahajan
2009-12-01 23:31:23 +05:30
parent 3caa43d756
commit cf9f3aab5b
4 changed files with 104 additions and 15 deletions

View File

@@ -56,10 +56,6 @@
#define SP804_TIMERMIS 0x14
#define SP804_TIMERBGLOAD 0x18
struct sp804_timer {
unsigned int base;
};
void sp804_init(unsigned int timer_base, int runmode, int wrapmode, \
int width, int irq_enable);
void sp804_irq_handler(unsigned int timer_base);

View File

@@ -10,6 +10,8 @@
#define setbit(bit, a) write(read(a) | bit, a)
#define clrbit(bit, a) write(read(a) & ~bit, a)
extern void timer_irq_handler(void);
void sp804_irq_handler(unsigned int timer_base)
{
/*
@@ -17,6 +19,7 @@ void sp804_irq_handler(unsigned int timer_base)
* as it automatically reloads and wraps
*/
write(1, (timer_base + SP804_TIMERINTCLR));
timer_irq_handler();
}
static inline void sp804_control(unsigned int timer_base, int bit, int setclr)