Module Name: src Committed By: skrll Date: Tue Apr 3 12:07:26 UTC 2012
Modified Files: src/sys/arch/hp700/dev: apic.c dino.c lasi.c siop_sgc.c wax.c src/sys/arch/hp700/hp700: mainbus.c src/sys/arch/hppa/include: cpufunc.h Log Message: Kill cpu_gethpa by using the HPA stored in the cpu_info structure. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hp700/dev/apic.c cvs rdiff -u -r1.33 -r1.34 src/sys/arch/hp700/dev/dino.c cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp700/dev/lasi.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hp700/dev/siop_sgc.c cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hp700/dev/wax.c cvs rdiff -u -r1.81 -r1.82 src/sys/arch/hp700/hp700/mainbus.c cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hppa/include/cpufunc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/hp700/dev/apic.c diff -u src/sys/arch/hp700/dev/apic.c:1.12 src/sys/arch/hp700/dev/apic.c:1.13 --- src/sys/arch/hp700/dev/apic.c:1.12 Mon Apr 4 20:37:50 2011 +++ src/sys/arch/hp700/dev/apic.c Tue Apr 3 12:07:26 2012 @@ -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 @@ apic_intr_establish(void *v, pci_intr_ha { 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; Index: src/sys/arch/hp700/dev/dino.c diff -u src/sys/arch/hp700/dev/dino.c:1.33 src/sys/arch/hp700/dev/dino.c:1.34 --- src/sys/arch/hp700/dev/dino.c:1.33 Fri Jan 27 18:52:55 2012 +++ src/sys/arch/hp700/dev/dino.c Tue Apr 3 12:07:26 2012 @@ -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 @@ dinoattach(device_t parent, device_t sel 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 @@ dinoattach(device_t parent, device_t sel 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); Index: src/sys/arch/hp700/dev/lasi.c diff -u src/sys/arch/hp700/dev/lasi.c:1.21 src/sys/arch/hp700/dev/lasi.c:1.22 --- src/sys/arch/hp700/dev/lasi.c:1.21 Fri Jul 1 18:33:09 2011 +++ src/sys/arch/hp700/dev/lasi.c Tue Apr 3 12:07:26 2012 @@ -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 @@ lasiattach(device_t parent, device_t sel 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 @@ lasiattach(device_t parent, device_t sel /* 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; Index: src/sys/arch/hp700/dev/siop_sgc.c diff -u src/sys/arch/hp700/dev/siop_sgc.c:1.8 src/sys/arch/hp700/dev/siop_sgc.c:1.9 --- src/sys/arch/hp700/dev/siop_sgc.c:1.8 Fri Jul 1 18:33:09 2011 +++ src/sys/arch/hp700/dev/siop_sgc.c Tue Apr 3 12:07:26 2012 @@ -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 @@ siop_sgc_attach(device_t parent, device_ 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_attach(device_t parent, device_ 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, Index: src/sys/arch/hp700/dev/wax.c diff -u src/sys/arch/hp700/dev/wax.c:1.17 src/sys/arch/hp700/dev/wax.c:1.18 --- src/sys/arch/hp700/dev/wax.c:1.17 Tue Feb 1 18:33:24 2011 +++ src/sys/arch/hp700/dev/wax.c Tue Apr 3 12:07:26 2012 @@ -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 @@ waxattach(device_t parent, device_t self 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 @@ waxattach(device_t parent, device_t self /* 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; Index: src/sys/arch/hp700/hp700/mainbus.c diff -u src/sys/arch/hp700/hp700/mainbus.c:1.81 src/sys/arch/hp700/hp700/mainbus.c:1.82 --- src/sys/arch/hp700/hp700/mainbus.c:1.81 Thu Feb 23 21:38:53 2012 +++ src/sys/arch/hp700/hp700/mainbus.c Tue Apr 3 12:07:26 2012 @@ -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 @@ int mbusdebug = 1; struct mainbus_softc { device_t sc_dv; - - hppa_hpa_t sc_hpa; }; int mbmatch(device_t, cfdata_t, void *); @@ -1387,8 +1385,6 @@ mbattach(device_t parent, device_t self, ((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 @@ mbattach(device_t parent, device_t self, 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) { Index: src/sys/arch/hppa/include/cpufunc.h diff -u src/sys/arch/hppa/include/cpufunc.h:1.15 src/sys/arch/hppa/include/cpufunc.h:1.16 --- src/sys/arch/hppa/include/cpufunc.h:1.15 Sat Feb 4 16:33:27 2012 +++ src/sys/arch/hppa/include/cpufunc.h Tue Apr 3 12:07:26 2012 @@ -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 fdcache(pa_space_t, vaddr_t, vsize_ 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)