ia64/xen-unstable

view xen/include/asm-ia64/xenpage.h @ 9770:ced37bea0647

[IA64] FPH enabling + cleanup

Move contents of switch_to macro from xensystem.h to context_switch function.
Initialize FPU on all processors. FPH is always enabled in Xen.
Speed up context-switch (a little bit!) by not enabling/disabling FPH.
Cleanup (unused function/variablesi/fields, debug printf...)
vmx_ia64_switch_to removed (was unused).

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Tue Apr 25 22:35:41 2006 -0600 (2006-04-25)
parents f6e8c269f6af
children 942ecf21dc06
line source
1 #ifndef _ASM_IA64_XENPAGE_H
2 #define _ASM_IA64_XENPAGE_H
4 #ifdef CONFIG_DISCONTIGMEM
5 #error "xenpage.h: page macros need to be defined for CONFIG_DISCONTIGMEM"
6 #endif
8 #undef mfn_valid
9 #undef page_to_mfn
10 #undef mfn_to_page
11 #ifdef CONFIG_VIRTUAL_FRAME_TABLE
12 #undef ia64_mfn_valid
13 #ifndef __ASSEMBLY__
14 extern int ia64_mfn_valid (unsigned long pfn);
15 #endif
16 # define mfn_valid(_pfn) (((_pfn) < max_page) && ia64_mfn_valid(_pfn))
17 #else
18 # define mfn_valid(_pfn) ((_pfn) < max_page)
19 #endif
20 # define page_to_mfn(_page) ((unsigned long) ((_page) - frame_table))
21 # define mfn_to_page(_pfn) (frame_table + (_pfn))
23 #undef page_to_maddr
24 #undef virt_to_page
25 #define page_to_maddr(page) (page_to_mfn(page) << PAGE_SHIFT)
26 #define virt_to_page(kaddr) mfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
28 #define page_to_virt(_page) maddr_to_virt(page_to_maddr(_page))
29 #define maddr_to_page(kaddr) mfn_to_page(((kaddr) >> PAGE_SHIFT))
31 #ifndef __ASSEMBLY__
32 typedef union xen_va {
33 struct {
34 unsigned long off : 60;
35 unsigned long reg : 4;
36 } f;
37 unsigned long l;
38 void *p;
39 } xen_va;
41 static inline int get_order_from_bytes(paddr_t size)
42 {
43 int order;
44 size = (size-1) >> PAGE_SHIFT;
45 for ( order = 0; size; order++ )
46 size >>= 1;
47 return order;
48 }
50 static inline int get_order_from_pages(unsigned long nr_pages)
51 {
52 int order;
53 nr_pages--;
54 for ( order = 0; nr_pages; order++ )
55 nr_pages >>= 1;
56 return order;
57 }
59 #endif
61 #undef __pa
62 #undef __va
63 #define __pa(x) ({xen_va _v; _v.l = (long) (x); _v.f.reg = 0; _v.l;})
64 #define __va(x) ({xen_va _v; _v.l = (long) (x); _v.f.reg = -1; _v.p;})
66 /* It is sometimes very useful to have unsigned long as result. */
67 #define __va_ul(x) ({xen_va _v; _v.l = (long) (x); _v.f.reg = -1; _v.l;})
69 #endif /* _ASM_IA64_XENPAGE_H */