EMAC_LLD_OSAL


Defines

#define Emac_osalMalloc(X)   Osal_emacMalloc(X)
 The macro is used by the EMAC driver to allocate memory The EMAC driver uses this macro to allocate memory for its internal driver structures. This is invoked during the driver initialization and startup process.
#define Emac_osalFree(X, Y)   Osal_emacFree(X, Y)
 The macro is used by the EMAC driver to free a previously allocated block of memory.
#define Emac_osalBeginMemAccess   Osal_emacBeginMemAccess
 This macro is used to alert the application that the EMAC is going to access common data memory. The application must ensure cache coherency and semaphores for multi-core applications.
#define Emac_osalEndMemAccess   Osal_emacEndMemAccess
 This macro is used to alert the application that the EMAC has completed access to common data memory. This call will always be made following a call to Osal_emacBeginMemAccess and have the same parameters.
#define Emac_osalEnterSingleCoreCriticalSection   Osal_emacEnterSingleCoreCriticalSection
 The macro is used by the EMAC driver to protect its internal shared resources from SINGLE CORE MULTIPLE CONTEXT (thread or ISR) access. If all the EMAC Driver APIs are being called from threads then this API could use semaphores. However if the EMAC driver API's are being called from both ISR & Thread context then the critical section here would need to disable/enable interrupts.
#define Emac_osalExitSingleCoreCriticalSection   Osal_emacExitSingleCoreCriticalSection
 The macro is used to denote the end of the protection of the internal shared resource from SINGLE CORE MULTIPLE CONTEXT access.
#define Emac_osalEnterMultipleCoreCriticalSection   Osal_emacEnterMultipleCoreCriticalSection
 The macro is used by the EMAC Driver to protect its shared resources access from MULTIPLE CORES. This is required if the EMAC Driver API's are being invoked from multiple cores. If this is not the case then these macros can be defined to be NOP.
#define Emac_osalExitMultipleCoreCriticalSection   Osal_emacExitMultipleCoreCriticalSection
 The macro is used by the EMAC driver to end the protection of its internal shared "resources" from MULTIPLE CORE access.

Define Documentation

#define Emac_osalBeginMemAccess   Osal_emacBeginMemAccess

This macro is used to alert the application that the EMAC is going to access common data memory. The application must ensure cache coherency and semaphores for multi-core applications.

Prototype: The following is the C prototype for the expected OSAL API.

        void Osal_emacBeginMemAccess (void* addr, Uint32 size)
    

Parameters
The address of the memory to be accessed
The number of bytes in the memory

#define Emac_osalEndMemAccess   Osal_emacEndMemAccess

This macro is used to alert the application that the EMAC has completed access to common data memory. This call will always be made following a call to Osal_emacBeginMemAccess and have the same parameters.

Prototype: The following is the C prototype for the expected OSAL API.

        void Osal_emacEndMemAccess (void* addr, Uint32 size)
    

Parameters
The address of the memory to be accessed
The number of bytes in the memory

#define Emac_osalEnterMultipleCoreCriticalSection   Osal_emacEnterMultipleCoreCriticalSection

The macro is used by the EMAC Driver to protect its shared resources access from MULTIPLE CORES. This is required if the EMAC Driver API's are being invoked from multiple cores. If this is not the case then these macros can be defined to be NOP.

Prototype: The following is the C prototype for the expected OSAL API.

       void* Osal_emacEnterMultipleCoreCriticalSection(Uint32 port_num)
    

Parameter
EMAC port number

Return Value
None

#define Emac_osalEnterSingleCoreCriticalSection   Osal_emacEnterSingleCoreCriticalSection

The macro is used by the EMAC driver to protect its internal shared resources from SINGLE CORE MULTIPLE CONTEXT (thread or ISR) access. If all the EMAC Driver APIs are being called from threads then this API could use semaphores. However if the EMAC driver API's are being called from both ISR & Thread context then the critical section here would need to disable/enable interrupts.

Prototype: The following is the C prototype for the expected OSAL API.

       void* Osal_emacEnterSingleCoreCriticalSection(Uint32 port_num)
    

Parameter
EMAC port number

Return Value
none

#define Emac_osalExitMultipleCoreCriticalSection   Osal_emacExitMultipleCoreCriticalSection

The macro is used by the EMAC driver to end the protection of its internal shared "resources" from MULTIPLE CORE access.

Prototype: The following is the C prototype for the expected OSAL API.

       void  Osal_emacExitMultipleCoreCriticalSection(Uint32 port_num)
    

Parameter
EMAC port number

Return Value
None

#define Emac_osalExitSingleCoreCriticalSection   Osal_emacExitSingleCoreCriticalSection

The macro is used to denote the end of the protection of the internal shared resource from SINGLE CORE MULTIPLE CONTEXT access.

Prototype: The following is the C prototype for the expected OSAL API.

       void  Osal_emacExitSingleCoreCriticalSection(Uint32 port_num)
    

Parameter
EMAC port number

Return Value
None

#define Emac_osalFree ( X,
 )     Osal_emacFree(X, Y)

The macro is used by the EMAC driver to free a previously allocated block of memory.

Prototype: The following is the C prototype for the expected OSAL API.

       void Osal_emacFree(void* ptr, Uint32 size)
    

Parameter
Pointer to the block of memory to be cleaned up.
Size of the allocated memory in bytes which is being freed.

Return Value
Not applicable.

#define Emac_osalMalloc (  )     Osal_emacMalloc(X)

The macro is used by the EMAC driver to allocate memory The EMAC driver uses this macro to allocate memory for its internal driver structures. This is invoked during the driver initialization and startup process.

Prototype: The following is the C prototype for the expected OSAL API.

       void* Osal_emacMalloc(Uint32 size)
    

Parameter
Number of bytes to be allocated

Return Value
Pointer to the allocated block size

See also:
Emac_osalFree


Copyright 2012, Texas Instruments Incorporated