RTEMS
Public Attributes | List of all members
Per_CPU_Control Struct Reference

Per CPU Core Structure. More...

#include <percpu.h>

Public Attributes

void * interrupt_stack_low
 The interrupt stack low address for this processor.
 
void * interrupt_stack_high
 The interrupt stack high address for this processor.
 
uint32_t isr_nest_level
 
uint32_t isr_dispatch_disable
 Indicates if an ISR thread dispatch is disabled. More...
 
volatile uint32_t thread_dispatch_disable_level
 The thread dispatch critical section nesting counter which is used to prevent context switches at inopportune moments.
 
volatile bool dispatch_necessary
 This is set to true when this processor needs to run the thread dispatcher. More...
 
bool reserved_for_executing_alignment [3]
 
struct _Thread_Controlexecuting
 This is the thread executing on this processor. More...
 
struct _Thread_Controlheir
 This is the heir thread for this processor. More...
 
CPU_Interrupt_frame Interrupt_frame
 
Timestamp_Control cpu_usage_timestamp
 The CPU usage timestamp contains the time point of the last heir thread change or last CPU usage update of the executing thread of this processor. More...
 
struct {
   uint64_t   ticks
 Protects all watchdog operations on this processor. More...
 
   Watchdog_Header   Header [PER_CPU_WATCHDOG_COUNT]
 Header for watchdogs. More...
 
Watchdog
 Watchdog state for this processor.
 
ISR_lock_Control Lock
 This lock protects some members of this structure. More...
 
ISR_lock_Context Lock_context
 Lock context used to acquire all per-CPU locks. More...
 
Chain_Control Threads_in_need_for_help
 Chain of threads in need for help. More...
 
Atomic_Ulong message
 Bit field for SMP messages. More...
 
struct {
   const struct _Scheduler_Control *   control
 The scheduler control of the scheduler owning this processor. More...
 
   const struct Scheduler_Context *   context
 The scheduler context of the scheduler owning this processor. More...
 
   struct _Thread_Control *   idle_if_online_and_unused
 The idle thread for this processor in case it is online and currently not used by a scheduler instance.
 
Scheduler
 
struct _Thread_Controlancestor
 The ancestor of the executing thread. More...
 
char * data
 Begin of the per-CPU data area. More...
 
Per_CPU_State state
 Indicates the current state of the CPU. More...
 
struct {
   ISR_lock_Control   Lock
 Lock to protect the FIFO list of jobs to be performed by this processor.
 
   struct Per_CPU_Job *   head
 Head of the FIFO list of jobs to be performed by this processor. More...
 
   struct Per_CPU_Job **   tail
 Tail of the FIFO list of jobs to be performed by this processor. More...
 
Jobs
 FIFO list of jobs to be performed by this processor. More...
 
bool online
 Indicates if the processor has been successfully started via _CPU_SMP_Start_processor().
 
bool boot
 Indicates if the processor is the one that performed the initial system initialization.
 
struct Record_Control * record
 
Per_CPU_Stats Stats
 

Detailed Description

Per CPU Core Structure.

This structure is used to hold per core state information.

Definition at line 347 of file percpu.h.

Member Data Documentation

◆ ancestor

struct _Thread_Control* Per_CPU_Control::ancestor

The ancestor of the executing thread.

This member is used by _User_extensions_Thread_switch().

Definition at line 536 of file percpu.h.

◆ context

const struct Scheduler_Context* Per_CPU_Control::context

The scheduler context of the scheduler owning this processor.

This pointer is NULL in case this processor is currently not used by a scheduler instance.

Definition at line 522 of file percpu.h.

◆ control

const struct _Scheduler_Control* Per_CPU_Control::control

The scheduler control of the scheduler owning this processor.

This pointer is NULL in case this processor is currently not used by a scheduler instance.

Definition at line 514 of file percpu.h.

◆ cpu_usage_timestamp

Timestamp_Control Per_CPU_Control::cpu_usage_timestamp

The CPU usage timestamp contains the time point of the last heir thread change or last CPU usage update of the executing thread of this processor.

Protected by the scheduler lock.

See also
_Scheduler_Update_heir(), _Thread_Dispatch_update_heir() and _Thread_Get_CPU_time_used().

Definition at line 452 of file percpu.h.

◆ data

char* Per_CPU_Control::data

Begin of the per-CPU data area.

Contains items defined via PER_CPU_DATA_ITEM().

Definition at line 543 of file percpu.h.

◆ dispatch_necessary

volatile bool Per_CPU_Control::dispatch_necessary

This is set to true when this processor needs to run the thread dispatcher.

It is volatile since interrupts may alter this flag.

This member is not protected by a lock and must be accessed only by this processor. Code (e.g. scheduler and post-switch action requests) running on another processors must use an inter-processor interrupt to set the thread dispatch necessary indicator to true.

See also
_Thread_Get_heir_and_make_it_executing().

Definition at line 400 of file percpu.h.

◆ executing

struct _Thread_Control* Per_CPU_Control::executing

This is the thread executing on this processor.

This member is not protected by a lock. The only writer is this processor.

On SMP configurations a thread may be registered as executing on more than one processor in case a thread migration is in progress. On SMP configurations use _Thread_Is_executing_on_a_processor() to figure out if a thread context is executing on a processor.

Definition at line 420 of file percpu.h.

◆ head

struct Per_CPU_Job* Per_CPU_Control::head

Head of the FIFO list of jobs to be performed by this processor.

This member is protected by the Per_CPU_Control::Jobs::Lock lock.

Definition at line 572 of file percpu.h.

◆ Header

Watchdog_Header Per_CPU_Control::Header[PER_CPU_WATCHDOG_COUNT]

Header for watchdogs.

See also
Per_CPU_Watchdog_index.

Definition at line 474 of file percpu.h.

◆ heir

struct _Thread_Control* Per_CPU_Control::heir

This is the heir thread for this processor.

This member is not protected by a lock. The only writer after multitasking start is the scheduler owning this processor. It is assumed that stores to pointers are atomic on all supported SMP architectures. The CPU port specific code (inter-processor interrupt handling and _CPU_SMP_Send_interrupt()) must guarantee that this processor observes the last value written.

A thread can be a heir on at most one processor in the system.

See also
_Thread_Get_heir_and_make_it_executing().

Definition at line 436 of file percpu.h.

◆ isr_dispatch_disable

uint32_t Per_CPU_Control::isr_dispatch_disable

Indicates if an ISR thread dispatch is disabled.

This flag is context switched with each thread. It indicates that this thread has an interrupt stack frame on its stack. By using this flag, we can avoid nesting more interrupt dispatching attempts on a previously interrupted thread's stack.

Definition at line 379 of file percpu.h.

◆ isr_nest_level

uint32_t Per_CPU_Control::isr_nest_level

This contains the current interrupt nesting level on this CPU.

Definition at line 369 of file percpu.h.

◆ Jobs

struct { ... } Per_CPU_Control::Jobs

FIFO list of jobs to be performed by this processor.

See also
_SMP_Multicast_action().

◆ Lock

ISR_lock_Control Per_CPU_Control::Lock

This lock protects some members of this structure.

Lock to protect the FIFO list of jobs to be performed by this processor.

Definition at line 481 of file percpu.h.

◆ Lock_context

ISR_lock_Context Per_CPU_Control::Lock_context

Lock context used to acquire all per-CPU locks.

This member is protected by the Per_CPU_Control::Lock lock.

See also
_Per_CPU_Acquire_all().

Definition at line 490 of file percpu.h.

◆ message

Atomic_Ulong Per_CPU_Control::message

Bit field for SMP messages.

This member is not protected locks. Atomic operations are used to set and get the message bits.

Definition at line 505 of file percpu.h.

◆ state

Per_CPU_State Per_CPU_Control::state

Indicates the current state of the CPU.

This member is protected by the _Per_CPU_State_lock lock.

See also
_Per_CPU_State_change().

Definition at line 552 of file percpu.h.

◆ tail

struct Per_CPU_Job** Per_CPU_Control::tail

Tail of the FIFO list of jobs to be performed by this processor.

This member is only valid if the head is not NULL.

This member is protected by the Per_CPU_Control::Jobs::Lock lock.

Definition at line 582 of file percpu.h.

◆ Threads_in_need_for_help

Chain_Control Per_CPU_Control::Threads_in_need_for_help

Chain of threads in need for help.

This member is protected by the Per_CPU_Control::Lock lock.

Definition at line 497 of file percpu.h.

◆ ticks

uint64_t Per_CPU_Control::ticks

Protects all watchdog operations on this processor.

Watchdog ticks on this processor used for monotonic clock watchdogs.

Definition at line 467 of file percpu.h.


The documentation for this struct was generated from the following file: