hw_x86_64: Use mtc relative addressing for _mt_buffer in crt0.s
Until the kernel page tables are active, labels can't be used directly because the associated pages are not mapped for non-core threads.
This commit is contained in:
parent
09c90e5751
commit
080d7d5f8b
|
@ -32,6 +32,8 @@
|
||||||
/* tss segment limit */
|
/* tss segment limit */
|
||||||
.set TSS_LIMIT, 0x68
|
.set TSS_LIMIT, 0x68
|
||||||
|
|
||||||
|
/* mtc virt addresses */
|
||||||
|
.set MT_BUFFER, _mt_buffer - _mt_begin
|
||||||
.macro _isr_entry
|
.macro _isr_entry
|
||||||
.align 4, 0x90
|
.align 4, 0x90
|
||||||
.endm
|
.endm
|
||||||
|
@ -126,7 +128,7 @@
|
||||||
_mt_kernel_entry_pic:
|
_mt_kernel_entry_pic:
|
||||||
|
|
||||||
/* Copy client context RAX to buffer */
|
/* Copy client context RAX to buffer */
|
||||||
mov %rax, _mt_buffer
|
mov %rax, MT_BUFFER
|
||||||
|
|
||||||
/* Switch to kernel page tables */
|
/* Switch to kernel page tables */
|
||||||
mov _mt_master_context_begin+CR3_OFFSET, %rax
|
mov _mt_master_context_begin+CR3_OFFSET, %rax
|
||||||
|
@ -235,7 +237,7 @@
|
||||||
mov %rax, %cr3
|
mov %rax, %cr3
|
||||||
|
|
||||||
/* Set stack back to mt buffer and restore client RAX */
|
/* Set stack back to mt buffer and restore client RAX */
|
||||||
mov $_mt_buffer, %rsp
|
mov $MT_BUFFER, %rsp
|
||||||
popq %rax
|
popq %rax
|
||||||
|
|
||||||
iretq
|
iretq
|
||||||
|
|
Loading…
Reference in New Issue