Go to the source code of this file.
Macros | |
#define | BF_TAG 'BFLK' |
#define | BF_NX_TAG 'BFNX' |
Functions | |
void * | platform_alloc_rw (uint64_t len) |
void * | platform_alloc_rwe (uint64_t len) |
void * | platform_virt_to_phys (void *virt) |
void | platform_free_rw (void *addr, uint64_t len) |
void | platform_free_rwe (void *addr, uint64_t len) |
void | platform_memset (void *ptr, char value, uint64_t num) |
void | platform_memcpy (void *dst, const void *src, uint64_t num) |
void | platform_start () |
void | platform_stop () |
int64_t | platform_num_cpus () |
int64_t | platform_set_affinity (int64_t affinity) |
void | platform_restore_affinity (int64_t affinity) |
#define BF_TAG 'BFLK' |
Definition at line 28 of file platform.c.
#define BF_NX_TAG 'BFNX' |
Definition at line 29 of file platform.c.
void* platform_alloc_rw | ( | uint64_t | len | ) |
Allocate Memory
Used by the common code to allocate virtual memory.
len | the size of virtual memory to be allocated in bytes. |
Definition at line 32 of file platform.c.
void* platform_alloc_rwe | ( | uint64_t | len | ) |
Allocate Executable Memory
Used by the common code to allocate executable virtual memory.
len | the size of virtual memory to be allocated in bytes. |
Definition at line 51 of file platform.c.
void* platform_virt_to_phys | ( | void * | virt | ) |
Convert Virtual Address to Physical Address
Given a virtual address, this function returns the associated physical address. Note that any page pool issues should be handle by the platform (i.e. the users of this function should be able to provide any virtual address, regardless of where the address originated from).
virt | the virtual address to convert |
Definition at line 70 of file platform.c.
void platform_free_rw | ( | void * | addr, |
uint64_t | len | ||
) |
Free Memory
Used by the common code to free virtual memory that was allocated using the platform_alloc function.
addr | the virtual address returned from platform_alloc |
len | the size of the memory allocated |
Definition at line 78 of file platform.c.
void platform_free_rwe | ( | void * | addr, |
uint64_t | len | ||
) |
Free Executable Memory
Used by the common code to free virtual memory that was allocated using the platform_alloc_exec function.
addr | the virtual address returned from platform_alloc_exec |
len | the size of the memory allocated |
Definition at line 92 of file platform.c.
void platform_memset | ( | void * | ptr, |
char | value, | ||
uint64_t | num | ||
) |
Memset
ptr | a pointer to the memory to set |
value | the value to set each byte to |
num | the number of bytes to set |
Definition at line 106 of file platform.c.
void platform_memcpy | ( | void * | dst, |
const void * | src, | ||
uint64_t | num | ||
) |
Memcpy
dst | a pointer to the memory to copy to |
src | a pointer to the memory to copy from |
num | the number of bytes to copy |
Definition at line 115 of file platform.c.
void platform_start | ( | void | ) |
void platform_stop | ( | void | ) |
int64_t platform_num_cpus | ( | void | ) |
Get Number of CPUs
Definition at line 136 of file platform.c.
int64_t platform_set_affinity | ( | int64_t | affinity | ) |
Set CPU affinity
Changes the current core that the driver is running on.
affinity | the cpu number to change to |
Definition at line 143 of file platform.c.
void platform_restore_affinity | ( | int64_t | affinity | ) |
Restore CPU affinity
If an OS requires the cores used by the user space thread to match on return from a call into the kernel (e.g. IOCTL), reset the affinity to it's previous state.
affinity | the cpu affinity mask. |
Definition at line 150 of file platform.c.