RTEMS
|
Modules | |
Flexible Per-CPU Data | |
Flexible Per-CPU Data. | |
Files | |
file | percpu.c |
Allocate and Initialize Per CPU Structures. | |
Classes | |
struct | Per_CPU_Job_context |
Context for per-processor jobs. More... | |
struct | Per_CPU_Job |
A per-processor job. More... | |
struct | Per_CPU_Stats |
Per-CPU statistics. More... | |
struct | Per_CPU_Control |
Per CPU Core Structure. More... | |
struct | Per_CPU_Control_envelope |
Macros | |
#define | PER_CPU_JOB_DONE 1 |
#define | _Per_CPU_Acquire(cpu, lock_context) _ISR_lock_Acquire( &( cpu )->Lock, lock_context ) |
#define | _Per_CPU_Release(cpu, lock_context) _ISR_lock_Release( &( cpu )->Lock, lock_context ) |
#define | _Per_CPU_Get_snapshot() ( &_Per_CPU_Information[ _SMP_Get_current_processor() ].per_cpu ) |
#define | _Thread_Dispatch_disable_level _Per_CPU_Get()->thread_dispatch_disable_level |
#define | _Thread_Heir _Per_CPU_Get()->heir |
#define | _Thread_Executing _Per_CPU_Get_executing( _Per_CPU_Get() ) |
#define | _ISR_Nest_level _Per_CPU_Get()->isr_nest_level |
#define | _CPU_Interrupt_stack_low _Per_CPU_Get()->interrupt_stack_low |
#define | _CPU_Interrupt_stack_high _Per_CPU_Get()->interrupt_stack_high |
#define | _Thread_Dispatch_necessary _Per_CPU_Get()->dispatch_necessary |
Typedefs | |
typedef void(* | Per_CPU_Job_handler) (void *arg) |
typedef struct Per_CPU_Job | Per_CPU_Job |
A per-processor job. More... | |
typedef struct Per_CPU_Control | Per_CPU_Control |
Per CPU Core Structure. More... | |
Enumerations | |
enum | Per_CPU_State { PER_CPU_STATE_INITIAL, PER_CPU_STATE_READY_TO_START_MULTITASKING, PER_CPU_STATE_REQUEST_START_MULTITASKING, PER_CPU_STATE_UP, PER_CPU_STATE_SHUTDOWN } |
State of a processor. More... | |
enum | Per_CPU_Watchdog_index { PER_CPU_WATCHDOG_TICKS, PER_CPU_WATCHDOG_REALTIME, PER_CPU_WATCHDOG_MONOTONIC, PER_CPU_WATCHDOG_COUNT } |
Per-CPU watchdog header index. More... | |
Functions | |
static Per_CPU_Control * | _Per_CPU_Get (void) |
static Per_CPU_Control * | _Per_CPU_Get_by_index (uint32_t index) |
static uint32_t | _Per_CPU_Get_index (const Per_CPU_Control *cpu) |
static struct _Thread_Control * | _Per_CPU_Get_executing (const Per_CPU_Control *cpu) |
static bool | _Per_CPU_Is_processor_online (const Per_CPU_Control *cpu) |
static bool | _Per_CPU_Is_boot_processor (const Per_CPU_Control *cpu) |
static __inline__ void | _Per_CPU_Acquire_all (ISR_lock_Context *lock_context) |
static __inline__ void | _Per_CPU_Release_all (ISR_lock_Context *lock_context) |
void | _Per_CPU_Initialize (void) |
Allocate and Initialize Per CPU Structures. More... | |
void | _Per_CPU_State_change (Per_CPU_Control *cpu, Per_CPU_State new_state) |
bool | _Per_CPU_State_wait_for_non_initial_state (uint32_t cpu_index, uint32_t timeout_in_ns) |
Waits for a processor to change into a non-initial state. More... | |
void | _Per_CPU_Perform_jobs (Per_CPU_Control *cpu) |
Performs the jobs of the specified processor in FIFO order. More... | |
void | _Per_CPU_Add_job (Per_CPU_Control *cpu, Per_CPU_Job *job) |
Adds the job to the tail of the processing list of the specified processor. More... | |
void | _Per_CPU_Wait_for_job (const Per_CPU_Control *cpu, const Per_CPU_Job *job) |
Waits for the job carried out by the specified processor. More... | |
static __inline__ struct _Thread_Control * | _Thread_Get_executing (void) |
Returns the thread control block of the executing thread. More... | |
Variables | |
Per_CPU_Control_envelope _Per_CPU_Information [] | CPU_STRUCTURE_ALIGNMENT |
Set of Per CPU Core Information. More... | |
This defines the per CPU state information required by RTEMS and the BSP. In an SMP configuration, there will be multiple instances of this data structure – one per CPU – and the current CPU number will be used as the index.
typedef struct Per_CPU_Control Per_CPU_Control |
Per CPU Core Structure.
This structure is used to hold per core state information.
typedef struct Per_CPU_Job Per_CPU_Job |
A per-processor job.
This structure must be as small as possible due to stack space constraints in _SMP_Multicast_action().
enum Per_CPU_State |
State of a processor.
The processor state controls the life cycle of processors at the lowest level. No multi-threading or other high-level concepts matter here.
State changes must be initiated via _Per_CPU_State_change(). This function may not return in case someone requested a shutdown. The _SMP_Send_message() function will be used to notify other processors about state changes if the other processor is in the up state.
Due to the sequential nature of the basic system initialization one processor has a special role. It is the processor executing the boot_card() function. This processor is called the boot processor. All other processors are called secondary.
Per-CPU watchdog header index.
void _Per_CPU_Add_job | ( | Per_CPU_Control * | cpu, |
Per_CPU_Job * | job | ||
) |
Adds the job to the tail of the processing list of the specified processor.
This function does not send the SMP_MESSAGE_PERFORM_JOBS message the specified processor.
[in,out] | cpu | The processor to add the job. |
[in,out] | job | The job. The Per_CPU_Job::context member must be initialized by the caller. |
Definition at line 64 of file smpmulticastaction.c.
void _Per_CPU_Initialize | ( | void | ) |
Allocate and Initialize Per CPU Structures.
This method allocates and initialize the per CPU structure.
void _Per_CPU_Perform_jobs | ( | Per_CPU_Control * | cpu | ) |
Performs the jobs of the specified processor in FIFO order.
[in,out] | cpu | The jobs of this processor will be performed. |
Definition at line 41 of file smpmulticastaction.c.
bool _Per_CPU_State_wait_for_non_initial_state | ( | uint32_t | cpu_index, |
uint32_t | timeout_in_ns | ||
) |
Waits for a processor to change into a non-initial state.
This function should be called only in _CPU_SMP_Start_processor() if required by the CPU port or BSP.
[in] | cpu_index | The processor index. |
[in] | timeout_in_ns | The timeout in nanoseconds. Use a value of zero to wait forever if necessary. |
true | The processor is in a non-initial state. |
false | The timeout expired before the processor reached a non-initial state. |
Definition at line 22 of file percpustatewait.c.
void _Per_CPU_Wait_for_job | ( | const Per_CPU_Control * | cpu, |
const Per_CPU_Job * | job | ||
) |
Waits for the job carried out by the specified processor.
This function may result in an SMP_FATAL_WRONG_CPU_STATE_TO_PERFORM_JOBS fatal error.
[in] | cpu | The processor carrying out the job. |
[in] | job | The job to wait for. |
Definition at line 105 of file smpmulticastaction.c.
|
static |
Returns the thread control block of the executing thread.
This function can be called in any thread context. On SMP configurations, interrupts are disabled to ensure that the processor index is used consistently if no CPU port specific method is available to get the executing thread.
Per_CPU_Control_envelope _Per_CPU_Information [] CPU_STRUCTURE_ALIGNMENT |
Set of Per CPU Core Information.
This is an array of per CPU core information.