TEMU  4.4
The Terma Emulator
Cpu.h File Reference
#include "temu-c/Support/Attributes.h"
#include <stdint.h>
Include dependency graph for Cpu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void(* temu_SparcAsrHandler) (void *Cpu, uint32_t Instr)
 
typedef void(* temu_SafeCb) (void *)
 

Functions

TEMU_API uint64_t temu_cpuGetFreq (void *Cpu)
 
TEMU_API void temu_cpuSetPc (void *Cpu, uint64_t Pc)
 
TEMU_API uint64_t temu_cpuGetPc (void *Cpu)
 
TEMU_API void temu_cpuReset (void *Cpu, int ResetType)
 
TEMU_API uint64_t temu_cpuRun (void *Cpu, uint64_t Cycles)
 
TEMU_API uint64_t temu_cpuStep (void *Cpu, uint64_t Steps)
 
TEMU_API int temu_cpuTranslateAddress (void *Cpu, uint64_t Va, uint32_t flags, uint64_t *physAddressResult)
 
TEMU_API int temu_cpuTranslateAddressWithRootPointer (void *cpu, uint64_t va, uint32_t flags, uint64_t *physAddressResult, uint64_t pageTableRoot)
 
TEMU_API uint64_t temu_cpuGetReg (void *Cpu, unsigned Reg)
 
TEMU_API void temu_cpuSetReg (void *Cpu, unsigned Reg, uint64_t Value)
 
TEMU_API float temu_cpuGetFpr32 (void *Cpu, unsigned Reg)
 
TEMU_API uint32_t temu_cpuGetFpr32Bits (void *Cpu, unsigned Reg)
 
TEMU_API void temu_cpuSetFpr32 (void *Cpu, unsigned Reg, float Value)
 
TEMU_API void temu_cpuSetFpr32Bits (void *Cpu, unsigned Reg, uint32_t Value)
 
TEMU_API double temu_cpuGetFpr64 (void *Cpu, unsigned Reg)
 
TEMU_API uint64_t temu_cpuGetFpr64Bits (void *Cpu, unsigned Reg)
 
TEMU_API void temu_cpuSetFpr64 (void *Cpu, unsigned Reg, double Value)
 
TEMU_API void temu_cpuSetFpr64Bits (void *Cpu, unsigned Reg, uint64_t Value)
 
TEMU_API void temu_cpuEnableTraps (void *Cpu)
 
TEMU_API void temu_cpuDisableTraps (void *Cpu)
 
TEMU_API void temu_cpuRaiseTrap (void *Cpu, int Trap, unsigned Flags)
 
TEMU_API int temu_sparcGetWindowCount (void *Cpu)
 
TEMU_API uint32_t temu_sparcGetWindowedReg (void *Cpu, int Window, unsigned Reg)
 
TEMU_API void temu_sparcSetWindowedReg (void *Cpu, int Window, unsigned Reg, uint32_t Value)
 
TEMU_API void temu_sparcSetY (void *Cpu, uint64_t Value)
 
TEMU_API uint64_t temu_sparcGetY (void *Cpu)
 
TEMU_API void temu_sparcSetAsr (void *Cpu, unsigned Reg, uint64_t Value)
 
TEMU_API uint64_t temu_sparcGetAsr (void *Cpu, unsigned Reg)
 
TEMU_API void temu_sparcSetAsrWriter (void *Cpu, unsigned Asr, temu_SparcAsrHandler Handler)
 
TEMU_API void temu_sparcSetAsrReader (void *Cpu, unsigned Asr, temu_SparcAsrHandler Handler)
 
TEMU_API void temu_sparcSetPsr (void *Cpu, uint32_t Value)
 
TEMU_API uint32_t temu_sparcGetPsr (void *Cpu)
 
TEMU_API void temu_sparcSetTbr (void *Cpu, uint32_t Value)
 
TEMU_API uint32_t temu_sparcGetTbr (void *Cpu)
 
TEMU_API void temu_sparcSetWim (void *Cpu, uint32_t Value)
 
TEMU_API uint32_t temu_sparcGetWim (void *Cpu)
 
TEMU_API void temu_sparcSetNPc (void *Cpu, uint32_t Value)
 
TEMU_API uint32_t temu_sparcGetNPc (void *Cpu)
 
TEMU_API void temu_armSetAPSR (void *Cpu, uint32_t Value)
 
TEMU_API uint32_t temu_armGetAPSR (void *Cpu)
 
TEMU_API void temu_armSetFPSCR (void *Cpu, uint32_t Value)
 
TEMU_API uint32_t temu_armGetFPSCR (void *Cpu)
 
TEMU_API void temu_armSetFPEXC (void *Cpu, uint32_t Value)
 
TEMU_API uint32_t temu_armGetFPEXC (void *Cpu)
 
TEMU_API void temu_armSetFPINST (void *Cpu, int Idx, uint32_t Value)
 
TEMU_API uint32_t temu_armGetFPINST (void *Cpu, int Idx)
 
TEMU_API unsigned temu_armGetExecMode (void *Cpu)
 
TEMU_API void temu_armSetExecMode (void *Cpu, unsigned Mode)
 
TEMU_API void temu_ppcSetCrReg (void *Cpu, uint32_t Value)
 
TEMU_API uint32_t temu_ppcGetCrReg (void *Cpu)
 
TEMU_API void temu_ppcSetXerReg (void *Cpu, uint32_t Value)
 
TEMU_API uint32_t temu_ppcGetXerReg (void *Cpu)
 
TEMU_API void temu_ppcSetMsrReg (void *Cpu, uint64_t Value)
 
TEMU_API uint64_t temu_ppcGetMsrReg (void *Cpu)
 
TEMU_API void temu_ppcSetReserveAddress (void *Cpu, uint64_t reserveAddress)
 
TEMU_API uint64_t temu_ppcGetReserveAddress (void *Cpu)
 
TEMU_API void temu_ppcClearAddressReservation (void *Cpu)
 
TEMU_API int temu_ppcIsReservationBitSet (void *Cpu)
 
TEMU_API void temu_ppcSetCtrReg (void *Cpu, uint32_t Value)
 
TEMU_API uint32_t temu_ppcGetCtrReg (void *Cpu)
 
TEMU_API void temu_ppcSetFpscrReg (void *Cpu, uint32_t Value)
 
TEMU_API uint32_t temu_ppcGetFpscrReg (void *Cpu)
 
TEMU_API void temu_ppcSetLrReg (void *Cpu, uint64_t Value)
 
TEMU_API uint64_t temu_ppcGetLrReg (void *Cpu)
 
TEMU_API void temu_cpuSetSpr (void *Cpu, unsigned RegId, uint64_t Value)
 
TEMU_API uint64_t temu_cpuGetSpr (void *Cpu, unsigned RegId)
 
TEMU_API void * temu_cpuGetMachine (void *Cpu)
 
TEMU_API void temu_machineReset (void *Machine, int ResetType)
 
TEMU_API uint64_t temu_machineRun (void *Machine, uint64_t NanoSecs)
 
TEMU_API void temu_postCallback (void *Obj, temu_SafeCb Cb, void *Arg)
 
TEMU_API uint64_t temu_cpuGetStat (void *Obj, int Stat)
 
TEMU_API void temu_cpuResetStat (void *Obj, int Stat)
 

Detailed Description

Wrappers functions for the CPU interfaces.

The functions declared in this file exists for convenience purposes. They will in general look up the relevant interface by name via a double map lookup.

The functions here provide an easy way invoke functions in the CpuIface without having to query for the interface and then calling the function.

If the emulator is integrated in a simulator, the recommended approach is to first construct the system, and then query relevant interfaces, caching them as needed. Note that system configurations should not normally change after the construction phase, so any cached object-interface pairs will be stable.

Warning
A general rule is that the functions defined here calls abort in-case the interface cannot be found for the relevant object.

Typedef Documentation

◆ temu_SafeCb

typedef void(* temu_SafeCb) (void *)

◆ temu_SparcAsrHandler

typedef void(* temu_SparcAsrHandler) (void *Cpu, uint32_t Instr)

Function Documentation

◆ temu_armGetAPSR()

TEMU_API uint32_t temu_armGetAPSR ( void *  Cpu)

Get the ARM processor state register

Parameters
CpuARM CPU pointer
Returns
APSR value

◆ temu_armGetExecMode()

TEMU_API unsigned temu_armGetExecMode ( void *  Cpu)

Get the ARM execution mode

Parameters
CpuARM CPU pointer
Returns
Execution mode

◆ temu_armGetFPEXC()

TEMU_API uint32_t temu_armGetFPEXC ( void *  Cpu)

Get the ARM FPEXC register

Parameters
CpuARM CPU pointer
Returns
FPEXC value

◆ temu_armGetFPINST()

TEMU_API uint32_t temu_armGetFPINST ( void *  Cpu,
int  Idx 
)

Get the ARM FPINST register

Parameters
CpuARM CPU pointer
IdxFPINST register number
Returns
FPINST value

◆ temu_armGetFPSCR()

TEMU_API uint32_t temu_armGetFPSCR ( void *  Cpu)

Get the ARM FPSCR register

Parameters
CpuARM CPU pointer
Returns
FPSCR value

◆ temu_armSetAPSR()

TEMU_API void temu_armSetAPSR ( void *  Cpu,
uint32_t  Value 
)

Set the ARM processor state register

Parameters
CpuARM CPU pointer
ValueValue to set the APSR to

◆ temu_armSetExecMode()

TEMU_API void temu_armSetExecMode ( void *  Cpu,
unsigned  Mode 
)

Set the ARM execution mode

Parameters
CpuARM CPU pointer
ModeExecution mode

◆ temu_armSetFPEXC()

TEMU_API void temu_armSetFPEXC ( void *  Cpu,
uint32_t  Value 
)

Set the ARM FPEXC register

Parameters
CpuARM CPU pointer
ValueFPEXC value

◆ temu_armSetFPINST()

TEMU_API void temu_armSetFPINST ( void *  Cpu,
int  Idx,
uint32_t  Value 
)

Set the ARM FPINST register

Parameters
CpuARM CPU pointer
IdxFPINST register number
ValueFPINST value

◆ temu_armSetFPSCR()

TEMU_API void temu_armSetFPSCR ( void *  Cpu,
uint32_t  Value 
)

Set the ARM FPSCR register

Parameters
CpuARM CPU pointer
ValueFPSCR value

◆ temu_cpuDisableTraps()

TEMU_API void temu_cpuDisableTraps ( void *  Cpu)

Disable traps on processor

Parameters
CpuCPU pointer

◆ temu_cpuEnableTraps()

TEMU_API void temu_cpuEnableTraps ( void *  Cpu)

Enable traps on processor

Parameters
CpuCPU pointer

◆ temu_cpuGetFpr32()

TEMU_API float temu_cpuGetFpr32 ( void *  Cpu,
unsigned  Reg 
)

Get a 32 bit floating point register

Parameters
CpuCPU pointer
RegFPU register number
Returns
Host float with the content of the FPU register

◆ temu_cpuGetFpr32Bits()

TEMU_API uint32_t temu_cpuGetFpr32Bits ( void *  Cpu,
unsigned  Reg 
)

Get a 32 bit floating point register

Parameters
CpuCPU pointer
RegFPU register number
Returns
Floating point register contents

◆ temu_cpuGetFpr64()

TEMU_API double temu_cpuGetFpr64 ( void *  Cpu,
unsigned  Reg 
)

Get 64 bit floating point register as double

Parameters
CpuCPU pointer
RegFPU register number
Returns
FPU register value

◆ temu_cpuGetFpr64Bits()

TEMU_API uint64_t temu_cpuGetFpr64Bits ( void *  Cpu,
unsigned  Reg 
)

Get 64 bit floating point register contents

Parameters
CpuCPU pointer
RegFPU register number
Returns
FPU register value

◆ temu_cpuGetFreq()

TEMU_API uint64_t temu_cpuGetFreq ( void *  Cpu)

Get the clock frequency for the CPU

Warning
In case the Cpu does not implement the CpuIface the program will abort. Do not use this function in performance critical code!!!
Parameters
CpuThe CPU object
Returns
The configured clock frequency in Hz.

◆ temu_cpuGetMachine()

TEMU_API void* temu_cpuGetMachine ( void *  Cpu)

Get the Machine for a given CPU

Parameters
CpuPointer to the CPU object
Returns
Pointer to the machine object

◆ temu_cpuGetPc()

TEMU_API uint64_t temu_cpuGetPc ( void *  Cpu)

Get the program counter

The program counter will be returned.

Warning
In case the Cpu does not implement the CpuIface the program will abort. Do not use this function in performance critical code!!!
Parameters
CpuThe CPU object
Returns
The value of the program counter register

◆ temu_cpuGetReg()

TEMU_API uint64_t temu_cpuGetReg ( void *  Cpu,
unsigned  Reg 
)

Gets the register in the processor

Parameters
CpuCPU pointer
RegRegister number
Returns
Register value

◆ temu_cpuGetSpr()

TEMU_API uint64_t temu_cpuGetSpr ( void *  Cpu,
unsigned  RegId 
)

Get the PowerPC SPR register

Parameters
CpuProcessor pointer
RegIdSPR register number
Returns
Value of SPR specified in RegId.

◆ temu_cpuGetStat()

TEMU_API uint64_t temu_cpuGetStat ( void *  Obj,
int  Stat 
)

Get processor statistics

Parameters
ObjProcessor pointer
StatStatistics ID
Returns
Statistics value

◆ temu_cpuRaiseTrap()

TEMU_API void temu_cpuRaiseTrap ( void *  Cpu,
int  Trap,
unsigned  Flags 
)

Raise a trap The function simulates a trap being raised at the current PC.

Parameters
CpuProcessor pointer
TrapTrap ID. This is target dependent, for the SPARC this is the TT value of the trap.
Flagsset flag 1 to enable longjmp trap (this is useful in MMIO handlers to force a trap while a core is running). Set to 0 if called from outside the core or in e.g. an event handler.

◆ temu_cpuReset()

TEMU_API void temu_cpuReset ( void *  Cpu,
int  ResetType 
)

Reset the processor.

Resetting the CPU will result in a reset cascade where all connected devices are also reset.

Warning
In case the Cpu does not implement the CpuIface the program will abort. Do not use this function in performance critical code!!!
Parameters
CpuThe CPU object
ResetTypeThe type of reset, by convention 0 means cold reset, and 1 indicates a warm reset.

◆ temu_cpuResetStat()

TEMU_API void temu_cpuResetStat ( void *  Obj,
int  Stat 
)

Clear processor statistics

Parameters
ObjProcessor pointer
StatStatistics ID

◆ temu_cpuRun()

TEMU_API uint64_t temu_cpuRun ( void *  Cpu,
uint64_t  Cycles 
)

Run the processor for a number of cycles

The function runs the processor for a number of cycles. If you wish to run the processor with another time unit, you can compute the cycles from the clock frequency of the emulated processor.

In case the processor halts or enters idle mode and there are no pending events the function will return early.

Warning
In case the Cpu does not implement the CpuIface the program will abort. Do not use this function in performance critical code!!!
Parameters
CpuThe CPU object
CyclesThe number of cycles to run the processor for.
Returns
The number of executed cycles.

◆ temu_cpuSetFpr32()

TEMU_API void temu_cpuSetFpr32 ( void *  Cpu,
unsigned  Reg,
float  Value 
)

Set floating point register value

Parameters
CpuCPU pointer
RegFloating point register number
ValueFloating point value to set

◆ temu_cpuSetFpr32Bits()

TEMU_API void temu_cpuSetFpr32Bits ( void *  Cpu,
unsigned  Reg,
uint32_t  Value 
)

Set 32 bit floating point register value

Parameters
CpuCPU pointer
RegFloating point register number
ValueFloating point value to set

◆ temu_cpuSetFpr64()

TEMU_API void temu_cpuSetFpr64 ( void *  Cpu,
unsigned  Reg,
double  Value 
)

Set FPU register value

Parameters
CpuCPU pointer
RegFPU register number
ValueValue to set to register

◆ temu_cpuSetFpr64Bits()

TEMU_API void temu_cpuSetFpr64Bits ( void *  Cpu,
unsigned  Reg,
uint64_t  Value 
)

Set FPU register value

Parameters
CpuCPU pointer
RegFPU register number
ValueValue to set to register

◆ temu_cpuSetPc()

TEMU_API void temu_cpuSetPc ( void *  Cpu,
uint64_t  Pc 
)

Set the program counter

The program counter will be set to the supplied value.

Note
For targets with delay slots (SPARC, MIPS etc), the function will also set the next PC to PC + sizeof(instruction).
Warning
In case the Cpu does not implement the CpuIface the program will abort. Do not use this function in performance critical code!!!
Parameters
CpuThe CPU object
PcThe program counter.

◆ temu_cpuSetReg()

TEMU_API void temu_cpuSetReg ( void *  Cpu,
unsigned  Reg,
uint64_t  Value 
)

Set the register in the processor

Parameters
CpuCPU pointer
RegRegister number
ValueValue to write to register

◆ temu_cpuSetSpr()

TEMU_API void temu_cpuSetSpr ( void *  Cpu,
unsigned  RegId,
uint64_t  Value 
)

Set the PowerPC SPR register

Parameters
CpuProcessor pointer
RegIdSPR register number
ValueNew SPR value

◆ temu_cpuStep()

TEMU_API uint64_t temu_cpuStep ( void *  Cpu,
uint64_t  Steps 
)

Run the processor for a number of steps

This function is different from temu_cpuRun, which runs for a time. The steps here indicates instructions executed (including trapping instructions). This can be contrasted to the run function which may advance the cycle counter by more than one for an instruction (depending on the timing models).

The function may return early in case the processor halts its execution or has entered idle mode and there are no events pending.

Warning
In case the Cpu does not implement the CpuIface the program will abort. Do not use this function in performance critical code!!!
Parameters
CpuThe CPU object
StepsThe number of steps to run the processor for.
Returns
The number of executed steps.

◆ temu_cpuTranslateAddress()

TEMU_API int temu_cpuTranslateAddress ( void *  Cpu,
uint64_t  Va,
uint32_t  flags,
uint64_t *  physAddressResult 
)

Uses the MMU to translate the given virtual address Va to the physical address in the emulator

Parameters
Cputhe CPU object
Vathe virtual address to be translated
flagsflags for the translation (CPU specific)
physAddressResultthe result in a uint64_t pointer
Returns
error code. 0 on success, non-zero otherwise,

◆ temu_cpuTranslateAddressWithRootPointer()

TEMU_API int temu_cpuTranslateAddressWithRootPointer ( void *  cpu,
uint64_t  va,
uint32_t  flags,
uint64_t *  physAddressResult,
uint64_t  pageTableRoot 
)

Uses the an explicit page table pointer to translate a virtual address to physical address.

The routine is dependent on the processor having hardware managed page tables. Hence this works e.g. for SPARC and ARM processors, but not for PowerPC.

Parameters
cputhe CPU object
vathe virtual address to be translated
flagsflags for the translation (CPU specific)
physAddressResultthe result in a uint64_t pointer
pageTableRootThe page table to use for the translation
Returns
error code. 0 on success, non-zero otherwise,

◆ temu_machineReset()

TEMU_API void temu_machineReset ( void *  Machine,
int  ResetType 
)

Reset the Machine

Resetting the Machine will result in a reset cascade where all connected devices and processors are also reset.

Warning
In case the Machine does not implement the MachineIface the program will abort. Do not use this function in performance critical code!!!
Parameters
MachineThe Machine object
ResetTypeThe type of reset, by convention 0 means cold reset, and 1 indicates a warm reset.

◆ temu_machineRun()

TEMU_API uint64_t temu_machineRun ( void *  Machine,
uint64_t  NanoSecs 
)

Run the machine for a number of nanoseconds

The function runs the machine and for a number of nanoseconds. This will run all the CPUs in the system.

In case a processor halts or enters idle mode, the function returns early.

Warning
In case the machine does not implement the MachineIface the program will abort. Do not use this function in performance critical code!!!
Parameters
MachineThe machine object
NanoSecsThe number of nanosecs to run each processor for.
Returns
The number of executed nanoseconds.

◆ temu_postCallback()

TEMU_API void temu_postCallback ( void *  Obj,
temu_SafeCb  Cb,
void *  Arg 
)

Post a callback in a time source

The posting will be thread-safe and the callback will be excuted by the main thread (the one calling the cpu or machine run / step functions). The main thread is the thread calling cpu run if there is only a single cpu in the system, and the thread calling machine run if there are multiple CPUs in the system.

The callback will be executed as soon as possible, when the even queue is checked for events. Which in practice mean:

  • At the end of the current time quanta for multi-cpu systems.
  • At regular intervals for single CPU systems (a CPU runs a null-event periodically. Note that the callback will be called as soon as either a normal or the null event is executed.

The posting of this callback is thread-safe but not async / signal safe. I.e. do not do this from signal handler or async io callbacks.

When the event is executed, it is safe to do most emulator operations, including posting of events, calling API functions, etc.

The callback must however not:

  • Manipulate the object system meta state (i.e. creating or modifying classes)
  • Replace signal handlers (e.g. SIGINT)
  • Run or step the emulator in any way (e.g. by calling machineRun(), cpuRun() or using the CpuIface or MachineIface interfaces.
Parameters
ObjTime source
CbCallback
ArgArgument passed to callback

◆ temu_ppcClearAddressReservation()

TEMU_API void temu_ppcClearAddressReservation ( void *  Cpu)

Clear the PowerPC reserve address used by lwarx and stwcx

Parameters
CpuProcessor pointer

◆ temu_ppcGetCrReg()

TEMU_API uint32_t temu_ppcGetCrReg ( void *  Cpu)

Get the PowerPC CR register

Parameters
CpuProcessor pointer
Returns
CR value

◆ temu_ppcGetCtrReg()

TEMU_API uint32_t temu_ppcGetCtrReg ( void *  Cpu)

Get the PowerPC CTR register

Parameters
CpuProcessor pointer
Returns
The CTR value

◆ temu_ppcGetFpscrReg()

TEMU_API uint32_t temu_ppcGetFpscrReg ( void *  Cpu)

Get the PowerPC FPSCR register

Parameters
CpuProcessor pointer
Returns
The FPSCR value

◆ temu_ppcGetLrReg()

TEMU_API uint64_t temu_ppcGetLrReg ( void *  Cpu)

Get the PowerPC LR register

Parameters
CpuProcessor pointer
Returns
The LR value

◆ temu_ppcGetMsrReg()

TEMU_API uint64_t temu_ppcGetMsrReg ( void *  Cpu)

Get the PowerPC MSR register

Parameters
CpuProcessor pointer
Returns
MSR value

◆ temu_ppcGetReserveAddress()

TEMU_API uint64_t temu_ppcGetReserveAddress ( void *  Cpu)

Get the PowerPC reserve address used by lwarx and stwcx

Parameters
CpuProcessor pointer
Returns
The reserved address value

◆ temu_ppcGetXerReg()

TEMU_API uint32_t temu_ppcGetXerReg ( void *  Cpu)

Get the PowerPC XER register

Parameters
CpuProcessor pointer
Returns
XER value

◆ temu_ppcIsReservationBitSet()

TEMU_API int temu_ppcIsReservationBitSet ( void *  Cpu)

Check if PowerPC reserve address is set lwarx and stwcx

Parameters
CpuProcessor pointer
Returns
1 if reservation is set, 0 if cleared.

◆ temu_ppcSetCrReg()

TEMU_API void temu_ppcSetCrReg ( void *  Cpu,
uint32_t  Value 
)

Set the PowerPC CR register

Parameters
CpuProcessor pointer
ValueNew CR value

◆ temu_ppcSetCtrReg()

TEMU_API void temu_ppcSetCtrReg ( void *  Cpu,
uint32_t  Value 
)

Set the PowerPC CTR register

Parameters
CpuProcessor pointer
ValueNew CTR value

◆ temu_ppcSetFpscrReg()

TEMU_API void temu_ppcSetFpscrReg ( void *  Cpu,
uint32_t  Value 
)

Set the PowerPC FPSCR register

Parameters
CpuProcessor pointer
ValueNew FPSCR value

◆ temu_ppcSetLrReg()

TEMU_API void temu_ppcSetLrReg ( void *  Cpu,
uint64_t  Value 
)

Set the PowerPC LR register

Parameters
CpuProcessor pointer
ValueNew LR value

◆ temu_ppcSetMsrReg()

TEMU_API void temu_ppcSetMsrReg ( void *  Cpu,
uint64_t  Value 
)

Set the PowerPC MSR register

Parameters
CpuProcessor pointer
ValueNew MSR value

◆ temu_ppcSetReserveAddress()

TEMU_API void temu_ppcSetReserveAddress ( void *  Cpu,
uint64_t  reserveAddress 
)

Set the PowerPC reserve address used by lwarx and stwcx

Parameters
CpuProcessor pointer
reserveAddressNew reserved address value

◆ temu_ppcSetXerReg()

TEMU_API void temu_ppcSetXerReg ( void *  Cpu,
uint32_t  Value 
)

Set the PowerPC XER register

Parameters
CpuProcessor pointer
ValueNew XER value

◆ temu_sparcGetAsr()

TEMU_API uint64_t temu_sparcGetAsr ( void *  Cpu,
unsigned  Reg 
)

Get ASR register value

Parameters
CpuSPARC CPU pointer
RegASR register ID
Returns
ASR register value

◆ temu_sparcGetNPc()

TEMU_API uint32_t temu_sparcGetNPc ( void *  Cpu)

Get the nPC value

Parameters
CpuSPARC CPU pointer
Returns
nPC value

◆ temu_sparcGetPsr()

TEMU_API uint32_t temu_sparcGetPsr ( void *  Cpu)

Get the Processor State Register

Parameters
CpuSPARC CPU pointer
Returns
PSR value

◆ temu_sparcGetTbr()

TEMU_API uint32_t temu_sparcGetTbr ( void *  Cpu)

Get Trap Base Register value

Parameters
CpuSPARC CPU pointer
Returns
TBR value

◆ temu_sparcGetWim()

TEMU_API uint32_t temu_sparcGetWim ( void *  Cpu)

Get window invalidation mask register

Parameters
CpuSPARC CPU pointer
Returns
WIM value

◆ temu_sparcGetWindowCount()

TEMU_API int temu_sparcGetWindowCount ( void *  Cpu)

Get how many register windows are supported by the CPU

Parameters
CpuSPARC CPU pointer
Returns
Number of register windows

◆ temu_sparcGetWindowedReg()

TEMU_API uint32_t temu_sparcGetWindowedReg ( void *  Cpu,
int  Window,
unsigned  Reg 
)

Get a windowed SPARC register

Parameters
CpuSPARC CPU pointer
WindowWindow number (-1 for current window)
RegRegister number within window
Returns
Register value

◆ temu_sparcGetY()

TEMU_API uint64_t temu_sparcGetY ( void *  Cpu)

Get the Y register of the CPU,

Parameters
CpuSPARC CPU pointer
Returns
Current Y register value

◆ temu_sparcSetAsr()

TEMU_API void temu_sparcSetAsr ( void *  Cpu,
unsigned  Reg,
uint64_t  Value 
)

Set the ASR register

Parameters
CpuSPARC CPU pointer
RegASR register ID
ValueValue to write

◆ temu_sparcSetAsrReader()

TEMU_API void temu_sparcSetAsrReader ( void *  Cpu,
unsigned  Asr,
temu_SparcAsrHandler  Handler 
)

Install the handler to be called when an ASR is read

Parameters
CpuSPARC CPU pointer
AsrASR register ID
HandlerFunction to call.

◆ temu_sparcSetAsrWriter()

TEMU_API void temu_sparcSetAsrWriter ( void *  Cpu,
unsigned  Asr,
temu_SparcAsrHandler  Handler 
)

Install the handler to be called when an ASR is written

Parameters
CpuSPARC CPU pointer
AsrASR register ID
HandlerFunction to call.

◆ temu_sparcSetNPc()

TEMU_API void temu_sparcSetNPc ( void *  Cpu,
uint32_t  Value 
)

Set the nPC value (next program counter)

NOTE: When you use the setPC function, the NPC is also updated to PC+4. Use this to explicitly set NPC.

Parameters
CpuSPARC CPU pointer
ValueValue to write to NPC

◆ temu_sparcSetPsr()

TEMU_API void temu_sparcSetPsr ( void *  Cpu,
uint32_t  Value 
)

Set the Processor State Register

Parameters
CpuSPARC CPU pointer
ValueValue to write

◆ temu_sparcSetTbr()

TEMU_API void temu_sparcSetTbr ( void *  Cpu,
uint32_t  Value 
)

Set the Trap Base Register

Parameters
CpuSPARC CPU pointer,
ValueValue for TBR register

◆ temu_sparcSetWim()

TEMU_API void temu_sparcSetWim ( void *  Cpu,
uint32_t  Value 
)

Set window invalidation mask register

Parameters
CpuSPARC CPU pointer
Valuevalue to set in WIM

◆ temu_sparcSetWindowedReg()

TEMU_API void temu_sparcSetWindowedReg ( void *  Cpu,
int  Window,
unsigned  Reg,
uint32_t  Value 
)

Set a windowed SPARC register

Parameters
CpuSPARC CPU pointer
WindowWindow number (-1 for current window)
RegRegister number within window
ValueRegister value

◆ temu_sparcSetY()

TEMU_API void temu_sparcSetY ( void *  Cpu,
uint64_t  Value 
)

Set the Y register of the CPU,

Parameters
CpuSPARC CPU pointer
ValueValue to write to the Y register