Changeset 602ca36b in mainline for ns/ns.c


Ignore:
Timestamp:
2006-05-02T21:50:06Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f33cb0b9
Parents:
fa3561f
Message:

Added way to do an action upon interrupt.
ns.c contains a commented example on how to access keyboard in msim.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ns/ns.c

    rfa3561f r602ca36b  
    55#include <ns.h>
    66#include <errno.h>
     7/*
     8irq_cmd_t msim_cmds[1] = {
     9        { CMD_MEM_READ_1, (void *)0xB0000000, 0 }
     10};
    711
     12irq_code_t msim_kbd = {
     13        1,
     14        msim_cmds
     15};
     16*/
    817static int service;
    918
     
    1625
    1726        printf("NS:Name service started.\n");
    18 //      ipc_register_irq(1);
     27//      ipc_register_irq(2, &msim_kbd);
    1928        while (1) {
    2029                callid = ipc_wait_for_call(&call, 0);
     
    2231                switch (IPC_GET_METHOD(call)) {
    2332                case IPC_M_INTERRUPT:
    24                         printf("GOT INTERRUPT\n");
     33                        printf("GOT INTERRUPT: %c\n", IPC_GET_ARG2(call));
    2534                        break;
    2635                case IPC_M_PHONE_HUNGUP:
     
    5968                        break;
    6069                }
    61                 if (! (callid & IPC_CALLID_NOTIFICATION))
     70                if (! (callid & IPC_CALLID_NOTIFICATION)) {
     71                        printf("Answerinh\n");
    6272                        ipc_answer(callid, retval, arg1, arg2);
     73                }
    6374        }
    6475}
Note: See TracChangeset for help on using the changeset viewer.