Simple Virtual Machine
A simple but flexible virtual machine
SVM processor instruction overrides

This module contains API functions to handle SVM processor instruction overrides. More...

Functions

SVM_FUNCTION void svm_processor_instructionoverride_set_local (const void *svm, const SVM_Kernel kernel, const SVM_Address address, const SVM_Value_PluginEntryPoint name, const SVM_Size argc, const SVM_Parameter argv[], const SVM_Object_Level level)
 This function sets an instruction override on a local address. More...
 
SVM_FUNCTION void svm_processor_instructionoverride_set_global (const void *svm, const SVM_Kernel kernel, const SVM_Value_Symbol symbol, const SVM_Value_PluginEntryPoint name, const SVM_Size argc, const SVM_Parameter argv[], const SVM_Object_Level level)
 This function sets an instruction override on a local address. More...
 
SVM_FUNCTION SVM_Boolean svm_processor_instructionoverride_has_local (const void *svm, const SVM_Kernel kernel, const SVM_Address address, const SVM_Object_Level level)
 This function checks whether a processor has an instruction override on a local address. More...
 
SVM_FUNCTION SVM_Boolean svm_processor_instructionoverride_has_global (const void *svm, const SVM_Kernel kernel, const SVM_Value_Symbol symbol, const SVM_Object_Level level)
 This function checks whether a processor has an instruction override on a symbol. More...
 
SVM_FUNCTION void svm_processor_instructionoverride_reset_local (const void *svm, const SVM_Kernel kernel, const SVM_Address address, const SVM_Object_Level level)
 This function removes an instruction override on a local address. More...
 
SVM_FUNCTION void svm_processor_instructionoverride_reset_global (const void *svm, const SVM_Kernel kernel, const SVM_Value_Symbol symbol, const SVM_Object_Level level)
 This function removes an instruction override on a symbol. More...
 

Detailed Description

This module contains API functions to handle SVM processor instruction overrides.

Function Documentation

◆ svm_processor_instructionoverride_has_global()

SVM_FUNCTION SVM_Boolean svm_processor_instructionoverride_has_global ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_Value_Symbol  symbol,
const SVM_Object_Level  level 
)

This function checks whether a processor has an instruction override on a symbol.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted processor is.
[in]symbolThe symbol to check.
[in]levelThe level of instruction override.
Returns
TRUE when the symbol has an instruction override, FALSE otherwise.
Note
The level can be LOCAL or GLOBAL. Cascaded instruction overrides are considered local by this API function.
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_processor_instructionoverride_has_local()

SVM_FUNCTION SVM_Boolean svm_processor_instructionoverride_has_local ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_Address  address,
const SVM_Object_Level  level 
)

This function checks whether a processor has an instruction override on a local address.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted processor is.
[in]addressThe local address to check.
[in]levelThe level of instruction override.
Returns
TRUE when the address has an instruction override, FALSE otherwise.
Note
The level can be LOCAL or GLOBAL. Cascaded instruction overrides are considered local by this API function.
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_processor_instructionoverride_reset_global()

SVM_FUNCTION void svm_processor_instructionoverride_reset_global ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_Value_Symbol  symbol,
const SVM_Object_Level  level 
)

This function removes an instruction override on a symbol.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted processor is.
[in]symbolThe symbol where the override shall be removed.
[in]levelThe level of instruction override.

This function removes an instruction override at the symbol.

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_processor_instructionoverride_reset_local()

SVM_FUNCTION void svm_processor_instructionoverride_reset_local ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_Address  address,
const SVM_Object_Level  level 
)

This function removes an instruction override on a local address.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted processor is.
[in]addressThe local address where the override shall be removed.
[in]levelThe level of instruction override.

This function removes an instruction override at the local address of the current code.

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_processor_instructionoverride_set_global()

SVM_FUNCTION void svm_processor_instructionoverride_set_global ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_Value_Symbol  symbol,
const SVM_Value_PluginEntryPoint  name,
const SVM_Size  argc,
const SVM_Parameter  argv[],
const SVM_Object_Level  level 
)

This function sets an instruction override on a local address.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted processor is.
[in]symbolThe symbol to override.
[in]nameThe instruction name.
[in]argcThe number of instruction parameters.
[in]argvThe instruction parameters.
[in]levelThe level of instruction override.

This API function sets an instruction override on the processor, at the given symbol. This instruction will be executed when the current instruction pointer matches the symbol, replacing the code one at the same symbol location.

Note
The created instruction will have the code location of the instruction calling this function. Parameter checks will be performed when the instruction is executed.
Warning
Only plugin instructions are allowed. Return values from these instructions are lost.
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.
FAILUREinterruption when the symbol already has an instruction override.
PROCESSORinterruption when the instruction does not exist.
See also
svm_process_ownership_lock
svm_kernel_get_current
svm_plugin_has_instruction

◆ svm_processor_instructionoverride_set_local()

SVM_FUNCTION void svm_processor_instructionoverride_set_local ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_Address  address,
const SVM_Value_PluginEntryPoint  name,
const SVM_Size  argc,
const SVM_Parameter  argv[],
const SVM_Object_Level  level 
)

This function sets an instruction override on a local address.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted processor is.
[in]addressThe local address to override.
[in]nameThe instruction name.
[in]argcThe number of instruction parameters.
[in]argvThe instruction parameters.
[in]levelThe level of instruction override.

This API function sets an instruction override on the processor, at the given address of the current code of the processor. This instruction will be executed when the current instruction pointer matches the address, replacing the code one at the same address location.

Note
The created instruction will have the code location of the instruction calling this function. Parameter checks will be performed when the instruction is executed.
Warning
Only plugin instructions are allowed. Return values from these instructions are lost.
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.
FAILUREinterruption when the address already has an instruction override.
PROCESSORinterruption when the instruction does not exist.
See also
svm_process_ownership_lock
svm_kernel_get_current
svm_plugin_has_instruction