diff options
author | Paul Burton <paul.burton@imgtec.com> | 2014-02-14 09:27:15 +0000 |
---|---|---|
committer | Paul Burton <paul.burton@imgtec.com> | 2014-05-02 16:39:14 +0100 |
commit | 2ba60250b01bfbab6b2293f8c1492312eb6a4131 (patch) | |
tree | 1ed554041a92a7e0fd68e96ab43a7e3b5f305b57 /arch/mips/include/asm/mips-cpc.h | |
parent | 76306f4272e036e600254a98bc291df50cedd949 (diff) | |
download | lwn-2ba60250b01bfbab6b2293f8c1492312eb6a4131.tar.gz lwn-2ba60250b01bfbab6b2293f8c1492312eb6a4131.zip |
MIPS: CPC: provide functions to retrieve register addresses
This patch introduces addr_ functions in addition to the existing read_
& write_ functions. The new functions simply return the address of the
appropriate CPC register rather than performing a memory access. This
will be used in a subsequent patch.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Diffstat (limited to 'arch/mips/include/asm/mips-cpc.h')
-rw-r--r-- | arch/mips/include/asm/mips-cpc.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/mips/include/asm/mips-cpc.h b/arch/mips/include/asm/mips-cpc.h index 988507e46d42..c5bb609c4b97 100644 --- a/arch/mips/include/asm/mips-cpc.h +++ b/arch/mips/include/asm/mips-cpc.h @@ -72,7 +72,12 @@ static inline bool mips_cpc_present(void) #define MIPS_CPC_COCB_OFS 0x4000 /* Macros to ease the creation of register access functions */ -#define BUILD_CPC_R_(name, off) \ +#define BUILD_CPC_R_(name, off) \ +static inline u32 *addr_cpc_##name(void) \ +{ \ + return (u32 *)(mips_cpc_base + (off)); \ +} \ + \ static inline u32 read_cpc_##name(void) \ { \ return __raw_readl(mips_cpc_base + (off)); \ |