Changeset bdc5c516 in mainline
- Timestamp:
- 2006-05-03T08:18:01Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 22cf454d
- Parents:
- cc35e88
- Location:
- generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/include/ipc/irq.h
rcc35e88 rbdc5c516 41 41 CMD_MEM_WRITE_4, 42 42 CMD_MEM_WRITE_8, 43 CMD_PORT_READ_1, 44 CMD_PORT_WRITE_1, 43 45 CMD_LAST 44 46 } irq_cmd_type; -
generic/src/ipc/irq.c
rcc35e88 rbdc5c516 27 27 */ 28 28 29 /** IRQ notification framework 30 * 31 * This framework allows applications to register to receive a notification 32 * when interrupt is detected. The application may provide a simple 'top-half' 33 * handler as part of its registration, which can perform simple operations 34 * (read/write port/memory, add information to notification ipc message). 35 * 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 41 * in multithreaded drivers) 42 */ 43 29 44 #include <arch.h> 30 45 #include <mm/slab.h> … … 32 47 #include <ipc/ipc.h> 33 48 #include <ipc/irq.h> 49 #include <atomic.h> 34 50 35 51 typedef struct { … … 37 53 answerbox_t *box; 38 54 irq_code_t *code; 55 atomic_t counter; 39 56 } ipc_irq_t; 40 57 … … 78 95 *((__u64 *)code->cmds[i].addr) = code->cmds[i].value; 79 96 break; 97 #if defined(ia32) || defined(amd64) 98 case CMD_PORT_READ_1: 99 IPC_SET_ARG2(call->data, inb((long)code->cmds[i].addr)); 100 break; 101 case CMD_PORT_WRITE_1: 102 outb((long)code->cmds[i].addr, code->cmds[i].value); 103 break; 104 #endif 80 105 default: 81 106 break; … … 154 179 irq_conns[irq].box = box; 155 180 irq_conns[irq].code = code; 181 atomic_set(&irq_conns[irq].counter, 0); 156 182 spinlock_unlock(&irq_conns[irq].lock); 157 183 interrupts_restore(ipl); … … 176 202 IPC_SET_METHOD(call->data, IPC_M_INTERRUPT); 177 203 IPC_SET_ARG1(call->data, irq); 204 IPC_SET_ARG3(call->data, atomic_preinc(&irq_conns[irq].counter)); 178 205 179 206 /* Execute code to handle irq */
Note:
See TracChangeset
for help on using the changeset viewer.