OpenNet
Classes | Typedefs
OSDep.h File Reference

OpenNetK_OSDep. More...

Go to the source code of this file.

Classes

struct  OpenNetK_OSDep
 This structure contains pointer to OS dependant functions. More...
 

Typedefs

typedef void *(* OpenNetK_OSDep_AllocateMemory) (unsigned int aSize_byte)
 Allocate non paged memory. More...
 
typedef void(* OpenNetK_OSDep_FreeMemory) (void *aMemory)
 Release non paged memory. More...
 
typedef uint64_t(* OpenNetK_OSDep_GetTimeStamp) (void)
 Retrive a timestamp. More...
 
typedef void(* OpenNetK_OSDep_LockSpinlock) (void *aLock)
 Lock a spinlock. More...
 
typedef uint32_t(* OpenNetK_OSDep_LockSpinlockFromThread) (void *aLock)
 Lock a spinlock and disable interrupt. More...
 
typedef void(* OpenNetK_OSDep_UnlockSpinlock) (void *aLock)
 Unlock a spinlock. More...
 
typedef void(* OpenNetK_OSDep_UnlockSpinlockFromThread) (void *aLock, uint32_t aFlags)
 Unlock a spinlock and restore interrupt. More...
 
typedef void *(* OpenNetK_OSDep_MapBuffer) (void *aContext, uint64_t *aBuffer_PA, uint64_t aBuffer_DA, unsigned int aSize_byte, uint64_t aMarker_PA, volatile void **aMarker_MA)
 Map a buffer. More...
 
typedef void(* OpenNetK_OSDep_UnmapBuffer) (void *aContext, void *aBuffer_MA, unsigned int aSize_byte, volatile void *aMarker_MA)
 Map a buffer. More...
 
typedef void *(* OpenNetK_OSDep_MapSharedMemory) (void *aContext, void *aShared_UA, unsigned int aSize_byte)
 Map the shared memory. More...
 
typedef void(* OpenNetK_OSDep_UnmapSharedMemory) (void *aContext)
 Unmap the shared memory. More...
 

Detailed Description

OpenNetK_OSDep.

Author
KMS - Martin Dubois, ing.

Typedef Documentation

typedef void*( * OpenNetK_OSDep_AllocateMemory) (unsigned int aSize_byte)

Allocate non paged memory.

Parameters
aSize_byteThe size of memory to allocate
Returns
The allocated memory's address
See also
OpenNetK_OSDep_FreeMemory
typedef void( * OpenNetK_OSDep_FreeMemory) (void *aMemory)

Release non paged memory.

Parameters
aMemoryThe address of the memory to release
See also
OpenNetK_OSDep_AllocateMemory
typedef uint64_t( * OpenNetK_OSDep_GetTimeStamp) (void)

Retrive a timestamp.

Returns
A timestamp in us
typedef void( * OpenNetK_OSDep_LockSpinlock) (void *aLock)

Lock a spinlock.

Parameters
aLockThe spinlock
Note
This function is part of the critical path.
See also
OpenNetK_OSDep_UnlockSpinlock
typedef uint32_t( * OpenNetK_OSDep_LockSpinlockFromThread) (void *aLock)

Lock a spinlock and disable interrupt.

Parameters
aLockThe spinlock
Returns
A value to pass to OpenNetK_OSDep_UnlockSpinlockFromThread
See also
OpenNetK_OSDep_UnlockSpinlockFromThread
typedef void*( * OpenNetK_OSDep_MapBuffer) (void *aContext, uint64_t *aBuffer_PA, uint64_t aBuffer_DA, unsigned int aSize_byte, uint64_t aMarker_PA, volatile void **aMarker_MA)

Map a buffer.

Parameters
aContextThe context
aBuffer_PAThe input or output for the buffer physical address
aBuffer_DAThe buffer device address
aSize_byteThe size of the buffer
aMarker_PAThe physical address of the marker
aMarker_MAThe mapped address of the marker is returner here
Returns
This function return the mapped address of the buffer
See also
OpenNetK_OSDep_UnmapBuffer
typedef void*( * OpenNetK_OSDep_MapSharedMemory) (void *aContext, void *aShared_UA, unsigned int aSize_byte)

Map the shared memory.

Parameters
aContextThe context
aShared_USThe user address of the shared memory
aSize_byteThe size of the shared memory
Returns
This function return the mapped address of the shared memory
See also
OpenNetK_OSDep_UnmapSharedMemory
typedef void( * OpenNetK_OSDep_UnlockSpinlock) (void *aLock)

Unlock a spinlock.

Parameters
aLockThe spinlock
Note
This function is part of the critical path.
See also
OpenNetK_OSDep_LockSpinlock
typedef void( * OpenNetK_OSDep_UnlockSpinlockFromThread) (void *aLock, uint32_t aFlags)

Unlock a spinlock and restore interrupt.

Parameters
aLockThe spinlock
aFlagsThe value OpenNetK_OSDep_LockSpinlockFromThread returned
See also
OpenNetK_OSDep_LockSpinlockFromThread
typedef void( * OpenNetK_OSDep_UnmapBuffer) (void *aContext, void *aBuffer_MA, unsigned int aSize_byte, volatile void *aMarker_MA)

Map a buffer.

Parameters
aContextThe context
aBuffer_MAThe mapped address of the buffer
aSize_byteThe size of the buffer
aMarker_MAThe mapped address of the marker is returner here
See also
OpenNetK_OSDep_MapBuffer
typedef void( * OpenNetK_OSDep_UnmapSharedMemory) (void *aContext)

Unmap the shared memory.

Parameters
aContextThe context
See also
OpenNetK_OSDep_MapSharedMemory