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>
This commit is contained in:
parent
5484879c0a
commit
89e18eb331
|
@ -1391,11 +1391,11 @@ static inline void tlb_write_random(void)
|
||||||
static inline unsigned int \
|
static inline unsigned int \
|
||||||
set_c0_##name(unsigned int set) \
|
set_c0_##name(unsigned int set) \
|
||||||
{ \
|
{ \
|
||||||
unsigned int res; \
|
unsigned int res, new; \
|
||||||
\
|
\
|
||||||
res = read_c0_##name(); \
|
res = read_c0_##name(); \
|
||||||
res |= set; \
|
new = res | set; \
|
||||||
write_c0_##name(res); \
|
write_c0_##name(new); \
|
||||||
\
|
\
|
||||||
return res; \
|
return res; \
|
||||||
} \
|
} \
|
||||||
|
@ -1403,24 +1403,24 @@ set_c0_##name(unsigned int set) \
|
||||||
static inline unsigned int \
|
static inline unsigned int \
|
||||||
clear_c0_##name(unsigned int clear) \
|
clear_c0_##name(unsigned int clear) \
|
||||||
{ \
|
{ \
|
||||||
unsigned int res; \
|
unsigned int res, new; \
|
||||||
\
|
\
|
||||||
res = read_c0_##name(); \
|
res = read_c0_##name(); \
|
||||||
res &= ~clear; \
|
new = res & ~clear; \
|
||||||
write_c0_##name(res); \
|
write_c0_##name(new); \
|
||||||
\
|
\
|
||||||
return res; \
|
return res; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline unsigned int \
|
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 = read_c0_##name(); \
|
||||||
res &= ~change; \
|
new = res & ~change; \
|
||||||
res |= (new & change); \
|
new |= (val & change); \
|
||||||
write_c0_##name(res); \
|
write_c0_##name(new); \
|
||||||
\
|
\
|
||||||
return res; \
|
return res; \
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue