TEMU  2
The Terma Emulator
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
temu_MemoryIface Struct Reference

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

Collaboration diagram for temu_MemoryIface:

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

Definition at line 151 of file Memory.h.

Field Documentation

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

Definition at line 152 of file Memory.h.

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

Definition at line 153 of file Memory.h.


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