summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2009-03-23 22:14:55 +0100
committerRalf Baechle <ralf@linux-mips.org>2009-03-23 23:38:05 +0100
commit89e18eb331cc83fb4923bbc9a93beb5cb53eca0a (patch)
tree54e28511115d2d58d5f1615184967e0fe2e388a1
parent5484879c0a50de7f60d403d375faff41cbd4ab01 (diff)
downloadop-kernel-dev-89e18eb331cc83fb4923bbc9a93beb5cb53eca0a.zip
op-kernel-dev-89e18eb331cc83fb4923bbc9a93beb5cb53eca0a.tar.gz
MIPS: Change {set,clear,change}_c0_<foo> to return old value.
This is more standard and useful and need for the following fix to work correctly. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/include/asm/mipsregs.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 0417516..526f327 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -1391,11 +1391,11 @@ static inline void tlb_write_random(void)
static inline unsigned int \
set_c0_##name(unsigned int set) \
{ \
- unsigned int res; \
+ unsigned int res, new; \
\
res = read_c0_##name(); \
- res |= set; \
- write_c0_##name(res); \
+ new = res | set; \
+ write_c0_##name(new); \
\
return res; \
} \
@@ -1403,24 +1403,24 @@ set_c0_##name(unsigned int set) \
static inline unsigned int \
clear_c0_##name(unsigned int clear) \
{ \
- unsigned int res; \
+ unsigned int res, new; \
\
res = read_c0_##name(); \
- res &= ~clear; \
- write_c0_##name(res); \
+ new = res & ~clear; \
+ write_c0_##name(new); \
\
return res; \
} \
\
static inline unsigned int \
-change_c0_##name(unsigned int change, unsigned int new) \
+change_c0_##name(unsigned int change, unsigned int val) \
{ \
- unsigned int res; \
+ unsigned int res, new; \
\
res = read_c0_##name(); \
- res &= ~change; \
- res |= (new & change); \
- write_c0_##name(res); \
+ new = res & ~change; \
+ new |= (val & change); \
+ write_c0_##name(new); \
\
return res; \
}
OpenPOWER on IntegriCloud