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

This module contains API functions to get SVM processes. More...

Functions

SVM_FUNCTION SVM_Process svm_process_new (const void *svm, const SVM_Value_String name, const SVM_Value_PluginEntryPoint sequencer, const SVM_Boolean auto_terminated, const SVM_Kernel kernel)
 This function creates a new process from a kernel and the name from a string value. More...
 
SVM_FUNCTION SVM_Process svm_process_new__string (const void *svm, const SVM_String name, const SVM_Value_PluginEntryPoint sequencer, const SVM_Boolean auto_terminated, const SVM_Kernel kernel)
 This function creates a new process from a kernel and the name from a SVM string. More...
 
SVM_FUNCTION SVM_Process svm_process_new__raw (const void *svm, const char *name, const SVM_Value_PluginEntryPoint sequencer, const SVM_Boolean auto_terminated, const SVM_Kernel kernel)
 This function creates a new process from a kernel and the name from a C nul-terminated string. More...
 
SVM_FUNCTION SVM_Process svm_process_new_code (const void *svm, const SVM_Value_String name, const SVM_Value_PluginEntryPoint sequencer, const SVM_Boolean auto_terminated, const SVM_Code code, const SVM_Boolean transmit_interruptions, const SVM_Boolean last_return_is_shutdown, const SVM_Boolean protected_mode, const SVM_AccessControl access_control)
 This function creates a new process from specific values and the name from a string value. More...
 
SVM_FUNCTION SVM_Process svm_process_new_code__string (const void *svm, const SVM_String name, const SVM_Value_PluginEntryPoint sequencer, const SVM_Boolean auto_terminated, const SVM_Code code, const SVM_Boolean transmit_interruptions, const SVM_Boolean last_return_is_shutdown, const SVM_Boolean protected_mode, const SVM_AccessControl access_control)
 This function creates a new process from specific values and the name from a SVM_String. More...
 
SVM_FUNCTION SVM_Process svm_process_new_code__raw (const void *svm, const char *name, const SVM_Value_PluginEntryPoint sequencer, const SVM_Boolean auto_terminated, const SVM_Code code, const SVM_Boolean transmit_interruptions, const SVM_Boolean last_return_is_shutdown, const SVM_Boolean protected_mode, const SVM_AccessControl access_control)
 This function creates a new process from specific values and the name from a C nul-terminated string. More...
 
SVM_FUNCTION SVM_Process svm_process_new_symbol (const void *svm, const SVM_Value_String name, const SVM_Value_PluginEntryPoint sequencer, const SVM_Boolean auto_terminated, const SVM_Value_Symbol symbol, const SVM_Boolean transmit_interruptions, const SVM_Boolean last_return_is_shutdown, const SVM_Boolean protected_mode, const SVM_AccessControl access_control)
 This function creates a new process from specific values and the name from a string value. More...
 
SVM_FUNCTION SVM_Process svm_process_new_symbol__string (const void *svm, const SVM_String name, const SVM_Value_PluginEntryPoint sequencer, const SVM_Boolean auto_terminated, const SVM_Value_Symbol symbol, const SVM_Boolean transmit_interruptions, const SVM_Boolean last_return_is_shutdown, const SVM_Boolean protected_mode, const SVM_AccessControl access_control)
 This function creates a new process from specific values and the name from a SVM_String. More...
 
SVM_FUNCTION SVM_Process svm_process_new_symbol__raw (const void *svm, const char *name, const SVM_Value_PluginEntryPoint sequencer, const SVM_Boolean auto_terminated, const SVM_Value_Symbol symbol, const SVM_Boolean transmit_interruptions, const SVM_Boolean last_return_is_shutdown, const SVM_Boolean protected_mode, const SVM_AccessControl access_control)
 This function creates a new process from specific values and the name from a C nul-terminated string. More...
 
SVM_FUNCTION SVM_Process svm_process_get_current (const void *svm)
 This function retrieves the current process. More...
 

Detailed Description

This module contains API functions to get SVM processes.

Function Documentation

◆ svm_process_get_current()

SVM_FUNCTION SVM_Process svm_process_get_current ( const void *  svm)

This function retrieves the current process.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
Warning
The resulting variable can be set global and added to a C/C++ structure linked to a type which can be written into the memory of the current kernel. In such case, a circular loop is created, preventing the variable to be destroyed at the proper time unless the variable is set local outside the type destructor or the value is explicitely removed from the kernel memory.
Returns
The current process if the API function is invoked inside a process, a NULL pointer otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_process_new()

SVM_FUNCTION SVM_Process svm_process_new ( const void *  svm,
const SVM_Value_String  name,
const SVM_Value_PluginEntryPoint  sequencer,
const SVM_Boolean  auto_terminated,
const SVM_Kernel  kernel 
)

This function creates a new process from a kernel and the name from a string value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe name of the process.
[in]sequencerThe sequencer name. A NULL pointer will select the default sequencer.
[in]auto_terminatedThis flag indicates whether the process shall be automatically terminated.
[in]kernelThe first kernel of the process.

The process is created in SUSPENDED state and has to be attached to a scheduler to be executed.

Note
Several processes can have the same name. This name will be used for debugging purpose.
Returns
The created process.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_process_new__raw()

SVM_FUNCTION SVM_Process svm_process_new__raw ( const void *  svm,
const char *  name,
const SVM_Value_PluginEntryPoint  sequencer,
const SVM_Boolean  auto_terminated,
const SVM_Kernel  kernel 
)

This function creates a new process from a kernel and the name from a C nul-terminated string.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe name of the process.
[in]sequencerThe sequencer name. A NULL pointer will select the default sequencer.
[in]auto_terminatedThis flag indicates whether the process shall be automatically terminated.
[in]kernelThe first kernel of the process.

The process is created in SUSPENDED state and has to be attached to a scheduler to be executed.

Note
Several processes can have the same name. This name will be used for debugging purpose.
Returns
The created process.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_process_new__string()

SVM_FUNCTION SVM_Process svm_process_new__string ( const void *  svm,
const SVM_String  name,
const SVM_Value_PluginEntryPoint  sequencer,
const SVM_Boolean  auto_terminated,
const SVM_Kernel  kernel 
)

This function creates a new process from a kernel and the name from a SVM string.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe name of the process.
[in]sequencerThe sequencer name. A NULL pointer will select the default sequencer.
[in]auto_terminatedThis flag indicates whether the process shall be automatically terminated.
[in]kernelThe first kernel of the process.

The process is created in SUSPENDED state and has to be attached to a scheduler to be executed.

Note
Several processes can have the same name. This name will be used for debugging purpose.
Returns
The created process.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_process_new_code()

SVM_FUNCTION SVM_Process svm_process_new_code ( const void *  svm,
const SVM_Value_String  name,
const SVM_Value_PluginEntryPoint  sequencer,
const SVM_Boolean  auto_terminated,
const SVM_Code  code,
const SVM_Boolean  transmit_interruptions,
const SVM_Boolean  last_return_is_shutdown,
const SVM_Boolean  protected_mode,
const SVM_AccessControl  access_control 
)

This function creates a new process from specific values and the name from a string value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe name of the process.
[in]sequencerThe sequencer name. A NULL pointer will select the default sequencer.
[in]auto_terminatedThis flag indicates whether the process shall be automatically terminated.
[in]codeThe SVM code to execute in the first kernel of the process.
[in]transmit_interruptionsThis flag asks the first kernel to forward the interruption to the next kernel or the process.
[in]last_return_is_shutdownThis flag indicates whether an extra return on an empty return stack can be considered as a shutdown in the first kernel of the process.
[in]protected_modeThe protected mode of the first kernel of the process.
[in]access_controlThe access control of the first kernel of the process. A NULL pointer means no specific restriction.

The process is created in SUSPENDED state and has to be attached to a scheduler to be executed.

Note
When this API function is called within a kernel, the protected mode and the access control of the first kernel of the process are always set as restrictions of the current limitations. In particular, if the current kernel executes code in protected mode, the created kernel within the process will automatically be in protected mode, no matter the protected_mode flag could be.
Access control is ignored when the first kernel of the process is not created in protected mode.
Warning
When this API function is called outside a kernel, the protected mode and access control parameters are directly applied. This can lead to a security issue unless either the plugin callback containing such call can only be triggered by a system instruction, or the code is coming only from safe sources.
Note
Several processes can have the same name. This name will be used for debugging purpose.
Returns
The created process.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_process_new_code__raw()

SVM_FUNCTION SVM_Process svm_process_new_code__raw ( const void *  svm,
const char *  name,
const SVM_Value_PluginEntryPoint  sequencer,
const SVM_Boolean  auto_terminated,
const SVM_Code  code,
const SVM_Boolean  transmit_interruptions,
const SVM_Boolean  last_return_is_shutdown,
const SVM_Boolean  protected_mode,
const SVM_AccessControl  access_control 
)

This function creates a new process from specific values and the name from a C nul-terminated string.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe name of the process.
[in]sequencerThe sequencer name. A NULL pointer will select the default sequencer.
[in]auto_terminatedThis flag indicates whether the process shall be automatically terminated.
[in]codeThe SVM code to execute in the first kernel of the process.
[in]transmit_interruptionsThis flag asks the first kernel to forward the interruption to the next kernel or the process.
[in]last_return_is_shutdownThis flag indicates whether an extra return on an empty return stack can be considered as a shutdown in the first kernel of the process.
[in]protected_modeThe protected mode of the first kernel of the process.
[in]access_controlThe access control of the first kernel of the process. A NULL pointer means no specific restriction.

The process is created in SUSPENDED state and has to be attached to a scheduler to be executed.

Note
When this API function is called within a kernel, the protected mode and the access control of the first kernel of the process are always set as restrictions of the current limitations. In particular, if the current kernel executes code in protected mode, the created kernel within the process will automatically be in protected mode, no matter the protected_mode flag could be.
Access control is ignored when the first kernel of the process is not created in protected mode.
Warning
When this API function is called outside a kernel, the protected mode and access control parameters are directly applied. This can lead to a security issue unless either the plugin callback containing such call can only be triggered by a system instruction, or the code is coming only from safe sources.
Note
Several processes can have the same name. This name will be used for debugging purpose.
Returns
The created process.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_process_new_code__string()

SVM_FUNCTION SVM_Process svm_process_new_code__string ( const void *  svm,
const SVM_String  name,
const SVM_Value_PluginEntryPoint  sequencer,
const SVM_Boolean  auto_terminated,
const SVM_Code  code,
const SVM_Boolean  transmit_interruptions,
const SVM_Boolean  last_return_is_shutdown,
const SVM_Boolean  protected_mode,
const SVM_AccessControl  access_control 
)

This function creates a new process from specific values and the name from a SVM_String.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe name of the process.
[in]sequencerThe sequencer name. A NULL pointer will select the default sequencer.
[in]auto_terminatedThis flag indicates whether the process shall be automatically terminated.
[in]codeThe SVM code to execute in the first kernel of the process.
[in]transmit_interruptionsThis flag asks the first kernel to forward the interruption to the next kernel or the process.
[in]last_return_is_shutdownThis flag indicates whether an extra return on an empty return stack can be considered as a shutdown in the first kernel of the process.
[in]protected_modeThe protected mode of the first kernel of the process.
[in]access_controlThe access control of the first kernel of the process. A NULL pointer means no specific restriction.

The process is created in SUSPENDED state and has to be attached to a scheduler to be executed.

Note
When this API function is called within a kernel, the protected mode and the access control of the first kernel of the process are always set as restrictions of the current limitations. In particular, if the current kernel executes code in protected mode, the created kernel within the process will automatically be in protected mode, no matter the protected_mode flag could be.
Access control is ignored when the first kernel of the process is not created in protected mode.
Warning
When this API function is called outside a kernel, the protected mode and access control parameters are directly applied. This can lead to a security issue unless either the plugin callback containing such call can only be triggered by a system instruction, or the code is coming only from safe sources.
Note
Several processes can have the same name. This name will be used for debugging purpose.
Returns
The created process.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_process_new_symbol()

SVM_FUNCTION SVM_Process svm_process_new_symbol ( const void *  svm,
const SVM_Value_String  name,
const SVM_Value_PluginEntryPoint  sequencer,
const SVM_Boolean  auto_terminated,
const SVM_Value_Symbol  symbol,
const SVM_Boolean  transmit_interruptions,
const SVM_Boolean  last_return_is_shutdown,
const SVM_Boolean  protected_mode,
const SVM_AccessControl  access_control 
)

This function creates a new process from specific values and the name from a string value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe name of the process.
[in]sequencerThe sequencer name. A NULL pointer will select the default sequencer.
[in]auto_terminatedThis flag indicates whether the process shall be automatically terminated.
[in]symbolThe symbol to jump to in the first kernel of the process.
[in]transmit_interruptionsThis flag asks the first kernel to forward the interruption to the next kernel or the process.
[in]last_return_is_shutdownThis flag indicates whether an extra return on an empty return stack can be considered as a shutdown in the first kernel of the process.
[in]protected_modeThe protected mode of the first kernel of the process.
[in]access_controlThe access control of the first kernel of the process. A NULL pointer means no specific restriction.

The process is created in SUSPENDED state and has to be attached to a scheduler to be executed.

Note
When this API function is called within a kernel, the protected mode and the access control of the first kernel of the process are always set as restrictions of the current limitations. In particular, if the current kernel executes code in protected mode, the created kernel within the process will automatically be in protected mode, no matter the protected_mode flag could be.
Access control is ignored when the first kernel of the process is not created in protected mode.
Warning
When this API function is called outside a kernel, the protected mode and access control parameters are directly applied. This can lead to a security issue unless either the plugin callback containing such call can only be triggered by a system instruction, or the code is coming only from safe sources.
Note
Several processes can have the same name. This name will be used for debugging purpose.
Returns
The created process.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_process_new_symbol__raw()

SVM_FUNCTION SVM_Process svm_process_new_symbol__raw ( const void *  svm,
const char *  name,
const SVM_Value_PluginEntryPoint  sequencer,
const SVM_Boolean  auto_terminated,
const SVM_Value_Symbol  symbol,
const SVM_Boolean  transmit_interruptions,
const SVM_Boolean  last_return_is_shutdown,
const SVM_Boolean  protected_mode,
const SVM_AccessControl  access_control 
)

This function creates a new process from specific values and the name from a C nul-terminated string.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe name of the process.
[in]sequencerThe sequencer name. A NULL pointer will select the default sequencer.
[in]auto_terminatedThis flag indicates whether the process shall be automatically terminated.
[in]symbolThe symbol to jump to in the first kernel of the process.
[in]transmit_interruptionsThis flag asks the first kernel to forward the interruption to the next kernel or the process.
[in]last_return_is_shutdownThis flag indicates whether an extra return on an empty return stack can be considered as a shutdown in the first kernel of the process.
[in]protected_modeThe protected mode of the first kernel of the process.
[in]access_controlThe access control of the first kernel of the process. A NULL pointer means no specific restriction.

The process is created in SUSPENDED state and has to be attached to a scheduler to be executed.

Note
When this API function is called within a kernel, the protected mode and the access control of the first kernel of the process are always set as restrictions of the current limitations. In particular, if the current kernel executes code in protected mode, the created kernel within the process will automatically be in protected mode, no matter the protected_mode flag could be.
Access control is ignored when the first kernel of the process is not created in protected mode.
Warning
When this API function is called outside a kernel, the protected mode and access control parameters are directly applied. This can lead to a security issue unless either the plugin callback containing such call can only be triggered by a system instruction, or the code is coming only from safe sources.
Note
Several processes can have the same name. This name will be used for debugging purpose.
Returns
The created process.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_process_new_symbol__string()

SVM_FUNCTION SVM_Process svm_process_new_symbol__string ( const void *  svm,
const SVM_String  name,
const SVM_Value_PluginEntryPoint  sequencer,
const SVM_Boolean  auto_terminated,
const SVM_Value_Symbol  symbol,
const SVM_Boolean  transmit_interruptions,
const SVM_Boolean  last_return_is_shutdown,
const SVM_Boolean  protected_mode,
const SVM_AccessControl  access_control 
)

This function creates a new process from specific values and the name from a SVM_String.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe name of the process.
[in]sequencerThe sequencer name. A NULL pointer will select the default sequencer.
[in]auto_terminatedThis flag indicates whether the process shall be automatically terminated.
[in]symbolThe symbol to jump to in the first kernel of the process.
[in]transmit_interruptionsThis flag asks the first kernel to forward the interruption to the next kernel or the process.
[in]last_return_is_shutdownThis flag indicates whether an extra return on an empty return stack can be considered as a shutdown in the first kernel of the process.
[in]protected_modeThe protected mode of the first kernel of the process.
[in]access_controlThe access control of the first kernel of the process. A NULL pointer means no specific restriction.

The process is created in SUSPENDED state and has to be attached to a scheduler to be executed.

Note
When this API function is called within a kernel, the protected mode and the access control of the first kernel of the process are always set as restrictions of the current limitations. In particular, if the current kernel executes code in protected mode, the created kernel within the process will automatically be in protected mode, no matter the protected_mode flag could be.
Access control is ignored when the first kernel of the process is not created in protected mode.
Warning
When this API function is called outside a kernel, the protected mode and access control parameters are directly applied. This can lead to a security issue unless either the plugin callback containing such call can only be triggered by a system instruction, or the code is coming only from safe sources.
Note
Several processes can have the same name. This name will be used for debugging purpose.
Returns
The created process.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)