summaryrefslogtreecommitdiff
path: root/sys/src/cmd/vmx/dat.h
diff options
context:
space:
mode:
authoraiju <devnull@localhost>2017-08-24 08:06:41 +0000
committeraiju <devnull@localhost>2017-08-24 08:06:41 +0000
commit8968426327c93f47ff0d8123941b7d1d2077d6c7 (patch)
treef36f589c3a2dad2dbcf24ad9f72b2c1df98def38 /sys/src/cmd/vmx/dat.h
parent9616f6187202900fa8d86d197d5b7bc56f83609b (diff)
vmx(1): memory map improvements, x86 simulator for MMIO
Diffstat (limited to 'sys/src/cmd/vmx/dat.h')
-rw-r--r--sys/src/cmd/vmx/dat.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/src/cmd/vmx/dat.h b/sys/src/cmd/vmx/dat.h
index 34c2fd888..b6321ab96 100644
--- a/sys/src/cmd/vmx/dat.h
+++ b/sys/src/cmd/vmx/dat.h
@@ -1,3 +1,7 @@
+typedef char s8int;
+typedef short s16int;
+typedef int s32int;
+
typedef struct PCIDev PCIDev;
typedef struct PCICap PCICap;
typedef struct PCIBar PCIBar;
@@ -33,6 +37,7 @@ enum {
#define R13 "r13"
#define R14 "r14"
#define R15 "r15"
+#define RFLAGS "flags"
enum {
MMIORD = 0,
@@ -44,7 +49,12 @@ struct Region {
uintptr start, end;
enum {
REGALLOC = 1, /* allocate memory for region */
- REGRO = 2, /* read-only */
+ REGR = 2, /* can read */
+ REGW = 4, /* can write */
+ REGX = 8, /* can execute */
+
+ REGRWX = REGR|REGW|REGX,
+ REGRX = REGR|REGX,
/* E820 types, 0 == omitted from memory map */
REGFREE = 1<<8, /* report to OS as free */
@@ -54,6 +64,7 @@ struct Region {
uvlong segoff;
void *v, *ve;
Region *next;
+ int (*mmio)(uintptr, void *, int, int);
};
extern Region *mmap;
@@ -132,6 +143,7 @@ enum {
ACCR,
ACCW,
ACCX,
+ ACCSAFE = 0x100, /* don't post exceptions on fault */
};
/* used to speed up consecutive x86access calls */
@@ -139,5 +151,7 @@ typedef struct TLB TLB;
struct TLB {
int asz, seg, acc;
uintptr start, end;
+ uintptr pabase;
+ Region *reg;
uchar *base;
};