make it compile on amd64

This commit is contained in:
christos 2014-03-20 20:41:11 +00:00
parent 4591c8e2e5
commit 48b19df748
1 changed files with 10 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: oboe.c,v 1.39 2012/10/27 17:18:35 chs Exp $ */
/* $NetBSD: oboe.c,v 1.40 2014/03/20 20:41:11 christos Exp $ */
/* XXXXFVDL THIS DRIVER IS BROKEN FOR NON-i386 -- vtophys() usage */
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: oboe.c,v 1.39 2012/10/27 17:18:35 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: oboe.c,v 1.40 2014/03/20 20:41:11 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -298,9 +298,9 @@ oboe_read(void *h, struct uio *uio, int flag)
int s;
int slot;
DPRINTF(("%s: resid=%d, iovcnt=%d, offset=%ld\n",
DPRINTF(("%s: resid=%zu, iovcnt=%d, offset=%td\n",
__func__, uio->uio_resid, uio->uio_iovcnt,
(long)uio->uio_offset));
uio->uio_offset));
s = splir();
while (sc->sc_saved == 0) {
@ -324,7 +324,7 @@ oboe_read(void *h, struct uio *uio, int flag)
slot = (sc->sc_rxs - sc->sc_saved + RX_SLOTS) % RX_SLOTS;
if (uio->uio_resid < sc->sc_lens[slot]) {
DPRINTF(("oboe_read: uio buffer smaller than frame size"
"(%d < %d)\n", uio->uio_resid, sc->sc_lens[slot]));
"(%zu < %d)\n", uio->uio_resid, sc->sc_lens[slot]));
error = EINVAL;
} else {
DPRINTF(("oboe_read: moving %d bytes from %p\n",
@ -618,14 +618,14 @@ oboe_init_taskfile(struct oboe_softc *sc)
sc->sc_taskfile->xmit[i].len = 0;
sc->sc_taskfile->xmit[i].control = 0x00;
sc->sc_taskfile->xmit[i].buffer =
vtophys((u_int)sc->sc_xmit_bufs[i]); /* u_int? */
vtophys((uintptr_t)sc->sc_xmit_bufs[i]);
}
for (i = 0; i < RX_SLOTS; ++i) {
sc->sc_taskfile->recv[i].len = 0;
sc->sc_taskfile->recv[i].control = 0x83;
sc->sc_taskfile->recv[i].buffer =
vtophys((u_int)sc->sc_recv_bufs[i]); /* u_int? */
vtophys((uintptr_t)sc->sc_recv_bufs[i]);
}
sc->sc_txpending = 0;
@ -638,7 +638,8 @@ oboe_alloc_taskfile(struct oboe_softc *sc)
{
int i;
/* XXX */
uint32_t addr = (uint32_t)malloc(OBOE_TASK_BUF_LEN, M_DEVBUF, M_WAITOK);
uintptr_t addr =
(uintptr_t)malloc(OBOE_TASK_BUF_LEN, M_DEVBUF, M_WAITOK);
if (addr == 0) {
goto bad;
}
@ -686,7 +687,7 @@ oboe_startchip (struct oboe_softc *sc)
OUTB(sc, 0x0f, OBOE_REG_1A);
OUTB(sc, 0xff, OBOE_REG_1B);
physaddr = vtophys((u_int)sc->sc_taskfile); /* u_int? */
physaddr = vtophys((uintptr_t)sc->sc_taskfile);
OUTB(sc, (physaddr >> 0x0a) & 0xff, OBOE_TFP0);
OUTB(sc, (physaddr >> 0x12) & 0xff, OBOE_TFP1);