Go to the source code of this file.
Typedefs | |
typedef long(* | set_affinity_fn) (pid_t, const struct cpumask *) |
Functions | |
void * | platform_alloc_rw (uint64_t len) |
void * | platform_alloc_rwe (uint64_t len) |
void | platform_free_rw (void *addr, uint64_t len) |
void | platform_free_rwe (void *addr, uint64_t len) |
void * | platform_virt_to_phys (void *virt) |
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) |
void | platform_stop (void) |
int64_t | platform_num_cpus (void) |
int64_t | platform_set_affinity (int64_t affinity) |
void | platform_restore_affinity (int64_t affinity) |
Variables | |
set_affinity_fn | set_cpu_affinity = 0 |
typedef long(* set_affinity_fn) (pid_t, const struct cpumask *) |
Definition at line 39 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 43 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 62 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 81 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 95 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 109 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 118 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 127 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 152 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 163 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 182 of file platform.c.
set_affinity_fn set_cpu_affinity = 0 |
Definition at line 40 of file platform.c.