summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score/cpu
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-05 16:44:02 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-05 16:44:02 +0000
commit458bd343e24cda7169c75f079705979891c9abc1 (patch)
treea9e584c28211674b28d1e37aec005e0e3a25afa1 /c/src/exec/score/cpu
parentEliminated references to stack checker related #defines. (diff)
downloadrtems-458bd343e24cda7169c75f079705979891c9abc1.tar.bz2
This is another pass at making sure that nothing outside the BSP
unnecessarily uses any variables defined by the BSP. On this sweep, use of BSP_Configuration and Cpu_table was eliminated. A significant part of this modification was the addition of macros to access fields in the RTEMS configuration structures. This is necessary to strengthen the division between the BSP independent parts of RTEMS and the BSPs themselves. This started after comments and analysis by Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
Diffstat (limited to 'c/src/exec/score/cpu')
-rw-r--r--c/src/exec/score/cpu/a29k/rtems/score/cpu.h12
-rw-r--r--c/src/exec/score/cpu/hppa1.1/rtems/score/cpu.h15
-rw-r--r--c/src/exec/score/cpu/i386/rtems/score/cpu.h15
-rw-r--r--c/src/exec/score/cpu/i960/rtems/score/cpu.h12
-rw-r--r--c/src/exec/score/cpu/m68k/rtems/score/cpu.h12
-rw-r--r--c/src/exec/score/cpu/mips/rtems/score/cpu.h9
-rw-r--r--c/src/exec/score/cpu/mips64orion/rtems/score/cpu.h9
-rw-r--r--c/src/exec/score/cpu/no_cpu/rtems/score/cpu.h12
-rw-r--r--c/src/exec/score/cpu/powerpc/mpc750/cpu.h15
-rw-r--r--c/src/exec/score/cpu/powerpc/other_cpu/cpu.h54
-rw-r--r--c/src/exec/score/cpu/sh/rtems/score/cpu.h11
-rw-r--r--c/src/exec/score/cpu/sparc/rtems/score/cpu.h11
-rw-r--r--c/src/exec/score/cpu/unix/rtems/score/cpu.h11
13 files changed, 195 insertions, 3 deletions
diff --git a/c/src/exec/score/cpu/a29k/rtems/score/cpu.h b/c/src/exec/score/cpu/a29k/rtems/score/cpu.h
index 9cf2fa6f2f..1235e991c8 100644
--- a/c/src/exec/score/cpu/a29k/rtems/score/cpu.h
+++ b/c/src/exec/score/cpu/a29k/rtems/score/cpu.h
@@ -459,10 +459,20 @@ typedef struct {
unsigned32 idle_task_stack_size;
unsigned32 interrupt_stack_size;
unsigned32 extra_system_initialization_stack;
- unsigned32 some_other_cpu_dependent_info;
} rtems_cpu_table;
/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access AMD A29K specific additions to the CPU Table
+ */
+
+/* There are no CPU specific additions to the CPU Table for this port. */
+
+/*
* This variable is optional. It is used on CPUs on which it is difficult
* to generate an "uninitialized" FP context. It is filled in by
* _CPU_Initialize and copied into the task's FP context area during
diff --git a/c/src/exec/score/cpu/hppa1.1/rtems/score/cpu.h b/c/src/exec/score/cpu/hppa1.1/rtems/score/cpu.h
index 7e810bac52..e5db793923 100644
--- a/c/src/exec/score/cpu/hppa1.1/rtems/score/cpu.h
+++ b/c/src/exec/score/cpu/hppa1.1/rtems/score/cpu.h
@@ -238,6 +238,21 @@ typedef struct {
unsigned32 itimer_clicks_per_microsecond; /* for use by Clock driver */
} rtems_cpu_table;
+/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access HPPA specific additions to the CPU Table
+ */
+
+#define rtems_cpu_configuration_get_spurious_handler() \
+ (_CPU_Table.spurious_handler)
+
+#define rtems_cpu_configuration_get_itimer_clicks_per_microsecond() \
+ (_CPU_Table.itimer_clicks_per_microsecond)
+
/* variables */
SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context;
diff --git a/c/src/exec/score/cpu/i386/rtems/score/cpu.h b/c/src/exec/score/cpu/i386/rtems/score/cpu.h
index 045df2ae72..68fdea703d 100644
--- a/c/src/exec/score/cpu/i386/rtems/score/cpu.h
+++ b/c/src/exec/score/cpu/i386/rtems/score/cpu.h
@@ -198,6 +198,21 @@ typedef struct {
} rtems_cpu_table;
/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access i386 specific additions to the CPU Table
+ */
+
+#define rtems_cpu_configuration_get_interrupt_table_segment() \
+ (_CPU_Table.interrupt_table_segment)
+
+#define rtems_cpu_configuration_get_interrupt_table_offset() \
+ (_CPU_Table.interrupt_table_offset)
+
+/*
* context size area for floating point
*
* NOTE: This is out of place on the i386 to avoid a forward reference.
diff --git a/c/src/exec/score/cpu/i960/rtems/score/cpu.h b/c/src/exec/score/cpu/i960/rtems/score/cpu.h
index 14083d9860..45a7fb85d6 100644
--- a/c/src/exec/score/cpu/i960/rtems/score/cpu.h
+++ b/c/src/exec/score/cpu/i960/rtems/score/cpu.h
@@ -172,6 +172,18 @@ typedef struct {
i960_PRCB *Prcb;
} rtems_cpu_table;
+/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access i960 specific additions to the CPU Table
+ */
+
+#define rtems_cpu_configuration_get_prcb() \
+ (_CPU_Table.Prcb)
+
/* variables */
SCORE_EXTERN void *_CPU_Interrupt_stack_low;
diff --git a/c/src/exec/score/cpu/m68k/rtems/score/cpu.h b/c/src/exec/score/cpu/m68k/rtems/score/cpu.h
index cc51428243..248492ba97 100644
--- a/c/src/exec/score/cpu/m68k/rtems/score/cpu.h
+++ b/c/src/exec/score/cpu/m68k/rtems/score/cpu.h
@@ -195,6 +195,18 @@ typedef struct {
m68k_isr *interrupt_vector_table;
} rtems_cpu_table;
+/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access M68K specific additions to the CPU Table
+ */
+
+#define rtems_cpu_configuration_get_interrupt_vector_table() \
+ (_CPU_Table.interrupt_vector_table)
+
/* variables */
SCORE_EXTERN void *_CPU_Interrupt_stack_low;
diff --git a/c/src/exec/score/cpu/mips/rtems/score/cpu.h b/c/src/exec/score/cpu/mips/rtems/score/cpu.h
index 0722a81ca6..69478af9ee 100644
--- a/c/src/exec/score/cpu/mips/rtems/score/cpu.h
+++ b/c/src/exec/score/cpu/mips/rtems/score/cpu.h
@@ -438,6 +438,15 @@ typedef struct {
unsigned32 clicks_per_microsecond;
} rtems_cpu_table;
+/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access MIPS64ORION specific additions to the CPU Table
+ */
+
#define rtems_cpu_configuration_get_clicks_per_microsecond() \
(_CPU_Table.clicks_per_microsecond)
diff --git a/c/src/exec/score/cpu/mips64orion/rtems/score/cpu.h b/c/src/exec/score/cpu/mips64orion/rtems/score/cpu.h
index 0722a81ca6..69478af9ee 100644
--- a/c/src/exec/score/cpu/mips64orion/rtems/score/cpu.h
+++ b/c/src/exec/score/cpu/mips64orion/rtems/score/cpu.h
@@ -438,6 +438,15 @@ typedef struct {
unsigned32 clicks_per_microsecond;
} rtems_cpu_table;
+/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access MIPS64ORION specific additions to the CPU Table
+ */
+
#define rtems_cpu_configuration_get_clicks_per_microsecond() \
(_CPU_Table.clicks_per_microsecond)
diff --git a/c/src/exec/score/cpu/no_cpu/rtems/score/cpu.h b/c/src/exec/score/cpu/no_cpu/rtems/score/cpu.h
index ea18fe2cf3..9bd8c2b045 100644
--- a/c/src/exec/score/cpu/no_cpu/rtems/score/cpu.h
+++ b/c/src/exec/score/cpu/no_cpu/rtems/score/cpu.h
@@ -360,10 +360,20 @@ typedef struct {
void (*stack_free_hook)( void* );
/* end of fields required on all CPUs */
- unsigned32 some_other_cpu_dependent_info;
} rtems_cpu_table;
/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access NO_CPU specific additions to the CPU Table
+ */
+
+/* There are no CPU specific additions to the CPU Table for this port. */
+
+/*
* This variable is optional. It is used on CPUs on which it is difficult
* to generate an "uninitialized" FP context. It is filled in by
* _CPU_Initialize and copied into the task's FP context area during
diff --git a/c/src/exec/score/cpu/powerpc/mpc750/cpu.h b/c/src/exec/score/cpu/powerpc/mpc750/cpu.h
index 68371d33dd..145e2924eb 100644
--- a/c/src/exec/score/cpu/powerpc/mpc750/cpu.h
+++ b/c/src/exec/score/cpu/powerpc/mpc750/cpu.h
@@ -443,6 +443,21 @@ typedef struct {
} rtems_cpu_table;
/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access PowerPC MPC750 specific additions to the CPU Table
+ */
+
+#define rtems_cpu_configuration_get_clicks_per_usec() \
+ (_CPU_Table.clicks_per_usec)
+
+#define rtems_cpu_configuration_get_exceptions_in_ram() \
+ (_CPU_Table.exceptions_in_RAM)
+
+/*
* This variable is optional. It is used on CPUs on which it is difficult
* to generate an "uninitialized" FP context. It is filled in by
* _CPU_Initialize and copied into the task's FP context area during
diff --git a/c/src/exec/score/cpu/powerpc/other_cpu/cpu.h b/c/src/exec/score/cpu/powerpc/other_cpu/cpu.h
index c126bdf1a1..2a502d0745 100644
--- a/c/src/exec/score/cpu/powerpc/other_cpu/cpu.h
+++ b/c/src/exec/score/cpu/powerpc/other_cpu/cpu.h
@@ -492,6 +492,58 @@ typedef struct {
} rtems_cpu_table;
/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access PowerPC specific additions to the CPU Table
+ */
+
+#define rtems_cpu_configuration_get_clicks_per_usec() \
+ (_CPU_Table.clicks_per_usec)
+
+#define rtems_cpu_configuration_get_spurious_handler() \
+ (_CPU_Table.spurious_handler)
+
+#define rtems_cpu_configuration_get_exceptions_in_ram() \
+ (_CPU_Table.exceptions_in_RAM)
+
+#if (defined(ppc403) || defined(mpc860) || defined(mpc821))
+
+#define rtems_cpu_configuration_get_serial_per_sec() \
+ (_CPU_Table.serial_per_sec)
+
+#define rtems_cpu_configuration_get_serial_external_clock() \
+ (_CPU_Table.serial_external_clock)
+
+#define rtems_cpu_configuration_get_serial_xon_xoff() \
+ (_CPU_Table.serial_xon_xoff)
+
+#define rtems_cpu_configuration_get_serial_cts_rts() \
+ (_CPU_Table.serial_cts_rts)
+
+#define rtems_cpu_configuration_get_serial_rate() \
+ (_CPU_Table.serial_rate)
+
+#define rtems_cpu_configuration_get_timer_average_overhead() \
+ (_CPU_Table.timer_average_overhead)
+
+#define rtems_cpu_configuration_get_timer_least_valid() \
+ (_CPU_Table.timer_least_valid)
+
+#define rtems_cpu_configuration_get_timer_internal_clock() \
+ (_CPU_Table.timer_internal_clock)
+
+#endif
+
+#if (defined(mpc860) || defined(mpc821))
+#define rtems_cpu_configuration_get_clock_speed() \
+ (_CPU_Table.clock_speed)
+#endif
+
+
+/*
* The following type defines an entry in the PPC's trap table.
*
* NOTE: The instructions chosen are RTEMS dependent although one is
@@ -789,7 +841,7 @@ void _CPU_ISR_install_raw_handler(
do { \
unsigned32 start, ticks, now; \
CPU_Get_timebase_low( start ) ; \
- ticks = (_microseconds) * Cpu_table.clicks_per_usec; \
+ ticks = (_microseconds) * _CPU_Table.clicks_per_usec; \
do \
CPU_Get_timebase_low( now ) ; \
while (now - start < ticks); \
diff --git a/c/src/exec/score/cpu/sh/rtems/score/cpu.h b/c/src/exec/score/cpu/sh/rtems/score/cpu.h
index 935cbd4e48..8a18848f09 100644
--- a/c/src/exec/score/cpu/sh/rtems/score/cpu.h
+++ b/c/src/exec/score/cpu/sh/rtems/score/cpu.h
@@ -380,6 +380,17 @@ typedef struct {
} rtems_cpu_table;
/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access SH specific additions to the CPU Table
+ */
+
+/* There are no CPU specific additions to the CPU Table for this port. */
+
+/*
* This variable is optional. It is used on CPUs on which it is difficult
* to generate an "uninitialized" FP context. It is filled in by
* _CPU_Initialize and copied into the task's FP context area during
diff --git a/c/src/exec/score/cpu/sparc/rtems/score/cpu.h b/c/src/exec/score/cpu/sparc/rtems/score/cpu.h
index 5e34126b2f..3442adc67d 100644
--- a/c/src/exec/score/cpu/sparc/rtems/score/cpu.h
+++ b/c/src/exec/score/cpu/sparc/rtems/score/cpu.h
@@ -527,6 +527,17 @@ typedef struct {
} rtems_cpu_table;
/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access SPARC specific additions to the CPU Table
+ */
+
+/* There are no CPU specific additions to the CPU Table for this port. */
+
+/*
* This variable is contains the initialize context for the FP unit.
* It is filled in by _CPU_Initialize and copied into the task's FP
* context area during _CPU_Context_Initialize.
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 466a5dc5c7..96c7522b53 100644
--- a/c/src/exec/score/cpu/unix/rtems/score/cpu.h
+++ b/c/src/exec/score/cpu/unix/rtems/score/cpu.h
@@ -513,6 +513,17 @@ typedef struct {
} rtems_cpu_table;
/*
+ * Macros to access required entires in the CPU Table are in
+ * the file rtems/system.h.
+ */
+
+/*
+ * Macros to access UNIX specific additions to the CPU Table
+ */
+
+/* There are no CPU specific additions to the CPU Table for this port. */
+
+/*
* This variable is optional. It is used on CPUs on which it is difficult
* to generate an "uninitialized" FP context. It is filled in by
* _CPU_Initialize and copied into the task's FP context area during