types.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef _ASM_X86_TYPES_H
  2. #define _ASM_X86_TYPES_H
  3. #ifndef __ASSEMBLY__
  4. typedef unsigned short umode_t;
  5. /*
  6. * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
  7. * header files exported to user space
  8. */
  9. typedef __signed__ char __s8;
  10. typedef unsigned char __u8;
  11. typedef __signed__ short __s16;
  12. typedef unsigned short __u16;
  13. typedef __signed__ int __s32;
  14. typedef unsigned int __u32;
  15. #ifdef __i386__
  16. # ifdef __GNUC__
  17. __extension__ typedef __signed__ long long __s64;
  18. __extension__ typedef unsigned long long __u64;
  19. # endif
  20. #else
  21. typedef __signed__ long long __s64;
  22. typedef unsigned long long __u64;
  23. #endif
  24. #endif /* __ASSEMBLY__ */
  25. /*
  26. * These aren't exported outside the kernel to avoid name space clashes
  27. */
  28. #ifdef __KERNEL__
  29. #ifdef CONFIG_X86_32
  30. # define BITS_PER_LONG 32
  31. #else
  32. # define BITS_PER_LONG 64
  33. #endif
  34. #ifndef __ASSEMBLY__
  35. typedef signed char s8;
  36. typedef unsigned char u8;
  37. typedef signed short s16;
  38. typedef unsigned short u16;
  39. typedef signed int s32;
  40. typedef unsigned int u32;
  41. typedef signed long long s64;
  42. typedef unsigned long long u64;
  43. typedef u64 dma64_addr_t;
  44. #if defined(CONFIG_X86_64) || defined(CONFIG_HIGHMEM64G)
  45. /* DMA addresses come in 32-bit and 64-bit flavours. */
  46. typedef u64 dma_addr_t;
  47. #else
  48. typedef u32 dma_addr_t;
  49. #endif
  50. #endif /* __ASSEMBLY__ */
  51. #endif /* __KERNEL__ */
  52. #endif