Changeset 43752b6 in mainline for generic/src/ipc/irq.c


Ignore:
Timestamp:
2006-06-11T17:03:02Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dd054bc2
Parents:
0b917dd
Message:

Modified ipc/irq to be able to pass up to 3 arguments to userspace.

File:
1 edited

Legend:

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

    r0b917dd r43752b6  
    3535 *
    3636 * The structure of a notification message is as follows:
    37  * - METHOD: IPC_M_INTERRUPT
    38  * - ARG1: interrupt number
    39  * - ARG2: payload modified by a 'top-half' handler
    40  * - ARG3: interrupt counter (may be needed to assure correct order
     37 * - METHOD: interrupt number
     38 * - ARG1: payload modified by a 'top-half' handler
     39 * - ARG2: payload
     40 * - ARG3: payload
     41 * - in_phone_hash: interrupt counter (may be needed to assure correct order
    4142 *         in multithreaded drivers)
    4243 */
     
    6768{
    6869        int i;
     70        __native dstval = 0;
    6971       
    7072        if (!code)
     
    7476                switch (code->cmds[i].cmd) {
    7577                case CMD_MEM_READ_1:
    76                         IPC_SET_ARG2(call->data, *((__u8 *)code->cmds[i].addr));
     78                        dstval = *((__u8 *)code->cmds[i].addr);
    7779                        break;
    7880                case CMD_MEM_READ_2:
    79                         IPC_SET_ARG2(call->data, *((__u16 *)code->cmds[i].addr));
     81                        dstval = *((__u16 *)code->cmds[i].addr);
    8082                        break;
    8183                case CMD_MEM_READ_4:
    82                         IPC_SET_ARG2(call->data, *((__u32 *)code->cmds[i].addr));
     84                        dstval = *((__u32 *)code->cmds[i].addr);
    8385                        break;
    8486                case CMD_MEM_READ_8:
    85                         IPC_SET_ARG2(call->data, *((__u64 *)code->cmds[i].addr));
     87                        dstval = *((__u64 *)code->cmds[i].addr);
    8688                        break;
    8789                case CMD_MEM_WRITE_1:
     
    99101#if defined(ia32) || defined(amd64)
    100102                case CMD_PORT_READ_1:
    101                         IPC_SET_ARG2(call->data, inb((long)code->cmds[i].addr));
     103                        dstval = inb((long)code->cmds[i].addr);
    102104                        break;
    103105                case CMD_PORT_WRITE_1:
     
    107109#if defined(ia64)
    108110                case CMD_IA64_GETCHAR:
    109                         IPC_SET_ARG2(call->data, _getc(&ski_uconsole));
     111                        dstval = _getc(&ski_uconsole);
    110112                        break;
    111113#endif
    112114#if defined(ppc32)
    113115                case CMD_PPC32_GETCHAR:
    114                         IPC_SET_ARG2(call->data, cuda_get_scancode());
     116                        dstval = cuda_get_scancode();
    115117                        break;
    116118#endif
    117119                default:
    118120                        break;
     121                }
     122                if (code->cmds[i].dstarg && code->cmds[i].dstarg < 4) {
     123                        call->data.args[code->cmds[i].dstarg] = dstval;
    119124                }
    120125        }
     
    225230 *
    226231 */
    227 void ipc_irq_send_msg(int irq, __native a2, __native a3)
     232void ipc_irq_send_msg(int irq, __native a1, __native a2, __native a3)
    228233{
    229234        call_t *call;
     
    239244                }
    240245                call->flags |= IPC_CALL_NOTIF;
    241                 IPC_SET_METHOD(call->data, IPC_M_INTERRUPT);
    242                 IPC_SET_ARG1(call->data, irq);
     246                IPC_SET_METHOD(call->data, irq);
     247                IPC_SET_ARG1(call->data, a1);
    243248                IPC_SET_ARG2(call->data, a2);
    244249                IPC_SET_ARG3(call->data, a3);
     250                /* Put a counter to the message */
     251                call->private = atomic_preinc(&irq_conns[mq].counter);
    245252               
    246253                send_call(mq, call);
     
    268275                }
    269276                call->flags |= IPC_CALL_NOTIF;
    270                 IPC_SET_METHOD(call->data, IPC_M_INTERRUPT);
    271                 IPC_SET_ARG1(call->data, irq);
    272                 IPC_SET_ARG3(call->data, atomic_preinc(&irq_conns[mq].counter));
     277                /* Put a counter to the message */
     278                call->private = atomic_preinc(&irq_conns[mq].counter);
     279                /* Set up args */
     280                IPC_SET_METHOD(call->data, irq);
    273281
    274282                /* Execute code to handle irq */
Note: See TracChangeset for help on using the changeset viewer.