diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-07-12 19:47:25 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-07-12 19:47:25 +0000 |
commit | 637df35f96d8023056369fcf2c9943419f1a1b74 (patch) | |
tree | a12bd461bf892ccaff6c67571432f0535eb03e96 /c/src/exec/score/cpu/m68k | |
parent | added David Glessner's 68302 work. (diff) | |
download | rtems-637df35f96d8023056369fcf2c9943419f1a1b74.tar.bz2 |
Ada95, gnat, go32
Diffstat (limited to 'c/src/exec/score/cpu/m68k')
-rw-r--r-- | c/src/exec/score/cpu/m68k/cpu.c | 72 | ||||
-rw-r--r-- | c/src/exec/score/cpu/m68k/cpu.h | 39 |
2 files changed, 67 insertions, 44 deletions
diff --git a/c/src/exec/score/cpu/m68k/cpu.c b/c/src/exec/score/cpu/m68k/cpu.c index 662a0440f4..a97698372a 100644 --- a/c/src/exec/score/cpu/m68k/cpu.c +++ b/c/src/exec/score/cpu/m68k/cpu.c @@ -40,7 +40,29 @@ void _CPU_Initialize( } -/* _CPU_ISR_install_vector +/*PAGE + * + * _CPU_ISR_install_raw_handler + */ + +void _CPU_ISR_install_raw_handler( + unsigned32 vector, + proc_ptr new_handler, + proc_ptr *old_handler +) +{ + proc_ptr *interrupt_table = NULL; + + m68k_get_vbr( interrupt_table ); + + *old_handler = interrupt_table[ vector ]; + + interrupt_table[ vector ] = new_handler; +} + +/*PAGE + * + * _CPU_ISR_install_vector * * This kernel routine installs the RTEMS handler for the * specified vector. @@ -51,15 +73,6 @@ void _CPU_Initialize( * old_handler - former ISR for this vector number * * Output parameters: NONE - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ */ void _CPU_ISR_install_vector( @@ -68,14 +81,13 @@ void _CPU_ISR_install_vector( proc_ptr *old_handler ) { - proc_ptr *interrupt_table = NULL; - - m68k_get_vbr( interrupt_table ); + proc_ptr ignored; *old_handler = _ISR_Vector_table[ vector ]; + _CPU_ISR_install_raw_handler( vector, _ISR_Handler, &ignored ); + _ISR_Vector_table[ vector ] = new_handler; - interrupt_table[ vector ] = _ISR_Handler; } @@ -100,21 +112,21 @@ void _CPU_Install_interrupt_stack( void ) * Returns log2(x) 0<x<256 */ const unsigned char __log2table[256] = { - 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 }; #endif diff --git a/c/src/exec/score/cpu/m68k/cpu.h b/c/src/exec/score/cpu/m68k/cpu.h index 0b36533562..566e479f3a 100644 --- a/c/src/exec/score/cpu/m68k/cpu.h +++ b/c/src/exec/score/cpu/m68k/cpu.h @@ -328,20 +328,18 @@ EXTERN void *_CPU_Interrupt_stack_high; { \ extern const unsigned char __log2table[256]; \ \ - (_output) = 0; /* avoids warnings */ \ - asm ( "move.w %1,%0\n"\ - "\tandi.w #0xff00,%0\n"\ - "\tjbne 0f\n"\ - "\tmoveq.l #0,%0\n"\ - "\tmove.b (%2,%1.w),%0\n"\ - "\tjbra 1f\n"\ - "0:\tmoveq.l #8,%0\n"\ - "\tlsr.w #8,%1\n"\ - "\tadd.b (%2,%1.w),%0\n"\ - "1:"\ - : "=&d" ((_output)) \ - : "d" ((_value)), "ao" (__log2table) \ - : "cc" ) ; \ + asm ( " tst.b %1\n" /* check for bits in ls byte */ \ + " beq.s 0f\n" /* branch if no bits set */ \ + " moveq.l #0,%0\n" /* set up for bits 0..7 */ \ + " andi.w #0x00ff,%1\n" /* clear ms byte for add inst */ \ + " bra.s 1f\n" /* go add */ \ + "0: moveq.l #8,%0\n" /* set up for bits 8..15 */ \ + " lsr.w #8,%1\n" /* shift ms byte to ls byte, */ \ + /* filling ms byte with 0s */ \ + "1: add.b (%2,%1.w),%0\n" /* add offset for bit pattern */ \ + : "=&d" ((_output)) \ + : "d" ((_value)), "ao" (__log2table) \ + : "cc" ) ; \ } #endif @@ -385,6 +383,19 @@ void _CPU_Initialize( ); /* + * _CPU_ISR_install_raw_handler + * + * This routine installs a "raw" interrupt handler directly into the + * processor's vector table. + */ + +void _CPU_ISR_install_raw_handler( + unsigned32 vector, + proc_ptr new_handler, + proc_ptr *old_handler +); + +/* * _CPU_ISR_install_vector * * This routine installs an interrupt vector. |