Changeset ff685c9 in mainline for uspace/srv/kbd/port/ns16550.c


Ignore:
Timestamp:
2009-03-03T23:00:33Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
150385b9
Parents:
9cd98796
Message:

Make the kbd port drivers platform neutral by using PIO functions.
The kernel now supplies the physical address and the kernel virtual address.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/kbd/port/ns16550.c

    r9cd98796 rff685c9  
    8787static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call);
    8888
    89 uint16_t ns16550_port;
     89static uintptr_t ns16550_physical;
     90static uintptr_t ns16550_kernel;
    9091
    9192int kbd_port_init(void)
    9293{
     94        void *vaddr;
     95
    9396        async_set_interrupt_received(ns16550_irq_handler);
    9497
    95         ns16550_port = sysinfo_value("kbd.port");
    96         ns16550_kbd.cmds[0].addr = (void *) (ns16550_port + LSR_REG);
    97         ns16550_kbd.cmds[3].addr = (void *) (ns16550_port + RBR_REG);
     98        ns16550_physical = sysinfo_value("kbd.address.physical");
     99        ns16550_kernel = sysinfo_value("kbd.address.kernel");
     100        ns16550_kbd.cmds[0].addr = (void *) (ns16550_kernel + LSR_REG);
     101        ns16550_kbd.cmds[3].addr = (void *) (ns16550_kernel + RBR_REG);
    98102        ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"),
    99103            0, &ns16550_kbd);
    100         iospace_enable(task_get_id(), ns16550_port, 8);
    101 
    102         return 0;
     104        return pio_enable((void *) ns16550_physical, 8, &vaddr);
    103105}
    104106
Note: See TracChangeset for help on using the changeset viewer.