Changeset 43752b6 in mainline for generic/src/ipc/irq.c
- Timestamp:
- 2006-06-11T17:03:02Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dd054bc2
- Parents:
- 0b917dd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/ipc/irq.c
r0b917dd r43752b6 35 35 * 36 36 * 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 41 42 * in multithreaded drivers) 42 43 */ … … 67 68 { 68 69 int i; 70 __native dstval = 0; 69 71 70 72 if (!code) … … 74 76 switch (code->cmds[i].cmd) { 75 77 case CMD_MEM_READ_1: 76 IPC_SET_ARG2(call->data, *((__u8 *)code->cmds[i].addr));78 dstval = *((__u8 *)code->cmds[i].addr); 77 79 break; 78 80 case CMD_MEM_READ_2: 79 IPC_SET_ARG2(call->data, *((__u16 *)code->cmds[i].addr));81 dstval = *((__u16 *)code->cmds[i].addr); 80 82 break; 81 83 case CMD_MEM_READ_4: 82 IPC_SET_ARG2(call->data, *((__u32 *)code->cmds[i].addr));84 dstval = *((__u32 *)code->cmds[i].addr); 83 85 break; 84 86 case CMD_MEM_READ_8: 85 IPC_SET_ARG2(call->data, *((__u64 *)code->cmds[i].addr));87 dstval = *((__u64 *)code->cmds[i].addr); 86 88 break; 87 89 case CMD_MEM_WRITE_1: … … 99 101 #if defined(ia32) || defined(amd64) 100 102 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); 102 104 break; 103 105 case CMD_PORT_WRITE_1: … … 107 109 #if defined(ia64) 108 110 case CMD_IA64_GETCHAR: 109 IPC_SET_ARG2(call->data, _getc(&ski_uconsole));111 dstval = _getc(&ski_uconsole); 110 112 break; 111 113 #endif 112 114 #if defined(ppc32) 113 115 case CMD_PPC32_GETCHAR: 114 IPC_SET_ARG2(call->data, cuda_get_scancode());116 dstval = cuda_get_scancode(); 115 117 break; 116 118 #endif 117 119 default: 118 120 break; 121 } 122 if (code->cmds[i].dstarg && code->cmds[i].dstarg < 4) { 123 call->data.args[code->cmds[i].dstarg] = dstval; 119 124 } 120 125 } … … 225 230 * 226 231 */ 227 void ipc_irq_send_msg(int irq, __native a 2, __native a3)232 void ipc_irq_send_msg(int irq, __native a1, __native a2, __native a3) 228 233 { 229 234 call_t *call; … … 239 244 } 240 245 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); 243 248 IPC_SET_ARG2(call->data, a2); 244 249 IPC_SET_ARG3(call->data, a3); 250 /* Put a counter to the message */ 251 call->private = atomic_preinc(&irq_conns[mq].counter); 245 252 246 253 send_call(mq, call); … … 268 275 } 269 276 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); 273 281 274 282 /* Execute code to handle irq */
Note:
See TracChangeset
for help on using the changeset viewer.