xref: /haiku/src/system/boot/platform/openfirmware/arch/sparc/start.cpp (revision 02354704729d38c3b078c696adc1bbbd33cbcf72)
1 /*
2  * Copyright 2003-2010, Axel Dörfler, axeld@pinc-software.de.
3  * Copyright 2011, Alexander von Gluck, kallisti5@unixzen.com
4  * Copyright 2019, Adrien Destugues, pulkomandy@pulkomandy.tk
5  * Distributed under the terms of the MIT License.
6  */
7 
8 
9 #include "start.h"
10 
11 #include "machine.h"
12 
13 
14 void
15 determine_machine(void)
16 {
17 	gMachine = MACHINE_UNKNOWN;
18 }
19 
20 
21 extern "C" void __attribute__((section(".text.start")))
22 _start(int _reserved, int _argstr, int _arglen, int _unknown,
23 	void *openFirmwareEntry)
24 {
25 	// According to the sparc bindings, OpenFirmware should have created
26 	// a stack of 8kB or higher for us at this point, and window traps are
27 	// operational so it's possible to call the openFirmwareEntry safely.
28 	// The bss segment is already cleared by the firmware as well.
29 
30 	call_ctors();
31 		// call C++ constructors before doing anything else
32 
33 	start(openFirmwareEntry);
34 }
35 
36