Simple Virtual Machine
A simple but flexible virtual machine
SVM process kernels

This module contains API functions to handle SVM process kernels. More...

Functions

SVM_FUNCTION SVM_Boolean svm_process_kernel_attach (const void *svm, SVM_Process process, const SVM_Kernel kernel, const SVM_Size argc, SVM_Parameter argv[])
 This function attaches a kernel to a process. More...
 
SVM_FUNCTION SVM_Boolean svm_process_kernel_detach (const void *svm, SVM_Process process, const SVM_Kernel kernel, const SVM_Size argc, SVM_Parameter argv[])
 This function detaches a kernel from a process. More...
 
SVM_FUNCTION SVM_Kernel svm_process_kernel_get_current (const void *svm, const SVM_Process process)
 This function retrieves the kernel currently executed on a process. More...
 

Detailed Description

This module contains API functions to handle SVM process kernels.

Function Documentation

◆ svm_process_kernel_attach()

SVM_FUNCTION SVM_Boolean svm_process_kernel_attach ( const void *  svm,
SVM_Process  process,
const SVM_Kernel  kernel,
const SVM_Size  argc,
SVM_Parameter  argv[] 
)

This function attaches a kernel to a process.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]processThe receiving process.
[in]kernelThe kernel to attach.
[in]argcThe number of parameters.
[in]argvThe parameters.

The parameters are sent verbatim to the sequencer attach plugin callback. The argv parameter can be a NULL pointer if the sequencer callback accepts it.

Warning
If the argv is not a NULL pointer and its size is smaller than argc, it will result in an undefined behavior.
Returns
TRUE if the kernel is attached to a process, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the kernel can not be attached to the process.
FAILUREinterruption when the process is not ours or is not a process locked by ours.
See also
svm_process_ownership_lock
svm_process_get_current

◆ svm_process_kernel_detach()

SVM_FUNCTION SVM_Boolean svm_process_kernel_detach ( const void *  svm,
SVM_Process  process,
const SVM_Kernel  kernel,
const SVM_Size  argc,
SVM_Parameter  argv[] 
)

This function detaches a kernel from a process.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]processThe giving process.
[in]kernelThe kernel to detach.
[in]argcThe number of parameters.
[in]argvThe parameters.

The parameters are sent verbatim to the sequencer detach plugin callback. The argv parameter can be a NULL pointer if the sequencer callback accepts it.

Warning
If the argv is not a NULL pointer and its size is smaller than argc, it will result in an undefined behavior.
Returns
TRUE if the kernel is detached from a process, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the kernel can not be detached from the process.
FAILUREinterruption when the process is not ours or is not a process locked by ours.
See also
svm_process_ownership_lock
svm_process_get_current

◆ svm_process_kernel_get_current()

SVM_FUNCTION SVM_Kernel svm_process_kernel_get_current ( const void *  svm,
const SVM_Process  process 
)

This function retrieves the kernel currently executed on a process.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]processThe process from which the current kernel will be extracted.
Returns
The current kernel executed in a process or a NULL pointer when the process is a zombie.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the process is not ours or is not a process locked by ours.
See also
svm_process_ownership_lock
svm_process_get_current