(
context_addr: usize
)
| 333 | interrupt_wrap!(keyboard_handler_inner => keyboard_interrupt_handler); |
| 334 | |
| 335 | extern "C" fn keyboard_handler_inner( |
| 336 | context_addr: usize |
| 337 | )-> usize { |
| 338 | |
| 339 | // Change to a new thread if there is one waiting |
| 340 | if !INTERRUPT_WAITING.read().is_empty() { |
| 341 | |
| 342 | // Schedule waiting threads |
| 343 | for thread in INTERRUPT_WAITING.write().drain(..) { |
| 344 | // Note: This adds to the front of the queue |
| 345 | process::schedule_thread(thread); |
| 346 | } |
| 347 | |
| 348 | // Switch to one of the scheduled threads |
| 349 | process::schedule_next(context_addr) |
| 350 | } else { |
| 351 | // Return to interrupted thread |
| 352 | context_addr |
| 353 | } |
| 354 | } |
nothing calls this directly
no test coverage detected