提交 c78f322c 编写于 作者: G Gustavo F. Padovan 提交者: H. Peter Anvin

x86, fixmap: prepare fixmap_32.h for unification

Impact: cleanup

Just prepare fixmap for later mechanic unification.
No real modification on code.

   text    data     bss     dec     hex filename
3831152  353188  372736 4557076  458914 vmlinux-32.after
3831152  353188  372736 4557076  458914 vmlinux-32.before
Signed-off-by: NGustavo F. Padovan <gustavo@las.ic.unicamp.br>
Acked-by: NGlauber Costa <gcosta@redhat.com>
Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
上级 e365bcd9
...@@ -8,50 +8,80 @@ ...@@ -8,50 +8,80 @@
* Copyright (C) 1998 Ingo Molnar * Copyright (C) 1998 Ingo Molnar
* *
* Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
* x86_32 and x86_64 integration by Gustavo F. Padovan, February 2009
*/ */
#ifndef _ASM_X86_FIXMAP_32_H #ifndef _ASM_X86_FIXMAP_32_H
#define _ASM_X86_FIXMAP_32_H #define _ASM_X86_FIXMAP_32_H
#ifndef __ASSEMBLY__
#include <linux/kernel.h>
#include <asm/acpi.h>
#include <asm/apicdef.h>
#include <asm/page.h>
#ifdef CONFIG_X86_32
#include <linux/threads.h>
#include <asm/kmap_types.h>
#else
#include <asm/vsyscall.h>
#ifdef CONFIG_EFI
#include <asm/efi.h>
#endif
#endif
/*
* We can't declare FIXADDR_TOP as variable for x86_64 because vsyscall
* uses fixmaps that relies on FIXADDR_TOP for proper address calculation.
* Because of this, FIXADDR_TOP x86 integration was left as later work.
*/
#ifdef CONFIG_X86_32
/* used by vmalloc.c, vsyscall.lds.S. /* used by vmalloc.c, vsyscall.lds.S.
* *
* Leave one empty page between vmalloc'ed areas and * Leave one empty page between vmalloc'ed areas and
* the start of the fixmap. * the start of the fixmap.
*/ */
extern unsigned long __FIXADDR_TOP; extern unsigned long __FIXADDR_TOP;
#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP)
#define FIXADDR_USER_START __fix_to_virt(FIX_VDSO) #define FIXADDR_USER_START __fix_to_virt(FIX_VDSO)
#define FIXADDR_USER_END __fix_to_virt(FIX_VDSO - 1) #define FIXADDR_USER_END __fix_to_virt(FIX_VDSO - 1)
#else
#define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE)
#ifndef __ASSEMBLY__ /* Only covers 32bit vsyscalls currently. Need another set for 64bit. */
#include <linux/kernel.h> #define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL)
#include <asm/acpi.h> #define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE)
#include <asm/apicdef.h> #endif
#include <asm/page.h>
#include <linux/threads.h>
#include <asm/kmap_types.h>
/* /*
* Here we define all the compile-time 'special' virtual * Here we define all the compile-time 'special' virtual
* addresses. The point is to have a constant address at * addresses. The point is to have a constant address at
* compile time, but to set the physical address only * compile time, but to set the physical address only
* in the boot process. We allocate these special addresses * in the boot process.
* for x86_32: We allocate these special addresses
* from the end of virtual memory (0xfffff000) backwards. * from the end of virtual memory (0xfffff000) backwards.
* Also this lets us do fail-safe vmalloc(), we * Also this lets us do fail-safe vmalloc(), we
* can guarantee that these special addresses and * can guarantee that these special addresses and
* vmalloc()-ed addresses never overlap. * vmalloc()-ed addresses never overlap.
* *
* these 'compile-time allocated' memory buffers are * These 'compile-time allocated' memory buffers are
* fixed-size 4k pages. (or larger if used with an increment * fixed-size 4k pages (or larger if used with an increment
* highger than 1) use fixmap_set(idx,phys) to associate * higher than 1). Use set_fixmap(idx,phys) to associate
* physical memory with fixmap indices. * physical memory with fixmap indices.
* *
* TLB entries of such buffers will not be flushed across * TLB entries of such buffers will not be flushed across
* task switches. * task switches.
*/ */
enum fixed_addresses { enum fixed_addresses {
#ifdef CONFIG_X86_32
FIX_HOLE, FIX_HOLE,
FIX_VDSO, FIX_VDSO,
#else
VSYSCALL_LAST_PAGE,
VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE
+ ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1,
VSYSCALL_HPET,
#endif
FIX_DBGP_BASE, FIX_DBGP_BASE,
FIX_EARLYCON_MEM_BASE, FIX_EARLYCON_MEM_BASE,
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
...@@ -59,7 +89,14 @@ enum fixed_addresses { ...@@ -59,7 +89,14 @@ enum fixed_addresses {
#endif #endif
#ifdef CONFIG_X86_IO_APIC #ifdef CONFIG_X86_IO_APIC
FIX_IO_APIC_BASE_0, FIX_IO_APIC_BASE_0,
FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS-1, FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,
#endif
#ifdef CONFIG_X86_64
#ifdef CONFIG_EFI
FIX_EFI_IO_MAP_LAST_PAGE,
FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE
+ MAX_EFI_IO_PAGES - 1,
#endif
#endif #endif
#ifdef CONFIG_X86_VISWS_APIC #ifdef CONFIG_X86_VISWS_APIC
FIX_CO_CPU, /* Cobalt timer */ FIX_CO_CPU, /* Cobalt timer */
...@@ -73,15 +110,20 @@ enum fixed_addresses { ...@@ -73,15 +110,20 @@ enum fixed_addresses {
#ifdef CONFIG_X86_CYCLONE_TIMER #ifdef CONFIG_X86_CYCLONE_TIMER
FIX_CYCLONE_TIMER, /*cyclone timer register*/ FIX_CYCLONE_TIMER, /*cyclone timer register*/
#endif #endif
#ifdef CONFIG_X86_32
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
#ifdef CONFIG_PCI_MMCONFIG #ifdef CONFIG_PCI_MMCONFIG
FIX_PCIE_MCFG, FIX_PCIE_MCFG,
#endif #endif
#endif
#ifdef CONFIG_PARAVIRT #ifdef CONFIG_PARAVIRT
FIX_PARAVIRT_BOOTMAP, FIX_PARAVIRT_BOOTMAP,
#endif #endif
__end_of_permanent_fixed_addresses, __end_of_permanent_fixed_addresses,
#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
FIX_OHCI1394_BASE,
#endif
/* /*
* 256 temporary boot-time mappings, used by early_ioremap(), * 256 temporary boot-time mappings, used by early_ioremap(),
* before ioremap() is functional. * before ioremap() is functional.
...@@ -94,17 +136,14 @@ enum fixed_addresses { ...@@ -94,17 +136,14 @@ enum fixed_addresses {
FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 - FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
(__end_of_permanent_fixed_addresses & 255), (__end_of_permanent_fixed_addresses & 255),
FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1, FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
#ifdef CONFIG_X86_32
FIX_WP_TEST, FIX_WP_TEST,
#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
FIX_OHCI1394_BASE,
#endif #endif
__end_of_fixed_addresses __end_of_fixed_addresses
}; };
extern void reserve_top_address(unsigned long reserve);
#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP) extern void reserve_top_address(unsigned long reserve);
#define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT) #define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
#define FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) #define FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册