Changes in kernel/generic/include/ddi/irq.h [9cdac5a:98000fb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ddi/irq.h
r9cdac5a r98000fb 36 36 #define KERN_IRQ_H_ 37 37 38 #ifdef KERNEL39 40 #include <typedefs.h>41 #include <adt/list.h>42 #include <adt/hash_table.h>43 #include <synch/spinlock.h>44 #include <proc/task.h>45 #include <ipc/ipc.h>46 47 #endif /* KERNEL */48 49 38 typedef enum { 50 /** Read 1 byte from the I/O space. */51 39 CMD_PIO_READ_8 = 1, 52 /** Read 2 bytes from the I/O space. */53 40 CMD_PIO_READ_16, 54 /** Read 4 bytes from the I/O space. */55 41 CMD_PIO_READ_32, 56 57 /** Write 1 byte to the I/O space. */58 42 CMD_PIO_WRITE_8, 59 /** Write 2 bytes to the I/O space. */60 43 CMD_PIO_WRITE_16, 61 /** Write 4 bytes to the I/O space. */62 44 CMD_PIO_WRITE_32, 63 64 /**65 * Write 1 byte from the source argument66 * to the I/O space.67 */68 CMD_PIO_WRITE_A_8,69 /**70 * Write 2 bytes from the source argument71 * to the I/O space.72 */73 CMD_PIO_WRITE_A_16,74 /**75 * Write 4 bytes from the source argument76 * to the I/O space.77 */78 CMD_PIO_WRITE_A_32,79 80 /**81 * Perform a bit masking on the source argument82 * and store the result into the destination argument.83 */84 45 CMD_BTEST, 85 86 /**87 * Predicate the execution of the following88 * N commands by the boolean value of the source89 * argument.90 */91 46 CMD_PREDICATE, 92 93 /** Accept the interrupt. */94 47 CMD_ACCEPT, 95 96 /** Decline the interrupt. */97 48 CMD_DECLINE, 98 49 CMD_LAST … … 102 53 irq_cmd_type cmd; 103 54 void *addr; 104 u int32_tvalue;105 u intptr_t srcarg;106 u intptr_t dstarg;55 unsigned long long value; 56 unsigned int srcarg; 57 unsigned int dstarg; 107 58 } irq_cmd_t; 108 59 109 60 typedef struct { 110 size_t cmdcount;61 unsigned int cmdcount; 111 62 irq_cmd_t *cmds; 112 63 } irq_code_t; … … 114 65 #ifdef KERNEL 115 66 67 #include <arch/types.h> 68 #include <adt/list.h> 69 #include <adt/hash_table.h> 70 #include <synch/spinlock.h> 71 #include <proc/task.h> 72 #include <ipc/ipc.h> 73 116 74 typedef enum { 117 IRQ_DECLINE, 118 IRQ_ACCEPT 75 IRQ_DECLINE, /**< Decline to service. */ 76 IRQ_ACCEPT /**< Accept to service. */ 119 77 } irq_ownership_t; 120 78 … … 134 92 * Primarily, this structure is encapsulated in the irq_t structure. 135 93 * It is protected by irq_t::lock. 136 *137 94 */ 138 95 typedef struct { … … 141 98 /** Answerbox for notifications. */ 142 99 answerbox_t *answerbox; 143 /** Interface and method to be used for the notification. */144 sysarg_t imethod;100 /** Method to be used for the notification. */ 101 unative_t method; 145 102 /** Arguments that will be sent if the IRQ is claimed. */ 146 u int32_t scratch[IPC_CALL_LEN];103 unative_t scratch[IPC_CALL_LEN]; 147 104 /** Top-half pseudocode. */ 148 105 irq_code_t *code; 149 106 /** Counter. */ 150 107 size_t counter; 151 152 108 /** 153 109 * Link between IRQs that are notifying the same answerbox. The list is … … 161 117 * If one device has multiple interrupts, there will be multiple irq_t 162 118 * instantions with the same devno. 163 *164 119 */ 165 120 typedef struct irq { 166 121 /** Hash table link. */ 167 122 link_t link; 168 123 169 124 /** Lock protecting everything in this structure 170 125 * except the link member. When both the IRQ … … 172 127 * this lock must not be taken first. 173 128 */ 174 IRQ_SPINLOCK_DECLARE(lock);129 SPINLOCK_DECLARE(lock); 175 130 176 131 /** Send EOI before processing the interrupt. … … 181 136 */ 182 137 bool preack; 183 138 184 139 /** Unique device number. -1 if not yet assigned. */ 185 140 devno_t devno; 186 141 187 142 /** Actual IRQ number. -1 if not yet assigned. */ 188 143 inr_t inr; … … 195 150 /** Instance argument for the handler and the claim function. */ 196 151 void *instance; 197 152 198 153 /** Clear interrupt routine. */ 199 154 cir_t cir; 200 155 /** First argument to the clear interrupt routine. */ 201 156 void *cir_arg; 202 157 203 158 /** Notification configuration structure. */ 204 159 ipc_notif_cfg_t notif_cfg; 205 160 } irq_t; 206 161 207 IRQ_SPINLOCK_EXTERN(irq_uspace_hash_table_lock);162 SPINLOCK_EXTERN(irq_uspace_hash_table_lock); 208 163 extern hash_table_t irq_uspace_hash_table; 209 210 extern inr_t last_inr;211 164 212 165 extern void irq_init(size_t, size_t); … … 215 168 extern irq_t *irq_dispatch_and_lock(inr_t); 216 169 217 #endif /* KERNEL */170 #endif 218 171 219 172 #endif
Note:
See TracChangeset
for help on using the changeset viewer.