[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [IA64] cleanups



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID d00fa9827789a587e64655eccf513d6569c11a9a
# Parent  a693ccb4d5813f10a7e342f61d7747feea29090c
[IA64] cleanups

Cleanups: unused code removed, duplicate extern declarations removed,
prototypes moved at the top of the file.

Signed-off-by: Tristan Gingold <tristan.gingold@xxxxxxxx>

diff -r a693ccb4d581 -r d00fa9827789 xen/arch/ia64/xen/process.c
--- a/xen/arch/ia64/xen/process.c       Wed Mar  8 03:01:29 2006
+++ b/xen/arch/ia64/xen/process.c       Thu Mar  9 06:07:51 2006
@@ -41,6 +41,7 @@
 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 lookup_domain_mpa(struct domain *,unsigned long);
 
 extern unsigned long dom0_start, dom0_size;
 
@@ -60,17 +61,7 @@
 #define PSCB(x,y)      VCPU(x,y)
 #define PSCBX(x,y)     x->arch.y
 
-extern unsigned long vcpu_verbose;
-
-long do_iopl(domid_t domain, unsigned int new_io_pl)
-{
-       dummy();
-       return 0;
-}
-
 #include <xen/sched-if.h>
-
-extern struct schedule_data schedule_data[NR_CPUS];
 
 void schedule_tail(struct vcpu *prev)
 {
@@ -95,9 +86,6 @@
 {
        struct domain *d = current->domain;
        unsigned long mask, pteval2, mpaddr;
-       unsigned long lookup_domain_mpa(struct domain *,unsigned long);
-       extern struct domain *dom0;
-       extern unsigned long dom0_start, dom0_size;
 
        // FIXME address had better be pre-validated on insert
        mask = ~itir_mask(itir);
@@ -127,7 +115,6 @@
 // given a current domain metaphysical address, return the physical address
 unsigned long translate_domain_mpaddr(unsigned long mpaddr)
 {
-       extern unsigned long lookup_domain_mpa(struct domain *,unsigned long);
        unsigned long pteval;
 
        if (current->domain == dom0) {
@@ -224,7 +211,7 @@
 
 void foodpi(void) {}
 
-unsigned long pending_false_positive = 0;
+static unsigned long pending_false_positive = 0;
 
 void reflect_extint(struct pt_regs *regs)
 {
@@ -543,7 +530,6 @@
 void
 do_ssc(unsigned long ssc, struct pt_regs *regs)
 {
-       extern unsigned long lookup_domain_mpa(struct domain *,unsigned long);
        unsigned long arg0, arg1, arg2, arg3, retval;
        char buf[2];
 /**/   static int last_fd, last_count; // FIXME FIXME FIXME
@@ -653,14 +639,14 @@
        vcpu_increment_iip(current);
 }
 
+/* Also read in hyperprivop.S  */
 int first_break = 1;
 
 void
 ia64_handle_break (unsigned long ifa, struct pt_regs *regs, unsigned long isr, 
unsigned long iim)
 {
-       struct domain *d = (struct domain *) current->domain;
+       struct domain *d = current->domain;
        struct vcpu *v = current;
-       extern unsigned long running_on_sim;
 
        if (first_break) {
                if (platform_is_hp_ski()) running_on_sim = 1;
@@ -668,8 +654,7 @@
                first_break = 0;
        }
        if (iim == 0x80001 || iim == 0x80002) { //FIXME: don't hardcode constant
-               if (running_on_sim) do_ssc(vcpu_get_gr(current,36), regs);
-               else do_ssc(vcpu_get_gr(current,36), regs);
+               do_ssc(vcpu_get_gr(current,36), regs);
        } 
 #ifdef CRASH_DEBUG
        else if ((iim == 0 || iim == CDB_BREAK_NUM) && !user_mode(regs)) {
@@ -711,6 +696,7 @@
        }
 }
 
+/* Used in vhpt.h.  */
 #define INTR_TYPE_MAX  10
 UINT64 int_counts[INTR_TYPE_MAX];
 
diff -r a693ccb4d581 -r d00fa9827789 xen/arch/ia64/xen/vcpu.c
--- a/xen/arch/ia64/xen/vcpu.c  Wed Mar  8 03:01:29 2006
+++ b/xen/arch/ia64/xen/vcpu.c  Thu Mar  9 06:07:51 2006
@@ -30,14 +30,15 @@
 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);
+extern unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
+extern unsigned long translate_domain_mpaddr(unsigned long);
+extern void ia64_global_tlb_purge(UINT64 start, UINT64 end, UINT64 nbits);
+
 
 typedef        union {
        struct ia64_psr ia64_psr;
        unsigned long i64;
 } PSR;
-
-//typedef      struct pt_regs  REGS;
-//typedef struct domain VCPU;
 
 // this def for vcpu_regs won't work if kernel stack is present
 //#define      vcpu_regs(vcpu) ((struct pt_regs *) vcpu->arch.regs
@@ -238,7 +239,6 @@
        return IA64_NO_FAULT;
 }
 
-extern UINT64 vcpu_check_pending_interrupts(VCPU *vcpu);
 #define SPURIOUS_VECTOR 0xf
 
 IA64FAULT vcpu_set_psr_dt(VCPU *vcpu)
@@ -659,13 +659,6 @@
     }
 }
 
-void early_tick(VCPU *vcpu)
-{
-       UINT64 *p = &PSCBX(vcpu,irr[3]);
-       printf("vcpu_check_pending: about to deliver early tick\n");
-       printf("&irr[0]=%p, irr[0]=0x%lx\n",p,*p);
-}
-
 #define        IA64_TPR_MMI    0x10000
 #define        IA64_TPR_MIC    0x000f0
 
@@ -932,6 +925,7 @@
 {
        if (val & 0xff00) return IA64_RSVDREG_FAULT;
        PSCB(vcpu,tpr) = val;
+       /* This can unmask interrupts.  */
        if (vcpu_check_pending_interrupts(vcpu) != SPURIOUS_VECTOR)
                PSCB(vcpu,pending_interruption) = 1;
        return (IA64_NO_FAULT);
@@ -1693,7 +1687,7 @@
  VCPU translation register access routines
 **************************************************************************/
 
-static void vcpu_purge_tr_entry(TR_ENTRY *trp)
+static inline void vcpu_purge_tr_entry(TR_ENTRY *trp)
 {
        trp->p = 0;
 }
@@ -1746,8 +1740,6 @@
 **************************************************************************/
 
 void foobar(void) { /*vcpu_verbose = 1;*/ }
-
-extern struct domain *dom0;
 
 void vcpu_itc_no_srlz(VCPU *vcpu, UINT64 IorD, UINT64 vaddr, UINT64 pte, 
UINT64 mp_pte, UINT64 logps)
 {
@@ -1793,7 +1785,6 @@
 IA64FAULT vcpu_itc_d(VCPU *vcpu, UINT64 pte, UINT64 itir, UINT64 ifa)
 {
        unsigned long pteval, logps = itir_ps(itir);
-       unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
        BOOLEAN swap_rr0 = (!(ifa>>61) && PSCB(vcpu,metaphysical_mode));
 
        if (logps < PAGE_SHIFT) {
@@ -1813,7 +1804,6 @@
 IA64FAULT vcpu_itc_i(VCPU *vcpu, UINT64 pte, UINT64 itir, UINT64 ifa)
 {
        unsigned long pteval, logps = itir_ps(itir);
-       unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
        BOOLEAN swap_rr0 = (!(ifa>>61) && PSCB(vcpu,metaphysical_mode));
 
        // FIXME: validate ifa here (not in Xen space), COULD MACHINE CHECK!
@@ -1849,7 +1839,6 @@
        // TODO: Only allowed for current vcpu
        UINT64 mpaddr, paddr;
        IA64FAULT fault;
-       unsigned long translate_domain_mpaddr(unsigned long);
 
        fault = vcpu_tpa(vcpu, vadr, &mpaddr);
        if (fault == IA64_NO_FAULT) {
@@ -1884,7 +1873,6 @@
 
 IA64FAULT vcpu_ptc_ga(VCPU *vcpu,UINT64 vadr,UINT64 addr_range)
 {
-       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

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.