diff options
| author | Gustavo F. Padovan <gustavo@las.ic.unicamp.br> | 2009-02-15 19:48:57 -0500 |
|---|---|---|
| committer | H. Peter Anvin <hpa@zytor.com> | 2009-02-27 23:57:48 -0500 |
| commit | e365bcd9214db993436de7bc915b76ab8402045f (patch) | |
| tree | 0fd7ce585e2f98f89baa2a4a707d189b61e67c51 | |
| parent | 5f403fa9de5b3bb1309ec5f72b1e52e5b51321d4 (diff) | |
x86, fixmap: prepare fixmap_64.h for unification
Impact: cleanup
Just prepare fixmap for later mechanic unification.
No real modification on code.
text data bss dec hex filename
4312362 527192 421924 5261478 5048a6 vmlinux-64.after
4312362 527192 421924 5261478 5048a6 vmlinux-64.before
Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br>
Acked-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| -rw-r--r-- | arch/x86/include/asm/fixmap_64.h | 76 |
1 files changed, 69 insertions, 7 deletions
diff --git a/arch/x86/include/asm/fixmap_64.h b/arch/x86/include/asm/fixmap_64.h index baff6d0da995..95acae0daa5b 100644 --- a/arch/x86/include/asm/fixmap_64.h +++ b/arch/x86/include/asm/fixmap_64.h | |||
| @@ -6,25 +6,63 @@ | |||
| 6 | * for more details. | 6 | * for more details. |
| 7 | * | 7 | * |
| 8 | * Copyright (C) 1998 Ingo Molnar | 8 | * Copyright (C) 1998 Ingo Molnar |
| 9 | * | ||
| 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 | ||
| 9 | */ | 12 | */ |
| 10 | 13 | ||
| 11 | #ifndef _ASM_X86_FIXMAP_64_H | 14 | #ifndef _ASM_X86_FIXMAP_64_H |
| 12 | #define _ASM_X86_FIXMAP_64_H | 15 | #define _ASM_X86_FIXMAP_64_H |
| 13 | 16 | ||
| 17 | #ifndef __ASSEMBLY__ | ||
| 14 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
| 15 | #include <asm/acpi.h> | 19 | #include <asm/acpi.h> |
| 16 | #include <asm/apicdef.h> | 20 | #include <asm/apicdef.h> |
| 17 | #include <asm/page.h> | 21 | #include <asm/page.h> |
| 22 | #ifdef CONFIG_X86_32 | ||
| 23 | #include <linux/threads.h> | ||
| 24 | #include <asm/kmap_types.h> | ||
| 25 | #else | ||
| 18 | #include <asm/vsyscall.h> | 26 | #include <asm/vsyscall.h> |
| 19 | #ifdef CONFIG_EFI | 27 | #ifdef CONFIG_EFI |
| 20 | #include <asm/efi.h> | 28 | #include <asm/efi.h> |
| 21 | #endif | 29 | #endif |
| 30 | #endif | ||
| 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 | ||
| 38 | /* used by vmalloc.c, vsyscall.lds.S. | ||
| 39 | * | ||
| 40 | * Leave one empty page between vmalloc'ed areas and | ||
| 41 | * the start of the fixmap. | ||
| 42 | */ | ||
| 43 | extern unsigned long __FIXADDR_TOP; | ||
| 44 | #define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP) | ||
| 45 | |||
| 46 | #define FIXADDR_USER_START __fix_to_virt(FIX_VDSO) | ||
| 47 | #define FIXADDR_USER_END __fix_to_virt(FIX_VDSO - 1) | ||
| 48 | #else | ||
| 49 | #define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE) | ||
| 50 | |||
| 51 | /* Only covers 32bit vsyscalls currently. Need another set for 64bit. */ | ||
| 52 | #define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL) | ||
| 53 | #define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE) | ||
| 54 | #endif | ||
| 22 | 55 | ||
| 23 | /* | 56 | /* |
| 24 | * Here we define all the compile-time 'special' virtual | 57 | * Here we define all the compile-time 'special' virtual |
| 25 | * addresses. The point is to have a constant address at | 58 | * addresses. The point is to have a constant address at |
| 26 | * compile time, but to set the physical address only | 59 | * compile time, but to set the physical address only |
| 27 | * in the boot process. | 60 | * in the boot process. |
| 61 | * for x86_32: We allocate these special addresses | ||
| 62 | * from the end of virtual memory (0xfffff000) backwards. | ||
| 63 | * Also this lets us do fail-safe vmalloc(), we | ||
| 64 | * can guarantee that these special addresses and | ||
| 65 | * vmalloc()-ed addresses never overlap. | ||
| 28 | * | 66 | * |
| 29 | * These 'compile-time allocated' memory buffers are | 67 | * These 'compile-time allocated' memory buffers are |
| 30 | * fixed-size 4k pages (or larger if used with an increment | 68 | * fixed-size 4k pages (or larger if used with an increment |
| @@ -34,12 +72,16 @@ | |||
| 34 | * TLB entries of such buffers will not be flushed across | 72 | * TLB entries of such buffers will not be flushed across |
| 35 | * task switches. | 73 | * task switches. |
| 36 | */ | 74 | */ |
| 37 | |||
| 38 | enum fixed_addresses { | 75 | enum fixed_addresses { |
| 76 | #ifdef CONFIG_X86_32 | ||
| 77 | FIX_HOLE, | ||
| 78 | FIX_VDSO, | ||
| 79 | #else | ||
| 39 | VSYSCALL_LAST_PAGE, | 80 | VSYSCALL_LAST_PAGE, |
| 40 | VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE | 81 | VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE |
| 41 | + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1, | 82 | + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1, |
| 42 | VSYSCALL_HPET, | 83 | VSYSCALL_HPET, |
| 84 | #endif | ||
| 43 | FIX_DBGP_BASE, | 85 | FIX_DBGP_BASE, |
| 44 | FIX_EARLYCON_MEM_BASE, | 86 | FIX_EARLYCON_MEM_BASE, |
| 45 | #ifdef CONFIG_X86_LOCAL_APIC | 87 | #ifdef CONFIG_X86_LOCAL_APIC |
| @@ -49,11 +91,32 @@ enum fixed_addresses { | |||
| 49 | FIX_IO_APIC_BASE_0, | 91 | FIX_IO_APIC_BASE_0, |
| 50 | 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, |
| 51 | #endif | 93 | #endif |
| 94 | #ifdef CONFIG_X86_64 | ||
| 52 | #ifdef CONFIG_EFI | 95 | #ifdef CONFIG_EFI |
| 53 | FIX_EFI_IO_MAP_LAST_PAGE, | 96 | FIX_EFI_IO_MAP_LAST_PAGE, |
| 54 | FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE | 97 | FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE |
| 55 | + MAX_EFI_IO_PAGES - 1, | 98 | + MAX_EFI_IO_PAGES - 1, |
| 56 | #endif | 99 | #endif |
| 100 | #endif | ||
| 101 | #ifdef CONFIG_X86_VISWS_APIC | ||
| 102 | FIX_CO_CPU, /* Cobalt timer */ | ||
| 103 | FIX_CO_APIC, /* Cobalt APIC Redirection Table */ | ||
| 104 | FIX_LI_PCIA, /* Lithium PCI Bridge A */ | ||
| 105 | FIX_LI_PCIB, /* Lithium PCI Bridge B */ | ||
| 106 | #endif | ||
| 107 | #ifdef CONFIG_X86_F00F_BUG | ||
| 108 | FIX_F00F_IDT, /* Virtual mapping for IDT */ | ||
| 109 | #endif | ||
| 110 | #ifdef CONFIG_X86_CYCLONE_TIMER | ||
| 111 | FIX_CYCLONE_TIMER, /*cyclone timer register*/ | ||
| 112 | #endif | ||
| 113 | #ifdef CONFIG_X86_32 | ||
| 114 | FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ | ||
| 115 | FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, | ||
| 116 | #ifdef CONFIG_PCI_MMCONFIG | ||
| 117 | FIX_PCIE_MCFG, | ||
| 118 | #endif | ||
| 119 | #endif | ||
| 57 | #ifdef CONFIG_PARAVIRT | 120 | #ifdef CONFIG_PARAVIRT |
| 58 | FIX_PARAVIRT_BOOTMAP, | 121 | FIX_PARAVIRT_BOOTMAP, |
| 59 | #endif | 122 | #endif |
| @@ -73,20 +136,19 @@ enum fixed_addresses { | |||
| 73 | FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 - | 136 | FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 - |
| 74 | (__end_of_permanent_fixed_addresses & 255), | 137 | (__end_of_permanent_fixed_addresses & 255), |
| 75 | 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 | ||
| 140 | FIX_WP_TEST, | ||
| 141 | #endif | ||
| 76 | __end_of_fixed_addresses | 142 | __end_of_fixed_addresses |
| 77 | }; | 143 | }; |
| 78 | 144 | ||
| 79 | extern void reserve_top_address(unsigned long reserve); | ||
| 80 | 145 | ||
| 81 | #define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE) | 146 | extern void reserve_top_address(unsigned long reserve); |
| 82 | 147 | ||
| 83 | #define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT) | 148 | #define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT) |
| 84 | #define FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) | 149 | #define FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) |
| 85 | #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) | 150 | #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) |
| 86 | #define FIXADDR_BOOT_START (FIXADDR_TOP - FIXADDR_BOOT_SIZE) | 151 | #define FIXADDR_BOOT_START (FIXADDR_TOP - FIXADDR_BOOT_SIZE) |
| 87 | 152 | ||
| 88 | /* Only covers 32bit vsyscalls currently. Need another set for 64bit. */ | 153 | #endif /* !__ASSEMBLY__ */ |
| 89 | #define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL) | ||
| 90 | #define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE) | ||
| 91 | |||
| 92 | #endif /* _ASM_X86_FIXMAP_64_H */ | 154 | #endif /* _ASM_X86_FIXMAP_64_H */ |
