hololink::emulation::AddressMemory
hololink::emulation::AddressMemory
Representation of the internal memory space of the HSBEmulator and its registers.
Note
This currently implemented as a simple map, but the underlying implementation should be expected to change, though the public methods should remain available.
Constructors
Destructor
~AddressMemory
Methods
write
Write a value to a register.
Returns: 0 on success, 1 on failure
Parameters
address_value AddressValuePair &
Pair of address and value to write
read
Read a value from a register.
Returns: 0 on success, 1 on failure
Parameters
address_value AddressValuePair &
Pair of address and value to read
write_many
Convenience function to write multiple values to registers under a single lock.
Returns: 0 on success, 1 on failure
Parameters
address_values AddressValuePair *
Pointer to array of pairs of register addresses and values to write
num_addresses int
Number of address-value pairs
read_many
Convenience function to read multiple values from registers under a single lock.
Returns: 0 on success, 1 on failure
Parameters
address_values AddressValuePair *
Pointer to array of pairs of register addresses and values to read (caller must allocate at least num_addresses elements)
num_addresses int
Number of addresses to read
write_range
Write a range of values to registers. Allow optimizations if it is known that the addresses are contiguous.
Returns: 0 on success, 1 on failure
Parameters
start_address uint32_t
The first register address in the range.
values uint32_t *
Pointer to the array of values to write (caller must allocate at least num_addresses elements).
num_addresses int
The number of addresses to write.
stride int — default: 2
The address increment between consecutive registers in the range (defaults to 2).
read_range
Read a range of values from registers. Allow optimizations if it is known that the addresses are contiguous.
Returns: 0 on success, 1 on failure
Parameters
start_address uint32_t
The first register address in the range.
values uint32_t *
Pointer to the array that receives the values read (caller must allocate at least num_addresses elements).
num_addresses int
The number of addresses to read.
stride int — default: 2
The address increment between consecutive registers in the range (defaults to 2).