Changeset 602ca36b in mainline


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.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libipc/generic/ipc.c

    rfa3561f r602ca36b  
    263263}
    264264
    265 int ipc_register_irq(int irq)
    266 {
    267         return __SYSCALL1(SYS_IPC_REGISTER_IRQ, irq);
     265int ipc_register_irq(int irq, irq_code_t *ucode)
     266{
     267        return __SYSCALL2(SYS_IPC_REGISTER_IRQ, irq, (sysarg_t) ucode);
    268268}
    269269
  • libipc/include/ipc.h

    rfa3561f r602ca36b  
    3131
    3232#include <kernel/ipc/ipc.h>
     33#include <kernel/ipc/irq.h>
    3334#include <libc.h>
    3435#include <types.h>
     
    6465int ipc_connect_me_to(int phoneid, int arg1, int arg2);
    6566int ipc_hangup(int phoneid);
    66 int ipc_register_irq(int irq);
     67int ipc_register_irq(int irq, irq_code_t *code);
    6768int ipc_unregister_irq(int irq);
    6869
  • 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.