ia64/xen-unstable

view linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h @ 9618:db44b783fe09

Cleanups to do_callback_op() new hypercall changeset.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Apr 06 17:25:24 2006 +0100 (2006-04-06)
parents 67de34c062b5
children 93cffd2ea6a9
line source
1 /**
2 * machine_specific_memory_setup - Hook for machine specific memory setup.
3 *
4 * Description:
5 * This is included late in kernel/setup.c so that it can make
6 * use of all of the static functions.
7 **/
9 #include <xen/interface/callback.h>
11 static char * __init machine_specific_memory_setup(void)
12 {
13 unsigned long max_pfn = xen_start_info->nr_pages;
15 e820.nr_map = 0;
16 add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM);
18 return "Xen";
19 }
21 extern void hypervisor_callback(void);
22 extern void failsafe_callback(void);
23 extern void nmi(void);
25 static void __init machine_specific_arch_setup(void)
26 {
27 struct xen_platform_parameters pp;
28 struct callback_register event = {
29 .type = CALLBACKTYPE_event,
30 .address = { __KERNEL_CS, (unsigned long)hypervisor_callback },
31 };
32 struct callback_register failsafe = {
33 .type = CALLBACKTYPE_failsafe,
34 .address = { __KERNEL_CS, (unsigned long)failsafe_callback },
35 };
36 struct xennmi_callback cb;
38 if (xen_feature(XENFEAT_auto_translated_physmap) &&
39 xen_start_info->shared_info < xen_start_info->nr_pages) {
40 HYPERVISOR_shared_info =
41 (shared_info_t *)__va(xen_start_info->shared_info);
42 memset(empty_zero_page, 0, sizeof(empty_zero_page));
43 }
45 HYPERVISOR_callback_op(CALLBACKOP_register, &event);
46 HYPERVISOR_callback_op(CALLBACKOP_register, &failsafe);
48 cb.handler_address = (unsigned long)&nmi;
49 HYPERVISOR_nmi_op(XENNMI_register_callback, &cb);
51 if (HYPERVISOR_xen_version(XENVER_platform_parameters,
52 &pp) == 0)
53 set_fixaddr_top(pp.virt_start - PAGE_SIZE);
54 }