TEMU  4.4
The Terma Emulator
temu_MemoryIface Struct Reference

#include </builds/termade/temu/temu/include/temu-c/Memory/Memory.h>

Data Fields

int(* readBytes )(void *Obj, void *Dest, uint64_t Offs, uint32_t Size, int Swap)
 
int(* writeBytes )(void *Obj, uint64_t Offs, uint32_t Size, const void *Src, int Swap)
 

Detailed Description

For objects which have actualm memory (not just registers) This is for the simulator (not the emu core). The procedures should write the data given in bytes to the given physical offset. The offset is a 64 bit uint to support 64 bit targets. The interface is used for example by DMA transactions.

The size argument is in bytes.

The swap argument is used to swap bytes to the host endianess. Specify the log size of the read data types.

  • 0: We are reading bytes (bytes will be in target memory order)
  • 1: We are reading half words (will be swapped to host order)
  • 2: We are reading words (will be swapped)
  • 3: We are reading double words (will be swapped) With 0 for swap, we are basically reading a byte array

readBytes and writeBytes should return the number of bytes read / written or negative on error.

Field Documentation

◆ readBytes

int(* temu_MemoryIface::readBytes) (void *Obj, void *Dest, uint64_t Offs, uint32_t Size, int Swap)

◆ writeBytes

int(* temu_MemoryIface::writeBytes) (void *Obj, uint64_t Offs, uint32_t Size, const void *Src, int Swap)

The documentation for this struct was generated from the following file: