4 #define MAX(a,b) ((a) > (b) ? (a) : (b))
5 #define MIN(a,b) ((a) < (b) ? (a) : (b))
8 typedef unsigned short unshort; /* must be 16-bit unsigned */
9 typedef unshort block_nr; /* block number */
10 typedef unshort zone_nr; /* zone number */
12 #define MAX_BLOCK_NR ((block_nr) 0177777) /* largest block number */
13 #define HIGHEST_ZONE ((zone_nr) 0177777) /* largest zone number */
14 #define MAX_INODE_NR ((ino_t 0177777) /* largest inode number */
15 #define MAX_FILE_POS 017777777777L /* largest legal file offset */
17 #define NO_BLOCK ((block_nr) 0) /* absence of a block number */
18 #define NO_ENTRY ((ino_t) 0) /* absence of a dir entry */
19 #define NO_ZONE ((zone_nr) 0) /* absence of a zone number */
20 #define NO_DEV ((dev_t) ~0) /* absence of a device numb */
22 typedef unshort bit_nr; /* if ino_t & zone_nr both unshort,
23 then also unshort, else long */
24 typedef long zone_type; /* zone size */
27 typedef unsigned vir_bytes; /* virtual addresses and lengths in bytes */
31 typedef long vir_bytes; /* virtual addresses and lengths in bytes */
34 typedef unsigned vir_clicks; /* virtual addresses and lengths in clicks */
35 typedef long phys_bytes; /* physical addresses and lengths in bytes */
36 typedef unsigned phys_clicks; /* physical addresses and lengths in clicks */
37 typedef int signed_clicks; /* same length as phys_clicks, but signed */
39 /* Types relating to messages. */
45 typedef struct {int m1i1, m1i2, m1i3; char *m1p1, *m1p2, *m1p3;} mess_1;
46 typedef struct {int m2i1, m2i2, m2i3; long m2l1, m2l2; char *m2p1;} mess_2;
47 typedef struct {int m3i1, m3i2; char *m3p1; char m3ca1[M3_STRING];} mess_3;
48 typedef struct {long m4l1, m4l2, m4l3, m4l4;} mess_4;
49 typedef struct {char m5c1, m5c2; int m5i1, m5i2; long m5l1, m5l2, m5l3;} mess_5;
51 typedef struct {int m6i1, m6i2, m6i3; long m6l1; void (*m6f1)(int);} mess_6;
53 typedef struct {int m6i1, m6i2, m6i3; long m6l1; void (*m6f1)();} mess_6;
57 int m_source; /* who sent the message */
58 int m_type; /* what kind of message is it */
69 #define MESS_SIZE (sizeof(message))
70 #define NIL_MESS (message *) 0
72 /* The following defines provide names for useful members. */
73 #define m1_i1 m_u.m_m1.m1i1
74 #define m1_i2 m_u.m_m1.m1i2
75 #define m1_i3 m_u.m_m1.m1i3
76 #define m1_p1 m_u.m_m1.m1p1
77 #define m1_p2 m_u.m_m1.m1p2
78 #define m1_p3 m_u.m_m1.m1p3
80 #define m2_i1 m_u.m_m2.m2i1
81 #define m2_i2 m_u.m_m2.m2i2
82 #define m2_i3 m_u.m_m2.m2i3
83 #define m2_l1 m_u.m_m2.m2l1
84 #define m2_l2 m_u.m_m2.m2l2
85 #define m2_p1 m_u.m_m2.m2p1
87 #define m3_i1 m_u.m_m3.m3i1
88 #define m3_i2 m_u.m_m3.m3i2
89 #define m3_p1 m_u.m_m3.m3p1
90 #define m3_ca1 m_u.m_m3.m3ca1
93 #define m4_l1 m_u.m_m4.m4l1
94 #define m4_l2 m_u.m_m4.m4l2
95 #define m4_l3 m_u.m_m4.m4l3
96 #define m4_l4 m_u.m_m4.m4l4
98 #define m5_c1 m_u.m_m5.m5c1
99 #define m5_c2 m_u.m_m5.m5c2
100 #define m5_i1 m_u.m_m5.m5i1
101 #define m5_i2 m_u.m_m5.m5i2
102 #define m5_l1 m_u.m_m5.m5l1
103 #define m5_l2 m_u.m_m5.m5l2
104 #define m5_l3 m_u.m_m5.m5l3
106 #define m6_i1 m_u.m_m6.m6i1
107 #define m6_i2 m_u.m_m6.m6i2
108 #define m6_i3 m_u.m_m6.m6i3
109 #define m6_l1 m_u.m_m6.m6l1
110 #define m6_f1 m_u.m_m6.m6f1
113 vir_clicks mem_vir; /* virtual address */
114 phys_clicks mem_phys; /* physical address */
115 vir_clicks mem_len; /* length */
118 struct copy_info { /* used by sys_copy(src, dst, bytes) */
121 vir_bytes cp_src_vir;
124 vir_bytes cp_dst_vir;
129 long io_position; /* position in device file (really off_t) */
130 char *io_buf; /* buffer in user space */
131 unsigned short io_nbytes; /* size of request */
132 unsigned short io_request; /* read, write (optionally) */