# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID aff2e2b7a23b2f3cece512ef7633ceb394043fb8
# Parent d853acd5ed5865d5326b7884de6b610af814ef41
Clean up console fields in start_info structure. Add compat code for
older kernels so they can use the old start_info API.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c | 51 ++++++++--------
linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c | 51 ++++++++--------
linux-2.6-xen-sparse/drivers/xen/Kconfig | 2
linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c | 8 +-
linux-2.6-xen-sparse/drivers/xen/core/reboot.c | 3
tools/libxc/ia64/xc_ia64_linux_restore.c | 4 -
tools/libxc/powerpc64/xc_linux_build.c | 4 -
tools/libxc/xc_linux_build.c | 8 +-
tools/libxc/xc_linux_restore.c | 5 -
xen/arch/x86/domain_build.c | 8 +-
xen/drivers/char/console.c | 2
xen/include/public/arch-ia64.h | 6 +
xen/include/public/arch-powerpc.h | 5 -
xen/include/public/arch-x86_32.h | 6 +
xen/include/public/arch-x86_64.h | 6 +
xen/include/public/xen-compat.h | 23 -------
xen/include/public/xen.h | 49 +++++++++++----
xen/include/xen/console.h | 2
18 files changed, 135 insertions(+), 108 deletions(-)
diff -r d853acd5ed58 -r aff2e2b7a23b
linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Tue Aug 15 11:36:10
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Tue Aug 15 15:50:36
2006 +0100
@@ -1670,32 +1670,35 @@ void __init setup_arch(char **cmdline_p)
screen_info.orig_video_cols = 80;
screen_info.orig_video_ega_bx = 3;
screen_info.orig_video_points = 16;
- if (xen_start_info->con_info_size >= sizeof(console_info_t)) {
- const console_info_t *console_info = (void
*)xen_start_info + xen_start_info->con_info_offs;
-
- screen_info.orig_video_mode = console_info->txt_mode;
- screen_info.orig_video_isVGA = console_info->video_type;
- screen_info.orig_video_lines =
console_info->video_height;
- screen_info.orig_video_cols = console_info->video_width;
- screen_info.orig_video_points =
console_info->txt_points;
- screen_info.lfb_width = console_info->video_width;
- screen_info.lfb_height = console_info->video_height;
- screen_info.lfb_depth = console_info->lfb_depth;
- screen_info.lfb_base = console_info->lfb_base;
- screen_info.lfb_size = console_info->lfb_size;
- screen_info.lfb_linelength = console_info->lfb_linelen;
- screen_info.red_size = console_info->red_size;
- screen_info.red_pos = console_info->red_pos;
- screen_info.green_size = console_info->green_size;
- screen_info.green_pos = console_info->green_pos;
- screen_info.blue_size = console_info->blue_size;
- screen_info.blue_pos = console_info->blue_pos;
- screen_info.rsvd_size = console_info->rsvd_size;
- screen_info.rsvd_pos = console_info->rsvd_pos;
+ if (xen_start_info->console.dom0.info_size >=
+ sizeof(struct dom0_vga_console_info)) {
+ const struct dom0_vga_console_info *info =
+ (struct dom0_vga_console_info *)(
+ (char *)xen_start_info +
+ xen_start_info->console.dom0.info_off);
+ screen_info.orig_video_mode = info->txt_mode;
+ screen_info.orig_video_isVGA = info->video_type;
+ screen_info.orig_video_lines = info->video_height;
+ screen_info.orig_video_cols = info->video_width;
+ screen_info.orig_video_points = info->txt_points;
+ screen_info.lfb_width = info->video_width;
+ screen_info.lfb_height = info->video_height;
+ screen_info.lfb_depth = info->lfb_depth;
+ screen_info.lfb_base = info->lfb_base;
+ screen_info.lfb_size = info->lfb_size;
+ screen_info.lfb_linelength = info->lfb_linelen;
+ screen_info.red_size = info->red_size;
+ screen_info.red_pos = info->red_pos;
+ screen_info.green_size = info->green_size;
+ screen_info.green_pos = info->green_pos;
+ screen_info.blue_size = info->blue_size;
+ screen_info.blue_pos = info->blue_pos;
+ screen_info.rsvd_size = info->rsvd_size;
+ screen_info.rsvd_pos = info->rsvd_pos;
}
screen_info.orig_y = screen_info.orig_video_lines - 1;
- xen_start_info->console_mfn = 0;
- xen_start_info->console_evtchn = 0;
+ xen_start_info->console.domU.mfn = 0;
+ xen_start_info->console.domU.evtchn = 0;
} else
screen_info.orig_video_isVGA = 0;
diff -r d853acd5ed58 -r aff2e2b7a23b
linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c Tue Aug 15
11:36:10 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c Tue Aug 15
15:50:36 2006 +0100
@@ -648,32 +648,35 @@ void __init setup_arch(char **cmdline_p)
screen_info.orig_video_cols = 80;
screen_info.orig_video_ega_bx = 3;
screen_info.orig_video_points = 16;
- if (xen_start_info->con_info_size >= sizeof(console_info_t)) {
- const console_info_t *console_info = (void
*)xen_start_info + xen_start_info->con_info_offs;
-
- screen_info.orig_video_mode = console_info->txt_mode;
- screen_info.orig_video_isVGA = console_info->video_type;
- screen_info.orig_video_lines =
console_info->video_height;
- screen_info.orig_video_cols = console_info->video_width;
- screen_info.orig_video_points =
console_info->txt_points;
- screen_info.lfb_width = console_info->video_width;
- screen_info.lfb_height = console_info->video_height;
- screen_info.lfb_depth = console_info->lfb_depth;
- screen_info.lfb_base = console_info->lfb_base;
- screen_info.lfb_size = console_info->lfb_size;
- screen_info.lfb_linelength = console_info->lfb_linelen;
- screen_info.red_size = console_info->red_size;
- screen_info.red_pos = console_info->red_pos;
- screen_info.green_size = console_info->green_size;
- screen_info.green_pos = console_info->green_pos;
- screen_info.blue_size = console_info->blue_size;
- screen_info.blue_pos = console_info->blue_pos;
- screen_info.rsvd_size = console_info->rsvd_size;
- screen_info.rsvd_pos = console_info->rsvd_pos;
+ if (xen_start_info->console.dom0.info_size >=
+ sizeof(struct dom0_vga_console_info)) {
+ const struct dom0_vga_console_info *info =
+ (struct dom0_vga_console_info *)(
+ (char *)xen_start_info +
+ xen_start_info->console.dom0.info_off);
+ screen_info.orig_video_mode = info->txt_mode;
+ screen_info.orig_video_isVGA = info->video_type;
+ screen_info.orig_video_lines = info->video_height;
+ screen_info.orig_video_cols = info->video_width;
+ screen_info.orig_video_points = info->txt_points;
+ screen_info.lfb_width = info->video_width;
+ screen_info.lfb_height = info->video_height;
+ screen_info.lfb_depth = info->lfb_depth;
+ screen_info.lfb_base = info->lfb_base;
+ screen_info.lfb_size = info->lfb_size;
+ screen_info.lfb_linelength = info->lfb_linelen;
+ screen_info.red_size = info->red_size;
+ screen_info.red_pos = info->red_pos;
+ screen_info.green_size = info->green_size;
+ screen_info.green_pos = info->green_pos;
+ screen_info.blue_size = info->blue_size;
+ screen_info.blue_pos = info->blue_pos;
+ screen_info.rsvd_size = info->rsvd_size;
+ screen_info.rsvd_pos = info->rsvd_pos;
}
screen_info.orig_y = screen_info.orig_video_lines - 1;
- xen_start_info->console_mfn = 0;
- xen_start_info->console_evtchn = 0;
+ xen_start_info->console.domU.mfn = 0;
+ xen_start_info->console.domU.evtchn = 0;
} else
screen_info.orig_video_isVGA = 0;
diff -r d853acd5ed58 -r aff2e2b7a23b linux-2.6-xen-sparse/drivers/xen/Kconfig
--- a/linux-2.6-xen-sparse/drivers/xen/Kconfig Tue Aug 15 11:36:10 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/Kconfig Tue Aug 15 15:50:36 2006 +0100
@@ -13,7 +13,7 @@ if XEN
if XEN
config XEN_INTERFACE_VERSION
hex
- default 0x00030202
+ default 0x00030203
menu "XEN"
diff -r d853acd5ed58 -r aff2e2b7a23b
linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c
--- a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c Tue Aug 15
11:36:10 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c Tue Aug 15
15:50:36 2006 +0100
@@ -52,13 +52,13 @@ static int xencons_irq;
static inline struct xencons_interface *xencons_interface(void)
{
- return mfn_to_virt(xen_start_info->console_mfn);
+ return mfn_to_virt(xen_start_info->console.domU.mfn);
}
static inline void notify_daemon(void)
{
/* Use evtchn: this is called early, before irq is set up. */
- notify_remote_via_evtchn(xen_start_info->console_evtchn);
+ notify_remote_via_evtchn(xen_start_info->console.domU.evtchn);
}
int xencons_ring_send(const char *data, unsigned len)
@@ -116,11 +116,11 @@ int xencons_ring_init(void)
unbind_from_irqhandler(xencons_irq, NULL);
xencons_irq = 0;
- if (!xen_start_info->console_evtchn)
+ if (!xen_start_info->console.domU.evtchn)
return 0;
err = bind_evtchn_to_irqhandler(
- xen_start_info->console_evtchn,
+ xen_start_info->console.domU.evtchn,
handle_input, 0, "xencons", NULL);
if (err <= 0) {
printk(KERN_ERR "XEN console request irq failed %i\n", err);
diff -r d853acd5ed58 -r aff2e2b7a23b
linux-2.6-xen-sparse/drivers/xen/core/reboot.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/reboot.c Tue Aug 15 11:36:10
2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/core/reboot.c Tue Aug 15 15:50:36
2006 +0100
@@ -106,7 +106,8 @@ static void pre_suspend(void)
clear_fixmap(FIX_SHARED_INFO);
xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn);
- xen_start_info->console_mfn = mfn_to_pfn(xen_start_info->console_mfn);
+ xen_start_info->console.domU.mfn =
+ mfn_to_pfn(xen_start_info->console.domU.mfn);
}
static void post_suspend(void)
diff -r d853acd5ed58 -r aff2e2b7a23b tools/libxc/ia64/xc_ia64_linux_restore.c
--- a/tools/libxc/ia64/xc_ia64_linux_restore.c Tue Aug 15 11:36:10 2006 +0100
+++ b/tools/libxc/ia64/xc_ia64_linux_restore.c Tue Aug 15 15:50:36 2006 +0100
@@ -288,8 +288,8 @@ xc_linux_restore(int xc_handle, int io_f
start_info->flags = 0;
*store_mfn = page_array[start_info->store_mfn];
start_info->store_evtchn = store_evtchn;
- *console_mfn = page_array[start_info->console_mfn];
- start_info->console_evtchn = console_evtchn;
+ *console_mfn = page_array[start_info->console.domU.mfn];
+ start_info->console.domU.evtchn = console_evtchn;
munmap(start_info, PAGE_SIZE);
/*
diff -r d853acd5ed58 -r aff2e2b7a23b tools/libxc/powerpc64/xc_linux_build.c
--- a/tools/libxc/powerpc64/xc_linux_build.c Tue Aug 15 11:36:10 2006 +0100
+++ b/tools/libxc/powerpc64/xc_linux_build.c Tue Aug 15 15:50:36 2006 +0100
@@ -308,8 +308,8 @@ static unsigned long create_start_info(s
si->shared_info = eomem - (PAGE_SIZE * 1);
si->store_mfn = si->nr_pages - 2;
si->store_evtchn = store_evtchn;
- si->console_mfn = si->nr_pages - 3;
- si->console_evtchn = console_evtchn;
+ si->console.domU.mfn = si->nr_pages - 3;
+ si->console.domU.evtchn = console_evtchn;
si_addr = eomem - (PAGE_SIZE * 4);
return si_addr;
diff -r d853acd5ed58 -r aff2e2b7a23b tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c Tue Aug 15 11:36:10 2006 +0100
+++ b/tools/libxc/xc_linux_build.c Tue Aug 15 15:50:36 2006 +0100
@@ -569,8 +569,8 @@ static int setup_guest(int xc_handle,
start_info->flags = flags;
start_info->store_mfn = nr_pages - 2;
start_info->store_evtchn = store_evtchn;
- start_info->console_mfn = nr_pages - 1;
- start_info->console_evtchn = console_evtchn;
+ start_info->console.domU.mfn = nr_pages - 1;
+ start_info->console.domU.evtchn = console_evtchn;
start_info->nr_pages = nr_pages; // FIXME?: nr_pages - 2 ????
bp = (struct xen_ia64_boot_param *)(start_info + 1);
@@ -1047,8 +1047,8 @@ static int setup_guest(int xc_handle,
start_info->mfn_list = vphysmap_start;
start_info->store_mfn = guest_store_mfn;
start_info->store_evtchn = store_evtchn;
- start_info->console_mfn = guest_console_mfn;
- start_info->console_evtchn = console_evtchn;
+ start_info->console.domU.mfn = guest_console_mfn;
+ start_info->console.domU.evtchn = console_evtchn;
if ( initrd->len != 0 )
{
start_info->mod_start = vinitrd_start;
diff -r d853acd5ed58 -r aff2e2b7a23b tools/libxc/xc_linux_restore.c
--- a/tools/libxc/xc_linux_restore.c Tue Aug 15 11:36:10 2006 +0100
+++ b/tools/libxc/xc_linux_restore.c Tue Aug 15 15:50:36 2006 +0100
@@ -690,8 +690,9 @@ int xc_linux_restore(int xc_handle, int
start_info->flags = 0;
*store_mfn = start_info->store_mfn = p2m[start_info->store_mfn];
start_info->store_evtchn = store_evtchn;
- *console_mfn = start_info->console_mfn = p2m[start_info->console_mfn];
- start_info->console_evtchn = console_evtchn;
+ start_info->console.domU.mfn = p2m[start_info->console.domU.mfn];
+ start_info->console.domU.evtchn = console_evtchn;
+ *console_mfn = start_info->console.domU.mfn;
munmap(start_info, PAGE_SIZE);
/* Uncanonicalise each GDT frame number. */
diff -r d853acd5ed58 -r aff2e2b7a23b xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c Tue Aug 15 11:36:10 2006 +0100
+++ b/xen/arch/x86/domain_build.c Tue Aug 15 15:50:36 2006 +0100
@@ -335,7 +335,9 @@ int construct_dom0(struct domain *d,
vphysmap_start = round_pgup(vinitrd_end);
vphysmap_end = vphysmap_start + (nr_pages * sizeof(unsigned long));
vstartinfo_start = round_pgup(vphysmap_end);
- vstartinfo_end = vstartinfo_start + sizeof(start_info_t) +
sizeof(console_info_t);
+ vstartinfo_end = (vstartinfo_start +
+ sizeof(struct start_info) +
+ sizeof(struct dom0_vga_console_info));
vpt_start = round_pgup(vstartinfo_end);
for ( nr_pt_pages = 2; ; nr_pt_pages++ )
{
@@ -773,8 +775,8 @@ int construct_dom0(struct domain *d,
if ( fill_console_start_info((void *)(si + 1)) )
{
- si->con_info_offs = sizeof(start_info_t);
- si->con_info_size = sizeof(console_info_t);
+ si->console.dom0.info_off = sizeof(struct start_info);
+ si->console.dom0.info_size = sizeof(struct dom0_vga_console_info);
}
/* Reinstate the caller's page tables. */
diff -r d853acd5ed58 -r aff2e2b7a23b xen/drivers/char/console.c
--- a/xen/drivers/char/console.c Tue Aug 15 11:36:10 2006 +0100
+++ b/xen/drivers/char/console.c Tue Aug 15 15:50:36 2006 +0100
@@ -154,7 +154,7 @@ static void putchar_console(int c)
}
}
-int fill_console_start_info(console_info_t *ci)
+int fill_console_start_info(struct dom0_vga_console_info *ci)
{
memset(ci, 0, sizeof(*ci));
diff -r d853acd5ed58 -r aff2e2b7a23b xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h Tue Aug 15 11:36:10 2006 +0100
+++ b/xen/include/public/arch-ia64.h Tue Aug 15 15:50:36 2006 +0100
@@ -7,8 +7,14 @@
#ifndef __HYPERVISOR_IF_IA64_H__
#define __HYPERVISOR_IF_IA64_H__
+/* Structural guest handles introduced in 0x00030201. */
+#if __XEN_INTERFACE_VERSION__ >= 0x00030201
#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
typedef struct { type *p; } __guest_handle_ ## name
+#else
+#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
+ typedef type * __guest_handle_ ## name
+#endif
#define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
#define XEN_GUEST_HANDLE(name) __guest_handle_ ## name
diff -r d853acd5ed58 -r aff2e2b7a23b xen/include/public/arch-powerpc.h
--- a/xen/include/public/arch-powerpc.h Tue Aug 15 11:36:10 2006 +0100
+++ b/xen/include/public/arch-powerpc.h Tue Aug 15 15:50:36 2006 +0100
@@ -20,11 +20,6 @@
#ifndef __XEN_PUBLIC_ARCH_PPC_64_H__
#define __XEN_PUBLIC_ARCH_PPC_64_H__
-
-#if !(defined(__XEN__) || defined(__XEN_TOOLS__))
-/* not sure how this is supposed to get asserted */
-#define __XEN_INTERFACE_VERSION__ 0x00030202
-#endif
#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
typedef struct { \
diff -r d853acd5ed58 -r aff2e2b7a23b xen/include/public/arch-x86_32.h
--- a/xen/include/public/arch-x86_32.h Tue Aug 15 11:36:10 2006 +0100
+++ b/xen/include/public/arch-x86_32.h Tue Aug 15 15:50:36 2006 +0100
@@ -9,8 +9,14 @@
#ifndef __XEN_PUBLIC_ARCH_X86_32_H__
#define __XEN_PUBLIC_ARCH_X86_32_H__
+/* Structural guest handles introduced in 0x00030201. */
+#if __XEN_INTERFACE_VERSION__ >= 0x00030201
#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
typedef struct { type *p; } __guest_handle_ ## name
+#else
+#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
+ typedef type * __guest_handle_ ## name
+#endif
#define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
#define XEN_GUEST_HANDLE(name) __guest_handle_ ## name
diff -r d853acd5ed58 -r aff2e2b7a23b xen/include/public/arch-x86_64.h
--- a/xen/include/public/arch-x86_64.h Tue Aug 15 11:36:10 2006 +0100
+++ b/xen/include/public/arch-x86_64.h Tue Aug 15 15:50:36 2006 +0100
@@ -9,8 +9,14 @@
#ifndef __XEN_PUBLIC_ARCH_X86_64_H__
#define __XEN_PUBLIC_ARCH_X86_64_H__
+/* Structural guest handles introduced in 0x00030201. */
+#if __XEN_INTERFACE_VERSION__ >= 0x00030201
#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
typedef struct { type *p; } __guest_handle_ ## name
+#else
+#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
+ typedef type * __guest_handle_ ## name
+#endif
#define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
#define XEN_GUEST_HANDLE(name) __guest_handle_ ## name
diff -r d853acd5ed58 -r aff2e2b7a23b xen/include/public/xen-compat.h
--- a/xen/include/public/xen-compat.h Tue Aug 15 11:36:10 2006 +0100
+++ b/xen/include/public/xen-compat.h Tue Aug 15 15:50:36 2006 +0100
@@ -9,7 +9,7 @@
#ifndef __XEN_PUBLIC_XEN_COMPAT_H__
#define __XEN_PUBLIC_XEN_COMPAT_H__
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030202
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030203
#if defined(__XEN__) || defined(__XEN_TOOLS__)
/* Xen is built with matching headers and implements the latest interface. */
@@ -23,25 +23,4 @@
#error "These header files do not support the requested interface version."
#endif
-/* New sched_op hypercall introduced in 0x00030101. */
-#if __XEN_INTERFACE_VERSION__ < 0x00030101
-#undef __HYPERVISOR_sched_op
-#define __HYPERVISOR_sched_op __HYPERVISOR_sched_op_compat
-#endif
-
-/* Structural guest handles introduced in 0x00030201. */
-#if __XEN_INTERFACE_VERSION__ < 0x00030201
-#undef __DEFINE_XEN_GUEST_HANDLE
-#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
- typedef type * __guest_handle_ ## name
-#endif
-
-/* New event-channel and physdev hypercalls introduced in 0x00030202. */
-#if __XEN_INTERFACE_VERSION__ < 0x00030202
-#undef __HYPERVISOR_event_channel_op
-#define __HYPERVISOR_event_channel_op __HYPERVISOR_event_channel_op_compat
-#undef __HYPERVISOR_physdev_op
-#define __HYPERVISOR_physdev_op __HYPERVISOR_physdev_op_compat
-#endif
-
#endif /* __XEN_PUBLIC_XEN_COMPAT_H__ */
diff -r d853acd5ed58 -r aff2e2b7a23b xen/include/public/xen.h
--- a/xen/include/public/xen.h Tue Aug 15 11:36:10 2006 +0100
+++ b/xen/include/public/xen.h Tue Aug 15 15:50:36 2006 +0100
@@ -8,6 +8,8 @@
#ifndef __XEN_PUBLIC_XEN_H__
#define __XEN_PUBLIC_XEN_H__
+
+#include "xen-compat.h"
#if defined(__i386__)
#include "arch-x86_32.h"
@@ -78,6 +80,24 @@
#define __HYPERVISOR_arch_6 54
#define __HYPERVISOR_arch_7 55
+/*
+ * HYPERCALL COMPATIBILITY.
+ */
+
+/* New sched_op hypercall introduced in 0x00030101. */
+#if __XEN_INTERFACE_VERSION__ < 0x00030101
+#undef __HYPERVISOR_sched_op
+#define __HYPERVISOR_sched_op __HYPERVISOR_sched_op_compat
+#endif
+
+/* New event-channel and physdev hypercalls introduced in 0x00030202. */
+#if __XEN_INTERFACE_VERSION__ < 0x00030202
+#undef __HYPERVISOR_event_channel_op
+#define __HYPERVISOR_event_channel_op __HYPERVISOR_event_channel_op_compat
+#undef __HYPERVISOR_physdev_op
+#define __HYPERVISOR_physdev_op __HYPERVISOR_physdev_op_compat
+#endif
+
/*
* VIRTUAL INTERRUPTS
*
@@ -467,14 +487,15 @@ struct start_info {
xen_pfn_t store_mfn; /* MACHINE page number of shared page. */
uint32_t store_evtchn; /* Event channel for store communication. */
union {
- xen_pfn_t console_mfn; /* MACHINE page number of console page. */
- uint32_t con_info_offs; /* Dom0 only: offset of console_info from
- start_info */
- };
- union {
- uint32_t console_evtchn;/* Event channel for console messages. */
- uint32_t con_info_size; /* Dom0 only: size of console_info */
- };
+ struct {
+ xen_pfn_t mfn; /* MACHINE page number of console page. */
+ uint32_t evtchn; /* Event channel for console page. */
+ } domU;
+ struct {
+ uint32_t info_off; /* Offset of console_info struct. */
+ uint32_t info_size; /* Size of console_info struct from start.*/
+ } dom0;
+ } console;
/* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME). */
unsigned long pt_base; /* VIRTUAL address of page directory. */
unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames. */
@@ -485,11 +506,17 @@ struct start_info {
};
typedef struct start_info start_info_t;
+/* New console union for dom0 introduced in 0x00030203. */
+#if __XEN_INTERFACE_VERSION__ < 0x00030203
+#define console_mfn console.domU.mfn
+#define console_evtchn console.domU.evtchn
+#endif
+
/* These flags are passed in the 'flags' field of start_info_t. */
#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */
-typedef struct console_info {
+typedef struct dom0_vga_console_info {
uint8_t video_type;
uint8_t txt_points;
uint16_t txt_mode;
@@ -509,7 +536,7 @@ typedef struct console_info {
uint8_t blue_size;
uint8_t rsvd_pos;
uint8_t rsvd_size;
-} console_info_t;
+} dom0_vga_console_info_t;
typedef uint64_t cpumap_t;
@@ -525,8 +552,6 @@ typedef uint8_t xen_domain_handle_t[16];
#define mk_unsigned_long(x) x
#endif /* !__ASSEMBLY__ */
-
-#include "xen-compat.h"
#endif /* __XEN_PUBLIC_XEN_H__ */
diff -r d853acd5ed58 -r aff2e2b7a23b xen/include/xen/console.h
--- a/xen/include/xen/console.h Tue Aug 15 11:36:10 2006 +0100
+++ b/xen/include/xen/console.h Tue Aug 15 15:50:36 2006 +0100
@@ -18,7 +18,7 @@ void init_console(void);
void init_console(void);
void console_endboot(void);
-int fill_console_start_info(console_info_t *);
+int fill_console_start_info(struct dom0_vga_console_info *);
void console_force_unlock(void);
void console_force_lock(void);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|