diff options
Diffstat (limited to 'c/src/exec/score/cpu')
26 files changed, 168 insertions, 75 deletions
diff --git a/c/src/exec/score/cpu/hppa1.1/cpu.c b/c/src/exec/score/cpu/hppa1.1/cpu.c index 437996a78d..6cb6347151 100644 --- a/c/src/exec/score/cpu/hppa1.1/cpu.c +++ b/c/src/exec/score/cpu/hppa1.1/cpu.c @@ -19,11 +19,10 @@ #include <rtems/system.h> #include <rtems/fatal.h> -#include <rtems/isr.h> -#include <rtems/intr.h> -#include <rtems/wkspace.h> +#include <rtems/core/isr.h> +#include <rtems/core/wkspace.h> -rtems_status_code hppa_external_interrupt_initialize(void); +void hppa_external_interrupt_initialize(void); void hppa_external_interrupt_enable(unsigned32); void hppa_external_interrupt_disable(unsigned32); void hppa_external_interrupt(unsigned32, CPU_Interrupt_frame *); @@ -73,9 +72,6 @@ void _CPU_Initialize( extern void IVA_Table(void); - if ( cpu_table == NULL ) - rtems_fatal_error_occurred( RTEMS_NOT_CONFIGURED ); - /* * XXX; need to setup fpsr smarter perhaps */ @@ -194,7 +190,7 @@ void _CPU_ISR_install_vector( * called by bsp_start() */ -rtems_status_code +void hppa_external_interrupt_initialize(void) { rtems_isr_entry ignore; @@ -207,8 +203,6 @@ hppa_external_interrupt_initialize(void) /* install the external interrupt handler */ rtems_interrupt_catch((rtems_isr_entry) hppa_external_interrupt, HPPA_INTERRUPT_EXTERNAL_INTERRUPT, &ignore) ; - - return RTEMS_SUCCESSFUL; } /* diff --git a/c/src/exec/score/cpu/hppa1.1/cpu.h b/c/src/exec/score/cpu/hppa1.1/cpu.h index 3d330e09e5..e1f6cbfa48 100644 --- a/c/src/exec/score/cpu/hppa1.1/cpu.h +++ b/c/src/exec/score/cpu/hppa1.1/cpu.h @@ -30,9 +30,9 @@ extern "C" { #endif -#include <rtems/hppa.h> /* pick up machine definitions */ +#include <rtems/core/hppa.h> /* pick up machine definitions */ #ifndef ASM -#include <rtems/hppatypes.h> +#include <rtems/core/hppatypes.h> #endif /* conditional compilation parameters */ diff --git a/c/src/exec/score/cpu/hppa1.1/cpu_asm.s b/c/src/exec/score/cpu/hppa1.1/cpu_asm.s index acb6e589fd..229efed42c 100644 --- a/c/src/exec/score/cpu/hppa1.1/cpu_asm.s +++ b/c/src/exec/score/cpu/hppa1.1/cpu_asm.s @@ -27,11 +27,11 @@ * $Id$ # -#include <rtems/hppa.h> -#include <rtems/cpu_asm.h> -#include <rtems/cpu.h> +#include <rtems/core/hppa.h> +#include <rtems/core/cpu_asm.h> +#include <rtems/core/cpu.h> -#include <offsets.h> +#include <rtems/core/offsets.h> .SPACE $PRIVATE$ .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31 diff --git a/c/src/exec/score/cpu/hppa1.1/rtems.s b/c/src/exec/score/cpu/hppa1.1/rtems.s index 84ffadd856..0e9305644e 100644 --- a/c/src/exec/score/cpu/hppa1.1/rtems.s +++ b/c/src/exec/score/cpu/hppa1.1/rtems.s @@ -15,7 +15,7 @@ */ #include <rtems/hppa.h> -#include <rtems/cpu_asm.h> +#include <rtems/core/cpu_asm.h> .SPACE $PRIVATE$ .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31 diff --git a/c/src/exec/score/cpu/i386/asm.h b/c/src/exec/score/cpu/i386/asm.h index adf92f935a..aac1ba9dbe 100644 --- a/c/src/exec/score/cpu/i386/asm.h +++ b/c/src/exec/score/cpu/i386/asm.h @@ -31,7 +31,7 @@ */ #define ASM -#include <rtems/i386.h> +#include <rtems/core/i386.h> /* * Recent versions of GNU cpp define variables which indicate the diff --git a/c/src/exec/score/cpu/i386/cpu.c b/c/src/exec/score/cpu/i386/cpu.c index d1ceaba88a..446515d6f9 100644 --- a/c/src/exec/score/cpu/i386/cpu.c +++ b/c/src/exec/score/cpu/i386/cpu.c @@ -15,8 +15,8 @@ #include <rtems/system.h> #include <rtems/fatal.h> -#include <rtems/isr.h> -#include <rtems/wkspace.h> +#include <rtems/core/isr.h> +#include <rtems/core/wkspace.h> /* _CPU_Initialize * @@ -36,9 +36,6 @@ void _CPU_Initialize( register unsigned16 fp_status asm ("ax"); register unsigned8 *fp_context; - if ( cpu_table == NULL ) - rtems_fatal_error_occurred( RTEMS_NOT_CONFIGURED ); - _CPU_Table = *cpu_table; /* @@ -69,6 +66,20 @@ void _CPU_Initialize( /*PAGE * + * _CPU_ISR_Get_level + */ + +unsigned32 _CPU_ISR_Get_level( void ) +{ + unsigned32 level; + + i386_get_interrupt_level( level ); + + return level; +} + +/*PAGE + * * _CPU_ISR_install_raw_handler */ diff --git a/c/src/exec/score/cpu/i386/cpu.h b/c/src/exec/score/cpu/i386/cpu.h index 2af0096fc6..f3793cd443 100644 --- a/c/src/exec/score/cpu/i386/cpu.h +++ b/c/src/exec/score/cpu/i386/cpu.h @@ -22,9 +22,9 @@ extern "C" { #endif #ifndef ASM -#include <rtems/i386types.h> +#include <rtems/core/i386types.h> #endif -#include <rtems/i386.h> +#include <rtems/core/i386.h> /* conditional compilation parameters */ @@ -119,9 +119,9 @@ typedef struct { /* variables */ -EXTERN unsigned8 _CPU_Null_fp_context[ CPU_CONTEXT_FP_SIZE ]; -EXTERN void *_CPU_Interrupt_stack_low; -EXTERN void *_CPU_Interrupt_stack_high; +EXTERN Context_Control_fp _CPU_Null_fp_context; +EXTERN void *_CPU_Interrupt_stack_low; +EXTERN void *_CPU_Interrupt_stack_high; /* constants */ @@ -192,6 +192,8 @@ EXTERN void *_CPU_Interrupt_stack_high; else asm volatile ( "sti" ); \ } +unsigned32 _CPU_ISR_Get_level( void ); + /* end of ISR handler macros */ /* diff --git a/c/src/exec/score/cpu/i386/i386.h b/c/src/exec/score/cpu/i386/i386.h index 3ebde48ed3..d43669ba53 100644 --- a/c/src/exec/score/cpu/i386/i386.h +++ b/c/src/exec/score/cpu/i386/i386.h @@ -166,6 +166,18 @@ typedef struct { ); \ } +#define i386_get_interrupt_level( _level ) \ + do { \ + register unsigned32 _eflags = 0; \ + \ + asm volatile ( "push %0 ; \ + popf " \ + : "=r" ((_eflags)) : "0" ((_eflags)) \ + ); \ + \ + _level = (_eflags & 0x0200) ? 0 : 1; \ + } while (0) + /* * The following routine swaps the endian format of an unsigned int. * It must be static so it can be referenced indirectly. diff --git a/c/src/exec/score/cpu/i960/asm.h b/c/src/exec/score/cpu/i960/asm.h index e8fc986402..73a8b3a641 100644 --- a/c/src/exec/score/cpu/i960/asm.h +++ b/c/src/exec/score/cpu/i960/asm.h @@ -31,7 +31,7 @@ */ #define ASM -#include <rtems/i960.h> +#include <rtems/core/i960.h> /* * Recent versions of GNU cpp define variables which indicate the diff --git a/c/src/exec/score/cpu/i960/cpu.c b/c/src/exec/score/cpu/i960/cpu.c index d5acebd225..ec4613c4cf 100644 --- a/c/src/exec/score/cpu/i960/cpu.c +++ b/c/src/exec/score/cpu/i960/cpu.c @@ -21,7 +21,7 @@ #include <rtems/system.h> #include <rtems/fatal.h> -#include <rtems/isr.h> +#include <rtems/core/isr.h> /* _CPU_Initialize * @@ -40,15 +40,26 @@ void _CPU_Initialize( ) { - if ( cpu_table == NULL ) - rtems_fatal_error_occurred( RTEMS_NOT_CONFIGURED ); - _CPU_Table = *cpu_table; } /*PAGE * + * _CPU_ISR_Get_level + */ + +unsigned32 _CPU_ISR_Get_level( void ) +{ + unsigned32 level; + + i960_get_interrupt_level( level ); + + return level; +} + +/*PAGE + * * _CPU_ISR_install_raw_handler */ diff --git a/c/src/exec/score/cpu/i960/cpu.h b/c/src/exec/score/cpu/i960/cpu.h index 4e8e82e9de..3c4cb98ec8 100644 --- a/c/src/exec/score/cpu/i960/cpu.h +++ b/c/src/exec/score/cpu/i960/cpu.h @@ -23,9 +23,9 @@ extern "C" { #pragma align 4 /* for GNU C structure alignment */ -#include <rtems/i960.h> +#include <rtems/core/i960.h> #ifndef ASM -#include <rtems/i960types.h> +#include <rtems/core/i960types.h> #endif #define CPU_INLINE_ENABLE_DISPATCH FALSE @@ -237,6 +237,8 @@ EXTERN void *_CPU_Interrupt_stack_high; ); \ } +unsigned32 _CPU_ISR_Get_level( void ); + /* ISR handler section macros */ /* diff --git a/c/src/exec/score/cpu/i960/i960.h b/c/src/exec/score/cpu/i960/i960.h index 53b99f469a..5112fd58c8 100644 --- a/c/src/exec/score/cpu/i960/i960.h +++ b/c/src/exec/score/cpu/i960/i960.h @@ -169,6 +169,13 @@ typedef struct { : "0" (_mask), "1" ((oldlevel)) ); \ } +#define i960_get_interrupt_level( _level ) \ + { \ + i960_disable_interrupts( _level ); \ + i960_enable_interrupts( _level ); \ + (_level) = ((_level) & 0x1f0000) >> 16; \ + } while ( 0 ) + #define i960_atomic_modify( mask, addr, prev ) \ { register unsigned int _mask = (mask); \ register unsigned int *_addr = (unsigned int *)(addr); \ @@ -199,9 +206,8 @@ typedef struct { #define i960_clear_intr( xint ) \ { register unsigned int _xint=(xint); \ - asm volatile( "loop_til_cleared: - clrbit %0,sf0,sf0 ; \ - bbs %0,sf0,loop_til_cleared" \ +asm volatile( "loop_til_cleared: clrbit %0,sf0,sf0 ; \ + bbs %0,sf0, loop_til_cleared" \ : "=d" (_xint) : "0" (_xint) ); \ } diff --git a/c/src/exec/score/cpu/m68k/asm.h b/c/src/exec/score/cpu/m68k/asm.h index 58bb04bdf9..7a25b6c298 100644 --- a/c/src/exec/score/cpu/m68k/asm.h +++ b/c/src/exec/score/cpu/m68k/asm.h @@ -31,7 +31,7 @@ */ #define ASM -#include <rtems/m68k.h> +#include <rtems/core/m68k.h> /* * Recent versions of GNU cpp define variables which indicate the diff --git a/c/src/exec/score/cpu/m68k/cpu.c b/c/src/exec/score/cpu/m68k/cpu.c index a97698372a..fdba64bffe 100644 --- a/c/src/exec/score/cpu/m68k/cpu.c +++ b/c/src/exec/score/cpu/m68k/cpu.c @@ -14,7 +14,7 @@ #include <rtems/system.h> #include <rtems/fatal.h> -#include <rtems/isr.h> +#include <rtems/core/isr.h> /* _CPU_Initialize * @@ -33,15 +33,26 @@ void _CPU_Initialize( ) { - if ( cpu_table == NULL ) - rtems_fatal_error_occurred( RTEMS_NOT_CONFIGURED ); - _CPU_Table = *cpu_table; } /*PAGE * + * _CPU_ISR_Get_level + */ + +unsigned32 _CPU_ISR_Get_level( void ) +{ + unsigned32 level; + + m68k_get_interrupt_level( level ); + + return level; +} + +/*PAGE + * * _CPU_ISR_install_raw_handler */ diff --git a/c/src/exec/score/cpu/m68k/cpu.h b/c/src/exec/score/cpu/m68k/cpu.h index 566e479f3a..8379d47a00 100644 --- a/c/src/exec/score/cpu/m68k/cpu.h +++ b/c/src/exec/score/cpu/m68k/cpu.h @@ -30,9 +30,9 @@ extern "C" { #define NO_UNINITIALIZED_WARNINGS -#include <rtems/m68k.h> +#include <rtems/core/m68k.h> #ifndef ASM -#include <rtems/m68ktypes.h> +#include <rtems/core/m68ktypes.h> #endif /* conditional compilation parameters */ @@ -222,6 +222,8 @@ EXTERN void *_CPU_Interrupt_stack_high; #define _CPU_ISR_Set_level( _newlevel ) \ m68k_set_interrupt_level( _newlevel ) +unsigned32 _CPU_ISR_Get_level( void ); + /* end of ISR handler macros */ /* diff --git a/c/src/exec/score/cpu/m68k/m68k.h b/c/src/exec/score/cpu/m68k/m68k.h index b86db286cb..a2e0df6a25 100644 --- a/c/src/exec/score/cpu/m68k/m68k.h +++ b/c/src/exec/score/cpu/m68k/m68k.h @@ -196,6 +196,17 @@ extern "C" { ); \ } +#define m68k_get_interrupt_level( _level ) \ + do { \ + register unsigned32 _tmpsr = 0; \ + \ + asm volatile( "movw %%sr,%0" \ + : "=d" (_tmpsr) : "0" (_tmpsr) \ + ); \ + \ + _level = (_tmpsr & 0x0700) >> 8; \ + } while (0) + #define m68k_set_interrupt_level( _newlevel ) \ { \ register unsigned32 _tmpsr = 0; \ diff --git a/c/src/exec/score/cpu/no_cpu/asm.h b/c/src/exec/score/cpu/no_cpu/asm.h index 97464d5b3a..ca0ff95e35 100644 --- a/c/src/exec/score/cpu/no_cpu/asm.h +++ b/c/src/exec/score/cpu/no_cpu/asm.h @@ -31,7 +31,7 @@ */ #define ASM -#include <rtems/no_cpu.h> +#include <rtems/core/no_cpu.h> /* * Recent versions of GNU cpp define variables which indicate the diff --git a/c/src/exec/score/cpu/no_cpu/cpu.c b/c/src/exec/score/cpu/no_cpu/cpu.c index f95c435eae..c7e7cbe693 100644 --- a/c/src/exec/score/cpu/no_cpu/cpu.c +++ b/c/src/exec/score/cpu/no_cpu/cpu.c @@ -15,8 +15,8 @@ #include <rtems/system.h> #include <rtems/fatal.h> -#include <rtems/isr.h> -#include <rtems/wkspace.h> +#include <rtems/core/isr.h> +#include <rtems/core/wkspace.h> /* _CPU_Initialize * @@ -33,9 +33,6 @@ void _CPU_Initialize( void (*thread_dispatch) /* ignored on this CPU */ ) { - if ( cpu_table == NULL ) - rtems_fatal_error_occurred( RTEMS_NOT_CONFIGURED ); - /* * The thread_dispatch argument is the address of the entry point * for the routine called at the end of an ISR once it has been @@ -63,6 +60,18 @@ void _CPU_Initialize( /*PAGE * + * _CPU_ISR_Get_level + */ + +unsigned32 _CPU_ISR_Get_level( void ) +{ + /* + * This routine returns the current interrupt level. + */ +} + +/*PAGE + * * _CPU_ISR_install_raw_handler */ diff --git a/c/src/exec/score/cpu/no_cpu/cpu.h b/c/src/exec/score/cpu/no_cpu/cpu.h index 29a6960ea2..7242ebc041 100644 --- a/c/src/exec/score/cpu/no_cpu/cpu.h +++ b/c/src/exec/score/cpu/no_cpu/cpu.h @@ -21,9 +21,9 @@ extern "C" { #endif -#include <rtems/no_cpu.h> /* pick up machine definitions */ +#include <rtems/core/no_cpu.h> /* pick up machine definitions */ #ifndef ASM -#include <rtems/no_cputypes.h> +#include <rtems/core/no_cputypes.h> #endif /* conditional compilation parameters */ diff --git a/c/src/exec/score/cpu/no_cpu/cpu_asm.c b/c/src/exec/score/cpu/no_cpu/cpu_asm.c index c0cf3b5127..0d7622d15f 100644 --- a/c/src/exec/score/cpu/no_cpu/cpu_asm.c +++ b/c/src/exec/score/cpu/no_cpu/cpu_asm.c @@ -24,7 +24,7 @@ */ #include <rtems/system.h> -#include <rtems/cpu.h> +#include <rtems/core/cpu.h> /* #include "cpu_asm.h> */ /* diff --git a/c/src/exec/score/cpu/no_cpu/cpu_asm.h b/c/src/exec/score/cpu/no_cpu/cpu_asm.h index 0f4154a453..50bc256e06 100644 --- a/c/src/exec/score/cpu/no_cpu/cpu_asm.h +++ b/c/src/exec/score/cpu/no_cpu/cpu_asm.h @@ -21,7 +21,7 @@ /* pull in the generated offsets */ -#include <offsets.h> +#include <rtems/core/offsets.h> /* * Hardware General Registers diff --git a/c/src/exec/score/cpu/no_cpu/rtems.c b/c/src/exec/score/cpu/no_cpu/rtems.c index 5415ae9852..0d15381046 100644 --- a/c/src/exec/score/cpu/no_cpu/rtems.c +++ b/c/src/exec/score/cpu/no_cpu/rtems.c @@ -22,7 +22,7 @@ */ #include <rtems/system.h> -#include <rtems/cpu.h> +#include <rtems/core/cpu.h> /* #include "asm.h> */ /* diff --git a/c/src/exec/score/cpu/powerpc/cpu.c b/c/src/exec/score/cpu/powerpc/cpu.c index ab358a2490..336f1e1aef 100644 --- a/c/src/exec/score/cpu/powerpc/cpu.c +++ b/c/src/exec/score/cpu/powerpc/cpu.c @@ -30,15 +30,17 @@ #include <rtems/system.h> #include <rtems/fatal.h> -#include <rtems/isr.h> -#include <rtems/context.h> -#include <rtems/thread.h> -#include <rtems/wkspace.h> +#include <rtems/core/isr.h> +#include <rtems/core/context.h> +#include <rtems/core/thread.h> +#include <rtems/core/wkspace.h> /* * These are for testing purposes. */ +/* #define Testing +*/ #ifdef Testing static unsigned32 msr; @@ -119,9 +121,6 @@ void _CPU_Initialize( } #endif - if ( cpu_table == NULL ) - rtems_fatal_error_occurred( RTEMS_NOT_CONFIGURED ); - if ( cpu_table->spurious_handler ) handler = (proc_ptr)cpu_table->spurious_handler; @@ -164,9 +163,11 @@ void _CPU_ISR_install_vector( * be used by the _ISR_Handler so the user gets control. */ - _ISR_Vector_table[ vector ] = new_handler ? (rtems_isr_entry)new_handler : - _CPU_Table.spurious_handler ? (rtems_isr_entry)_CPU_Table.spurious_handler : - (rtems_isr_entry)ppc_spurious; + _ISR_Vector_table[ vector ] = + (new_handler) ? (ISR_Handler_entry) new_handler : + ((_CPU_Table.spurious_handler) ? + (ISR_Handler_entry) _CPU_Table.spurious_handler : + (ISR_Handler_entry) ppc_spurious); } /*PAGE diff --git a/c/src/exec/score/cpu/powerpc/cpu.h b/c/src/exec/score/cpu/powerpc/cpu.h index 82cad518e8..fd44f5ee8e 100644 --- a/c/src/exec/score/cpu/powerpc/cpu.h +++ b/c/src/exec/score/cpu/powerpc/cpu.h @@ -37,11 +37,11 @@ extern "C" { #endif -#include <rtems/ppc.h> /* pick up machine definitions */ +#include <rtems/core/ppc.h> /* pick up machine definitions */ #ifndef ASM struct CPU_Interrupt_frame; -#include <rtems/ppctypes.h> +#include <rtems/core/ppctypes.h> #endif /* conditional compilation parameters */ diff --git a/c/src/exec/score/cpu/unix/cpu.c b/c/src/exec/score/cpu/unix/cpu.c index 736b7c4c7f..339bb2a3ce 100644 --- a/c/src/exec/score/cpu/unix/cpu.c +++ b/c/src/exec/score/cpu/unix/cpu.c @@ -17,7 +17,7 @@ */ #include <rtems/system.h> -#include <rtems/isr.h> +#include <rtems/core/isr.h> #include <stdio.h> #include <stdlib.h> @@ -186,6 +186,28 @@ void _CPU_Context_From_CPU_Init() } +/*PAGE + * + * _CPU_ISR_Get_level + */ + +unsigned32 _CPU_ISR_Get_level( void ) +{ + sigset_t sigset; + + sigprocmask( 0, 0, &sigset ); + + /* + * This is an educated guess based on ONLY ONE of the signals we + * disable/enable to mask ISRs. + */ + + if ( sigismember( &sigset, SIGUSR1 ) ) + return 1; + else + return 0; +} + /* _CPU_Initialize * * This routine performs processor dependent initialization. @@ -198,12 +220,9 @@ void _CPU_Context_From_CPU_Init() void _CPU_Initialize( rtems_cpu_table *cpu_table, - void (*thread_dispatch) /* ignored on this CPU */ + void (*thread_dispatch) /* ignored on this CPU */ ) { - if ( cpu_table == NULL ) - _CPU_Fatal_halt( RTEMS_NOT_CONFIGURED ); - /* * The thread_dispatch argument is the address of the entry point * for the routine called at the end of an ISR once it has been diff --git a/c/src/exec/score/cpu/unix/cpu.h b/c/src/exec/score/cpu/unix/cpu.h index ee7239bc89..f0d583651e 100644 --- a/c/src/exec/score/cpu/unix/cpu.h +++ b/c/src/exec/score/cpu/unix/cpu.h @@ -26,9 +26,9 @@ extern "C" { #endif -#include <rtems/unix.h> +#include <rtems/core/unix.h> #ifndef ASM -#include <rtems/unixtypes.h> +#include <rtems/core/unixtypes.h> #endif #if defined(solaris2) @@ -667,6 +667,8 @@ void _CPU_ISR_Enable(unsigned32 level); else _CPU_ISR_Enable( 1 ); \ } +unsigned32 _CPU_ISR_Get_level( void ); + /* end of ISR handler macros */ /* Context handler macros */ |