trap/console: centralize UART use under console.rs master
authorKit Rhett Aultman <kit@kitaultman.com>
Tue, 3 Sep 2024 03:01:07 +0000 (23:01 -0400)
committerKit Rhett Aultman <kit@kitaultman.com>
Tue, 3 Sep 2024 03:01:07 +0000 (23:01 -0400)
commit874cc5f38195295a135b6c4479c8788af63d2322
treebc652ec68d425f9869b68ebc03247666f8891c76
parent23c07e794e23f84105391b99b8132bf4c9b394a3
trap/console: centralize UART use under console.rs

This commit refactors the UART reading code so that all UART
interactions go through the MmioSerialPort in console.rs.  A previous
commit had the UART interrupt handler reading directly from the UART
because some sort of issue prevents calling CONSOLE.lock() outside of
the console crate.  However, it's fine to call this from functions
inside the console crate, so this commit implements a console_read()
function there which the trap vector can then call.
src/console.rs
src/trap.rs