From f33f888d0e6c5c3f8eb880219bbc87b938832607 Mon Sep 17 00:00:00 2001 From: Daniel Hellstrom Date: Fri, 22 Jan 2010 11:57:49 +0100 Subject: sparc: Added function that checks if IRQ is on or off Signed-off-by: Daniel Hellstrom --- arch/sparc/lib/interrupts.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch/sparc/lib/interrupts.c') diff --git a/arch/sparc/lib/interrupts.c b/arch/sparc/lib/interrupts.c index b7c39936196..b8f2efb303b 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; -- cgit v1.2.3 From c97088c3cfa84e7e53fddd26896f145cc8c431a2 Mon Sep 17 00:00:00 2001 From: Francois Retief Date: Wed, 28 Oct 2015 15:18:22 +0200 Subject: sparc: Update cpu_init.c to use generic timer infrastructure Introduce the CONFIG_SYS_TIMER_* macros in include/asm/config.h to make use of the generic timer infrastructure in lib/time.c. Created a timer_init() function to initialize the timer hardware and update the #ifdef in board_init_f to allow this function to be called during the start-up sequence. Signed-off-by: Francois Retief --- arch/sparc/lib/interrupts.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'arch/sparc/lib/interrupts.c') diff --git a/arch/sparc/lib/interrupts.c b/arch/sparc/lib/interrupts.c index b8f2efb303b..fab26c62dd6 100644 --- a/arch/sparc/lib/interrupts.c +++ b/arch/sparc/lib/interrupts.c @@ -81,11 +81,6 @@ void timer_interrupt(struct pt_regs *regs) timestamp++; } -ulong get_timer(ulong base) -{ - return (timestamp - base); -} - void timer_interrupt_init(void) { int irq; -- cgit v1.2.3 From 7a4fb11b85939b47738283c3a7ae7f461468e274 Mon Sep 17 00:00:00 2001 From: Francois Retief Date: Sat, 21 Nov 2015 23:15:07 +0200 Subject: sparc: Remove non-generic board init files: board.c, time.c Remove the board.c and time.c files and all associated non-generic board initialization code. Signed-off-by: Francois Retief --- arch/sparc/lib/interrupts.c | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'arch/sparc/lib/interrupts.c') diff --git a/arch/sparc/lib/interrupts.c b/arch/sparc/lib/interrupts.c index fab26c62dd6..cb73d17999d 100644 --- a/arch/sparc/lib/interrupts.c +++ b/arch/sparc/lib/interrupts.c @@ -66,33 +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++; -} - -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); -} -- cgit v1.2.3