mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-28 15:53:06 +08:00
The files in libcpu should not be directly dependent on any BSP. In
particular, using bsp.h, or getting information from the BSP which should properly be obtained from RTEMS is forbidden. 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>. The changes primarily eliminated the need to include bsp.h and peeking at BSP_Configuration. The use of Cpu_table in each BSP needs to be eliminated.
This commit is contained in:
@@ -116,6 +116,52 @@ typedef struct {
|
||||
SAPI_EXTERN rtems_configuration_table *_Configuration_Table;
|
||||
SAPI_EXTERN rtems_multiprocessing_table *_Configuration_MP_table;
|
||||
|
||||
/*
|
||||
* Some handy macros to avoid dependencies on either the BSP
|
||||
* or the exact format of the configuration table.
|
||||
*/
|
||||
|
||||
#define rtems_configuration_get_work_space_start() \
|
||||
(_Configuration_Table->work_space_start)
|
||||
|
||||
#define rtems_configuration_get_work_space_size() \
|
||||
(_Configuration_Table->work_space_size)
|
||||
|
||||
#define rtems_configuration_get_maximum_extensions() \
|
||||
(_Configuration_Table->maximum_extensions)
|
||||
|
||||
#define rtems_configuration_get_microseconds_per_tick() \
|
||||
(_Configuration_Table->microseconds_per_tick)
|
||||
#define rtems_configuration_get_milliseconds_per_tick() \
|
||||
(_Configuration_Table->microseconds_per_tick / 1000)
|
||||
|
||||
#define rtems_configuration_get_ticks_per_timeslice() \
|
||||
(_Configuration_Table->ticks_per_timeslice)
|
||||
|
||||
#define rtems_configuration_get_maximum_devices() \
|
||||
(_Configuration_Table->maximum_devices)
|
||||
|
||||
#define rtems_configuration_get_number_of_device_drivers() \
|
||||
(_Configuration_Table->number_of_device_drivers)
|
||||
|
||||
#define rtems_configuration_get_device_driver_table() \
|
||||
(_Configuration_Table->device_driver_table)
|
||||
|
||||
#define rtems_configuration_get_number_of_initial_extensions() \
|
||||
(_Configuration_Table->number_of_initial_extensions)
|
||||
|
||||
#define rtems_configuration_get_user_extension_table() \
|
||||
(_Configuration_Table->user_extension_table)
|
||||
|
||||
#define rtems_configuration_get_user_multiprocessing_table() \
|
||||
(_Configuration_Table->user_multiprocessing_table)
|
||||
|
||||
#define rtems_configuration_get_rtems_api_configuration() \
|
||||
(_Configuration_Table->rtems_api_configuration)
|
||||
|
||||
#define rtems_configuration_get_posix_api_configuration() \
|
||||
(_Configuration_Table->posix_api_configuration)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user