2 * (C) Copyright 2000-2002
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 * Gleb Natapov <gnatapov@mrv.com>
9 * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com.
11 * SPDX-License-Identifier: GPL-2.0+
15 #include <asm/processor.h>
18 /* Implemented by SPARC CPUs */
19 extern int interrupt_init_cpu(void);
20 extern void timer_interrupt_cpu(void *arg);
21 extern int timer_interrupt_init_cpu(void);
29 /* set PIL to 15 ==> no pending interrupts will interrupt CPU */
35 void intUnlock(int oldLevel)
40 void enable_interrupts(void)
42 set_pil(0); /* enable all interrupts */
45 int disable_interrupts(void)
50 int interrupt_is_enabled(void)
57 int interrupt_init(void)
61 /* call cpu specific function from $(CPU)/interrupts.c */
62 ret = interrupt_init_cpu();
64 /* enable global interrupts */
70 /* timer interrupt/overflow counter */
71 static volatile ulong timestamp = 0;
73 /* regs can not be used here! regs is actually the pointer given in
76 void timer_interrupt(struct pt_regs *regs)
78 /* call cpu specific function from $(CPU)/interrupts.c */
79 timer_interrupt_cpu((void *)regs);
84 void timer_interrupt_init(void)
90 irq = timer_interrupt_init_cpu();
93 /* cpu specific code handled the interrupt registration it self */
96 /* register interrupt handler for timer */
97 irq_install_handler(irq, (void (*)(void *))timer_interrupt, NULL);