diff options
author | imp <imp@FreeBSD.org> | 2001-01-07 08:08:54 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-01-07 08:08:54 +0000 |
commit | 4b7a126e06e4c8b7897d75aa7ee1d99a0e5e8060 (patch) | |
tree | 32fc6b708606cdec71aff03bf3112324db82ac56 /sys/dev/pccbb | |
parent | 9abe30ef582d87f37c76e2c8d585353ff5a1af44 (diff) | |
download | FreeBSD-src-4b7a126e06e4c8b7897d75aa7ee1d99a0e5e8060.zip FreeBSD-src-4b7a126e06e4c8b7897d75aa7ee1d99a0e5e8060.tar.gz |
Undo the interface change to CARD_GET_MEMORY_OFFSET. It wasn't tested
by even a compile of the OLDCARD code, was unapproved by me the keeper
of OLDCARD and broke OLDCARD and the ray driver.
Adjust new code to cope with the older interface.
If the interface changes in the future, it ***MUST*** be cleared by me
so that the OLDCARD impacts taken into account. It code in card_if.m
is used jointly by both OLDCARD and NEWCARD.
Diffstat (limited to 'sys/dev/pccbb')
-rw-r--r-- | sys/dev/pccbb/pccbb.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index e39e956..caa22fd 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -242,7 +242,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 *offsetp); + u_int32_t offset); 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,7 +1706,7 @@ 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 *offsetp) + u_int32_t cardaddr) { struct pccbb_softc *sc = device_get_softc(self); int win; @@ -1726,11 +1726,11 @@ pccbb_pcic_set_memory_offset(device_t self, device_t child, int rid, return 1; } - *offsetp = cardaddr % PCIC_MEM_PAGESIZE; - cardaddr -= *offsetp; - sc->mem[win].realsize = sc->mem[win].size + *offsetp + PCIC_MEM_PAGESIZE - 1; - sc->mem[win].realsize = sc->mem[win].realsize - - (sc->mem[win].realsize % PCIC_MEM_PAGESIZE); + /* 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); sc->mem[win].offset = cardaddr - sc->mem[win].addr; pccbb_pcic_do_mem_map(sc, win); |