Changeset 21df2e5 in mainline


Ignore:
Timestamp:
2009-02-21T20:49:01Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0c33687a
Parents:
7bdd725
Message:

Adapt the userspace ns16550 driver to the new pseudocode.

File:
1 edited

Legend:

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

    r7bdd725 r21df2e5  
    5151#define LSR_REG         5       /** Line Status Register. */
    5252
    53 irq_cmd_t ns16550_cmds[1] = {
    54         { CMD_PORT_READ_1, 0, 0, 2 },
     53#define LSR_DATA_READY  0x01
     54
     55static irq_cmd_t ns16550_cmds[] = {
     56        {
     57                .cmd = CMD_PIO_READ_8,
     58                .addr = (void *) 0,     /* will be patched in run-time */
     59                .dstarg = 1
     60        },
     61        {
     62                .cmd = CMD_BTEST,
     63                .value = LSR_DATA_READY,
     64                .srcarg = 1,
     65                .dstarg = 3
     66        },
     67        {
     68                .cmd = CMD_PREDICATE,
     69                .value = 2,
     70                .srcarg = 3
     71        },
     72        {
     73                .cmd = CMD_PIO_READ_8,
     74                .addr = (void *) 0,     /* will be patched in run-time */
     75                .dstarg = 2
     76        },
     77        {
     78                .cmd = CMD_ACCEPT
     79        }
    5580};
    5681
    5782irq_code_t ns16550_kbd = {
    58         1,
     83        sizeof(ns16550_cmds) / sizeof(irq_cmd_t),
    5984        ns16550_cmds
    6085};
     
    6994
    7095        ns16550_port = sysinfo_value("kbd.port");
    71         ns16550_kbd.cmds[0].addr = (void *) (ns16550_port + RBR_REG);
     96        ns16550_kbd.cmds[0].addr = (void *) (ns16550_port + LSR_REG);
     97        ns16550_kbd.cmds[3].addr = (void *) (ns16550_port + RBR_REG);
    7298        ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"),
    7399            0, &ns16550_kbd);
     
    76102        return 0;
    77103}
    78 
    79 #define LSR_DATA_READY  0x01
    80104
    81105static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call)
Note: See TracChangeset for help on using the changeset viewer.