11541Srgrimes/*-
210358Sjulian * Copyright (c) 1995 Terrence R. Lambert
310358Sjulian * All rights reserved.
410358Sjulian *
51541Srgrimes * Copyright (c) 1990, 1993
61541Srgrimes *	The Regents of the University of California.  All rights reserved.
71541Srgrimes * (c) UNIX System Laboratories, Inc.
81541Srgrimes * All or some portions of this file are derived from material licensed
91541Srgrimes * to the University of California by American Telephone and Telegraph
101541Srgrimes * Co. or Unix System Laboratories, Inc. and are reproduced herein with
111541Srgrimes * the permission of UNIX System Laboratories, Inc.
121541Srgrimes *
131541Srgrimes * Redistribution and use in source and binary forms, with or without
141541Srgrimes * modification, are permitted provided that the following conditions
151541Srgrimes * are met:
161541Srgrimes * 1. Redistributions of source code must retain the above copyright
171541Srgrimes *    notice, this list of conditions and the following disclaimer.
181541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
191541Srgrimes *    notice, this list of conditions and the following disclaimer in the
201541Srgrimes *    documentation and/or other materials provided with the distribution.
211541Srgrimes * 3. All advertising materials mentioning features or use of this software
221541Srgrimes *    must display the following acknowledgement:
231541Srgrimes *	This product includes software developed by the University of
241541Srgrimes *	California, Berkeley and its contributors.
251541Srgrimes * 4. Neither the name of the University nor the names of its contributors
261541Srgrimes *    may be used to endorse or promote products derived from this software
271541Srgrimes *    without specific prior written permission.
281541Srgrimes *
291541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
301541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
311541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
321541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
331541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
341541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
351541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
361541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
371541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
381541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
391541Srgrimes * SUCH DAMAGE.
401541Srgrimes *
411541Srgrimes *	@(#)kernel.h	8.3 (Berkeley) 1/21/94
4250477Speter * $FreeBSD: stable/10/sys/sys/kernel.h 358937 2020-03-13 08:53:59Z hselasky $
431541Srgrimes */
441541Srgrimes
452165Spaul#ifndef _SYS_KERNEL_H_
4677843Speter#define	_SYS_KERNEL_H_
472165Spaul
4842645Sjdp#include <sys/linker_set.h>
4942645Sjdp
5055205Speter#ifdef _KERNEL
5125164Speter
5251957Sn_hibma/* for intrhook below */
5351957Sn_hibma#include <sys/queue.h>
5451957Sn_hibma
551541Srgrimes/* Global variables for the kernel. */
561541Srgrimes
571541Srgrimes/* 1.1 */
58219523Smdfextern char kernelname[MAXPATHLEN];
591541Srgrimes
601541Srgrimesextern int tick;			/* usec per tick (1000000 / hz) */
611541Srgrimesextern int hz;				/* system clock's frequency */
6216635Sbdeextern int psratio;			/* ratio: prof / stat */
631541Srgrimesextern int stathz;			/* statistics clock's frequency */
641541Srgrimesextern int profhz;			/* profiling clock's frequency */
65110296Sjakeextern int profprocs;			/* number of process's profiling */
66246037Sjhbextern volatile int ticks;
671549Srgrimes
6855205Speter#endif /* _KERNEL */
6931234Sbde
701549Srgrimes/*
7110358Sjulian * Enumerated types for known system startup interfaces.
7210358Sjulian *
7310358Sjulian * Startup occurs in ascending numeric order; the list entries are
7410358Sjulian * sorted prior to attempting startup to guarantee order.  Items
7510358Sjulian * of the same level are arbitrated for order based on the 'order'
7610358Sjulian * element.
7710358Sjulian *
7810358Sjulian * These numbers are arbitrary and are chosen ONLY for ordering; the
7913765Smpp * enumeration values are explicit rather than implicit to provide
8013765Smpp * for binary compatibility with inserted elements.
8110358Sjulian *
82253604Savg * The SI_SUB_LAST value must have the highest lexical value.
8310358Sjulian *
84158938Sphk * The SI_SUB_SWAP values represent a value used by
85158940Sphk * the BSD 4.4Lite but not by FreeBSD; it is maintained in dependent
8610358Sjulian * order to support porting.
8710358Sjulian */
8810358Sjulianenum sysinit_sub_id {
8935893Sbde	SI_SUB_DUMMY		= 0x0000000,	/* not executed; for linker*/
9040136Speter	SI_SUB_DONE		= 0x0000001,	/* processed*/
9166212Sjhb	SI_SUB_TUNABLES		= 0x0700000,	/* establish tunable values */
9235893Sbde	SI_SUB_COPYRIGHT	= 0x0800001,	/* first use of console*/
93134443Srwatson	SI_SUB_SETTINGS		= 0x0880000,	/* check and recheck settings */
94117494Struckman	SI_SUB_MTX_POOL_STATIC	= 0x0900000,	/* static mutex pool */
95117660Struckman	SI_SUB_LOCKMGR		= 0x0980000,	/* lockmgr locks */
9635893Sbde	SI_SUB_VM		= 0x1000000,	/* virtual memory system init*/
9735893Sbde	SI_SUB_KMEM		= 0x1800000,	/* kernel memory*/
9857263Sdillon	SI_SUB_KVM_RSRC		= 0x1A00000,	/* kvm operational limits*/
99255040Sgibbs	SI_SUB_HYPERVISOR	= 0x1A40000,	/*
100255040Sgibbs						 * Hypervisor detection and
101255040Sgibbs						 * virtualization support
102255040Sgibbs						 * setup.
103255040Sgibbs						 */
10474912Sjhb	SI_SUB_WITNESS		= 0x1A80000,	/* witness initialization */
105117494Struckman	SI_SUB_MTX_POOL_DYNAMIC	= 0x1AC0000,	/* dynamic mutex pool */
106117660Struckman	SI_SUB_LOCK		= 0x1B00000,	/* various locks */
10769893Sjhb	SI_SUB_EVENTHANDLER	= 0x1C00000,	/* eventhandler init */
108195760Srwatson	SI_SUB_VNET_PRELINK	= 0x1E00000,	/* vnet init before modules */
10985835Siwasaki	SI_SUB_KLD		= 0x2000000,	/* KLD and module setup */
11085835Siwasaki	SI_SUB_CPU		= 0x2100000,	/* CPU resource(s)*/
111220137Strasz	SI_SUB_RACCT		= 0x2110000,	/* resource accounting */
112198295Sru	SI_SUB_RANDOM		= 0x2120000,	/* random number generator */
113179095Sjb	SI_SUB_KDTRACE		= 0x2140000,	/* Kernel dtrace hooks */
11491701Srwatson	SI_SUB_MAC		= 0x2180000,	/* TrustedBSD MAC subsystem */
11591701Srwatson	SI_SUB_MAC_POLICY	= 0x21C0000,	/* TrustedBSD MAC policies */
11696590Srwatson	SI_SUB_MAC_LATE		= 0x21D0000,	/* TrustedBSD MAC subsystem */
117195760Srwatson	SI_SUB_VNET		= 0x21E0000,	/* vnet 0 */
11846556Speter	SI_SUB_INTRINSIC	= 0x2200000,	/* proc 0*/
11964548Speter	SI_SUB_VM_CONF		= 0x2300000,	/* config VM, set limits*/
120174900Srwatson	SI_SUB_DDB_SERVICES	= 0x2380000,	/* capture, scripting, etc. */
12164548Speter	SI_SUB_RUN_QUEUE	= 0x2400000,	/* set up run queue*/
12297987Sjhb	SI_SUB_KTRACE		= 0x2480000,	/* ktrace */
123179095Sjb	SI_SUB_OPENSOLARIS	= 0x2490000,	/* OpenSolaris compatibility */
124179095Sjb	SI_SUB_CYCLIC		= 0x24A0000,	/* Cyclic timers */
125141146Srwatson	SI_SUB_AUDIT		= 0x24C0000,	/* audit */
12664548Speter	SI_SUB_CREATE_INIT	= 0x2500000,	/* create init process*/
12765557Sjasone	SI_SUB_SCHED_IDLE	= 0x2600000,	/* required idle procs */
12866475Sbmilekic	SI_SUB_MBUF		= 0x2700000,	/* mbuf subsystem */
12972236Sjhb	SI_SUB_INTR		= 0x2800000,	/* interrupt threads */
130337042Shselasky	SI_SUB_TASKQ		= 0x2880000,	/* task queues */
131149811Scsjp	SI_SUB_ACL		= 0x2900000,	/* start for filesystem ACLs */
132337042Shselasky	SI_SUB_SOFTINTR		= 0x2A00000,	/* start soft interrupt thread */
13389118Smsmith	SI_SUB_DEVFS		= 0x2F00000,	/* devfs ready for devices */
13483130Sjlemon	SI_SUB_INIT_IF		= 0x3000000,	/* prep for net interfaces */
135139774Semax	SI_SUB_NETGRAPH		= 0x3010000,	/* Let Netgraph initialize */
136179095Sjb	SI_SUB_DTRACE		= 0x3020000,	/* DTrace subsystem */
137179095Sjb	SI_SUB_DTRACE_PROVIDER	= 0x3048000,	/* DTrace providers */
138179095Sjb	SI_SUB_DTRACE_ANON	= 0x308C000,	/* DTrace anon enabling */
13964548Speter	SI_SUB_DRIVERS		= 0x3100000,	/* Let Drivers initialize */
14064548Speter	SI_SUB_CONFIGURE	= 0x3800000,	/* Configure devices */
14196755Strhodes	SI_SUB_VFS		= 0x4000000,	/* virtual filesystem*/
14267402Sjhb	SI_SUB_CLOCKS		= 0x4800000,	/* real time and stat clocks*/
14335893Sbde	SI_SUB_CLIST		= 0x5800000,	/* clists*/
14435893Sbde	SI_SUB_SYSV_SHM		= 0x6400000,	/* System V shared memory*/
14535893Sbde	SI_SUB_SYSV_SEM		= 0x6800000,	/* System V semaphores*/
14635893Sbde	SI_SUB_SYSV_MSG		= 0x6C00000,	/* System V message queues*/
14735893Sbde	SI_SUB_P1003_1B		= 0x6E00000,	/* P1003.1B realtime */
14835893Sbde	SI_SUB_PSEUDO		= 0x7000000,	/* pseudo devices*/
14940435Speter	SI_SUB_EXEC		= 0x7400000,	/* execve() handlers */
150241724Sandre	SI_SUB_PROTO_BEGIN	= 0x8000000,	/* VNET initialization */
15135893Sbde	SI_SUB_PROTO_IF		= 0x8400000,	/* interfaces*/
152195837Srwatson	SI_SUB_PROTO_DOMAININIT	= 0x8600000,	/* domain registration system */
15335893Sbde	SI_SUB_PROTO_DOMAIN	= 0x8800000,	/* domains (address families?)*/
154121161Sume	SI_SUB_PROTO_IFATTACHDOMAIN	= 0x8800001,	/* domain dependent data init*/
155241724Sandre	SI_SUB_PROTO_END	= 0x8ffffff,	/* VNET helper functions */
15635893Sbde	SI_SUB_KPROF		= 0x9000000,	/* kernel profiling*/
15735893Sbde	SI_SUB_KICK_SCHEDULER	= 0xa000000,	/* start the timeout events*/
15835893Sbde	SI_SUB_INT_CONFIG_HOOKS	= 0xa800000,	/* Interrupts enabled config */
15935893Sbde	SI_SUB_ROOT_CONF	= 0xb000000,	/* Find root devices */
16035893Sbde	SI_SUB_DUMP_CONF	= 0xb200000,	/* Find dump devices */
161138440Spjd	SI_SUB_RAID		= 0xb380000,	/* Configure GEOM classes */
162115767Sgrog	SI_SUB_SWAP		= 0xc000000,	/* swap */
16335893Sbde	SI_SUB_INTRINSIC_POST	= 0xd000000,	/* proc 0 cleanup*/
164160882Sjhb	SI_SUB_SYSCALLS		= 0xd800000,	/* register system calls */
165195760Srwatson	SI_SUB_VNET_DONE	= 0xdc00000,	/* vnet registration complete */
16635893Sbde	SI_SUB_KTHREAD_INIT	= 0xe000000,	/* init process*/
16735893Sbde	SI_SUB_KTHREAD_PAGE	= 0xe400000,	/* pageout daemon*/
16835893Sbde	SI_SUB_KTHREAD_VM	= 0xe800000,	/* vm daemon*/
16948544Smckusick	SI_SUB_KTHREAD_BUF	= 0xea00000,	/* buffer daemon*/
17035893Sbde	SI_SUB_KTHREAD_UPDATE	= 0xec00000,	/* update daemon*/
17135893Sbde	SI_SUB_KTHREAD_IDLE	= 0xee00000,	/* idle procs*/
17265557Sjasone	SI_SUB_SMP		= 0xf000000,	/* start the APs*/
173220137Strasz	SI_SUB_RACCTD		= 0xf100000,	/* start raccd*/
174253604Savg	SI_SUB_LAST		= 0xfffffff	/* final initialization */
17510358Sjulian};
17610358Sjulian
17710358Sjulian
17810358Sjulian/*
17910358Sjulian * Some enumerated orders; "ANY" sorts last.
18010358Sjulian */
18110358Sjulianenum sysinit_elem_order {
18235893Sbde	SI_ORDER_FIRST		= 0x0000000,	/* first*/
18335893Sbde	SI_ORDER_SECOND		= 0x0000001,	/* second*/
18435893Sbde	SI_ORDER_THIRD		= 0x0000002,	/* third*/
185195837Srwatson	SI_ORDER_FOURTH		= 0x0000003,	/* fourth*/
186358937Shselasky	SI_ORDER_FIFTH		= 0x0000004,	/* fifth*/
187358937Shselasky	SI_ORDER_SIXTH		= 0x0000005,	/* sixth*/
188358937Shselasky	SI_ORDER_SEVENTH	= 0x0000006,	/* seventh*/
189358937Shselasky	SI_ORDER_EIGHTH		= 0x0000007,	/* eighth*/
19035893Sbde	SI_ORDER_MIDDLE		= 0x1000000,	/* somewhere in the middle */
19135893Sbde	SI_ORDER_ANY		= 0xfffffff	/* last*/
19210358Sjulian};
19310358Sjulian
19410358Sjulian
19510358Sjulian/*
19610358Sjulian * A system initialization call instance
19710358Sjulian *
19843350Sdillon * At the moment there is one instance of sysinit.  We probably do not
19943350Sdillon * want two which is why this code is if'd out, but we definitely want
20043350Sdillon * to discern SYSINIT's which take non-constant data pointers and
20143350Sdillon * SYSINIT's which take constant data pointers,
20243385Sdillon *
203137098Sdes * The C_* macros take functions expecting const void * arguments
20443385Sdillon * while the non-C_* macros take functions expecting just void * arguments.
20543385Sdillon *
20643385Sdillon * With -Wcast-qual on, the compiler issues warnings:
20743385Sdillon *	- if we pass non-const data or functions taking non-const data
20843385Sdillon *	  to a C_* macro.
20943385Sdillon *
21043385Sdillon *	- if we pass const data to the normal macros
21143385Sdillon *
21243385Sdillon * However, no warning is issued if we pass a function taking const data
21343385Sdillon * through a normal non-const macro.  This is ok because the function is
21443385Sdillon * saying it won't modify the data so we don't care whether the data is
21543385Sdillon * modifiable or not.
21610358Sjulian */
21710358Sjulian
21892719Salfredtypedef void (*sysinit_nfunc_t)(void *);
21992719Salfredtypedef void (*sysinit_cfunc_t)(const void *);
22010358Sjulian
22143385Sdillonstruct sysinit {
22277052Sphk	enum sysinit_sub_id	subsystem;	/* subsystem identifier*/
22377052Sphk	enum sysinit_elem_order	order;		/* init order within subsystem*/
22443385Sdillon	sysinit_cfunc_t func;			/* function		*/
22543350Sdillon	const void	*udata;			/* multiplexer/argument */
22643350Sdillon};
22743350Sdillon
22810358Sjulian/*
22910358Sjulian * Default: no special processing
23043350Sdillon *
23143350Sdillon * The C_ version of SYSINIT is for data pointers to const
23243350Sdillon * data ( and functions taking data pointers to const data ).
23343350Sdillon * At the moment it is no different from SYSINIT and thus
23443350Sdillon * still results in warnings.
23543350Sdillon *
23643385Sdillon * The casts are necessary to have the compiler produce the
23743385Sdillon * correct warnings when -Wcast-qual is used.
23843385Sdillon *
23910358Sjulian */
24043385Sdillon#define	C_SYSINIT(uniquifier, subsystem, order, func, ident)	\
24141960Sbde	static struct sysinit uniquifier ## _sys_init = {	\
24210358Sjulian		subsystem,					\
24310358Sjulian		order,						\
24410358Sjulian		func,						\
24595194Smarkm		(ident)						\
24610358Sjulian	};							\
247177254Srwatson	DATA_SET(sysinit_set,uniquifier ## _sys_init)
24843350Sdillon
24943385Sdillon#define	SYSINIT(uniquifier, subsystem, order, func, ident)	\
25048391Speter	C_SYSINIT(uniquifier, subsystem, order,			\
25195194Smarkm	(sysinit_cfunc_t)(sysinit_nfunc_t)func, (void *)(ident))
25243350Sdillon
25341053Speter/*
25441053Speter * Called on module unload: no special processing
25541053Speter */
25643385Sdillon#define	C_SYSUNINIT(uniquifier, subsystem, order, func, ident)	\
25741960Sbde	static struct sysinit uniquifier ## _sys_uninit = {	\
25841053Speter		subsystem,					\
25941053Speter		order,						\
26048391Speter		func,						\
26195194Smarkm		(ident)						\
26241053Speter	};							\
26341171Sbde	DATA_SET(sysuninit_set,uniquifier ## _sys_uninit)
26410358Sjulian
26543385Sdillon#define	SYSUNINIT(uniquifier, subsystem, order, func, ident)	\
26648391Speter	C_SYSUNINIT(uniquifier, subsystem, order,		\
26795194Smarkm	(sysinit_cfunc_t)(sysinit_nfunc_t)func, (void *)(ident))
26843350Sdillon
26992719Salfredvoid	sysinit_add(struct sysinit **set, struct sysinit **set_end);
27010358Sjulian
27110358Sjulian/*
27248577Smsmith * Infrastructure for tunable 'constants'.  Value may be specified at compile
27348577Smsmith * time or kernel load time.  Rules relating tunables together can be placed
274236968Sjhb * in a SYSINIT function at SI_SUB_TUNABLES with SI_ORDER_ANY.
275125795Snjl *
276125795Snjl * WARNING: developers should never use the reserved suffixes specified in
277125795Snjl * loader.conf(5) for any tunables or conflicts will result.
27848577Smsmith */
27948577Smsmith
280137099Sdes/*
281137099Sdes * int
282137099Sdes * please avoid using for new tunables!
283137099Sdes */
28477900Speterextern void tunable_int_init(void *);
28577900Speterstruct tunable_int {
28677900Speter	const char *path;
28777900Speter	int *var;
28877900Speter};
28977900Speter#define	TUNABLE_INT(path, var)					\
290145193Sstefanf	static struct tunable_int __CONCAT(__tunable_int_, __LINE__) = { \
291145193Sstefanf		(path),						\
292145193Sstefanf		(var),						\
29377900Speter	};							\
294145193Sstefanf	SYSINIT(__CONCAT(__Tunable_init_, __LINE__),		\
295145193Sstefanf	    SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_int_init,	\
296145193Sstefanf	    &__CONCAT(__tunable_int_, __LINE__))
29777900Speter
29885386Sjhb#define	TUNABLE_INT_FETCH(path, var)	getenv_int((path), (var))
29948577Smsmith
300137099Sdes/*
301137099Sdes * long
302137099Sdes */
303137099Sdesextern void tunable_long_init(void *);
304137099Sdesstruct tunable_long {
305137099Sdes	const char *path;
306137099Sdes	long *var;
307137099Sdes};
308137099Sdes#define	TUNABLE_LONG(path, var)					\
309145193Sstefanf	static struct tunable_long __CONCAT(__tunable_long_, __LINE__) = { \
310145193Sstefanf		(path),						\
311145193Sstefanf		(var),						\
312137099Sdes	};							\
313145193Sstefanf	SYSINIT(__CONCAT(__Tunable_init_, __LINE__),		\
314145193Sstefanf	    SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_long_init,\
315145193Sstefanf	    &__CONCAT(__tunable_long_, __LINE__))
316137099Sdes
317137099Sdes#define	TUNABLE_LONG_FETCH(path, var)	getenv_long((path), (var))
318137099Sdes
319137099Sdes/*
320137099Sdes * unsigned long
321137099Sdes */
322137099Sdesextern void tunable_ulong_init(void *);
323137099Sdesstruct tunable_ulong {
324137099Sdes	const char *path;
325137099Sdes	unsigned long *var;
326137099Sdes};
327137099Sdes#define	TUNABLE_ULONG(path, var)				\
328145193Sstefanf	static struct tunable_ulong __CONCAT(__tunable_ulong_, __LINE__) = { \
329145193Sstefanf		(path),						\
330145193Sstefanf		(var),						\
331137099Sdes	};							\
332145193Sstefanf	SYSINIT(__CONCAT(__Tunable_init_, __LINE__),		\
333145193Sstefanf	    SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_ulong_init, \
334145193Sstefanf	    &__CONCAT(__tunable_ulong_, __LINE__))
335137099Sdes
336137099Sdes#define	TUNABLE_ULONG_FETCH(path, var)	getenv_ulong((path), (var))
337137099Sdes
338180661Spjd/*
339180661Spjd * quad
340180661Spjd */
341180661Spjdextern void tunable_quad_init(void *);
342180661Spjdstruct tunable_quad {
343180661Spjd	const char *path;
344180661Spjd	quad_t *var;
345180661Spjd};
346180661Spjd#define	TUNABLE_QUAD(path, var)					\
347180661Spjd	static struct tunable_quad __CONCAT(__tunable_quad_, __LINE__) = { \
348180661Spjd		(path),						\
349180661Spjd		(var),						\
350180661Spjd	};							\
351180661Spjd	SYSINIT(__CONCAT(__Tunable_init_, __LINE__),		\
352180661Spjd	    SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_quad_init, \
353180661Spjd	    &__CONCAT(__tunable_quad_, __LINE__))
354180661Spjd
355180661Spjd#define	TUNABLE_QUAD_FETCH(path, var)	getenv_quad((path), (var))
356180661Spjd
35777900Speterextern void tunable_str_init(void *);
35877900Speterstruct tunable_str {
35977900Speter	const char *path;
36077900Speter	char *var;
36177900Speter	int size;
36277900Speter};
36377900Speter#define	TUNABLE_STR(path, var, size)				\
364145193Sstefanf	static struct tunable_str __CONCAT(__tunable_str_, __LINE__) = { \
365145193Sstefanf		(path),						\
366145193Sstefanf		(var),						\
367145193Sstefanf		(size),						\
36877900Speter	};							\
369145193Sstefanf	SYSINIT(__CONCAT(__Tunable_init_, __LINE__),		\
370145193Sstefanf	    SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_str_init,	\
371145193Sstefanf	    &__CONCAT(__tunable_str_, __LINE__))
37277900Speter
37385386Sjhb#define	TUNABLE_STR_FETCH(path, var, size)			\
37485386Sjhb	getenv_string((path), (var), (size))
37570417Speter
37651957Sn_hibmastruct intr_config_hook {
37760938Sjake	TAILQ_ENTRY(intr_config_hook) ich_links;
37892719Salfred	void	(*ich_func)(void *arg);
37951957Sn_hibma	void	*ich_arg;
38051957Sn_hibma};
38151957Sn_hibma
38292719Salfredint	config_intrhook_establish(struct intr_config_hook *hook);
38392719Salfredvoid	config_intrhook_disestablish(struct intr_config_hook *hook);
38451957Sn_hibma
38512901Sbde#endif /* !_SYS_KERNEL_H_*/
386