Path: blob/master/arch/m32r/include/asm/addrspace.h
10818 views
/*1* This file is subject to the terms and conditions of the GNU General Public2* License. See the file "COPYING" in the main directory of this archive3* for more details.4*5* Copyright (C) 2001 by Hiroyuki Kondo6*7* Defitions for the address spaces of the M32R CPUs.8*/9#ifndef __ASM_M32R_ADDRSPACE_H10#define __ASM_M32R_ADDRSPACE_H1112/*13* Memory segments (32bit kernel mode addresses)14*/15#define KUSEG 0x0000000016#define KSEG0 0x8000000017#define KSEG1 0xa000000018#define KSEG2 0xc000000019#define KSEG3 0xe00000002021#define K0BASE KSEG02223/*24* Returns the kernel segment base of a given address25*/26#ifndef __ASSEMBLY__27#define KSEGX(a) (((unsigned long)(a)) & 0xe0000000)28#else29#define KSEGX(a) ((a) & 0xe0000000)30#endif3132/*33* Returns the physical address of a KSEG0/KSEG1 address34*/35#ifndef __ASSEMBLY__36#define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff)37#else38#define PHYSADDR(a) ((a) & 0x1fffffff)39#endif4041/*42* Map an address to a certain kernel segment43*/44#ifndef __ASSEMBLY__45#define KSEG0ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG0))46#define KSEG1ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG1))47#define KSEG2ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG2))48#define KSEG3ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG3))49#else50#define KSEG0ADDR(a) (((a) & 0x1fffffff) | KSEG0)51#define KSEG1ADDR(a) (((a) & 0x1fffffff) | KSEG1)52#define KSEG2ADDR(a) (((a) & 0x1fffffff) | KSEG2)53#define KSEG3ADDR(a) (((a) & 0x1fffffff) | KSEG3)54#endif5556#endif /* __ASM_M32R_ADDRSPACE_H */575859