Simple Virtual Machine A simple but flexible virtual machine

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

This module contains API functions to handle SVM memory write access. More...

## Functions
SVM_FUNCTION void | svm_memory_write_address (const void *svm, const SVM_Kernel kernel, const SVM_Address address, const SVM_Value value)
| This function writes a value into a memory.
SVM_FUNCTION void | svm_memory_write_pointer (const void *svm, const SVM_Kernel kernel, const SVM_Value_Pointer pointer, const SVM_Value *values)
| This function writes an array of values into a memory.
SVM_FUNCTION void | svm_memory_write_pointer__raw (const void *svm, const SVM_Kernel kernel, const SVM_Address address, const SVM_Size size, const SVM_Value *values)
| This function writes an array of values into a memory.

## Detailed Description

This module contains API functions to handle SVM memory write access.

## Function Documentation

## ◆ svm_memory_write_address()

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

This function writes a value 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 write.

When a null value is written into the memory, the corresponding value is cleared. After the write, the address is still defined but no longer initialised.

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.
  MEMORY | interruption when the type of the address is incompatible with the value type.

See also
  svm_memory_address_is_defined
  svm_memory_address_is_writable
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_memory_write_pointer()

SVM_FUNCTION void svm_memory_write_pointer | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Value_Pointer | pointer,
|  | const SVM_Value * | values
| ) |  |

This function writes an array of values 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] | pointer | The zone to write to.
  [in] | values | The values to write.

The values are written into the memory only if all types are compatibles. Otherwise, no value is written into the memory.

When a null value is written into the memory, the corresponding value is cleared. After the write, the address is still defined but no longer initialised.

Warning
  The array of values shall have a size at least equal to the pointer size. Otherwise, the result is undefined.

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 at least one address is not defined.
  MEMORY | interruption when at least one type of value is incompatible with the corresponding address type.

See also
  svm_memory_address_is_defined
  svm_memory_write_address
  svm_memory_address_is_writable
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_memory_write_pointer__raw()

SVM_FUNCTION void svm_memory_write_pointer__raw | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Address | address,
|  | const SVM_Size | size,
|  | const SVM_Value * | values
| ) |  |

This function writes an array of values 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 zone address to write to.
  [in] | size | The zone size to write to.
  [in] | values | The values to write.

The values are written into the memory only if all types are compatibles. Otherwise, no value is written into the memory.

When a null value is written into the memory, the corresponding value is cleared. After the write, the address is still defined but no longer initialised.

Warning
  The array of values shall have a size at least equal to the zone size. Otherwise, the result is undefined.

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 at least one address is not defined.
  MEMORY | interruption when at least one type of value is incompatible with the corresponding address type.

See also
  svm_memory_address_is_defined
  svm_memory_write_address
  svm_memory_address_is_writable
  svm_process_ownership_lock
  svm_kernel_get_current