diff options
author | Tom Rini <trini@konsulko.com> | 2015-12-04 17:50:34 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-12-04 17:50:34 -0500 |
commit | 9eed48c8bec98425dbd995dd72c40e9ad7a8c26b (patch) | |
tree | 187374b183ff589b43b7f8706829500ad2664dc2 /arch/sparc/lib/interrupts.c | |
parent | a85670e40da1ef4f299effb73c36e48d39d50106 (diff) | |
parent | 7a4fb11b85939b47738283c3a7ae7f461468e274 (diff) |
Merge branch 'master' of http://git.denx.de/u-boot-sparc
Diffstat (limited to 'arch/sparc/lib/interrupts.c')
-rw-r--r-- | arch/sparc/lib/interrupts.c | 42 |
1 files changed, 7 insertions, 35 deletions
diff --git a/arch/sparc/lib/interrupts.c b/arch/sparc/lib/interrupts.c index b7c39936196..cb73d17999d 100644 --- a/arch/sparc/lib/interrupts.c +++ b/arch/sparc/lib/interrupts.c @@ -47,6 +47,13 @@ int disable_interrupts(void) return intLock(); } +int interrupt_is_enabled(void) +{ + if (get_pil() == 15) + return 0; + return 1; +} + int interrupt_init(void) { int ret; @@ -59,38 +66,3 @@ int interrupt_init(void) return ret; } - -/* timer interrupt/overflow counter */ -static volatile ulong timestamp = 0; - -/* regs can not be used here! regs is actually the pointer given in - * irq_install_handler - */ -void timer_interrupt(struct pt_regs *regs) -{ - /* call cpu specific function from $(CPU)/interrupts.c */ - timer_interrupt_cpu((void *)regs); - - timestamp++; -} - -ulong get_timer(ulong base) -{ - return (timestamp - base); -} - -void timer_interrupt_init(void) -{ - int irq; - - timestamp = 0; - - irq = timer_interrupt_init_cpu(); - - if (irq < 0) { - /* cpu specific code handled the interrupt registration it self */ - return; - } - /* register interrupt handler for timer */ - irq_install_handler(irq, (void (*)(void *))timer_interrupt, NULL); -} |