const.h 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* Copyright (C) 1987 by Prentice-Hall, Inc. Permission is hereby granted to
  2. * private individuals and educational institutions to modify and
  3. * redistribute the binary and source programs of this system to other
  4. * private individuals and educational institutions for educational and
  5. * research purposes. For corporate or commercial use, permission from
  6. * Prentice-Hall is required. In general, such permission will be granted,
  7. * subject to a few conditions.
  8. */
  9. #define EXTERN extern /* used in *.h files */
  10. #define PRIVATE static /* PRIVATE x limits the scope of x */
  11. #define PUBLIC /* PUBLIC is the opposite of PRIVATE */
  12. #define FORWARD static /* some compilers require this to be 'static' */
  13. #define TRUE 1 /* used for turning integers into Booleans */
  14. #define FALSE 0 /* used for turning integers into Booleans */
  15. #define HZ 60 /* clock freq (software settable on IBM-PC) */
  16. #define BLOCK_SIZE 1024 /* # bytes in a disk block */
  17. #define SUPER_USER (uid) 0 /* uid of superuser */
  18. #define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */
  19. #define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */
  20. #define NR_TASKS 8 /* number of tasks in the transfer vector */
  21. #define NR_PROCS 16 /* number of slots in proc table */
  22. #define NR_SEGS 3 /* # segments per process */
  23. #define T 0 /* proc[i].mem_map[T] is for text */
  24. #define D 1 /* proc[i].mem_map[D] is for data */
  25. #define S 2 /* proc[i].mem_map[S] is for stack */
  26. #define MAX_P_LONG 2147483647 /* maximum positive long, i.e. 2**31 - 1 */
  27. /* Memory is allocated in clicks. */
  28. #ifdef i8088
  29. #define CLICK_SIZE 0020 /* unit in which memory is allocated */
  30. #define CLICK_SHIFT 4 /* log2 of CLICK_SIZE */
  31. #endif
  32. #ifdef ATARI_ST
  33. #define CLICK_SIZE 256 /* unit in which memory is allocated */
  34. #define CLICK_SHIFT 8 /* log2 of CLICK_SIZE */
  35. #endif
  36. /* Process numbers of some important processes */
  37. #define MM_PROC_NR 0 /* process number of memory manager */
  38. #define FS_PROC_NR 1 /* process number of file system */
  39. #define INIT_PROC_NR 2 /* init -- the process that goes multiuser */
  40. #define LOW_USER 2 /* first user not part of operating system */
  41. /* Miscellaneous */
  42. #define BYTE 0377 /* mask for 8 bits */
  43. #define TO_USER 0 /* flag telling to copy from fs to user */
  44. #define FROM_USER 1 /* flag telling to copy from user to fs */
  45. #define READING 0 /* copy data to user */
  46. #define WRITING 1 /* copy data from user */
  47. #ifndef ATARI_ST
  48. #define ABS -999 /* this process means absolute memory */
  49. #endif
  50. #define WORD_SIZE 2 /* number of bytes per word */
  51. #define NIL_PTR (char *) 0 /* generally useful expression */
  52. #define NO_NUM 0x8000 /* used as numerical argument to panic() */
  53. #define MAX_PATH 128 /* max length of path names */
  54. #define SIG_PUSH_BYTES 8 /* how many bytes pushed by signal */
  55. #define MAX_ISTACK_BYTES 1024 /* maximum initial stack size for EXEC */
  56. /* Device numbers of root (RAM) and boot (fd0) devices. */
  57. #define ROOT_DEV (dev_nr) 256 /* major-minor device number of root dev */
  58. #define BOOT_DEV (dev_nr) 512 /* major-minor device number of boot diskette */
  59. /* Flag bits for i_mode in the inode. */
  60. #define I_TYPE 0170000 /* this field gives inode type */
  61. #define I_REGULAR 0100000 /* regular file, not dir or special */
  62. #define I_BLOCK_SPECIAL 0060000 /* block special file */
  63. #define I_DIRECTORY 0040000 /* file is a directory */
  64. #define I_CHAR_SPECIAL 0020000 /* character special file */
  65. #define I_SET_UID_BIT 0004000 /* set effective uid on exec */
  66. #define I_SET_GID_BIT 0002000 /* set effective gid on exec */
  67. #define ALL_MODES 0006777 /* all bits for user, group and others */
  68. #define RWX_MODES 0000777 /* mode bits for RWX only */
  69. #define R_BIT 0000004 /* Rwx protection bit */
  70. #define W_BIT 0000002 /* rWx protection bit */
  71. #define X_BIT 0000001 /* rwX protection bit */
  72. #define I_NOT_ALLOC 0000000 /* this inode is free */