xref: /netbsd-src/external/cddl/osnet/sys/kern/opensolaris.c (revision b51f985d73ff6f97b5d62ffeda3a82ca3691c511)
1*b51f985dSriastradh /*	$NetBSD: opensolaris.c,v 1.5 2024/06/29 13:03:02 riastradh Exp $	*/
2328338d6Sdarran /*-
3328338d6Sdarran  * Copyright 2007 John Birrell <jb@FreeBSD.org>
4328338d6Sdarran  *
5328338d6Sdarran  * Redistribution and use in source and binary forms, with or without
6328338d6Sdarran  * modification, are permitted provided that the following conditions
7328338d6Sdarran  * are met:
8328338d6Sdarran  * 1. Redistributions of source code must retain the above copyright
9328338d6Sdarran  *    notice, this list of conditions and the following disclaimer.
10328338d6Sdarran  * 2. Redistributions in binary form must reproduce the above copyright
11328338d6Sdarran  *    notice, this list of conditions and the following disclaimer in the
12328338d6Sdarran  *    documentation and/or other materials provided with the distribution.
13328338d6Sdarran  *
14328338d6Sdarran  * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15328338d6Sdarran  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16328338d6Sdarran  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17328338d6Sdarran  * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
18328338d6Sdarran  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19328338d6Sdarran  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20328338d6Sdarran  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21328338d6Sdarran  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22328338d6Sdarran  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23328338d6Sdarran  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24328338d6Sdarran  * SUCH DAMAGE.
25328338d6Sdarran  *
26ba2539a9Schs  * $FreeBSD: head/sys/cddl/compat/opensolaris/kern/opensolaris.c 222670 2011-06-04 07:02:06Z avg $
27328338d6Sdarran  *
28328338d6Sdarran  */
29328338d6Sdarran 
30328338d6Sdarran #include <sys/cdefs.h>
317f8c58afSskrll #include <sys/param.h>
32328338d6Sdarran #include <sys/types.h>
337f8c58afSskrll 
34328338d6Sdarran #include <sys/conf.h>
35328338d6Sdarran #include <sys/cpuvar.h>
36328338d6Sdarran #include <sys/errno.h>
37328338d6Sdarran #include <sys/kernel.h>
38328338d6Sdarran #include <sys/misc.h>
39328338d6Sdarran #include <sys/module.h>
40328338d6Sdarran #include <sys/mutex.h>
41dead83d6Sriastradh #include <sys/sdt.h>
42328338d6Sdarran 
43328338d6Sdarran cpu_core_t	cpu_core[MAXCPUS];
44328338d6Sdarran solaris_cpu_t	solaris_cpu[MAXCPUS];
45328338d6Sdarran 
46328338d6Sdarran /*
47328338d6Sdarran  *  OpenSolaris subsystem initialisation.
48328338d6Sdarran  */
49328338d6Sdarran void
opensolaris_init(void * dummy)50328338d6Sdarran opensolaris_init(void *dummy)
51328338d6Sdarran {
52328338d6Sdarran 	int i;
53328338d6Sdarran 
54328338d6Sdarran 	/*
55328338d6Sdarran 	 * "Enable" all CPUs even though they may not exist just so
56328338d6Sdarran 	 * that the asserts work. On FreeBSD, if a CPU exists, it is
57328338d6Sdarran 	 * enabled.
58328338d6Sdarran 	 */
59328338d6Sdarran 	for (i = 0; i < MAXCPUS; i++) {
60328338d6Sdarran 		solaris_cpu[i].cpuid = i;
61328338d6Sdarran 		solaris_cpu[i].cpu_flags &= CPU_ENABLE;
62328338d6Sdarran 	}
63328338d6Sdarran 
64328338d6Sdarran }
65328338d6Sdarran 
66328338d6Sdarran void
opensolaris_fini(void * dummy)67328338d6Sdarran opensolaris_fini(void *dummy)
68328338d6Sdarran {
69328338d6Sdarran }
70