MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / keyboard_handler_inner

Function keyboard_handler_inner

kernel/src/interrupts.rs:335–354  ·  view source on GitHub ↗
(
    context_addr: usize
)

Source from the content-addressed store, hash-verified

333interrupt_wrap!(keyboard_handler_inner => keyboard_interrupt_handler);
334
335extern "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}

Callers

nothing calls this directly

Calls 4

schedule_threadFunction · 0.85
schedule_nextFunction · 0.85
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected