All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akio Takebe <takebe_akio@jp.fujitsu.com>
To: xen-ia64-devel <xen-ia64-devel@lists.xensource.com>,
	xen-devel@lists.xensource.com
Subject: [Patch] cleanup warning in xen/ia64
Date: Mon, 27 Feb 2006 10:48:44 +0900	[thread overview]
Message-ID: <FFC63B3FF13DB2takebe_akio@jp.fujitsu.com> (raw)

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 672 bytes --]

Hi, all

We clean up warning in xen/ia64 .
We have cleaned up many warnings, but it remainded some warnings yet.

These patches fix many issue (ex. panic dom0, oops domU/dom0...).
we will fix compile warnnings one step at a time. 

For xen (common)
 - cleanup.include.xen.patch

For xen (ia64)
 - cleanup.include.asm-ia64.patch
 - cleanup.linux.patch
 - cleanup.linux-xen.patch
 - cleanup.xen.patch
 
Signed-off-by: Tsunehisa Doi <doi.tsunehisa@jp.fujitsu.com>
Signed-off-by: Kouya SHIMURA <kouya@jp.fujitsu.com>
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>

Best Regards,

Akio Takebe, and Fujitsu team

[-- Attachment #2: cleanup.include.asm-ia64.patch --]
[-- Type: application/octet-stream, Size: 3781 bytes --]

diff -r 6c43118bdba8 xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h	Fri Feb 24 22:41:08 2006
+++ b/xen/include/asm-ia64/config.h	Sun Feb 26 16:53:42 2006
@@ -255,7 +255,7 @@
 #define CONFIG_BLK_DEV_INITRD // needed to reserve memory for domain0
 
 void dummy_called(char *function);
-#define dummy()	dummy_called(__FUNCTION__)
+#define dummy()	dummy_called((char *) __FUNCTION__)
 
 // these declarations got moved at some point, find a better place for them
 extern int ht_per_core;
diff -r 6c43118bdba8 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h	Fri Feb 24 22:41:08 2006
+++ b/xen/include/asm-ia64/mm.h	Sun Feb 26 16:53:42 2006
@@ -407,6 +407,7 @@
 extern int nr_swap_pages;
 
 extern unsigned long *mpt_table;
+extern unsigned long gmfn_to_mfn_foreign(struct domain *d, unsigned long gpfn);
 extern unsigned long lookup_domain_mpa(struct domain *d, unsigned long mpaddr);
 #undef machine_to_phys_mapping
 #define machine_to_phys_mapping	mpt_table
diff -r 6c43118bdba8 xen/include/asm-ia64/vcpu.h
--- a/xen/include/asm-ia64/vcpu.h	Fri Feb 24 22:41:08 2006
+++ b/xen/include/asm-ia64/vcpu.h	Sun Feb 26 16:53:42 2006
@@ -38,7 +38,9 @@
 extern IA64FAULT vcpu_get_gr_nat(VCPU *vcpu, unsigned long reg, UINT64 *val);
 extern IA64FAULT vcpu_set_gr(VCPU *vcpu, unsigned long reg, UINT64 value, int nat);
 /* application registers */
+extern void vcpu_load_kernel_regs(VCPU *vcpu);
 extern IA64FAULT vcpu_set_ar(VCPU *vcpu, UINT64 reg, UINT64 val);
+extern IA64FAULT vcpu_get_ar(VCPU *vcpu, UINT64 reg, UINT64 *val);
 /* psr */
 extern BOOLEAN vcpu_get_psr_ic(VCPU *vcpu);
 extern UINT64 vcpu_get_ipsr_int_state(VCPU *vcpu,UINT64 prevpsr);
@@ -46,6 +48,9 @@
 extern IA64FAULT vcpu_reset_psr_sm(VCPU *vcpu, UINT64 imm);
 extern IA64FAULT vcpu_set_psr_sm(VCPU *vcpu, UINT64 imm);
 extern IA64FAULT vcpu_set_psr_l(VCPU *vcpu, UINT64 val);
+extern IA64FAULT vcpu_set_psr_i(VCPU *vcpu);
+extern IA64FAULT vcpu_reset_psr_dt(VCPU *vcpu);
+extern IA64FAULT vcpu_set_psr_dt(VCPU *vcpu);
 /* control registers */
 extern IA64FAULT vcpu_set_dcr(VCPU *vcpu, UINT64 val);
 extern IA64FAULT vcpu_set_itm(VCPU *vcpu, UINT64 val);
@@ -89,6 +94,8 @@
 extern IA64FAULT vcpu_get_lrr0(VCPU *vcpu, UINT64 *pval);
 extern IA64FAULT vcpu_get_lrr1(VCPU *vcpu, UINT64 *pval);
 /* interrupt registers */
+extern void vcpu_pend_unspecified_interrupt(VCPU *vcpu);
+extern UINT64 vcpu_check_pending_interrupts(VCPU *vcpu);
 extern IA64FAULT vcpu_get_itv(VCPU *vcpu,UINT64 *pval);
 extern IA64FAULT vcpu_get_pmv(VCPU *vcpu,UINT64 *pval);
 extern IA64FAULT vcpu_get_cmcv(VCPU *vcpu,UINT64 *pval);
@@ -99,6 +106,7 @@
 /* interval timer registers */
 extern IA64FAULT vcpu_set_itm(VCPU *vcpu,UINT64 val);
 extern IA64FAULT vcpu_set_itc(VCPU *vcpu,UINT64 val);
+extern UINT64 vcpu_timer_pending_early(VCPU *vcpu);
 /* debug breakpoint registers */
 extern IA64FAULT vcpu_set_ibr(VCPU *vcpu,UINT64 reg,UINT64 val);
 extern IA64FAULT vcpu_set_dbr(VCPU *vcpu,UINT64 reg,UINT64 val);
@@ -135,9 +143,14 @@
 extern IA64FAULT vcpu_ptr_i(VCPU *vcpu,UINT64 vadr, UINT64 addr_range);
 extern IA64FAULT vcpu_translate(VCPU *vcpu, UINT64 address, BOOLEAN is_data, UINT64 *pteval, UINT64 *itir, UINT64 *iha);
 extern IA64FAULT vcpu_tpa(VCPU *vcpu, UINT64 vadr, UINT64 *padr);
+extern IA64FAULT vcpu_force_data_miss(VCPU *vcpu, UINT64 ifa);
+extern IA64FAULT vcpu_fc(VCPU *vcpu, UINT64 vadr);
 /* misc */
 extern IA64FAULT vcpu_rfi(VCPU *vcpu);
 extern IA64FAULT vcpu_thash(VCPU *vcpu, UINT64 vadr, UINT64 *pval);
+extern IA64FAULT vcpu_cover(VCPU *vcpu);
+extern IA64FAULT vcpu_ttag(VCPU *vcpu, UINT64 vadr, UINT64 *padr);
+extern IA64FAULT vcpu_get_cpuid(VCPU *vcpu, UINT64 reg, UINT64 *pval);
 
 extern void vcpu_pend_interrupt(VCPU *vcpu, UINT64 vector);
 extern void vcpu_pend_timer(VCPU *vcpu);

[-- Attachment #3: cleanup.include.xen.patch --]
[-- Type: application/octet-stream, Size: 455 bytes --]

diff -r 6c43118bdba8 xen/include/xen/string.h
--- a/xen/include/xen/string.h	Fri Feb 24 22:41:08 2006
+++ b/xen/include/xen/string.h	Sun Feb 26 16:53:57 2006
@@ -24,6 +24,9 @@
 #endif
 #ifndef __HAVE_ARCH_STRNCPY
 extern char * strncpy(char *,const char *, __kernel_size_t);
+#endif
+#ifndef __HAVE_ARCH_STRLCPY
+extern size_t strlcpy(char *,const char *, __kernel_size_t);
 #endif
 #ifndef __HAVE_ARCH_STRCAT
 extern char * strcat(char *, const char *);

[-- Attachment #4: cleanup.linux-xen.patch --]
[-- Type: application/octet-stream, Size: 6223 bytes --]

diff -r 6c43118bdba8 xen/arch/ia64/linux-xen/minstate.h
--- a/xen/arch/ia64/linux-xen/minstate.h	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/linux-xen/minstate.h	Sun Feb 26 16:52:52 2006
@@ -175,7 +175,7 @@
 	;;											\
 .mem.offset 0,0; st8.spill [r16]=r13,16;							\
 .mem.offset 8,0; st8.spill [r17]=r21,16;	/* save ar.fpsr */				\
-	/* XEN mov r13=IA64_KR(CURRENT);	/* establish `current' */				\
+	/* XEN mov r13=IA64_KR(CURRENT);*/	/* establish `current' */				\
 	MINSTATE_GET_CURRENT(r13);		/* XEN establish `current' */				\
 	;;											\
 .mem.offset 0,0; st8.spill [r16]=r15,16;							\
diff -r 6c43118bdba8 xen/arch/ia64/linux-xen/setup.c
--- a/xen/arch/ia64/linux-xen/setup.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/linux-xen/setup.c	Sun Feb 26 16:52:52 2006
@@ -94,6 +94,10 @@
 EXPORT_SYMBOL(io_space);
 unsigned int num_io_spaces;
 
+#ifdef XEN
+extern void early_cmdline_parse(char **);
+#endif
+
 /*
  * "flush_icache_range()" needs to know what processor dependent stride size to use
  * when it makes i-cache(s) coherent with d-caches.
@@ -500,6 +504,7 @@
 	paging_init();
 }
 
+#ifndef XEN
 /*
  * Display cpu info for all cpu's.
  */
@@ -611,14 +616,13 @@
 {
 }
 
-#ifndef XEN
 struct seq_operations cpuinfo_op = {
 	.start =	c_start,
 	.next =		c_next,
 	.stop =		c_stop,
 	.show =		show_cpuinfo
 };
-#endif
+#endif /* XEN */
 
 void
 identify_cpu (struct cpuinfo_ia64 *c)
diff -r 6c43118bdba8 xen/arch/ia64/linux-xen/unaligned.c
--- a/xen/arch/ia64/linux-xen/unaligned.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/linux-xen/unaligned.c	Sun Feb 26 16:52:52 2006
@@ -216,6 +216,7 @@
 	RPT(r28), RPT(r29), RPT(r30), RPT(r31)
 };
 
+#if 0
 static u16 fr_info[32]={
 	0,			/* constant : WE SHOULD NEVER GET THIS */
 	0,			/* constant : WE SHOULD NEVER GET THIS */
@@ -285,6 +286,7 @@
 	}
 #	undef F
 }
+#endif
 
 static inline unsigned long
 rotate_reg (unsigned long sor, unsigned long rrb, unsigned long reg)
@@ -299,12 +301,11 @@
 void
 set_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long val, unsigned long nat)
 {
-	struct switch_stack *sw = (struct switch_stack *) regs - 1;
-	unsigned long *bsp, *bspstore, *addr, *rnat_addr, *ubs_end;
+	unsigned long *bsp, *bspstore, *addr, *rnat_addr;
 	unsigned long *kbs = (void *) current + IA64_RBS_OFFSET;
-	unsigned long rnats, nat_mask;
+	unsigned long nat_mask;
     unsigned long old_rsc,new_rsc;
-	unsigned long on_kbs,rnat;
+	unsigned long rnat;
 	long sof = (regs->cr_ifs) & 0x7f;
 	long sor = 8 * ((regs->cr_ifs >> 14) & 0xf);
 	long rrb_gr = (regs->cr_ifs >> 18) & 0x7f;
@@ -323,7 +324,7 @@
     new_rsc=old_rsc&(~0x3);
     ia64_set_rsc(new_rsc);
 
-    bspstore = ia64_get_bspstore();
+    bspstore = (unsigned long*)ia64_get_bspstore();
     bsp =kbs + (regs->loadrs >> 19);//16+3
 
 	addr = ia64_rse_skip_regs(bsp, -sof + ridx);
@@ -335,7 +336,7 @@
         ia64_flushrs ();
         ia64_mf ();
 		*addr = val;
-        bspstore = ia64_get_bspstore();
+        bspstore = (unsigned long*)ia64_get_bspstore();
     	rnat = ia64_get_rnat ();
         if(bspstore < rnat_addr){
             rnat=rnat&(~nat_mask);
@@ -362,13 +363,11 @@
 
 
 static void
-get_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long *val, unsigned long *nat)
-{
-    struct switch_stack *sw = (struct switch_stack *) regs - 1;
-    unsigned long *bsp, *addr, *rnat_addr, *ubs_end, *bspstore;
+get_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long *val, int*nat)
+{
+    unsigned long *bsp, *addr, *rnat_addr, *bspstore;
     unsigned long *kbs = (void *) current + IA64_RBS_OFFSET;
-    unsigned long rnats, nat_mask;
-    unsigned long on_kbs;
+    unsigned long nat_mask;
     unsigned long old_rsc, new_rsc;
     long sof = (regs->cr_ifs) & 0x7f;
     long sor = 8 * ((regs->cr_ifs >> 14) & 0xf);
@@ -388,7 +387,7 @@
     new_rsc=old_rsc&(~(0x3));
     ia64_set_rsc(new_rsc);
 
-    bspstore = ia64_get_bspstore();
+    bspstore = (unsigned long*)ia64_get_bspstore();
     bsp =kbs + (regs->loadrs >> 19); //16+3;
 
     addr = ia64_rse_skip_regs(bsp, -sof + ridx);
@@ -399,14 +398,14 @@
 
         ia64_flushrs ();
         ia64_mf ();
-        bspstore = ia64_get_bspstore();
+        bspstore = (unsigned long*)ia64_get_bspstore();
     }
     *val=*addr;
     if(nat){
         if(bspstore < rnat_addr){
-            *nat=!!(ia64_get_rnat()&nat_mask);
+            *nat=(int)!!(ia64_get_rnat()&nat_mask);
         }else{
-            *nat = !!((*rnat_addr)&nat_mask);
+            *nat = (int)!!((*rnat_addr)&nat_mask);
         }
         ia64_set_rsc(old_rsc);
     }
@@ -634,6 +633,7 @@
 	return rotate_reg(96, rrb_fr, (regnum - IA64_FIRST_ROTATING_FR));
 }
 
+#if 0
 static void
 setfpreg (unsigned long regnum, struct ia64_fpreg *fpval, struct pt_regs *regs)
 {
@@ -682,6 +682,7 @@
 		regs->cr_ipsr |= IA64_PSR_MFL;
 	}
 }
+#endif
 
 /*
  * Those 2 inline functions generate the spilled versions of the constant floating point
@@ -699,6 +700,7 @@
 	ia64_stf_spill(final, 1);
 }
 
+#if 0
 static void
 getfpreg (unsigned long regnum, struct ia64_fpreg *fpval, struct pt_regs *regs)
 {
@@ -748,6 +750,7 @@
 		}
 	}
 }
+#endif
 
 
 #ifdef XEN
@@ -803,6 +806,7 @@
 		*nat  = (*unat >> (addr >> 3 & 0x3f)) & 0x1UL;
 }
 
+#if 0
 static void
 emulate_load_updates (update_t type, load_store_t ld, struct pt_regs *regs, unsigned long ifa)
 {
@@ -1078,6 +1082,7 @@
 
 	return 0;
 }
+#endif
 
 /*
  * floating point operations sizes in bytes
@@ -1153,6 +1158,7 @@
 	ia64_stfd(final, 6);
 }
 
+#if 0
 static int
 emulate_load_floatpair (unsigned long ifa, load_store_t ld, struct pt_regs *regs)
 {
@@ -1437,6 +1443,7 @@
 	return 0;
 
 }
+#endif
 
 void
 ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
diff -r 6c43118bdba8 xen/arch/ia64/linux-xen/unwind.c
--- a/xen/arch/ia64/linux-xen/unwind.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/linux-xen/unwind.c	Sun Feb 26 16:52:52 2006
@@ -484,7 +484,8 @@
 	} else if (regnum <= 15) {
 		if (regnum <= 11) {
 			pt = get_scratch_regs(info);
-			addr = &pt->f6  + (regnum - 6);
+			//XXX struct ia64_fpreg and struct pt_fpreg are same.
+			addr = (struct ia64_fpreg*)(&pt->f6  + (regnum - 6));
 		}
 		else
 			addr = &info->sw->f12 + (regnum - 12);

[-- Attachment #5: cleanup.linux.patch --]
[-- Type: application/octet-stream, Size: 879 bytes --]

diff -r 6c43118bdba8 xen/arch/ia64/linux/cmdline.c
--- a/xen/arch/ia64/linux/cmdline.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/linux/cmdline.c	Sun Feb 26 16:52:38 2006
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
+#include <xen/lib.h>
 
 
 /**
diff -r 6c43118bdba8 xen/arch/ia64/linux/linuxextable.c
--- a/xen/arch/ia64/linux/linuxextable.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/linux/linuxextable.c	Sun Feb 26 16:52:38 2006
@@ -19,6 +19,10 @@
 #include <linux/init.h>
 #include <asm/uaccess.h>
 #include <asm/sections.h>
+
+extern void *search_module_extables(unsigned long addr);
+extern void *__module_text_address(unsigned long addr);
+extern void *module_text_address(unsigned long addr);
 
 extern struct exception_table_entry __start___ex_table[];
 extern struct exception_table_entry __stop___ex_table[];

[-- Attachment #6: cleanup.xen.patch --]
[-- Type: application/octet-stream, Size: 67487 bytes --]

diff -r 6c43118bdba8 xen/arch/ia64/xen/acpi.c
--- a/xen/arch/ia64/xen/acpi.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/acpi.c	Sun Feb 26 16:53:02 2006
@@ -178,7 +178,7 @@
 
 	if (lapic->address) {
 		iounmap((void *) ipi_base_addr);
-		ipi_base_addr = (unsigned long) ioremap(lapic->address, 0);
+		ipi_base_addr = (void __iomem *) ioremap(lapic->address, 0);
 	}
 	return 0;
 }
@@ -265,7 +265,9 @@
 	acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_plat_int_src *plintsrc;
+#if 0
 	int vector;
+#endif
 
 	plintsrc = (struct acpi_table_plat_int_src *) header;
 
@@ -369,9 +371,9 @@
 	/* Get base address of IPI Message Block */
 
 	if (acpi_madt->lapic_address)
-		ipi_base_addr = (unsigned long) ioremap(acpi_madt->lapic_address, 0);
-
-	printk(KERN_INFO PREFIX "Local APIC address 0x%lx\n", ipi_base_addr);
+		ipi_base_addr = (void __iomem *) ioremap(acpi_madt->lapic_address, 0);
+
+	printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr);
 
 	acpi_madt_oem_check(acpi_madt->header.oem_id,
 		acpi_madt->header.oem_table_id);
diff -r 6c43118bdba8 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/dom0_ops.c	Sun Feb 26 16:53:02 2006
@@ -17,6 +17,7 @@
 #include <xen/trace.h>
 #include <xen/console.h>
 #include <public/sched_ctl.h>
+#include <asm/vmx.h>
 
 long arch_do_dom0_op(dom0_op_t *op, dom0_op_t *u_dom0_op)
 {
@@ -143,7 +144,7 @@
             n += j;
         }
 
-        free_xenheap_page((unsigned long)l_arr);
+        free_xenheap_page((void *) l_arr);
 
         put_domain(d);
     }
@@ -160,7 +161,6 @@
         unsigned long nr_pages = op->u.getmemlist.max_pfns & 0xffffffff;
         unsigned long mfn;
         unsigned long *buffer = op->u.getmemlist.buffer;
-        struct page *page;
 
         ret = -EINVAL;
         if ( d != NULL )
diff -r 6c43118bdba8 xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/dom_fw.c	Sun Feb 26 16:53:02 2006
@@ -39,7 +39,8 @@
 		while(1);
 	}
 	if (imva - imva_fw_base > PAGE_SIZE) {
-		printf("dom_pa: bad offset! imva=%p, imva_fw_base=%p (spinning...)\n",imva,imva_fw_base);
+		printf("dom_pa: bad offset! imva=0x%lx, imva_fw_base=0x%lx (spinning...)\n",
+			imva, imva_fw_base);
 		while(1);
 	}
 	return dom_fw_base_mpa + (imva - imva_fw_base);
@@ -48,31 +49,29 @@
 // builds a hypercall bundle at domain physical address
 void dom_efi_hypercall_patch(struct domain *d, unsigned long paddr, unsigned long hypercall)
 {
-	unsigned long imva;
+	unsigned long *imva;
 
 	if (d == dom0) paddr += dom0_start;
-	imva = domain_mpa_to_imva(d,paddr);
-	build_hypercall_bundle(imva,d->arch.breakimm,hypercall,1);
+	imva = (unsigned long *) domain_mpa_to_imva(d, paddr);
+	build_hypercall_bundle(imva, d->arch.breakimm, hypercall, 1);
 }
 
 
 // builds a hypercall bundle at domain physical address
 static void dom_fw_hypercall_patch(struct domain *d, unsigned long paddr, unsigned long hypercall,unsigned long ret)
 {
-	unsigned long imva;
-
-	imva = domain_mpa_to_imva(d,paddr);
-	build_hypercall_bundle(imva,d->arch.breakimm,hypercall,ret);
+	unsigned long *imva;
+
+	imva = (unsigned long *) domain_mpa_to_imva(d, paddr);
+	build_hypercall_bundle(imva, d->arch.breakimm, hypercall, ret);
 }
 
 static void dom_fw_pal_hypercall_patch(struct domain *d, unsigned long paddr)
 {
 	unsigned long *imva;
 
-	imva = (unsigned long *)domain_mpa_to_imva(d,paddr);
-
-	build_pal_hypercall_bundles (imva, d->arch.breakimm,
-				      FW_HYPERCALL_PAL_CALL);
+	imva = (unsigned long *) domain_mpa_to_imva(d, paddr);
+	build_pal_hypercall_bundles(imva, d->arch.breakimm, FW_HYPERCALL_PAL_CALL);
 }
 
 
@@ -85,15 +84,13 @@
 
 	dom_fw_base_mpa = 0;
 	if (d == dom0) dom_fw_base_mpa += dom0_start;
-	imva_fw_base = domain_mpa_to_imva(d,dom_fw_base_mpa);
-	bp = dom_fw_init(d,args,arglen,imva_fw_base,PAGE_SIZE);
-	return dom_pa((unsigned long)bp);
+	imva_fw_base = domain_mpa_to_imva(d, dom_fw_base_mpa);
+	bp = dom_fw_init(d, args, arglen, (char *) imva_fw_base, PAGE_SIZE);
+	return dom_pa((unsigned long) bp);
 }
 
 
 /* the following heavily leveraged from linux/arch/ia64/hp/sim/fw-emu.c */
-
-#define MB	(1024*1024UL)
 
 #define NUM_EFI_SYS_TABLES 6
 # define NUM_MEM_DESCS	5
@@ -256,7 +253,8 @@
 			if (((in1 & ~0xffffffffUL) && (in4 == 0)) ||
 			    (in4 > 1) ||
 			    (in2 > 8) || (in2 & (in2-1)))
-			    	printf("*** SAL_PCI_CONF_WRITE?!?(adr=%p,typ=%p,sz=%p,val=%p)\n",in1,in4,in2,in3);
+				printf("*** SAL_PCI_CONF_WRITE?!?(adr=0x%lx,typ=0x%lx,sz=0x%lx,val=0x%lx)\n",
+					in1,in4,in2,in3);
 			// note that args are in a different order!!
 			status = ia64_sal_pci_config_write(in1,in4,in2,in3);
 		}
@@ -296,7 +294,7 @@
 	long status = -1;
 
 	if (running_on_sim) return pal_emulator_static(index);
-	printk("xen_pal_emulator: index=%d\n",index);
+	printk("xen_pal_emulator: index=%lu\n", index);
 	// pal code must be mapped by a TR when pal is called, however
 	// calls are rare enough that we will map it lazily rather than
 	// at every context switch
@@ -312,10 +310,16 @@
 		status = ia64_pal_proc_get_features(&r9,&r10,&r11);
 		break;
 	    case PAL_BUS_GET_FEATURES:
-		status = ia64_pal_bus_get_features(&r9,&r10,&r11);
+		status = ia64_pal_bus_get_features(
+				(pal_bus_features_u_t *) &r9,
+				(pal_bus_features_u_t *) &r10,
+				(pal_bus_features_u_t *) &r11);
 		break;
 	    case PAL_FREQ_RATIOS:
-		status = ia64_pal_freq_ratios(&r9,&r10,&r11);
+		status = ia64_pal_freq_ratios(
+				(struct pal_freq_ratio *) &r9,
+				(struct pal_freq_ratio *) &r10,
+				(struct pal_freq_ratio *) &r11);
 		break;
 	    case PAL_PTCE_INFO:
 		{
@@ -326,7 +330,9 @@
 		}
 		break;
 	    case PAL_VERSION:
-		status = ia64_pal_version(&r9,&r10);
+		status = ia64_pal_version(
+				(pal_version_u_t *) &r9,
+				(pal_version_u_t *) &r10);
 		break;
 	    case PAL_VM_PAGE_SIZE:
 		status = ia64_pal_vm_page_size(&r9,&r10);
@@ -341,13 +347,21 @@
 		// FIXME: what should xen return for these, figure out later
 		// For now, linux does the right thing if pal call fails
 		// In particular, rid_size must be set properly!
-		//status = ia64_pal_vm_summary(&r9,&r10);
+		//status = ia64_pal_vm_summary(
+		//		(pal_vm_info_1_u_t *) &r9,
+		//		(pal_vm_info_2_u_t *) &r10);
 		break;
 	    case PAL_RSE_INFO:
-		status = ia64_pal_rse_info(&r9,&r10);
+		status = ia64_pal_rse_info(
+				&r9,
+				(pal_hints_u_t *) &r10);
 		break;
 	    case PAL_VM_INFO:
-		status = ia64_pal_vm_info(in1,in2,&r9,&r10);
+		status = ia64_pal_vm_info(
+				in1,
+				in2,
+				(pal_tc_info_u_t *) &r9,
+				&r10);
 		break;
 	    case PAL_REGISTER_INFO:
 		status = ia64_pal_register_info(in1,&r9,&r10);
@@ -360,11 +374,12 @@
 	    case PAL_PERF_MON_INFO:
 		{
 			unsigned long pm_buffer[16];
-			int i;
-			status = ia64_pal_perf_mon_info(pm_buffer,&r9);
+			status = ia64_pal_perf_mon_info(
+					pm_buffer,
+					(pal_perf_mon_info_u_t *) &r9);
 			if (status != 0) {
 				while(1)
-				printk("PAL_PERF_MON_INFO fails ret=%d\n",status);
+				printk("PAL_PERF_MON_INFO fails ret=%ld\n", status);
 				break;
 			}
 			if (copy_to_user((void __user *)in1,pm_buffer,128)) {
@@ -409,7 +424,7 @@
 			    domain_shutdown (current->domain, 0);
 		    break;
 	    default:
-		printk("xen_pal_emulator: UNIMPLEMENTED PAL CALL %d!!!!\n",
+		printk("xen_pal_emulator: UNIMPLEMENTED PAL CALL %lu!!!!\n",
 				index);
 		break;
 	}
@@ -434,7 +449,7 @@
 
 /* Provide only one LP to guest */
 static int 
-acpi_update_lsapic (acpi_table_entry_header *header)
+acpi_update_lsapic (acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_lsapic *lsapic;
 
@@ -529,8 +544,8 @@
 	strcpy(xsdt->asl_compiler_id, "XEN");
 	xsdt->asl_compiler_revision = (XEN_VERSION<<16)|(XEN_SUBVERSION);
 
-	xsdt->table_offset_entry[0] = dom_pa(fadt);
-	tables->madt_ptr = dom_pa(madt);
+	xsdt->table_offset_entry[0] = dom_pa((unsigned long) fadt);
+	tables->madt_ptr = dom_pa((unsigned long) madt);
 
 	xsdt->checksum = generate_acpi_checksum(xsdt, xsdt->length);
 
@@ -547,8 +562,8 @@
 	facs->version = 1;
 	facs->length = sizeof(struct facs_descriptor_rev2);
 
-	fadt->xfirmware_ctrl = dom_pa(facs);
-	fadt->Xdsdt = dom_pa(dsdt);
+	fadt->xfirmware_ctrl = dom_pa((unsigned long) facs);
+	fadt->Xdsdt = dom_pa((unsigned long) dsdt);
 
 	/*
 	 * All of the below FADT entries are filled it to prevent warnings
@@ -558,15 +573,15 @@
 	fadt->pm1_evt_len = 4;
 	fadt->xpm1a_evt_blk.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
 	fadt->xpm1a_evt_blk.register_bit_width = 8;
-	fadt->xpm1a_evt_blk.address = dom_pa(&tables->pm1a_evt_blk);
+	fadt->xpm1a_evt_blk.address = dom_pa((unsigned long) &tables->pm1a_evt_blk);
 	fadt->pm1_cnt_len = 1;
 	fadt->xpm1a_cnt_blk.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
 	fadt->xpm1a_cnt_blk.register_bit_width = 8;
-	fadt->xpm1a_cnt_blk.address = dom_pa(&tables->pm1a_cnt_blk);
+	fadt->xpm1a_cnt_blk.address = dom_pa((unsigned long) &tables->pm1a_cnt_blk);
 	fadt->pm_tm_len = 4;
 	fadt->xpm_tmr_blk.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
 	fadt->xpm_tmr_blk.register_bit_width = 8;
-	fadt->xpm_tmr_blk.address = dom_pa(&tables->pm_tmr_blk);
+	fadt->xpm_tmr_blk.address = dom_pa((unsigned long) &tables->pm_tmr_blk);
 
 	fadt->checksum = generate_acpi_checksum(fadt, fadt->length);
 
@@ -575,7 +590,7 @@
 	strcpy(rsdp->oem_id, "XEN");
 	rsdp->revision = 2; /* ACPI 2.0 includes XSDT */
 	rsdp->length = sizeof(struct acpi20_table_rsdp);
-	rsdp->xsdt_address = dom_pa(xsdt);
+	rsdp->xsdt_address = dom_pa((unsigned long) xsdt);
 
 	rsdp->checksum = generate_acpi_checksum(rsdp,
 	                                        ACPI_RSDP_CHECKSUM_LENGTH);
@@ -640,7 +655,7 @@
 	unsigned long maxmem = (d->max_pages - d->arch.sys_pgnr) * PAGE_SIZE;
 	const unsigned long start_mpaddr = ((d==dom0)?dom0_start:0);
 
-#	define MAKE_MD(typ, attr, start, end, abs) 	\	
+#	define MAKE_MD(typ, attr, start, end, abs) 	\
 	do {						\
 		md = efi_memmap + i++;			\
 		md->type = typ;				\
@@ -669,7 +684,7 @@
 	sal_ed      = (void *) cp; cp += sizeof(*sal_ed);
 	efi_memmap  = (void *) cp; cp += NUM_MEM_DESCS*sizeof(*efi_memmap);
 	bp	    = (void *) cp; cp += sizeof(*bp);
-	pfn        = (void *) cp; cp += NFUNCPTRS * 2 * sizeof(pfn);
+	pfn         = (void *) cp; cp += NFUNCPTRS * 2 * sizeof(pfn);
 	cmd_line    = (void *) cp;
 
 	if (args) {
@@ -690,19 +705,19 @@
 	cp += sizeof(FW_VENDOR) + (8-((unsigned long)cp & 7)); // round to 64-bit boundary
 
 	memcpy(fw_vendor,FW_VENDOR,sizeof(FW_VENDOR));
-	efi_systab->fw_vendor = dom_pa(fw_vendor);
+	efi_systab->fw_vendor = dom_pa((unsigned long) fw_vendor);
 	
 	efi_systab->fw_revision = 1;
-	efi_systab->runtime = (void *) dom_pa(efi_runtime);
+	efi_systab->runtime = (void *) dom_pa((unsigned long) efi_runtime);
 	efi_systab->nr_tables = NUM_EFI_SYS_TABLES;
-	efi_systab->tables = dom_pa(efi_tables);
+	efi_systab->tables = dom_pa((unsigned long) efi_tables);
 
 	efi_runtime->hdr.signature = EFI_RUNTIME_SERVICES_SIGNATURE;
 	efi_runtime->hdr.revision = EFI_RUNTIME_SERVICES_REVISION;
 	efi_runtime->hdr.headersize = sizeof(efi_runtime->hdr);
 #define EFI_HYPERCALL_PATCH(tgt,call) do { \
     dom_efi_hypercall_patch(d,FW_HYPERCALL_##call##_PADDR,FW_HYPERCALL_##call); \
-    tgt = dom_pa(pfn); \
+    tgt = dom_pa((unsigned long) pfn); \
     *pfn++ = FW_HYPERCALL_##call##_PADDR + start_mpaddr; \
     *pfn++ = 0; \
     } while (0)
@@ -719,7 +734,7 @@
 	EFI_HYPERCALL_PATCH(efi_runtime->reset_system,EFI_RESET_SYSTEM);
 
 	efi_tables[0].guid = SAL_SYSTEM_TABLE_GUID;
-	efi_tables[0].table = dom_pa(sal_systab);
+	efi_tables[0].table = dom_pa((unsigned long) sal_systab);
 	for (i = 1; i < NUM_EFI_SYS_TABLES; i++) {
 		efi_tables[i].guid = NULL_GUID;
 		efi_tables[i].table = 0;
@@ -773,7 +788,7 @@
 			dom_fw_fake_acpi(acpi_tables);
 
 			efi_tables[i].guid = ACPI_20_TABLE_GUID;
-			efi_tables[i].table = dom_pa(acpi_tables);
+			efi_tables[i].table = dom_pa((unsigned long) acpi_tables);
 			printf(" ACPI 2.0=0x%lx",efi_tables[i].table);
 			i++;
 		}
@@ -850,12 +865,12 @@
 		MAKE_MD(EFI_RESERVED_TYPE,0,0,0,0);
 	}
 
-	bp->efi_systab = dom_pa(fw_mem);
-	bp->efi_memmap = dom_pa(efi_memmap);
+	bp->efi_systab = dom_pa((unsigned long) fw_mem);
+	bp->efi_memmap = dom_pa((unsigned long) efi_memmap);
 	bp->efi_memmap_size = NUM_MEM_DESCS*sizeof(efi_memory_desc_t);
 	bp->efi_memdesc_size = sizeof(efi_memory_desc_t);
 	bp->efi_memdesc_version = 1;
-	bp->command_line = dom_pa(cmd_line);
+	bp->command_line = dom_pa((unsigned long) cmd_line);
 	bp->console_info.num_cols = 80;
 	bp->console_info.num_rows = 25;
 	bp->console_info.orig_x = 0;
diff -r 6c43118bdba8 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/domain.c	Sun Feb 26 16:53:02 2006
@@ -45,6 +45,7 @@
 #include <asm/vmx.h>
 #include <asm/vmx_vcpu.h>
 #include <asm/vmx_vpd.h>
+#include <asm/vmx_phy_mode.h>
 #include <asm/pal.h>
 #include <public/hvm/ioreq.h>
 
@@ -64,6 +65,15 @@
 	              unsigned long *, unsigned long *, unsigned long *);
 
 extern unsigned long dom_fw_setup(struct domain *, char *, int);
+/* FIXME: where these declarations should be there ? */
+extern void domain_pend_keyboard_interrupt(int);
+extern long platform_is_hp_ski(void);
+extern unsigned long allocate_metaphysical_rr(void);
+extern int allocate_rid_range(struct domain *, unsigned long);
+extern void sync_split_caches(void);
+extern void init_all_rr(struct vcpu *);
+extern void serial_input_init(void);
+
 static void init_switch_stack(struct vcpu *v);
 
 /* this belongs in include/asm, but there doesn't seem to be a suitable place */
@@ -274,8 +284,6 @@
 {
 	struct pt_regs *regs = vcpu_regs (v);
 	struct domain *d = v->domain;
-	int i, rc, ret;
-	unsigned long progress = 0;
 
 	printf("arch_set_info_guest\n");
 	if ( test_bit(_VCPUF_initialised, &v->vcpu_flags) )
@@ -303,7 +311,7 @@
  	v->vcpu_info->arch.evtchn_vector = c->vcpu.evtchn_vector;
 	if ( c->vcpu.privregs && copy_from_user(v->arch.privregs,
 			   c->vcpu.privregs, sizeof(mapped_regs_t))) {
-	    printk("Bad ctxt address in arch_set_info_guest: 0x%lx\n", c->vcpu.privregs);
+	    printk("Bad ctxt address in arch_set_info_guest: %p\n", c->vcpu.privregs);
 	    return -EFAULT;
 	}
 
@@ -330,9 +338,7 @@
 {
 	struct domain *d = v->domain;
 	struct pt_regs *regs;
-	struct ia64_boot_param *bp;
 	extern char saved_command_line[];
-
 
 #ifdef CONFIG_DOMAIN0_CONTIGUOUS
 	if (d == dom0) start_pc += dom0_start;
@@ -383,8 +389,9 @@
 static struct page * assign_new_domain0_page(unsigned long mpaddr)
 {
 	if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
-		printk("assign_new_domain0_page: bad domain0 mpaddr %p!\n",mpaddr);
-printk("assign_new_domain0_page: start=%p,end=%p!\n",dom0_start,dom0_start+dom0_size);
+		printk("assign_new_domain0_page: bad domain0 mpaddr 0x%lx!\n",mpaddr);
+		printk("assign_new_domain0_page: start=0x%lx,end=0x%lx!\n",
+			dom0_start, dom0_start+dom0_size);
 		while(1);
 	}
 	return mfn_to_page((mpaddr >> PAGE_SHIFT));
@@ -430,12 +437,13 @@
 			if (p) memset(__va(page_to_maddr(p)),0,PAGE_SIZE);
 		}
 		if (unlikely(!p)) {
-printf("assign_new_domain_page: Can't alloc!!!! Aaaargh!\n");
+			printf("assign_new_domain_page: Can't alloc!!!! Aaaargh!\n");
 			return(p);
 		}
-if (unlikely(page_to_maddr(p) > vhpt_paddr && page_to_maddr(p) < vhpt_pend)) {
-  printf("assign_new_domain_page: reassigned vhpt page %p!!\n",page_to_maddr(p));
-}
+		if (unlikely(page_to_maddr(p) > vhpt_paddr && page_to_maddr(p) < vhpt_pend)) {
+			printf("assign_new_domain_page: reassigned vhpt page 0x%lx!!\n",
+				page_to_maddr(p));
+		}
 		set_pte(pte, pfn_pte(page_to_maddr(p) >> PAGE_SHIFT,
 			__pgprot(__DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX)));
 	}
@@ -532,8 +540,8 @@
 #ifdef CONFIG_DOMAIN0_CONTIGUOUS
 	if (d == dom0) {
 		if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
-			//printk("lookup_domain_mpa: bad dom0 mpaddr %p!\n",mpaddr);
-//printk("lookup_domain_mpa: start=%p,end=%p!\n",dom0_start,dom0_start+dom0_size);
+			//printk("lookup_domain_mpa: bad dom0 mpaddr 0x%lx!\n",mpaddr);
+			//printk("lookup_domain_mpa: start=0x%lx,end=0x%lx!\n",dom0_start,dom0_start+dom0_size);
 			mpafoo(mpaddr);
 		}
 		pte_t pteval = pfn_pte(mpaddr >> PAGE_SHIFT,
@@ -561,8 +569,8 @@
 	if ((mpaddr >> PAGE_SHIFT) < d->max_pages) {
 		if (assign_new_domain_page(d,mpaddr)) goto tryagain;
 	}
-	printk("lookup_domain_mpa: bad mpa %p (> %p\n",
-		mpaddr,d->max_pages<<PAGE_SHIFT);
+	printk("lookup_domain_mpa: bad mpa 0x%lx (> 0x%lx)\n",
+		mpaddr, (unsigned long) d->max_pages<<PAGE_SHIFT);
 	mpafoo(mpaddr);
 	return 0;
 }
@@ -575,7 +583,7 @@
 	unsigned long imva;
 
 	pte &= _PAGE_PPN_MASK;
-	imva = __va(pte);
+	imva = (unsigned long) __va(pte);
 	imva |= mpaddr & ~PAGE_MASK;
 	return(imva);
 }
@@ -604,13 +612,13 @@
 {
 	int remain;
 
-	if (IS_XEN_ADDRESS(dom0,src)) {
+	if (IS_XEN_ADDRESS(dom0,(unsigned long) src)) {
 		memcpy(dst,src,size);
 	}
 	else {
 		printf("About to call __copy_from_user(%p,%p,%d)\n",
 			dst,src,size);
-		while (remain = __copy_from_user(dst,src,size)) {
+		while ((remain = __copy_from_user(dst,src,size)) != 0) {
 			printf("incomplete user copy, %d remain of %d\n",
 				remain,size);
 			dst += size - remain; src += size - remain;
@@ -621,16 +629,15 @@
 
 void loaddomainelfimage(struct domain *d, unsigned long image_start)
 {
-	char *elfbase = image_start;
+	char *elfbase = (char *) image_start;
 	//Elf_Ehdr *ehdr = (Elf_Ehdr *)image_start;
 	Elf_Ehdr ehdr;
 	Elf_Phdr phdr;
-	int h, filesz, memsz, paddr;
+	int h, filesz, memsz;
 	unsigned long elfaddr, dom_mpaddr, dom_imva;
 	struct page *p;
-	unsigned long pteval;
   
-	copy_memory(&ehdr,image_start,sizeof(Elf_Ehdr));
+	copy_memory(&ehdr, (void *) image_start, sizeof(Elf_Ehdr));
 	for ( h = 0; h < ehdr.e_phnum; h++ ) {
 		copy_memory(&phdr,elfbase + ehdr.e_phoff + (h*ehdr.e_phentsize),
 		sizeof(Elf_Phdr));
@@ -639,7 +646,7 @@
 	        continue;
 	}
 	filesz = phdr.p_filesz; memsz = phdr.p_memsz;
-	elfaddr = elfbase + phdr.p_offset;
+	elfaddr = (unsigned long) elfbase + phdr.p_offset;
 	dom_mpaddr = phdr.p_paddr;
 //printf("p_offset: %x, size=%x\n",elfaddr,filesz);
 #ifdef CONFIG_DOMAIN0_CONTIGUOUS
@@ -648,9 +655,9 @@
 			printf("Domain0 doesn't fit in allocated space!\n");
 			while(1);
 		}
-		dom_imva = __va(dom_mpaddr + dom0_start);
-		copy_memory(dom_imva,elfaddr,filesz);
-		if (memsz > filesz) memset(dom_imva+filesz,0,memsz-filesz);
+		dom_imva = (unsigned long) __va(dom_mpaddr + dom0_start);
+		copy_memory((void *) dom_imva, (void *) elfaddr, filesz);
+		if (memsz > filesz) memset((void *) dom_imva+filesz, 0, memsz-filesz);
 //FIXME: This test for code seems to find a lot more than objdump -x does
 		if (phdr.p_flags & PF_X) privify_memory(dom_imva,filesz);
 	}
@@ -659,20 +666,20 @@
 	while (memsz > 0) {
 		p = assign_new_domain_page(d,dom_mpaddr);
 		if (unlikely(!p)) BUG();
-		dom_imva = __va(page_to_maddr(p));
+		dom_imva = (unsigned long) __va(page_to_maddr(p));
 		if (filesz > 0) {
 			if (filesz >= PAGE_SIZE)
-				copy_memory(dom_imva,elfaddr,PAGE_SIZE);
+				copy_memory((void *) dom_imva, (void *) elfaddr, PAGE_SIZE);
 			else { // copy partial page, zero the rest of page
-				copy_memory(dom_imva,elfaddr,filesz);
-				memset(dom_imva+filesz,0,PAGE_SIZE-filesz);
+				copy_memory((void *) dom_imva, (void *) elfaddr, filesz);
+				memset((void *) dom_imva+filesz, 0, PAGE_SIZE-filesz);
 			}
 //FIXME: This test for code seems to find a lot more than objdump -x does
 			if (phdr.p_flags & PF_X)
 				privify_memory(dom_imva,PAGE_SIZE);
 		}
 		else if (memsz > 0) // always zero out entire page
-			memset(dom_imva,0,PAGE_SIZE);
+			memset((void *) dom_imva, 0, PAGE_SIZE);
 		memsz -= PAGE_SIZE; filesz -= PAGE_SIZE;
 		elfaddr += PAGE_SIZE; dom_mpaddr += PAGE_SIZE;
 	}
@@ -687,33 +694,33 @@
 	copy_memory(&ehdr,elfbase,sizeof(Elf_Ehdr));
 
 	if ( !elf_sanity_check(&ehdr) ) {
-	    printk("ELF sanity check failed.\n");
-	    return -EINVAL;
+		printk("ELF sanity check failed.\n");
+		return -EINVAL;
 	}
 
 	if ( (ehdr.e_phoff + (ehdr.e_phnum * ehdr.e_phentsize)) > elfsize )
 	{
-	    printk("ELF program headers extend beyond end of image.\n");
-	    return -EINVAL;
+		printk("ELF program headers extend beyond end of image.\n");
+		return -EINVAL;
 	}
 
 	if ( (ehdr.e_shoff + (ehdr.e_shnum * ehdr.e_shentsize)) > elfsize )
 	{
-	    printk("ELF section headers extend beyond end of image.\n");
-	    return -EINVAL;
+		printk("ELF section headers extend beyond end of image.\n");
+		return -EINVAL;
 	}
 
 #if 0
 	/* Find the section-header strings table. */
 	if ( ehdr.e_shstrndx == SHN_UNDEF )
 	{
-	    printk("ELF image has no section-header strings table (shstrtab).\n");
-	    return -EINVAL;
+		printk("ELF image has no section-header strings table (shstrtab).\n");
+		return -EINVAL;
 	}
 #endif
 
 	*entry = ehdr.e_entry;
-printf("parsedomainelfimage: entry point = %p\n",*entry);
+	printf("parsedomainelfimage: entry point = 0x%lx\n", *entry);
 
 	return 0;
 }
@@ -725,22 +732,21 @@
 	if (platform_is_hp_ski()) {
 	dom0_size = 128*1024*1024; //FIXME: Should be configurable
 	}
-	printf("alloc_dom0: starting (initializing %d MB...)\n",dom0_size/(1024*1024));
+	printf("alloc_dom0: starting (initializing %lu MB...)\n",dom0_size/(1024*1024));
  
-     /* FIXME: The first trunk (say 256M) should always be assigned to
-      * Dom0, since Dom0's physical == machine address for DMA purpose.
-      * Some old version linux, like 2.4, assumes physical memory existing
-      * in 2nd 64M space.
-      */
-     dom0_start = alloc_boot_pages(
-         dom0_size >> PAGE_SHIFT, dom0_align >> PAGE_SHIFT);
-     dom0_start <<= PAGE_SHIFT;
+	/* FIXME: The first trunk (say 256M) should always be assigned to
+	 * Dom0, since Dom0's physical == machine address for DMA purpose.
+	 * Some old version linux, like 2.4, assumes physical memory existing
+	 * in 2nd 64M space.
+	 */
+	dom0_start = alloc_boot_pages(dom0_size >> PAGE_SHIFT, dom0_align >> PAGE_SHIFT);
+	dom0_start <<= PAGE_SHIFT;
 	if (!dom0_start) {
-	printf("construct_dom0: can't allocate contiguous memory size=%p\n",
+	printf("alloc_dom0: can't allocate contiguous memory size=%lu\n",
 		dom0_size);
 	while(1);
 	}
-	printf("alloc_dom0: dom0_start=%p\n",dom0_start);
+	printf("alloc_dom0: dom0_start=0x%lx\n", dom0_start);
 #else
 	dom0_start = 0;
 #endif
@@ -768,13 +774,8 @@
 	               unsigned long initrd_start, unsigned long initrd_len,
 	               char *cmdline)
 {
-	char *dst;
 	int i, rc;
-	unsigned long pfn, mfn;
-	unsigned long nr_pt_pages;
-	unsigned long count;
 	unsigned long alloc_start, alloc_end;
-	struct page_info *page = NULL;
 	start_info_t *si;
 	struct vcpu *v = d->vcpu[0];
 
@@ -785,7 +786,15 @@
 	unsigned long pkern_end;
 	unsigned long pinitrd_start = 0;
 	unsigned long pstart_info;
-	unsigned long ret, progress = 0;
+#if 0
+	char *dst;
+	unsigned long nr_pt_pages;
+	unsigned long count;
+#endif
+#ifdef VALIDATE_VT
+	unsigned long mfn;
+	struct page_info *page = NULL;
+#endif
 
 //printf("construct_dom0: starting\n");
 
@@ -841,7 +850,7 @@
              pinitrd_start=(dom0_start+dom0_size) -
                           (PAGE_ALIGN(initrd_len) + 4*1024*1024);
 
-             memcpy(__va(pinitrd_start),initrd_start,initrd_len);
+             memcpy(__va(pinitrd_start), (void *) initrd_start, initrd_len);
              pstart_info = PAGE_ALIGN(pinitrd_start + initrd_len);
         } else {
              pstart_info = PAGE_ALIGN(pkern_end);
@@ -859,7 +868,8 @@
 	{
 	    printk("Initial guest OS requires too much space\n"
 	           "(%luMB is greater than %luMB limit)\n",
-	           (pkern_end-pkern_start)>>20, (d->max_pages<<PAGE_SHIFT)>>20);
+	           (pkern_end-pkern_start)>>20,
+	           (unsigned long) (d->max_pages<<PAGE_SHIFT)>>20);
 	    return -ENOMEM;
 	}
 
diff -r 6c43118bdba8 xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/hypercall.c	Sun Feb 26 16:53:02 2006
@@ -16,10 +16,15 @@
 
 #include <asm/vcpu.h>
 #include <asm/dom_fw.h>
+#include <public/dom0_ops.h>
+#include <public/event_channel.h>
 #include <public/memory.h>
 #include <public/sched.h>
 
 extern unsigned long translate_domain_mpaddr(unsigned long);
+/* FIXME: where these declarations should be there ? */
+extern int dump_privop_counts_to_user(char *, int);
+extern int zero_privop_counts_to_user(char *, int);
 
 unsigned long idle_when_pending = 0;
 unsigned long pal_halt_light_count = 0;
@@ -135,12 +140,12 @@
 		regs->r8 = EFI_UNSUPPORTED;
 		break;
 	    case FW_HYPERCALL_EFI_GET_TIME:
-		tv = vcpu_get_gr(v,32);
-		tc = vcpu_get_gr(v,33);
+		tv = (unsigned long *) vcpu_get_gr(v,32);
+		tc = (unsigned long *) vcpu_get_gr(v,33);
 		//printf("efi_get_time(%p,%p) called...",tv,tc);
-		tv = __va(translate_domain_mpaddr(tv));
-		if (tc) tc = __va(translate_domain_mpaddr(tc));
-		regs->r8 = (*efi.get_time)(tv,tc);
+		tv = (unsigned long *) __va(translate_domain_mpaddr((unsigned long) tv));
+		if (tc) tc = (unsigned long *) __va(translate_domain_mpaddr((unsigned long) tc));
+		regs->r8 = (*efi.get_time)((efi_time_t *) tv, (efi_time_cap_t *) tc);
 		//printf("and returns %lx\n",regs->r8);
 		break;
 	    case FW_HYPERCALL_EFI_SET_TIME:
@@ -161,23 +166,23 @@
 		break;
 	    case 0xffff:
 		regs->r8 = dump_privop_counts_to_user(
-			vcpu_get_gr(v,32),
-			vcpu_get_gr(v,33));
+			(char *) vcpu_get_gr(v,32),
+			(int) vcpu_get_gr(v,33));
 		break;
 	    case 0xfffe:
 		regs->r8 = zero_privop_counts_to_user(
-			vcpu_get_gr(v,32),
-			vcpu_get_gr(v,33));
+			(char *) vcpu_get_gr(v,32),
+			(int) vcpu_get_gr(v,33));
 		break;
 	    case __HYPERVISOR_dom0_op:
-		regs->r8 = do_dom0_op(regs->r14);
+		regs->r8 = do_dom0_op((struct dom0_op *) regs->r14);
 		break;
 
 	    case __HYPERVISOR_memory_op:
 		/* we don't handle reservations; just return success */
 		{
 		    struct xen_memory_reservation reservation;
-		    void *arg = regs->r15;
+		    void *arg = (void *) regs->r15;
 
 		    switch(regs->r14) {
 		    case XENMEM_increase_reservation:
@@ -189,34 +194,34 @@
 			    regs->r8 = reservation.nr_extents;
 			break;
 		    default:
-			regs->r8 = do_memory_op(regs->r14, regs->r15);
+			regs->r8 = do_memory_op((int) regs->r14, (void *)regs->r15);
 			break;
 		    }
 		}
 		break;
 
 	    case __HYPERVISOR_event_channel_op:
-		regs->r8 = do_event_channel_op(regs->r14);
+		regs->r8 = do_event_channel_op((struct evtchn_op *) regs->r14);
 		break;
 
 	    case __HYPERVISOR_grant_table_op:
-		regs->r8 = do_grant_table_op(regs->r14, regs->r15, regs->r16);
+		regs->r8 = do_grant_table_op((unsigned int) regs->r14, (void *) regs->r15, (unsigned int) regs->r16);
 		break;
 
 	    case __HYPERVISOR_console_io:
-		regs->r8 = do_console_io(regs->r14, regs->r15, regs->r16);
+		regs->r8 = do_console_io((int) regs->r14, (int) regs->r15, (char *) regs->r16);
 		break;
 
 	    case __HYPERVISOR_xen_version:
-		regs->r8 = do_xen_version(regs->r14, regs->r15);
+		regs->r8 = do_xen_version((int) regs->r14, (void *) regs->r15);
 		break;
 
 	    case __HYPERVISOR_multicall:
-		regs->r8 = do_multicall(regs->r14, regs->r15);
+		regs->r8 = do_multicall((struct multicall_entry *) regs->r14, (unsigned int) regs->r15);
 		break;
 
 	    default:
-		printf("unknown hypercall %x\n", regs->r2);
+		printf("unknown hypercall %lx\n", regs->r2);
 		regs->r8 = do_ni_hypercall();
 	}
 	return 1;
diff -r 6c43118bdba8 xen/arch/ia64/xen/irq.c
--- a/xen/arch/ia64/xen/irq.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/irq.c	Sun Feb 26 16:53:02 2006
@@ -286,7 +286,9 @@
 int handle_IRQ_event(unsigned int irq,
 		struct pt_regs *regs, struct irqaction *action)
 {
+#ifndef XEN
 	int status = 1;	/* Force the "do bottom halves" bit */
+#endif
 	int retval = 0;
 
 #ifndef XEN
@@ -657,8 +659,10 @@
 	if (!action)
 		return -ENOMEM;
 
+#ifdef XEN
+	action->handler = (void *) handler;
+#else
 	action->handler = handler;
-#ifndef XEN
 	action->flags = irqflags;
 	action->mask = 0;
 #endif
@@ -698,7 +702,9 @@
 #endif
 {
 	irq_desc_t *desc;
+#ifndef XEN
 	struct irqaction **p;
+#endif
 	unsigned long flags;
 
 	if (irq >= NR_IRQS)
@@ -755,7 +761,8 @@
  * disabled.
  */
 
-static DECLARE_MUTEX(probe_sem);
+#ifndef XEN
+static int DECLARE_MUTEX(probe_sem);
 
 /**
  *	probe_irq_on	- begin an interrupt autodetect
@@ -765,7 +772,6 @@
  *
  */
 
-#ifndef XEN
 unsigned long probe_irq_on(void)
 {
 	unsigned int i;
@@ -936,7 +942,9 @@
 
 int setup_irq(unsigned int irq, struct irqaction * new)
 {
+#ifndef XEN
 	int shared = 0;
+#endif
 	unsigned long flags;
 	struct irqaction *old, **p;
 	irq_desc_t *desc = irq_descp(irq);
@@ -1371,7 +1379,7 @@
     return 0;
 }
 
-int pirq_guest_bind(struct vcpu *d, int irq, int will_share)
+int pirq_guest_bind(struct vcpu *v, int irq, int will_share)
 {
     irq_desc_t         *desc = &irq_desc[irq];
     irq_guest_action_t *action;
@@ -1431,7 +1439,7 @@
         goto out;
     }
 
-    action->guest[action->nr_guests++] = d;
+    action->guest[action->nr_guests++] = v->domain;
 
  out:
     spin_unlock_irqrestore(&desc->lock, flags);
@@ -1480,6 +1488,7 @@
 #ifdef XEN
 #ifdef IA64
 // this is a temporary hack until real console input is implemented
+extern void domain_pend_keyboard_interrupt(int irq);
 irqreturn_t guest_forward_keyboard_input(int irq, void *nada, struct pt_regs *regs)
 {
 	domain_pend_keyboard_interrupt(irq);
diff -r 6c43118bdba8 xen/arch/ia64/xen/mm_init.c
--- a/xen/arch/ia64/xen/mm_init.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/mm_init.c	Sun Feb 26 16:53:02 2006
@@ -47,6 +47,7 @@
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
 #include <asm/mca.h>
+#include <asm/vhpt.h>
 
 #ifndef XEN
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
@@ -63,7 +64,7 @@
 EXPORT_SYMBOL(vmem_map);
 #endif
 
-static int pgt_cache_water[2] = { 25, 50 };
+// static int pgt_cache_water[2] = { 25, 50 };
 
 struct page *zero_page_memmap_ptr;		/* map entry for zero page */
 EXPORT_SYMBOL(zero_page_memmap_ptr);
@@ -222,7 +223,7 @@
 ia64_set_rbs_bot (void)
 {
 #ifdef XEN
-	unsigned stack_size = MAX_USER_STACK_SIZE;
+	unsigned long stack_size = MAX_USER_STACK_SIZE;
 #else
 	unsigned long stack_size = current->rlim[RLIMIT_STACK].rlim_max & -16;
 #endif
@@ -279,7 +280,7 @@
 #endif
 }
 
-setup_gate (void)
+void setup_gate (void)
 {
 	printk("setup_gate not-implemented.\n");
 }
@@ -287,7 +288,10 @@
 void __devinit
 ia64_mmu_init (void *my_cpu_data)
 {
-	unsigned long psr, pta, impl_va_bits;
+	unsigned long psr, impl_va_bits;
+#if 0
+	unsigned long pta;
+#endif
 	extern void __devinit tlb_init (void);
 	int cpu;
 
diff -r 6c43118bdba8 xen/arch/ia64/xen/pcdp.c
--- a/xen/arch/ia64/xen/pcdp.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/pcdp.c	Sun Feb 26 16:53:02 2006
@@ -71,7 +71,9 @@
 {
 	struct pcdp *pcdp;
 	struct pcdp_uart *uart;
+#ifndef XEN
 	struct pcdp_device *dev, *end;
+#endif
 	int i, serial = 0;
 
 	pcdp = efi.hcdp;
diff -r 6c43118bdba8 xen/arch/ia64/xen/privop.c
--- a/xen/arch/ia64/xen/privop.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/privop.c	Sun Feb 26 16:53:02 2006
@@ -11,7 +11,12 @@
 #include <asm/processor.h>
 #include <asm/delay.h>	// Debug only
 #include <asm/dom_fw.h>
+#include <asm/vhpt.h>
 //#include <debug.h>
+
+/* FIXME: where these declarations should be there ? */
+extern int dump_reflect_counts(char *);
+extern void zero_reflect_counts(void);
 
 long priv_verbose=0;
 
@@ -600,7 +605,7 @@
 	if (__copy_from_user(&bundle,iip,sizeof(bundle)))
 #endif
 	{
-//printf("*** priv_handle_op: privop bundle @%p not mapped, retrying\n",iip);
+//printf("*** priv_handle_op: privop bundle at 0x%lx not mapped, retrying\n",iip);
 		return vcpu_force_data_miss(vcpu,regs->cr_iip);
 	}
 #if 0
@@ -613,8 +618,8 @@
 #endif
 	if (privop_trace) {
 		static long i = 400;
-		//if (i > 0) printf("privop @%p\n",iip);
-		if (i > 0) printf("priv_handle_op: @%p, itc=%lx, itm=%lx\n",
+		//if (i > 0) printf("priv_handle_op: at 0x%lx\n",iip);
+		if (i > 0) printf("priv_handle_op: privop trace at 0x%lx, itc=%lx, itm=%lx\n",
 			iip,ia64_get_itc(),ia64_get_itm());
 		i--;
 	}
@@ -727,7 +732,7 @@
 		break;
 	}
         //printf("We who are about do die salute you\n");
-	printf("handle_op: can't handle privop at 0x%lx (op=0x%016lx) slot %d (type=%d), ipsr=%p\n",
+	printf("priv_handle_op: can't handle privop at 0x%lx (op=0x%016lx) slot %d (type=%d), ipsr=0x%lx\n",
 		 iip, (UINT64)inst.inst, slot, slot_type, ipsr);
         //printf("vtop(0x%lx)==0x%lx\n", iip, tr_vtop(iip));
         //thread_mozambique("privop fault\n");
@@ -768,7 +773,7 @@
 		(void)vcpu_increment_iip(vcpu);
 	}
 	if (fault == IA64_ILLOP_FAULT)
-		printf("priv_emulate: priv_handle_op fails, isr=%p\n",isr);
+		printf("priv_emulate: priv_handle_op fails, isr=0x%lx\n",isr);
 	return fault;
 }
 
@@ -797,8 +802,7 @@
 char *hyperpriv_str[HYPERPRIVOP_MAX+1] = {
 	0, "rfi", "rsm.dt", "ssm.dt", "cover", "itc.d", "itc.i", "ssm.i",
 	"=ivr", "=tpr", "tpr=", "eoi", "itm=", "thash", "ptc.ga", "itr.d",
-	"=rr", "rr=", "kr=",
-	0
+	"=rr", "rr=", "kr="
 };
 
 unsigned long slow_hyperpriv_cnt[HYPERPRIVOP_MAX+1] = { 0 };
@@ -809,15 +813,14 @@
 int
 ia64_hyperprivop(unsigned long iim, REGS *regs)
 {
-	struct vcpu *v = (struct domain *) current;
-	INST64 inst;
+	struct vcpu *v = current;
 	UINT64 val;
 	UINT64 itir, ifa;
 
 // FIXME: Handle faults appropriately for these
 	if (!iim || iim > HYPERPRIVOP_MAX) {
 		printf("bad hyperprivop; ignored\n");
-		printf("iim=%d, iip=%p\n",iim,regs->cr_iip);
+		printf("iim=%lx, iip=0x%lx\n", iim, regs->cr_iip);
 		return 1;
 	}
 	slow_hyperpriv_cnt[iim]++;
@@ -946,48 +949,48 @@
 	for (i=0; i < 64; i++) sum += privcnt.Mpriv_cnt[i];
 	s += sprintf(s,"Privop statistics: (Total privops: %ld)\n",sum);
 	if (privcnt.mov_to_ar_imm)
-		s += sprintf(s,"%10d  %s [%d%%]\n", privcnt.mov_to_ar_imm,
+		s += sprintf(s,"%10ld  %s [%ld%%]\n", privcnt.mov_to_ar_imm,
 			"mov_to_ar_imm", (privcnt.mov_to_ar_imm*100L)/sum);
 	if (privcnt.mov_to_ar_reg)
-		s += sprintf(s,"%10d  %s [%d%%]\n", privcnt.mov_to_ar_reg,
+		s += sprintf(s,"%10ld  %s [%ld%%]\n", privcnt.mov_to_ar_reg,
 			"mov_to_ar_reg", (privcnt.mov_to_ar_reg*100L)/sum);
 	if (privcnt.mov_from_ar)
-		s += sprintf(s,"%10d  %s [%d%%]\n", privcnt.mov_from_ar,
+		s += sprintf(s,"%10ld  %s [%ld%%]\n", privcnt.mov_from_ar,
 			"privified-mov_from_ar", (privcnt.mov_from_ar*100L)/sum);
 	if (privcnt.ssm)
-		s += sprintf(s,"%10d  %s [%d%%]\n", privcnt.ssm,
+		s += sprintf(s,"%10ld  %s [%ld%%]\n", privcnt.ssm,
 			"ssm", (privcnt.ssm*100L)/sum);
 	if (privcnt.rsm)
-		s += sprintf(s,"%10d  %s [%d%%]\n", privcnt.rsm,
+		s += sprintf(s,"%10ld  %s [%ld%%]\n", privcnt.rsm,
 			"rsm", (privcnt.rsm*100L)/sum);
 	if (privcnt.rfi)
-		s += sprintf(s,"%10d  %s [%d%%]\n", privcnt.rfi,
+		s += sprintf(s,"%10ld  %s [%ld%%]\n", privcnt.rfi,
 			"rfi", (privcnt.rfi*100L)/sum);
 	if (privcnt.bsw0)
-		s += sprintf(s,"%10d  %s [%d%%]\n", privcnt.bsw0,
+		s += sprintf(s,"%10ld  %s [%ld%%]\n", privcnt.bsw0,
 			"bsw0", (privcnt.bsw0*100L)/sum);
 	if (privcnt.bsw1)
-		s += sprintf(s,"%10d  %s [%d%%]\n", privcnt.bsw1,
+		s += sprintf(s,"%10ld  %s [%ld%%]\n", privcnt.bsw1,
 			"bsw1", (privcnt.bsw1*100L)/sum);
 	if (privcnt.cover)
-		s += sprintf(s,"%10d  %s [%d%%]\n", privcnt.cover,
+		s += sprintf(s,"%10ld  %s [%ld%%]\n", privcnt.cover,
 			"cover", (privcnt.cover*100L)/sum);
 	if (privcnt.fc)
-		s += sprintf(s,"%10d  %s [%d%%]\n", privcnt.fc,
+		s += sprintf(s,"%10ld  %s [%ld%%]\n", privcnt.fc,
 			"privified-fc", (privcnt.fc*100L)/sum);
 	if (privcnt.cpuid)
-		s += sprintf(s,"%10d  %s [%d%%]\n", privcnt.cpuid,
+		s += sprintf(s,"%10ld  %s [%ld%%]\n", privcnt.cpuid,
 			"privified-getcpuid", (privcnt.cpuid*100L)/sum);
 	for (i=0; i < 64; i++) if (privcnt.Mpriv_cnt[i]) {
 		if (!Mpriv_str[i]) s += sprintf(s,"PRIVSTRING NULL!!\n");
-		else s += sprintf(s,"%10d  %s [%d%%]\n", privcnt.Mpriv_cnt[i],
+		else s += sprintf(s,"%10ld  %s [%ld%%]\n", privcnt.Mpriv_cnt[i],
 			Mpriv_str[i], (privcnt.Mpriv_cnt[i]*100L)/sum);
 		if (i == 0x24) { // mov from CR
 			s += sprintf(s,"            [");
 			for (j=0; j < 128; j++) if (from_cr_cnt[j]) {
 				if (!cr_str[j])
 					s += sprintf(s,"PRIVSTRING NULL!!\n");
-				s += sprintf(s,"%s(%d),",cr_str[j],from_cr_cnt[j]);
+				s += sprintf(s,"%s(%ld),",cr_str[j],from_cr_cnt[j]);
 			}
 			s += sprintf(s,"]\n");
 		}
@@ -996,7 +999,7 @@
 			for (j=0; j < 128; j++) if (to_cr_cnt[j]) {
 				if (!cr_str[j])
 					s += sprintf(s,"PRIVSTRING NULL!!\n");
-				s += sprintf(s,"%s(%d),",cr_str[j],to_cr_cnt[j]);
+				s += sprintf(s,"%s(%ld),",cr_str[j],to_cr_cnt[j]);
 			}
 			s += sprintf(s,"]\n");
 		}
@@ -1050,7 +1053,7 @@
 		s += sprintf(s,"%s:\n",v->instname);
 		for (j = 0; j < PRIVOP_COUNT_NADDRS; j++) {
 			if (!v->addr[j]) break;
-			s += sprintf(s," @%p #%ld\n",v->addr[j],v->count[j]);
+			s += sprintf(s," at 0x%lx #%ld\n",v->addr[j],v->count[j]);
 		}
 		if (v->overflow) 
 			s += sprintf(s," other #%ld\n",v->overflow);
@@ -1085,17 +1088,17 @@
 int dump_misc_stats(char *buf)
 {
 	char *s = buf;
-	s += sprintf(s,"Virtual TR translations: %d\n",tr_translate_count);
-	s += sprintf(s,"Virtual VHPT slow translations: %d\n",vhpt_translate_count);
-	s += sprintf(s,"Virtual VHPT fast translations: %d\n",fast_vhpt_translate_count);
-	s += sprintf(s,"Virtual DTLB translations: %d\n",dtlb_translate_count);
-	s += sprintf(s,"Physical translations: %d\n",phys_translate_count);
-	s += sprintf(s,"Recoveries to page fault: %d\n",recover_to_page_fault_count);
-	s += sprintf(s,"Recoveries to break fault: %d\n",recover_to_break_fault_count);
-	s += sprintf(s,"Idle when pending: %d\n",idle_when_pending);
-	s += sprintf(s,"PAL_HALT_LIGHT (no pending): %d\n",pal_halt_light_count);
-	s += sprintf(s,"context switches: %d\n",context_switch_count);
-	s += sprintf(s,"Lazy covers: %d\n",lazy_cover_count);
+	s += sprintf(s,"Virtual TR translations: %ld\n",tr_translate_count);
+	s += sprintf(s,"Virtual VHPT slow translations: %ld\n",vhpt_translate_count);
+	s += sprintf(s,"Virtual VHPT fast translations: %ld\n",fast_vhpt_translate_count);
+	s += sprintf(s,"Virtual DTLB translations: %ld\n",dtlb_translate_count);
+	s += sprintf(s,"Physical translations: %ld\n",phys_translate_count);
+	s += sprintf(s,"Recoveries to page fault: %ld\n",recover_to_page_fault_count);
+	s += sprintf(s,"Recoveries to break fault: %ld\n",recover_to_break_fault_count);
+	s += sprintf(s,"Idle when pending: %ld\n",idle_when_pending);
+	s += sprintf(s,"PAL_HALT_LIGHT (no pending): %ld\n",pal_halt_light_count);
+	s += sprintf(s,"context switches: %ld\n",context_switch_count);
+	s += sprintf(s,"Lazy covers: %ld\n",lazy_cover_count);
 	return s - buf;
 }
 
@@ -1120,17 +1123,17 @@
 	char *s = buf;
 	unsigned long total = 0;
 	for (i = 1; i <= HYPERPRIVOP_MAX; i++) total += slow_hyperpriv_cnt[i];
-	s += sprintf(s,"Slow hyperprivops (total %d):\n",total);
+	s += sprintf(s,"Slow hyperprivops (total %ld):\n",total);
 	for (i = 1; i <= HYPERPRIVOP_MAX; i++)
 		if (slow_hyperpriv_cnt[i])
-			s += sprintf(s,"%10d %s\n",
+			s += sprintf(s,"%10ld %s\n",
 				slow_hyperpriv_cnt[i], hyperpriv_str[i]);
 	total = 0;
 	for (i = 1; i <= HYPERPRIVOP_MAX; i++) total += fast_hyperpriv_cnt[i];
-	s += sprintf(s,"Fast hyperprivops (total %d):\n",total);
+	s += sprintf(s,"Fast hyperprivops (total %ld):\n",total);
 	for (i = 1; i <= HYPERPRIVOP_MAX; i++)
 		if (fast_hyperpriv_cnt[i])
-			s += sprintf(s,"%10d %s\n",
+			s += sprintf(s,"%10ld %s\n",
 				fast_hyperpriv_cnt[i], hyperpriv_str[i]);
 	return s - buf;
 }
diff -r 6c43118bdba8 xen/arch/ia64/xen/process.c
--- a/xen/arch/ia64/xen/process.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/process.c	Sun Feb 26 16:53:02 2006
@@ -33,8 +33,14 @@
 #include <xen/multicall.h>
 #include <asm/debugger.h>
 
-extern unsigned long vcpu_get_itir_on_fault(struct vcpu *, UINT64);
 extern void die_if_kernel(char *str, struct pt_regs *regs, long err);
+/* FIXME: where these declarations shold be there ? */
+extern void load_region_regs(struct vcpu *);
+extern void panic_domain(struct pt_regs *, const char *, ...);
+extern long platform_is_hp_ski(void);
+extern int ia64_hyperprivop(unsigned long, REGS *);
+extern int ia64_hypercall(struct pt_regs *regs);
+extern void vmx_do_launch(struct vcpu *);
 
 extern unsigned long dom0_start, dom0_size;
 
@@ -98,14 +104,17 @@
 	mpaddr = ((pteval & _PAGE_PPN_MASK) & ~mask) | (address & mask);
 	if (d == dom0) {
 		if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
-			//printk("translate_domain_pte: out-of-bounds dom0 mpaddr %p! itc=%lx...\n",mpaddr,ia64_get_itc());
+			/*
+			printk("translate_domain_pte: out-of-bounds dom0 mpaddr 0x%lx! itc=%lx...\n",
+				mpaddr, ia64_get_itc());
+			*/
 			tdpfoo();
 		}
 	}
 	else if ((mpaddr >> PAGE_SHIFT) > d->max_pages) {
 		if ((mpaddr & ~0x1fffL ) != (1L << 40))
-		printf("translate_domain_pte: bad mpa=%p (> %p),vadr=%p,pteval=%p,itir=%p\n",
-			mpaddr,d->max_pages<<PAGE_SHIFT,address,pteval,itir);
+		printf("translate_domain_pte: bad mpa=0x%lx (> 0x%lx),vadr=0x%lx,pteval=0x%lx,itir=0x%lx\n",
+			mpaddr, (unsigned long) d->max_pages<<PAGE_SHIFT, address, pteval, itir);
 		tdpfoo();
 	}
 	pteval2 = lookup_domain_mpa(d,mpaddr);
@@ -123,7 +132,8 @@
 
 	if (current->domain == dom0) {
 		if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
-			printk("translate_domain_mpaddr: out-of-bounds dom0 mpaddr %p! continuing...\n",mpaddr);
+			printk("translate_domain_mpaddr: out-of-bounds dom0 mpaddr 0x%lx! continuing...\n",
+				mpaddr);
 			tdpfoo();
 		}
 	}
@@ -150,7 +160,7 @@
 
 	s += sprintf(s,"Slow reflections by vector:\n");
 	for (i = 0, j = 0; i < 0x80; i++) {
-		if (cnt = slow_reflect_count[i]) {
+		if ( (cnt = slow_reflect_count[i]) != 0 ) {
 			s += sprintf(s,"0x%02x00:%10d, ",i,cnt);
 			if ((j++ & 3) == 3) s += sprintf(s,"\n");
 		}
@@ -158,7 +168,7 @@
 	if (j & 3) s += sprintf(s,"\n");
 	s += sprintf(s,"Fast reflections by vector:\n");
 	for (i = 0, j = 0; i < 0x80; i++) {
-		if (cnt = fast_reflect_count[i]) {
+		if ( (cnt = fast_reflect_count[i]) != 0 ) {
 			s += sprintf(s,"0x%02x00:%10d, ",i,cnt);
 			if ((j++ & 3) == 3) s += sprintf(s,"\n");
 		}
@@ -186,7 +196,6 @@
 
 void reflect_interruption(unsigned long isr, struct pt_regs *regs, unsigned long vector)
 {
-	unsigned long vcpu_get_ipsr_int_state(struct vcpu *,unsigned long);
 	struct vcpu *v = current;
 
 	if (!PSCB(v,interrupt_collection_enabled))
@@ -205,7 +214,7 @@
 #ifdef CONFIG_SMP
 #warning "SMP FIXME: sharedinfo doesn't handle smp yet, need page per vcpu"
 #endif
-	regs->r31 = &(((mapped_regs_t *)SHARED_ARCHINFO_ADDR)->ipsr);
+	regs->r31 = (unsigned long) &(((mapped_regs_t *)SHARED_ARCHINFO_ADDR)->ipsr);
 
 	PSCB(v,interrupt_delivery_enabled) = 0;
 	PSCB(v,interrupt_collection_enabled) = 0;
@@ -219,13 +228,13 @@
 
 void reflect_extint(struct pt_regs *regs)
 {
-	extern unsigned long vcpu_verbose, privop_trace;
+//	extern unsigned long vcpu_verbose, privop_trace;
 	unsigned long isr = regs->cr_ipsr & IA64_PSR_RI;
 	struct vcpu *v = current;
-	static first_extint = 1;
+	static int first_extint = 1;
 
 	if (first_extint) {
-		printf("Delivering first extint to domain: isr=%p, iip=%p\n",isr,regs->cr_iip);
+		printf("Delivering first extint to domain: isr=0x%lx, iip=0x%lx\n", isr, regs->cr_iip);
 		//privop_trace = 1; vcpu_verbose = 1;
 		first_extint = 0;
 	}
@@ -297,11 +306,11 @@
 			// should never happen.  If it does, region 0 addr may
 			// indicate a bad xen pointer
 			printk("*** xen_handle_domain_access: exception table"
-			       " lookup failed, iip=%p, addr=%p, spinning...\n",
-				iip,address);
+			       " lookup failed, iip=0x%lx, addr=0x%lx, spinning...\n",
+				iip, address);
 			panic_domain(regs,"*** xen_handle_domain_access: exception table"
-			       " lookup failed, iip=%p, addr=%p, spinning...\n",
-				iip,address);
+			       " lookup failed, iip=0x%lx, addr=0x%lx, spinning...\n",
+				iip, address);
 		}
 		return;
 	}
@@ -329,9 +338,12 @@
 	    unsigned long arg6, unsigned long arg7, unsigned long stack)
 {
 	struct pt_regs *regs = (struct pt_regs *) &stack;
-	unsigned long code, error = isr;
+	unsigned long code;
+#if 0
+	unsigned long error = isr;
+	int result, sig;
+#endif
 	char buf[128];
-	int result, sig;
 	static const char *reason[] = {
 		"IA-64 Illegal Operation fault",
 		"IA-64 Privileged Operation fault",
@@ -543,7 +555,6 @@
 /**/	static int last_fd, last_count;	// FIXME FIXME FIXME
 /**/					// BROKEN FOR MULTIPLE DOMAINS & SMP
 /**/	struct ssc_disk_stat { int fd; unsigned count;} *stat, last_stat;
-	extern unsigned long vcpu_verbose, privop_trace;
 
 	arg0 = vcpu_get_gr(current,32);
 	switch(ssc) {
@@ -588,11 +599,11 @@
 		arg3 = vcpu_get_gr(current,35);
 		if (arg2) {	// metaphysical address of descriptor
 			struct ssc_disk_req *req;
-			unsigned long mpaddr, paddr;
+			unsigned long mpaddr;
 			long len;
 
 			arg2 = translate_domain_mpaddr(arg2);
-			req = (struct disk_req *)__va(arg2);
+			req = (struct ssc_disk_req *) __va(arg2);
 			req->len &= 0xffffffffL;	// avoid strange bug
 			len = req->len;
 /**/			last_fd = arg1;
@@ -640,7 +651,8 @@
 		vcpu_set_gr(current,8,-1L,0);
 		break;
 	    default:
-		printf("ia64_handle_break: bad ssc code %lx, iip=%p, b0=%p... spinning\n",ssc,regs->cr_iip,regs->b0);
+		printf("ia64_handle_break: bad ssc code %lx, iip=0x%lx, b0=0x%lx... spinning\n",
+			ssc, regs->cr_iip, regs->b0);
 		while(1);
 		break;
 	}
@@ -696,9 +708,9 @@
 ia64_handle_privop (unsigned long ifa, struct pt_regs *regs, unsigned long isr, unsigned long itir)
 {
 	IA64FAULT vector;
-	struct domain *d = current->domain;
 	struct vcpu *v = current;
-	vector = priv_emulate(current,regs,isr);
+
+	vector = priv_emulate(v,regs,isr);
 	if (vector != IA64_NO_FAULT && vector != IA64_RFI_IN_PROGRESS) {
 		// Note: if a path results in a vector to reflect that requires
 		// iha/itir (e.g. vcpu_force_data_miss), they must be set there
@@ -712,8 +724,7 @@
 void
 ia64_handle_reflection (unsigned long ifa, struct pt_regs *regs, unsigned long isr, unsigned long iim, unsigned long vector)
 {
-	struct domain *d = (struct domain *) current->domain;
-	struct vcpu *v = (struct domain *) current;
+	struct vcpu *v = current;
 	unsigned long check_lazy_cover = 0;
 	unsigned long psr = regs->cr_ipsr;
 
@@ -753,7 +764,7 @@
 		}
 #endif
 printf("*** NaT fault... attempting to handle as privop\n");
-printf("isr=%p, ifa=%p,iip=%p,ipsr=%p\n",isr,ifa,regs->cr_iip,psr);
+printf("isr=0x%lx, ifa=0x%lx, iip=0x%lx, ipsr=0x%lx\n", isr, ifa, regs->cr_iip, psr);
 		//regs->eml_unat = 0;  FIXME: DO WE NEED THIS???
 		// certain NaT faults are higher priority than privop faults
 		vector = priv_emulate(v,regs,isr);
@@ -800,8 +811,7 @@
 	unsigned int op, unsigned int nr_args, ...)
 {
     struct mc_state *mcs = &mc_state[smp_processor_id()];
-    VCPU *vcpu = current;
-    struct cpu_user_regs *regs = vcpu_regs(vcpu);
+    struct vcpu *v = current;
     unsigned int i;
     va_list args;
 
@@ -809,25 +819,25 @@
     if ( test_bit(_MCSF_in_multicall, &mcs->flags) ) {
 	panic("PREEMPT happen in multicall\n");	// Not support yet
     } else {
-	vcpu_set_gr(vcpu, 2, op, 0);
+	vcpu_set_gr(v, 2, op, 0);
 	for ( i = 0; i < nr_args; i++) {
 	    switch (i) {
-	    case 0: vcpu_set_gr(vcpu, 14, va_arg(args, unsigned long), 0);
+	    case 0: vcpu_set_gr(v, 14, va_arg(args, unsigned long), 0);
 		    break;
-	    case 1: vcpu_set_gr(vcpu, 15, va_arg(args, unsigned long), 0);
+	    case 1: vcpu_set_gr(v, 15, va_arg(args, unsigned long), 0);
 		    break;
-	    case 2: vcpu_set_gr(vcpu, 16, va_arg(args, unsigned long), 0);
+	    case 2: vcpu_set_gr(v, 16, va_arg(args, unsigned long), 0);
 		    break;
-	    case 3: vcpu_set_gr(vcpu, 17, va_arg(args, unsigned long), 0);
+	    case 3: vcpu_set_gr(v, 17, va_arg(args, unsigned long), 0);
 		    break;
-	    case 4: vcpu_set_gr(vcpu, 18, va_arg(args, unsigned long), 0);
+	    case 4: vcpu_set_gr(v, 18, va_arg(args, unsigned long), 0);
 		    break;
 	    default: panic("Too many args for hypercall continuation\n");
 		    break;
 	    }
 	}
     }
-    vcpu->arch.hypercall_continuation = 1;
+    v->arch.hypercall_continuation = 1;
     va_end(args);
     return op;
 }
diff -r 6c43118bdba8 xen/arch/ia64/xen/regionreg.c
--- a/xen/arch/ia64/xen/regionreg.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/regionreg.c	Sun Feb 26 16:53:02 2006
@@ -18,6 +18,8 @@
 extern void ia64_new_rr7(unsigned long rid,void *shared_info, void *shared_arch_info, unsigned long p_vhpt, unsigned long v_pal);
 extern void *pal_vaddr;
 
+/* FIXME: where these declarations should be there ? */
+extern void panic_domain(struct pt_regs *, const char *, ...);
 
 #define	IA64_MIN_IMPL_RID_BITS	(IA64_MIN_IMPL_RID_MSB+1)
 #define	IA64_MAX_IMPL_RID_BITS	24
@@ -142,7 +144,7 @@
 	// setup domain struct
 	d->arch.rid_bits = ridbits;
 	d->arch.starting_rid = i << IA64_MIN_IMPL_RID_BITS; d->arch.ending_rid = (i+n_rid_blocks) << IA64_MIN_IMPL_RID_BITS;
-printf("###allocating rid_range, domain %p: starting_rid=%lx, ending_rid=%lx\n",
+printf("###allocating rid_range, domain %p: starting_rid=%x, ending_rid=%x\n",
 d,d->arch.starting_rid, d->arch.ending_rid);
 	
 	return 1;
@@ -220,8 +222,8 @@
 	newrid = v->arch.starting_rid + rrv.rid;
 
 	if (newrid > v->arch.ending_rid) {
-		printk("can't set rr%d to %lx, starting_rid=%lx,"
-			"ending_rid=%lx, val=%lx\n", rreg, newrid,
+		printk("can't set rr%d to %lx, starting_rid=%x,"
+			"ending_rid=%x, val=%lx\n", (int) rreg, newrid,
 			v->arch.starting_rid,v->arch.ending_rid,val);
 		return 0;
 	}
@@ -252,7 +254,7 @@
 	if (rreg == 0) v->arch.metaphysical_saved_rr0 =
 		vmMangleRID(newrrv.rrval);
 	if (rreg == 7) ia64_new_rr7(vmMangleRID(newrrv.rrval),v->vcpu_info,
-				v->arch.privregs, vhpt_paddr, pal_vaddr);
+				v->arch.privregs, vhpt_paddr, (unsigned long) pal_vaddr);
 	else set_rr(rr,newrrv.rrval);
 #endif
 	return 1;
@@ -262,11 +264,12 @@
 int set_metaphysical_rr0(void)
 {
 	struct vcpu *v = current;
-	ia64_rr rrv;
+//	ia64_rr rrv;
 	
 //	rrv.ve = 1; 	FIXME: TURN ME BACK ON WHEN VHPT IS WORKING
 	ia64_set_rr(0,v->arch.metaphysical_rr0);
 	ia64_srlz_d();
+	return 1;
 }
 
 // validates/changes region registers 0-6 in the currently executing domain
diff -r 6c43118bdba8 xen/arch/ia64/xen/sn_console.c
--- a/xen/arch/ia64/xen/sn_console.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/sn_console.c	Sun Feb 26 16:53:02 2006
@@ -9,7 +9,13 @@
 #include <asm/sn/sn_sal.h>
 #include <xen/serial.h>
 
-void sn_putc(struct serial_port *, char);
+/*
+ * sn_putc - Send a character to the console, polled or interrupt mode
+ */
+static void sn_putc(struct serial_port *port, char c)
+{
+	ia64_sn_console_putc(c);
+}
 
 static struct uart_driver sn_sal_console = {
 	.putc = sn_putc,
@@ -75,11 +81,3 @@
 
 	return 0;
 }
-
-/*
- * sn_putc - Send a character to the console, polled or interrupt mode
- */
-void sn_putc(struct serial_port *port, char c)
-{
-	return ia64_sn_console_putc(c);
-}
diff -r 6c43118bdba8 xen/arch/ia64/xen/vcpu.c
--- a/xen/arch/ia64/xen/vcpu.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/vcpu.c	Sun Feb 26 16:53:02 2006
@@ -21,7 +21,15 @@
 #include <asm/processor.h>
 #include <asm/delay.h>
 #include <asm/vmx_vcpu.h>
+#include <asm/vhpt.h>
+#include <asm/tlbflush.h>
 #include <xen/event.h>
+
+/* FIXME: where these declarations should be there ? */
+extern void getreg(unsigned long regnum, unsigned long *val, int *nat, struct pt_regs *regs);
+extern void setreg(unsigned long regnum, unsigned long val, int nat, struct pt_regs *regs);
+extern void panic_domain(struct pt_regs *, const char *, ...);
+extern int set_metaphysical_rr0(void);
 
 typedef	union {
 	struct ia64_psr ia64_psr;
@@ -47,10 +55,10 @@
 #define STATIC
 
 #ifdef PRIVOP_ADDR_COUNT
-struct privop_addr_count privop_addr_counter[PRIVOP_COUNT_NINSTS] = {
-	{ "=ifa", { 0 }, { 0 }, 0 },
+struct privop_addr_count privop_addr_counter[PRIVOP_COUNT_NINSTS+1] = {
+	{ "=ifa",  { 0 }, { 0 }, 0 },
 	{ "thash", { 0 }, { 0 }, 0 },
-	0
+	{ 0,       { 0 }, { 0 }, 0 }
 };
 extern void privop_count_addr(unsigned long addr, int inst);
 #define	PRIVOP_COUNT_ADDR(regs,inst) privop_count_addr(regs->cr_iip,inst)
@@ -375,7 +383,7 @@
 UINT64 vcpu_get_ipsr_int_state(VCPU *vcpu,UINT64 prevpsr)
 {
 	UINT64 dcr = PSCBX(vcpu,dcr);
-	PSR psr = {0};
+	PSR psr;
 
 	//printf("*** vcpu_get_ipsr_int_state (0x%016lx)...",prevpsr);
 	psr.i64 = prevpsr;
@@ -397,7 +405,7 @@
 
 IA64FAULT vcpu_get_dcr(VCPU *vcpu, UINT64 *pval)
 {
-extern unsigned long privop_trace;
+//extern unsigned long privop_trace;
 //privop_trace=0;
 //verbose("vcpu_get_dcr: called @%p\n",PSCB(vcpu,iip));
 	// Reads of cr.dcr on Xen always have the sign bit set, so
@@ -525,7 +533,7 @@
 
 IA64FAULT vcpu_set_dcr(VCPU *vcpu, UINT64 val)
 {
-extern unsigned long privop_trace;
+//extern unsigned long privop_trace;
 //privop_trace=1;
 	// Reads of cr.dcr on SP always have the sign bit set, so
 	// a domain can differentiate whether it is running on SP or not
@@ -747,7 +755,7 @@
 
 IA64FAULT vcpu_get_lid(VCPU *vcpu, UINT64 *pval)
 {
-extern unsigned long privop_trace;
+//extern unsigned long privop_trace;
 //privop_trace=1;
 	//TODO: Implement this
 	printf("vcpu_get_lid: WARNING: Getting cr.lid always returns zero\n");
@@ -764,9 +772,10 @@
 #define HEARTBEAT_FREQ 16	// period in seconds
 #ifdef HEARTBEAT_FREQ
 #define N_DOMS 16	// period in seconds
+#if 0
 	static long count[N_DOMS] = { 0 };
+#endif
 	static long nonclockcount[N_DOMS] = { 0 };
-	REGS *regs = vcpu_regs(vcpu);
 	unsigned domid = vcpu->domain->domain_id;
 #endif
 #ifdef IRQ_DEBUG
@@ -803,7 +812,7 @@
 	// getting ivr has "side effects"
 #ifdef IRQ_DEBUG
 	if (firsttime[vector]) {
-		printf("*** First get_ivr on vector=%d,itc=%lx\n",
+		printf("*** First get_ivr on vector=%lu,itc=%lx\n",
 			vector,ia64_get_itc());
 		firsttime[vector]=0;
 	}
@@ -817,7 +826,7 @@
 
 	i = vector >> 6;
 	mask = 1L << (vector & 0x3f);
-//printf("ZZZZZZ vcpu_get_ivr: setting insvc mask for vector %ld\n",vector);
+//printf("ZZZZZZ vcpu_get_ivr: setting insvc mask for vector %lu\n",vector);
 	PSCBX(vcpu,insvc[i]) |= mask;
 	PSCBX(vcpu,irr[i]) &= ~mask;
 	//PSCB(vcpu,pending_interruption)--;
@@ -983,19 +992,19 @@
 {
     PSCBX(vcpu,xen_timer_interval) = cycles;
     vcpu_set_next_timer(vcpu);
-    printf("vcpu_enable_timer(%d): interval set to %d cycles\n",
+    printf("vcpu_enable_timer: interval set to %lu cycles\n",
              PSCBX(vcpu,xen_timer_interval));
     __set_bit(PSCB(vcpu,itv), PSCB(vcpu,delivery_mask));
 }
 
 IA64FAULT vcpu_set_itv(VCPU *vcpu, UINT64 val)
 {
-extern unsigned long privop_trace;
+//extern unsigned long privop_trace;
 //privop_trace=1;
 	if (val & 0xef00) return (IA64_ILLOP_FAULT);
 	PSCB(vcpu,itv) = val;
 	if (val & 0x10000) {
-printf("**** vcpu_set_itv(%d): vitm=%lx, setting to 0\n",val,PSCBX(vcpu,domain_itm));
+printf("**** vcpu_set_itv(%lu): vitm=%lx, setting to 0\n",val,PSCBX(vcpu,domain_itm));
 		PSCBX(vcpu,domain_itm) = 0;
 	}
 	else vcpu_enable_timer(vcpu,1000000L);
@@ -1103,7 +1112,7 @@
 
 IA64FAULT vcpu_set_itm(VCPU *vcpu, UINT64 val)
 {
-	UINT now = ia64_get_itc();
+	//UINT now = ia64_get_itc();
 
 	//if (val < now) val = now + 1000;
 //printf("*** vcpu_set_itm: called with %lx\n",val);
@@ -1114,7 +1123,10 @@
 
 IA64FAULT vcpu_set_itc(VCPU *vcpu, UINT64 val)
 {
-
+#define DISALLOW_SETTING_ITC_FOR_NOW
+#ifdef DISALLOW_SETTING_ITC_FOR_NOW
+printf("vcpu_set_itc: Setting ar.itc is currently disabled\n");
+#else
 	UINT64 oldnow = ia64_get_itc();
 	UINT64 olditm = PSCBX(vcpu,domain_itm);
 	unsigned long d = olditm - oldnow;
@@ -1122,10 +1134,6 @@
 
 	UINT64 newnow = val, min_delta;
 
-#define DISALLOW_SETTING_ITC_FOR_NOW
-#ifdef DISALLOW_SETTING_ITC_FOR_NOW
-printf("vcpu_set_itc: Setting ar.itc is currently disabled\n");
-#else
 	local_irq_disable();
 	if (olditm) {
 printf("**** vcpu_set_itc(%lx): vitm changed to %lx\n",val,newnow+d);
@@ -1314,7 +1322,7 @@
 // this down, but since it has been apparently harmless, just flag it for now
 //			panic_domain(vcpu_regs(vcpu),
 			printk(
-			 "vcpu_translate: bad physical address: %p\n",address);
+			 "vcpu_translate: bad physical address: 0x%lx\n",address);
 		}
 		*pteval = (address & _PAGE_PPN_MASK) | __DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX;
 		*itir = PAGE_SHIFT << 2;
@@ -1327,7 +1335,8 @@
 		unsigned long vipsr = PSCB(vcpu,ipsr);
 		unsigned long iip = regs->cr_iip;
 		unsigned long ipsr = regs->cr_ipsr;
-		printk("vcpu_translate: bad address %p, viip=%p, vipsr=%p, iip=%p, ipsr=%p continuing\n", address, viip, vipsr, iip, ipsr);
+		printk("vcpu_translate: bad address 0x%lx, viip=0x%lx, vipsr=0x%lx, iip=0x%lx, ipsr=0x%lx continuing\n",
+			address, viip, vipsr, iip, ipsr);
 	}
 
 	rr = PSCB(vcpu,rrs)[region];
@@ -1888,7 +1897,7 @@
 
 IA64FAULT vcpu_ptc_ga(VCPU *vcpu,UINT64 vadr,UINT64 addr_range)
 {
-	extern ia64_global_tlb_purge(UINT64 start, UINT64 end, UINT64 nbits);
+	extern void ia64_global_tlb_purge(UINT64 start, UINT64 end, UINT64 nbits);
 	// FIXME: validate not flushing Xen addresses
 	// if (Xen address) return(IA64_ILLOP_FAULT);
 	// FIXME: ??breaks if domain PAGE_SIZE < Xen PAGE_SIZE
diff -r 6c43118bdba8 xen/arch/ia64/xen/vhpt.c
--- a/xen/arch/ia64/xen/vhpt.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/vhpt.c	Sun Feb 26 16:53:02 2006
@@ -20,7 +20,7 @@
 void vhpt_flush(void)
 {
 	struct vhpt_lf_entry *v = (void *)VHPT_ADDR;
-	int i, cnt = 0;
+	int i;
 #if 0
 static int firsttime = 2;
 
@@ -47,7 +47,6 @@
 #ifdef VHPT_GLOBAL
 void vhpt_flush_address(unsigned long vadr, unsigned long addr_range)
 {
-	unsigned long ps;
 	struct vhpt_lf_entry *vlfe;
 
 	if ((vadr >> 61) == 7) {
@@ -128,20 +127,20 @@
 	// allocate a huge chunk of physical memory.... how???
 	vhpt_total_size = 1 << VHPT_SIZE_LOG2;	// 4MB, 16MB, 64MB, or 256MB
 	vhpt_alignment = 1 << VHPT_SIZE_LOG2;	// 4MB, 16MB, 64MB, or 256MB
-	printf("vhpt_init: vhpt size=%p, align=%p\n",vhpt_total_size,vhpt_alignment);
+	printf("vhpt_init: vhpt size=%lx, align=%lx\n", vhpt_total_size, vhpt_alignment);
 	/* This allocation only holds true if vhpt table is unique for
 	 * all domains. Or else later new vhpt table should be allocated
 	 * from domain heap when each domain is created. Assume xen buddy
 	 * allocator can provide natural aligned page by order?
 	 */
-	vhpt_imva = alloc_xenheap_pages(VHPT_SIZE_LOG2 - PAGE_SHIFT);
+	vhpt_imva = (unsigned long) alloc_xenheap_pages(VHPT_SIZE_LOG2 - PAGE_SHIFT);
 	if (!vhpt_imva) {
 		printf("vhpt_init: can't allocate VHPT!\n");
 		while(1);
 	}
 	vhpt_paddr = __pa(vhpt_imva);
 	vhpt_pend = vhpt_paddr + vhpt_total_size - 1;
-	printf("vhpt_init: vhpt paddr=%p, end=%p\n",vhpt_paddr,vhpt_pend);
+	printf("vhpt_init: vhpt paddr=%lx, end=%lx\n", vhpt_paddr, vhpt_pend);
 	vhpt_pte = pte_val(pfn_pte(vhpt_paddr >> PAGE_SHIFT, PAGE_KERNEL));
 	vhpt_map();
 	ia64_set_pta(VHPT_ADDR | (1 << 8) | (VHPT_SIZE_LOG2 << 2) |
@@ -167,6 +166,6 @@
 		if (v->CChain) vhpt_chains++;
 	}
 	s += sprintf(s,"VHPT usage: %ld/%ld (%ld collision chains)\n",
-		vhpt_valid,VHPT_NUM_ENTRIES,vhpt_chains);
+		vhpt_valid, (unsigned long) VHPT_NUM_ENTRIES, vhpt_chains);
 	return s - buf;
 }
diff -r 6c43118bdba8 xen/arch/ia64/xen/xenirq.c
--- a/xen/arch/ia64/xen/xenirq.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/xenirq.c	Sun Feb 26 16:53:02 2006
@@ -24,7 +24,7 @@
 		firstirq = 0;
 	}
 	if (firsttime[vector]) {
-		printf("**** (entry) First received int on vector=%d,itc=%lx\n",
+		printf("**** (entry) First received int on vector=%lu,itc=%lx\n",
 			(unsigned long) vector, ia64_get_itc());
 		firsttime[vector] = 0;
 	}
@@ -38,13 +38,13 @@
 		extern void vcpu_pend_interrupt(void *, int);
 #if 0
 		if (firsttime[vector]) {
-			printf("**** (iterate) First received int on vector=%d,itc=%lx\n",
-			(unsigned long) vector, ia64_get_itc());
+			printf("**** (iterate) First received int on vector=%lu,itc=%lx\n",
+				(unsigned long) vector, ia64_get_itc());
 			firsttime[vector] = 0;
 		}
 		if (firstpend[vector]) {
-			printf("**** First pended int on vector=%d,itc=%lx\n",
-				(unsigned long) vector,ia64_get_itc());
+			printf("**** First pended int on vector=%lu,itc=%lx\n",
+				(unsigned long) vector, ia64_get_itc());
 			firstpend[vector] = 0;
 		}
 #endif
diff -r 6c43118bdba8 xen/arch/ia64/xen/xenmem.c
--- a/xen/arch/ia64/xen/xenmem.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/xenmem.c	Sun Feb 26 16:53:02 2006
@@ -34,7 +34,6 @@
 void
 paging_init (void)
 {
-	struct page_info *pg;
 	unsigned int mpt_order;
 	/* Create machine to physical mapping table
 	 * NOTE: similar to frame table, later we may need virtually
@@ -61,7 +60,7 @@
 #define FT_ALIGN_SIZE	(16UL << 20)
 void __init init_frametable(void)
 {
-	unsigned long i, pfn;
+	unsigned long pfn;
 	frame_table_size = max_page * sizeof(struct page_info);
 	frame_table_size = (frame_table_size + PAGE_SIZE - 1) & PAGE_MASK;
 
diff -r 6c43118bdba8 xen/arch/ia64/xen/xenmisc.c
--- a/xen/arch/ia64/xen/xenmisc.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/xenmisc.c	Sun Feb 26 16:53:02 2006
@@ -19,12 +19,18 @@
 #include <public/sched.h>
 #include <asm/vhpt.h>
 #include <asm/debugger.h>
+#include <asm/vmx.h>
+#include <asm/vmx_vcpu.h>
 
 efi_memory_desc_t ia64_efi_io_md;
 EXPORT_SYMBOL(ia64_efi_io_md);
 unsigned long wait_init_idle;
 int phys_proc_id[NR_CPUS];
 unsigned long loops_per_jiffy = (1<<12);	// from linux/init/main.c
+
+/* FIXME: where these declarations should be there ? */
+extern void load_region_regs(struct vcpu *);
+extern void show_registers(struct pt_regs *regs);
 
 void ia64_mca_init(void) { printf("ia64_mca_init() skipped (Machine check abort handling)\n"); }
 void ia64_mca_cpu_init(void *x) { }
@@ -251,6 +257,7 @@
 	   unsigned long user_rbs_end, unsigned long addr, long *val)
 {
 	printk("ia64_peek: called, not implemented\n");
+	return 1;
 }
 
 long
@@ -258,6 +265,7 @@
 	   unsigned long user_rbs_end, unsigned long addr, long val)
 {
 	printk("ia64_poke: called, not implemented\n");
+	return 1;
 }
 
 void
@@ -314,7 +322,7 @@
 static int i = 100;
 int id = ((struct vcpu *)current)->domain->domain_id & 0xf;
 if (!cnt[id]--) { printk("%x",id); cnt[id] = 500000; }
-if (!i--) { printk("+",id); i = 1000000; }
+if (!i--) { printk("+"); i = 1000000; }
 }
 
     if (VMX_DOMAIN(current)){
@@ -358,12 +366,12 @@
 	va_list args;
 	char buf[128];
 	struct vcpu *v = current;
-	static volatile int test = 1;	// so can continue easily in debug
-	extern spinlock_t console_lock;
-	unsigned long flags;
+//	static volatile int test = 1;	// so can continue easily in debug
+//	extern spinlock_t console_lock;
+//	unsigned long flags;
     
 loop:
-	printf("$$$$$ PANIC in domain %d (k6=%p): ",
+	printf("$$$$$ PANIC in domain %d (k6=0x%lx): ",
 		v->domain->domain_id, 
 		__get_cpu_var(cpu_kr)._kr[IA64_KR_CURRENT]);
 	va_start(args, fmt);
@@ -378,7 +386,7 @@
 	}
 	domain_pause_by_systemcontroller(current->domain);
 	v->domain->shutdown_code = SHUTDOWN_crash;
-	set_bit(_DOMF_shutdown, v->domain->domain_flags);
+	set_bit(_DOMF_shutdown, &v->domain->domain_flags);
 	if (v->domain->domain_id == 0) {
 		int i = 1000000000L;
 		// if domain0 crashes, just periodically print out panic
diff -r 6c43118bdba8 xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/xensetup.c	Sun Feb 26 16:53:02 2006
@@ -14,7 +14,7 @@
 #include <public/version.h>
 //#include <xen/delay.h>
 #include <xen/compile.h>
-//#include <xen/console.h>
+#include <xen/console.h>
 #include <xen/serial.h>
 #include <xen/trace.h>
 #include <asm/meminit.h>
@@ -22,6 +22,7 @@
 #include <asm/setup.h>
 #include <xen/string.h>
 #include <asm/vmx.h>
+#include <linux/efi.h>
 
 unsigned long xenheap_phys_end;
 
@@ -35,6 +36,16 @@
 
 int find_max_pfn (unsigned long, unsigned long, void *);
 void start_of_day(void);
+
+/* FIXME: which header these declarations should be there ? */
+extern long is_platform_hp_ski(void);
+extern void early_setup_arch(char **);
+extern void late_setup_arch(char **);
+extern void hpsim_serial_init(void);
+extern void alloc_dom0(void);
+extern void setup_per_cpu_areas(void);
+extern void mem_init(void);
+extern void init_IRQ(void);
 
 /* opt_nosmp: If true, secondary processors are ignored. */
 static int opt_nosmp = 0;
@@ -149,8 +160,7 @@
 {
     unsigned char *cmdline;
     void *heap_start;
-    int i;
-    unsigned long max_mem, nr_pages, firsthole_start;
+    unsigned long nr_pages, firsthole_start;
     unsigned long dom0_memory_start, dom0_memory_size;
     unsigned long dom0_initrd_start, dom0_initrd_size;
     unsigned long initial_images_start, initial_images_end;
@@ -160,7 +170,7 @@
     /* Kernel may be relocated by EFI loader */
     xen_pstart = ia64_tpa(KERNEL_START);
 
-    early_setup_arch(&cmdline);
+    early_setup_arch((char **) &cmdline);
 
     /* We initialise the serial devices very early so we can get debugging. */
     if (running_on_sim) hpsim_serial_init();
@@ -248,9 +258,9 @@
 	max_page);
 
     heap_start = memguard_init(ia64_imva(&_end));
-    printf("Before heap_start: 0x%lx\n", heap_start);
+    printf("Before heap_start: %p\n", heap_start);
     heap_start = __va(init_boot_allocator(__pa(heap_start)));
-    printf("After heap_start: 0x%lx\n", heap_start);
+    printf("After heap_start: %p\n", heap_start);
 
     reserve_memory();
 
@@ -281,7 +291,7 @@
     idle_domain = domain_create(IDLE_DOMAIN_ID, 0);
     BUG_ON(idle_domain == NULL);
 
-    late_setup_arch(&cmdline);
+    late_setup_arch((char **) &cmdline);
     setup_per_cpu_areas();
     mem_init();
 
@@ -298,6 +308,8 @@
 #endif
 
 #ifdef CONFIG_SMP
+    int i;
+
     if ( opt_nosmp )
     {
         max_cpus = 0;
@@ -349,9 +361,9 @@
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
     printk("About to call construct_dom0()\n");
-    dom0_memory_start = __va(initial_images_start);
+    dom0_memory_start = (unsigned long) __va(initial_images_start);
     dom0_memory_size = ia64_boot_param->domain_size;
-    dom0_initrd_start = __va(initial_images_start +
+    dom0_initrd_start = (unsigned long) __va(initial_images_start +
 			     PAGE_ALIGN(ia64_boot_param->domain_size));
     dom0_initrd_size = ia64_boot_param->initrd_size;
  
diff -r 6c43118bdba8 xen/arch/ia64/xen/xentime.c
--- a/xen/arch/ia64/xen/xentime.c	Fri Feb 24 22:41:08 2006
+++ b/xen/arch/ia64/xen/xentime.c	Sun Feb 26 16:53:02 2006
@@ -30,6 +30,9 @@
 #include <linux/jiffies.h>	// not included by xen/sched.h
 #include <xen/softirq.h>
 
+/* FIXME: where these declarations should be there ? */
+extern void ia64_init_itm(void);
+
 seqlock_t xtime_lock __cacheline_aligned_in_smp = SEQLOCK_UNLOCKED;
 
 #define TIME_KEEPER_ID  0
@@ -70,7 +73,7 @@
 s_time_t get_s_time(void)
 {
     s_time_t now;
-    unsigned long flags, seq;
+    unsigned long seq;
 
     do {
 	seq = read_seqbegin(&xtime_lock);
@@ -202,7 +205,7 @@
 }
 
 static struct irqaction xen_timer_irqaction = {
-	.handler =	xen_timer_interrupt,
+	.handler =	(void *) xen_timer_interrupt,
 	.name =		"timer"
 };
 
@@ -217,8 +220,6 @@
 /* Late init function (after all CPUs are booted). */
 int __init init_xen_time()
 {
-    struct timespec tm;
-
     ia64_time_init();
     itc_scale  = 1000000000UL << 32 ;
     itc_scale /= local_cpu_data->itc_freq;
@@ -253,7 +254,7 @@
 	} while (unlikely(read_seqretry(&xtime_lock, seq)));
 
 	local_cpu_data->itm_next = itm_next;
-	vcpu_set_next_timer(current);
+	vcpu_set_next_timer(v);
 	return 1;
 }
 

[-- Attachment #7: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2006-02-27  1:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-27  1:48 Akio Takebe [this message]
2006-02-27  7:02 ` [Patch] cleanup warning in xen/ia64 Keir Fraser
2006-02-27  7:32   ` Akio Takebe
2006-02-27  7:38     ` Keir Fraser
2006-02-27 16:44 ` [Xen-ia64-devel] " Alex Williamson
2006-02-28  4:15   ` [Xen-ia64-devel] [Patch] [RESEND] " Masaki Kanno
2006-02-28 18:34     ` Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FFC63B3FF13DB2takebe_akio@jp.fujitsu.com \
    --to=takebe_akio@jp.fujitsu.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-ia64-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.