Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 2507d1fc in mainline


Ignore:
Timestamp:
2012-02-12T22:17:59Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
cccdb8b7
Parents:
ec52752
Message:

Define a PIO range for the i8042 driver.

File:
1 edited

Legend:

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

    rec52752 r2507d1fc  
    7575#define i8042_KBD_TRANSLATE     0x40 /* Use this to switch to XT scancodes */
    7676
     77static const irq_pio_range_t i8042_ranges[] = {
     78        {
     79                .base = 0,
     80                .size = sizeof(i8042_regs_t)
     81        }
     82};
     83
    7784/** i8042 Interrupt pseudo-code. */
    7885static const irq_cmd_t i8042_cmds[] = {
     
    228235} else (void)0
    229236
     237        const size_t range_count = sizeof(i8042_ranges) /
     238            sizeof(irq_pio_range_t);
    230239        const size_t cmd_count = sizeof(i8042_cmds) / sizeof(irq_cmd_t);
     240        irq_pio_range_t ranges[range_count];
    231241        irq_cmd_t cmds[cmd_count];
     242        memcpy(ranges, i8042_ranges, sizeof(i8042_ranges));
     243        ranges[0].base = (uintptr_t) regs;
    232244        memcpy(cmds, i8042_cmds, sizeof(i8042_cmds));
    233245        cmds[0].addr = (void *) &dev->regs->status;
    234246        cmds[3].addr = (void *) &dev->regs->data;
    235247
    236         irq_code_t irq_code = { .cmdcount = cmd_count, .cmds = cmds };
     248        irq_code_t irq_code = {
     249                .rangecount = range_count,
     250                .ranges = ranges,
     251                .cmdcount = cmd_count,
     252                .cmds = cmds
     253        };
    237254        ret = register_interrupt_handler(ddf_dev, irq_kbd, i8042_irq_handler,
    238255            &irq_code);
Note: See TracChangeset for help on using the changeset viewer.