u.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 int8_t;
  12. typedef unsigned char uint8_t;
  13. typedef signed short int16_t;
  14. typedef unsigned short uint16_t;
  15. typedef signed int int32_t;
  16. typedef unsigned int uint32_t;
  17. typedef unsigned int uint;
  18. typedef signed long long int64_t;
  19. typedef unsigned long long uint64_t;
  20. typedef uint64_t uintptr;
  21. typedef uint64_t uintptr_t;
  22. typedef uint64_t usize;
  23. typedef uint64_t size_t;
  24. typedef uint32_t Rune;
  25. typedef union FPdbleword FPdbleword;
  26. union FPdbleword
  27. {
  28. double x;
  29. struct { // little endian
  30. uint32_t lo;
  31. uint32_t hi;
  32. };
  33. };
  34. typedef uint64_t jmp_buf[32];
  35. #define JMPBUFDPC 0
  36. #define JMPBUFSP 30
  37. #define JMPBUFPC 31
  38. #define JMPBUFARG1 0
  39. #define JMPBUFARG2 1
  40. typedef uint32_t mpdigit; // for /sys/include/mp.h
  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() ((uintptr_t)__builtin_return_address(0))