xref: /titanic_52/usr/src/uts/intel/amd64/krtld/kobj_boot.c (revision 4bff34e37def8a90f9194d81bc345c52ba20086a)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #pragma ident	"%Z%%M%	%I%	%E% SMI"
27 
28 /*
29  * Bootstrap the linker/loader.
30  */
31 
32 #include <sys/types.h>
33 #include <sys/bootconf.h>
34 #include <sys/link.h>
35 #include <sys/auxv.h>
36 #include <sys/kobj.h>
37 #include <sys/bootsvcs.h>
38 #include <vm/kboot_mmu.h>
39 #include <sys/kobj_impl.h>
40 
41 /*
42  * the kernel's entry point (from locore.s)
43  */
44 extern void _locore_start();
45 
46 /*
47  * fakebop and dboot don't create the boot auxillary vector information.
48  * Do that here before calling krtld initialization.
49  */
50 /*ARGSUSED3*/
51 void
52 _kobj_boot(
53 	struct boot_syscalls *syscallp,
54 	void *dvec,
55 	struct bootops *bootops,
56 	Boot *ebp)
57 {
58 	val_t bootaux[BA_NUM];
59 	int i;
60 
61 	for (i = 0; i < BA_NUM; i++)
62 		bootaux[i].ba_val = NULL;
63 
64 	bootaux[BA_ENTRY].ba_ptr = (void *)_locore_start;
65 	bootaux[BA_PAGESZ].ba_val = PAGESIZE;
66 	bootaux[BA_LPAGESZ].ba_val = kbm_nucleus_size;
67 
68 	/*
69 	 * Off to krtld initialization.
70 	 */
71 	kobj_init(syscallp, dvec, bootops, bootaux);
72 }
73