From 0cbad7f3a3bfba365697de0e7bdbb07d148c0c95 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Tue, 2 Feb 2021 15:54:31 -0600 Subject: [PATCH] boot/platform/efi: Fill out riscv64 kernel entry assembly Change-Id: I18867f2c1188b43d5c663a7ceb3aab4a4dedb454 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3731 Reviewed-by: Alex von Gluck IV Reviewed-by: Fredrik Holmqvist --- .../boot/platform/efi/arch/riscv64/entry.S | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/system/boot/platform/efi/arch/riscv64/entry.S b/src/system/boot/platform/efi/arch/riscv64/entry.S index 3399ae9931..7ae5221a49 100644 --- a/src/system/boot/platform/efi/arch/riscv64/entry.S +++ b/src/system/boot/platform/efi/arch/riscv64/entry.S @@ -1,35 +1,32 @@ /* - * Copyright 2011, François Revol . - * All rights reserved. Distributed under the terms of the MIT License. + * Copyright 2020-2021, Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT License. */ #include - .text /* status_t arch_enter_kernel(struct kernel_args *kernelArgs, addr_t kernelEntry, addr_t kernelStackTop); - r0 - kernelArgs - r1 - kernelEntry - r2 - kernelStackTop + a0 - kernelArgs + a1 - kernelEntry + a2 - kernelStackTop */ FUNCTION(arch_enter_kernel): - nop + // set the kernel stack + mv sp,a2 -// // set the kernel stack -// mov sp,r2 -// -// // set up kernel _start args -// //mov r0,r0 // kernelArgs -// mov r4,r1 -// mov r1,#0 // currentCPU=0 -// -// // call the kernel -// mov pc,r4 -// -// // return -// mov r0,#-1 // B_ERROR -// mov pc,lr + // Setup kernel args + //mv a0,a0 // kernelArgs + mv a4,a1 + li a1,0 // currentCPU=0 + + // call the kernel + jr a4 + + // return + li a0,-1 // B_ERROR + ret FUNCTION_END(arch_enter_kernel)