types.h 1.9 KB

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