domain.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * linux/include/asm-arm/domain.h
  3. *
  4. * Copyright (C) 1999 Russell King.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASM_PROC_DOMAIN_H
  11. #define __ASM_PROC_DOMAIN_H
  12. /*
  13. * Domain numbers
  14. *
  15. * DOMAIN_IO - domain 2 includes all IO only
  16. * DOMAIN_USER - domain 1 includes all user memory only
  17. * DOMAIN_KERNEL - domain 0 includes all kernel memory only
  18. */
  19. #define DOMAIN_KERNEL 0
  20. #define DOMAIN_TABLE 0
  21. #define DOMAIN_USER 1
  22. #define DOMAIN_IO 2
  23. /*
  24. * Domain types
  25. */
  26. #define DOMAIN_NOACCESS 0
  27. #define DOMAIN_CLIENT 1
  28. #define DOMAIN_MANAGER 3
  29. #define domain_val(dom,type) ((type) << (2*(dom)))
  30. #ifndef __ASSEMBLY__
  31. #define set_domain(x) \
  32. do { \
  33. __asm__ __volatile__( \
  34. "mcr p15, 0, %0, c3, c0 @ set domain" \
  35. : : "r" (x)); \
  36. } while (0)
  37. #define modify_domain(dom,type) \
  38. do { \
  39. struct thread_info *thread = current_thread_info(); \
  40. unsigned int domain = thread->cpu_domain; \
  41. domain &= ~domain_val(dom, DOMAIN_MANAGER); \
  42. thread->cpu_domain = domain | domain_val(dom, type); \
  43. set_domain(thread->cpu_domain); \
  44. } while (0)
  45. #endif
  46. #endif /* !__ASSEMBLY__ */