1/*
2 * Copyright 2020-2021, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5
6#include <asm_defs.h>
7
8
9	.text
10
11/*	status_t arch_enter_kernel(struct kernel_args *kernelArgs,
12		addr_t kernelEntry, addr_t kernelStackTop);
13
14	x0	- kernelArgs
15	x1	- kernelEntry
16	x2	- kernelStackTop
17*/
18FUNCTION(arch_enter_kernel):
19
20	// set the kernel stack
21	mov		sp,x2
22
23	// set up kernel _start args
24	//mov	x0,x0	// kernelArgs
25	mov		x4,x1
26	mov		x1,#0	// currentCPU=0
27
28	// call the kernel
29	br		x4
30
31	// return
32	mov		x0,#-1	// B_ERROR
33	ret
34
35FUNCTION_END(arch_enter_kernel)
36
37