|
ChibiOS 21.11.4
|
Non portable code templates.

Port Capabilities and Constants | |
| #define | PORT_SUPPORTS_RT FALSE |
| This port supports a realtime counter. | |
| #define | PORT_NATURAL_ALIGN sizeof (void *) |
| Natural alignment constant. | |
| #define | PORT_STACK_ALIGN sizeof (stkalign_t) |
| Stack alignment constant. | |
| #define | PORT_WORKING_AREA_ALIGN sizeof (stkalign_t) |
| Working Areas alignment constant. | |
Architecture and Compiler | |
| #define | PORT_ARCHITECTURE_XXX |
| Macro defining an XXX architecture. | |
| #define | PORT_ARCHITECTURE_XXX_YYY |
| Macro defining the specific XXX architecture. | |
| #define | PORT_ARCHITECTURE_NAME "XXX Architecture" |
| Name of the implemented architecture. | |
| #define | PORT_COMPILER_NAME "GCC " __VERSION__ |
| Compiler name and version. | |
| #define | PORT_INFO "no info" |
| Port-specific information string. | |
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... | |
Macros | |
| #define | PORT_IDLE_THREAD_STACK_SIZE 32 |
| Stack size for the system idle thread. | |
| #define | PORT_INT_REQUIRED_STACK 256 |
| Per-thread stack overhead for interrupts servicing. | |
| #define | PORT_XXX_ENABLE_WFI_IDLE FALSE |
| Enables a "wait for interrupt" instruction in the idle loop. | |
| #define | PORT_THD_FUNCTION(tname, arg) |
| Optimized thread function declaration macro. | |
| #define | PORT_SETUP_CONTEXT(tp, wbase, wtop, pf, arg) |
Platform dependent part of the chThdCreateI() API. | |
| #define | PORT_WA_SIZE(n) |
| Computes the thread working area global size. | |
| #define | PORT_WORKING_AREA(s, n) |
| Static working area allocation. | |
| #define | PORT_IRQ_IS_VALID_PRIORITY(n) |
| Priority level verification macro. | |
| #define | PORT_IRQ_IS_VALID_KERNEL_PRIORITY(n) |
| Priority level verification macro. | |
| #define | PORT_IRQ_PROLOGUE() |
| IRQ prologue code. | |
| #define | PORT_IRQ_EPILOGUE() |
| IRQ epilogue code. | |
| #define | PORT_IRQ_HANDLER(id) |
| IRQ handler function declaration. | |
| #define | PORT_FAST_IRQ_HANDLER(id) |
| Fast IRQ handler function declaration. | |
| #define | port_switch(ntp, otp) |
| Performs a context switch between two threads. | |
| #define | port_get_lock_status() |
| Returns a word representing a critical section status. | |
| #define | port_is_locked(sts) |
| Determines if in a critical section. | |
Functions | |
| void | _port_init (void) |
| Port-related initialization code. | |
| void | _port_switch (thread_t *ntp, thread_t *otp) |
| Performs a context switch between two threads. | |
| static bool | port_is_isr_context (void) |
| Determines the current execution context. | |
| static void | port_lock (void) |
| Kernel-lock action. | |
| static void | port_unlock (void) |
| Kernel-unlock action. | |
| static void | port_lock_from_isr (void) |
| Kernel-lock action from an interrupt handler. | |
| static void | port_unlock_from_isr (void) |
| Kernel-unlock action from an interrupt handler. | |
| static void | port_disable (void) |
| Disables all the interrupt sources. | |
| static void | port_suspend (void) |
| Disables the interrupt sources below kernel-level priority. | |
| static void | port_enable (void) |
| Enables all the interrupt sources. | |
| static void | port_wait_for_interrupt (void) |
| Enters an architecture-dependent IRQ-waiting mode. | |
| static rtcnt_t | port_rt_get_counter_value (void) |
| Returns the current value of the realtime counter. | |
| #define PORT_SUPPORTS_RT FALSE |
| #define PORT_NATURAL_ALIGN sizeof (void *) |
Natural alignment constant.
Definition at line 50 of file chcore.h.
Referenced by chCacheObjectInit(), chCoreAlloc(), chCoreAllocI(), chFifoObjectInit(), chGuardedPoolObjectInit(), chPoolObjectInit(), and chPoolObjectInitAligned().
| #define PORT_STACK_ALIGN sizeof (stkalign_t) |
Stack alignment constant.
Definition at line 56 of file chcore.h.
Referenced by chThdCreateI(), 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(), chThdCreateI(), 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 |
Stack size for the system idle thread.
This size depends on the idle thread implementation, usually the idle thread should take no more space than those reserved by PORT_INT_REQUIRED_STACK.
Definition at line 111 of file chcore.h.
Referenced by THD_WORKING_AREA(), and THD_WORKING_AREA().
| #define PORT_INT_REQUIRED_STACK 256 |
| #define PORT_XXX_ENABLE_WFI_IDLE FALSE |
| #define PORT_THD_FUNCTION | ( | tname, | |
| arg ) |
| #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 189 of file chcore.h.
Referenced by chThdCreateI(), chThdCreateStatic(), and chThdCreateSuspendedI().
| #define PORT_WA_SIZE | ( | n | ) |
Computes the thread working area global size.
| #define PORT_WORKING_AREA | ( | s, | |
| n ) |
Static working area allocation.
This macro is used to allocate a static thread working area aligned as both position and size.
| [in] | s | the name to be assigned to the stack array |
| [in] | n | the stack size to be assigned to the thread |
| #define PORT_IRQ_IS_VALID_PRIORITY | ( | n | ) |
| #define PORT_IRQ_IS_VALID_KERNEL_PRIORITY | ( | n | ) |
| #define PORT_IRQ_PROLOGUE | ( | ) |
| #define PORT_IRQ_EPILOGUE | ( | ) |
| #define PORT_IRQ_HANDLER | ( | id | ) |
| #define PORT_FAST_IRQ_HANDLER | ( | id | ) |
| #define 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 268 of file chcore.h.
Referenced by chSchDoPreemption(), and chSchGoSleepTimeoutS().
| #define port_get_lock_status | ( | ) |
Returns a word representing a critical section status.
Definition at line 283 of file chcore.h.
Referenced by chSysGetStatusAndLockX(), chSysUnconditionalLock(), chSysUnconditionalLock(), chSysUnconditionalUnlock(), and chSysUnconditionalUnlock().
| #define port_is_locked | ( | sts | ) |
Determines if in a critical section.
| [in] | sts | status word returned by port_get_lock_status() |
| false | if running outside a critical section. |
| true | if running within a critical section. |
Definition at line 293 of file chcore.h.
Referenced by chSysGetStatusAndLockX(), chSysRestoreStatusX(), chSysUnconditionalLock(), chSysUnconditionalLock(), chSysUnconditionalUnlock(), and chSysUnconditionalUnlock().
| 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 |
Determines the current execution context.
| false | not running in ISR mode. |
| true | running in ISR mode. |
Definition at line 329 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 339 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 348 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 358 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 368 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 376 of file chcore.h.
Referenced by chSysDisable(), and chSysHalt().
|
inlinestatic |
Disables the interrupt sources below kernel-level priority.
Definition at line 384 of file chcore.h.
Referenced by chSysSuspend().
|
inlinestatic |
Enables all the interrupt sources.
Definition at line 391 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 402 of file chcore.h.
Referenced by __idle_thread().