forked from Imagelibrary/rtems
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>.
This commit is contained in:
@@ -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 );
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -459,9 +459,19 @@ 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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -197,6 +197,21 @@ typedef struct {
|
||||
void *interrupt_table_offset;
|
||||
} 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
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -360,9 +360,19 @@ 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
|
||||
|
||||
@@ -442,6 +442,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
|
||||
|
||||
@@ -491,6 +491,58 @@ typedef struct {
|
||||
#endif
|
||||
} 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.
|
||||
*
|
||||
@@ -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); \
|
||||
|
||||
@@ -379,6 +379,17 @@ typedef struct {
|
||||
/* end of fields required on all CPUs */
|
||||
} 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
|
||||
|
||||
@@ -526,6 +526,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
|
||||
|
||||
@@ -512,6 +512,17 @@ typedef struct {
|
||||
/* end of required fields */
|
||||
} 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
|
||||
|
||||
@@ -139,6 +139,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
|
||||
*/
|
||||
|
||||
@@ -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 );
|
||||
|
||||
/*
|
||||
|
||||
@@ -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 (;;)
|
||||
{
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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); \
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
extern rtems_configuration_table BSP_Configuration;
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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() );
|
||||
}
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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 );
|
||||
|
||||
/*
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
extern rtems_configuration_table BSP_Configuration;
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -459,9 +459,19 @@ 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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -197,6 +197,21 @@ typedef struct {
|
||||
void *interrupt_table_offset;
|
||||
} 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
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -360,9 +360,19 @@ 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
|
||||
|
||||
@@ -379,6 +379,17 @@ typedef struct {
|
||||
/* end of fields required on all CPUs */
|
||||
} 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
|
||||
|
||||
@@ -526,6 +526,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
|
||||
|
||||
@@ -512,6 +512,17 @@ typedef struct {
|
||||
/* end of required fields */
|
||||
} 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
|
||||
|
||||
@@ -139,6 +139,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
|
||||
*/
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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() );
|
||||
}
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user