Simple Virtual Machine A simple but flexible virtual machine

Loading...
Searching...
No Matches
Functions
SVM process kernels
SVM processes

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.
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.
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.

## 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | process | The receiving process.
  [in] | kernel | The kernel to attach.
  [in] | argc | The number of parameters.
  [in] | argv | The 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

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel can not be attached to the process.
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | process | The giving process.
  [in] | kernel | The kernel to detach.
  [in] | argc | The number of parameters.
  [in] | argv | The 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

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel can not be detached from the process.
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | process | The 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

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the process is not ours or is not a process locked by ours.

See also
  svm_process_ownership_lock
  svm_process_get_current