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 0
  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<<5)
  32. #define FPUNFL ((1<<4)|(1<<1))
  33. #define FPOVFL (1<<3)
  34. #define FPZDIV (1<<2)
  35. #define FPINVAL (1<<0)
  36. #define FPRNR (0<<10)
  37. #define FPRZ (3<<10)
  38. #define FPRPINF (2<<10)
  39. #define FPRNINF (1<<10)
  40. #define FPRMASK (3<<10)
  41. #define FPPEXT (3<<8)
  42. #define FPPSGL (0<<8)
  43. #define FPPDBL (2<<8)
  44. #define FPPMASK (3<<8)
  45. /* FSR */
  46. #define FPAINEX FPINEX
  47. #define FPAOVFL FPOVFL
  48. #define FPAUNFL FPUNFL
  49. #define FPAZDIV FPZDIV
  50. #define FPAINVAL FPINVAL
  51. union FPdbleword
  52. {
  53. double x;
  54. struct { /* little endian */
  55. uint32_t lo;
  56. uint32_t hi;
  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)[-4]:\
  69. (sizeof(mode) == 2)?\
  70. ((list += 4), (mode*)list)[-2]:\
  71. ((list += sizeof(mode)), (mode*)list)[-1])