Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: spaces: Define a couple of handy macros

Define CKSEGX_SIZE to represent the size of each KSEG segment.

Introduce CKSEG0ADDR_OR_64BIT and CKSEG1ADDR_OR_64BIT to get an XPHYS
address in 64bits and CKSEG[01]ADDR() in 32 bits mode.

Co-developed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Gregory CLEMENT and committed by
Thomas Bogendoerfer
e40192da 6d74e0fc

+9
+5
arch/mips/include/asm/addrspace.h
··· 48 48 #define KSEGX(a) ((_ACAST32_(a)) & _ACAST32_(0xe0000000)) 49 49 50 50 /* 51 + * Gives the size of each kernel segment 52 + */ 53 + #define CSEGX_SIZE 0x20000000 54 + 55 + /* 51 56 * Returns the physical address of a CKSEGx / XKPHYS address 52 57 */ 53 58 #define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff)
+4
arch/mips/include/asm/mach-generic/spaces.h
··· 49 49 #define HIGHMEM_START _AC(0x20000000, UL) 50 50 #endif 51 51 52 + #define CKSEG0ADDR_OR_64BIT(x) CKSEG0ADDR(x) 53 + #define CKSEG1ADDR_OR_64BIT(x) CKSEG1ADDR(x) 52 54 #endif /* CONFIG_32BIT */ 53 55 54 56 #ifdef CONFIG_64BIT ··· 84 82 #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) 85 83 #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) 86 84 85 + #define CKSEG0ADDR_OR_64BIT(x) TO_CAC(x) 86 + #define CKSEG1ADDR_OR_64BIT(x) TO_UNCAC(x) 87 87 #endif /* CONFIG_64BIT */ 88 88 89 89 /*