Choco OS
V.0.16.9.0
Join to the chocolate world
|
Contains machine core specific functions. More...
#include <oc_interrupts_defs.h>
#include <oc_assert.h>
#include <oc_stdtypes.h>
#include <stdbool.h>
#include <oc_mcs_defs.h>
#include <stddef.h>
#include <oc_memory.h>
#include <oc_errors.h>
Go to the source code of this file.
Data Structures | |
struct | oC_StackData_t |
stores stack data More... | |
struct | oC_MCS_MemoryRegionConfig_t |
configuration structure for the memory region More... | |
Macros | |
#define | oC_MCS_IsStackPushDecrementPointer() |
returns true if stack push decrements SP More... | |
#define | oC_MCS_AlignStackPointer(Pointer) |
align pointer to the stack alignment More... | |
#define | oC_MCS_AlignPointer(Pointer) |
align pointer to the machine alignment More... | |
#define | oC_MCS_AlignSize(Size, Alignment) |
align size to the machine alignment More... | |
#define | oC_MCS_IsStackPointerAligned(Pointer) |
checks if stack pointer is aligned to the machine stack memory alignment | |
#define | oC_MCS_IsPointerAligned(Pointer) |
checks if pointer is aligned to the machine memory alignment | |
Typedefs | |
typedef void(* | oC_ContextHandler_t) (void *ContextParameter) |
stores handler of function, that handles context More... | |
typedef void(* | oC_ContextExitHandler_t) (void) |
stores handler of function called, when context handling is finished More... | |
typedef oC_StackData_t * | oC_Stack_t |
type for storing stack reference More... | |
typedef void(* | oC_FindNextStackHandler_t) (void) |
stores pointer to function for searching next stack More... | |
Enumerations |
Functions | |
bool | oC_MCS_InitializeModule (void) |
initializes module to work More... | |
void * | oC_MCS_GetHardFaultReason (void) |
returns address that cause a hard fault More... | |
void | oC_MCS_EnableInterrupts (void) |
Globally enables interrupts (always) More... | |
void | oC_MCS_DisableInterrupts (void) |
Globally disables interrupts (always) More... | |
bool | oC_MCS_AreInterruptsEnabled (void) |
Checks if interrupts are enabled in HW. More... | |
bool | oC_MCS_EnableInterrupt (IRQn_Type InterruptNumber) |
enables interrupt with specified number More... | |
bool | oC_MCS_DisableInterrupt (IRQn_Type InterruptNumber) |
disables interrupt with specified number More... | |
bool | oC_MCS_IsInterruptEnabled (IRQn_Type InterruptNumber) |
checks if interrupt is enabled More... | |
bool | oC_MCS_SetInterruptPriority (IRQn_Type InterruptNumber, oC_InterruptPriotity_t Priority) |
sets interrupt priority More... | |
oC_InterruptPriotity_t | oC_MCS_GetInterruptPriority (IRQn_Type InterruptNumber) |
returns interrupt priority More... | |
void | oC_MCS_Reboot (void) |
Software reboots of machine. More... | |
bool | oC_MCS_InitializeStack (oC_Stack_t *outStack, void *Buffer, oC_Int_t BufferSize, oC_ContextHandler_t ContextHandler, void *HandlerParameter, oC_ContextExitHandler_t ExitHandler) |
initializes stack for the system More... | |
void * | oC_MCS_GetCurrentProcessStackPointer (void) |
returns current value of PSP More... | |
void * | oC_MCS_GetCurrentMainStackPointer (void) |
returns current value of MSP More... | |
oC_Int_t | oC_MCS_GetStackSize (oC_Stack_t Stack) |
returns size of stack More... | |
oC_Int_t | oC_MCS_GetFreeStackSize (oC_Stack_t Stack) |
returns number of free stack More... | |
oC_Stack_t | oC_MCS_GetCurrentStack (void) |
returns current stack More... | |
oC_Int_t | oC_MCS_GetMinimumStackBufferSize (oC_Int_t StackSize) |
returns minimum stack buffer size More... | |
bool | oC_MCS_SetNextStack (oC_Stack_t Stack) |
sets next stack for context switching More... | |
bool | oC_MCS_ConfigureSystemTimer (oC_UInt_t Prescaler, oC_FindNextStackHandler_t FindNextStackHandler) |
configures system timer More... | |
oC_Stack_t | oC_MCS_GetSystemStack (void) |
returns pointer to the system stack More... | |
bool | oC_MCS_ReturnToSystemStack (void) |
sets next stack as system stack More... | |
void | oC_MCS_Delay (register oC_UInt_t Cycles) |
delays operations for cycles More... | |
oC_ErrorCode_t | oC_MCS_ConfigureMemoryRegion (const oC_MCS_MemoryRegionConfig_t *Config) |
configures memory region More... | |
uint32_t | oC_MCS_GetMaximumNumberOfRegions (void) |
returns maximum number of regions handled by the machine More... | |
uint32_t | oC_MCS_GetNumberOfRegions (void) |
returns number of regions that are currently configured More... | |
bool | oC_MCS_ReadFreeRegionNumber (uint32_t *outFreeRegionNumber) |
reads number of a free region More... | |
bool | oC_MCS_SetMemoryAccessMode (oC_MCS_MemoryAccessMode_t Mode) |
sets the memory access mode More... | |
oC_MCS_MemoryAccessMode_t | oC_MCS_GetMemoryAccessMode (void) |
reads memory access mode More... | |
static bool | oC_MCS_ChangeCriticalSectionCounter (int8_t ValueToAdd) |
Increment or decrement counter for critical sections. More... | |
static void | oC_MCS_EnterCriticalSection (void) |
Enters to critical section. More... | |
static bool | oC_MCS_ExitCriticalSection (void) |
Exits from critical section. More... | |
static bool | oC_MCS_IsCriticalSectionActive (void) |
checks if critical section is active More... | |
Variables | |
int16_t | oC_MCS_CriticalSectionCounter |
global variable with critical section nesting counter | |
Definition in file oc_mcs.h.
|
inlinestatic |
The function changes value of critical section counter. The #ValueToAdd will be added to the current value of counter. The function returns true, when the critical counter is equal to 0.
ValueToAdd |
|
inlinestatic |
The function begins critical section. It increments critical section counter and disable interrupts.
|
inlinestatic |
The function ends critical section. It decrements counter and enables interrupts, when counter is equal to 0.
|
inlinestatic |
The function is for checking if critical section is currently active (interrupts should be disabled then, but it is not checked in this function)