[kernel] Update syscall MSRs for all CPUs

Since SYSCALL/SYSRET rely on MSRs to control their function, split out
syscall_enable() into syscall_initialize() and syscall_enable(), the
latter being called on all CPUs. This affects not just syscalls but also
the kernel_to_user_trampoline.

Additionally, do away with the max syscalls, and just make a single page
of syscall pointers and name pointers. Max syscalls was fragile and
needed to be kept in sync in multiple places.
This commit is contained in:
Justin C. Miller
2021-02-10 01:15:32 -08:00
parent 70d6094f46
commit 872f178d94
5 changed files with 64 additions and 47 deletions

View File

@@ -149,6 +149,7 @@ kernel_main(args::header *header)
}
}
syscall_initialize();
device_manager &devices = device_manager::get();
devices.parse_acpi(header->acpi_table);
@@ -184,7 +185,6 @@ kernel_main(args::header *header)
}
*/
syscall_enable();
scheduler *sched = new scheduler(devices.get_lapic());
// Skip program 0, which is the kernel itself