Enable compilation of project on AArch64 architecture

This commit is contained in:
Alex
2023-04-04 16:06:54 +03:00
parent c4ae288ef1
commit 4e20d4d9f4
28 changed files with 242 additions and 50 deletions

View File

@ -96,6 +96,7 @@ namespace CrashHandler
{
CrashKeyboardDriver::CrashKeyboardDriver() : Interrupts::Handler(1) /* IRQ1 */
{
#if defined(a64) || defined(a32)
while (inb(0x64) & 0x1)
inb(0x60);
@ -108,6 +109,8 @@ namespace CrashHandler
outb(0x21, 0xFD);
outb(0xA1, 0xFF);
#endif // defined(a64) || defined(a32)
CPU::Interrupts(CPU::Enable); // Just to be sure.
}
@ -124,9 +127,10 @@ namespace CrashHandler
#elif defined(a32)
SafeFunction void CrashKeyboardDriver::OnInterruptReceived(CPU::x32::TrapFrame *Frame)
#elif defined(aa64)
SafeFunction void CrashKeyboardDriver::OnInterruptReceived(void *Frame)
SafeFunction void CrashKeyboardDriver::OnInterruptReceived(CPU::aarch64::TrapFrame *Frame)
#endif
{
#if defined(a64) || defined(a32)
UNUSED(Frame);
uint8_t scanCode = inb(0x60);
if (scanCode == KEY_D_TAB ||
@ -174,12 +178,17 @@ namespace CrashHandler
}
Display->SetBuffer(SBIdx); // Update as we type.
}
#endif // a64 || a32
}
SafeFunction void HookKeyboard()
{
CrashKeyboardDriver kbd; // We don't want to allocate memory.
#if defined(a64) || defined(a32)
asmv("KeyboardHookLoop: nop; jmp KeyboardHookLoop;");
#elif defined(aa64)
asmv("KeyboardHookLoop: nop; b KeyboardHookLoop;");
#endif
// CPU::Halt(true); // This is an infinite loop.
}
}