mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Fix: Port needs to be mutable when reading from it
Required because of the update to x86_64 0.7.0 (#606).
This commit is contained in:
@@ -589,7 +589,7 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(
|
||||
{
|
||||
use x86_64::instructions::port::Port;
|
||||
|
||||
let port = Port::new(0x60);
|
||||
let mut port = Port::new(0x60);
|
||||
let scancode: u8 = unsafe { port.read() };
|
||||
print!("{}", scancode);
|
||||
|
||||
@@ -630,7 +630,7 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(
|
||||
{
|
||||
use x86_64::instructions::port::Port;
|
||||
|
||||
let port = Port::new(0x60);
|
||||
let mut port = Port::new(0x60);
|
||||
let scancode: u8 = unsafe { port.read() };
|
||||
|
||||
// new
|
||||
@@ -697,7 +697,7 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(
|
||||
}
|
||||
|
||||
let mut keyboard = KEYBOARD.lock();
|
||||
let port = Port::new(0x60);
|
||||
let mut port = Port::new(0x60);
|
||||
|
||||
let scancode: u8 = unsafe { port.read() };
|
||||
if let Ok(Some(key_event)) = keyboard.add_byte(scancode) {
|
||||
|
||||
Reference in New Issue
Block a user