fixmap.h (4fe2d8b11a370af286287a2661de9d4e6c9a145a) | fixmap.h (ed1bbc40a0d10e0c5c74fe7bdc6298295cf40255) |
---|---|
1/* 2 * fixmap.h: compile-time virtual memory allocation 3 * 4 * This file is subject to the terms and conditions of the GNU General Public 5 * License. See the file "COPYING" in the main directory of this archive 6 * for more details. 7 * 8 * Copyright (C) 1998 Ingo Molnar --- 11 unchanged lines hidden (view full) --- 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 <uapi/asm/vsyscall.h> 27#endif | 1/* 2 * fixmap.h: compile-time virtual memory allocation 3 * 4 * This file is subject to the terms and conditions of the GNU General Public 5 * License. See the file "COPYING" in the main directory of this archive 6 * for more details. 7 * 8 * Copyright (C) 1998 Ingo Molnar --- 11 unchanged lines hidden (view full) --- 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 <uapi/asm/vsyscall.h> 27#endif |
28#include <asm/cpu_entry_area.h> |
|
28 29/* 30 * We can't declare FIXADDR_TOP as variable for x86_64 because vsyscall 31 * uses fixmaps that relies on FIXADDR_TOP for proper address calculation. 32 * Because of this, FIXADDR_TOP x86 integration was left as later work. 33 */ 34#ifdef CONFIG_X86_32 35/* used by vmalloc.c, vsyscall.lds.S. --- 4 unchanged lines hidden (view full) --- 40extern unsigned long __FIXADDR_TOP; 41#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP) 42#else 43#define FIXADDR_TOP (round_up(VSYSCALL_ADDR + PAGE_SIZE, 1<<PMD_SHIFT) - \ 44 PAGE_SIZE) 45#endif 46 47/* | 29 30/* 31 * We can't declare FIXADDR_TOP as variable for x86_64 because vsyscall 32 * uses fixmaps that relies on FIXADDR_TOP for proper address calculation. 33 * Because of this, FIXADDR_TOP x86 integration was left as later work. 34 */ 35#ifdef CONFIG_X86_32 36/* used by vmalloc.c, vsyscall.lds.S. --- 4 unchanged lines hidden (view full) --- 41extern unsigned long __FIXADDR_TOP; 42#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP) 43#else 44#define FIXADDR_TOP (round_up(VSYSCALL_ADDR + PAGE_SIZE, 1<<PMD_SHIFT) - \ 45 PAGE_SIZE) 46#endif 47 48/* |
48 * cpu_entry_area is a percpu region in the fixmap that contains things 49 * needed by the CPU and early entry/exit code. Real types aren't used 50 * for all fields here to avoid circular header dependencies. 51 * 52 * Every field is a virtual alias of some other allocated backing store. 53 * There is no direct allocation of a struct cpu_entry_area. 54 */ 55struct cpu_entry_area { 56 char gdt[PAGE_SIZE]; 57 58 /* 59 * The GDT is just below entry_stack and thus serves (on x86_64) as 60 * a a read-only guard page. 61 */ 62 struct entry_stack_page entry_stack_page; 63 64 /* 65 * On x86_64, the TSS is mapped RO. On x86_32, it's mapped RW because 66 * we need task switches to work, and task switches write to the TSS. 67 */ 68 struct tss_struct tss; 69 70 char entry_trampoline[PAGE_SIZE]; 71 72#ifdef CONFIG_X86_64 73 /* 74 * Exception stacks used for IST entries. 75 * 76 * In the future, this should have a separate slot for each stack 77 * with guard pages between them. 78 */ 79 char exception_stacks[(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + DEBUG_STKSZ]; 80#endif 81}; 82 83#define CPU_ENTRY_AREA_PAGES (sizeof(struct cpu_entry_area) / PAGE_SIZE) 84 85extern void setup_cpu_entry_areas(void); 86 87/* | |
88 * Here we define all the compile-time 'special' virtual 89 * addresses. The point is to have a constant address at 90 * compile time, but to set the physical address only 91 * in the boot process. 92 * for x86_32: We allocate these special addresses 93 * from the end of virtual memory (0xfffff000) backwards. 94 * Also this lets us do fail-safe vmalloc(), we 95 * can guarantee that these special addresses and --- 164 unchanged lines hidden --- | 49 * Here we define all the compile-time 'special' virtual 50 * addresses. The point is to have a constant address at 51 * compile time, but to set the physical address only 52 * in the boot process. 53 * for x86_32: We allocate these special addresses 54 * from the end of virtual memory (0xfffff000) backwards. 55 * Also this lets us do fail-safe vmalloc(), we 56 * can guarantee that these special addresses and --- 164 unchanged lines hidden --- |