u.h 1.5 KB

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