Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Kill cpu_gethpa by using the HPA stored in the cpu_...



details:   https://anonhg.NetBSD.org/src/rev/1074882b8492
branches:  trunk
changeset: 778539:1074882b8492
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Apr 03 12:07:26 2012 +0000

description:
Kill cpu_gethpa by using the HPA stored in the cpu_info structure.

diffstat:

 sys/arch/hp700/dev/apic.c       |   5 +++--
 sys/arch/hp700/dev/dino.c       |   7 ++++---
 sys/arch/hp700/dev/lasi.c       |   7 ++++---
 sys/arch/hp700/dev/siop_sgc.c   |   7 ++++---
 sys/arch/hp700/dev/wax.c        |   7 ++++---
 sys/arch/hp700/hp700/mainbus.c  |  21 ++-------------------
 sys/arch/hppa/include/cpufunc.h |   3 +--
 7 files changed, 22 insertions(+), 35 deletions(-)

diffs (232 lines):

diff -r 7c9ef7032fcd -r 1074882b8492 sys/arch/hp700/dev/apic.c
--- a/sys/arch/hp700/dev/apic.c Tue Apr 03 12:03:04 2012 +0000
+++ b/sys/arch/hp700/dev/apic.c Tue Apr 03 12:07:26 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: apic.c,v 1.12 2011/04/04 20:37:50 dyoung Exp $ */
+/*     $NetBSD: apic.c,v 1.13 2012/04/03 12:07:26 skrll Exp $  */
 
 /*     $OpenBSD: apic.c,v 1.7 2007/10/06 23:50:54 krw Exp $    */
 
@@ -161,7 +161,8 @@
 {
        struct elroy_softc *sc = v;
        volatile struct elroy_regs *r = sc->sc_regs;
-       hppa_hpa_t hpa = cpu_gethpa(0);
+       struct cpu_info *ci = &cpus[0];
+       hppa_hpa_t hpa = ci->ci_hpa;
        struct evcnt *cnt;
        struct apic_iv *aiv, *biv;
        void *iv;
diff -r 7c9ef7032fcd -r 1074882b8492 sys/arch/hp700/dev/dino.c
--- a/sys/arch/hp700/dev/dino.c Tue Apr 03 12:03:04 2012 +0000
+++ b/sys/arch/hp700/dev/dino.c Tue Apr 03 12:07:26 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dino.c,v 1.33 2012/01/27 18:52:55 para Exp $ */
+/*     $NetBSD: dino.c,v 1.34 2012/04/03 12:07:26 skrll Exp $ */
 
 /*     $OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $ */
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.33 2012/01/27 18:52:55 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.34 2012/04/03 12:07:26 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -1608,6 +1608,7 @@
        struct confargs *ca = (struct confargs *)aux, nca;
        struct pcibus_attach_args pba;
        volatile struct dino_regs *r;
+       struct cpu_info *ci = &cpus[0];
        const char *p = NULL;
        u_int data;
        int s, ver;
@@ -1655,7 +1656,7 @@
        r->imr = ~0;
        data = r->irr0;
        r->imr = 0;
-       r->iar0 = cpu_gethpa(0) | (31 - ca->ca_irq);
+       r->iar0 = ci->ci_hpa | (31 - ca->ca_irq);
        splx(s);
        /* Establish the interrupt register. */
        hp700_interrupt_register_establish(&sc->sc_ir);
diff -r 7c9ef7032fcd -r 1074882b8492 sys/arch/hp700/dev/lasi.c
--- a/sys/arch/hp700/dev/lasi.c Tue Apr 03 12:03:04 2012 +0000
+++ b/sys/arch/hp700/dev/lasi.c Tue Apr 03 12:07:26 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lasi.c,v 1.21 2011/07/01 18:33:09 dyoung Exp $ */
+/*     $NetBSD: lasi.c,v 1.22 2012/04/03 12:07:26 skrll Exp $  */
 
 /*     $OpenBSD: lasi.c,v 1.4 2001/06/09 03:57:19 mickey Exp $ */
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lasi.c,v 1.21 2011/07/01 18:33:09 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lasi.c,v 1.22 2012/04/03 12:07:26 skrll Exp $");
 
 #undef LASIDEBUG
 
@@ -151,6 +151,7 @@
        struct confargs *ca = aux;
        struct lasi_softc *sc = device_private(self);
        struct gsc_attach_args ga;
+       struct cpu_info *ci = &cpus[0];
        bus_space_handle_t ioh;
        int s, in;
 
@@ -182,7 +183,7 @@
 
        /* interrupts guts */
        s = splhigh();
-       sc->sc_trs->lasi_iar = cpu_gethpa(0) | (31 - ca->ca_irq);
+       sc->sc_trs->lasi_iar = ci->ci_hpa | (31 - ca->ca_irq);
        sc->sc_trs->lasi_icr = 0;
        sc->sc_trs->lasi_imr = ~0U;
        in = sc->sc_trs->lasi_irr;
diff -r 7c9ef7032fcd -r 1074882b8492 sys/arch/hp700/dev/siop_sgc.c
--- a/sys/arch/hp700/dev/siop_sgc.c     Tue Apr 03 12:03:04 2012 +0000
+++ b/sys/arch/hp700/dev/siop_sgc.c     Tue Apr 03 12:07:26 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: siop_sgc.c,v 1.8 2011/07/01 18:33:09 dyoung Exp $      */
+/*     $NetBSD: siop_sgc.c,v 1.9 2012/04/03 12:07:26 skrll Exp $       */
 
 /*     $OpenBSD: siop_sgc.c,v 1.1 2007/08/05 19:09:52 kettenis Exp $   */
 
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: siop_sgc.c,v 1.8 2011/07/01 18:33:09 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siop_sgc.c,v 1.9 2012/04/03 12:07:26 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -88,6 +88,7 @@
        struct siop_sgc_softc *sgc = device_private(self);
        struct siop_softc *sc = &sgc->sc_siop;
        struct confargs *ca = aux;
+       struct cpu_info *ci = &cpus[0];
        volatile struct iomod *regs;
 
        sc->sc_c.sc_dev = self;
@@ -126,7 +127,7 @@
 
        siop_sgc_reset(&sc->sc_c);
 
-       regs->io_eim = cpu_gethpa(0) | (31 - ca->ca_irq);
+       regs->io_eim = ci->ci_hpa | (31 - ca->ca_irq);
        regs->io_ii_rw |= IO_II_INTEN;
 
        aprint_normal(": NCR53C720 rev %d\n", bus_space_read_1(sc->sc_c.sc_rt,
diff -r 7c9ef7032fcd -r 1074882b8492 sys/arch/hp700/dev/wax.c
--- a/sys/arch/hp700/dev/wax.c  Tue Apr 03 12:03:04 2012 +0000
+++ b/sys/arch/hp700/dev/wax.c  Tue Apr 03 12:07:26 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wax.c,v 1.17 2011/02/01 18:33:24 skrll Exp $   */
+/*     $NetBSD: wax.c,v 1.18 2012/04/03 12:07:26 skrll Exp $   */
 
 /*     $OpenBSD: wax.c,v 1.1 1998/11/23 03:04:10 mickey Exp $  */
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wax.c,v 1.17 2011/02/01 18:33:24 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wax.c,v 1.18 2012/04/03 12:07:26 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -115,6 +115,7 @@
        struct confargs *ca = aux;
        struct wax_softc *sc = device_private(self);
        struct gsc_attach_args ga;
+       struct cpu_info *ci = &cpus[0];
        bus_space_handle_t ioh;
        int s, in;
 
@@ -140,7 +141,7 @@
 
        /* interrupts guts */
        s = splhigh();
-       sc->sc_regs->wax_iar = cpu_gethpa(0) | (31 - ca->ca_irq);
+       sc->sc_regs->wax_iar = ci->ci_hpa | (31 - ca->ca_irq);
        sc->sc_regs->wax_icr = 0;
        sc->sc_regs->wax_imr = ~0U;
        in = sc->sc_regs->wax_irr;
diff -r 7c9ef7032fcd -r 1074882b8492 sys/arch/hp700/hp700/mainbus.c
--- a/sys/arch/hp700/hp700/mainbus.c    Tue Apr 03 12:03:04 2012 +0000
+++ b/sys/arch/hp700/hp700/mainbus.c    Tue Apr 03 12:07:26 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mainbus.c,v 1.81 2012/02/23 21:38:53 skrll Exp $       */
+/*     $NetBSD: mainbus.c,v 1.82 2012/04/03 12:07:26 skrll Exp $       */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.81 2012/02/23 21:38:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.82 2012/04/03 12:07:26 skrll Exp $");
 
 #include "locators.h"
 #include "power.h"
@@ -101,8 +101,6 @@
 
 struct mainbus_softc {
        device_t sc_dv;
-
-       hppa_hpa_t sc_hpa;
 };
 
 int    mbmatch(device_t, cfdata_t, void *);
@@ -1387,8 +1385,6 @@
        ((struct iomod *)(hppa_mcpuhpa & HPPA_FLEX_MASK))[FPA_IOMOD].io_flex =
                (void *)((hppa_mcpuhpa & HPPA_FLEX_MASK) | DMA_ENABLE);
 
-       sc->sc_hpa = hppa_mcpuhpa;
-
        aprint_normal(" [flex %lx]\n", hppa_mcpuhpa & HPPA_FLEX_MASK);
 
        /* PDC first */
@@ -1457,19 +1453,6 @@
        hppa_modules_done();
 }
 
-/*
- * retrive CPU #N HPA value
- */
-hppa_hpa_t
-cpu_gethpa(int n)
-{
-       struct mainbus_softc *sc;
-
-       sc = device_lookup_private(&mainbus_cd, 0);
-
-       return sc->sc_hpa;
-}
-
 int
 mbprint(void *aux, const char *pnp)
 {
diff -r 7c9ef7032fcd -r 1074882b8492 sys/arch/hppa/include/cpufunc.h
--- a/sys/arch/hppa/include/cpufunc.h   Tue Apr 03 12:03:04 2012 +0000
+++ b/sys/arch/hppa/include/cpufunc.h   Tue Apr 03 12:07:26 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.h,v 1.15 2012/02/04 16:33:27 skrll Exp $       */
+/*     $NetBSD: cpufunc.h,v 1.16 2012/04/03 12:07:26 skrll Exp $       */
 
 /*     $OpenBSD: cpufunc.h,v 1.17 2000/05/15 17:22:40 mickey Exp $     */
 
@@ -180,7 +180,6 @@
 void pdcache(pa_space_t, vaddr_t, vsize_t);
 void fcacheall(void);
 void ptlball(void);
-hppa_hpa_t cpu_gethpa(int);
 
 #define PCXL2_ACCEL_IO_START           0xf4000000
 #define PCXL2_ACCEL_IO_END             (0xfc000000 - 1)



Home | Main Index | Thread Index | Old Index