Changeset c822026 in mainline for kernel/generic/src/ipc/irq.c
- Timestamp:
- 2009-04-13T21:35:28Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4ee4046
- Parents:
- 37c312a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/irq.c
r37c312a rc822026 129 129 /** Register an answerbox as a receiving end for IRQ notifications. 130 130 * 131 * @param box Receiving answerbox. 132 * @param inr IRQ number. 133 * @param devno Device number. 134 * @param method Method to be associated with the notification. 135 * @param ucode Uspace pointer to top-half pseudocode. 136 * 137 * @return EBADMEM, ENOENT or EEXISTS on failure or 0 on success. 131 * @param box Receiving answerbox. 132 * @param inr IRQ number. 133 * @param devno Device number. 134 * @param method Method to be associated with the notification. 135 * @param ucode Uspace pointer to top-half pseudocode. 136 * 137 * @return EBADMEM, ENOENT or EEXISTS on failure or 0 on success. 138 * 138 139 */ 139 140 int ipc_irq_register(answerbox_t *box, inr_t inr, devno_t devno, … … 148 149 (unative_t) devno 149 150 }; 150 151 151 152 if (ucode) { 152 153 code = code_from_uspace(ucode); … … 156 157 code = NULL; 157 158 } 158 159 159 160 /* 160 161 * Allocate and populate the IRQ structure. … … 171 172 irq->notif_cfg.code = code; 172 173 irq->notif_cfg.counter = 0; 173 174 174 175 /* 175 176 * Enlist the IRQ structure in the uspace IRQ hash table and the … … 180 181 hlp = hash_table_find(&irq_uspace_hash_table, key); 181 182 if (hlp) { 182 irq_t *hirq = hash_table_get_instance(hlp, irq_t, link); 183 irq_t *hirq __attribute__((unused)) 184 = hash_table_get_instance(hlp, irq_t, link); 185 183 186 /* hirq is locked */ 184 187 spinlock_unlock(&hirq->lock); … … 189 192 return EEXISTS; 190 193 } 191 spinlock_lock(&irq->lock); /* not really necessary, but paranoid */ 194 195 spinlock_lock(&irq->lock); /* Not really necessary, but paranoid */ 192 196 spinlock_lock(&box->irq_lock); 193 197 hash_table_insert(&irq_uspace_hash_table, key, &irq->link); … … 196 200 spinlock_unlock(&irq->lock); 197 201 spinlock_unlock(&irq_uspace_hash_table_lock); 198 202 199 203 interrupts_restore(ipl); 200 204 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.