types.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * include/asm-s390/types.h
  3. *
  4. * S390 version
  5. *
  6. * Derived from "include/asm-i386/types.h"
  7. */
  8. #ifndef _S390_TYPES_H
  9. #define _S390_TYPES_H
  10. #ifndef __ASSEMBLY__
  11. typedef unsigned short umode_t;
  12. /*
  13. * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
  14. * header files exported to user space
  15. */
  16. typedef __signed__ char __s8;
  17. typedef unsigned char __u8;
  18. typedef __signed__ short __s16;
  19. typedef unsigned short __u16;
  20. typedef __signed__ int __s32;
  21. typedef unsigned int __u32;
  22. #ifndef __s390x__
  23. #if defined(__GNUC__)
  24. __extension__ typedef __signed__ long long __s64;
  25. __extension__ typedef unsigned long long __u64;
  26. #endif
  27. #else /* __s390x__ */
  28. typedef __signed__ long __s64;
  29. typedef unsigned long __u64;
  30. #endif
  31. /* A address type so that arithmetic can be done on it & it can be upgraded to
  32. 64 bit when necessary
  33. */
  34. typedef unsigned long addr_t;
  35. typedef __signed__ long saddr_t;
  36. #endif /* __ASSEMBLY__ */
  37. /*
  38. * These aren't exported outside the kernel to avoid name space clashes
  39. */
  40. #ifdef __KERNEL__
  41. #ifndef __s390x__
  42. #define BITS_PER_LONG 32
  43. #else
  44. #define BITS_PER_LONG 64
  45. #endif
  46. #ifndef __ASSEMBLY__
  47. typedef signed char s8;
  48. typedef unsigned char u8;
  49. typedef signed short s16;
  50. typedef unsigned short u16;
  51. typedef signed int s32;
  52. typedef unsigned int u32;
  53. #ifndef __s390x__
  54. typedef signed long long s64;
  55. typedef unsigned long long u64;
  56. #else /* __s390x__ */
  57. typedef signed long s64;
  58. typedef unsigned long u64;
  59. #endif /* __s390x__ */
  60. typedef u32 dma_addr_t;
  61. #ifndef __s390x__
  62. typedef union {
  63. unsigned long long pair;
  64. struct {
  65. unsigned long even;
  66. unsigned long odd;
  67. } subreg;
  68. } register_pair;
  69. #endif /* ! __s390x__ */
  70. #endif /* __ASSEMBLY__ */
  71. #endif /* __KERNEL__ */
  72. #endif /* _S390_TYPES_H */