1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
|
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013 Andrew Stormont. All rights reserved.
# Copyright 2016 Joyent, Inc.
# Copyright 2016 Garrett D'Amore <garrett@damore.org>
# Copyright 2016 Nexenta Systems, Inc.
#
#
# This makefile contains the common definitions for all intel
# implementation architecture independent modules.
#
#
# Machine type (implementation architecture):
#
PLATFORM = i86pc
#
# Everybody needs to know how to build modstubs.o and to locate unix.o.
# Note that unix.o must currently be selected from among the possible
# "implementation architectures". Note further, that unix.o is only
# used as an optional error check for undefines so (theoretically)
# any "implementation architectures" could be used. We choose i86pc
# because it is the reference port.
#
UNIX_DIR = $(UTSBASE)/i86pc/unix
GENLIB_DIR = $(UTSBASE)/intel/genunix
IPDRV_DIR = $(UTSBASE)/intel/ip
MODSTUBS_DIR = $(UNIX_DIR)
DSF_DIR = $(UTSBASE)/$(PLATFORM)/genassym
LINTS_DIR = $(OBJS_DIR)
LINT_LIB_DIR = $(UTSBASE)/intel/lint-libs/$(OBJS_DIR)
UNIX_O = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
GENLIB = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
MODSTUBS_O = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
LINT_LIB = # was llib-lunix.ln
GEN_LINT_LIB = # was llib-lgenunix.ln
#
# Include the makefiles which define build rule templates, the
# collection of files per module, and a few specific flags. Note
# that order is significant, just as with an include path. The
# first build rule template which matches the files name will be
# used. By including these in order from most machine dependent
# to most machine independent, we allow a machine dependent file
# to be used in preference over a machine independent version
# (Such as a machine specific optimization, which preserves the
# interfaces.)
#
include $(UTSBASE)/intel/Makefile.files
include $(UTSBASE)/common/Makefile.files
#
# ----- TRANSITIONAL SECTION --------------------------------------------------
#
#
# Not everything which *should* be a module is a module yet. The
# following is a list of such objects which are currently part of
# genunix but which might someday become kmods. This must be
# defined before we include Makefile.uts, or else genunix's build
# won't be as parallel as we might like.
#
NOT_YET_KMODS =
#
# ----- END OF TRANSITIONAL SECTION -------------------------------------------
#
# Include machine independent rules. Note that this does not imply
# that the resulting module from rules in Makefile.uts is machine
# independent. Only that the build rules are machine independent.
#
include $(UTSBASE)/Makefile.uts
#
# The following must be defined for all implementations:
#
MODSTUBS = $(UTSBASE)/intel/ia32/ml/modstubs.s
#
# Define supported builds
#
DEF_BUILDS = $(DEF_BUILDS64)
ALL_BUILDS = $(ALL_BUILDS64)
#
# x86 or amd64 inline templates
#
INLINES_32 = $(UTSBASE)/intel/ml/ia32.il
INLINES_64 = $(UTSBASE)/intel/ml/amd64.il
INLINES += $(INLINES_$(CLASS))
#
# kernel-specific optimizations; override default in Makefile.master
#
CFLAGS_XARCH_32 = $(i386_CFLAGS)
CFLAGS_XARCH_64 = $(amd64_CFLAGS)
CFLAGS_XARCH = $(CFLAGS_XARCH_$(CLASS))
COPTFLAG_32 = $(COPTFLAG)
COPTFLAG_64 = $(COPTFLAG64)
COPTIMIZE = $(COPTFLAG_$(CLASS))
CFLAGS = $(CFLAGS_XARCH)
CFLAGS += $(COPTIMIZE)
CFLAGS += $(INLINES) -D_ASM_INLINES
CFLAGS += $(CCMODE)
CFLAGS += $(SPACEFLAG)
CFLAGS += $(CCUNBOUND)
CFLAGS += $(CFLAGS_uts)
CFLAGS += -xstrconst
CFLAGS += -_gcc=-fstack-protector
ASFLAGS_XARCH_32 = $(i386_ASFLAGS)
ASFLAGS_XARCH_64 = $(amd64_ASFLAGS)
ASFLAGS_XARCH = $(ASFLAGS_XARCH_$(CLASS))
ASFLAGS += $(ASFLAGS_XARCH)
#
# Define the base directory for installation.
#
BASE_INS_DIR = $(ROOT)
#
# Debugging level
#
# Special knowledge of which special debugging options affect which
# file is used to optimize the build if these flags are changed.
#
DEBUG_DEFS_OBJ32 =
DEBUG_DEFS_DBG32 = -DDEBUG
DEBUG_DEFS_OBJ64 =
DEBUG_DEFS_DBG64 = -DDEBUG
DEBUG_DEFS = $(DEBUG_DEFS_$(BUILD_TYPE))
DEBUG_COND_OBJ32 = $(POUND_SIGN)
DEBUG_COND_DBG32 =
DEBUG_COND_OBJ64 = $(POUND_SIGN)
DEBUG_COND_DBG64 =
IF_DEBUG_OBJ = $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
$(IF_DEBUG_OBJ)syscall.o := DEBUG_DEFS += -DSYSCALLTRACE
$(IF_DEBUG_OBJ)clock.o := DEBUG_DEFS += -DKSLICE=1
#
# Collect the preprocessor definitions to be associated with *all*
# files.
#
ALL_DEFS = $(DEBUG_DEFS) $(OPTION_DEFS)
#
# The kernels modules which are "implementation architecture"
# specific for this machine are enumerated below. Note that most
# of these modules must exist (in one form or another) for each
# architecture.
#
# Common Drivers (usually pseudo drivers) (/kernel/drv)
# DRV_KMODS are built both 32-bit and 64-bit
# DRV_KMODS_32 are built only 32-bit
# DRV_KMODS_64 are built only 64-bit
#
DRV_KMODS += amd64_gart
DRV_KMODS += agpgart
DRV_KMODS += agptarget
DRV_KMODS += drm
DRV_KMODS += i915
#
# Common code drivers
#
#
# Brand modules
#
BRAND_KMODS +=
#
# Exec Class Modules (/kernel/exec):
#
EXEC_KMODS +=
#
# Scheduling Class Modules (/kernel/sched):
#
SCHED_KMODS +=
#
# File System Modules (/kernel/fs):
#
FS_KMODS +=
#
# Streams Modules (/kernel/strmod):
#
STRMOD_KMODS +=
#
# 'System' Modules (/kernel/sys):
#
SYS_KMODS +=
#
# 'Misc' Modules (/kernel/misc)
# MISC_KMODS are built both 32-bit and 64-bit
# MISC_KMODS_32 are built only 32-bit
# MISC_KMODS_64 are built only 64-bit
#
MISC_KMODS += agpmaster
#
# Software Cryptographic Providers (/kernel/crypto):
#
CRYPTO_KMODS +=
#
# IP Policy Modules (/kernel/ipp)
#
IPP_KMODS +=
#
# generic-unix module (/kernel/genunix):
#
GENUNIX_KMODS +=
#
# 'Dacf' Modules (/kernel/dacf):
#
#
# Performance Counter BackEnd modules (/usr/kernel/pcbe)
#
PCBE_KMODS +=
#
# MAC-Type Plugin Modules (/kernel/mac)
#
MAC_KMODS +=
#
# socketmod (kernel/socketmod)
#
SOCKET_KMODS +=
#
# kiconv modules (/kernel/kiconv):
#
KICONV_KMODS +=
#
# 'Dacf' Modules (/kernel/dacf):
#
DACF_KMODS +=
|