Fix NULL pointer constant issues in kernel/arch/x86
[unleashed.git] / kernel / arch / x86 / krtld / 32 / kobj_boot.c
blob206c3b28908d051acc85222173d99622f36df5bb
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
27 * Bootstrap the linker/loader.
30 #include <sys/types.h>
31 #include <sys/bootconf.h>
32 #include <sys/link.h>
33 #include <sys/auxv.h>
34 #include <sys/kobj.h>
35 #include <sys/bootsvcs.h>
36 #include <vm/kboot_mmu.h>
37 #include <sys/kobj_impl.h>
40 * the kernel's entry point (from locore.s)
42 extern void _locore_start();
45 * fakebop transfers control here.
47 * fakebop and dboot don't construct any boot vector or aux vector information.
48 * We figure all this out for ourself instead.
50 /*ARGSUSED3*/
51 void
52 _kobj_boot(
53 struct boot_syscalls *syscallp,
54 void *dvec,
55 struct bootops *bootops,
56 Boot *ebp)
58 val_t bootaux[BA_NUM];
59 int i;
61 for (i = 0; i < BA_NUM; i++)
62 bootaux[i].ba_val = (uintptr_t)NULL;
64 bootaux[BA_ENTRY].ba_ptr = (void *)_locore_start;
65 bootaux[BA_PAGESZ].ba_val = MMU_PAGESIZE;
66 bootaux[BA_LPAGESZ].ba_val = kbm_nucleus_size;
69 * Initialize krtld.
71 kobj_init(syscallp, dvec, bootops, bootaux);