2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * @(#)kernel.h 8.3 (Berkeley) 1/21/94
39 * $\Id: kernel.h,v 1.9 1995/03/20 19:20:26 wollman Exp $
42 #ifndef _SYS_KERNEL_H_
43 #define _SYS_KERNEL_H_
45 /* Global variables for the kernel. */
49 extern char hostname
[MAXHOSTNAMELEN
];
50 extern int hostnamelen
;
51 extern char domainname
[MAXHOSTNAMELEN
];
52 extern int domainnamelen
;
53 extern char kernelname
[MAXPATHLEN
];
56 extern volatile struct timeval mono_time
;
57 extern struct timeval boottime
;
58 extern struct timeval runtime
;
59 #ifdef _MSC_VER /* TODO FIXME - need a library-specific macro for this one */
60 extern volatile struct timeval kern_time
;
62 extern volatile struct timeval time
;
64 extern struct timezone tz
; /* XXX */
66 extern int tick
; /* usec per tick (1000000 / hz) */
67 extern int hz
; /* system clock's frequency */
68 extern int stathz
; /* statistics clock's frequency */
69 extern int profhz
; /* profiling clock's frequency */
71 extern int lbolt
; /* once a second sleep address */
73 extern long timedelta
;
76 * The following macros are used to declare global sets of objects, which
77 * are collected by the linker into a `struct linker_set' as defined below.
79 * NB: the constants defined below must match those defined in
80 * ld/ld.h. Since their calculation requires arithmetic, we
81 * can't name them symbolically (e.g., 23 is N_SETT | N_EXT).
84 #define MAKE_SET(set, sym, type)
87 #define MAKE_SET(set, sym, type) \
88 asm(".stabs \"" #set "\", " #type ", 0, 0, " #sym)
90 #define MAKE_SET(set, sym, type) \
91 asm(".stabs \"_" #set "\", " #type ", 0, 0, _" #sym)
94 #define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
95 #define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
96 #define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
97 #define ABS_SET(set, sym) MAKE_SET(set, sym, 21)
100 #include <sys/conf.h>
101 #include <sys/exec.h>
102 #include <sys/sysent.h>
105 #define PSEUDO_SET(init, name) \
106 extern struct linker_set MODVNOPS; \
108 int name ## _load(struct lkm_table *lkmtp, int cmd) \
109 { init(); return 0; } \
110 int name ## _unload(struct lkm_table *lkmtp, int cmd) \
113 name ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
114 DISPATCH(lkmtp, cmd, ver, name ## _load, name ## _unload, \
116 #else /* PSEUDO_LKM */
118 #define PSEUDO_SET(sym, name) TEXT_SET(pseudo_set, sym)
120 #endif /* PSEUDO_LKM */
124 caddr_t ls_items
[1]; /* really ls_length of them, trailing NULL */
127 extern const struct linker_set execsw_set
;