types.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (c) 2011 The Chromium OS Authors.
  4. */
  5. #ifndef __ASM_SANDBOX_TYPES_H
  6. #define __ASM_SANDBOX_TYPES_H
  7. typedef unsigned short umode_t;
  8. /*
  9. * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
  10. * header files exported to user space
  11. */
  12. typedef __signed__ char __s8;
  13. typedef unsigned char __u8;
  14. typedef __signed__ short __s16;
  15. typedef unsigned short __u16;
  16. typedef __signed__ int __s32;
  17. typedef unsigned int __u32;
  18. #if defined(__GNUC__)
  19. __extension__ typedef __signed__ long long __s64;
  20. __extension__ typedef unsigned long long __u64;
  21. #endif
  22. /*
  23. * These aren't exported outside the kernel to avoid name space clashes
  24. */
  25. #ifdef __KERNEL__
  26. typedef signed char s8;
  27. typedef unsigned char u8;
  28. typedef signed short s16;
  29. typedef unsigned short u16;
  30. typedef signed int s32;
  31. typedef unsigned int u32;
  32. typedef signed long long s64;
  33. typedef unsigned long long u64;
  34. /*
  35. * Number of bits in a C 'long' on this architecture.
  36. */
  37. #ifdef CONFIG_PHYS64
  38. #define BITS_PER_LONG 64
  39. #else /* CONFIG_PHYS64 */
  40. #define BITS_PER_LONG 32
  41. #endif /* CONFIG_PHYS64 */
  42. #ifdef CONFIG_PHYS64
  43. typedef unsigned long long dma_addr_t;
  44. typedef u64 phys_addr_t;
  45. typedef u64 phys_size_t;
  46. #else /* CONFIG_PHYS64 */
  47. typedef unsigned long dma_addr_t;
  48. typedef u32 phys_addr_t;
  49. typedef u32 phys_size_t;
  50. #endif /* CONFIG_PHYS64 */
  51. #endif /* __KERNEL__ */
  52. #endif