types.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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__) && !defined(__STRICT_ANSI__)
  24. typedef __signed__ long long __s64;
  25. 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. #include <linux/config.h>
  48. typedef signed char s8;
  49. typedef unsigned char u8;
  50. typedef signed short s16;
  51. typedef unsigned short u16;
  52. typedef signed int s32;
  53. typedef unsigned int u32;
  54. #ifndef __s390x__
  55. typedef signed long long s64;
  56. typedef unsigned long long u64;
  57. #else /* __s390x__ */
  58. typedef signed long s64;
  59. typedef unsigned long u64;
  60. #endif /* __s390x__ */
  61. typedef u32 dma_addr_t;
  62. #ifndef __s390x__
  63. typedef union {
  64. unsigned long long pair;
  65. struct {
  66. unsigned long even;
  67. unsigned long odd;
  68. } subreg;
  69. } register_pair;
  70. #ifdef CONFIG_LBD
  71. typedef u64 sector_t;
  72. #define HAVE_SECTOR_T
  73. #endif
  74. #ifdef CONFIG_LSF
  75. typedef u64 blkcnt_t;
  76. #define HAVE_BLKCNT_T
  77. #endif
  78. #endif /* ! __s390x__ */
  79. #endif /* __ASSEMBLY__ */
  80. #endif /* __KERNEL__ */
  81. #endif /* _S390_TYPES_H */