u.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. /* VFP FCR */
  31. #define FPINEX (1<<12) /* trap enables for exceptions */
  32. #define FPUNFL (1<<11)
  33. #define FPOVFL (1<<10)
  34. #define FPZDIV (1<<9)
  35. #define FPINVAL (1<<8)
  36. #define FPRNR (0<<22)
  37. #define FPRZ (1<<22)
  38. #define FPRPINF (2<<22)
  39. #define FPRNINF (3<<22)
  40. #define FPRMASK (3<<22)
  41. #define FPPEXT 0
  42. #define FPPSGL 0
  43. #define FPPDBL 0
  44. #define FPPMASK 0
  45. /* FSR */
  46. #define FPAINEX (1<<4) /* accrued exceptions */
  47. #define FPAUNFL (1<<3)
  48. #define FPAOVFL (1<<2)
  49. #define FPAZDIV (1<<1)
  50. #define FPAINVAL (1<<0)
  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])