Import 2.3.18pre1
[davej-history.git] / include / asm-mips / addrspace.h
blob39259486e6fac06bdecc107091d1b4816f1f9b93
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * Copyright (C) 1996 by Ralf Baechle
8 * Defitions for the address spaces of the MIPS CPUs.
9 */
10 #ifndef __ASM_MIPS_ADDRSPACE_H
11 #define __ASM_MIPS_ADDRSPACE_H
14 * Memory segments (32bit kernel mode addresses)
16 #define KUSEG 0x00000000
17 #define KSEG0 0x80000000
18 #define KSEG1 0xa0000000
19 #define KSEG2 0xc0000000
20 #define KSEG3 0xe0000000
23 * Returns the kernel segment base of a given address
25 #define KSEGX(a) (((unsigned long)(a)) & 0xe0000000)
28 * Returns the physical address of a KSEG0/KSEG1 address
30 #define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff)
33 * Map an address to a certain kernel segment
35 #define KSEG0ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG0))
36 #define KSEG1ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG1))
37 #define KSEG2ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG2))
38 #define KSEG3ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG3))
41 * Memory segments (64bit kernel mode addresses)
43 #define XKUSEG 0x0000000000000000
44 #define XKSSEG 0x4000000000000000
45 #define XKPHYS 0x8000000000000000
46 #define XKSEG 0xc000000000000000
47 #define CKSEG0 0xffffffff80000000
48 #define CKSEG1 0xffffffffa0000000
49 #define CKSSEG 0xffffffffc0000000
50 #define CKSEG3 0xffffffffe0000000
52 #endif /* __ASM_MIPS_ADDRSPACE_H */