MIPS: Fix KVM guest fixmap address
[linux-2.6-block.git] / arch / mips / include / asm / mach-generic / spaces.h
CommitLineData
1da177e4
LT
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.
5 *
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.
9 */
10#ifndef _ASM_MACH_GENERIC_SPACES_H
11#define _ASM_MACH_GENERIC_SPACES_H
12
c4612c85 13#include <linux/const.h>
1da177e4 14
41b0483e
FBH
15/*
16 * This gives the physical RAM offset.
17 */
18#ifndef PHYS_OFFSET
19#define PHYS_OFFSET _AC(0, UL)
20#endif
21
875d43e7 22#ifdef CONFIG_32BIT
9843b030
SL
23#ifdef CONFIG_KVM_GUEST
24#define CAC_BASE _AC(0x40000000, UL)
25#else
c4612c85 26#define CAC_BASE _AC(0x80000000, UL)
9843b030 27#endif
7ad18dd0 28#ifndef IO_BASE
c4612c85 29#define IO_BASE _AC(0xa0000000, UL)
7ad18dd0
SH
30#endif
31#ifndef UNCAC_BASE
c4612c85 32#define UNCAC_BASE _AC(0xa0000000, UL)
7ad18dd0 33#endif
09bb9ce1
FBH
34
35#ifndef MAP_BASE
9843b030
SL
36#ifdef CONFIG_KVM_GUEST
37#define MAP_BASE _AC(0x60000000, UL)
38#else
c4612c85 39#define MAP_BASE _AC(0xc0000000, UL)
09bb9ce1 40#endif
9843b030 41#endif
1da177e4
LT
42
43/*
44 * Memory above this physical address will be considered highmem.
45 */
46#ifndef HIGHMEM_START
c4612c85 47#define HIGHMEM_START _AC(0x20000000, UL)
1da177e4
LT
48#endif
49
875d43e7 50#endif /* CONFIG_32BIT */
1da177e4 51
875d43e7 52#ifdef CONFIG_64BIT
1da177e4 53
09bb9ce1 54#ifndef CAC_BASE
1da177e4 55#ifdef CONFIG_DMA_NONCOHERENT
c4612c85 56#define CAC_BASE _AC(0x9800000000000000, UL)
1da177e4 57#else
c4612c85 58#define CAC_BASE _AC(0xa800000000000000, UL)
1da177e4 59#endif
09bb9ce1
FBH
60#endif
61
62#ifndef IO_BASE
c4612c85 63#define IO_BASE _AC(0x9000000000000000, UL)
09bb9ce1
FBH
64#endif
65
66#ifndef UNCAC_BASE
c4612c85 67#define UNCAC_BASE _AC(0x9000000000000000, UL)
09bb9ce1
FBH
68#endif
69
70#ifndef MAP_BASE
c4612c85
FBH
71#define MAP_BASE _AC(0xc000000000000000, UL)
72#endif
73
74/*
75 * Memory above this physical address will be considered highmem.
76 * Fixme: 59 bits is a fictive number and makes assumptions about processors
77 * in the distant future. Nobody will care for a few years :-)
78 */
79#ifndef HIGHMEM_START
80#define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
09bb9ce1 81#endif
1da177e4 82
70342287 83#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
1da177e4
LT
84#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
85#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
86
875d43e7 87#endif /* CONFIG_64BIT */
1da177e4 88
c4612c85
FBH
89/*
90 * This handles the memory map.
91 */
92#ifndef PAGE_OFFSET
db385015 93#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
c4612c85
FBH
94#endif
95
565b60de 96#ifndef FIXADDR_TOP
8e748c8d
JH
97#ifdef CONFIG_KVM_GUEST
98#define FIXADDR_TOP ((unsigned long)(long)(int)0x7ffe0000)
99#else
565b60de
KC
100#define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
101#endif
8e748c8d 102#endif
565b60de 103
1da177e4 104#endif /* __ASM_MACH_GENERIC_SPACES_H */