From 080d7d5f8bad3be455cf04e399ff837bd8d01ff5 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 27 Feb 2015 13:25:19 +0100 Subject: [PATCH] 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. --- repos/base-hw/src/core/spec/x86_64/mode_transition.s | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/repos/base-hw/src/core/spec/x86_64/mode_transition.s b/repos/base-hw/src/core/spec/x86_64/mode_transition.s index db3634296..aeb89e4d7 100644 --- a/repos/base-hw/src/core/spec/x86_64/mode_transition.s +++ b/repos/base-hw/src/core/spec/x86_64/mode_transition.s @@ -32,6 +32,8 @@ /* tss segment limit */ .set TSS_LIMIT, 0x68 +/* mtc virt addresses */ +.set MT_BUFFER, _mt_buffer - _mt_begin .macro _isr_entry .align 4, 0x90 .endm @@ -126,7 +128,7 @@ _mt_kernel_entry_pic: /* Copy client context RAX to buffer */ - mov %rax, _mt_buffer + mov %rax, MT_BUFFER /* Switch to kernel page tables */ mov _mt_master_context_begin+CR3_OFFSET, %rax @@ -235,7 +237,7 @@ mov %rax, %cr3 /* Set stack back to mt buffer and restore client RAX */ - mov $_mt_buffer, %rsp + mov $MT_BUFFER, %rsp popq %rax iretq