summaryrefslogtreecommitdiffstats
path: root/c/src
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
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')
-rw-r--r--c/src/exec/libcsupport/src/malloc.c3
-rw-r--r--c/src/exec/sapi/include/confdefs.h2
-rw-r--r--c/src/exec/sapi/include/rtems/config.h3
-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
-rw-r--r--c/src/exec/score/include/rtems/system.h40
-rw-r--r--c/src/lib/libc/malloc.c3
-rw-r--r--c/src/lib/libcpu/hppa1.1/clock/clock.c4
-rw-r--r--c/src/lib/libcpu/powerpc/mpc821/clock/clock.c4
-rw-r--r--c/src/lib/libcpu/powerpc/mpc821/console-generic/console-generic.c5
-rw-r--r--c/src/lib/libcpu/powerpc/mpc821/timer/timer.c6
-rw-r--r--c/src/lib/libcpu/powerpc/mpc860/clock/clock.c4
-rw-r--r--c/src/lib/libcpu/powerpc/mpc860/console-generic/console-generic.c5
-rw-r--r--c/src/lib/libcpu/powerpc/mpc860/timer/timer.c6
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/clock/clock.c6
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/console/console.c9
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled11
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c6
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/timer/timer.c6
-rw-r--r--c/src/lib/libcpu/powerpc/shared/cpu.h2
-rw-r--r--c/src/libmisc/cpuuse/cpuuse.c2
-rw-r--r--c/src/libmisc/monitor/mon-command.c3
-rw-r--r--c/src/libmisc/stackchk/check.c7
-rw-r--r--c/src/tests/psxtests/psx07/init.c4
-rw-r--r--c/src/tests/sptests/sp09/screen03.c12
-rw-r--r--c/src/tests/sptests/sp13/task1.c2
-rw-r--r--c/src/tests/sptests/spfatal/fatal.c5
-rw-r--r--c/src/tests/sptests/spfatal/system.h2
-rw-r--r--c/src/tests/support/include/tmacros.h2
-rw-r--r--c/src/tests/tmtests/tmoverhd/testtask.c2
41 files changed, 282 insertions, 82 deletions
diff --git a/c/src/exec/libcsupport/src/malloc.c b/c/src/exec/libcsupport/src/malloc.c
index 30f74c89bb..80708f57c2 100644
--- a/c/src/exec/libcsupport/src/malloc.c
+++ b/c/src/exec/libcsupport/src/malloc.c
@@ -32,7 +32,6 @@
rtems_id RTEMS_Malloc_Heap;
size_t RTEMS_Malloc_Sbrk_amount;
-extern rtems_cpu_table Cpu_table;
#ifdef RTEMS_DEBUG
#define MALLOC_STATS
#define MALLOC_DIRTY
@@ -109,7 +108,7 @@ void RTEMS_Malloc_Initialize(
* left over from another process. This would be a security violation.
*/
- if ( Cpu_table.do_zero_of_workspace )
+ if ( rtems_cpu_configuration_get_do_zero_of_workspace() )
memset( starting_address, 0, length );
/*
diff --git a/c/src/exec/sapi/include/confdefs.h b/c/src/exec/sapi/include/confdefs.h
index b841d568de..e2a0c84d3d 100644
--- a/c/src/exec/sapi/include/confdefs.h
+++ b/c/src/exec/sapi/include/confdefs.h
@@ -80,6 +80,8 @@ int rtems_filesystem_mount_table_size = 1;
/*
* Stack Checker Requirements
+ *
+ * NOTE: This does not automatically enable reporting at program exit.
*/
#ifdef STACK_CHECKER_ON
diff --git a/c/src/exec/sapi/include/rtems/config.h b/c/src/exec/sapi/include/rtems/config.h
index 8a2def6082..7dbc997ff9 100644
--- a/c/src/exec/sapi/include/rtems/config.h
+++ b/c/src/exec/sapi/include/rtems/config.h
@@ -121,6 +121,9 @@ SAPI_EXTERN rtems_multiprocessing_table *_Configuration_MP_table;
* or the exact format of the configuration table.
*/
+#define rtems_configuration_get_table() \
+ (&_Configuration_Table)
+
#define rtems_configuration_get_work_space_start() \
(_Configuration_Table->work_space_start)
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
diff --git a/c/src/exec/score/include/rtems/system.h b/c/src/exec/score/include/rtems/system.h
index 5e1cc80ed5..4d7f550141 100644
--- a/c/src/exec/score/include/rtems/system.h
+++ b/c/src/exec/score/include/rtems/system.h
@@ -140,6 +140,46 @@ extern const char _Copyright_Notice[]; /* RTEMS copyright string */
SCORE_EXTERN rtems_cpu_table _CPU_Table; /* CPU dependent info */
/*
+ * Macros to access CPU Table fields required by ALL ports.
+ *
+ * NOTE: Similar macros to access port specific fields in in the
+ * appropriate cpu.h file.
+ */
+
+#define rtems_cpu_configuration_get_table() \
+ (&_CPU_Table)
+
+#define rtems_cpu_configuration_get_pretasking_hook() \
+ (_CPU_Table.pretasking_hook)
+
+#define rtems_cpu_configuration_get_predriver_hook() \
+ (_CPU_Table.predriver_hook)
+
+#define rtems_cpu_configuration_get_postdriver_hook() \
+ (_CPU_Table.postdriver_hook)
+
+#define rtems_cpu_configuration_get_idle_task() \
+ (_CPU_Table.idle_task)
+
+#define rtems_cpu_configuration_get_do_zero_of_workspace() \
+ (_CPU_Table.do_zero_of_workspace)
+
+#define rtems_cpu_configuration_get_idle_task_stack_size() \
+ (_CPU_Table.idle_task_stack_size)
+
+#define rtems_cpu_configuration_get_interrupt_stack_size() \
+ (_CPU_Table.interrupt_stack_size)
+
+#define rtems_cpu_configuration_get_extra_mpci_receive_server_stack() \
+ (_CPU_Table.extra_mpci_receive_server_stack)
+
+#define rtems_cpu_configuration_get_stack_allocate_hook() \
+ (_CPU_Table.stack_allocate_hook)
+
+#define rtems_cpu_configuration_get_stack_free_hook() \
+ (_CPU_Table.stack_free_hook)
+
+/*
* XXX weird RTEMS stuff
*/
diff --git a/c/src/lib/libc/malloc.c b/c/src/lib/libc/malloc.c
index 30f74c89bb..80708f57c2 100644
--- a/c/src/lib/libc/malloc.c
+++ b/c/src/lib/libc/malloc.c
@@ -32,7 +32,6 @@
rtems_id RTEMS_Malloc_Heap;
size_t RTEMS_Malloc_Sbrk_amount;
-extern rtems_cpu_table Cpu_table;
#ifdef RTEMS_DEBUG
#define MALLOC_STATS
#define MALLOC_DIRTY
@@ -109,7 +108,7 @@ void RTEMS_Malloc_Initialize(
* left over from another process. This would be a security violation.
*/
- if ( Cpu_table.do_zero_of_workspace )
+ if ( rtems_cpu_configuration_get_do_zero_of_workspace() )
memset( starting_address, 0, length );
/*
diff --git a/c/src/lib/libcpu/hppa1.1/clock/clock.c b/c/src/lib/libcpu/hppa1.1/clock/clock.c
index a0588e57fd..99d0a69125 100644
--- a/c/src/lib/libcpu/hppa1.1/clock/clock.c
+++ b/c/src/lib/libcpu/hppa1.1/clock/clock.c
@@ -22,8 +22,6 @@ rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int);
#include <stdlib.h> /* for atexit() */
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
typedef unsigned long long hppa_click_count_t;
/*
@@ -207,7 +205,7 @@ Clock_delay(rtems_unsigned32 microseconds)
(void) Clock_read_itimer();
future_time = Clock_clicks +
((rtems_unsigned64) microseconds) *
- Cpu_table.itimer_clicks_per_microsecond;
+ rtems_cpu_configuration_get_itimer_clicks_per_microsecond();
for (;;)
{
diff --git a/c/src/lib/libcpu/powerpc/mpc821/clock/clock.c b/c/src/lib/libcpu/powerpc/mpc821/clock/clock.c
index ce27c426a9..a41bde3de5 100644
--- a/c/src/lib/libcpu/powerpc/mpc821/clock/clock.c
+++ b/c/src/lib/libcpu/powerpc/mpc821/clock/clock.c
@@ -42,8 +42,6 @@
#include <stdlib.h> /* for atexit() */
#include <mpc821.h>
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
volatile rtems_unsigned32 Clock_driver_ticks;
extern volatile m821_t m821;
@@ -74,7 +72,7 @@ void Install_clock(rtems_isr_entry clock_isr)
Clock_driver_ticks = 0;
pit_value = rtems_configuration_get_microseconds_per_tick() /
- Cpu_table.clicks_per_usec;
+ rtems_cpu_configuration_get_clicks_per_usec();
if (pit_value == 0) {
pit_value = 0xffff;
} else {
diff --git a/c/src/lib/libcpu/powerpc/mpc821/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc821/console-generic/console-generic.c
index 4b6a3a308b..dbf978bb4d 100644
--- a/c/src/lib/libcpu/powerpc/mpc821/console-generic/console-generic.c
+++ b/c/src/lib/libcpu/powerpc/mpc821/console-generic/console-generic.c
@@ -51,8 +51,6 @@
#define NIFACES 4 /* number of console devices (serial ports) */
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
static Buf_t *rxBufList[NIFACES];
static Buf_t *rxBufListTail[NIFACES];
@@ -87,7 +85,8 @@ m821_get_brg_cd (int baud)
int divisor;
int div16 = 0;
- divisor = ((Cpu_table.clock_speed / 16) + (baud / 2)) / baud;
+ divisor = ((rtems_cpu_configuration_get_clock_speed() / 16) +
+ (baud / 2)) / baud;
if (divisor > 4096) {
div16 = 1;
divisor = (divisor + 8) / 16;
diff --git a/c/src/lib/libcpu/powerpc/mpc821/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc821/timer/timer.c
index d9c42e9565..4ad3b2fb2e 100644
--- a/c/src/lib/libcpu/powerpc/mpc821/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/mpc821/timer/timer.c
@@ -46,8 +46,6 @@
#include <rtems.h>
#include <mpc821.h>
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
static volatile rtems_unsigned32 Timer_starting;
static rtems_boolean Timer_driver_Find_average_overhead;
@@ -85,10 +83,10 @@ int Read_timer(void)
return total; /* in XXX microsecond units */
else {
- if ( total < Cpu_table.timer_least_valid ) {
+ if ( total < rtems_cpu_configuration_get_timer_least_valid() ) {
return 0; /* below timer resolution */
}
- return (total - Cpu_table.timer_average_overhead);
+ return (total - rtems_cpu_configuration_get_timer_average_overhead());
}
}
diff --git a/c/src/lib/libcpu/powerpc/mpc860/clock/clock.c b/c/src/lib/libcpu/powerpc/mpc860/clock/clock.c
index 452b939a6d..2d01d786b2 100644
--- a/c/src/lib/libcpu/powerpc/mpc860/clock/clock.c
+++ b/c/src/lib/libcpu/powerpc/mpc860/clock/clock.c
@@ -43,8 +43,6 @@
#include <stdlib.h> /* for atexit() */
#include <mpc860.h>
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
volatile rtems_unsigned32 Clock_driver_ticks;
extern volatile m860_t m860;
@@ -75,7 +73,7 @@ void Install_clock(rtems_isr_entry clock_isr)
Clock_driver_ticks = 0;
pit_value = rtems_configuration_get_microseconds_per_tick() /
- Cpu_table.clicks_per_usec;
+ rtems_cpu_configuration_get_clicks_per_usec();
if (pit_value == 0) {
pit_value = 0xffff;
} else {
diff --git a/c/src/lib/libcpu/powerpc/mpc860/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc860/console-generic/console-generic.c
index 604bb8734a..c713f9ebdc 100644
--- a/c/src/lib/libcpu/powerpc/mpc860/console-generic/console-generic.c
+++ b/c/src/lib/libcpu/powerpc/mpc860/console-generic/console-generic.c
@@ -54,8 +54,6 @@
#define NIFACES 6 /* number of console devices (serial ports) */
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
static Buf_t *rxBufList[NIFACES];
static Buf_t *rxBufListTail[NIFACES];
@@ -90,7 +88,8 @@ m860_get_brg_cd (int baud)
int divisor;
int div16 = 0;
- divisor = ((Cpu_table.clock_speed / 16) + (baud / 2)) / baud;
+ divisor = ((rtems_cpu_configuration_get_clock_speed() / 16) +
+ (baud / 2)) / baud;
if (divisor > 4096) {
div16 = 1;
divisor = (divisor + 8) / 16;
diff --git a/c/src/lib/libcpu/powerpc/mpc860/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc860/timer/timer.c
index 732ab565a7..6cfb6fdcbf 100644
--- a/c/src/lib/libcpu/powerpc/mpc860/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/mpc860/timer/timer.c
@@ -46,8 +46,6 @@
#include <rtems.h>
#include <mpc860.h>
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
static volatile rtems_unsigned32 Timer_starting;
static rtems_boolean Timer_driver_Find_average_overhead;
@@ -85,10 +83,10 @@ int Read_timer(void)
return total; /* in XXX microsecond units */
else {
- if ( total < Cpu_table.timer_least_valid ) {
+ if ( total < rtems_cpu_configuration_get_timer_least_valid() ) {
return 0; /* below timer resolution */
}
- return (total - Cpu_table.timer_average_overhead);
+ return (total - rtems_cpu_configuration_get_timer_average_overhead());
}
}
diff --git a/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c b/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
index dfcbea5535..dc019d6b7e 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
+++ b/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
@@ -43,8 +43,6 @@
#include <stdlib.h> /* for atexit() */
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
volatile rtems_unsigned32 Clock_driver_ticks;
static rtems_unsigned32 pit_value, tick_time;
static rtems_boolean auto_restart;
@@ -140,7 +138,7 @@ void Install_clock(rtems_isr_entry clock_isr)
asm volatile ("mfdcr %0, 0xa0" : "=r" (iocr)); /* IOCR */
- if (Cpu_table.timer_internal_clock) {
+ if (rtems_cpu_configuration_get_timer_internal_clock()) {
iocr &= ~4; /* timer clocked from system clock */
}
else {
@@ -165,7 +163,7 @@ void Install_clock(rtems_isr_entry clock_isr)
auto_restart = 1;
pit_value = rtems_configuration_get_microseconds_per_tick() *
- Cpu_table.clicks_per_usec;
+ rtems_cpu_configuration_get_clicks_per_usec();
if ( rtems_configuration_get_ticks_per_timeslice() ) {
register rtems_unsigned32 tcr;
diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console.c b/c/src/lib/libcpu/powerpc/ppc403/console/console.c
index b1fc7bfe9c..11177c8a42 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/console/console.c
+++ b/c/src/lib/libcpu/powerpc/ppc403/console/console.c
@@ -60,7 +60,6 @@
#include <rtems/libio.h>
#include "../ictrl/ictrl.h"
#include <stdlib.h> /* for atexit() */
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
struct async {
/*---------------------------------------------------------------------------+
@@ -215,7 +214,7 @@ void
spiBaudSet(unsigned32 baudrate)
{
unsigned32 tmp;
- tmp = Cpu_table.serial_per_sec / baudrate;
+ tmp = rtems_cpu_configuration_get_serial_per_sec() / baudrate;
tmp = ((tmp) >> 4) - 1;
port->BRDL = tmp & 0xff;
port->BRDH = tmp >> 8;
@@ -314,7 +313,7 @@ spiDeInit(void)
*/
/* set up baud rate to original state */
- spiBaudSet(Cpu_table.serial_rate);
+ spiBaudSet(rtems_cpu_configuration_get_serial_rate());
/* clear any receive (error) status */
port->SPLS = (LSRDataReady | LSRFramingError | LSROverrunError |
@@ -356,7 +355,7 @@ spiInitialize(void)
asm volatile ("mfdcr %0, 0xa0" : "=r" (tmp)); /* IOCR */
tmp &= ~3;
- tmp |= (Cpu_table.serial_external_clock ? 2 : 0) | 1;
+ tmp |= (rtems_cpu_configuration_get_serial_external_clock() ? 2 : 0) | 1;
asm volatile ("mtdcr 0xa0, %0" : "=r" (tmp) : "0" (tmp)); /* IOCR */
@@ -365,7 +364,7 @@ spiInitialize(void)
LSRParityError | LSRBreakInterrupt);
/* set up baud rate */
- spiBaudSet(Cpu_table.serial_rate);
+ spiBaudSet(rtems_cpu_configuration_get_serial_rate());
/* set up port control: DTR/RTS active,8 bit,1 stop,no parity */
port->SPCTL = (CRNormal |
diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled b/c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled
index e5d3b6fbce..976b5f975c 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled
+++ b/c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled
@@ -34,8 +34,6 @@
#include <rtems.h>
#include <rtems/libio.h>
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
struct async {
/*-----------------------------------------------------------------------------+
| Line Status Register.
@@ -147,12 +145,13 @@ rtems_device_driver console_initialize(
/* Initialise the serial port */
asm volatile ("mfdcr %0, 0xa0" : "=r" (tmp)); /* IOCR */
tmp &= ~3;
- tmp |= (Cpu_table.serial_external_clock ? 2 : 0) |
- (Cpu_table.serial_cts_rts ? 1 : 0);
+ tmp |= (rtems_cpu_configuration_get_serial_external_clock() ? 2 : 0) |
+ (rtems_cpu_configuration_get_serial_cts_rts() ? 1 : 0);
asm volatile ("mtdcr 0xa0, %0" : "=r" (tmp) : "0" (tmp)); /* IOCR */
port->SPLS = (LSRDataReady | LSRFramingError | LSROverrunError |
LSRParityError | LSRBreakInterrupt);
- tmp = Cpu_table.serial_per_sec / Cpu_table.serial_rate;
+ tmp = rtems_cpu_configuration_get_serial_per_sec() /
+ rtems_cpu_configuration_get_serial_rate();
#if 0 /* replaced by IMD... */
tmp = ((tmp + 8) >> 4) - 1;
port->BRDL = tmp & 0x255;
@@ -278,7 +277,7 @@ void outbyte(
break;
}
- if (Cpu_table.serial_xon_xoff)
+ if (rtems_cpu_configuration_get_serial_xon_xoff())
while (is_character_ready(&status))
{
if (status == XOFFchar)
diff --git a/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c b/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c
index 8f808d432d..6ba3947bc8 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c
+++ b/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c
@@ -108,7 +108,7 @@ disable_ext_irq( unsigned32 mask)
* this function is called, when a external interrupt is present and
* enabled but there is no handler installed. It will clear
* the corresponding enable bits and call the spurious handler
- * present in the _CPU_Table, if any.
+ * present in the CPU Configuration Table, if any.
*
*/
void
@@ -125,8 +125,8 @@ ictrl_spurious_handler(unsigned32 spurious_mask,
printf("spurious external interrupt: %d at pc 0x%x; disabling\n",
vector, cpu_frame->Interrupt.pcoqfront);
#endif
- if (_CPU_Table.spurious_handler) {
- _CPU_Table.spurious_handler(v + PPC_IRQ_EXT_BASE,cpu_frame);
+ if (rtems_cpu_configuration_get_spurious_handler()) {
+ rtems_cpu_configuration_get_spurious_handler()(v + PPC_IRQ_EXT_BASE,cpu_frame);
}
}
}
diff --git a/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c b/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
index 0ff48aec90..a45f2b396f 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
@@ -36,8 +36,6 @@
#include <rtems.h>
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
static volatile rtems_unsigned32 Timer_starting;
static rtems_boolean Timer_driver_Find_average_overhead;
@@ -78,9 +76,9 @@ int Read_timer()
return total; /* in XXX microsecond units */
else {
- if ( total < Cpu_table.timer_least_valid )
+ if ( total < rtems_cpu_configuration_get_timer_least_valid() )
return 0; /* below timer resolution */
- return (total - Cpu_table.timer_average_overhead);
+ return (total - rtems_cpu_configuration_get_timer_average_overhead());
}
}
diff --git a/c/src/lib/libcpu/powerpc/shared/cpu.h b/c/src/lib/libcpu/powerpc/shared/cpu.h
index 4cfb9e3ef6..8b886ffc2d 100644
--- a/c/src/lib/libcpu/powerpc/shared/cpu.h
+++ b/c/src/lib/libcpu/powerpc/shared/cpu.h
@@ -247,7 +247,7 @@ n:
do { \
unsigned32 start, ticks, now; \
CPU_Get_timebase_low( start ) ; \
- ticks = (_microseconds) * Cpu_table.clicks_per_usec; \
+ ticks = (_microseconds) * rtems_cpu_configuration_get_clicks_per_usec(); \
do \
CPU_Get_timebase_low( now ) ; \
while (now - start < ticks); \
diff --git a/c/src/libmisc/cpuuse/cpuuse.c b/c/src/libmisc/cpuuse/cpuuse.c
index be2bc1be87..e451318575 100644
--- a/c/src/libmisc/cpuuse/cpuuse.c
+++ b/c/src/libmisc/cpuuse/cpuuse.c
@@ -15,8 +15,6 @@
#include <rtems.h>
-extern rtems_configuration_table BSP_Configuration;
-
#include <assert.h>
#include <stdio.h>
#include <string.h>
diff --git a/c/src/libmisc/monitor/mon-command.c b/c/src/libmisc/monitor/mon-command.c
index 1fe495e0ae..5c733b60d9 100644
--- a/c/src/libmisc/monitor/mon-command.c
+++ b/c/src/libmisc/monitor/mon-command.c
@@ -50,14 +50,13 @@ rtems_monitor_command_read(char *command,
int *argc,
char **argv)
{
- extern rtems_configuration_table BSP_Configuration;
static char monitor_prompt[32];
/*
* put node number in the prompt if we are multiprocessing
*/
- if (BSP_Configuration.User_multiprocessing_table == 0)
+ if (!rtems_configuration_get_user_multiprocessing_table())
sprintf(monitor_prompt, "%s", MONITOR_PROMPT);
else if (rtems_monitor_default_node != rtems_monitor_node)
sprintf(monitor_prompt, "%d-%s-%d", rtems_monitor_node, MONITOR_PROMPT, rtems_monitor_default_node);
diff --git a/c/src/libmisc/stackchk/check.c b/c/src/libmisc/stackchk/check.c
index ac688c2a2e..b8688d3579 100644
--- a/c/src/libmisc/stackchk/check.c
+++ b/c/src/libmisc/stackchk/check.c
@@ -32,9 +32,6 @@
*/
#define DONT_USE_FATAL_EXTENSION
-
-extern rtems_configuration_table BSP_Configuration;
-
#include <assert.h>
#include <stdio.h>
#include <string.h>
@@ -318,11 +315,11 @@ void Stack_check_report_blown_task(void)
);
fflush(stderr);
- if (BSP_Configuration.User_multiprocessing_table)
+ if (rtems_configuration_get_user_multiprocessing_table())
fprintf(
stderr,
"; node=%d\n",
- BSP_Configuration.User_multiprocessing_table->node
+ rtems_configuration_get_user_multiprocessing_table()->node
);
else
fprintf(stderr, "\n");
diff --git a/c/src/tests/psxtests/psx07/init.c b/c/src/tests/psxtests/psx07/init.c
index f4da65213a..ba769f70b4 100644
--- a/c/src/tests/psxtests/psx07/init.c
+++ b/c/src/tests/psxtests/psx07/init.c
@@ -33,8 +33,6 @@ void print_schedparam(
#endif
}
-extern rtems_configuration_table BSP_Configuration;
-
void *POSIX_Init(
void *argument
)
@@ -107,7 +105,7 @@ void *POSIX_Init(
status = pthread_attr_init( &attr );
assert( !status );
- attr.stacksize = BSP_Configuration.work_space_size * 10;
+ attr.stacksize = rtems_configuration_get_work_space_size() * 10;
puts( "Init: pthread_create - EAGAIN (stacksize too large)" );
status = pthread_create( &Task_id, &attr, Task_1, NULL );
assert( status == EAGAIN );
diff --git a/c/src/tests/sptests/sp09/screen03.c b/c/src/tests/sptests/sp09/screen03.c
index fb99c5c16f..040ba7e3eb 100644
--- a/c/src/tests/sptests/sp09/screen03.c
+++ b/c/src/tests/sptests/sp09/screen03.c
@@ -19,9 +19,6 @@
#include "system.h"
-extern rtems_configuration_table BSP_Configuration;
-extern rtems_cpu_table _CPU_Table;
-
void Screen3()
{
rtems_name task_name;
@@ -48,16 +45,13 @@ void Screen3()
* skip the test that tries to allocate a stack that is too big.
*/
- if (_CPU_Table.stack_allocate_hook)
- {
+ if (rtems_cpu_configuration_get_stack_allocate_hook()) {
puts( "TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED -- SKIPPED" );
- }
- else
- {
+ } else {
status = rtems_task_create(
task_name,
1,
- BSP_Configuration.work_space_size,
+ rtems_configuration_get_work_space_size(),
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Junk_id
diff --git a/c/src/tests/sptests/sp13/task1.c b/c/src/tests/sptests/sp13/task1.c
index 3ac0c398eb..77e575e21a 100644
--- a/c/src/tests/sptests/sp13/task1.c
+++ b/c/src/tests/sptests/sp13/task1.c
@@ -21,8 +21,6 @@
#include "system.h"
#include <string.h> /* for memcmp */
-extern rtems_configuration_table BSP_Configuration;
-
char big_send_buffer[2048];
char big_receive_buffer[2048];
diff --git a/c/src/tests/sptests/spfatal/fatal.c b/c/src/tests/sptests/spfatal/fatal.c
index aef4a159de..c89105a826 100644
--- a/c/src/tests/sptests/spfatal/fatal.c
+++ b/c/src/tests/sptests/spfatal/fatal.c
@@ -103,7 +103,7 @@ void Process_case()
{
switch ( Case_in_switch ) {
case FATAL_WORKSPACE_OF_ZERO:
- New_Configuration = BSP_Configuration;
+ New_Configuration = rtems_configuration_get_table();
New_Configuration.work_space_start = NULL;
Case_in_switch = FATAL_NULL_WORKSPACE;
break;
@@ -131,6 +131,7 @@ void Process_case()
Initialization_tasks[ 0 ].entry_point = Init;
break;
}
- rtems_initialize_executive( &New_Configuration, &Cpu_table );
+ rtems_initialize_executive(
+ &New_Configuration, rtems_cpu_configuration_get_table() );
}
diff --git a/c/src/tests/sptests/spfatal/system.h b/c/src/tests/sptests/spfatal/system.h
index f2391c2a94..113beffd29 100644
--- a/c/src/tests/sptests/spfatal/system.h
+++ b/c/src/tests/sptests/spfatal/system.h
@@ -73,7 +73,5 @@ TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
TEST_EXTERN rtems_configuration_table New_Configuration;
extern rtems_extensions_table Extensions;
-extern rtems_configuration_table BSP_Configuration;
-extern rtems_cpu_table Cpu_table;
/* end of include file */
diff --git a/c/src/tests/support/include/tmacros.h b/c/src/tests/support/include/tmacros.h
index ec2b5a0409..3ea6a2c31f 100644
--- a/c/src/tests/support/include/tmacros.h
+++ b/c/src/tests/support/include/tmacros.h
@@ -122,7 +122,7 @@ extern "C" {
#define task_number( tid ) \
( rtems_get_index( tid ) - \
- BSP_Configuration.RTEMS_api_configuration->number_of_initialization_tasks )
+ rtems_configuration_get_rtems_api_configuration()->number_of_initialization_tasks )
static inline rtems_unsigned32 get_ticks_per_second( void )
{
diff --git a/c/src/tests/tmtests/tmoverhd/testtask.c b/c/src/tests/tmtests/tmoverhd/testtask.c
index 96413ac722..2f051d6ec8 100644
--- a/c/src/tests/tmtests/tmoverhd/testtask.c
+++ b/c/src/tests/tmtests/tmoverhd/testtask.c
@@ -96,7 +96,7 @@ rtems_task Task_1(
/* rtems_initialize_executive */
Timer_initialize();
for ( index=1 ; index <= OPERATION_COUNT ; index++ )
- (void) rtems_initialize_executive( &BSP_Configuration, &cpu_table );
+ (void) rtems_initialize_executive( rtems_configuration_get_table(), &cpu_table );
end_time = Read_timer();
put_time(