summaryrefslogtreecommitdiff
path: root/sys/src/cmd/5e/dat.h
diff options
context:
space:
mode:
authoraiju <aiju@phicode.de>2011-06-16 17:49:24 +0200
committeraiju <aiju@phicode.de>2011-06-16 17:49:24 +0200
commit2acb5433d8008012d7208a7bfcb9c6a1544f218f (patch)
tree19f0c7afc013113c5f8b3de005b2245e33ce2f5e /sys/src/cmd/5e/dat.h
parentfcf30f314b4c4157b536647a09a214576711ad16 (diff)
added 5e (not finished)
Diffstat (limited to 'sys/src/cmd/5e/dat.h')
-rw-r--r--sys/src/cmd/5e/dat.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/sys/src/cmd/5e/dat.h b/sys/src/cmd/5e/dat.h
new file mode 100644
index 000000000..d8356f07d
--- /dev/null
+++ b/sys/src/cmd/5e/dat.h
@@ -0,0 +1,65 @@
+typedef struct Process Process;
+typedef struct Segment Segment;
+typedef struct Fdtable Fdtable;
+typedef struct Fd Fd;
+
+enum {
+ STACKTOP = 0x80000000UL,
+ STACKSIZE = 0x10000,
+
+ FDBLOCK = 16,
+ SEGNUM = 8,
+
+ flN = 1<<31,
+ flZ = 1<<30,
+ flC = 1<<29,
+ flV = 1<<28,
+ FLAGS = flN | flZ | flC | flV,
+};
+
+enum {
+ SEGTEXT,
+ SEGDATA,
+ SEGBSS,
+ SEGSTACK,
+};
+
+struct Process {
+ Segment* S[SEGNUM];
+ u32int R[16]; /* general purpose registers / PC (R15) */
+ u32int CPSR; /* status register */
+ char errbuf[ERRMAX];
+ Fd *fd;
+ int pid;
+};
+
+extern void **_privates;
+extern int _nprivates;
+#define P (*(Process**)_privates)
+
+enum {
+ SEGFLLOCK = 1,
+};
+
+struct Segment {
+ Ref;
+ int flags;
+ RWLock rw; /* lock for SEGLOCK segments */
+ Lock lock; /* atomic accesses */
+ u32int start, size;
+ void *data;
+ Ref *ref;
+};
+
+struct Fd {
+ RWLock;
+ Ref ref;
+ u8int *fds;
+ int nfds;
+};
+
+#define fulltrace 0
+#define havesymbols 0
+#define ultraverbose 0
+#define systrace 0
+