From df49c60c9671e4a28e636964d744c1f59fb6cb68 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 12 Jun 2000 15:00:15 +0000 Subject: Merged from 4.5.0-beta3a --- cpukit/score/cpu/unix/Makefile.am | 4 ++-- cpukit/score/cpu/unix/cpu.c | 27 +++++++++++++++++++++------ cpukit/score/cpu/unix/rtems/score/cpu.h | 13 ++++++++++++- cpukit/score/cpu/unix/rtems/score/unix.h | 16 ++++++++++++---- 4 files changed, 47 insertions(+), 13 deletions(-) (limited to 'cpukit/score/cpu/unix') diff --git a/cpukit/score/cpu/unix/Makefile.am b/cpukit/score/cpu/unix/Makefile.am index e619852a38..3aadc93da0 100644 --- a/cpukit/score/cpu/unix/Makefile.am +++ b/cpukit/score/cpu/unix/Makefile.am @@ -1,6 +1,6 @@ -## +## ## $Id$ -## +## AUTOMAKE_OPTIONS = foreign 1.4 ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal diff --git a/cpukit/score/cpu/unix/cpu.c b/cpukit/score/cpu/unix/cpu.c index 7f9f9c8047..96c706451d 100644 --- a/cpukit/score/cpu/unix/cpu.c +++ b/cpukit/score/cpu/unix/cpu.c @@ -42,7 +42,7 @@ typedef struct { jmp_buf regs; - int isr_level; + int isr_level; } Context_Control_overlay; void _CPU_Signal_initialize(void); @@ -99,7 +99,9 @@ void _CPU_ISR_From_CPU_Init() (void) sigfillset(&_CPU_Signal_mask); (void) sigdelset(&_CPU_Signal_mask, SIGTRAP); (void) sigdelset(&_CPU_Signal_mask, SIGABRT); +#if !defined(__CYGWIN__) (void) sigdelset(&_CPU_Signal_mask, SIGIOT); +#endif (void) sigdelset(&_CPU_Signal_mask, SIGCONT); (void) sigdelset(&_CPU_Signal_mask, SIGSEGV); (void) sigdelset(&_CPU_Signal_mask, SIGBUS); @@ -198,7 +200,9 @@ void _CPU_Context_From_CPU_Init() * get default values to use in _CPU_Context_Initialize() */ - + if ( sizeof(Context_Control_overlay) < sizeof(Context_Control) ) + _CPU_Fatal_halt( 0xdeadfood ); + (void) memset( &_CPU_Context_Default_with_ISRs_enabled, 0, @@ -274,6 +278,15 @@ void _CPU_Initialize( void (*thread_dispatch) /* ignored on this CPU */ ) { + /* + * If something happened where the public Context_Control is not + * at least as large as the private Context_Control_overlay, then + * we are in trouble. + */ + + if ( sizeof(Context_Control_overlay) > sizeof(Context_Control) ) + _CPU_Fatal_error(0x100 + 1); + /* * 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 @@ -482,11 +495,11 @@ void _CPU_Context_Initialize( */ if ( _new_level == 0 ) - *_the_context = *(Context_Control *) - &_CPU_Context_Default_with_ISRs_enabled; + *(Context_Control_overlay *)_the_context = + _CPU_Context_Default_with_ISRs_enabled; else - *_the_context = *(Context_Control *) - &_CPU_Context_Default_with_ISRs_disabled; + *(Context_Control_overlay *)_the_context = + _CPU_Context_Default_with_ISRs_disabled; addr = (unsigned32 *)_the_context; @@ -806,7 +819,9 @@ void _CPU_Stray_signal(int sig_num) case SIGBUS: case SIGSEGV: case SIGTERM: +#if !defined(__CYGWIN__) case SIGIOT: +#endif _CPU_Fatal_error(0x100 + sig_num); } } diff --git a/cpukit/score/cpu/unix/rtems/score/cpu.h b/cpukit/score/cpu/unix/rtems/score/cpu.h index 75eb07af74..698d900515 100644 --- a/cpukit/score/cpu/unix/rtems/score/cpu.h +++ b/cpukit/score/cpu/unix/rtems/score/cpu.h @@ -378,7 +378,7 @@ extern "C" { #endif /* - * For Linux 1.1 + * For i386 targets */ #ifdef RTEMS_UNIXLIB @@ -389,7 +389,18 @@ extern "C" { #define ESP_OFF 3 #define ESI_OFF 4 #define EDI_OFF 5 +#elif defined(__CYGWIN__) +#define EAX_OFF 0 +#define EBX_OFF 1 +#define ECX_OFF 2 +#define EDX_OFF 3 +#define ESI_OFF 4 +#define EDI_OFF 5 +#define EBP_OFF 6 +#define ESP_OFF 7 +#define RET_OFF 8 #else +/* Linux */ #define EBX_OFF 0 #define ESI_OFF 1 #define EDI_OFF 2 diff --git a/cpukit/score/cpu/unix/rtems/score/unix.h b/cpukit/score/cpu/unix/rtems/score/unix.h index 26ef8ca4e4..e8a0c7bdd6 100644 --- a/cpukit/score/cpu/unix/rtems/score/unix.h +++ b/cpukit/score/cpu/unix/rtems/score/unix.h @@ -29,7 +29,15 @@ extern "C" { * of the family. */ -#if defined(hpux) +#if defined(rtems_multilib) +/* + * Figure out all CPU Model Feature Flags based upon compiler + * predefines. + */ + +#define CPU_MODEL_NAME "rtems_multilib" + +#elif defined(hpux) #define CPU_MODEL_NAME "HP-UX" @@ -37,13 +45,13 @@ extern "C" { #define CPU_MODEL_NAME "Solaris" -#elif defined(__linux__) +#elif defined(__linux__) || defined(linux) #define CPU_MODEL_NAME "Linux" -#elif defined(linux) +#elif defined(__CYGWIN__) -#define CPU_MODEL_NAME "Linux" +#define CPU_MODEL_NAME "Cygwin" #elif defined(__FreeBSD__) -- cgit v1.2.3