xref: /freebsd/stand/kboot/libkboot/arch/powerpc64/start_arch.h (revision a03411e84728e9b267056fd31c7d1d9d1dc1b01e)
1 /*
2  * Copyright (c) 2022 Netflix, Inc
3  *
4  * SPDX-License-Identifier: BSD-2-Clause
5  */
6 
7 /*
8  * Due to the PowerPC ABI, We can call main directly from here, so do so.
9  *
10  * Note: there may be some static initializers that aren't called, but we don't
11  * worry about that elsewhere. This is a stripped down environment.
12  *
13  * I think we could also do something like
14  *
15  * mflr		r0
16  * stw		r0,4(r1)
17  * stwu		r1,-16(r1)
18  * b		_start_c
19  *
20  * But my powerpc assembler fu is quite lacking...
21  */
22 
23 #define __unused __attribute__((__unused__))
24 
25 void
_start(int argc,const char ** argv,char ** env,void * obj __unused,void (* cleanup)(void)__unused)26 _start(int argc, const char **argv, char **env, void *obj __unused,
27     void (*cleanup)(void) __unused)
28 {
29 	main(argc, argv, env);
30 }
31