2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
14 * Copyright 2017 RackTop Systems.
17 #include <sys/types.h>
19 #include <sys/thread.h>
30 #include <fakekernel.h>
32 pri_t minclsyspri
= 60;
34 /* Some kernel code takes the address of this. */
44 .zone_name
= "global",
57 return ((pid_t
)getpid());
61 * Find highest one bit set.
62 * Returns bit number + 1 of highest bit that is set, otherwise returns 0.
71 if (i
& 0xffffffff00000000ULL
) {
93 ddi_strtoul(const char *str
, char **endp
, int base
, unsigned long *res
)
95 *res
= strtoul(str
, endp
, base
);
102 ddi_strtoull(const char *str
, char **nptr
, int base
, u_longlong_t
*res
)
106 *res
= strtoull(str
, &end
, base
);
115 int msec
= ticks
; /* NB: hz==1000 */
116 (void) poll(0, 0, msec
);
126 * This library does not really need an "init" function, but
127 * providing one the main program can call is an easy way to
128 * make sure this library is loaded into the debugger, and
129 * gives us a way to avoid elfcheck complaints in the build.
132 fakekernel_init(void)