Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/intctl/obio/obio.c

    rc1694b6b rd0cbfd3  
    4242 */
    4343
     44#include <align.h>
     45#include <as.h>
    4446#include <async.h>
    4547#include <ddf/driver.h>
     
    4749#include <ddi.h>
    4850#include <errno.h>
    49 #include <str_error.h>
    5051#include <inttypes.h>
    5152#include <ipc/irc.h>
     
    117118{
    118119        ddf_fun_t *fun_a = NULL;
     120        int flags;
     121        int retval;
    119122        int rc;
    120123
    121         rc = pio_enable((void *)res->base, OBIO_SIZE, (void **) &obio->regs);
    122         if (rc != EOK) {
     124        flags = AS_AREA_READ | AS_AREA_WRITE;
     125        obio->regs = (ioport64_t *)AS_AREA_ANY;
     126        retval = physmem_map(res->base,
     127            ALIGN_UP(OBIO_SIZE, PAGE_SIZE) >> PAGE_WIDTH, flags,
     128            (void *) &obio->regs);
     129
     130        if (retval < 0) {
    123131                ddf_msg(LVL_ERROR, "Error mapping OBIO registers");
    124132                rc = EIO;
     
    126134        }
    127135
    128         ddf_msg(LVL_NOTE, "OBIO registers with base at 0x%" PRIxn, res->base);
     136        ddf_msg(LVL_NOTE, "OBIO registers with base at 0x%" PRIun, res->base);
    129137
    130138        fun_a = ddf_fun_create(obio->dev, fun_exposed, "a");
     
    139147        rc = ddf_fun_bind(fun_a);
    140148        if (rc != EOK) {
    141                 ddf_msg(LVL_ERROR, "Failed binding function 'a': %s", str_error(rc));
     149                ddf_msg(LVL_ERROR, "Failed binding function 'a'. (%d)", rc);
    142150                goto error;
    143151        }
Note: See TracChangeset for help on using the changeset viewer.