xref: /onnv-gate/usr/src/uts/intel/amd64/krtld/kobj_boot.c (revision 5648:161f8007cab9)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5580Swesolows  * Common Development and Distribution License (the "License").
6580Swesolows  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
223446Smrj  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
270Sstevel@tonic-gate 
280Sstevel@tonic-gate /*
290Sstevel@tonic-gate  * Bootstrap the linker/loader.
300Sstevel@tonic-gate  */
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #include <sys/types.h>
330Sstevel@tonic-gate #include <sys/bootconf.h>
340Sstevel@tonic-gate #include <sys/link.h>
350Sstevel@tonic-gate #include <sys/auxv.h>
360Sstevel@tonic-gate #include <sys/kobj.h>
370Sstevel@tonic-gate #include <sys/bootsvcs.h>
38*5648Ssetje #include <vm/kboot_mmu.h>
390Sstevel@tonic-gate #include <sys/kobj_impl.h>
400Sstevel@tonic-gate 
410Sstevel@tonic-gate /*
423446Smrj  * the kernel's entry point (from locore.s)
430Sstevel@tonic-gate  */
443446Smrj extern void _locore_start();
450Sstevel@tonic-gate 
460Sstevel@tonic-gate /*
473446Smrj  * fakebop and dboot don't create the boot auxillary vector information.
483446Smrj  * Do that here before calling krtld initialization.
490Sstevel@tonic-gate  */
503446Smrj /*ARGSUSED3*/
510Sstevel@tonic-gate void
_kobj_boot(struct boot_syscalls * syscallp,void * dvec,struct bootops * bootops,Boot * ebp)520Sstevel@tonic-gate _kobj_boot(
530Sstevel@tonic-gate 	struct boot_syscalls *syscallp,
540Sstevel@tonic-gate 	void *dvec,
550Sstevel@tonic-gate 	struct bootops *bootops,
560Sstevel@tonic-gate 	Boot *ebp)
570Sstevel@tonic-gate {
580Sstevel@tonic-gate 	val_t bootaux[BA_NUM];
590Sstevel@tonic-gate 	int i;
600Sstevel@tonic-gate 
610Sstevel@tonic-gate 	for (i = 0; i < BA_NUM; i++)
620Sstevel@tonic-gate 		bootaux[i].ba_val = NULL;
630Sstevel@tonic-gate 
643446Smrj 	bootaux[BA_ENTRY].ba_ptr = (void *)_locore_start;
653446Smrj 	bootaux[BA_PAGESZ].ba_val = PAGESIZE;
663446Smrj 	bootaux[BA_LPAGESZ].ba_val = kbm_nucleus_size;
670Sstevel@tonic-gate 
680Sstevel@tonic-gate 	/*
693446Smrj 	 * Off to krtld initialization.
700Sstevel@tonic-gate 	 */
710Sstevel@tonic-gate 	kobj_init(syscallp, dvec, bootops, bootaux);
720Sstevel@tonic-gate }
73