aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/fixmap_32.h73
1 files changed, 56 insertions, 17 deletions
diff --git a/arch/x86/include/asm/fixmap_32.h b/arch/x86/include/asm/fixmap_32.h
index d3fd0b92b4e5..8384df78eee6 100644
--- a/arch/x86/include/asm/fixmap_32.h
+++ b/arch/x86/include/asm/fixmap_32.h
@@ -8,50 +8,80 @@
8 * Copyright (C) 1998 Ingo Molnar 8 * Copyright (C) 1998 Ingo Molnar
9 * 9 *
10 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 10 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
11 * x86_32 and x86_64 integration by Gustavo F. Padovan, February 2009
11 */ 12 */
12 13
13#ifndef _ASM_X86_FIXMAP_32_H 14#ifndef _ASM_X86_FIXMAP_32_H
14#define _ASM_X86_FIXMAP_32_H 15#define _ASM_X86_FIXMAP_32_H
15 16
17#ifndef __ASSEMBLY__
18#include <linux/kernel.h>
19#include <asm/acpi.h>
20#include <asm/apicdef.h>
21#include <asm/page.h>
22#ifdef CONFIG_X86_32
23#include <linux/threads.h>
24#include <asm/kmap_types.h>
25#else
26#include <asm/vsyscall.h>
27#ifdef CONFIG_EFI
28#include <asm/efi.h>
29#endif
30#endif
16 31
32/*
33 * We can't declare FIXADDR_TOP as variable for x86_64 because vsyscall
34 * uses fixmaps that relies on FIXADDR_TOP for proper address calculation.
35 * Because of this, FIXADDR_TOP x86 integration was left as later work.
36 */
37#ifdef CONFIG_X86_32
17/* used by vmalloc.c, vsyscall.lds.S. 38/* used by vmalloc.c, vsyscall.lds.S.
18 * 39 *
19 * Leave one empty page between vmalloc'ed areas and 40 * Leave one empty page between vmalloc'ed areas and
20 * the start of the fixmap. 41 * the start of the fixmap.
21 */ 42 */
22extern unsigned long __FIXADDR_TOP; 43extern unsigned long __FIXADDR_TOP;
44#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP)
45
23#define FIXADDR_USER_START __fix_to_virt(FIX_VDSO) 46#define FIXADDR_USER_START __fix_to_virt(FIX_VDSO)
24#define FIXADDR_USER_END __fix_to_virt(FIX_VDSO - 1) 47#define FIXADDR_USER_END __fix_to_virt(FIX_VDSO - 1)
48#else
49#define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE)
25 50
26#ifndef __ASSEMBLY__ 51/* Only covers 32bit vsyscalls currently. Need another set for 64bit. */
27#include <linux/kernel.h> 52#define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL)
28#include <asm/acpi.h> 53#define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE)
29#include <asm/apicdef.h> 54#endif
30#include <asm/page.h>
31#include <linux/threads.h>
32#include <asm/kmap_types.h>
33 55
34/* 56/*
35 * Here we define all the compile-time 'special' virtual 57 * Here we define all the compile-time 'special' virtual
36 * addresses. The point is to have a constant address at 58 * addresses. The point is to have a constant address at
37 * compile time, but to set the physical address only 59 * compile time, but to set the physical address only
38 * in the boot process. We allocate these special addresses 60 * in the boot process.
61 * for x86_32: We allocate these special addresses
39 * from the end of virtual memory (0xfffff000) backwards. 62 * from the end of virtual memory (0xfffff000) backwards.
40 * Also this lets us do fail-safe vmalloc(), we 63 * Also this lets us do fail-safe vmalloc(), we
41 * can guarantee that these special addresses and 64 * can guarantee that these special addresses and
42 * vmalloc()-ed addresses never overlap. 65 * vmalloc()-ed addresses never overlap.
43 * 66 *
44 * these 'compile-time allocated' memory buffers are 67 * These 'compile-time allocated' memory buffers are
45 * fixed-size 4k pages. (or larger if used with an increment 68 * fixed-size 4k pages (or larger if used with an increment
46 * highger than 1) use fixmap_set(idx,phys) to associate 69 * higher than 1). Use set_fixmap(idx,phys) to associate
47 * physical memory with fixmap indices. 70 * physical memory with fixmap indices.
48 * 71 *
49 * TLB entries of such buffers will not be flushed across 72 * TLB entries of such buffers will not be flushed across
50 * task switches. 73 * task switches.
51 */ 74 */
52enum fixed_addresses { 75enum fixed_addresses {
76#ifdef CONFIG_X86_32
53 FIX_HOLE, 77 FIX_HOLE,
54 FIX_VDSO, 78 FIX_VDSO,
79#else
80 VSYSCALL_LAST_PAGE,
81 VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE
82 + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1,
83 VSYSCALL_HPET,
84#endif
55 FIX_DBGP_BASE, 85 FIX_DBGP_BASE,
56 FIX_EARLYCON_MEM_BASE, 86 FIX_EARLYCON_MEM_BASE,
57#ifdef CONFIG_X86_LOCAL_APIC 87#ifdef CONFIG_X86_LOCAL_APIC
@@ -59,7 +89,14 @@ enum fixed_addresses {
59#endif 89#endif
60#ifdef CONFIG_X86_IO_APIC 90#ifdef CONFIG_X86_IO_APIC
61 FIX_IO_APIC_BASE_0, 91 FIX_IO_APIC_BASE_0,
62 FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS-1, 92 FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,
93#endif
94#ifdef CONFIG_X86_64
95#ifdef CONFIG_EFI
96 FIX_EFI_IO_MAP_LAST_PAGE,
97 FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE
98 + MAX_EFI_IO_PAGES - 1,
99#endif
63#endif 100#endif
64#ifdef CONFIG_X86_VISWS_APIC 101#ifdef CONFIG_X86_VISWS_APIC
65 FIX_CO_CPU, /* Cobalt timer */ 102 FIX_CO_CPU, /* Cobalt timer */
@@ -73,15 +110,20 @@ enum fixed_addresses {
73#ifdef CONFIG_X86_CYCLONE_TIMER 110#ifdef CONFIG_X86_CYCLONE_TIMER
74 FIX_CYCLONE_TIMER, /*cyclone timer register*/ 111 FIX_CYCLONE_TIMER, /*cyclone timer register*/
75#endif 112#endif
113#ifdef CONFIG_X86_32
76 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ 114 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
77 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, 115 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
78#ifdef CONFIG_PCI_MMCONFIG 116#ifdef CONFIG_PCI_MMCONFIG
79 FIX_PCIE_MCFG, 117 FIX_PCIE_MCFG,
80#endif 118#endif
119#endif
81#ifdef CONFIG_PARAVIRT 120#ifdef CONFIG_PARAVIRT
82 FIX_PARAVIRT_BOOTMAP, 121 FIX_PARAVIRT_BOOTMAP,
83#endif 122#endif
84 __end_of_permanent_fixed_addresses, 123 __end_of_permanent_fixed_addresses,
124#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
125 FIX_OHCI1394_BASE,
126#endif
85 /* 127 /*
86 * 256 temporary boot-time mappings, used by early_ioremap(), 128 * 256 temporary boot-time mappings, used by early_ioremap(),
87 * before ioremap() is functional. 129 * before ioremap() is functional.
@@ -94,17 +136,14 @@ enum fixed_addresses {
94 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 - 136 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
95 (__end_of_permanent_fixed_addresses & 255), 137 (__end_of_permanent_fixed_addresses & 255),
96 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1, 138 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
139#ifdef CONFIG_X86_32
97 FIX_WP_TEST, 140 FIX_WP_TEST,
98#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
99 FIX_OHCI1394_BASE,
100#endif 141#endif
101 __end_of_fixed_addresses 142 __end_of_fixed_addresses
102}; 143};
103 144
104extern void reserve_top_address(unsigned long reserve);
105
106 145
107#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP) 146extern void reserve_top_address(unsigned long reserve);
108 147
109#define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT) 148#define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
110#define FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 149#define FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)