Simple Virtual Machine
A simple but flexible virtual machine
SVM kernel operations

This module contains API functions to handle SVM kernel operations. More...

Functions

SVM_FUNCTION void svm_kernel_swap_memory (const void *svm, SVM_Kernel kernel1, SVM_Kernel kernel2)
 This function swaps memories of two kernels. More...
 

Detailed Description

This module contains API functions to handle SVM kernel operations.

Function Documentation

◆ svm_kernel_swap_memory()

SVM_FUNCTION void svm_kernel_swap_memory ( const void *  svm,
SVM_Kernel  kernel1,
SVM_Kernel  kernel2 
)

This function swaps memories of two kernels.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]kernel1The first kernel of memory exchange.
[in,out]kernel2The second kernel of memory exchange.

This function swaps the memories of the two kernels provided in input, no matter their state. This function also works on detached kernels.

Note
The two kernels have to be different kernels.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when at least one kernel is not owned by our process or is not in a process locked by ours.
FAILUREinterruption when the two kernels are the same kernel.