diff options
Diffstat (limited to 'arch/x86/include/asm/fixmap.h')
| -rw-r--r-- | arch/x86/include/asm/fixmap.h | 101 | 
1 files changed, 19 insertions, 82 deletions
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h index 4d293dced62..b0910f97a3e 100644 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h @@ -19,11 +19,12 @@  #include <asm/acpi.h>  #include <asm/apicdef.h>  #include <asm/page.h> +#include <asm/pvclock.h>  #ifdef CONFIG_X86_32  #include <linux/threads.h>  #include <asm/kmap_types.h>  #else -#include <asm/vsyscall.h> +#include <uapi/asm/vsyscall.h>  #endif  /* @@ -39,15 +40,9 @@   */  extern unsigned long __FIXADDR_TOP;  #define FIXADDR_TOP	((unsigned long)__FIXADDR_TOP) - -#define FIXADDR_USER_START     __fix_to_virt(FIX_VDSO) -#define FIXADDR_USER_END       __fix_to_virt(FIX_VDSO - 1)  #else -#define FIXADDR_TOP	(VSYSCALL_END-PAGE_SIZE) - -/* Only covers 32bit vsyscalls currently. Need another set for 64bit. */ -#define FIXADDR_USER_START	((unsigned long)VSYSCALL32_VSYSCALL) -#define FIXADDR_USER_END	(FIXADDR_USER_START + PAGE_SIZE) +#define FIXADDR_TOP	(round_up(VSYSCALL_ADDR + PAGE_SIZE, 1<<PMD_SHIFT) - \ +			 PAGE_SIZE)  #endif @@ -73,12 +68,12 @@ extern unsigned long __FIXADDR_TOP;  enum fixed_addresses {  #ifdef CONFIG_X86_32  	FIX_HOLE, -	FIX_VDSO,  #else -	VSYSCALL_LAST_PAGE, -	VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE -			    + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1, -	VSYSCALL_HPET, +	VSYSCALL_PAGE = (FIXADDR_TOP - VSYSCALL_ADDR) >> PAGE_SHIFT, +#ifdef CONFIG_PARAVIRT_CLOCK +	PVCLOCK_FIXMAP_BEGIN, +	PVCLOCK_FIXMAP_END = PVCLOCK_FIXMAP_BEGIN+PVCLOCK_VSYSCALL_NR_PAGES-1, +#endif  #endif  	FIX_DBGP_BASE,  	FIX_EARLYCON_MEM_BASE, @@ -92,18 +87,7 @@ enum fixed_addresses {  	FIX_IO_APIC_BASE_0,  	FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,  #endif -#ifdef CONFIG_X86_VISWS_APIC -	FIX_CO_CPU,	/* Cobalt timer */ -	FIX_CO_APIC,	/* Cobalt APIC Redirection Table */ -	FIX_LI_PCIA,	/* Lithium PCI Bridge A */ -	FIX_LI_PCIB,	/* Lithium PCI Bridge B */ -#endif -#ifdef CONFIG_X86_F00F_BUG -	FIX_F00F_IDT,	/* Virtual mapping for IDT */ -#endif -#ifdef CONFIG_X86_CYCLONE_TIMER -	FIX_CYCLONE_TIMER, /*cyclone timer register*/ -#endif +	FIX_RO_IDT,	/* Virtual mapping for read-only IDT */  #ifdef CONFIG_X86_32  	FIX_KMAP_BEGIN,	/* reserved pte's for temporary kernel mappings */  	FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, @@ -116,7 +100,11 @@ enum fixed_addresses {  #endif  	FIX_TEXT_POKE1,	/* reserve 2 pages for text_poke() */  	FIX_TEXT_POKE0, /* first page is last, because allocation is backward */ +#ifdef	CONFIG_X86_INTEL_MID +	FIX_LNW_VRTC, +#endif  	__end_of_permanent_fixed_addresses, +  	/*  	 * 256 temporary boot-time mappings, used by early_ioremap(),  	 * before ioremap() is functional. @@ -170,64 +158,13 @@ static inline void __set_fixmap(enum fixed_addresses idx,  }  #endif -#define set_fixmap(idx, phys)				\ -	__set_fixmap(idx, phys, PAGE_KERNEL) - -/* - * Some hardware wants to get fixmapped without caching. - */ -#define set_fixmap_nocache(idx, phys)			\ -	__set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE) - -#define clear_fixmap(idx)			\ -	__set_fixmap(idx, 0, __pgprot(0)) - -#define __fix_to_virt(x)	(FIXADDR_TOP - ((x) << PAGE_SHIFT)) -#define __virt_to_fix(x)	((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) - -extern void __this_fixmap_does_not_exist(void); - -/* - * 'index to address' translation. If anyone tries to use the idx - * directly without translation, we catch the bug with a NULL-deference - * kernel oops. Illegal ranges of incoming indices are caught too. - */ -static __always_inline unsigned long fix_to_virt(const unsigned int idx) -{ -	/* -	 * this branch gets completely eliminated after inlining, -	 * except when someone tries to use fixaddr indices in an -	 * illegal way. (such as mixing up address types or using -	 * out-of-range indices). -	 * -	 * If it doesn't get removed, the linker will complain -	 * loudly with a reasonably clear error message.. -	 */ -	if (idx >= __end_of_fixed_addresses) -		__this_fixmap_does_not_exist(); - -	return __fix_to_virt(idx); -} - -static inline unsigned long virt_to_fix(const unsigned long vaddr) -{ -	BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); -	return __virt_to_fix(vaddr); -} - -/* Return an pointer with offset calculated */ -static inline unsigned long __set_fixmap_offset(enum fixed_addresses idx, -				phys_addr_t phys, pgprot_t flags) -{ -	__set_fixmap(idx, phys, flags); -	return fix_to_virt(idx) + (phys & (PAGE_SIZE - 1)); -} +#include <asm-generic/fixmap.h> -#define set_fixmap_offset(idx, phys)			\ -	__set_fixmap_offset(idx, phys, PAGE_KERNEL) +#define __late_set_fixmap(idx, phys, flags) __set_fixmap(idx, phys, flags) +#define __late_clear_fixmap(idx) __set_fixmap(idx, 0, __pgprot(0)) -#define set_fixmap_offset_nocache(idx, phys)			\ -	__set_fixmap_offset(idx, phys, PAGE_KERNEL_NOCACHE) +void __early_set_fixmap(enum fixed_addresses idx, +			phys_addr_t phys, pgprot_t flags);  #endif /* !__ASSEMBLY__ */  #endif /* _ASM_X86_FIXMAP_H */  | 
