u.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #define nil ((void*)0)
  10. typedef unsigned short ushort;
  11. typedef unsigned char uchar;
  12. typedef unsigned long ulong;
  13. typedef unsigned int uint;
  14. typedef signed char schar;
  15. typedef long long vlong;
  16. typedef unsigned long long uvlong;
  17. typedef unsigned long uintptr;
  18. typedef unsigned long usize;
  19. typedef uint Rune;
  20. typedef union FPdbleword FPdbleword;
  21. typedef long jmp_buf[2];
  22. #define JMPBUFSP 0
  23. #define JMPBUFPC 1
  24. #define JMPBUFDPC (-8)
  25. typedef unsigned int mpdigit; /* for /sys/include/mp.h */
  26. typedef unsigned char u8int;
  27. typedef unsigned short u16int;
  28. typedef unsigned int u32int;
  29. typedef unsigned long long u64int;
  30. /* FCR */
  31. #define FPINEX (1<<23)
  32. #define FPOVFL (1<<26)
  33. #define FPUNFL (1<<25)
  34. #define FPZDIV (1<<24)
  35. #define FPRNR (0<<30)
  36. #define FPRZ (1<<30)
  37. #define FPINVAL (1<<27)
  38. #define FPRPINF (2<<30)
  39. #define FPRNINF (3<<30)
  40. #define FPRMASK (3<<30)
  41. #define FPPEXT 0
  42. #define FPPSGL 0
  43. #define FPPDBL 0
  44. #define FPPMASK 0
  45. /* FSR */
  46. #define FPAINEX (1<<5)
  47. #define FPAZDIV (1<<6)
  48. #define FPAUNFL (1<<7)
  49. #define FPAOVFL (1<<8)
  50. #define FPAINVAL (1<<9)
  51. union FPdbleword
  52. {
  53. double x;
  54. struct { /* big endian */
  55. uint32_t hi;
  56. uint32_t lo;
  57. };
  58. };
  59. typedef char* va_list;
  60. #define va_start(list, start) list =\
  61. (sizeof(start) < 4?\
  62. (char*)((int*)&(start)+1):\
  63. (char*)(&(start)+1))
  64. #define va_end(list)\
  65. USED(list)
  66. #define va_arg(list, mode)\
  67. ((sizeof(mode) == 1)?\
  68. ((list += 4), (mode*)list)[-1]:\
  69. (sizeof(mode) == 2)?\
  70. ((list += 4), (mode*)list)[-1]:\
  71. ((list += sizeof(mode)), (mode*)list)[-1])