* Register a hook that will be called after "cold" * autoconfiguration is complete and interrupts can * be used to complete initialization. */
| 181 | * be used to complete initialization. |
| 182 | */ |
| 183 | int |
| 184 | config_intrhook_establish(struct intr_config_hook *hook) |
| 185 | { |
| 186 | struct intr_config_hook *hook_entry; |
| 187 | |
| 188 | TSHOLD("config hooks"); |
| 189 | mtx_lock(&intr_config_hook_lock); |
| 190 | TAILQ_FOREACH(hook_entry, &intr_config_hook_list, ich_links) |
| 191 | if (hook_entry == hook) |
| 192 | break; |
| 193 | if (hook_entry != NULL) { |
| 194 | mtx_unlock(&intr_config_hook_lock); |
| 195 | printf("config_intrhook_establish: establishing an " |
| 196 | "already established hook.\n"); |
| 197 | return (1); |
| 198 | } |
| 199 | TAILQ_INSERT_TAIL(&intr_config_hook_list, hook, ich_links); |
| 200 | if (next_to_notify == NULL) |
| 201 | next_to_notify = hook; |
| 202 | mtx_unlock(&intr_config_hook_lock); |
| 203 | if (cold == 0) |
| 204 | /* |
| 205 | * XXX Call from a task since not all drivers expect |
| 206 | * to be re-entered at the time a hook is established. |
| 207 | */ |
| 208 | /* XXX Sufficient for modules loaded after initial config??? */ |
| 209 | run_interrupt_driven_config_hooks(); |
| 210 | return (0); |
| 211 | } |
| 212 | |
| 213 | /* |
| 214 | * Register a hook function that is automatically unregistered after it runs. |
no test coverage detected