Changeset 5626277 in mainline for generic/src/ipc/sysipc.c


Ignore:
Timestamp:
2006-04-29T22:12:40Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
51a7dc1
Parents:
407862e
Message:

Added support for IRQ notifiactions.

  • seems to work correctly on ia32, amd64
  • the mips kbd probably lowers interrupts when the char is read from the port, we will have to find a way how to deal with it.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/ipc/sysipc.c

    r407862e r5626277  
    3737#include <ipc/sysipc.h>
    3838#include <ipc/ipcrsc.h>
    39 
     39#include <arch/interrupt.h>
    4040
    4141#include <print.h>
     
    275275        GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL);
    276276
    277         call = ipc_call_alloc();
     277        call = ipc_call_alloc(0);
    278278        IPC_SET_METHOD(call->data, method);
    279279        IPC_SET_ARG1(call->data, arg1);
     
    303303        GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL);
    304304
    305         call = ipc_call_alloc();
     305        call = ipc_call_alloc(0);
    306306        copy_from_uspace(&call->data.args, &data->args, sizeof(call->data.args));
    307307        if (!(res=request_preprocess(call)))
     
    442442                return 0;
    443443
     444        if (call->flags & IPC_CALL_NOTIF) {
     445                ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC));
     446                STRUCT_TO_USPACE(&calldata->args, &call->data.args);
     447                ipc_call_free(call);
     448               
     449                return ((__native)call) | IPC_CALLID_NOTIFICATION;
     450        }
     451
    444452        if (call->flags & IPC_CALL_ANSWERED) {
    445453                process_answer(call);
     
    468476        return (__native)call;
    469477}
     478
     479/** Connect irq handler to task */
     480__native sys_ipc_register_irq(__native irq)
     481{
     482        if (irq >= IRQ_COUNT)
     483                return -ELIMIT;
     484
     485        irq_ipc_bind_arch(irq);
     486        return ipc_irq_register(&TASK->answerbox, irq);
     487}
     488
     489/* Disconnect irq handler from task */
     490__native sys_ipc_unregister_irq(__native irq)
     491{
     492        if (irq >= IRQ_COUNT)
     493                return -ELIMIT;
     494
     495        ipc_irq_unregister(&TASK->answerbox, irq);
     496
     497        return 0;
     498}
Note: See TracChangeset for help on using the changeset viewer.