u.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 u32 Rune;
  21. typedef union FPdbleword FPdbleword;
  22. // This is a guess! Assumes float!
  23. typedef usize jmp_buf[64]; // for registers.
  24. #define JMPBUFSP 1
  25. #define JMPBUFPC 0
  26. #define JMPBUFARG1 13
  27. #define JMPBUFARG2 14
  28. #define JMPBUFARG3 15
  29. #define JMPBUFARG4 16
  30. // what is this?
  31. #define JMPBUFDPC 0
  32. typedef unsigned int mpdigit; /* for /sys/include/mp.h */
  33. union FPdbleword
  34. {
  35. double x;
  36. struct { /* little endian */
  37. u32 lo;
  38. u32 hi;
  39. };
  40. };
  41. typedef __builtin_va_list va_list;
  42. #define va_start(v,l) __builtin_va_start(v,l)
  43. #define va_end(v) __builtin_va_end(v)
  44. #define va_arg(v,l) __builtin_va_arg(v,l)
  45. #define va_copy(v,l) __builtin_va_copy(v,l)
  46. #define getcallerpc() ((usize)__builtin_return_address(0))