summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score/cpu/unix
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-06-12 15:00:15 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-06-12 15:00:15 +0000
commitdf49c60c9671e4a28e636964d744c1f59fb6cb68 (patch)
treeeabd85e189514ad412a35414ba5d483dcda3ef1f /c/src/exec/score/cpu/unix
parentPurged as many egcs references as possible. (diff)
downloadrtems-df49c60c9671e4a28e636964d744c1f59fb6cb68.tar.bz2
Merged from 4.5.0-beta3a
Diffstat (limited to 'c/src/exec/score/cpu/unix')
-rw-r--r--c/src/exec/score/cpu/unix/Makefile.am4
-rw-r--r--c/src/exec/score/cpu/unix/cpu.c27
-rw-r--r--c/src/exec/score/cpu/unix/rtems/Makefile.am4
-rw-r--r--c/src/exec/score/cpu/unix/rtems/score/Makefile.am11
-rw-r--r--c/src/exec/score/cpu/unix/rtems/score/cpu.h13
-rw-r--r--c/src/exec/score/cpu/unix/rtems/score/unix.h16
6 files changed, 54 insertions, 21 deletions
diff --git a/c/src/exec/score/cpu/unix/Makefile.am b/c/src/exec/score/cpu/unix/Makefile.am
index e619852a38..3aadc93da0 100644
--- a/c/src/exec/score/cpu/unix/Makefile.am
+++ b/c/src/exec/score/cpu/unix/Makefile.am
@@ -1,6 +1,6 @@
-##
+##
## $Id$
-##
+##
AUTOMAKE_OPTIONS = foreign 1.4
ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
diff --git a/c/src/exec/score/cpu/unix/cpu.c b/c/src/exec/score/cpu/unix/cpu.c
index 7f9f9c8047..96c706451d 100644
--- a/c/src/exec/score/cpu/unix/cpu.c
+++ b/c/src/exec/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,
@@ -275,6 +279,15 @@ void _CPU_Initialize(
)
{
/*
+ * 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
* decided a context switch is necessary. On some compilation
@@ -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/c/src/exec/score/cpu/unix/rtems/Makefile.am b/c/src/exec/score/cpu/unix/rtems/Makefile.am
index 900930a502..ef7df82af7 100644
--- a/c/src/exec/score/cpu/unix/rtems/Makefile.am
+++ b/c/src/exec/score/cpu/unix/rtems/Makefile.am
@@ -1,6 +1,6 @@
-##
+##
## $Id$
-##
+##
AUTOMAKE_OPTIONS = foreign 1.4
diff --git a/c/src/exec/score/cpu/unix/rtems/score/Makefile.am b/c/src/exec/score/cpu/unix/rtems/score/Makefile.am
index 06c1e6e614..52d5d046ef 100644
--- a/c/src/exec/score/cpu/unix/rtems/score/Makefile.am
+++ b/c/src/exec/score/cpu/unix/rtems/score/Makefile.am
@@ -1,6 +1,6 @@
-##
+##
## $Id$
-##
+##
AUTOMAKE_OPTIONS = foreign 1.4
@@ -20,10 +20,9 @@ unixsize.h: $(GENSIZE) cpu.h
CLEANFILES = unixsize.h
-PREINSTALL_FILES = \
-$(PROJECT_INCLUDE)/rtems/score \
-$(STATIC_H_FILES:%.h=$(PROJECT_INCLUDE)/rtems/score/%.h) \
-$(GENERIC_H_FILES:%.h=$(PROJECT_INCLUDE)/rtems/score/%.h)
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score \
+ $(STATIC_H_FILES:%.h=$(PROJECT_INCLUDE)/rtems/score/%.h) \
+ $(GENERIC_H_FILES:%.h=$(PROJECT_INCLUDE)/rtems/score/%.h)
$(PROJECT_INCLUDE)/rtems/score:
$(mkinstalldirs) $@
diff --git a/c/src/exec/score/cpu/unix/rtems/score/cpu.h b/c/src/exec/score/cpu/unix/rtems/score/cpu.h
index 75eb07af74..698d900515 100644
--- a/c/src/exec/score/cpu/unix/rtems/score/cpu.h
+++ b/c/src/exec/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/c/src/exec/score/cpu/unix/rtems/score/unix.h b/c/src/exec/score/cpu/unix/rtems/score/unix.h
index 26ef8ca4e4..e8a0c7bdd6 100644
--- a/c/src/exec/score/cpu/unix/rtems/score/unix.h
+++ b/c/src/exec/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__)