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

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

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]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 check.
Returns
The type of the value.
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.
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]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 check.
Returns
TRUE if the address has been allocated, FALSE otherwise.
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_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]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 check.
Returns
TRUE if the address has been allocated and has been initialised, FALSE otherwise.
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_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]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 check.

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

Returns
TRUE when the write can be successful, FALSE otherwise.
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_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]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 modify.
[in]typeThe new type.

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

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.
See also
svm_memory_address_is_defined
svm_process_ownership_lock
svm_kernel_get_current