TEMU  3.0
The Terma Emulator
Machine.h
Go to the documentation of this file.
1 //===------------------------------------------------------------*- C++ -*-===//
2 //
3 // TEMU: The Terma Emulator
4 // (c) Terma 2015, 2016
5 // Authors: Mattias Holm <maho (at) terma.com>
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef TEMU_MACHINE_H
10 #define TEMU_MACHINE_H
11 
12 #include "temu-c/Support/Cpu.h"
13 #include "temu-c/Target/Cpu.h"
14 #include <stdint.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
23 typedef struct temu_MachineIface {
25  void (*reset)(void *Obj, int ResetType);
27  temu_CpuExitReason (*run)(void *Obj, uint64_t NanoSecs);
28 
30  temu_CpuExitReason (*step)(void *Obj, int CpuId, uint64_t Steps);
32  temu_CpuIfaceRef (*getCurrentCpu)(void *Obj);
34  temu_CpuIfaceRef (*getCpu)(void *Obj, unsigned Idx);
36  int64_t (*getTime)(void *Machine);
37 
39  unsigned (*getCurrentCpuId)(void *Obj);
40 
44  void (*asyncStop)(void *Obj);
46 #define TEMU_MACHINE_IFACE_TYPE "MachineIface"
47 TEMU_IFACE_REFERENCE_TYPE(temu_Machine);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif /* ! TEMU_DEVICE_H */
int64_t(* getTime)(void *Machine)
Get machine time in nanoseconds.
Definition: Machine.h:36
struct temu_MachineIface temu_MachineIface
temu_CpuIfaceRef(* getCpu)(void *Obj, unsigned Idx)
Get processor by index.
Definition: Machine.h:34
temu_CpuExitReason(* step)(void *Obj, int CpuId, uint64_t Steps)
Step the given process a number of steps.
Definition: Machine.h:30
void(* reset)(void *Obj, int ResetType)
Send reset to all processors in the machine.
Definition: Machine.h:25
void(* asyncStop)(void *Obj)
Definition: Machine.h:44
temu_CpuExitReason(* run)(void *Obj, uint64_t NanoSecs)
Run the machine for the given time.
Definition: Machine.h:27
Definition: Machine.h:23
temu_CpuExitReason
Definition: Cpu.h:31
TEMU_IFACE_REFERENCE_TYPE(temu_Machine)
unsigned(* getCurrentCpuId)(void *Obj)
Return the current CPU number.
Definition: Machine.h:39
temu_CpuIfaceRef(* getCurrentCpu)(void *Obj)
Get current processor.
Definition: Machine.h:32