Simple Virtual Machine A simple but flexible virtual machine

Loading...
Searching...
No Matches
Functions
SVM kernel status
SVM kernels

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

## Functions
SVM_FUNCTION SVM_Boolean | svm_kernel_is_runnable (const void *svm, const SVM_Kernel kernel)
| This function checks whether a kernel can be executed.
SVM_FUNCTION SVM_Boolean | svm_kernel_is_terminated (const void *svm, const SVM_Kernel kernel)
| This function checks whether a kernel has completed its execution.
SVM_FUNCTION SVM_Kernel_State | svm_kernel_get_state (const void *svm, const SVM_Kernel kernel)
| This function returns the status of the kernel.
SVM_FUNCTION SVM_Boolean | svm_kernel_has_transmitinterruption (const void *svm, const SVM_Kernel kernel)
| This function checks whether a kernel has the transmit_interruptions option.
SVM_FUNCTION SVM_Boolean | svm_kernel_has_lastreturnisshutdown (const void *svm, const SVM_Kernel kernel)
| This function checks whether a kernel has the last_return_is_shutdown option.
SVM_FUNCTION SVM_Boolean | svm_kernel_has_protectedmode (const void *svm, const SVM_Kernel kernel)
| This function checks whether a kernel has the protected_mode option.
SVM_FUNCTION SVM_AccessControl | svm_kernel_get_accesscontrol (const void *svm, const SVM_Kernel kernel)
| This function retrieves the access control of a protected kernel.
SVM_FUNCTION void | svm_kernel_set_accesscontrol (const void *svm, const SVM_Kernel kernel, const SVM_AccessControl access_control)
| This function modifies the access control of a protected kernel.
SVM_FUNCTION SVM_Value_Interruption | svm_kernel_get_interruption (const void *svm, const SVM_Kernel kernel)
| This function retrieves the interruption of an interrupted kernel.
SVM_FUNCTION SVM_String | svm_kernel_print (const void *svm, const SVM_Kernel kernel)
| This function returns a string representation of the kernel.
SVM_FUNCTION SVM_String | svm_kernel_get_coredump (const void *svm, const SVM_Kernel kernel)
| This function returns a string representation of the complete kernel, like in core dumps.

## Detailed Description

This module contains API functions to handle SVM kernel status.

## Function Documentation

## ◆ svm_kernel_get_accesscontrol()

SVM_FUNCTION SVM_AccessControl svm_kernel_get_accesscontrol | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function retrieves the access control of a protected kernel.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel from which the interruption will be extracted.

Returns
  The access control of the kernel if the kernel has a defined quota, a NULL pointer otherwise.

Exceptions

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

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_kernel_get_coredump()

SVM_FUNCTION SVM_String svm_kernel_get_coredump | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function returns a string representation of the complete kernel, like in core dumps.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel from which the core dump will be extracted.

Note
  This API function can be useful for debugging purpose.

Returns
  A SVM_String containing a core dump of the kernel.

Exceptions

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

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_kernel_get_interruption()

SVM_FUNCTION SVM_Value_Interruption svm_kernel_get_interruption | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function retrieves the interruption of an interrupted kernel.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel from which the interruption will be extracted.

Returns
  If the kernel is interrupted, the interruption of the kernel, a NULL pointer otherwise.

Exceptions

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

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_kernel_get_state()

SVM_FUNCTION SVM_Kernel_State svm_kernel_get_state | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function returns the status of the kernel.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel to be diagnosed.

Returns
  The status of the kernel.

Exceptions

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

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_kernel_has_lastreturnisshutdown()

SVM_FUNCTION SVM_Boolean svm_kernel_has_lastreturnisshutdown | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function checks whether a kernel has the last_return_is_shutdown option.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel to be diagnosed.

Returns
  TRUE if the kernel has the last_return_is_shutdown option activated, 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 is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_kernel_has_protectedmode()

SVM_FUNCTION SVM_Boolean svm_kernel_has_protectedmode | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function checks whether a kernel has the protected_mode option.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel to be diagnosed.

Returns
  TRUE if the kernel has the protected_mode option activated, 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 is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_kernel_has_transmitinterruption()

SVM_FUNCTION SVM_Boolean svm_kernel_has_transmitinterruption | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function checks whether a kernel has the transmit_interruptions option.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel to be diagnosed.

Returns
  TRUE if the kernel has the transmit_interruptions option activated, 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 is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_kernel_is_runnable()

SVM_FUNCTION SVM_Boolean svm_kernel_is_runnable | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function checks whether a kernel can be executed.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel to be diagnosed.

Returns
  TRUE if the kernel can be returned to the process by a sequencer, 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 is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_kernel_is_terminated()

SVM_FUNCTION SVM_Boolean svm_kernel_is_terminated | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function checks whether a kernel has completed its execution.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel to be diagnosed.

Returns
  TRUE if the kernel is in zombie, interrupted or error state, 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 is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_kernel_print()

SVM_FUNCTION SVM_String svm_kernel_print | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function returns a string representation of the kernel.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel from which the state will be extracted.

Note
  This API function can be useful in sequencer print callback functions.

Returns
  A SVM_String containing a representation of the kernel.

Exceptions

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

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_kernel_set_accesscontrol()

SVM_FUNCTION void svm_kernel_set_accesscontrol | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_AccessControl | access_control
| ) |  |

This function modifies the access control of a protected kernel.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel from which the interruption will be extracted.
  [in] | access_control | The access control to set.

Note
  The resulting access control on the kernel is made of the lowest limit between the current access control of the kernel and the new one.

Exceptions

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

See also
  svm_process_ownership_lock
  svm_kernel_get_current