Minimal changes to get m6502 to compile (won't work)
[Apout.git] / v1trap.h
1 /* v1trap.h - Deal with 1st Edition trap instructions.
2  *
3  * $Revision: 1.1 $
4  * $Date: 1999/12/26 08:16:33 $
5  */
6
7 /* In this file, we list the trap number for each system call,
8  * and the structures associated with several of the systems
9  * calls in 1st Edition UNIX
10  */
11
12 #define V1_RELE    0
13 #define V1_EXIT    1
14 #define V1_FORK    2
15 #define V1_READ    3
16 #define V1_WRITE   4
17 #define V1_OPEN    5
18 #define V1_CLOSE   6
19 #define V1_WAIT    7
20 #define V1_CREAT   8
21 #define V1_LINK    9
22 #define V1_UNLINK  10
23 #define V1_EXEC    11
24 #define V1_CHDIR   12
25 #define V1_TIME    13
26 #define V1_MKDIR   14
27 #define V1_CHMOD   15
28 #define V1_CHOWN   16
29 #define V1_BREAK   17
30 #define V1_STAT    18
31 #define V1_SEEK    19
32 #define V1_TELL    20
33 #define V1_MOUNT   21
34 #define V1_UMOUNT  22
35 #define V1_SETUID  23
36 #define V1_GETUID  24
37 #define V1_STIME   25
38 #define V1_QUIT    26
39 #define V1_INTR    27
40 #define V1_FSTAT   28
41 #define V1_CEMT    29
42 #define V1_SMDATE  30
43 #define V1_STTY    31
44 #define V1_GTTY    32
45 #define V1_ILGINS  33
46
47
48 char *v1trap_name[] = {
49     "rele",
50     "exit",
51     "fork",
52     "read",
53     "write",
54     "open",
55     "close",
56     "wait",
57     "creat",
58     "link",
59     "unlink",
60     "exec",
61     "chdir",
62     "time",
63     "mkdir",
64     "chmod",
65     "chown",
66     "break",
67     "stat",
68     "seek",
69     "tell",
70     "mount",
71     "umount",
72     "setuid",
73     "getuid",
74     "stime",
75     "quit",
76     "intr",
77     "fstat",
78     "cemt",
79     "smdate",
80     "stty",
81     "gtty",
82     "ilgins"
83 };
84
85
86 struct tr_v1stat {
87     u_int16_t inum;
88     u_int16_t iflags;           /* Mode */
89     u_int8_t inl;               /* Links */
90     u_int8_t iuid;
91     u_int16_t isize;
92     int16_t iaddr[8];           /* Not used, I hope! */
93     u_int32_t ctime;
94     u_int32_t mtime;
95     u_int16_t unused;
96 };
97
98 /* Values for v1stat iflags */
99 #define V1_ST_USED      0100000
100 #define V1_ST_ISDIR     0040000
101 #define V1_ST_MODIFIED  0020000
102 #define V1_ST_LARGE     0010000
103 #define V1_ST_SETUID    0000040
104 #define V1_ST_EXEC      0000020
105 #define V1_ST_OWNREAD   0000010
106 #define V1_ST_OWNWRITE  0000004
107 #define V1_ST_WRLDREAD  0000002
108 #define V1_ST_WRLDWRITE 0000001
109
110 /* A union which will point at the trap args, so that
111  * we can get at the various args of different types
112  */
113 typedef union {
114     int16_t sarg[4];            /* Signed 16-bit args */
115     u_int16_t uarg[4];          /* Unsigned 16-bit args */
116 } arglist;
117
118 #define sarg1   V1A.sarg[0]
119 #define sarg2   V1A.sarg[1]
120 #define sarg3   V1A.sarg[2]
121 #define sarg4   V1A.sarg[3]
122 #define uarg1   V1A.uarg[0]
123 #define uarg2   V1A.uarg[1]
124 #define uarg3   V1A.uarg[2]
125 #define uarg4   V1A.uarg[3]