/*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) 1999 by Kaz Kojima6*7* Defitions for the address spaces of the SH CPUs.8*/9#ifndef __ASM_SH_ADDRSPACE_H10#define __ASM_SH_ADDRSPACE_H1112#ifdef __KERNEL__1314#include <cpu/addrspace.h>1516/* If this CPU supports segmentation, hook up the helpers */17#ifdef P1SEG1819/*20[ P0/U0 (virtual) ] 0x00000000 <------ User space21[ P1 (fixed) cached ] 0x80000000 <------ Kernel space22[ P2 (fixed) non-cachable] 0xA0000000 <------ Physical access23[ P3 (virtual) cached] 0xC0000000 <------ vmalloced area24[ P4 control ] 0xE000000025*/2627/* Returns the privileged segment base of a given address */28#define PXSEG(a) (((unsigned long)(a)) & 0xe0000000)2930#ifdef CONFIG_29BIT31/*32* Map an address to a certain privileged segment33*/34#define P1SEGADDR(a) \35((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P1SEG))36#define P2SEGADDR(a) \37((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P2SEG))38#define P3SEGADDR(a) \39((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P3SEG))40#define P4SEGADDR(a) \41((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P4SEG))42#else43/*44* These will never work in 32-bit, don't even bother.45*/46#define P1SEGADDR(a) ({ (void)(a); BUG(); NULL; })47#define P2SEGADDR(a) ({ (void)(a); BUG(); NULL; })48#define P3SEGADDR(a) ({ (void)(a); BUG(); NULL; })49#define P4SEGADDR(a) ({ (void)(a); BUG(); NULL; })50#endif51#endif /* P1SEG */5253/* Check if an address can be reached in 29 bits */54#define IS_29BIT(a) (((unsigned long)(a)) < 0x20000000)5556#ifdef CONFIG_SH_STORE_QUEUES57/*58* This is a special case for the SH-4 store queues, as pages for this59* space still need to be faulted in before it's possible to flush the60* store queue cache for writeout to the remapped region.61*/62#define P3_ADDR_MAX (P4SEG_STORE_QUE + 0x04000000)63#else64#define P3_ADDR_MAX P4SEG65#endif6667#endif /* __KERNEL__ */68#endif /* __ASM_SH_ADDRSPACE_H */697071