ChibiOS
0.0.0
|
![]() |
Non portable code templates.
Macros | |
#define | PORT_IDLE_THREAD_STACK_SIZE 32 |
Stack size for the system idle thread. More... | |
#define | PORT_INT_REQUIRED_STACK 256 |
Per-thread stack overhead for interrupts servicing. More... | |
#define | PORT_USE_ALT_TIMER FALSE |
Enables an alternative timer implementation. More... | |
#define | PORT_XXX_ENABLE_WFI_IDLE FALSE |
Enables a "wait for interrupt" instruction in the idle loop. More... | |
#define | PORT_SETUP_CONTEXT(tp, wbase, wtop, pf, arg) |
Platform dependent part of the chThdCreateI() API. More... | |
#define | PORT_WA_SIZE(n) |
Computes the thread working area global size. More... | |
#define | PORT_WORKING_AREA(s, n) stkalign_t s[THD_WORKING_AREA_SIZE(n) / sizeof (stkalign_t)] |
Static working area allocation. More... | |
#define | PORT_IRQ_IS_VALID_PRIORITY(n) false |
Priority level verification macro. More... | |
#define | PORT_IRQ_IS_VALID_KERNEL_PRIORITY(n) false |
Priority level verification macro. More... | |
#define | PORT_IRQ_PROLOGUE() |
IRQ prologue code. More... | |
#define | PORT_IRQ_EPILOGUE() |
IRQ epilogue code. More... | |
#define | PORT_IRQ_HANDLER(id) void id(void) |
IRQ handler function declaration. More... | |
#define | PORT_FAST_IRQ_HANDLER(id) void id(void) |
Fast IRQ handler function declaration. More... | |
#define | port_switch(ntp, otp) _port_switch(ntp, otp) |
Performs a context switch between two threads. More... | |
Port Capabilities and Constants | |
#define | PORT_SUPPORTS_RT FALSE |
This port supports a realtime counter. More... | |
#define | PORT_NATURAL_ALIGN sizeof (void *) |
Natural alignment constant. More... | |
#define | PORT_STACK_ALIGN sizeof (stkalign_t) |
Stack alignment constant. More... | |
#define | PORT_WORKING_AREA_ALIGN sizeof (stkalign_t) |
Working Areas alignment constant. More... | |
Architecture and Compiler | |
#define | PORT_ARCHITECTURE_XXX |
Macro defining an XXX architecture. More... | |
#define | PORT_ARCHITECTURE_XXX_YYY |
Macro defining the specific XXX architecture. More... | |
#define | PORT_ARCHITECTURE_NAME "XXX Architecture" |
Name of the implemented architecture. More... | |
#define | PORT_COMPILER_NAME "GCC " __VERSION__ |
Compiler name and version. More... | |
#define | PORT_INFO "no info" |
Port-specific information string. More... | |
Typedefs | |
typedef uint64_t | stkalign_t |
Type of stack and memory alignment enforcement. More... | |
Data Structures | |
struct | port_extctx |
Interrupt saved context. More... | |
struct | port_intctx |
System saved context. More... | |
struct | port_context |
Platform dependent part of the thread_t structure. More... | |
Functions | |
void | _port_init (void) |
Port-related initialization code. More... | |
void | _port_switch (thread_t *ntp, thread_t *otp) |
Performs a context switch between two threads. More... | |
static syssts_t | port_get_irq_status (void) |
Returns a word encoding the current interrupts status. More... | |
static bool | port_irq_enabled (syssts_t sts) |
Checks the interrupt status. More... | |
static bool | port_is_isr_context (void) |
Determines the current execution context. More... | |
static void | port_lock (void) |
Kernel-lock action. More... | |
static void | port_unlock (void) |
Kernel-unlock action. More... | |
static void | port_lock_from_isr (void) |
Kernel-lock action from an interrupt handler. More... | |
static void | port_unlock_from_isr (void) |
Kernel-unlock action from an interrupt handler. More... | |
static void | port_disable (void) |
Disables all the interrupt sources. More... | |
static void | port_suspend (void) |
Disables the interrupt sources below kernel-level priority. More... | |
static void | port_enable (void) |
Enables all the interrupt sources. More... | |
static void | port_wait_for_interrupt (void) |
Enters an architecture-dependent IRQ-waiting mode. More... | |
static rtcnt_t | port_rt_get_counter_value (void) |
Returns the current value of the realtime counter. More... | |
#define PORT_SUPPORTS_RT FALSE |
#define PORT_NATURAL_ALIGN sizeof (void *) |
Natural alignment constant.
Definition at line 50 of file chcore.h.
Referenced by chCoreAlloc(), chCoreAllocI(), chGuardedPoolObjectInit(), and chPoolObjectInit().
#define PORT_STACK_ALIGN sizeof (stkalign_t) |
Stack alignment constant.
Definition at line 56 of file chcore.h.
Referenced by chThdCreateStatic(), and chThdCreateSuspendedI().
#define PORT_WORKING_AREA_ALIGN sizeof (stkalign_t) |
Working Areas alignment constant.
Definition at line 62 of file chcore.h.
Referenced by chThdCreateFromHeap(), chThdCreateStatic(), and chThdCreateSuspendedI().
#define PORT_ARCHITECTURE_XXX |
#define PORT_ARCHITECTURE_XXX_YYY |
#define PORT_ARCHITECTURE_NAME "XXX Architecture" |
#define PORT_COMPILER_NAME "GCC " __VERSION__ |
#define PORT_INFO "no info" |
#define PORT_IDLE_THREAD_STACK_SIZE 32 |
#define PORT_INT_REQUIRED_STACK 256 |
#define PORT_USE_ALT_TIMER FALSE |
#define PORT_XXX_ENABLE_WFI_IDLE FALSE |
#define PORT_SETUP_CONTEXT | ( | tp, | |
wbase, | |||
wtop, | |||
pf, | |||
arg | |||
) |
Platform dependent part of the chThdCreateI()
API.
This code usually setup the context switching frame represented by an port_intctx
structure.
Definition at line 200 of file chcore.h.
Referenced by chSysInit(), chThdCreateStatic(), and chThdCreateSuspendedI().
#define PORT_WA_SIZE | ( | n | ) |
Computes the thread working area global size.
#define PORT_WORKING_AREA | ( | s, | |
n | |||
) | stkalign_t s[THD_WORKING_AREA_SIZE(n) / sizeof (stkalign_t)] |
#define PORT_IRQ_IS_VALID_PRIORITY | ( | n | ) | false |
#define PORT_IRQ_IS_VALID_KERNEL_PRIORITY | ( | n | ) | false |
#define PORT_IRQ_PROLOGUE | ( | ) |
#define PORT_IRQ_EPILOGUE | ( | ) |
#define PORT_IRQ_HANDLER | ( | id | ) | void id(void) |
#define PORT_FAST_IRQ_HANDLER | ( | id | ) | void id(void) |
#define port_switch | ( | ntp, | |
otp | |||
) | _port_switch(ntp, otp) |
Performs a context switch between two threads.
This is the most critical code in any port, this function is responsible for the context switch between 2 threads.
[in] | ntp | the thread to be switched in |
[in] | otp | the thread to be switched out |
Definition at line 271 of file chcore.h.
Referenced by chSchDoReschedule(), chSchGoSleepTimeoutS(), and chSysInit().
typedef uint64_t stkalign_t |
void _port_init | ( | void | ) |
Performs a context switch between two threads.
This is the most critical code in any port, this function is responsible for the context switch between 2 threads.
[in] | ntp | the thread to be switched in |
[in] | otp | the thread to be switched out |
|
inlinestatic |
Returns a word encoding the current interrupts status.
Definition at line 313 of file chcore.h.
Referenced by chSysGetStatusAndLockX(), chSysUnconditionalLock(), and chSysUnconditionalUnlock().
|
inlinestatic |
Checks the interrupt status.
[in] | sts | the interrupt status word |
false | the word specified a disabled interrupts status. |
true | the word specified an enabled interrupts status. |
Definition at line 327 of file chcore.h.
Referenced by chSysGetStatusAndLockX(), chSysRestoreStatusX(), chSysUnconditionalLock(), and chSysUnconditionalUnlock().
|
inlinestatic |
Determines the current execution context.
false | not running in ISR mode. |
true | running in ISR mode. |
Definition at line 341 of file chcore.h.
Referenced by chSysGetStatusAndLockX(), and chSysRestoreStatusX().
|
inlinestatic |
Kernel-lock action.
Usually this function just disables interrupts but may perform more actions.
Definition at line 351 of file chcore.h.
Referenced by chSysLock().
|
inlinestatic |
Kernel-unlock action.
Usually this function just enables interrupts but may perform more actions.
Definition at line 360 of file chcore.h.
Referenced by chSysUnlock().
|
inlinestatic |
Kernel-lock action from an interrupt handler.
This function is invoked before invoking I-class APIs from interrupt handlers. The implementation is architecture dependent, in its simplest form it is void.
Definition at line 370 of file chcore.h.
Referenced by _dbg_check_enter_isr(), _dbg_check_leave_isr(), _stats_increase_irq(), _trace_isr_enter(), _trace_isr_leave(), and chSysLockFromISR().
|
inlinestatic |
Kernel-unlock action from an interrupt handler.
This function is invoked after invoking I-class APIs from interrupt handlers. The implementation is architecture dependent, in its simplest form it is void.
Definition at line 380 of file chcore.h.
Referenced by _dbg_check_enter_isr(), _dbg_check_leave_isr(), _stats_increase_irq(), _trace_isr_enter(), _trace_isr_leave(), and chSysUnlockFromISR().
|
inlinestatic |
Disables all the interrupt sources.
Definition at line 388 of file chcore.h.
Referenced by chSysDisable(), and chSysHalt().
|
inlinestatic |
Disables the interrupt sources below kernel-level priority.
Definition at line 396 of file chcore.h.
Referenced by chSysSuspend().
|
inlinestatic |
Enables all the interrupt sources.
Definition at line 403 of file chcore.h.
Referenced by chSysEnable().
|
inlinestatic |
Enters an architecture-dependent IRQ-waiting mode.
The function is meant to return when an interrupt becomes pending. The simplest implementation is an empty function or macro but this would not take advantage of architecture-specific power saving modes.
Definition at line 414 of file chcore.h.
Referenced by _idle_thread().