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

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. More...
 
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. More...
 
SVM_FUNCTION SVM_Kernel_State svm_kernel_get_state (const void *svm, const SVM_Kernel kernel)
 This function returns the status of the kernel. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
SVM_FUNCTION SVM_String svm_kernel_print (const void *svm, const SVM_Kernel kernel)
 This function returns a string representation of the kernel. More...
 
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. More...
 

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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe 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
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe 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
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel from which the interruption will be extracted.
Returns
If the kernel is interrupted, the interruption of the kernel, a NULL pointer otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel to be diagnosed.
Returns
The status of the kernel.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel to be diagnosed.
Returns
TRUE if the kernel has the last_return_is_shutdown option activated, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel to be diagnosed.
Returns
TRUE if the kernel has the protected_mode option activated, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel to be diagnosed.
Returns
TRUE if the kernel has the transmit_interruptions option activated, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel to be diagnosed.
Returns
TRUE if the kernel can be returned to the process by a sequencer, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel to be diagnosed.
Returns
TRUE if the kernel is in zombie, interrupted or error state, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe 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
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel from which the interruption will be extracted.
[in]access_controlThe 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
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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