[TG3]: Add tagged status support.
[linux-2.6/verdex.git] / include / asm-arm / domain.h
blobda1d960387d9880f2fa602b028aca633719fc3f0
1 /*
2 * linux/include/asm-arm/domain.h
4 * Copyright (C) 1999 Russell King.
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
14 * Domain numbers
16 * DOMAIN_IO - domain 2 includes all IO only
17 * DOMAIN_USER - domain 1 includes all user memory only
18 * DOMAIN_KERNEL - domain 0 includes all kernel memory only
20 #define DOMAIN_KERNEL 0
21 #define DOMAIN_TABLE 0
22 #define DOMAIN_USER 1
23 #define DOMAIN_IO 2
26 * Domain types
28 #define DOMAIN_NOACCESS 0
29 #define DOMAIN_CLIENT 1
30 #define DOMAIN_MANAGER 3
32 #define domain_val(dom,type) ((type) << (2*(dom)))
34 #ifndef __ASSEMBLY__
35 #define set_domain(x) \
36 do { \
37 __asm__ __volatile__( \
38 "mcr p15, 0, %0, c3, c0 @ set domain" \
39 : : "r" (x)); \
40 } while (0)
42 #define modify_domain(dom,type) \
43 do { \
44 struct thread_info *thread = current_thread_info(); \
45 unsigned int domain = thread->cpu_domain; \
46 domain &= ~domain_val(dom, DOMAIN_MANAGER); \
47 thread->cpu_domain = domain | domain_val(dom, type); \
48 set_domain(thread->cpu_domain); \
49 } while (0)
51 #endif
52 #endif /* !__ASSEMBLY__ */