Simple Virtual Machine
A simple but flexible virtual machine
SVM memory write

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

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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]addressThe local address to write to.
[in]valueThe 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
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.
MEMORYinterruption when the address is not defined.
MEMORYinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]pointerThe zone to write to.
[in]valuesThe 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
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.
MEMORYinterruption when at least one address is not defined.
MEMORYinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]addressThe zone address to write to.
[in]sizeThe zone size to write to.
[in]valuesThe 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
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.
MEMORYinterruption when at least one address is not defined.
MEMORYinterruption 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