cpu_memory.h File Reference


Detailed Description

Contains code macros for the processor memory load/store instructions.

Based on ARM chapter 4.2.

Id
cpu_memory.h,v 1.11 2008/03/14 15:30:52 iamcamiel Exp

X-1.9 Camiel Vanderhoeven 14-MAR-2008 1. More meaningful exceptions replace throwing (int) 1. 2. U64 macro replaces X64 macro.

X-1.8 Camiel Vanderhoeven 05-MAR-2008 Multi-threading version.

X-1.7 Camiel Vanderhoeven 25-JAN-2008 Trap on unalogned memory access. The previous implementation where unaligned accesses were silently allowed could go wrong when page boundaries are crossed.

X-1.6 Camiel Vanderhoeven 18-JAN-2008 Replaced sext_64 inlines with sext_u64_<bits> inlines for performance reasons (thanks to David Hittner for spotting this!);

X-1.5 Camiel Vanderhoeven 2-DEC-2007 Changed the way translation buffers work.

X-1.4 Camiel Vanderhoeven 11-APR-2007 Moved all data that should be saved to a state file to a structure "state".

X-1.3 Camiel Vanderhoeven 30-MAR-2007 Added old changelog comments.

X-1.2 Camiel Vanderhoeven 8-MAR-2007 LDL and LDQ where the destination is R31 do not cause exceptions.

X-1.1 Camiel Vanderhoeven 18-FEB-2007 File created. Contains code previously found in AlphaCPU.h

Definition in file cpu_memory.h.

Go to the source code of this file.

Defines

#define DO_LDA   state.r[REG_1] = state.r[REG_2] + DISP_16;
#define DO_LDAH   state.r[REG_1] = state.r[REG_2] + (DISP_16 << 16);
#define DO_LDBU
#define DO_LDL
#define DO_LDL_L
#define DO_LDQ
#define DO_LDQ_L
#define DO_LDQ_U
#define DO_LDWU
#define DO_STB
#define DO_STL
#define DO_STL_C
#define DO_STQ
#define DO_STQ_C
#define DO_STQ_U
#define DO_STW


Define Documentation

#define DO_LDA   state.r[REG_1] = state.r[REG_2] + DISP_16;

Definition at line 65 of file cpu_memory.h.

#define DO_LDAH   state.r[REG_1] = state.r[REG_2] + (DISP_16 << 16);

Definition at line 67 of file cpu_memory.h.

#define DO_LDBU

Value:

DATA_PHYS_NT(state.r[REG_2] + DISP_16, ACCESS_READ); \
  state.r[REG_1] = READ_PHYS(8);

Definition at line 69 of file cpu_memory.h.

#define DO_LDL

Value:

if(FREG_1 != 31)                       \
  {                                                      \
    DATA_PHYS(state.r[REG_2] + DISP_16, ACCESS_READ, 3); \
    state.r[REG_1] = sext_u64_32(READ_PHYS(32));         \
  }

Definition at line 72 of file cpu_memory.h.

#define DO_LDL_L

Value:

DATA_PHYS(state.r[REG_2] + DISP_16, ACCESS_READ, 3); \
  cSystem->cpu_lock(state.iProcNum, phys_address);                     \
  state.r[REG_1] = sext_u64_32(READ_PHYS(32));

Definition at line 78 of file cpu_memory.h.

#define DO_LDQ

Value:

if(FREG_1 != 31)                       \
  {                                                      \
    DATA_PHYS(state.r[REG_2] + DISP_16, ACCESS_READ, 7); \
    state.r[REG_1] = READ_PHYS(64);                      \
  }

Definition at line 82 of file cpu_memory.h.

#define DO_LDQ_L

Value:

DATA_PHYS(state.r[REG_2] + DISP_16, ACCESS_READ, 7); \
  cSystem->cpu_lock(state.iProcNum, phys_address);                     \
  state.r[REG_1] = READ_PHYS(64);

Definition at line 88 of file cpu_memory.h.

#define DO_LDQ_U

Value:

DATA_PHYS_NT((state.r[REG_2] + DISP_16) &~U64(0x7), \
                               ACCESS_READ);                          \
  state.r[REG_1] = READ_PHYS(64);

Definition at line 92 of file cpu_memory.h.

#define DO_LDWU

Value:

DATA_PHYS(state.r[REG_2] + DISP_16, ACCESS_READ, 1); \
  state.r[REG_1] = READ_PHYS(16);

Definition at line 96 of file cpu_memory.h.

#define DO_STB

Value:

DATA_PHYS_NT(state.r[REG_2] + DISP_16, ACCESS_WRITE); \
  WRITE_PHYS(state.r[REG_1], 8);

Definition at line 99 of file cpu_memory.h.

#define DO_STL

Value:

DATA_PHYS(state.r[REG_2] + DISP_16, ACCESS_WRITE, 3); \
  WRITE_PHYS(state.r[REG_1], 32);

Definition at line 102 of file cpu_memory.h.

#define DO_STL_C

Value:

if(cSystem->cpu_unlock(state.iProcNum)) \
  {                                                       \
    DATA_PHYS(state.r[REG_2] + DISP_16, ACCESS_WRITE, 3); \
    WRITE_PHYS(state.r[REG_1], 32);                       \
    state.r[REG_1] = 1;                                   \
  }                                                       \
  else                                                    \
    state.r[REG_1] = 0;

Definition at line 105 of file cpu_memory.h.

#define DO_STQ

Value:

DATA_PHYS(state.r[REG_2] + DISP_16, ACCESS_WRITE, 7); \
  WRITE_PHYS(state.r[REG_1], 64);

Definition at line 114 of file cpu_memory.h.

#define DO_STQ_C

Value:

if(cSystem->cpu_unlock(state.iProcNum)) \
  {                                                       \
    DATA_PHYS(state.r[REG_2] + DISP_16, ACCESS_WRITE, 7); \
    WRITE_PHYS(state.r[REG_1], 64);                       \
    state.r[REG_1] = 1;                                   \
  }                                                       \
  else                                                    \
    state.r[REG_1] = 0;

Definition at line 117 of file cpu_memory.h.

#define DO_STQ_U

Value:

DATA_PHYS_NT((state.r[REG_2] + DISP_16) &~U64(0x7), \
                               ACCESS_WRITE);                         \
  WRITE_PHYS(state.r[REG_1], 64);

Definition at line 126 of file cpu_memory.h.

#define DO_STW

Value:

DATA_PHYS(state.r[REG_2] + DISP_16, ACCESS_WRITE, 1); \
  WRITE_PHYS(state.r[REG_1], 16);

Definition at line 130 of file cpu_memory.h.


SourceForge.net Logo
Project space on SourceForge.net