u.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * This file is part of the Harvey operating system. It is subject to the
  3. * license terms of the GNU GPL v2 in LICENSE.gpl found in the top-level
  4. * directory of this distribution and at http://www.gnu.org/licenses/gpl-2.0.txt
  5. *
  6. * No part of Harvey operating system, including this file, may be copied,
  7. * modified, propagated, or distributed except according to the terms
  8. * contained in the LICENSE.gpl file.
  9. */
  10. #define nil ((void *)0)
  11. typedef signed char i8;
  12. typedef unsigned char u8;
  13. typedef signed short i16;
  14. typedef unsigned short u16;
  15. typedef signed int i32;
  16. typedef unsigned int u32;
  17. typedef signed long long i64;
  18. typedef unsigned long long u64;
  19. typedef u64 usize;
  20. typedef i64 isize;
  21. typedef u32 Rune;
  22. typedef union FPdbleword FPdbleword;
  23. union FPdbleword
  24. {
  25. double x;
  26. struct { // little endian
  27. u32 lo;
  28. u32 hi;
  29. };
  30. };
  31. typedef u64 jmp_buf[32];
  32. #define JMPBUFDPC 0
  33. #define JMPBUFSP 30
  34. #define JMPBUFPC 31
  35. #define JMPBUFARG1 0
  36. #define JMPBUFARG2 1
  37. typedef u32 mpdigit; // for /sys/include/mp.h
  38. typedef __builtin_va_list va_list;
  39. #define va_start(v,l) __builtin_va_start(v,l)
  40. #define va_end(v) __builtin_va_end(v)
  41. #define va_arg(v,l) __builtin_va_arg(v,l)
  42. #define va_copy(v,l) __builtin_va_copy(v,l)
  43. #define getcallerpc() ((usize)__builtin_return_address(0))