Commit 8e798706 authored by Russell King's avatar Russell King

ARM: domains: provide domain_mask()

Provide a macro to generate the mask for a domain, rather than using
domain_val(, DOMAIN_MANAGER) which won't work when CPU_USE_DOMAINS
is turned off.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 1eef5d2f
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
#define DOMAIN_MANAGER 1 #define DOMAIN_MANAGER 1
#endif #endif
#define domain_val(dom,type) ((type) << (2*(dom))) #define domain_mask(dom) ((3) << (2 * (dom)))
#define domain_val(dom,type) ((type) << (2 * (dom)))
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
...@@ -82,7 +83,7 @@ static inline void set_domain(unsigned val) ...@@ -82,7 +83,7 @@ static inline void set_domain(unsigned val)
#define modify_domain(dom,type) \ #define modify_domain(dom,type) \
do { \ do { \
unsigned int domain = get_domain(); \ unsigned int domain = get_domain(); \
domain &= ~domain_val(dom, DOMAIN_MANAGER); \ domain &= ~domain_mask(dom); \
domain = domain | domain_val(dom, type); \ domain = domain | domain_val(dom, type); \
set_domain(domain); \ set_domain(domain); \
} while (0) } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment