Implement cpu_local with GS and ensure GS points to TSS

This commit is contained in:
Qingsong Chen
2024-09-19 02:11:32 +00:00
committed by Tate, Hongliang Tian
parent 52bde1721e
commit c2f7a10b84
30 changed files with 901 additions and 112 deletions

View File

@ -117,11 +117,17 @@ SECTIONS
# processor, while it would be copied to other dynamically allocated memory
# areas for the application processors.
. = ALIGN(4096);
.cpu_local : AT(ADDR(.cpu_local) - KERNEL_VMA) {
__cpu_local_start = .;
KEEP(*(SORT(.cpu_local)))
__cpu_local_end = .;
__cpu_local_start = .;
# Make sure that cpu_local_tss is right at the beginning of CPU local area,
# which stores the task state segment in x86_64 architecture, so that
# when trap from ring3 to ring0, CPU can switch stack correctly.
.cpu_local_tss : AT(ADDR(.cpu_local_tss) - KERNEL_VMA) {
*(.cpu_local_tss)
}
.cpu_local : AT(ADDR(.cpu_local) - KERNEL_VMA) {
KEEP(*(SORT(.cpu_local)))
}
__cpu_local_end = .;
.bss : AT(ADDR(.bss) - KERNEL_VMA) {
__bss = .;