2007-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>

* libcsupport/src/malloc.c, libmisc/monitor/mon-command.c,
	posix/preinstall.am, posix/include/rtems/posix/cond.h,
	posix/include/rtems/posix/mqueue.h,
	posix/include/rtems/posix/mutex.h,
	posix/include/rtems/posix/pthread.h,
	posix/include/rtems/posix/semaphore.h, posix/src/conddestroy.c,
	posix/src/mutexdestroy.c, posix/src/mutexinit.c,
	posix/src/mutexsetprioceiling.c, posix/src/mutexunlock.c,
	sapi/include/confdefs.h, sapi/include/rtems/config.h,
	sapi/include/rtems/init.h, sapi/include/rtems/sptables.h,
	sapi/src/exinit.c, score/include/rtems/system.h,
	score/include/rtems/score/mpci.h, score/src/mpci.c,
	score/src/thread.c, score/src/threadcreateidle.c,
	score/src/threadstackallocate.c, score/src/threadstackfree.c,
	score/src/wkspace.c: Moved most of the remaining CPU Table fields to
	the Configuration Table. This included pretasking_hook,
	predriver_hook, postdriver_hook, idle_task, do_zero_of_workspace,
	extra_mpci_receive_server_stack, stack_allocate_hook, and
	stack_free_hook. As a side-effect of this effort some multiprocessing
	code was made conditional and some style clean up occurred.
This commit is contained in:
Joel Sherrill
2007-12-03 22:23:13 +00:00
parent 3e06654040
commit 976162a69f
27 changed files with 242 additions and 209 deletions

View File

@@ -1,3 +1,26 @@
2007-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/src/malloc.c, libmisc/monitor/mon-command.c,
posix/preinstall.am, posix/include/rtems/posix/cond.h,
posix/include/rtems/posix/mqueue.h,
posix/include/rtems/posix/mutex.h,
posix/include/rtems/posix/pthread.h,
posix/include/rtems/posix/semaphore.h, posix/src/conddestroy.c,
posix/src/mutexdestroy.c, posix/src/mutexinit.c,
posix/src/mutexsetprioceiling.c, posix/src/mutexunlock.c,
sapi/include/confdefs.h, sapi/include/rtems/config.h,
sapi/include/rtems/init.h, sapi/include/rtems/sptables.h,
sapi/src/exinit.c, score/include/rtems/system.h,
score/include/rtems/score/mpci.h, score/src/mpci.c,
score/src/thread.c, score/src/threadcreateidle.c,
score/src/threadstackallocate.c, score/src/threadstackfree.c,
score/src/wkspace.c: Moved most of the remaining CPU Table fields to
the Configuration Table. This included pretasking_hook,
predriver_hook, postdriver_hook, idle_task, do_zero_of_workspace,
extra_mpci_receive_server_stack, stack_allocate_hook, and
stack_free_hook. As a side-effect of this effort some multiprocessing
code was made conditional and some style clean up occurred.
2007-12-03 Chris Johns <chrisj@rtems.org>
* libmisc/shell/shell.h: Added comments for the parameters to the

View File

@@ -175,7 +175,7 @@ void RTEMS_Malloc_Initialize(
* left over from another process. This would be a security violation.
*/
if ( rtems_cpu_configuration_get_do_zero_of_workspace() )
if ( rtems_configuration_get_do_zero_of_workspace() )
memset( starting_address, 0, length );
/*

View File

@@ -498,10 +498,13 @@ rtems_monitor_command_read(char *command,
/*
* put node number in the prompt if we are multiprocessing
*/
#if defined(RTEMS_MULTIPROCESSING)
if (!rtems_configuration_get_user_multiprocessing_table ())
sprintf (monitor_prompt, "%s",
(env_prompt == NULL) ? MONITOR_PROMPT: env_prompt);
else if (rtems_monitor_default_node != rtems_monitor_node)
else /* .... */
#endif
if (rtems_monitor_default_node != rtems_monitor_node)
sprintf (monitor_prompt, "%" PRId32 "-%s-%" PRId32 "", rtems_monitor_node,
(env_prompt == NULL) ? MONITOR_PROMPT : env_prompt,
rtems_monitor_default_node);

View File

@@ -159,9 +159,6 @@ int _POSIX_Condition_variables_Wait_support(
);
#include <rtems/posix/cond.inl>
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/posix/condmp.h>
#endif
#ifdef __cplusplus
}

View File

@@ -239,9 +239,6 @@ int _POSIX_Message_queue_Translate_core_message_queue_return_code(
#include <rtems/posix/mqueue.inl>
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/posix/mqueuemp.h>
#endif
#ifdef __cplusplus
}

View File

@@ -148,9 +148,6 @@ int _POSIX_Mutex_Translate_core_mutex_return_code(
#include <rtems/posix/mutex.inl>
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/posix/mutexmp.h>
#endif
#ifdef __cplusplus
}

View File

@@ -141,9 +141,6 @@ void _POSIX_Threads_Sporadic_budget_TSR(
);
#include <rtems/posix/pthread.inl>
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/posix/pthreadmp.h>
#endif
#ifdef __cplusplus
}

View File

@@ -185,9 +185,6 @@ int _POSIX_Semaphore_Translate_core_semaphore_return_code(
);
#include <rtems/posix/semaphore.inl>
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/posix/semaphoremp.h>
#endif
#ifdef __cplusplus
}

View File

@@ -8,10 +8,20 @@ endif
PREINSTALL_DIRS =
DISTCLEANFILES = $(PREINSTALL_DIRS)
all-local: $(TMPINSTALL_FILES)
TMPINSTALL_FILES =
CLEANFILES = $(TMPINSTALL_FILES)
all-am: $(PREINSTALL_FILES)
PREINSTALL_FILES =
CLEANFILES = $(PREINSTALL_FILES)
CLEANFILES += $(PREINSTALL_FILES)
$(PROJECT_LIB)/$(dirstamp):
@$(MKDIR_P) $(PROJECT_LIB)
@: > $(PROJECT_LIB)/$(dirstamp)
PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
$(PROJECT_INCLUDE)/$(dirstamp):
@$(MKDIR_P) $(PROJECT_INCLUDE)
@@ -19,6 +29,10 @@ $(PROJECT_INCLUDE)/$(dirstamp):
PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
if LIBPOSIX
$(PROJECT_LIB)/libposix.a: libposix.a $(PROJECT_LIB)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_LIB)/libposix.a
TMPINSTALL_FILES += $(PROJECT_LIB)/libposix.a
if HAS_PTHREADS
$(PROJECT_INCLUDE)/sched.h: include/sched.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sched.h

View File

@@ -46,23 +46,6 @@ int pthread_cond_destroy(
);
_POSIX_Condition_variables_Free( the_cond );
#if defined(RTEMS_MULTIPROCESSING)
if ( the_cond->process_shared == PTHREAD_PROCESS_SHARED ) {
_Objects_MP_Close(
&_POSIX_Condition_variables_Information,
the_cond->Object.id
);
_POSIX_Condition_variables_MP_Send_process_packet(
POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE,
the_cond->Object.id,
0, /* Not used */
0 /* Not used */
);
}
#endif
_Thread_Enable_dispatch();
return 0;

View File

@@ -12,9 +12,6 @@
#include <rtems/system.h>
#include <rtems/score/coremutex.h>
#include <rtems/score/watchdog.h>
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/score/mpci.h>
#endif
#include <rtems/posix/mutex.h>
#include <rtems/posix/priority.h>
#include <rtems/posix/time.h>
@@ -47,31 +44,9 @@ int pthread_mutex_destroy(
_Objects_Close( &_POSIX_Mutex_Information, &the_mutex->Object );
_CORE_mutex_Flush(
&the_mutex->Mutex,
#if defined(RTEMS_MULTIPROCESSING)
_POSIX_Mutex_MP_Send_object_was_deleted,
#else
NULL,
#endif
EINVAL
);
_CORE_mutex_Flush( &the_mutex->Mutex, NULL, EINVAL );
_POSIX_Mutex_Free( the_mutex );
#if defined(RTEMS_MULTIPROCESSING)
if ( the_mutex->process_shared == PTHREAD_PROCESS_SHARED ) {
_Objects_MP_Close( &_POSIX_Mutex_Information, the_mutex->Object.id );
_POSIX_Mutex_MP_Send_process_packet(
POSIX_MUTEX_MP_ANNOUNCE_DELETE,
the_mutex->Object.id,
0, /* Not used */
0 /* Not used */
);
}
#endif
_Thread_Enable_dispatch();
return 0;

View File

@@ -13,9 +13,6 @@
#include <rtems/system.h>
#include <rtems/score/coremutex.h>
#include <rtems/score/watchdog.h>
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/score/mpci.h>
#endif
#include <rtems/posix/mutex.h>
#include <rtems/posix/priority.h>
#include <rtems/posix/time.h>
@@ -132,16 +129,6 @@ int pthread_mutex_init(
return EAGAIN;
}
#if defined(RTEMS_MULTIPROCESSING)
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED &&
!( _Objects_MP_Allocate_and_open( &_POSIX_Mutex_Information, 0,
the_mutex->Object.id, FALSE ) ) ) {
_POSIX_Mutex_Free( the_mutex );
_Thread_Enable_dispatch();
return EAGAIN;
}
#endif
the_mutex->process_shared = the_attr->process_shared;
the_mutex_attr = &the_mutex->Mutex.Attributes;
@@ -169,16 +156,6 @@ int pthread_mutex_init(
*mutex = the_mutex->Object.id;
#if defined(RTEMS_MULTIPROCESSING)
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
_POSIX_Mutex_MP_Send_process_packet(
POSIX_MUTEX_MP_ANNOUNCE_CREATE,
the_mutex->Object.id,
0, /* Name not used */
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return 0;
}

View File

@@ -12,9 +12,6 @@
#include <rtems/system.h>
#include <rtems/score/coremutex.h>
#include <rtems/score/watchdog.h>
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/score/mpci.h>
#endif
#include <rtems/posix/mutex.h>
#include <rtems/posix/priority.h>
#include <rtems/posix/time.h>
@@ -62,11 +59,7 @@ int pthread_mutex_setprioceiling(
_CORE_mutex_Surrender(
&the_mutex->Mutex,
the_mutex->Object.id,
#if defined(RTEMS_MULTIPROCESSING)
_POSIX_Threads_mutex_MP_support
#else
NULL
#endif
);
_Thread_Enable_dispatch();
return 0;

View File

@@ -41,11 +41,7 @@ int pthread_mutex_unlock(
status = _CORE_mutex_Surrender(
&the_mutex->Mutex,
the_mutex->Object.id,
#if defined(RTEMS_MULTIPROCESSING)
_POSIX_Threads_mutex_MP_support
#else
NULL
#endif
);
_Thread_Enable_dispatch();
return _POSIX_Mutex_Translate_core_mutex_return_code( status );

View File

@@ -52,7 +52,9 @@ extern "C" {
extern rtems_initialization_tasks_table Initialization_tasks[];
extern rtems_driver_address_table Device_drivers[];
extern rtems_configuration_table Configuration;
extern rtems_multiprocessing_table Multiprocessing_configuration;
#if defined(RTEMS_MULTIPROCESSING)
extern rtems_multiprocessing_table Multiprocessing_configuration;
#endif
#ifdef RTEMS_POSIX_API
extern posix_api_configuration_table Configuration_POSIX_API;
#endif
@@ -176,6 +178,62 @@ extern int rtems_telnetd_maximum_ptys;
#endif
#endif
/*
* Idle task body configuration
*
* There is a default IDLE thread body provided by RTEMS which
* has the possibility of being CPU specific. There may be a
* BSP specific override of the RTEMS default body and in turn,
* the application may override and provide its own.
*/
#ifndef CONFIGURE_IDLE_TASK_BODY
#ifdef BSP_IDLE_TASK_BODY
#define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY
#else
#define CONFIGURE_IDLE_TASK_BODY NULL
#endif
#endif
/*
* Idle task stack size configuration
*
* By default, the IDLE task will have a stack of minimum size.
* The BSP or application may override this value.
*/
#ifndef CONFIGURE_IDLE_TASK_STACK_SIZE
#ifdef BSP_IDLE_TASK_STACK_SIZE
#define CONFIGURE_IDLE_TASK_STACK_SIZE BSP_IDLE_TASK_STACK_SIZE
#else
#define CONFIGURE_IDLE_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
#endif
#endif
/*
* Task stack allocator configuration
*/
#ifndef CONFIGURE_TASK_STACK_ALLOCATOR
#define CONFIGURE_TASK_STACK_ALLOCATOR NULL
#endif
#ifndef CONFIGURE_TASK_STACK_DEALLOCATOR
#define CONFIGURE_TASK_STACK_DEALLOCATOR NULL
#endif
/*
* Should the RTEMS Workspace and C Program Heap be cleared automatically
* at system start up?
*/
#ifndef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY
#ifdef BSP_ZERO_WORKSPACE_AUTOMATICALLY
#define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY \
BSP_ZERO_WORKSPACE_AUTOMATICALLY
#else
#define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY FALSE
#endif
#endif
/*
* Default User Initialization Task Table. This table guarantees that
* one user initialization table is defined.
@@ -399,6 +457,8 @@ int rtems_bdbuf_configuration_size =( sizeof(rtems_bdbuf_configuration)
#endif /* CONFIGURE_INIT */
#endif /* CONFIGURE_HAS_OWN_BDBUF_TABLE */
#endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */
#if defined(RTEMS_MULTIPROCESSING)
/*
* Default Multiprocessing Configuration Table. The defaults are
* appropriate for most of the RTEMS Multiprocessor Test Suite. Each
@@ -448,6 +508,7 @@ rtems_multiprocessing_table Multiprocessing_configuration = {
#define CONFIGURE_MULTIPROCESSING_TABLE NULL
#endif /* CONFIGURE_MP_APPLICATION */
#endif /* RTEMS_MULTIPROCESSING */
/*
* Default Configuration Table.
@@ -1178,17 +1239,24 @@ itron_api_configuration_table Configuration_ITRON_API = {
rtems_configuration_table Configuration = {
CONFIGURE_EXECUTIVE_RAM_WORK_AREA,
CONFIGURE_EXECUTIVE_RAM_SIZE,
CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */
CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION +
CONFIGURE_STACK_CHECKER_EXTENSION,
CONFIGURE_MICROSECONDS_PER_TICK,
CONFIGURE_TICKS_PER_TIMESLICE,
CONFIGURE_MAXIMUM_DRIVERS,
CONFIGURE_NUMBER_OF_DRIVERS, /* number of device drivers */
CONFIGURE_STACK_CHECKER_EXTENSION, /* maximum user extensions */
CONFIGURE_MICROSECONDS_PER_TICK, /* microseconds per clock tick */
CONFIGURE_TICKS_PER_TIMESLICE, /* ticks per timeslice quantum */
CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */
CONFIGURE_IDLE_TASK_STACK_SIZE, /* IDLE task stack size */
CONFIGURE_TASK_STACK_ALLOCATOR, /* stack allocator */
CONFIGURE_TASK_STACK_DEALLOCATOR, /* stack deallocator */
CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY, /* true to clear memory */
CONFIGURE_MAXIMUM_DRIVERS, /* maximum device drivers */
CONFIGURE_NUMBER_OF_DRIVERS, /* static device drivers */
Device_drivers, /* pointer to driver table */
CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of initial extensions */
CONFIGURE_INITIAL_EXTENSION_TABLE, /* pointer to initial extensions */
#if defined(RTEMS_MULTIPROCESSING)
CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */
#endif
&Configuration_RTEMS_API, /* pointer to RTEMS API config */
#ifdef RTEMS_POSIX_API
&Configuration_POSIX_API, /* pointer to POSIX API config */

View File

@@ -69,24 +69,28 @@ typedef void *itron_api_configuration_table;
#include <rtems/score/mpci.h>
#endif
#if defined(RTEMS_MULTIPROCESSING)
/*
* The following records define the Multiprocessor Configuration
* Table. This table defines the multiprocessor system
* characteristics which must be known by RTEMS in a multiprocessor
* system.
*/
typedef struct {
uint32_t node; /* local node number */
uint32_t maximum_nodes; /* maximum # nodes in system */
uint32_t maximum_global_objects; /* maximum # global objects */
uint32_t maximum_proxies; /* maximum # proxies */
#if defined(RTEMS_MULTIPROCESSING)
uint32_t node; /* local node number */
uint32_t maximum_nodes; /* maximum # nodes in system */
uint32_t maximum_global_objects; /* maximum # global objects */
uint32_t maximum_proxies; /* maximum # proxies */
/** The MPCI Receive server is assumed to have a stack of at least
* minimum stack size. This field specifies the amount of extra
* stack this task will be given in bytes.
*/
uint32_t extra_mpci_receive_server_stack;
rtems_mpci_table *User_mpci_table; /* pointer to MPCI table */
#else
void *User_mpci_table; /* pointer to MPCI table */
#endif
} rtems_multiprocessing_table;
#endif
/*
* The following records define the Configuration Table. The
@@ -99,19 +103,49 @@ typedef struct {
* + clock ticks per task timeslice
* + required number of each object type for each API configured
*/
typedef struct {
void *work_space_start;
uint32_t work_space_size;
uint32_t maximum_extensions;
uint32_t microseconds_per_tick;
uint32_t ticks_per_timeslice;
/** This element points to the BSP's optional idle task which may override
* the default one provided with RTEMS.
*/
void (*idle_task)( void );
/** This field specifies the size of the IDLE task's stack. If less than or
* equal to the minimum stack size, then the IDLE task will have the minimum
* stack size.
*/
uint32_t idle_task_stack_size;
/** The BSP may want to provide it's own stack allocation routines.
* In this case, the BSP will provide this stack allocation hook.
*/
void * (*stack_allocate_hook)( uint32_t );
/** The BSP may want to provide it's own stack free routines.
* In this case, the BSP will provide this stack free hook.
*/
void (*stack_free_hook)( void *);
/** If this element is TRUE, then RTEMS will zero the Executive Workspace.
* When this element is FALSE, it is assumed that the BSP or invoking
* environment has ensured that memory was cleared before RTEMS was
* invoked.
*/
boolean do_zero_of_workspace;
uint32_t maximum_drivers;
uint32_t number_of_device_drivers;
rtems_driver_address_table *Device_driver_table;
uint32_t number_of_initial_extensions;
rtems_extensions_table *User_extension_table;
#if defined(RTEMS_MULTIPROCESSING)
rtems_multiprocessing_table *User_multiprocessing_table;
#endif
rtems_api_configuration_table *RTEMS_api_configuration;
posix_api_configuration_table *POSIX_api_configuration;
itron_api_configuration_table *ITRON_api_configuration;
@@ -152,6 +186,13 @@ SAPI_EXTERN rtems_configuration_table *_Configuration_Table;
#define rtems_configuration_get_ticks_per_timeslice() \
(_Configuration_Table->ticks_per_timeslice)
/**
* This macro assists in accessing the field which indicates whether
* RTEMS is responsible for zeroing the Executive Workspace.
*/
#define rtems_configuration_get_do_zero_of_workspace() \
(_Configuration_Table->do_zero_of_workspace)
#define rtems_configuration_get_maximum_devices() \
(_Configuration_Table->maximum_devices)

View File

@@ -36,6 +36,7 @@ extern "C" {
#include <rtems/config.h>
#include <rtems/rtems/intr.h>
#if defined(RTEMS_MULTIPROCESSING)
/*
* The following defines the default Multiprocessing Configuration
* Table. This table is used in a single processor system.
@@ -43,6 +44,7 @@ extern "C" {
extern const rtems_multiprocessing_table
_Initialization_Default_multiprocessing_table;
#endif
/*
* rtems_initialize_executive_early

View File

@@ -47,23 +47,24 @@ extern "C" {
#include <rtems/rtems/signal.h>
#include <rtems/rtems/timer.h>
#if defined(RTEMS_MULTIPROCESSING)
/*
* This is the default Multiprocessing Configuration Table.
* It is used in single processor configurations.
*/
#if defined(SAPI_INIT)
const rtems_multiprocessing_table
_Initialization_Default_multiprocessing_table = {
1, /* local node number */
1, /* maximum number nodes in system */
0, /* maximum number global objects */
0, /* maximum number proxies */
NULL, /* pointer to MPCI address table */
};
#else
extern const rtems_multiprocessing_table
_Initialization_Default_multiprocessing_table;
#if defined(SAPI_INIT)
const rtems_multiprocessing_table
_Initialization_Default_multiprocessing_table = {
1, /* local node number */
1, /* maximum number nodes in system */
0, /* maximum number global objects */
0, /* maximum number proxies */
NULL, /* pointer to MPCI address table */
};
#else
extern const rtems_multiprocessing_table
_Initialization_Default_multiprocessing_table;
#endif
#endif
#ifdef __cplusplus

View File

@@ -92,6 +92,21 @@ rtems_interrupt_level rtems_initialize_executive_early(
INTERNAL_ERROR_NO_CPU_TABLE
);
/*
* Grab our own copy of the user's CPU table.
*/
_CPU_Table = *cpu_table;
/*
* Provide pointers just for later convenience.
*/
_Configuration_Table = configuration_table;
/*
* Initialize any target architecture specific support as early as possible
*/
_CPU_Initialize( cpu_table, _Thread_Dispatch );
#if defined(RTEMS_MULTIPROCESSING)
/*
* Initialize the system state based on whether this is an MP system.
@@ -111,18 +126,6 @@ rtems_interrupt_level rtems_initialize_executive_early(
_System_state_Handler_initialization( FALSE );
#endif
/*
* Grab our own copy of the user's CPU table.
*/
_CPU_Table = *cpu_table;
/*
* Provide pointers just for later convenience.
*/
_Configuration_Table = configuration_table;
_CPU_Initialize( cpu_table, _Thread_Dispatch );
/*
* Do this as early as possible to insure no debugging output
* is even attempted to be printed.
@@ -173,13 +176,13 @@ rtems_interrupt_level rtems_initialize_executive_early(
configuration_table->maximum_extensions
#if defined(RTEMS_MULTIPROCESSING)
,
multiprocessing_table->maximum_proxies
_Configuration_MP_table->maximum_proxies
#endif
);
#if defined(RTEMS_MULTIPROCESSING)
_MPCI_Handler_initialization(
multiprocessing_table->User_mpci_table,
_Configuration_MP_table->User_mpci_table,
RTEMS_TIMEOUT
);
#endif
@@ -220,8 +223,10 @@ rtems_interrupt_level rtems_initialize_executive_early(
* Scheduling can properly occur now as long as we avoid dispatching.
*/
if ( cpu_table->pretasking_hook )
(*cpu_table->pretasking_hook)();
{
extern void bsp_pretasking_hook(void);
bsp_pretasking_hook();
}
#if defined(RTEMS_MULTIPROCESSING)
_MPCI_Create_server();
@@ -233,8 +238,10 @@ rtems_interrupt_level rtems_initialize_executive_early(
_API_extensions_Run_predriver();
if ( _CPU_Table.predriver_hook )
(*_CPU_Table.predriver_hook)();
{
extern void bsp_predriver_hook(void);
bsp_predriver_hook();
}
/*
* Initialize all the device drivers and initialize the MPCI layer.
@@ -261,8 +268,10 @@ rtems_interrupt_level rtems_initialize_executive_early(
_API_extensions_Run_postdriver();
if ( _CPU_Table.postdriver_hook )
(*_CPU_Table.postdriver_hook)();
{
extern void bsp_postdriver_hook(void);
bsp_postdriver_hook();
}
return bsp_level;
}

View File

@@ -42,16 +42,6 @@ extern "C" {
#include <rtems/score/watchdog.h>
#include <rtems/score/coresem.h>
/**
* The following constants define the stack size requirements for
* the system threads.
*/
#define MPCI_RECEIVE_SERVER_STACK_SIZE \
( STACK_MINIMUM_SIZE + \
CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \
_CPU_Table.extra_mpci_receive_server_stack \
)
/**
* The following defines the node number used when a broadcast is desired.
*/

View File

@@ -199,7 +199,6 @@ SCORE_EXTERN rtems_cpu_table _CPU_Table;
/** This macro assists in accessing the CPU Specific Configuration Table. */
#define rtems_cpu_configuration_get_table() (&_CPU_Table)
/** This macro assists in accessing the pretasking BSP hook. */
#define rtems_cpu_configuration_get_pretasking_hook() \
(_CPU_Table.pretasking_hook)
@@ -212,37 +211,10 @@ SCORE_EXTERN rtems_cpu_table _CPU_Table;
#define rtems_cpu_configuration_get_postdriver_hook() \
(_CPU_Table.postdriver_hook)
/** This macro assists in accessing the BSP specific IDLE task entry point. */
#define rtems_cpu_configuration_get_idle_task() \
(_CPU_Table.idle_task)
/**
* This macro assists in accessing the field which indicates whether
* RTEMS is responsible for zeroing the Executive Workspace.
*/
#define rtems_cpu_configuration_get_do_zero_of_workspace() \
(_CPU_Table.do_zero_of_workspace)
/** This macro assists in accessing the IDLE task stack point size. */
#define rtems_cpu_configuration_get_idle_task_stack_size() \
(_CPU_Table.idle_task_stack_size)
/** This macro assists in accessing the interrupt stack size. */
#define rtems_cpu_configuration_get_interrupt_stack_size() \
(_CPU_Table.interrupt_stack_size)
/** This macro assists in accessing the size of the MPCI receiver server. */
#define rtems_cpu_configuration_get_extra_mpci_receive_server_stack() \
(_CPU_Table.extra_mpci_receive_server_stack)
/** This macro assists in accessing the BSP stack allocation hook. */
#define rtems_cpu_configuration_get_stack_allocate_hook() \
(_CPU_Table.stack_allocate_hook)
/** This macro assists in accessing the BSP stack allocation free hook. */
#define rtems_cpu_configuration_get_stack_free_hook() \
(_CPU_Table.stack_free_hook)
/** This macro defines the maximum length of a Classic API name. */
#define RTEMS_MAXIMUM_NAME_LENGTH sizeof(rtems_name)

View File

@@ -17,12 +17,12 @@
#endif
#include <rtems/system.h>
#include <rtems/score/cpu.h>
#include <rtems/score/interr.h>
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/score/mpci.h>
#include <rtems/score/mppkt.h>
#endif
#include <rtems/score/cpu.h>
#include <rtems/score/interr.h>
#include <rtems/score/states.h>
#include <rtems/score/thread.h>
#include <rtems/score/threadq.h>
@@ -31,6 +31,7 @@
#include <rtems/score/sysstate.h>
#include <rtems/score/coresem.h>
#include <rtems/config.h>
/*PAGE
*
@@ -112,7 +113,9 @@ void _MPCI_Create_server( void )
&_Thread_Internal_information,
_MPCI_Receive_server_tcb,
NULL, /* allocate the stack */
MPCI_RECEIVE_SERVER_STACK_SIZE,
STACK_MINIMUM_SIZE +
CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK +
_Configuration_MP_table->extra_mpci_receive_server_stack,
CPU_ALL_TASKS_ARE_FP,
PRIORITY_MINIMUM,
FALSE, /* no preempt */

View File

@@ -29,6 +29,7 @@
#include <rtems/score/threadq.h>
#include <rtems/score/userext.h>
#include <rtems/score/wkspace.h>
#include <rtems/config.h>
/*PAGE
*
@@ -58,9 +59,8 @@ void _Thread_Handler_initialization(
* BOTH stacks hooks must be set or both must be NULL.
* Do not allow mixture.
*/
if ( !( ( _CPU_Table.stack_allocate_hook == 0 )
== ( _CPU_Table.stack_free_hook == 0 ) ) )
if ( !( (!_Configuration_Table->stack_allocate_hook)
== (!_Configuration_Table->stack_free_hook) ) )
_Internal_error_Occurred(
INTERNAL_ERROR_CORE,
TRUE,

View File

@@ -29,6 +29,7 @@
#include <rtems/score/threadq.h>
#include <rtems/score/userext.h>
#include <rtems/score/wkspace.h>
#include <rtems/config.h>
/*PAGE
*
@@ -60,10 +61,10 @@ void _Thread_Create_idle( void )
idle = (void *) _Thread_Idle_body;
#endif
if ( _CPU_Table.idle_task )
idle = _CPU_Table.idle_task;
if ( _Configuration_Table->idle_task )
idle = _Configuration_Table->idle_task;
idle_task_stack_size = _CPU_Table.idle_task_stack_size;
idle_task_stack_size = _Configuration_Table->idle_task_stack_size;
if ( idle_task_stack_size < STACK_MINIMUM_SIZE )
idle_task_stack_size = STACK_MINIMUM_SIZE;

View File

@@ -29,6 +29,7 @@
#include <rtems/score/threadq.h>
#include <rtems/score/userext.h>
#include <rtems/score/wkspace.h>
#include <rtems/config.h>
/*PAGE
*
@@ -57,8 +58,8 @@ size_t _Thread_Stack_Allocate(
* routine can call the correct deallocation routine.
*/
if ( _CPU_Table.stack_allocate_hook ) {
stack_addr = (*_CPU_Table.stack_allocate_hook)( the_stack_size );
if ( _Configuration_Table->stack_allocate_hook ) {
stack_addr = (*_Configuration_Table->stack_allocate_hook)( the_stack_size );
} else {
/*

View File

@@ -29,6 +29,7 @@
#include <rtems/score/threadq.h>
#include <rtems/score/userext.h>
#include <rtems/score/wkspace.h>
#include <rtems/config.h>
/*
* _Thread_Stack_Free
@@ -53,8 +54,10 @@ void _Thread_Stack_Free(
* routine properly matches the allocation of the stack.
*/
if ( _CPU_Table.stack_free_hook )
(*_CPU_Table.stack_free_hook)( the_thread->Start.Initial_stack.area );
if ( _Configuration_Table->stack_free_hook )
(*_Configuration_Table->stack_free_hook)(
the_thread->Start.Initial_stack.area
);
else
_Workspace_Free( the_thread->Start.Initial_stack.area );
}

View File

@@ -1,11 +1,7 @@
/*
* Workspace Handler
*
* XXX
*
* NOTE:
*
* COPYRIGHT (c) 1989-1999.
* COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -22,6 +18,9 @@
#include <rtems/system.h>
#include <rtems/score/wkspace.h>
#include <rtems/score/interr.h>
#include <rtems/config.h>
#include <string.h> /* for memset */
/*PAGE
*
@@ -33,8 +32,6 @@ void _Workspace_Handler_initialization(
size_t size
)
{
uint32_t *zero_out_array;
uint32_t index;
uint32_t memory_available;
if ( !starting_address || !_Addresses_Is_aligned( starting_address ) )
@@ -44,12 +41,8 @@ void _Workspace_Handler_initialization(
INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS
);
if ( _CPU_Table.do_zero_of_workspace ) {
for( zero_out_array = (uint32_t *) starting_address, index = 0 ;
index < size / sizeof( uint32_t ) ;
index++ )
zero_out_array[ index ] = 0;
}
if ( _Configuration_Table->do_zero_of_workspace )
memset( starting_address, 0, size );
memory_available = _Heap_Initialize(
&_Workspace_Area,