types.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef _ASM_POWERPC_TYPES_H
  2. #define _ASM_POWERPC_TYPES_H
  3. #ifdef __powerpc64__
  4. # include <asm-generic/int-l64.h>
  5. #else
  6. # include <asm-generic/int-ll64.h>
  7. #endif
  8. #ifndef __ASSEMBLY__
  9. /*
  10. * This file is never included by application software unless
  11. * explicitly requested (e.g., via linux/types.h) in which case the
  12. * application is Linux specific so (user-) name space pollution is
  13. * not a major issue. However, for interoperability, libraries still
  14. * need to be careful to avoid a name clashes.
  15. *
  16. * This program is free software; you can redistribute it and/or
  17. * modify it under the terms of the GNU General Public License
  18. * as published by the Free Software Foundation; either version
  19. * 2 of the License, or (at your option) any later version.
  20. */
  21. #ifdef __powerpc64__
  22. typedef unsigned int umode_t;
  23. #else
  24. typedef unsigned short umode_t;
  25. #endif
  26. typedef struct {
  27. __u32 u[4];
  28. } __attribute__((aligned(16))) __vector128;
  29. #endif /* __ASSEMBLY__ */
  30. #ifdef __KERNEL__
  31. /*
  32. * These aren't exported outside the kernel to avoid name space clashes
  33. */
  34. #ifdef __powerpc64__
  35. #define BITS_PER_LONG 64
  36. #else
  37. #define BITS_PER_LONG 32
  38. #endif
  39. #ifndef __ASSEMBLY__
  40. typedef __vector128 vector128;
  41. /* Physical address used by some IO functions */
  42. #if defined(CONFIG_PPC64) || defined(CONFIG_PHYS_64BIT)
  43. typedef u64 phys_addr_t;
  44. #else
  45. typedef u32 phys_addr_t;
  46. #endif
  47. #ifdef __powerpc64__
  48. typedef u64 dma_addr_t;
  49. #else
  50. typedef u32 dma_addr_t;
  51. #endif
  52. typedef u64 dma64_addr_t;
  53. typedef struct {
  54. unsigned long entry;
  55. unsigned long toc;
  56. unsigned long env;
  57. } func_descr_t;
  58. #endif /* __ASSEMBLY__ */
  59. #endif /* __KERNEL__ */
  60. #endif /* _ASM_POWERPC_TYPES_H */