OSDN Git Service

MIPS: mipsregs.h: Add read const Cop0 macros
authorJames Hogan <jhogan@kernel.org>
Mon, 11 Dec 2017 16:13:14 +0000 (16:13 +0000)
committerJames Hogan <jhogan@kernel.org>
Tue, 9 Jan 2018 22:26:16 +0000 (22:26 +0000)
commitcd1e0737efcaa0889810216cb01017d97f83c5e0
tree10775df7e6c3e7345ba10381b65bd6695cee38f7
parentffe1f9356fbe55df7dd7f7f6b050ee8b7136611f
MIPS: mipsregs.h: Add read const Cop0 macros

Some Cop0 registers are constant and have no side effects when read.
There is no need for the inline asm to read these to be marked
__volatile__, and doing so prevents them from being removed by the
compiler.

Add a few new accessor macros to handle these registers more efficiently
(especially for the sake of running in a guest where redundant access to
the register may trap to the hypervisor):
  __read_const_32bit_c0_register()
  __read_const_64bit_c0_register()
  __read_const_ulong_c0_register()

Signed-off-by: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Maciej W. Rozycki <macro@mips.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17922/
arch/mips/include/asm/mipsregs.h