[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tyndur-devel] [PATCH 09/11] arch: Unterscheidung zwischen amd64 und i386 eingeschmolzen
Signed-off-by: Andreas Freimuth <m.nemo@xxxxxxx>
--HG--
extra : rebase_source : ae72fc50e657602bae71020e22551bf8f2e82984
---
src/kernel2/src/init.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/kernel2/src/init.c b/src/kernel2/src/init.c
index 37c6397..99ec00b 100644
--- a/src/kernel2/src/init.c
+++ b/src/kernel2/src/init.c
@@ -156,18 +156,17 @@ void init(int multiboot_magic, struct multiboot_info *boot_info, bool bsp)
// TODO: Was tun, wenn dieses identity-Mapping schief geht?
// Dies ist naehmlich sher warscheinlich.
+ uintptr_t sp;
#if CONFIG_ARCH == ARCH_AMD64
- uint64_t rsp;
- asm volatile("movq %%rsp, %0" : "=r"(rsp));
- mmc_map(init_context, (vaddr_t) PAGE_ALIGN_ROUND_DOWN(rsp),
- (paddr_t) PAGE_ALIGN_ROUND_DOWN(rsp), MM_FLAGS_KERNEL_DATA, 1);
- im_enable();
+ asm volatile("movq %%rsp, %0" : "=r"(sp));
#else
- uint32_t esp;
- asm volatile("movl %%esp, %0" : "=r"(esp));
- mmc_map(init_context, (vaddr_t) PAGE_ALIGN_ROUND_DOWN(esp),
- (paddr_t) PAGE_ALIGN_ROUND_DOWN(esp), MM_FLAGS_KERNEL_DATA, 1);
+ asm volatile("movl %%esp, %0" : "=r"(sp));
#endif
+ mmc_map(init_context, (vaddr_t) PAGE_ALIGN_ROUND_DOWN(sp),
+ (paddr_t) PAGE_ALIGN_ROUND_DOWN(sp), MM_FLAGS_KERNEL_DATA, 1);
+
+ // amd64 only?
+ //im_enable();
}
--
1.7.3.4