RTEMS
|
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_Control * | executing |
This is the thread executing on this processor. More... | |
struct _Thread_Control * | heir |
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_Control * | ancestor |
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 |
Per CPU Core Structure.
This structure is used to hold per core state information.
struct _Thread_Control* Per_CPU_Control::ancestor |
The ancestor of the executing thread.
This member is used by _User_extensions_Thread_switch().
const struct Scheduler_Context* Per_CPU_Control::context |
const struct _Scheduler_Control* Per_CPU_Control::control |
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.
char* Per_CPU_Control::data |
Begin of the per-CPU data area.
Contains items defined via PER_CPU_DATA_ITEM().
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.
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.
struct Per_CPU_Job* Per_CPU_Control::head |
Watchdog_Header Per_CPU_Control::Header[PER_CPU_WATCHDOG_COUNT] |
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.
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.
uint32_t Per_CPU_Control::isr_nest_level |
struct { ... } Per_CPU_Control::Jobs |
FIFO list of jobs to be performed by this processor.
ISR_lock_Control Per_CPU_Control::Lock |
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.
Atomic_Ulong Per_CPU_Control::message |
Per_CPU_State Per_CPU_Control::state |
struct Per_CPU_Job** Per_CPU_Control::tail |
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.
uint64_t Per_CPU_Control::ticks |