Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/char/i8042/i8042.c

    r7de1988c rca4730a5  
    145145 *
    146146 * @param dev       Driver structure to initialize.
    147  * @param regs      I/O range  of registers.
     147 * @param regs      I/O address of registers.
     148 * @param reg_size  size of the reserved I/O address space.
    148149 * @param irq_kbd   IRQ for primary port.
    149150 * @param irq_mouse IRQ for aux port.
     
    153154 *
    154155 */
    155 int i8042_init(i8042_t *dev, addr_range_t *regs, int irq_kbd,
     156int i8042_init(i8042_t *dev, void *regs, size_t reg_size, int irq_kbd,
    156157    int irq_mouse, ddf_dev_t *ddf_dev)
    157158{
     
    161162        const size_t cmd_count = sizeof(i8042_cmds) / sizeof(irq_cmd_t);
    162163        irq_cmd_t cmds[cmd_count];
    163         i8042_regs_t *ar;
    164164
    165165        int rc;
     
    170170        dev->aux_fun = NULL;
    171171       
    172         if (regs->size < sizeof(i8042_regs_t)) {
     172        if (reg_size < sizeof(i8042_regs_t)) {
    173173                rc = EINVAL;
    174174                goto error;
    175175        }
    176176       
    177         if (pio_enable_range(regs, (void **) &dev->regs) != 0) {
     177        if (pio_enable(regs, sizeof(i8042_regs_t), (void **) &dev->regs) != 0) {
    178178                rc = EIO;
    179179                goto error;
     
    234234
    235235        memcpy(ranges, i8042_ranges, sizeof(i8042_ranges));
    236         ranges[0].base = RNGABS(*regs);
    237 
    238 
    239         ar = RNGABSPTR(*regs);
     236        ranges[0].base = (uintptr_t) regs;
     237
    240238        memcpy(cmds, i8042_cmds, sizeof(i8042_cmds));
    241         cmds[0].addr = (void *) &ar->status;
    242         cmds[3].addr = (void *) &ar->data;
     239        cmds[0].addr = (void *) &(((i8042_regs_t *) regs)->status);
     240        cmds[3].addr = (void *) &(((i8042_regs_t *) regs)->data);
    243241
    244242        irq_code_t irq_code = {
Note: See TracChangeset for help on using the changeset viewer.