|
uint64_t | temu_cpuGetFreq (void *Cpu) |
| Get the clock frequency for the CPU. More...
|
|
void | temu_cpuSetPc (void *Cpu, uint64_t Pc) |
| Set the program counter. More...
|
|
uint64_t | temu_cpuGetPc (void *Cpu) |
| Get the program counter. More...
|
|
void | temu_cpuReset (void *Cpu, int ResetType) |
| Reset the processor. More...
|
|
uint64_t | temu_cpuRun (void *Cpu, uint64_t Cycles) |
| Run the processor for a number of cycles. More...
|
|
uint64_t | temu_cpuStep (void *Cpu, uint64_t Steps) |
| Run the processor for a number of steps. More...
|
|
uint64_t | temu_cpuGetReg (void *Cpu, unsigned Reg) |
|
void | temu_cpuSetReg (void *Cpu, unsigned Reg, uint64_t Value) |
|
float | temu_cpuGetFpr32 (void *Cpu, unsigned Reg) |
|
uint32_t | temu_cpuGetFpr32Bits (void *Cpu, unsigned Reg) |
|
void | temu_cpuSetFpr32 (void *Cpu, unsigned Reg, float Value) |
|
void | temu_cpuSetFpr32Bits (void *Cpu, unsigned Reg, uint32_t Value) |
|
double | temu_cpuGetFpr64 (void *Cpu, unsigned Reg) |
|
uint64_t | temu_cpuGetFpr64Bits (void *Cpu, unsigned Reg) |
|
void | temu_cpuSetFpr64 (void *Cpu, unsigned Reg, double Value) |
|
void | temu_cpuSetFpr64Bits (void *Cpu, unsigned Reg, uint64_t Value) |
|
void | temu_cpuEnableTraps (void *Cpu) |
|
void | temu_cpuDisableTraps (void *Cpu) |
|
int | temu_sparcGetWindowCount (void *Cpu) |
|
uint32_t | temu_sparcGetWindowedReg (void *Cpu, int Window, unsigned Reg) |
|
void | temu_sparcSetWindowedReg (void *Cpu, int Window, unsigned Reg, uint32_t Value) |
|
void | temu_sparcSetY (void *Cpu, uint64_t Value) |
|
uint64_t | temu_sparcGetY (void *Cpu) |
|
void | temu_sparcSetAsr (void *Cpu, unsigned Reg, uint64_t Value) |
|
uint64_t | temu_sparcGetAsr (void *Cpu, unsigned Reg) |
|
void | temu_sparcSetAsrWriter (void *Cpu, unsigned Asr, temu_SparcAsrHandler Handler) |
|
void | temu_sparcSetAsrReader (void *Cpu, unsigned Asr, temu_SparcAsrHandler Handler) |
|
void | temu_sparcSetPsr (void *Cpu, uint32_t Value) |
|
uint32_t | temu_sparcGetPsr (void *Cpu) |
|
void | temu_sparcSetTbr (void *Cpu, uint32_t Value) |
|
uint32_t | temu_sparcGetTbr (void *Cpu) |
|
void | temu_sparcSetWim (void *Cpu, uint32_t Value) |
|
uint32_t | temu_sparcGetWim (void *Cpu) |
|
void | temu_sparcSetNPc (void *Cpu, uint32_t Value) |
|
uint32_t | temu_sparcGetNPc (void *Cpu) |
|
void | temu_machineReset (void *Machine, int ResetType) |
| Reset the Machine. More...
|
|
uint64_t | temu_machineRun (void *Machine, uint64_t NanoSecs) |
| Run the machine for a number of nanoseconds. More...
|
|
void | temu_postCallback (void *Obj, temu_SafeCb Cb, void *Arg) |
|
typedef void(* temu_SafeCb)(void *) |
Post a callback in a CPU or Machine object (implementing the EventIface).
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 at a rate of 1kHz simulated real-time (though this rate is not guaranteed for the future)), but the callback will be called as soon as a normal 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.
Definition at line 259 of file Cpu.h.
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
-
Cpu | The CPU object |
Steps | The number of steps to run the processor for. |
- Returns
- The number of executed steps.