Changeset 0f74869 in mainline for uspace/srv/kbd/port/z8530.c


Ignore:
Timestamp:
2009-02-22T15:20:43Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f9f9a13
Parents:
e7abb0e
Message:

Unbreak sparc64.
Due to the lack of userspace bus drivers for the z8530 and ns16550,
we are currently handling exactly one interrupt from these devices
in userspace.

File:
1 edited

Legend:

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

    re7abb0e r0f74869  
    4242#include <sys/types.h>
    4343
    44 /** Top-half pseudocode for z8530. */
    45 irq_cmd_t z8530_cmds[] = {
     44#define CHAN_A_STATUS   4
     45#define CHAN_A_DATA     6
     46
     47#define RR0_RCA 1
     48
     49static irq_cmd_t z8530_cmds[] = {
    4650        {
    47                 CMD_MEM_READ_1,
    48                 0,              /**< Address. Will be patched in run-time. */
    49                 0,              /**< Value. Not used. */
    50                 1               /**< Arg 1 will contain the result. */
     51                .cmd = CMD_PIO_READ_8,
     52                .addr = (void *) 0,     /* will be patched in run-time */
     53                .dstarg = 1
     54        },
     55        {
     56                .cmd = CMD_BTEST,
     57                .value = RR0_RCA,
     58                .srcarg = 1,
     59                .dstarg = 3
     60        },
     61        {
     62                .cmd = CMD_PREDICATE,
     63                .value = 2,
     64                .srcarg = 3
     65        },
     66        {
     67                .cmd = CMD_PIO_READ_8,
     68                .addr = (void *) 0,     /* will be patched in run-time */
     69                .dstarg = 2
     70        },
     71        {
     72                .cmd = CMD_ACCEPT
    5173        }
    5274};
    53 
    5475       
    5576irq_code_t z8530_kbd = {
    56         1,
     77        sizeof(z8530_cmds) / sizeof(irq_cmd_t),
    5778        z8530_cmds
    5879};
     
    6384{
    6485        async_set_interrupt_received(z8530_irq_handler);
    65         z8530_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual") + 6;
     86        z8530_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual") +
     87            CHAN_A_STATUS;
     88        z8530_cmds[3].addr = (void *) sysinfo_value("kbd.address.virtual") +
     89            CHAN_A_DATA;
    6690        ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"),
    6791            0, &z8530_kbd);
     
    7195static void z8530_irq_handler(ipc_callid_t iid, ipc_call_t *call)
    7296{
    73         int scan_code = IPC_GET_ARG1(*call);
     97        int scan_code = IPC_GET_ARG2(*call);
    7498        kbd_push_scancode(scan_code);
    7599}
Note: See TracChangeset for help on using the changeset viewer.