diff options
author | Eric Norum <WENorum@lbl.gov> | 2005-02-03 16:01:04 +0000 |
---|---|---|
committer | Eric Norum <WENorum@lbl.gov> | 2005-02-03 16:01:04 +0000 |
commit | 5b6111b499f0e727b7987a87117b464398ee2500 (patch) | |
tree | 468fa4bf3e2c178eafc37375b8495540261a389e /c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c | |
parent | 2005-02-03 Ralf Corsepius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-5b6111b499f0e727b7987a87117b464398ee2500.tar.bz2 |
Add support for interrupt controller allocation. This will provides a
mechanism for applications to find a free level/priority.
Diffstat (limited to 'c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c')
-rw-r--r-- | c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c b/c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c index f3b46b41eb..6daa606b20 100644 --- a/c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c @@ -246,13 +246,33 @@ void bsp_start( void ) MCF5282_CS2_CSCR = MCF5282_CS_CSCR_PS_16; } -unsigned32 get_CPU_clock_speed(void) +unsigned32 bsp_get_CPU_clock_speed(void) { extern char _CPUClockSpeed[]; return( (unsigned32)_CPUClockSpeed); } /* + * Interrupt controller allocation + */ +int bsp_allocate_interrupt(int level, int priority) +{ + static char used[7]; + rtems_interrupt_level l; + int ret = -1; + + if ((level < 1) || (level > 7) || (priority < 0) || (priority > 7)) + return ret; + rtems_interrupt_disable(l); + if ((used[level-1] & (1 << priority)) == 0) { + used[level-1] |= (1 << priority); + ret = 0; + } + rtems_interrupt_enable(l); + return ret; +} + +/* * Arcturus bootloader system calls */ #define syscall_return(type, ret) \ |