Changes in kernel/generic/include/ddi/irq.h [d99c1d2:da1bafb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ddi/irq.h
rd99c1d2 rda1bafb 35 35 #ifndef KERN_IRQ_H_ 36 36 #define KERN_IRQ_H_ 37 38 #ifdef KERNEL 39 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 */ 37 48 38 49 typedef enum { … … 49 60 /** Write 4 bytes to the I/O space. */ 50 61 CMD_PIO_WRITE_32, 62 51 63 /** 52 64 * Perform a bit test on the source argument and store the result into … … 54 66 */ 55 67 CMD_BTEST, 68 56 69 /** 57 70 * Predicate the execution of the following N commands by the boolean … … 59 72 */ 60 73 CMD_PREDICATE, 74 61 75 /** Accept the interrupt. */ 62 76 CMD_ACCEPT, … … 69 83 irq_cmd_type cmd; 70 84 void *addr; 71 u nsigned long longvalue;72 u nsigned int srcarg;73 u nsigned int dstarg;85 uint32_t value; 86 uintptr_t srcarg; 87 uintptr_t dstarg; 74 88 } irq_cmd_t; 75 89 76 90 typedef struct { 77 unsigned int cmdcount;91 size_t cmdcount; 78 92 irq_cmd_t *cmds; 79 93 } irq_code_t; … … 81 95 #ifdef KERNEL 82 96 83 #include <typedefs.h>84 #include <adt/list.h>85 #include <adt/hash_table.h>86 #include <synch/spinlock.h>87 #include <proc/task.h>88 #include <ipc/ipc.h>89 90 97 typedef enum { 91 IRQ_DECLINE, 92 IRQ_ACCEPT 98 IRQ_DECLINE, /**< Decline to service. */ 99 IRQ_ACCEPT /**< Accept to service. */ 93 100 } irq_ownership_t; 94 101 … … 108 115 * Primarily, this structure is encapsulated in the irq_t structure. 109 116 * It is protected by irq_t::lock. 117 * 110 118 */ 111 119 typedef struct { … … 117 125 unative_t method; 118 126 /** Arguments that will be sent if the IRQ is claimed. */ 119 u native_t scratch[IPC_CALL_LEN];127 uint32_t scratch[IPC_CALL_LEN]; 120 128 /** Top-half pseudocode. */ 121 129 irq_code_t *code; 122 130 /** Counter. */ 123 131 size_t counter; 132 124 133 /** 125 134 * Link between IRQs that are notifying the same answerbox. The list is … … 133 142 * If one device has multiple interrupts, there will be multiple irq_t 134 143 * instantions with the same devno. 144 * 135 145 */ 136 146 typedef struct irq { 137 147 /** Hash table link. */ 138 148 link_t link; 139 149 140 150 /** Lock protecting everything in this structure 141 151 * except the link member. When both the IRQ … … 143 153 * this lock must not be taken first. 144 154 */ 145 SPINLOCK_DECLARE(lock);155 IRQ_SPINLOCK_DECLARE(lock); 146 156 147 157 /** Send EOI before processing the interrupt. … … 152 162 */ 153 163 bool preack; 154 164 155 165 /** Unique device number. -1 if not yet assigned. */ 156 166 devno_t devno; 157 167 158 168 /** Actual IRQ number. -1 if not yet assigned. */ 159 169 inr_t inr; … … 166 176 /** Instance argument for the handler and the claim function. */ 167 177 void *instance; 168 178 169 179 /** Clear interrupt routine. */ 170 180 cir_t cir; 171 181 /** First argument to the clear interrupt routine. */ 172 182 void *cir_arg; 173 183 174 184 /** Notification configuration structure. */ 175 185 ipc_notif_cfg_t notif_cfg; 176 186 } irq_t; 177 187 178 SPINLOCK_EXTERN(irq_uspace_hash_table_lock);188 IRQ_SPINLOCK_EXTERN(irq_uspace_hash_table_lock); 179 189 extern hash_table_t irq_uspace_hash_table; 180 190 … … 184 194 extern irq_t *irq_dispatch_and_lock(inr_t); 185 195 196 #endif /* KERNEL */ 197 186 198 #endif 187 199 188 #endif189 190 200 /** @} 191 201 */
Note:
See TracChangeset
for help on using the changeset viewer.