u.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 char u8;
  11. typedef signed char i8;
  12. typedef unsigned short u16;
  13. typedef signed short i16;
  14. typedef unsigned int u32;
  15. typedef signed int i32;
  16. typedef unsigned long long u64;
  17. typedef signed long long i64;
  18. typedef u64 usize;
  19. typedef i64 isize;
  20. typedef unsigned char uint8_t;
  21. typedef signed char int8_t;
  22. typedef unsigned short uint16_t;
  23. typedef signed short int16_t;
  24. typedef unsigned int uint32_t;
  25. typedef unsigned int uint;
  26. typedef signed int int32_t;
  27. typedef unsigned long long uint64_t;
  28. typedef long long int64_t;
  29. typedef int64_t intptr_t;
  30. typedef uint64_t uintptr;
  31. typedef uint64_t uintptr_t;
  32. typedef uint32_t usize;
  33. typedef int64_t size_t;
  34. typedef uint32_t Rune;
  35. typedef union FPdbleword FPdbleword;
  36. // This is a guess! Assumes float!
  37. typedef uintptr jmp_buf[64]; // for registers.
  38. #define JMPBUFSP 1
  39. #define JMPBUFPC 0
  40. #define JMPBUFARG1 13
  41. #define JMPBUFARG2 14
  42. #define JMPBUFARG3 15
  43. #define JMPBUFARG4 16
  44. // what is this?
  45. #define JMPBUFDPC 0
  46. typedef unsigned int mpdigit; /* for /sys/include/mp.h */
  47. union FPdbleword
  48. {
  49. double x;
  50. struct { /* little endian */
  51. uint lo;
  52. uint hi;
  53. };
  54. };
  55. typedef __builtin_va_list va_list;
  56. #define va_start(v,l) __builtin_va_start(v,l)
  57. #define va_end(v) __builtin_va_end(v)
  58. #define va_arg(v,l) __builtin_va_arg(v,l)
  59. #define va_copy(v,l) __builtin_va_copy(v,l)
  60. #define getcallerpc() ((uintptr_t)__builtin_return_address(0))