# HG changeset patch # User tristan.gingold@xxxxxxxx # Node ID 15528c8a8b672f0b87666947bed0cda03ff95b35 # Parent bd234c9603ce433dcb4a4ac1795a94f3b7b2796f Changes so that Xen can be compiled with gcc 4.0.2: * functions must be declared before being called. * a cast or a conditionnal expression is not an lvalue. * a function cannot be declared static and redeclared extern (or reverse). * gcc 4.0.2 missed a range optimization (ia64_setreg_unknown_kr). * ia64_ksyms is not used (removed from Makefile). diff -r bd234c9603ce -r 15528c8a8b67 xen/arch/ia64/Makefile --- a/xen/arch/ia64/Makefile Fri Nov 11 19:23:04 2005 +++ b/xen/arch/ia64/Makefile Wed Nov 16 12:23:32 2005 @@ -2,7 +2,7 @@ VPATH = xen vmx linux linux-xen -OBJS = xensetup.o setup.o time.o irq.o ia64_ksyms.o process.o smp.o \ +OBJS = xensetup.o setup.o time.o irq.o process.o smp.o \ xenmisc.o acpi.o hypercall.o \ machvec.o dom0_ops.o domain.o hpsimserial.o pcdp.o \ idle0_task.o pal.o hpsim.o efi.o efi_stub.o ivt.o mm_contig.o \ @@ -10,7 +10,7 @@ extable.o linuxextable.o sort.o xenirq.o xentime.o \ regionreg.o entry.o unaligned.o privop.o vcpu.o \ irq_ia64.o irq_lsapic.o vhpt.o xenasm.o hyperprivop.o dom_fw.o \ - grant_table.o sn_console.o + grant_table.o sn_console.o # ia64_ksyms.o OBJS += vmx_init.o vmx_virt.o vmx_vcpu.o vmx_process.o vmx_vsa.o vmx_ivt.o\ vmx_phy_mode.o vmx_utility.o vmx_interrupt.o vmx_entry.o vmmu.o \ @@ -45,7 +45,7 @@ asm-xsi-offsets.s: asm-xsi-offsets.c $(CC) $(CFLAGS) -S -o $@ $< - + $(BASEDIR)/include/asm-ia64/asm-xsi-offsets.h: asm-xsi-offsets.s @(set -e; \ echo "/*"; \ diff -r bd234c9603ce -r 15528c8a8b67 xen/arch/ia64/vmx/mmio.c --- a/xen/arch/ia64/vmx/mmio.c Fri Nov 11 19:23:04 2005 +++ b/xen/arch/ia64/vmx/mmio.c Wed Nov 16 12:23:32 2005 @@ -49,6 +49,8 @@ #define PIB_OFST_INTA 0x1E0000 #define PIB_OFST_XTP 0x1E0008 +static int write_ipi (VCPU *vcpu, uint64_t addr, uint64_t value); + static void pib_write(VCPU *vcpu, void *src, uint64_t pib_off, size_t s, int ma) { switch (pib_off) { diff -r bd234c9603ce -r 15528c8a8b67 xen/arch/ia64/vmx/vmmu.c --- a/xen/arch/ia64/vmx/vmmu.c Fri Nov 11 19:23:04 2005 +++ b/xen/arch/ia64/vmx/vmmu.c Wed Nov 16 12:23:32 2005 @@ -157,11 +157,13 @@ printk("Allocate domain vhpt at 0x%lx\n", (u64)vbase); memset(vbase, 0, VCPU_TLB_SIZE); vcur = (void*)((u64)vbase + VCPU_TLB_SIZE); - vhpt = --((thash_cb_t*)vcur); + vcur -= sizeof (thash_cb_t); + vhpt = vcur; vhpt->ht = THASH_VHPT; vhpt->vcpu = d; vhpt->hash_func = machine_thash; - vs = --((vhpt_special *)vcur); + vs -= sizeof (vhpt_special); + vs = vcur; /* Setup guest pta */ pta_value.val = 0; @@ -199,10 +201,12 @@ printk("Allocate domain tlb at 0x%lx\n", (u64)vbase); memset(vbase, 0, VCPU_TLB_SIZE); vcur = (void*)((u64)vbase + VCPU_TLB_SIZE); - tlb = --((thash_cb_t*)vcur); + vcur -= sizeof (thash_cb_t); + tlb = vcur; tlb->ht = THASH_TLB; tlb->vcpu = d; - ts = --((tlb_special_t *)vcur); + vcur -= sizeof (tlb_special_t); + ts = vcur; tlb->ts = ts; tlb->ts->vhpt = init_domain_vhpt(d); tlb->hash_func = machine_thash; diff -r bd234c9603ce -r 15528c8a8b67 xen/arch/ia64/xen/vcpu.c --- a/xen/arch/ia64/xen/vcpu.c Fri Nov 11 19:23:04 2005 +++ b/xen/arch/ia64/xen/vcpu.c Wed Nov 16 12:23:32 2005 @@ -146,6 +146,9 @@ ia64_set_kr(6, VCPU(vcpu, krs[6])); ia64_set_kr(7, VCPU(vcpu, krs[7])); } + +/* GCC 4.0.2 seems not to be able to suppress this call!. */ +#define ia64_setreg_unknown_kr() return IA64_ILLOP_FAULT IA64FAULT vcpu_set_ar(VCPU *vcpu, UINT64 reg, UINT64 val) { diff -r bd234c9603ce -r 15528c8a8b67 xen/include/asm-ia64/linux-xen/linux/interrupt.h --- a/xen/include/asm-ia64/linux-xen/linux/interrupt.h Fri Nov 11 19:23:04 2005 +++ b/xen/include/asm-ia64/linux-xen/linux/interrupt.h Wed Nov 16 12:23:32 2005 @@ -131,7 +131,9 @@ extern void softirq_init(void); #define __raise_softirq_irqoff(nr) do { local_softirq_pending() |= 1UL << (nr); } while (0) extern void FASTCALL(raise_softirq_irqoff(unsigned int nr)); +#ifndef XEN extern void FASTCALL(raise_softirq(unsigned int nr)); +#endif /* Tasklets --- multithreaded analogue of BHs. diff -r bd234c9603ce -r 15528c8a8b67 xen/include/asm-ia64/linux/gfp.h --- a/xen/include/asm-ia64/linux/gfp.h Fri Nov 11 19:23:04 2005 +++ b/xen/include/asm-ia64/linux/gfp.h Wed Nov 16 12:23:32 2005 @@ -1,6 +1,7 @@ #ifndef __LINUX_GFP_H #define __LINUX_GFP_H +#include #include #include #include diff -r bd234c9603ce -r 15528c8a8b67 xen/include/asm-ia64/vmmu.h --- a/xen/include/asm-ia64/vmmu.h Fri Nov 11 19:23:04 2005 +++ b/xen/include/asm-ia64/vmmu.h Wed Nov 16 12:23:32 2005 @@ -222,7 +222,10 @@ #define ITR(hcb,id) ((hcb)->ts->itr[id]) #define DTR(hcb,id) ((hcb)->ts->dtr[id]) #define INVALIDATE_HASH(hcb,hash) { \ - INVALID_ENTRY(hcb, hash) = 1; \ + if ((hcb)->ht==THASH_TLB) \ + INVALID_TLB(hash) = 1; \ + else \ + INVALID_VHPT(hash) = 1; \ hash->next = NULL; } #define PURGABLE_ENTRY(hcb,en) 1 diff -r bd234c9603ce -r 15528c8a8b67 xen/include/asm-ia64/vmx_vcpu.h --- a/xen/include/asm-ia64/vmx_vcpu.h Fri Nov 11 19:23:04 2005 +++ b/xen/include/asm-ia64/vmx_vcpu.h Wed Nov 16 12:23:32 2005 @@ -71,7 +71,9 @@ extern thash_cb_t *vmx_vcpu_get_vhpt(VCPU *vcpu); extern ia64_rr vmx_vcpu_rr(VCPU *vcpu,UINT64 vadr); extern IA64FAULT vmx_vcpu_set_rr(VCPU *vcpu, UINT64 reg, UINT64 val); +#if 0 extern IA64FAULT vmx_vcpu_get_rr(VCPU *vcpu, UINT64 reg, UINT64 *pval); +#endif extern IA64FAULT vmx_vcpu_get_pkr(VCPU *vcpu, UINT64 reg, UINT64 *pval); IA64FAULT vmx_vcpu_set_pkr(VCPU *vcpu, UINT64 reg, UINT64 val); extern IA64FAULT vmx_vcpu_itc_i(VCPU *vcpu, UINT64 pte, UINT64 itir, UINT64 ifa);