const.h 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* Copyright (C) 1990 by Prentice-Hall, Inc. Permission is hereby granted
  2. * to redistribute the binary and source programs of this system for
  3. * educational or research purposes. For other use, written permission from
  4. * Prentice-Hall is required.
  5. */
  6. #define EXTERN extern /* used in *.h files */
  7. #define PRIVATE static /* PRIVATE x limits the scope of x */
  8. #define PUBLIC /* PUBLIC is the opposite of PRIVATE */
  9. #define FORWARD static /* some compilers require this to be 'static'*/
  10. #define TRUE 1 /* used for turning integers into Booleans */
  11. #define FALSE 0 /* used for turning integers into Booleans */
  12. #define HZ 60 /* clock freq (software settable on IBM-PC) */
  13. #define BLOCK_SIZE 1024 /* # bytes in a disk block */
  14. #define SUPER_USER (uid_t) 0 /* uid_t of superuser */
  15. #define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */
  16. #define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */
  17. #ifdef AM_KERNEL
  18. #define NR_TASKS 14 /* must be 5 more than without amoeba */
  19. #else
  20. #define NR_TASKS 9 /* number of tasks in the transfer vector */
  21. #endif
  22. #define NR_PROCS 32 /* number of slots in proc table */
  23. #define NR_SEGS 3 /* # segments per process */
  24. #define T 0 /* proc[i].mem_map[T] is for text */
  25. #define D 1 /* proc[i].mem_map[D] is for data */
  26. #define S 2 /* proc[i].mem_map[S] is for stack */
  27. #define MAX_P_LONG 2147483647 /* maximum positive long, i.e. 2**31 - 1 */
  28. /* Memory is allocated in clicks. */
  29. #if (CHIP == INTEL) || (CHIP == M68000)
  30. #define CLICK_SIZE 256 /* unit in which memory is allocated */
  31. #define CLICK_SHIFT 8 /* log2 of CLICK_SIZE */
  32. #endif
  33. #define click_to_round_k(n) \
  34. ((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
  35. #if CLICK_SIZE < 1024
  36. #define k_to_click(n) ((n) * (1024 / CLICK_SIZE))
  37. #else
  38. #define k_to_click(n) ((n) / (CLICK_SIZE / 1024))
  39. #endif
  40. /* Process numbers of some important processes */
  41. #define MM_PROC_NR 0 /* process number of memory manager */
  42. #define FS_PROC_NR 1 /* process number of file system */
  43. #define INIT_PROC_NR 2 /* init -- the process that goes multiuser */
  44. #define LOW_USER 2 /* first user not part of operating system */
  45. /* Miscellaneous */
  46. #define BYTE 0377 /* mask for 8 bits */
  47. #define TO_USER 0 /* flag telling to copy from fs to user */
  48. #define FROM_USER 1 /* flag telling to copy from user to fs */
  49. #define READING 0 /* copy data to user */
  50. #define WRITING 1 /* copy data from user */
  51. #if (MACHINE != ATARI)
  52. #define ABS -999 /* this process means absolute memory */
  53. #endif
  54. #define WORD_SIZE 2 /* number of bytes per word */
  55. #define NIL_PTR (char *) 0 /* generally useful expression */
  56. #define NO_NUM 0x8000 /* used as numerical argument to panic() */
  57. #define SIG_PUSH_BYTES (4*sizeof(int)) /* how many bytes pushed by signal */
  58. /* Flag bits for i_mode in the inode. */
  59. #define I_TYPE 0170000 /* this field gives inode type */
  60. #define I_REGULAR 0100000 /* regular file, not dir or special */
  61. #define I_BLOCK_SPECIAL 0060000 /* block special file */
  62. #define I_DIRECTORY 0040000 /* file is a directory */
  63. #define I_CHAR_SPECIAL 0020000 /* character special file */
  64. #define I_NAMED_PIPE 0010000 /* named pipe (FIFO) */
  65. #define I_SET_UID_BIT 0004000 /* set effective uid_t on exec */
  66. #define I_SET_GID_BIT 0002000 /* set effective gid_t 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 */