Low-level VE Offloading API functions.
More...
Low-level VE Offloading API functions.
To use low-level VEO API functions, include "ve_offload.h" header.
void veo_register_hook |
( |
void * |
func, |
|
|
void(*)(void *,...) |
hook, |
|
|
void * |
payload |
|
) |
| |
Register a hook function.
Certain VEO API functions can have specific hooks that are called after the API call did it's work properly. The arguments of the hook function (should be a "C" function) depend on the call and are passed as varargs. Therefore the arguments must be unpacked appropriately inside the hook function.
Example: extern "C" void myhook(void *payload, ...) { va_list args; va_start(args, payload); auto addr = va_arg(args, uint64_t); auto size = va_arg(args, size_t); va_end(args); // do hook work }
- Note
- This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program.
- Parameters
-
[in] | func | pointer to function receiving the "hook" |
[in] | hook | the hook function |
[in] | payload | pointer to an opaque payload common to all hook calls |
void* veo_get_hook |
( |
void * |
func | ) |
|
Retrieve the pointer to a hook function.
- Note
- This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program.
- Parameters
-
[in] | func | pointer to function that has the "hook" |
- Returns
- pointer to hook function
-
NULL if function or hook not found
void veo_unregister_hook |
( |
void * |
func | ) |
|
Unregister a hook function.
- Note
- This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program.
- Parameters
-
[in] | func | pointer to function receiving the "hook" |
void veo_req_block_begin |
( |
veo_thr_ctxt * |
ctx | ) |
|
Start a request block, allowing only requests from the current thread.
The call will block if another thread has locked the submit mutex, i.e. has started a request block on the same context.
- Note
- This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program.
- Parameters
-
void veo_req_block_end |
( |
veo_thr_ctxt * |
ctx | ) |
|
End a request block that allowed only requests from the current thread.
The call will unlock the previously locked the submit mutex.
- Note
- This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program.
- Parameters
-
void veo_register_hmem_hook_functions |
( |
void(*)(void *, size_t) |
alloc, |
|
|
void(*)(uint64_t) |
free |
|
) |
| |
Register hook functions to set HMEM addr.
- Note
- This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program.
- Parameters
-
[in] | alloc | pointer to function that allocates memory and takes HMEM addr as an argument. |
[in] | free | pointer to function that frees memory and takes HMEM addr as an argument. |
void veo_unregister_hmem_hook_functions |
( |
void |
| ) |
|
Unregister hook functions to set HMEM addr.
- Note
- This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program.
void* veo_set_proc_identifier |
( |
void * |
addr, |
|
|
int |
proc_ident |
|
) |
| |
set a veo_proc_handle's identifier to VEMVA
- Note
- This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program.
- Parameters
-
addr | [in] VEMVA address |
proc_ident | [in] process identifier |
- Return values
-
HMEM | addr upon success; 0 upon failure. This API is not intended to be called by a user program. |
veo_proc_handle* veo_get_proc_handle_from_hmem |
( |
const void * |
addr | ) |
|
Get veo_proc_handle from HMEM addr.
- Note
- This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program.
- Parameters
-
[in] | addr | a pointer to VEMVA address with the identifier (HMEM addr) |
- Returns
- VEO process handle upon success; nullptr upon faiulre.
int veo_get_venum_from_hmem |
( |
const void * |
addr | ) |
|
Get the node number where the process exists from HMEM.
- Note
- This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program.
- Parameters
-
[in] | addr | a pointer to VEMVA address with the identifier (HMEM addr) |
- Returns
- VE node number upon success; negative upon failure.
pid_t veo_get_pid_from_hmem |
( |
const void * |
addr | ) |
|
Get the PID of the VE process from HMEM.
- Note
- This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program.
- Parameters
-
[in] | addr | a pointer to VEMVA address with the identifier (HMEM addr) |
- Returns
- PID upon success; negative upon failure.
int veo_get_ve_arch |
( |
int |
venode | ) |
|
get the architecture of the specified VE node.
- Note
- This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program.
- Parameters
-
- Return values
-
> | 0 VE architecture number |
0 | invalid argument or environment variable |
-1 | internal error |