forked from Imagelibrary/rtems
config: Add _SMP_Is_enabled
Move the is SMP enabled configuration constant out of the configuration table. Since this was the last configuration constant in rtems_configuration_table, remove this type. Update #3875.
This commit is contained in:
@@ -2633,20 +2633,14 @@ struct _reent *__getreent(void)
|
|||||||
#error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined"
|
#error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the primary Configuration Table for this application.
|
|
||||||
*/
|
|
||||||
const rtems_configuration_table Configuration = {
|
|
||||||
#ifdef RTEMS_SMP
|
|
||||||
#ifdef _CONFIGURE_SMP_APPLICATION
|
|
||||||
true
|
|
||||||
#else
|
|
||||||
false
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef RTEMS_SMP
|
#ifdef RTEMS_SMP
|
||||||
|
const bool _SMP_Is_enabled =
|
||||||
|
#ifdef _CONFIGURE_SMP_APPLICATION
|
||||||
|
true;
|
||||||
|
#else
|
||||||
|
false;
|
||||||
|
#endif
|
||||||
|
|
||||||
const uint32_t _SMP_Processor_configured_maximum =
|
const uint32_t _SMP_Processor_configured_maximum =
|
||||||
_CONFIGURE_MAXIMUM_PROCESSORS;
|
_CONFIGURE_MAXIMUM_PROCESSORS;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -72,28 +72,6 @@ typedef Stack_Allocator_allocate rtems_stack_allocate_hook;
|
|||||||
*/
|
*/
|
||||||
typedef Stack_Allocator_free rtems_stack_free_hook;
|
typedef Stack_Allocator_free rtems_stack_free_hook;
|
||||||
|
|
||||||
/*
|
|
||||||
* The following records define the Configuration Table. The
|
|
||||||
* information contained in this table is required in all
|
|
||||||
* RTEMS systems, whether single or multiprocessor. This
|
|
||||||
* table primarily defines the following:
|
|
||||||
*
|
|
||||||
* + location and size of the RTEMS Workspace
|
|
||||||
* + microseconds per clock tick
|
|
||||||
* + clock ticks per task timeslice
|
|
||||||
* + required number of each object type for each API configured
|
|
||||||
*/
|
|
||||||
typedef struct {
|
|
||||||
#ifdef RTEMS_SMP
|
|
||||||
bool smp_enabled;
|
|
||||||
#endif
|
|
||||||
} rtems_configuration_table;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the configuration table generated by confdefs.h.
|
|
||||||
*/
|
|
||||||
extern const rtems_configuration_table Configuration;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some handy macros to avoid dependencies on either the BSP
|
* Some handy macros to avoid dependencies on either the BSP
|
||||||
* or the exact format of the configuration table.
|
* or the exact format of the configuration table.
|
||||||
@@ -182,13 +160,8 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
|
|||||||
* @retval true SMP mode of operation is enabled.
|
* @retval true SMP mode of operation is enabled.
|
||||||
* @retval false Otherwise.
|
* @retval false Otherwise.
|
||||||
*/
|
*/
|
||||||
#ifdef RTEMS_SMP
|
#define rtems_configuration_is_smp_enabled() \
|
||||||
#define rtems_configuration_is_smp_enabled() \
|
(_SMP_Is_enabled)
|
||||||
(Configuration.smp_enabled)
|
|
||||||
#else
|
|
||||||
#define rtems_configuration_is_smp_enabled() \
|
|
||||||
false
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the configured maximum count of processors.
|
* @brief Returns the configured maximum count of processors.
|
||||||
|
|||||||
@@ -36,6 +36,19 @@ extern "C" {
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Indicates if SMP is enabled.
|
||||||
|
*
|
||||||
|
* In SMP configurations, this constant is defined by the application
|
||||||
|
* configuration via <rtems/confdefs.h>, otherwise it is a compile-time
|
||||||
|
* constant with the value false.
|
||||||
|
*/
|
||||||
|
#if defined(RTEMS_SMP)
|
||||||
|
extern const bool _SMP_Is_enabled;
|
||||||
|
#else
|
||||||
|
#define _SMP_Is_enabled false
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The configured processor maximum.
|
* @brief The configured processor maximum.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ rtems_monitor_mpci_next(
|
|||||||
_Objects_Allocator_lock();
|
_Objects_Allocator_lock();
|
||||||
|
|
||||||
*next_id += 1;
|
*next_id += 1;
|
||||||
return &Configuration;
|
return (const void *) (uintptr_t) 1;
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
*next_id = RTEMS_OBJECT_ID_FINAL;
|
*next_id = RTEMS_OBJECT_ID_FINAL;
|
||||||
|
|||||||
Reference in New Issue
Block a user