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
6 * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
7 * Copyright (C) 2000, 2002 Maciej W. Rozycki
8 * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
10 #ifndef _ASM_MACH_GENERIC_SPACES_H
11 #define _ASM_MACH_GENERIC_SPACES_H
13 #include <linux/const.h>
15 #include <asm/mipsregs.h>
17 #ifndef IO_SPACE_LIMIT
18 #define IO_SPACE_LIMIT 0xffff
22 * This gives the physical RAM offset.
25 # if defined(CONFIG_MIPS_AUTO_PFN_OFFSET)
26 # define PHYS_OFFSET ((unsigned long)PFN_PHYS(ARCH_PFN_OFFSET))
27 # elif !defined(PHYS_OFFSET)
28 # define PHYS_OFFSET _AC(0, UL)
30 #endif /* __ASSEMBLY__ */
33 #ifdef CONFIG_KVM_GUEST
34 #define CAC_BASE _AC(0x40000000, UL)
36 #define CAC_BASE _AC(0x80000000, UL)
39 #define IO_BASE _AC(0xa0000000, UL)
42 #define UNCAC_BASE _AC(0xa0000000, UL)
46 #ifdef CONFIG_KVM_GUEST
47 #define MAP_BASE _AC(0x60000000, UL)
49 #define MAP_BASE _AC(0xc0000000, UL)
54 * Memory above this physical address will be considered highmem.
57 #define HIGHMEM_START _AC(0x20000000, UL)
60 #endif /* CONFIG_32BIT */
65 #define CAC_BASE PHYS_TO_XKPHYS(read_c0_config() & CONF_CM_CMASK, 0)
69 #define IO_BASE _AC(0x9000000000000000, UL)
73 #define UNCAC_BASE _AC(0x9000000000000000, UL)
77 #define MAP_BASE _AC(0xc000000000000000, UL)
81 * Memory above this physical address will be considered highmem.
82 * Fixme: 59 bits is a fictive number and makes assumptions about processors
83 * in the distant future. Nobody will care for a few years :-)
86 #define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
89 #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
90 #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
91 #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
93 #endif /* CONFIG_64BIT */
96 * This handles the memory map.
99 #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
103 #ifdef CONFIG_KVM_GUEST
104 #define FIXADDR_TOP ((unsigned long)(long)(int)0x7ffe0000)
106 #define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
110 #endif /* __ASM_MACH_GENERIC_SPACES_H */