types.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #ifndef _ASM_POWERPC_TYPES_H
  2. #define _ASM_POWERPC_TYPES_H
  3. #ifndef __ASSEMBLY__
  4. /*
  5. * This file is never included by application software unless
  6. * explicitly requested (e.g., via linux/types.h) in which case the
  7. * application is Linux specific so (user-) name space pollution is
  8. * not a major issue. However, for interoperability, libraries still
  9. * need to be careful to avoid a name clashes.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License
  13. * as published by the Free Software Foundation; either version
  14. * 2 of the License, or (at your option) any later version.
  15. */
  16. #ifdef __powerpc64__
  17. typedef unsigned int umode_t;
  18. #else
  19. typedef unsigned short umode_t;
  20. #endif
  21. /*
  22. * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
  23. * header files exported to user space
  24. */
  25. typedef __signed__ char __s8;
  26. typedef unsigned char __u8;
  27. typedef __signed__ short __s16;
  28. typedef unsigned short __u16;
  29. typedef __signed__ int __s32;
  30. typedef unsigned int __u32;
  31. #ifdef __powerpc64__
  32. typedef __signed__ long __s64;
  33. typedef unsigned long __u64;
  34. #else
  35. #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
  36. typedef __signed__ long long __s64;
  37. typedef unsigned long long __u64;
  38. #endif
  39. #endif /* __powerpc64__ */
  40. typedef struct {
  41. __u32 u[4];
  42. } __attribute__((aligned(16))) __vector128;
  43. #endif /* __ASSEMBLY__ */
  44. #ifdef __KERNEL__
  45. /*
  46. * These aren't exported outside the kernel to avoid name space clashes
  47. */
  48. #ifdef __powerpc64__
  49. #define BITS_PER_LONG 64
  50. #else
  51. #define BITS_PER_LONG 32
  52. #endif
  53. #ifndef __ASSEMBLY__
  54. typedef signed char s8;
  55. typedef unsigned char u8;
  56. typedef signed short s16;
  57. typedef unsigned short u16;
  58. typedef signed int s32;
  59. typedef unsigned int u32;
  60. #ifdef __powerpc64__
  61. typedef signed long s64;
  62. typedef unsigned long u64;
  63. #else
  64. typedef signed long long s64;
  65. typedef unsigned long long u64;
  66. #endif
  67. typedef __vector128 vector128;
  68. #ifdef __powerpc64__
  69. typedef u64 dma_addr_t;
  70. #else
  71. typedef u32 dma_addr_t;
  72. #endif
  73. typedef u64 dma64_addr_t;
  74. typedef struct {
  75. unsigned long entry;
  76. unsigned long toc;
  77. unsigned long env;
  78. } func_descr_t;
  79. #endif /* __ASSEMBLY__ */
  80. #endif /* __KERNEL__ */
  81. #endif /* _ASM_POWERPC_TYPES_H */