Simple Virtual Machine A simple but flexible virtual machine

Loading...
Searching...
No Matches
Functions
SVM processor instruction overrides
SVM processors

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

## 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | symbol | The symbol to check.
  [in] | level | The 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

  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_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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | address | The local address to check.
  [in] | level | The 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

  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_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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | symbol | The symbol where the override shall be removed.
  [in] | level | The level of instruction override.

This function removes an instruction override at the symbol.

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_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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | address | The local address where the override shall be removed.
  [in] | level | The level of instruction override.

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

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_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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | symbol | The symbol to override.
  [in] | name | The instruction name.
  [in] | argc | The number of instruction parameters.
  [in] | argv | The instruction parameters.
  [in] | level | The 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

  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.
  FAILURE | interruption when the symbol already has an instruction override.
  PROCESSOR | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | address | The local address to override.
  [in] | name | The instruction name.
  [in] | argc | The number of instruction parameters.
  [in] | argv | The instruction parameters.
  [in] | level | The 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

  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.
  FAILURE | interruption when the address already has an instruction override.
  PROCESSOR | interruption when the instruction does not exist.

See also
  svm_process_ownership_lock
  svm_kernel_get_current
  svm_plugin_has_instruction