diff options
| author | Warner Losh <imp@FreeBSD.org> | 2001-01-07 16:31:09 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2001-01-07 16:31:09 +0000 |
| commit | 486d464d74f6eae01b67011ee8b84c1e3b652c1b (patch) | |
| tree | 4a06bb96014471074a2810a29a5ac795a71c6f95 /sys/dev | |
| parent | 568ffd8885481391ba86d3dab36e772ea2caef4a (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/pccard/card_if.m | 1 | ||||
| -rw-r--r-- | sys/dev/pccard/pccard.c | 10 | ||||
| -rw-r--r-- | sys/dev/pccbb/pccbb.c | 23 | ||||
| -rw-r--r-- | sys/dev/pcic/i82365.c | 6 | ||||
| -rw-r--r-- | sys/dev/pcic/i82365var.h | 2 | ||||
| -rw-r--r-- | sys/dev/ray/if_ray.c | 4 |
6 files changed, 22 insertions, 24 deletions
diff --git a/sys/dev/pccard/card_if.m b/sys/dev/pccard/card_if.m index 7952b8620614f..621a041fd3f72 100644 --- a/sys/dev/pccard/card_if.m +++ b/sys/dev/pccard/card_if.m @@ -64,6 +64,7 @@ METHOD int set_memory_offset { device_t child; int rid; u_int32_t cardaddr; + u_int32_t *deltap; } METHOD int get_memory_offset { diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c index efa170ee03b99..2de5db09a0411 100644 --- a/sys/dev/pccard/pccard.c +++ b/sys/dev/pccard/pccard.c @@ -391,7 +391,6 @@ pccard_function_enable(struct pccard_function *pf) struct pccard_function *tmp; int reg; device_t dev = pf->sc->dev; - uint32_t addr; if (pf->cfe == NULL) { DEVPRVERBOSE((dev, "No config entry could be allocated.\n")); @@ -450,10 +449,7 @@ pccard_function_enable(struct pccard_function *pf) CARD_SET_RES_FLAGS(device_get_parent(dev), dev, SYS_RES_MEMORY, pf->ccr_rid, PCCARD_A_MEM_ATTR); CARD_SET_MEMORY_OFFSET(device_get_parent(dev), dev, - pf->ccr_rid, pf->ccr_base); - CARD_GET_MEMORY_OFFSET(device_get_parent(dev), dev, - pf->ccr_rid, &addr); - pf->pf_ccr_offset = pf->ccr_base - addr; + pf->ccr_rid, pf->ccr_base, &pf->pf_ccr_offset); pf->pf_ccrt = rman_get_bustag(pf->ccr_res); pf->pf_ccrh = rman_get_bushandle(pf->ccr_res); pf->pf_ccr_realsize = 1; @@ -841,11 +837,11 @@ pccard_set_res_flags(device_t dev, device_t child, int type, int rid, static int pccard_set_memory_offset(device_t dev, device_t child, int rid, - u_int32_t offset) + u_int32_t offset, u_int32_t *deltap) { return CARD_SET_MEMORY_OFFSET(device_get_parent(dev), child, rid, - offset); + offset, deltap); } static int diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index caa22fd74a3af..c319e2f24be90 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -98,11 +98,6 @@ #define PCIC_MASK2(SC,REG,MASK,MASK2) \ PCIC_WRITE(SC,REG,(PCIC_READ(SC,REG) MASK) MASK2) -#if !defined(lint) -static const char rcsid[] = - "$FreeBSD$"; -#endif - struct pccbb_sclist { struct pccbb_softc *sc; STAILQ_ENTRY(pccbb_sclist) entries; @@ -242,7 +237,7 @@ static int pccbb_pcic_release_resource(device_t self, device_t child, int type, static int pccbb_pcic_set_res_flags(device_t self, device_t child, int type, int rid, u_int32_t flags); static int pccbb_pcic_set_memory_offset(device_t self, device_t child, int rid, - u_int32_t offset); + u_int32_t offset, u_int32_t *deltap); static int pccbb_power_enable_socket(device_t self, device_t child); static void pccbb_power_disable_socket(device_t self, device_t child); static int pccbb_activate_resource(device_t self, device_t child, int type, @@ -1706,11 +1701,12 @@ pccbb_pcic_set_res_flags(device_t self, device_t child, int type, int rid, static int pccbb_pcic_set_memory_offset(device_t self, device_t child, int rid, - u_int32_t cardaddr) + u_int32_t cardaddr, u_int32_t *deltap) { struct pccbb_softc *sc = device_get_softc(self); int win; struct pccbb_reslist *rle; + u_int32_t delta; win = -1; @@ -1726,11 +1722,14 @@ pccbb_pcic_set_memory_offset(device_t self, device_t child, int rid, return 1; } - /* Fixup size since cardaddr must align to PCIC_MEM_PAGESIZE */ - /* XXX This should be a marco XXX */ - sc->mem[win].realsize = (sc->mem[win].size + - (cardaddr & (PCIC_MEM_PAGESIZE - 1))) & ~(PCIC_MEM_PAGESIZE - 1); - cardaddr &= ~(PCIC_MEM_PAGESIZE - 1); + delta = cardaddr % PCIC_MEM_PAGESIZE; + if (deltap) + *deltap = delta; + cardaddr -= delta; + sc->mem[win].realsize = sc->mem[win].size + delta + + PCIC_MEM_PAGESIZE - 1; + sc->mem[win].realsize = sc->mem[win].realsize - + (sc->mem[win].realsize % PCIC_MEM_PAGESIZE); sc->mem[win].offset = cardaddr - sc->mem[win].addr; pccbb_pcic_do_mem_map(sc, win); diff --git a/sys/dev/pcic/i82365.c b/sys/dev/pcic/i82365.c index 8d8219de1f6ed..eeb03044aa56a 100644 --- a/sys/dev/pcic/i82365.c +++ b/sys/dev/pcic/i82365.c @@ -1471,9 +1471,11 @@ pcic_set_res_flags(device_t dev, device_t child, int type, int rid, } int -pcic_set_memory_offset(device_t dev, device_t child, int rid, u_int32_t offset) +pcic_set_memory_offset(device_t dev, device_t child, int rid, u_int32_t offset, + u_int32_t *deltap) { - return 0; + /* XXX BAD XXX */ + return EIO; } static void diff --git a/sys/dev/pcic/i82365var.h b/sys/dev/pcic/i82365var.h index b87f95804920c..1d6ce09b276b3 100644 --- a/sys/dev/pcic/i82365var.h +++ b/sys/dev/pcic/i82365var.h @@ -163,6 +163,6 @@ int pcic_disable_socket(device_t dev, device_t child); int pcic_set_res_flags(device_t dev, device_t child, int type, int rid, u_int32_t flags); int pcic_set_memory_offset(device_t dev, device_t child, int rid, - u_int32_t offset); + u_int32_t offset, u_int32_t *deltap); #define PCIC_SOFTC(d) (struct pcic_softc *) device_get_softc(d) diff --git a/sys/dev/ray/if_ray.c b/sys/dev/ray/if_ray.c index e81cd430fe9b0..7f35cb23c5153 100644 --- a/sys/dev/ray/if_ray.c +++ b/sys/dev/ray/if_ray.c @@ -3366,7 +3366,7 @@ ray_res_alloc_am(struct ray_softc *sc) RAY_PRINTF(sc, "fixing up AM card address from 0x%x to 0x0", offset); error = CARD_SET_MEMORY_OFFSET(device_get_parent(sc->dev), - sc->dev, sc->am_rid, 0); + sc->dev, sc->am_rid, 0, NULL); if (error) { RAY_PRINTF(sc, "CARD_SET_MEMORY_OFFSET returned 0x%0x", error); @@ -3454,7 +3454,7 @@ ray_res_alloc_cm(struct ray_softc *sc) RAY_PRINTF(sc, "fixing up CM card address from 0x%x to 0x0", offset); error = CARD_SET_MEMORY_OFFSET(device_get_parent(sc->dev), - sc->dev, sc->cm_rid, 0); + sc->dev, sc->cm_rid, 0, NULL); if (error) { RAY_PRINTF(sc, "CARD_SET_MEMORY_OFFSET returned 0x%0x", error); |
