00001
00002 #ifndef CHIP
00003 #error CHIP is not defined
00004 #endif
00005
00006 #define EXTERN extern
00007 #define PRIVATE static
00008 #define PUBLIC
00009 #define FORWARD static
00010
00011 #define TRUE 1
00012 #define FALSE 0
00013
00014 #define HZ 60
00015
00016 #define SUPER_USER (uid_t) 0
00017
00018 #define NULL ((void *)0)
00019 #define CPVEC_NR 16
00020 #define CPVVEC_NR 64
00021 #define NR_IOREQS MIN(NR_BUFS, 64)
00022
00023
00024
00025 #define MESS_SIZE (sizeof(message))
00026 #define NIL_MESS ((message *) 0)
00027
00028
00029 #define SEGMENT_TYPE 0xFF00
00030 #define SEGMENT_INDEX 0x00FF
00031
00032 #define LOCAL_SEG 0x0000
00033 #define NR_LOCAL_SEGS 3
00034 #define T 0
00035 #define D 1
00036 #define S 2
00037
00038 #define REMOTE_SEG 0x0100
00039 #define NR_REMOTE_SEGS 3
00040
00041 #define BIOS_SEG 0x0200
00042 #define NR_BIOS_SEGS 3
00043
00044 #define PHYS_SEG 0x0400
00045
00046
00047 #define DEAD_CODE 0
00048 #define FUTURE_CODE 0
00049 #define TEMP_CODE 1
00050
00051
00052 #define PROC_NAME_LEN 16
00053
00054
00055 #define BYTE 0377
00056 #define READING 0
00057 #define WRITING 1
00058 #define NO_NUM 0x8000
00059 #define NIL_PTR (char *) 0
00060 #define HAVE_SCATTERED_IO 1
00061
00062
00063 #define MAX(a, b) ((a) > (b) ? (a) : (b))
00064 #define MIN(a, b) ((a) < (b) ? (a) : (b))
00065
00066
00067 #if (CHIP == INTEL)
00068 #define CLICK_SIZE 4096
00069 #define CLICK_SHIFT 12
00070 #endif
00071
00072 #if (CHIP == SPARC) || (CHIP == M68000)
00073 #define CLICK_SIZE 4096
00074 #define CLICK_SHIFT 12
00075 #endif
00076
00077
00078 #define HCLICK_SHIFT 4
00079 #define HCLICK_SIZE 16
00080 #if CLICK_SIZE >= HCLICK_SIZE
00081 #define click_to_hclick(n) ((n) << (CLICK_SHIFT - HCLICK_SHIFT))
00082 #else
00083 #define click_to_hclick(n) ((n) >> (HCLICK_SHIFT - CLICK_SHIFT))
00084 #endif
00085 #define hclick_to_physb(n) ((phys_bytes) (n) << HCLICK_SHIFT)
00086 #define physb_to_hclick(n) ((n) >> HCLICK_SHIFT)
00087
00088 #define ABS -999
00089
00090
00091 #define I_TYPE 0170000
00092 #define I_SYMBOLIC_LINK 0120000
00093 #define I_REGULAR 0100000
00094 #define I_BLOCK_SPECIAL 0060000
00095 #define I_DIRECTORY 0040000
00096 #define I_CHAR_SPECIAL 0020000
00097 #define I_NAMED_PIPE 0010000
00098 #define I_SET_UID_BIT 0004000
00099 #define I_SET_GID_BIT 0002000
00100 #define ALL_MODES 0006777
00101 #define RWX_MODES 0000777
00102 #define R_BIT 0000004
00103 #define W_BIT 0000002
00104 #define X_BIT 0000001
00105 #define I_NOT_ALLOC 0000000
00106
00107
00108 #define MAX_BLOCK_NR ((block_t) 077777777)
00109 #define HIGHEST_ZONE ((zone_t) 077777777)
00110 #define MAX_INODE_NR ((ino_t) 037777777777)
00111 #define MAX_FILE_POS ((off_t) 037777777777)
00112
00113 #define MAX_SYM_LOOPS 8
00114
00115 #define NO_BLOCK ((block_t) 0)
00116 #define NO_ENTRY ((ino_t) 0)
00117 #define NO_ZONE ((zone_t) 0)
00118 #define NO_DEV ((dev_t) 0)