PDK API Guide for J7200
|
OSAL interface
Files | |
file | osal.h |
OS Abstraction Layer header. | |
Data Structures | |
struct | Osal_StaticMemStatus |
This structure holds static memory status parameters of OSAL library. More... | |
struct | Osal_memRange |
Osal memory address range. More... | |
struct | Osal_HwAttrs |
Osal hw attributes structure. More... | |
Functions | |
void | Osal_DebugP_assert (int32_t expression, const char *file, int32_t line) |
Osal_ThreadType | Osal_getThreadType (void) |
Function to get the current thread type. More... | |
int32_t | Osal_delay (uint32_t nTicks) |
Function to delay/sleep the specified number of ticks. More... | |
int32_t | Osal_setHwAttrs (uint32_t ctrlBitMap, const Osal_HwAttrs *hwAttrs) |
Function to set the Hw Attributes. More... | |
int32_t | Osal_getHwAttrs (Osal_HwAttrs *hwAttrs) |
Function to get the Hw Attributes. More... | |
int32_t | Osal_getStaticMemStatus (Osal_StaticMemStatus *pMemStat) |
Function to get the static memory usage of OSAL library. More... | |
int32_t | Osal_getCoreId (void) |
Function to get the core ID of the running Core. More... | |
void | OS_init (void) |
Function for initializing the OS / scheduler. More... | |
void | OS_start (void) |
Function to strat OS / scheduler. More... | |
void | OS_stop (void) |
Function to stop OS / scheduler. More... | |
Variables | |
Osal_HwAttrs | gOsal_HwAttrs |
external references for Osal Hw Attribute structure More... | |
Enumerations | |
enum | Osal_ThreadType { Osal_ThreadType_Hwi, Osal_ThreadType_Swi, Osal_ThreadType_Task, Osal_ThreadType_Main } |
This enum defines the multiple thread types used under OSAL library. More... | |
enum | Osal_HwAccessType { OSAL_HWACCESS_UNRESTRICTED, OSAL_HWACCESS_RESTRICTED } |
Osal hw access type. More... | |
Macros | |
#define | osal_WAIT_FOREVER (~((uint32_t)0U)) |
#define | osal_NO_WAIT ((uint32_t)0U) |
#define | OSAL_NONOS_SEMAPHOREP_SIZE_BYTES ((uint32_t) 48U) |
#define | OSAL_NONOS_HWIP_SIZE_BYTES ((uint32_t) 48U) |
#define | OSAL_FREERTOS_HWIP_C7X_SIZE_BYTES ((uint32_t) 56U) |
#define | OSAL_SAFERTOS_HWIP_C7X_SIZE_BYTES ((uint32_t) 56U) |
#define | OSAL_FREERTOS_SEMAPHOREP_SIZE_BYTES ((uint32_t) 96U) |
#define | OSAL_FREERTOS_TASKP_SIZE_BYTES ((uint32_t) 128U) |
#define | OSAL_SAFERTOS_SEMAPHOREP_SIZE_BYTES ((uint32_t) 248U) |
#define | OSAL_SAFERTOS_TASKP_SIZE_BYTES ((uint32_t) 248U) |
#define | OSAL_Assert(expression) |
Assert checking function. More... | |
#define | OSAL_COMPILE_TIME_SIZE_CHECK(x, y) |
Osal Error return Codes | |
#define | osal_OK (0) |
#define | osal_FAILURE (-(int32_t)(1)) |
#define | osal_UNSUPPORTED (-(int32_t)(2)) |
#define | osal_NOMEM (-(int32_t)(3)) |
Osal HwAttrs ValidBit definitions | |
#define | OSAL_HWATTR_SET_EXT_CLK (0x00000001U) |
#define | OSAL_HWATTR_SET_ECM_INT (0x00000002U) |
#define | OSAL_HWATTR_SET_HWACCESS_TYPE (0x00000004U) |
#define | OSAL_HWATTR_SET_OSALDELAY_TIMER_BASE (0x00000008U) |
#define | OSAL_HWATTR_SET_SEMP_EXT_BASE (0x00000010U) |
#define | OSAL_HWATTR_SET_HWIP_EXT_BASE (0x00000020U) |
#define | OSAL_HWATTR_SET_CPU_FREQ (0x00000040U) |
#define | OSAL_HWATTR_SET_TARG_PROC_LIST (0x00000080) |
#define osal_OK (0) |
#define osal_FAILURE (-(int32_t)(1)) |
#define osal_UNSUPPORTED (-(int32_t)(2)) |
#define osal_NOMEM (-(int32_t)(3)) |
#define osal_WAIT_FOREVER (~((uint32_t)0U)) |
#define osal_NO_WAIT ((uint32_t)0U) |
#define OSAL_NONOS_SEMAPHOREP_SIZE_BYTES ((uint32_t) 48U) |
#define OSAL_NONOS_HWIP_SIZE_BYTES ((uint32_t) 48U) |
#define OSAL_FREERTOS_HWIP_C7X_SIZE_BYTES ((uint32_t) 56U) |
#define OSAL_SAFERTOS_HWIP_C7X_SIZE_BYTES ((uint32_t) 56U) |
#define OSAL_FREERTOS_SEMAPHOREP_SIZE_BYTES ((uint32_t) 96U) |
#define OSAL_FREERTOS_TASKP_SIZE_BYTES ((uint32_t) 128U) |
#define OSAL_SAFERTOS_SEMAPHOREP_SIZE_BYTES ((uint32_t) 248U) |
#define OSAL_SAFERTOS_TASKP_SIZE_BYTES ((uint32_t) 248U) |
#define OSAL_Assert | ( | expression | ) |
Assert checking function.
If the expression is evaluated to true, the API does nothing. If it is evaluated to false, the underlying RTOS port implementation handles the assert via its mechanisms.
expression | Expression to evaluate |
#define OSAL_HWATTR_SET_EXT_CLK (0x00000001U) |
bit map to set external clock in Osal_HwAttr default value
#define OSAL_HWATTR_SET_ECM_INT (0x00000002U) |
bit map to set Event combiner interrupt numbers in the Osal_HwAttr
#define OSAL_HWATTR_SET_HWACCESS_TYPE (0x00000004U) |
bit map to set the hardware access type
#define OSAL_HWATTR_SET_OSALDELAY_TIMER_BASE (0x00000008U) |
bit map to set the osal_delay Timer base address
#define OSAL_HWATTR_SET_SEMP_EXT_BASE (0x00000010U) |
bit map to set the extended SemaphoreP memory block for additional SemaphoreP needs
#define OSAL_HWATTR_SET_HWIP_EXT_BASE (0x00000020U) |
bit map to set the extended HwiP memory block for additional HwiP needs
#define OSAL_HWATTR_SET_CPU_FREQ (0x00000040U) |
bit map to set the CPU frequency
#define OSAL_HWATTR_SET_TARG_PROC_LIST (0x00000080) |
bit map to set the target processor list to direct interrupts to specific core
#define OSAL_COMPILE_TIME_SIZE_CHECK | ( | x, | |
y | |||
) |
This macro generates compilier error if postulate is false, so allows 0 overhead compile time size check. This "works" when the expression contains sizeof() which otherwise doesn't work with preprocessor
Example
#define OSAL_TEST_STRUCT_SIZE_BYTES ((uint32_t) 48U) typedef struct Test_Struct_Ext_s { Bool used; Test_Struct test; } Test_Struct_Ext; void OsalTest_compileTime_SizeChk(void) { #if defined(__GNUC__) && !defined(__ti__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-variable" #else #pragma diag_suppress 179 #endif OSAL_COMPILE_TIME_SIZE_CHECK (sizeof(Test_Struct_Ext),OSAL_TEST_STRUCT_SIZE_BYTES); #if defined(__GNUC__) && !defined(__ti__) #pragma GCC diagnostic pop #endif }
enum Osal_ThreadType |
enum Osal_HwAccessType |
void Osal_DebugP_assert | ( | int32_t | expression, |
const char * | file, | ||
int32_t | line | ||
) |
Osal_ThreadType Osal_getThreadType | ( | void | ) |
Function to get the current thread type.
int32_t Osal_delay | ( | uint32_t | nTicks | ) |
Function to delay/sleep the specified number of ticks.
nTicks | number of ticks |
#
Prerequisites: Board_init() to be called before invoking this API
int32_t Osal_setHwAttrs | ( | uint32_t | ctrlBitMap, |
const Osal_HwAttrs * | hwAttrs | ||
) |
Function to set the Hw Attributes.
ctrlBitMap | control bit map as defined by the OSAL_HWATTR_SET control bits |
hwAttrs | pointer to Osal_HwAttrs structure |
int32_t Osal_getHwAttrs | ( | Osal_HwAttrs * | hwAttrs | ) |
Function to get the Hw Attributes.
hwAttrs | pointer to Osal_HwAttrs structure |
int32_t Osal_getStaticMemStatus | ( | Osal_StaticMemStatus * | pMemStat | ) |
Function to get the static memory usage of OSAL library.
pMemStat | pointer to Osal_StaticMemStatus structure |
int32_t Osal_getCoreId | ( | void | ) |
Function to get the core ID of the running Core.
void OS_init | ( | void | ) |
Function for initializing the OS / scheduler.
void OS_start | ( | void | ) |
Function to strat OS / scheduler.
void OS_stop | ( | void | ) |
Function to stop OS / scheduler.
Osal_HwAttrs gOsal_HwAttrs |
external references for Osal Hw Attribute structure