RTEMS
Classes | Macros | Typedefs | Enumerations | Functions | Variables
percpu.h File Reference
#include <rtems/score/cpuimpl.h>
#include <rtems/score/assert.h>
#include <rtems/score/chain.h>
#include <rtems/score/isrlock.h>
#include <rtems/score/smp.h>
#include <rtems/score/timestamp.h>
#include <rtems/score/watchdog.h>

Go to the source code of this file.

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_CONTROL_SIZE_APPROX   ( 180 + CPU_PER_CPU_CONTROL_SIZE + CPU_INTERRUPT_FRAME_SIZE )
 
#define PER_CPU_CONTROL_SIZE_LOG2   8
 
#define PER_CPU_CONTROL_SIZE   ( 1 << PER_CPU_CONTROL_SIZE_LOG2 )
 
#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...
 

Detailed Description

This include file defines the per CPU information required by RTEMS.

Definition in file percpu.h.