debuggers.hg

view xen/arch/ia64/patch/linux-2.6.11/page.h @ 4615:58efb3448933

bitkeeper revision 1.1327.1.1 (426536d2PUqtjTi2v06bzD10RFwarg)

Merge bk://xen.bkbits.net/xeno-unstable.bk
into bkbits.net:/repos/x/xen-ia64/xeno-unstable-ia64.bk
author xen-ia64.adm@bkbits.net
date Tue Apr 19 16:50:26 2005 +0000 (2005-04-19)
parents f1c946e1226a
children 5b9e241131fb 593703cf4935
line source
1 page.h | 42 +++++++++++++++++++++++++++++++++++++++---
2 1 files changed, 39 insertions(+), 3 deletions(-)
4 Index: linux-2.6.11-xendiffs/include/asm-ia64/page.h
5 ===================================================================
6 --- linux-2.6.11-xendiffs.orig/include/asm-ia64/page.h 2005-04-06 22:58:07.597539393 -0500
7 +++ linux-2.6.11-xendiffs/include/asm-ia64/page.h 2005-04-06 23:06:15.908576975 -0500
8 @@ -12,6 +12,9 @@
9 #include <asm/intrinsics.h>
10 #include <asm/types.h>
12 +#ifndef __ASSEMBLY__
13 +#include <asm/flushtlb.h>
14 +#endif
15 /*
16 * PAGE_SHIFT determines the actual kernel page size.
17 */
18 @@ -95,9 +98,11 @@ extern int ia64_pfn_valid (unsigned long
19 #endif
21 #ifndef CONFIG_DISCONTIGMEM
22 +#ifdef XEN
23 +#define pfn_valid(pfn) (0)
24 +#else
25 # define pfn_valid(pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
26 -# define page_to_pfn(page) ((unsigned long) (page - mem_map))
27 -# define pfn_to_page(pfn) (mem_map + (pfn))
28 +#endif
29 #else
30 extern struct page *vmem_map;
31 extern unsigned long max_low_pfn;
32 @@ -106,9 +111,15 @@ extern unsigned long max_low_pfn;
33 # define pfn_to_page(pfn) (vmem_map + (pfn))
34 #endif
36 -#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
37 +#define page_to_pfn(_page) ((unsigned long)((_page) - frame_table))
38 +#define page_to_virt(_page) phys_to_virt(page_to_phys(_page))
39 +
40 +#define page_to_phys(_page) (page_to_pfn(_page) << PAGE_SHIFT)
41 #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
43 +#define pfn_to_page(_pfn) (frame_table + (_pfn))
44 +#define phys_to_page(kaddr) pfn_to_page(((kaddr) >> PAGE_SHIFT))
45 +
46 typedef union ia64_va {
47 struct {
48 unsigned long off : 61; /* intra-region offset */
49 @@ -124,8 +135,25 @@ typedef union ia64_va {
50 * expressed in this way to ensure they result in a single "dep"
51 * instruction.
52 */
53 +#ifdef XEN
54 +typedef union xen_va {
55 + struct {
56 + unsigned long off : 60;
57 + unsigned long reg : 4;
58 + } f;
59 + unsigned long l;
60 + void *p;
61 +} xen_va;
62 +
63 +// xen/drivers/console.c uses __va in a declaration (should be fixed!)
64 +#define __pa(x) ({xen_va _v; _v.l = (long) (x); _v.f.reg = 0; _v.l;})
65 +#define __va(x) ({xen_va _v; _v.l = (long) (x); _v.f.reg = -1; _v.p;})
66 +//# define __pa(x) ((unsigned long)(((unsigned long)x) - PAGE_OFFSET))
67 +//# define __va(x) ((void *)((char *)(x) + PAGE_OFFSET))
68 +#else
69 #define __pa(x) ({ia64_va _v; _v.l = (long) (x); _v.f.reg = 0; _v.l;})
70 #define __va(x) ({ia64_va _v; _v.l = (long) (x); _v.f.reg = -1; _v.p;})
71 +#endif
73 #define REGION_NUMBER(x) ({ia64_va _v; _v.l = (long) (x); _v.f.reg;})
74 #define REGION_OFFSET(x) ({ia64_va _v; _v.l = (long) (x); _v.f.off;})
75 @@ -197,11 +225,19 @@ get_order (unsigned long size)
76 # define __pgprot(x) (x)
77 #endif /* !STRICT_MM_TYPECHECKS */
79 +#ifdef XEN
80 +#define PAGE_OFFSET __IA64_UL_CONST(0xf000000000000000)
81 +#else
82 #define PAGE_OFFSET __IA64_UL_CONST(0xe000000000000000)
83 +#endif
85 #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \
86 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC | \
87 (((current->personality & READ_IMPLIES_EXEC) != 0) \
88 ? VM_EXEC : 0))
90 +#ifdef XEN
91 +#define __flush_tlb() do {} while(0);
92 +#endif
93 +
94 #endif /* _ASM_IA64_PAGE_H */