Kill cpu_gethpa by using the HPA stored in the cpu_info structure.
This commit is contained in:
parent
3b1e581385
commit
32ee1e59d6
@ -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_handle_t ih,
|
||||
{
|
||||
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;
|
||||
|
@ -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 self, void *aux)
|
||||
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 self, void *aux)
|
||||
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);
|
||||
|
@ -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 self, void *aux)
|
||||
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 self, void *aux)
|
||||
|
||||
/* 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;
|
||||
|
@ -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_t self, void *aux)
|
||||
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_t self, void *aux)
|
||||
|
||||
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,
|
||||
|
@ -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, void *aux)
|
||||
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, void *aux)
|
||||
|
||||
/* 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;
|
||||
|
@ -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, void *aux)
|
||||
((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, void *aux)
|
||||
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)
|
||||
{
|
||||
|
@ -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_t);
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user