Data Structures | Typedefs | Functions
enet_osal.h File Reference

This file contains the OSAL API of the Enet driver. More...

#include <stdint.h>
#include <stdbool.h>

Data Structures

struct  EnetOsal_Cfg_s
 Enet driver OSAL function pointers. More...
 

Typedefs

typedef uintptr_t(* EnetOsal_DisableAllIntr )(void)
 Enet OSAL intr disable function prototype. More...
 
typedef void(* EnetOsal_RestoreAllIntr )(uintptr_t cookie)
 Enet OSAL intr restore function prototype. More...
 
typedef void(* EnetOsal_RestoreIntr )(uint32_t coreIntrNum)
 Enet OSAL intr restore function prototype. More...
 
typedef void(* EnetOsal_DisableIntr )(uint32_t coreIntrNum)
 Enet OSAL intr disable function prototype. More...
 
typedef void(* EnetOsal_Isr )(uintptr_t arg)
 Enet OSAL ISR callback function prototype. More...
 
typedef void *(* EnetOsal_RegisterIntr )(EnetOsal_Isr isrFxn, uint32_t coreIntrNum, uint32_t intrPriority, void *arg)
 Enet OSAL ISR register function prototype. More...
 
typedef void(* EnetOsal_UnregisterIntr )(void *hHwi)
 Enet OSAL ISR unregister function prototype. More...
 
typedef void *(* EnetOsal_CreateMutex )(void)
 Enet OSAL mutex create function prototype to protect critical section. More...
 
typedef void(* EnetOsal_DeleteMutex )(void *hMutex)
 Enet OSAL mutex delete function prototype. More...
 
typedef void(* EnetOsal_LockMutex )(void *hMutex)
 Enet OSAL mutex lock function prototype. More...
 
typedef void(* EnetOsal_UnlockMutex )(void *hMutex)
 Enet OSAL mutex lock function prototype. More...
 
typedef bool(* EnetOsal_IsCacheCoherent )(void)
 Enet OSAL cache coherency check function prototype. More...
 
typedef void(* EnetOsal_CacheInv )(const void *addr, int32_t size)
 Enet OSAL cache invalidate function prototype. More...
 
typedef void(* EnetOsal_CacheWb )(const void *addr, int32_t size)
 Enet OSAL cache writeback function prototype. More...
 
typedef void(* EnetOsal_CacheWbInv )(const void *addr, int32_t size)
 Enet OSAL cache writeback invalidate function prototype. More...
 
typedef struct EnetOsal_Cfg_s EnetOsal_Cfg
 Enet driver OSAL function pointers.
 

Functions

void EnetOsal_init (const EnetOsal_Cfg *cfg)
 Initialize OSAL with provided configuration. More...
 
void EnetOsal_deinit (void)
 Deinitialize OSAL. More...
 
uintptr_t EnetOsal_disableAllIntr (void)
 Enet OSAL intr disable function prototype. More...
 
void EnetOsal_restoreAllIntr (uintptr_t cookie)
 Enet OSAL intr restore function prototype. More...
 
void * EnetOsal_registerIntr (EnetOsal_Isr isrFxn, uint32_t coreIntrNum, uint32_t intrPriority, void *arg)
 Register an ISR for an interrupt. More...
 
void EnetOsal_unregisterIntr (void *hHwi)
 Unregister an interrupt. More...
 
void EnetOsal_enableIntr (uint32_t coreIntrNum)
 Enable interrupt. More...
 
void EnetOsal_disableIntr (uint32_t coreIntrNum)
 Disable interrupt. More...
 
void * EnetOsal_createMutex (void)
 Create a mutex. More...
 
void EnetOsal_deleteMutex (void *hMutex)
 Delete a mutex. More...
 
void EnetOsal_lockMutex (void *hMutex)
 Lock a mutex. More...
 
void EnetOsal_unlockMutex (void *hMutex)
 Unlock a mutex. More...
 
void EnetOsal_cacheInv (const void *addr, int32_t size)
 Invalidate cache. More...
 
void EnetOsal_cacheWb (const void *addr, int32_t size)
 Write-back cache. More...
 
void EnetOsal_cacheWbInv (const void *addr, int32_t size)
 Write-back and invalidate cache. More...
 

Detailed Description

This file contains the OSAL API of the Enet driver.

Typedef Documentation

typedef void(* EnetOsal_CacheInv)(const void *addr, int32_t size)

Enet OSAL cache invalidate function prototype.

Parameters
addrStart address of the cache line/s
sizeSize (in bytes) of the memory to invalidate
typedef void(* EnetOsal_CacheWb)(const void *addr, int32_t size)

Enet OSAL cache writeback function prototype.

Parameters
addrStart address of the cache line/s
sizeSize (in bytes) of the memory to be written back
typedef void(* EnetOsal_CacheWbInv)(const void *addr, int32_t size)

Enet OSAL cache writeback invalidate function prototype.

Parameters
addrStart address of the cache line/s
sizeSize (in bytes) of the memory to be written back
typedef void*(* EnetOsal_CreateMutex)(void)

Enet OSAL mutex create function prototype to protect critical section.

Returns
Pointer to mutex object
typedef void(* EnetOsal_DeleteMutex)(void *hMutex)

Enet OSAL mutex delete function prototype.

Parameters
hMutexPointer to mutex object returned during create
typedef uintptr_t(* EnetOsal_DisableAllIntr)(void)

Enet OSAL intr disable function prototype.

Returns
Cookie to be passed back to enable interrupt function
typedef void(* EnetOsal_DisableIntr)(uint32_t coreIntrNum)

Enet OSAL intr disable function prototype.

Parameters
coreIntrNumInterrupt to disable
typedef bool(* EnetOsal_IsCacheCoherent)(void)

Enet OSAL cache coherency check function prototype.

Returns
Whether cache is coherent or not
typedef void(* EnetOsal_Isr)(uintptr_t arg)

Enet OSAL ISR callback function prototype.

Parameters
argApp data
typedef void(* EnetOsal_LockMutex)(void *hMutex)

Enet OSAL mutex lock function prototype.

Parameters
hMutexPointer to mutex object returned during create
typedef void*(* EnetOsal_RegisterIntr)(EnetOsal_Isr isrFxn, uint32_t coreIntrNum, uint32_t intrPriority, void *arg)

Enet OSAL ISR register function prototype.

Parameters
isrFxnISR callback fxn pointer
coreIntrNumCore interrupt number to register
intrPriorityPriority
argArg that will be passed back in the ISR
Returns
Created Hwi handle
typedef void(* EnetOsal_RestoreAllIntr)(uintptr_t cookie)

Enet OSAL intr restore function prototype.

Parameters
cookieThis is returned in disable interrupt function
typedef void(* EnetOsal_RestoreIntr)(uint32_t coreIntrNum)

Enet OSAL intr restore function prototype.

Parameters
coreIntrNumInterrupt to restore
typedef void(* EnetOsal_UnlockMutex)(void *hMutex)

Enet OSAL mutex lock function prototype.

Parameters
hMutexPointer to mutex object returned during create
typedef void(* EnetOsal_UnregisterIntr)(void *hHwi)

Enet OSAL ISR unregister function prototype.

Parameters
hHwiHwi handle

Function Documentation

void EnetOsal_cacheInv ( const void *  addr,
int32_t  size 
)

Invalidate cache.

Invalidates cache in a range of memory.

Parameters
addrStart address of the cache line(s)
sizeSize (in bytes) of the memory to invalidate
void EnetOsal_cacheWb ( const void *  addr,
int32_t  size 
)

Write-back cache.

Writes back cache a range of memory from cache.

Parameters
addrStart address of the cache line(s)
sizeSize (in bytes) of the memory to be written back
void EnetOsal_cacheWbInv ( const void *  addr,
int32_t  size 
)

Write-back and invalidate cache.

Writes back and invalidates a range of memory.

Parameters
addrStart address of the cache line/s
sizeSize (in bytes) of the memory to be written back
void* EnetOsal_createMutex ( void  )

Create a mutex.

Returns
Mutex handle pointer
void EnetOsal_deinit ( void  )

Deinitialize OSAL.

Deinitializes the Enet driver OSAL by clearing the configuration previously set when calling EnetOsal_init().

void EnetOsal_deleteMutex ( void *  hMutex)

Delete a mutex.

Parameters
hMutexMutex handle pointer
uintptr_t EnetOsal_disableAllIntr ( void  )

Enet OSAL intr disable function prototype.

Returns
Cookie to be passed back to enable interrupt function
void EnetOsal_disableIntr ( uint32_t  coreIntrNum)

Disable interrupt.

Parameters
coreIntrNumInterrupt number
void EnetOsal_enableIntr ( uint32_t  coreIntrNum)

Enable interrupt.

Parameters
coreIntrNumInterrupt number
void EnetOsal_init ( const EnetOsal_Cfg cfg)

Initialize OSAL with provided configuration.

Initializes the Enet driver OSAL with the provided configuration. It's expected that all function pointers in the configuration are not NULL.

Parameters
cfgConfiguration parameters
void EnetOsal_lockMutex ( void *  hMutex)

Lock a mutex.

Parameters
hMutexMutex handle pointer
void* EnetOsal_registerIntr ( EnetOsal_Isr  isrFxn,
uint32_t  coreIntrNum,
uint32_t  intrPriority,
void *  arg 
)

Register an ISR for an interrupt.

Parameters
isrFxnInterrupt service routine
coreIntrNumInterrupt number
intrPriorityInterrupt priority
argArgument to ISR function
Returns
Interrupt handle pointer
void EnetOsal_restoreAllIntr ( uintptr_t  cookie)

Enet OSAL intr restore function prototype.

Parameters
cookieThis is returned in disable interrupt function
void EnetOsal_unlockMutex ( void *  hMutex)

Unlock a mutex.

Parameters
hMutexMutex handle pointer
void EnetOsal_unregisterIntr ( void *  hHwi)

Unregister an interrupt.

Parameters
hHwiInterrupt handle pointer

Copyright 2020, Texas Instruments Incorporated