diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2009-03-23 17:14:55 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-03-23 18:38:05 -0400 |
commit | 89e18eb331cc83fb4923bbc9a93beb5cb53eca0a (patch) | |
tree | 54e28511115d2d58d5f1615184967e0fe2e388a1 /arch/mips | |
parent | 5484879c0a50de7f60d403d375faff41cbd4ab01 (diff) |
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>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/include/asm/mipsregs.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 0417516503f6..526f327475ce 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) | |||
1391 | static inline unsigned int \ | 1391 | static inline unsigned int \ |
1392 | set_c0_##name(unsigned int set) \ | 1392 | set_c0_##name(unsigned int set) \ |
1393 | { \ | 1393 | { \ |
1394 | unsigned int res; \ | 1394 | unsigned int res, new; \ |
1395 | \ | 1395 | \ |
1396 | res = read_c0_##name(); \ | 1396 | res = read_c0_##name(); \ |
1397 | res |= set; \ | 1397 | new = res | set; \ |
1398 | write_c0_##name(res); \ | 1398 | write_c0_##name(new); \ |
1399 | \ | 1399 | \ |
1400 | return res; \ | 1400 | return res; \ |
1401 | } \ | 1401 | } \ |
@@ -1403,24 +1403,24 @@ set_c0_##name(unsigned int set) \ | |||
1403 | static inline unsigned int \ | 1403 | static inline unsigned int \ |
1404 | clear_c0_##name(unsigned int clear) \ | 1404 | clear_c0_##name(unsigned int clear) \ |
1405 | { \ | 1405 | { \ |
1406 | unsigned int res; \ | 1406 | unsigned int res, new; \ |
1407 | \ | 1407 | \ |
1408 | res = read_c0_##name(); \ | 1408 | res = read_c0_##name(); \ |
1409 | res &= ~clear; \ | 1409 | new = res & ~clear; \ |
1410 | write_c0_##name(res); \ | 1410 | write_c0_##name(new); \ |
1411 | \ | 1411 | \ |
1412 | return res; \ | 1412 | return res; \ |
1413 | } \ | 1413 | } \ |
1414 | \ | 1414 | \ |
1415 | static inline unsigned int \ | 1415 | static inline unsigned int \ |
1416 | change_c0_##name(unsigned int change, unsigned int new) \ | 1416 | change_c0_##name(unsigned int change, unsigned int val) \ |
1417 | { \ | 1417 | { \ |
1418 | unsigned int res; \ | 1418 | unsigned int res, new; \ |
1419 | \ | 1419 | \ |
1420 | res = read_c0_##name(); \ | 1420 | res = read_c0_##name(); \ |
1421 | res &= ~change; \ | 1421 | new = res & ~change; \ |
1422 | res |= (new & change); \ | 1422 | new |= (val & change); \ |
1423 | write_c0_##name(res); \ | 1423 | write_c0_##name(new); \ |
1424 | \ | 1424 | \ |
1425 | return res; \ | 1425 | return res; \ |
1426 | } | 1426 | } |