Simple Virtual Machine A simple but flexible virtual machine

Loading...
Searching...
No Matches
Functions
SVM memory addresses
SVM memories

This module contains API functions to handle SVM memory addresses. More...

## Functions
SVM_FUNCTION SVM_Boolean | svm_memory_address_is_defined (const void *svm, const SVM_Kernel kernel, const SVM_Address address)
| This function checks whether an address is defined in a memory.
SVM_FUNCTION SVM_Boolean | svm_memory_address_is_initialised (const void *svm, const SVM_Kernel kernel, const SVM_Address address)
| This function checks whether an address is initialised in a memory.
SVM_FUNCTION SVM_Type | svm_memory_address_get_type (const void *svm, const SVM_Kernel kernel, const SVM_Address address)
| This function extracts the type of a value from a memory.
SVM_FUNCTION SVM_Boolean | svm_memory_address_is_writable (const void *svm, const SVM_Kernel kernel, const SVM_Address address, const SVM_Value value)
| This function checks whether a value can be written into a memory.
SVM_FUNCTION void | svm_memory_address_set_type (const void *svm, const SVM_Kernel kernel, const SVM_Address address, const SVM_Type type)
| This function modifies the type to an internal type of an address of a memory.

## Detailed Description

This module contains API functions to handle SVM memory addresses.

## Function Documentation

## ◆ svm_memory_address_get_type()

SVM_FUNCTION SVM_Type svm_memory_address_get_type | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Address | address
| ) |  |

This function extracts the type of a value from a memory.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted memory is.
  [in] | address | The local address to check.

Returns
  The type of the value.

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.
  MEMORY | interruption when the address is not defined.

See also
  svm_memory_address_is_defined
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_memory_address_is_defined()

SVM_FUNCTION SVM_Boolean svm_memory_address_is_defined | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Address | address
| ) |  |

This function checks whether an address is defined in a memory.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted memory is.
  [in] | address | The local address to check.

Returns
  TRUE if the address has been allocated, 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_memory_address_is_initialised()

SVM_FUNCTION SVM_Boolean svm_memory_address_is_initialised | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Address | address
| ) |  |

This function checks whether an address is initialised in a memory.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted memory is.
  [in] | address | The local address to check.

Returns
  TRUE if the address has been allocated and has been initialised, 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_memory_address_is_writable()

SVM_FUNCTION SVM_Boolean svm_memory_address_is_writable | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Address | address,
|  | const SVM_Value | value
| ) |  |

This function checks whether a value can be written into a memory.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted memory is.
  [in] | address | The local address to write to.
  [in] | value | The value to check.

This API function does not write the value into the memory.

Returns
  TRUE when the write can be successful, 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_memory_write_address
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_memory_address_set_type()

SVM_FUNCTION void svm_memory_address_set_type | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Address | address,
|  | const SVM_Type | type
| ) |  |

This function modifies the type to an internal type of an address of a memory.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted memory is.
  [in] | address | The local address to modify.
  [in] | type | The new type.

If the address contained a value, this value is cleared.

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.
  MEMORY | interruption when the address is not defined.

See also
  svm_memory_address_is_defined
  svm_process_ownership_lock
  svm_kernel_get_current