From d0cbfd394fe9314c00a4d50969d60a32db04ac8a Mon Sep 17 00:00:00 2001 From: Jakub Jermar Date: Wed, 1 Nov 2017 21:34:04 +0100 Subject: [PATCH] Use proper PIO and ioport64_t interfaces in obio --- uspace/drv/intctl/obio/obio.c | 7 ++++--- uspace/drv/intctl/obio/obio.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/uspace/drv/intctl/obio/obio.c b/uspace/drv/intctl/obio/obio.c index 67c737ddf..47eaf00fb 100644 --- a/uspace/drv/intctl/obio/obio.c +++ b/uspace/drv/intctl/obio/obio.c @@ -93,7 +93,8 @@ static void obio_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) switch (IPC_GET_IMETHOD(call)) { case IRC_ENABLE_INTERRUPT: inr = IPC_GET_ARG1(call); - ((volatile uint64_t *)(obio->regs))[OBIO_IMR(inr & INO_MASK)] |= (1UL << 31); + pio_set_64(&obio->regs[OBIO_IMR(inr & INO_MASK)], + 1UL << 31, 0); async_answer_0(callid, EOK); break; case IRC_DISABLE_INTERRUPT: @@ -102,7 +103,7 @@ static void obio_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) break; case IRC_CLEAR_INTERRUPT: inr = IPC_GET_ARG1(call); - ((volatile uint64_t *)(obio->regs))[OBIO_CIR(inr & INO_MASK)] = 0; + pio_write_64(&obio->regs[OBIO_CIR(inr & INO_MASK)], 0); async_answer_0(callid, EOK); break; default: @@ -121,7 +122,7 @@ int obio_add(obio_t *obio, obio_res_t *res) int rc; flags = AS_AREA_READ | AS_AREA_WRITE; - obio->regs = (volatile uint64_t *)AS_AREA_ANY; + obio->regs = (ioport64_t *)AS_AREA_ANY; retval = physmem_map(res->base, ALIGN_UP(OBIO_SIZE, PAGE_SIZE) >> PAGE_WIDTH, flags, (void *) &obio->regs); diff --git a/uspace/drv/intctl/obio/obio.h b/uspace/drv/intctl/obio/obio.h index d2dd8e635..ea5290370 100644 --- a/uspace/drv/intctl/obio/obio.h +++ b/uspace/drv/intctl/obio/obio.h @@ -46,7 +46,7 @@ typedef struct { /** OBIO */ typedef struct { - volatile uint64_t *regs; + ioport64_t *regs; uintptr_t phys_base; ddf_dev_t *dev; } obio_t; -- 2.11.4.GIT