mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:17:44 +00:00
Prekernel: Install EL1 vector table at boot on aarch64
We now have a function to install a (currently default) vector table, meaning that any exceptions (or interrupts for that matter) will be caught by the processor and routed to one of the vectors inside the table.
This commit is contained in:
parent
28e36a70d6
commit
547322fb95
5 changed files with 87 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Nico Weber <thakis@chromium.org>
|
||||
* Copyright (c) 2021, Marcin Undak <mcinek@gmail.com>
|
||||
* Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -45,6 +46,13 @@ extern "C" [[noreturn]] void init()
|
|||
uart.print_str("Drop CPU to EL1\r\n");
|
||||
Prekernel::drop_to_exception_level_1();
|
||||
|
||||
// Load EL1 vector table
|
||||
extern uintptr_t vector_table_el1;
|
||||
el1_vector_table_install(&vector_table_el1);
|
||||
|
||||
// Set the register
|
||||
asm("msr sctlr_el1, %[value]" ::[value] "r"(system_control_register_el1));
|
||||
|
||||
uart.print_str("Initialize MMU\r\n");
|
||||
Prekernel::init_prekernel_page_tables();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue