types.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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__)
  28. __extension__ typedef __signed__ long long __s64;
  29. __extension__ 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. typedef __signed char s8;
  40. typedef unsigned char u8;
  41. typedef __signed short s16;
  42. typedef unsigned short u16;
  43. typedef __signed int s32;
  44. typedef unsigned int u32;
  45. #if (_MIPS_SZLONG == 64)
  46. typedef __signed__ long s64;
  47. typedef unsigned long u64;
  48. #else
  49. #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
  50. typedef __signed__ long long s64;
  51. typedef unsigned long long u64;
  52. #endif
  53. #endif
  54. #if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
  55. || defined(CONFIG_64BIT)
  56. typedef u64 dma_addr_t;
  57. #else
  58. typedef u32 dma_addr_t;
  59. #endif
  60. typedef u64 dma64_addr_t;
  61. /*
  62. * Don't use phys_t. You've been warned.
  63. */
  64. #ifdef CONFIG_64BIT_PHYS_ADDR
  65. typedef unsigned long long phys_t;
  66. #else
  67. typedef unsigned long phys_t;
  68. #endif
  69. #endif /* __ASSEMBLY__ */
  70. #endif /* __KERNEL__ */
  71. #endif /* _ASM_TYPES_H */