aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/page_64.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-01-30 07:32:44 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:32:44 -0500
commit11b7c7dc945b8802c459baa3304c1b501d2bf872 (patch)
treee07b1dbc96584362eabcca91f43177e15e0a1ced /include/asm-x86/page_64.h
parente62f4473f32a882a537b32cb7202da8d5d7c4f1f (diff)
x86: page.h: move things back to their own files
# HG changeset patch # User Jeremy Fitzhardinge <jeremy@xensource.com> # Date 1199321648 28800 # Node ID 22f6a5902285b58bfc1fbbd9e183498c9017bd78 # Parent bba9287641ff90e836d090d80b5c0a846aab7162 x86: page.h: move things back to their own files Oops, asm/page.h has turned into an #ifdef hellhole. Move 32/64-specific things back to their own headers to make it somewhat comprehensible... Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/page_64.h')
-rw-r--r--include/asm-x86/page_64.h74
1 files changed, 69 insertions, 5 deletions
diff --git a/include/asm-x86/page_64.h b/include/asm-x86/page_64.h
index 94d4803aab2d..ebf977a809a8 100644
--- a/include/asm-x86/page_64.h
+++ b/include/asm-x86/page_64.h
@@ -1,17 +1,81 @@
1#ifndef _X86_64_PAGE_H 1#ifndef _X86_64_PAGE_H
2#define _X86_64_PAGE_H 2#define _X86_64_PAGE_H
3 3
4#ifdef __KERNEL__ 4#define PAGETABLE_LEVELS 4
5#ifndef __ASSEMBLY__ 5
6#define THREAD_ORDER 1
7#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
8#define CURRENT_MASK (~(THREAD_SIZE-1))
9
10#define EXCEPTION_STACK_ORDER 0
11#define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
12
13#define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1)
14#define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
15
16#define IRQSTACK_ORDER 2
17#define IRQSTACKSIZE (PAGE_SIZE << IRQSTACK_ORDER)
18
19#define STACKFAULT_STACK 1
20#define DOUBLEFAULT_STACK 2
21#define NMI_STACK 3
22#define DEBUG_STACK 4
23#define MCE_STACK 5
24#define N_EXCEPTION_STACKS 5 /* hw limit: 7 */
25
26#define __PAGE_OFFSET _AC(0xffff810000000000, UL)
27
28#define __PHYSICAL_START CONFIG_PHYSICAL_START
29#define __KERNEL_ALIGN 0x200000
6 30
7#endif /* !__ASSEMBLY__ */ 31/*
32 * Make sure kernel is aligned to 2MB address. Catching it at compile
33 * time is better. Change your config file and compile the kernel
34 * for a 2MB aligned address (CONFIG_PHYSICAL_START)
35 */
36#if (CONFIG_PHYSICAL_START % __KERNEL_ALIGN) != 0
37#error "CONFIG_PHYSICAL_START must be a multiple of 2MB"
38#endif
39
40#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
41#define __START_KERNEL_map _AC(0xffffffff80000000, UL)
42
43/* See Documentation/x86_64/mm.txt for a description of the memory map. */
44#define __PHYSICAL_MASK_SHIFT 46
45#define __VIRTUAL_MASK_SHIFT 48
46
47#define KERNEL_TEXT_SIZE (40*1024*1024)
48#define KERNEL_TEXT_START _AC(0xffffffff80000000, UL)
8 49
9#ifndef __ASSEMBLY__ 50#ifndef __ASSEMBLY__
51void clear_page(void *page);
52void copy_page(void *to, void *from);
53
54extern unsigned long end_pfn;
55extern unsigned long end_pfn_map;
56extern unsigned long phys_base;
57
58extern unsigned long __phys_addr(unsigned long);
59#define __phys_reloc_hide(x) (x)
60
61/*
62 * These are used to make use of C type-checking..
63 */
64typedef unsigned long pteval_t;
65typedef unsigned long pmdval_t;
66typedef unsigned long pudval_t;
67typedef unsigned long pgdval_t;
68typedef unsigned long pgprotval_t;
69typedef unsigned long phys_addr_t;
70
71typedef struct { pteval_t pte; } pte_t;
10 72
73#define native_pte_val(x) ((x).pte)
74#define native_make_pte(x) ((pte_t) { (x) } )
11 75
12#endif /* __ASSEMBLY__ */ 76#define vmemmap ((struct page *)VMEMMAP_START)
13 77
14#endif /* __KERNEL__ */ 78#endif /* !__ASSEMBLY__ */
15 79
16#ifdef CONFIG_FLATMEM 80#ifdef CONFIG_FLATMEM
17#define pfn_valid(pfn) ((pfn) < end_pfn) 81#define pfn_valid(pfn) ((pfn) < end_pfn)