types.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* include/sys/types.h
  2. *
  3. * Copyright (C) 2021, 2022 intirain.
  4. *
  5. * This file is part of xnix.
  6. *
  7. * XNIX is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * XNIX is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with XNIX. If not, see <https://www.gnu.org/licenses/>
  19. */
  20. #ifndef __TYPES_H
  21. #define __TYPES_H
  22. /*
  23. * this file defines all types of intergers (not include 128-bits),
  24. * in kernel hacking you should use these types, not use raw C types */
  25. /*
  26. * and, you should not use those 64-bit intergers, because xnix will
  27. * (okay, I mean, evx)
  28. * run on some 32-bit machines too.
  29. * */
  30. #ifndef __ASSEMBLER__
  31. /* signed intergers */
  32. typedef signed char __int8_t;
  33. typedef signed char __sint8_t;
  34. typedef signed char __schar_t;
  35. typedef short signed int __int16_t;
  36. typedef short signed int __sint16_t;
  37. typedef signed int __int32_t;
  38. typedef signed int __sint32_t;
  39. typedef long signed int __int64_t;
  40. typedef long signed int __sint64_t;
  41. /* and, unsigneds */
  42. typedef unsigned char __uint8_t;
  43. typedef unsigned char __uchar_t;
  44. typedef short unsigned int __uint16_t;
  45. typedef unsigned int __uint32_t;
  46. typedef long unsigned int __uint64_t;
  47. typedef __uint16_t __gid_t;
  48. typedef __uint32_t __uid_t;
  49. typedef __uint32_t __ref_t;
  50. typedef __uint32_t __dev_t;
  51. typedef __int8_t s8;
  52. typedef __int16_t s16;
  53. typedef __int32_t s32;
  54. typedef __int64_t s64;
  55. typedef __uint8_t u8;
  56. typedef __uint16_t u16;
  57. typedef __uint32_t u32;
  58. typedef __uint64_t u64;
  59. #endif
  60. #endif