types.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
  7. * Copyright (C) 1999 Silicon Graphics, Inc.
  8. */
  9. #ifndef _ASM_TYPES_H
  10. #define _ASM_TYPES_H
  11. #ifndef __ASSEMBLY__
  12. typedef unsigned short umode_t;
  13. /*
  14. * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
  15. * header files exported to user space
  16. */
  17. typedef __signed__ char __s8;
  18. typedef unsigned char __u8;
  19. typedef __signed__ short __s16;
  20. typedef unsigned short __u16;
  21. typedef __signed__ int __s32;
  22. typedef unsigned int __u32;
  23. #if (_MIPS_SZLONG == 64)
  24. typedef __signed__ long __s64;
  25. typedef unsigned long __u64;
  26. #else
  27. #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
  28. typedef __signed__ long long __s64;
  29. typedef unsigned long long __u64;
  30. #endif
  31. #endif
  32. #endif /* __ASSEMBLY__ */
  33. /*
  34. * These aren't exported outside the kernel to avoid name space clashes
  35. */
  36. #ifdef __KERNEL__
  37. #define BITS_PER_LONG _MIPS_SZLONG
  38. #ifndef __ASSEMBLY__
  39. #include <linux/config.h>
  40. typedef __signed char s8;
  41. typedef unsigned char u8;
  42. typedef __signed short s16;
  43. typedef unsigned short u16;
  44. typedef __signed int s32;
  45. typedef unsigned int u32;
  46. #if (_MIPS_SZLONG == 64)
  47. typedef __signed__ long s64;
  48. typedef unsigned long u64;
  49. #else
  50. #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
  51. typedef __signed__ long long s64;
  52. typedef unsigned long long u64;
  53. #endif
  54. #endif
  55. #if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
  56. || defined(CONFIG_64BIT)
  57. typedef u64 dma_addr_t;
  58. #else
  59. typedef u32 dma_addr_t;
  60. #endif
  61. typedef u64 dma64_addr_t;
  62. /*
  63. * Don't use phys_t. You've been warned.
  64. */
  65. #ifdef CONFIG_64BIT_PHYS_ADDR
  66. typedef unsigned long long phys_t;
  67. #else
  68. typedef unsigned long phys_t;
  69. #endif
  70. #ifdef CONFIG_LBD
  71. typedef u64 sector_t;
  72. #define HAVE_SECTOR_T
  73. #endif
  74. #endif /* __ASSEMBLY__ */
  75. #endif /* __KERNEL__ */
  76. #endif /* _ASM_TYPES_H */