Changes in uspace/drv/char/i8042/i8042.c [7de1988c:ca4730a5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/i8042/i8042.c
r7de1988c rca4730a5 145 145 * 146 146 * @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. 148 149 * @param irq_kbd IRQ for primary port. 149 150 * @param irq_mouse IRQ for aux port. … … 153 154 * 154 155 */ 155 int i8042_init(i8042_t *dev, addr_range_t *regs, int irq_kbd,156 int i8042_init(i8042_t *dev, void *regs, size_t reg_size, int irq_kbd, 156 157 int irq_mouse, ddf_dev_t *ddf_dev) 157 158 { … … 161 162 const size_t cmd_count = sizeof(i8042_cmds) / sizeof(irq_cmd_t); 162 163 irq_cmd_t cmds[cmd_count]; 163 i8042_regs_t *ar;164 164 165 165 int rc; … … 170 170 dev->aux_fun = NULL; 171 171 172 if (reg s->size < sizeof(i8042_regs_t)) {172 if (reg_size < sizeof(i8042_regs_t)) { 173 173 rc = EINVAL; 174 174 goto error; 175 175 } 176 176 177 if (pio_enable _range(regs, (void **) &dev->regs) != 0) {177 if (pio_enable(regs, sizeof(i8042_regs_t), (void **) &dev->regs) != 0) { 178 178 rc = EIO; 179 179 goto error; … … 234 234 235 235 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 240 238 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); 243 241 244 242 irq_code_t irq_code = {
Note:
See TracChangeset
for help on using the changeset viewer.