![]() |
ETHFW API Guide
|
This section contains Ethernet Firmware OSAL APIs. This is a common header file for both Jacinto and Sitara which holds macros and declarations for OSAL related APIs.
Data Structures | |
| struct | EthFwOsal_TaskParams |
| Task configuration params. More... | |
| struct | EthFwOsal_ClockParams |
| Clock configuration params. More... | |
| struct | EthFwOsal_EventParams |
| Event configuration params. More... | |
Functions | |
| void | EthFwOsal_init (void) |
| ETHFW OSAL init. More... | |
| void | EthFwOsal_initTaskParams (EthFwOsal_TaskParams *params) |
| ETHFW OSAL Task init configuration parameters. More... | |
| EthFwOsal_TaskHandle | EthFwOsal_createTask (void(*func)(void *), EthFwOsal_TaskParams *params) |
| ETHFW OSAL function to create a task. More... | |
| int32_t | EthFwOsal_deleteTask (EthFwOsal_TaskHandle *taskHandle) |
| ETHFW OSAL function to delete a task. More... | |
| void | EthFwOsal_exitTask (void) |
| ETHFW OSAL function to exit from a task. More... | |
| uint32_t | EthFwOsal_isTaskTerminated (EthFwOsal_TaskHandle taskHandle) |
| ETHFW OSAL function to check if a given task is terminated. More... | |
| EthFwOsal_TaskHandle | EthFwOsal_getTaskSelf (void) |
| ETHFW OSAL function returns the Task handle of current task. More... | |
| void | EthFwOsal_setTaskPrio (EthFwOsal_TaskHandle taskHandle, uint32_t priority) |
| ETHFW OSAL function to update Task priority. More... | |
| void | EthFwOsal_sleepTaskinMsecs (uint32_t timeoutInMsecs) |
| ETHFW OSAL function Task sleep in units of msecs. More... | |
| uint64_t | EthFwOsal_getTimeInUsecs (void) |
| ETHFW OSAL function to get time in micro seconds. More... | |
| void | EthFwOsal_sleepTask (uint32_t timeout) |
| ETHFW OSAL function Task sleep in units of OS tick. More... | |
| void | EthFwOsal_yieldTask (void) |
| ETHFW OSAL function to Yield processor to equal priority task. More... | |
| void | EthFwOsal_wbCache (const void *addr, uint32_t size) |
| ETHFW OSAL function to write back cache lines. More... | |
| void | EthFwOsal_invCache (const void *addr, uint32_t size) |
| ETHFW OSAL function to invalidate cache lines. More... | |
| void | EthFwOsal_wbInvCache (const void *addr, uint32_t size) |
| ETHFW OSAL function to write back and invalidate cache lines. More... | |
| EthFwOsal_SemHandle | EthFwOsal_createSemaphore (uint32_t count) |
| ETHFW OSAL function to create a semaphore. More... | |
| int32_t | EthFwOsal_deleteSemaphore (EthFwOsal_SemHandle handle) |
| ETHFW OSAL function to delete a semaphore. More... | |
| int32_t | EthFwOsal_pendSemaphore (EthFwOsal_SemHandle handle, uint32_t timeout) |
| ETHFW OSAL function to pend a semaphore. More... | |
| int32_t | EthFwOsal_postSemaphore (EthFwOsal_SemHandle handle) |
| ETHFW OSAL function to post a semaphore. More... | |
| EthFwOsal_MutexHandle | EthFwOsal_createMutex (void) |
| ETHFW OSAL function to create a mutex. More... | |
| void | EthFwOsal_deleteMutex (void *EthFwOsal_MutexHandle) |
| ETHFW OSAL function to post a mutex. More... | |
| void | EthFwOsal_lockMutex (void *EthFwOsal_MutexHandle) |
| ETHFW OSAL function to lock a muex. More... | |
| void | EthFwOsal_unlockMutex (void *EthFwOsal_MutexHandle) |
| ETHFW OSAL function to unlock a mutex. More... | |
| void | EthFwOsal_initClockParams (EthFwOsal_ClockParams *params) |
| ETHFW OSAL Clock init configuration parameters. More... | |
| EthFwOsal_ClockHandle | EthFwOsal_createClock (void(*func)(void *), EthFwOsal_ClockParams *params) |
| ETHFW OSAL function to create a clock. More... | |
| int32_t | EthFwOsal_startClock (EthFwOsal_ClockHandle handle) |
| ETHFW OSAL function to stack a clock. More... | |
| int32_t | EthFwOsal_stopClock (EthFwOsal_ClockHandle handle) |
| ETHFW OSAL function to stop a clock. More... | |
| int32_t | EthFwOsal_deleteClock (EthFwOsal_ClockHandle handle) |
| ETHFW OSAL function to delete a clock. More... | |
| void | EthFwOsal_initEventParams (EthFwOsal_EventParams *params) |
| ETHFW OSAL Event init configuration parameters. More... | |
| EthFwOsal_EventHandle | EthFwOsal_createEvent (EthFwOsal_EventParams *params) |
| ETHFW OSAL function to create a event. More... | |
| uint32_t | EthFwOsal_waitEvent (EthFwOsal_EventHandle handle, uint32_t eventMask, uint8_t waitMode, uint32_t timeout) |
| ETHFW OSAL function to wait for an event. More... | |
| int32_t | EthFwOsal_postEvent (EthFwOsal_EventHandle handle, uint32_t eventBits) |
| ETHFW OSAL function to post an event. More... | |
| void | EthFwOsal_initMailboxParams (EthFwOsal_MailboxParams *params) |
| ETHFW OSAL Mailbox init configuration parameters. More... | |
| EthFwOsal_MailboxHandle | EthFwOsal_createMailbox (EthFwOsal_MailboxParams *params) |
| ETHFW OSAL function to create a Mailbox. More... | |
| int32_t | EthFwOsal_deleteMailbox (EthFwOsal_MailboxHandle handle) |
| ETHFW OSAL function to delete a Mailbox. More... | |
| int32_t | EthFwOsal_postMailbox (EthFwOsal_MailboxHandle handle, void *msg, uint32_t timeout) |
| ETHFW OSAL function to post a Mailbox. More... | |
| int32_t | EthFwOsal_pendMailbox (EthFwOsal_MailboxHandle handle, void *msg, uint32_t timeout) |
| ETHFW OSAL function to pend a Mailbox. More... | |
Typedefs | |
| typedef MailboxP_Params | EthFwOsal_MailboxParams |
| Mailbox params for Jacinto and Sitara. More... | |
| typedef void * | EthFwOsal_TaskHandle |
| ETHFW OSAL Task Handle. More... | |
| typedef void * | EthFwOsal_SemHandle |
| ETHFW OSAL Semaphore Handle. More... | |
| typedef void * | EthFwOsal_ClockHandle |
| ETHFW OSAL Clock Handle. More... | |
| typedef void * | EthFwOsal_EventHandle |
| ETHFW OSAL Event Handle. More... | |
| typedef void * | EthFwOsal_MutexHandle |
| ETHFW OSAL Mutex Handle. More... | |
| typedef void * | EthFwOsal_MailboxHandle |
| ETHFW OSAL Mailbox Handle. More... | |
Macros | |
| #define | ETHFWCLOCK_STARTMODE_USER ((uint8_t) 0U) |
| #define | ETHFWCLOCK_STARTMODE_AUTO ((uint8_t) 1U) |
| #define | ETHFWCLOCK_RUNMODE_ONESHOT ((uint8_t) 0U) |
| #define | ETHFWCLOCK_RUNMODE_CONTINUOUS ((uint8_t) 1U) |
| #define | ETHFWEVENT_WAITMODE_ANY ((uint8_t) 0U) |
| #define | ETHFWEVENT_WAITMODE_ALL ((uint8_t) 1U) |
| #define ETHFWCLOCK_STARTMODE_USER ((uint8_t) 0U) |
Timer will be started by the user
| #define ETHFWCLOCK_STARTMODE_AUTO ((uint8_t) 1U) |
Timer starts automatically after create or scheduler start
| #define ETHFWCLOCK_RUNMODE_ONESHOT ((uint8_t) 0U) |
Timer runs for a single period values and stops
| #define ETHFWCLOCK_RUNMODE_CONTINUOUS ((uint8_t) 1U) |
Timer is periodic and runs continuously
| #define ETHFWEVENT_WAITMODE_ANY ((uint8_t) 0U) |
EventP_wait will return when ANY of the bits set in mask are set in the Event bits
| #define ETHFWEVENT_WAITMODE_ALL ((uint8_t) 1U) |
EventP_wait will return when ALL the bits set in mask are set in the Event bits
| typedef MailboxP_Params EthFwOsal_MailboxParams |
Mailbox params for Jacinto and Sitara.
| typedef void* EthFwOsal_TaskHandle |
ETHFW OSAL Task Handle.
| typedef void* EthFwOsal_SemHandle |
ETHFW OSAL Semaphore Handle.
| typedef void* EthFwOsal_ClockHandle |
ETHFW OSAL Clock Handle.
| typedef void* EthFwOsal_EventHandle |
ETHFW OSAL Event Handle.
| typedef void* EthFwOsal_MutexHandle |
ETHFW OSAL Mutex Handle.
| typedef void* EthFwOsal_MailboxHandle |
ETHFW OSAL Mailbox Handle.
| void EthFwOsal_init | ( | void | ) |
ETHFW OSAL init.
Based on the caller of the function (Jacinto or Sitara), this function initiates the OSAL module in ETHFW. For Jacinto, this is a empty function and does nothing, but for Sitara, this inits and sets the global OSAL pools to zero, which is needed to support static memory allocation of the OS modules.
| void EthFwOsal_initTaskParams | ( | EthFwOsal_TaskParams * | params | ) |
ETHFW OSAL Task init configuration parameters.
Sets the Task init configuration parameters. This function sets to default init params for Task init.
| params | Init configuration params. |
| EthFwOsal_TaskHandle EthFwOsal_createTask | ( | void(*)(void *) | func, |
| EthFwOsal_TaskParams * | params | ||
| ) |
ETHFW OSAL function to create a task.
| func | Function pointer of the task. |
| params | Pointer to the instance configuration parameters. |
| int32_t EthFwOsal_deleteTask | ( | EthFwOsal_TaskHandle * | taskHandle | ) |
ETHFW OSAL function to delete a task.
| taskHandle | EthFwOsal_TaskHandle returned from EthFwOsal_createTask |
| void EthFwOsal_exitTask | ( | void | ) |
ETHFW OSAL function to exit from a task.
This function does nothing when the caller is from Jacinto baseline, but the same exits at the end of the task for Sitara.
| uint32_t EthFwOsal_isTaskTerminated | ( | EthFwOsal_TaskHandle | taskHandle | ) |
ETHFW OSAL function to check if a given task is terminated.
This function is not supported for Sitara baseline. For a Jacinto caller this function returns the current status of a task if terminated.
| taskHandle | EthFwOsal_TaskHandle returned from EthFwOsal_createTask |
| EthFwOsal_TaskHandle EthFwOsal_getTaskSelf | ( | void | ) |
ETHFW OSAL function returns the Task handle of current task.
This function is not supported for Sitara baseline. For a Jacinto caller this function returns the Task handle of current task.
| void EthFwOsal_setTaskPrio | ( | EthFwOsal_TaskHandle | taskHandle, |
| uint32_t | priority | ||
| ) |
ETHFW OSAL function to update Task priority.
This function is not supported for Sitara baseline. For a Jacinto caller this function to update Task priority.
| taskHandle | EthFwOsal_TaskHandle of task |
| priority | New priority to be set |
| void EthFwOsal_sleepTaskinMsecs | ( | uint32_t | timeoutInMsecs | ) |
ETHFW OSAL function Task sleep in units of msecs.
| uint64_t EthFwOsal_getTimeInUsecs | ( | void | ) |
ETHFW OSAL function to get time in micro seconds.
| void EthFwOsal_sleepTask | ( | uint32_t | timeout | ) |
ETHFW OSAL function Task sleep in units of OS tick.
| void EthFwOsal_yieldTask | ( | void | ) |
ETHFW OSAL function to Yield processor to equal priority task.
| void EthFwOsal_wbCache | ( | const void * | addr, |
| uint32_t | size | ||
| ) |
ETHFW OSAL function to write back cache lines.
| addr | Start address of the cache line/s |
| size | size (in bytes) of the memory to be written back |
| void EthFwOsal_invCache | ( | const void * | addr, |
| uint32_t | size | ||
| ) |
ETHFW OSAL function to invalidate cache lines.
| addr | Start address of the cache line/s |
| size | size (in bytes) of the memory to be written back |
| void EthFwOsal_wbInvCache | ( | const void * | addr, |
| uint32_t | size | ||
| ) |
ETHFW OSAL function to write back and invalidate cache lines.
| addr | Start address of the cache line/s |
| size | size (in bytes) of the memory to be written back |
| EthFwOsal_SemHandle EthFwOsal_createSemaphore | ( | uint32_t | count | ) |
ETHFW OSAL function to create a semaphore.
| count | Initial count of the semaphore. For binary semaphores, only values of 0 or 1 are valid. |
| int32_t EthFwOsal_deleteSemaphore | ( | EthFwOsal_SemHandle | handle | ) |
ETHFW OSAL function to delete a semaphore.
| handle | EthFwOsal_SemHandle returned from EthFwOsal_createSemaphore |
| int32_t EthFwOsal_pendSemaphore | ( | EthFwOsal_SemHandle | handle, |
| uint32_t | timeout | ||
| ) |
ETHFW OSAL function to pend a semaphore.
| handle | EthFwOsal_SemHandle returned from EthFwOsal_createSemaphore |
| timeout | Timeout (in ticks) to wait for the semaphore to be signalled (posted) |
| int32_t EthFwOsal_postSemaphore | ( | EthFwOsal_SemHandle | handle | ) |
ETHFW OSAL function to post a semaphore.
| handle | EthFwOsal_SemHandle returned from EthFwOsal_createSemaphore |
| EthFwOsal_MutexHandle EthFwOsal_createMutex | ( | void | ) |
ETHFW OSAL function to create a mutex.
| void EthFwOsal_deleteMutex | ( | void * | EthFwOsal_MutexHandle | ) |
ETHFW OSAL function to post a mutex.
| EthFwOsal_MutexHandle | EthFwOsal_MutexHandle returned from EthFwOsal_createMutex |
| void EthFwOsal_lockMutex | ( | void * | EthFwOsal_MutexHandle | ) |
ETHFW OSAL function to lock a muex.
| EthFwOsal_MutexHandle | EthFwOsal_MutexHandle returned from EthFwOsal_createMutex |
| void EthFwOsal_unlockMutex | ( | void * | EthFwOsal_MutexHandle | ) |
ETHFW OSAL function to unlock a mutex.
| EthFwOsal_MutexHandle | EthFwOsal_MutexHandle returned from EthFwOsal_createMutex |
| void EthFwOsal_initClockParams | ( | EthFwOsal_ClockParams * | params | ) |
ETHFW OSAL Clock init configuration parameters.
Sets the Clock init configuration parameters. This function sets to default init params for Clock init.
| params | Init configuration params. |
| EthFwOsal_ClockHandle EthFwOsal_createClock | ( | void(*)(void *) | func, |
| EthFwOsal_ClockParams * | params | ||
| ) |
ETHFW OSAL function to create a clock.
| func | Function pointer of the clock function. |
| params | Pointer to the instance configuration parameters. |
| int32_t EthFwOsal_startClock | ( | EthFwOsal_ClockHandle | handle | ) |
ETHFW OSAL function to stack a clock.
| handle | EthFwOsal_ClockHandle returned from EthFwOsal_createClock |
| int32_t EthFwOsal_stopClock | ( | EthFwOsal_ClockHandle | handle | ) |
ETHFW OSAL function to stop a clock.
| handle | EthFwOsal_ClockHandle returned from EthFwOsal_createClock |
| int32_t EthFwOsal_deleteClock | ( | EthFwOsal_ClockHandle | handle | ) |
ETHFW OSAL function to delete a clock.
| handle | EthFwOsal_ClockHandle returned from EthFwOsal_createClock |
| void EthFwOsal_initEventParams | ( | EthFwOsal_EventParams * | params | ) |
ETHFW OSAL Event init configuration parameters.
Sets the Event init configuration parameters. This function sets to default init params for Event init.
| params | Init configuration params. |
| EthFwOsal_EventHandle EthFwOsal_createEvent | ( | EthFwOsal_EventParams * | params | ) |
ETHFW OSAL function to create a event.
| params | Pointer to the instance configuration parameters. |
| uint32_t EthFwOsal_waitEvent | ( | EthFwOsal_EventHandle | handle, |
| uint32_t | eventMask, | ||
| uint8_t | waitMode, | ||
| uint32_t | timeout | ||
| ) |
ETHFW OSAL function to wait for an event.
| handle | EthFwOsal_EventHandle returned during EthFwOsal_createEvent |
| eventMask | mask of eventIds to pend on (must be non-zero) Only supports upto 24 bits. |
| waitMode | Event wait mode. |
| timeout | return from wait() after this many system time units |
| int32_t EthFwOsal_postEvent | ( | EthFwOsal_EventHandle | handle, |
| uint32_t | eventBits | ||
| ) |
ETHFW OSAL function to post an event.
| handle | EthFwOsal_EventHandle returned during EthFwOsal_createEvent |
| eventBits | mask of eventIds to post (must be non-zero) |
| void EthFwOsal_initMailboxParams | ( | EthFwOsal_MailboxParams * | params | ) |
ETHFW OSAL Mailbox init configuration parameters.
Sets the Mailbox init configuration parameters. This function sets to default init params for Mailbox init.
| params | Init configuration params. |
| EthFwOsal_MailboxHandle EthFwOsal_createMailbox | ( | EthFwOsal_MailboxParams * | params | ) |
ETHFW OSAL function to create a Mailbox.
| params | Pointer to the instance configuration parameters. |
| int32_t EthFwOsal_deleteMailbox | ( | EthFwOsal_MailboxHandle | handle | ) |
ETHFW OSAL function to delete a Mailbox.
| handle | EthFwOsal_MailboxHandle returned from EthFwOsal_createMailbox |
| int32_t EthFwOsal_postMailbox | ( | EthFwOsal_MailboxHandle | handle, |
| void * | msg, | ||
| uint32_t | timeout | ||
| ) |
ETHFW OSAL function to post a Mailbox.
| handle | EthFwOsal_MailboxHandle returned from EthFwOsal_createMailbox |
| msg | Pointer to the message to post |
| timeout | Timeout (in milliseconds) to wait for post a message to the mailbox. |
| int32_t EthFwOsal_pendMailbox | ( | EthFwOsal_MailboxHandle | handle, |
| void * | msg, | ||
| uint32_t | timeout | ||
| ) |
ETHFW OSAL function to pend a Mailbox.
| handle | EthFwOsal_MailboxHandle returned from EthFwOsal_createMailbox |
| msg | Pointer to the message to pend |
| timeout | Timeout (in milliseconds) to wait for pend a message to the mailbox. |