types.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. * run on some 32-bit machines too.
  26. * */
  27. #ifndef __ASSEMBLER__
  28. /* signed intergers */
  29. typedef signed char __int8_t;
  30. typedef signed char __sint8_t;
  31. typedef signed char __schar_t;
  32. typedef short signed int __int16_t;
  33. typedef short signed int __sint16_t;
  34. typedef signed int __int32_t;
  35. typedef signed int __sint32_t;
  36. typedef long signed int __int64_t;
  37. typedef long signed int __sint64_t;
  38. /* and, unsigneds */
  39. typedef unsigned char __uint8_t;
  40. typedef unsigned char __uchar_t;
  41. typedef short unsigned int __uint16_t;
  42. typedef unsigned int __uint32_t;
  43. typedef long unsigned int __uint64_t;
  44. typedef __uint16_t __gid_t;
  45. typedef __uint32_t __uid_t;
  46. typedef __uint32_t __ref_t;
  47. typedef __uint32_t __dev_t;
  48. #endif
  49. #endif