diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2001-03-11 21:52:24 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2001-03-11 21:52:24 +0000 |
commit | 34b560ff2837a78a20af84d332d59ea8a68f277e (patch) | |
tree | f6f438e7d29711555e773c6db0200f5d11bc25ad /include/asm-mips | |
parent | dd422013dc7f307f70a893fcf18b95c47b144823 (diff) |
Replace set_cp0_status / set_cp0_config by three functions, clear_cp0_*,
set_cp0_* and change_cp0_* which makes the kernel code somewhat more
readable. Going through the kernel code I notices some stupid abuse of
the old function like set_cp0_status(ST0_BEV, 1) - this clear ST0_BEV
but actually looks like attempting to set it and other abuses, so will
people please look over their code again.
Diffstat (limited to 'include/asm-mips')
-rw-r--r-- | include/asm-mips/mipsregs.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index c5d8ac759..9692eb57a 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1994, 1995, 1996, 1997, 2000 by Ralf Baechle + * Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001 by Ralf Baechle * Copyright (C) 2000 Silicon Graphics, Inc. * Modified for further R[236]000 support by Paul M. Antoine, 1996. * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com @@ -238,7 +238,31 @@ */ #define __BUILD_SET_CP0(name,register) \ extern __inline__ unsigned int \ -set_cp0_##name(unsigned int change, unsigned int new) \ +set_cp0_##name(unsigned int set) \ +{ \ + unsigned int res; \ + \ + res = read_32bit_cp0_register(register); \ + res |= ~set; \ + write_32bit_cp0_register(register, res); \ + \ + return res; \ +} \ + \ +extern __inline__ unsigned int \ +clear_cp0_##name(unsigned int clear) \ +{ \ + unsigned int res; \ + \ + res = read_32bit_cp0_register(register); \ + res &= ~clear; \ + write_32bit_cp0_register(register, res); \ + \ + return res; \ +} \ + \ +extern __inline__ unsigned int \ +change_cp0_##name(unsigned int change, unsigned int new) \ { \ unsigned int res; \ \ |