xref: /illumos-gate/usr/src/uts/i86pc/Makefile.i86pc (revision 76f19f5fdc974fe5be5c82a556e43a4df93f1de1)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# uts/i86pc/Makefile.i86pc
24#
25# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
26# Copyright (c) 2013 Andrew Stormont.  All rights reserved.
27# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
28# Copyright 2019 Joyent, Inc.
29#
30#
31#	This makefile contains the common definitions for the i86pc unix
32#	and all i86pc implementation architecture dependent modules.
33#
34
35#
36#	Machine type (implementation architecture):
37#
38PLATFORM	 = i86pc
39
40#
41#	uname -m value
42#
43UNAME_M		= $(PLATFORM)
44
45#
46# Definitions for the platform-specific /platform directories.
47#
48# IMPLEMENTATIONS is used to designate i86pc machines which have
49# platform specific modules.  All code specific to a given implementation
50# resides in the appropriately named subdirectory.   This requires
51# these platforms to have their own Makefiles to define ROOT_PLAT_DIRS,
52# USR_PLAT_DIRS, etc.
53#
54IMPLEMENTATIONS	= i86hvm
55
56#
57#	Everybody needs to know how to build modstubs.o and to locate unix.o
58#
59UNIX_DIR	 = $(UTSBASE)/$(PLATFORM)/unix
60GENLIB_DIR	 = $(UTSBASE)/intel/genunix
61MODSTUBS_DIR	 = $(UNIX_DIR)
62DSF_DIR		 = $(UTSBASE)/$(PLATFORM)/genassym
63
64DTRACESTUBS_O	 = $(OBJS_DIR)/dtracestubs.o
65DTRACESTUBS	 = $(OBJS_DIR)/libdtracestubs.so
66
67SYM_MOD		= $(OBJS_DIR)/unix.sym
68
69UNIX_O		 = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
70MODSTUBS_O	 = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
71GENLIB		 = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
72
73#
74#	Include the makefiles which define build rule templates, the
75#	collection of files per module, and a few specific flags. Note
76#	that order is significant, just as with an include path. The
77#	first build rule template which matches the files name will be
78#	used. By including these in order from most machine dependent
79#	to most machine independent, we allow a machine dependent file
80#	to be used in preference over a machine independent version
81#	(Such as a machine specific optimization, which preserves the
82#	interfaces.)
83#
84include $(UTSBASE)/$(PLATFORM)/Makefile.files
85include $(UTSBASE)/intel/Makefile.files
86include $(UTSBASE)/common/Makefile.files
87
88#
89#	Include machine independent rules. Note that this does not imply
90#	that the resulting module from rules in Makefile.uts is	machine
91#	independent. Only that the build rules are machine independent.
92#
93include $(UTSBASE)/Makefile.uts
94
95#
96#	Define supported builds
97#
98DEF_BUILDS		= $(DEF_BUILDS64)
99ALL_BUILDS		= $(ALL_BUILDS64)
100
101#
102#	kernel-specific optimizations; override default in Makefile.master
103#
104
105CFLAGS_XARCH_32		= $(i386_CFLAGS)
106CFLAGS_XARCH_64		= $(amd64_CFLAGS)
107CFLAGS_XARCH		= $(CFLAGS_XARCH_$(CLASS))
108
109COPTFLAG_32		= $(COPTFLAG)
110COPTFLAG_64		= $(COPTFLAG64)
111COPTIMIZE		= $(COPTFLAG_$(CLASS))
112
113CFLAGS			= $(CFLAGS_XARCH)
114CFLAGS			+= $(COPTIMIZE)
115CFLAGS			+= -D_ASM_INLINES
116CFLAGS			+= $(CCMODE)
117CFLAGS			+= $(SPACEFLAG)
118CFLAGS			+= $(CCUNBOUND)
119CFLAGS			+= $(CFLAGS_uts)
120CFLAGS			+= -xstrconst
121
122ASFLAGS_XARCH_32	= $(i386_ASFLAGS)
123ASFLAGS_XARCH_64	= $(amd64_ASFLAGS)
124ASFLAGS_XARCH		= $(ASFLAGS_XARCH_$(CLASS))
125
126ASFLAGS			+= $(ASFLAGS_XARCH)
127
128AS_INC_PATH		+= -I$(DSF_DIR)/$(OBJS_DIR)
129
130#
131#	The following must be defined for all implementations:
132#
133#	MAPFILE:	ld mapfile for the build of kernel/unix.
134#	MODSTUBS:	Module stubs source file.
135#	GENASSYM_SRC:	genassym.c
136#
137MAPFILE		 = $(UTSBASE)/$(PLATFORM)/conf/Mapfile
138MODSTUBS	 = $(UTSBASE)/intel/ia32/ml/modstubs.s
139GENASSYM_SRC	 = $(UTSBASE)/$(PLATFORM)/ml/genassym.c
140OFFSETS_SRC	 = $(UTSBASE)/$(PLATFORM)/ml/offsets.in
141PLATFORM_OFFSETS_SRC	= $(UTSBASE)/intel/amd64/ml/mach_offsets.in
142KDI_OFFSETS_SRC	 = $(UTSBASE)/intel/kdi/kdi_offsets.in
143
144#
145#	Define the actual specific platforms
146#
147MACHINE_DEFS	 = -D$(PLATFORM) -D_MACHDEP
148
149#
150#	Software workarounds for hardware "features"
151#
152
153include	$(UTSBASE)/$(PLATFORM)/Makefile.workarounds
154
155#
156#	Debugging level
157#
158#	Special knowledge of which special debugging options effect which
159#	file is used to optimize the build if these flags are changed.
160#
161#	XXX: The above could possibly be done for more flags and files, but
162#	     is left as an experiment to the interested reader. Be forewarned,
163#	     that excessive use could lead to maintenance difficulties.
164#
165DEBUG_DEFS_OBJ32	=
166DEBUG_DEFS_DBG32	= -DDEBUG
167DEBUG_DEFS_OBJ64	=
168DEBUG_DEFS_DBG64	= -DDEBUG
169DEBUG_DEFS		= $(DEBUG_DEFS_$(BUILD_TYPE))
170
171DEBUG_COND_OBJ32	= $(POUND_SIGN)
172DEBUG_COND_DBG32	=
173DEBUG_COND_OBJ64	= $(POUND_SIGN)
174DEBUG_COND_DBG64	=
175IF_DEBUG_OBJ		= $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
176
177$(IF_DEBUG_OBJ)trap.o		:= DEBUG_DEFS += -DTRAPDEBUG -DTRAPTRACE
178$(IF_DEBUG_OBJ)syscall_asm_amd64.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
179$(IF_DEBUG_OBJ)fast_trap_asm.o	:= DEBUG_DEFS += -DTRAPTRACE
180$(IF_DEBUG_OBJ)interrupt.o	:= DEBUG_DEFS += -DTRAPTRACE
181$(IF_DEBUG_OBJ)intr.o		:= DEBUG_DEFS += -DTRAPTRACE
182$(IF_DEBUG_OBJ)locore.o		:= DEBUG_DEFS += -DTRAPTRACE
183$(IF_DEBUG_OBJ)mp_startup.o	:= DEBUG_DEFS += -DTRAPTRACE
184$(IF_DEBUG_OBJ)machdep.o	:= DEBUG_DEFS += -DTRAPTRACE
185$(IF_DEBUG_OBJ)exception.o	:= DEBUG_DEFS += -DTRAPTRACE
186$(IF_DEBUG_OBJ)x_call.o		:= DEBUG_DEFS += -DTRAPTRACE
187$(IF_DEBUG_OBJ)mp_call.o	:= DEBUG_DEFS += -DTRAPTRACE
188$(IF_DEBUG_OBJ)cbe.o		:= DEBUG_DEFS += -DTRAPTRACE
189
190#
191#	Collect the preprocessor definitions to be associated with *all*
192#	files.
193#
194ALL_DEFS	 = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
195		   $(OPTION_DEFS)
196GENASSYM_DEFS	 = $(MACHINE_DEFS) $(OPTION_DEFS) \
197			-_gcc=-fno-eliminate-unused-debug-symbols \
198			-_gcc=-fno-eliminate-unused-debug-types
199
200#
201# ----- TRANSITIONAL SECTION --------------------------------------------------
202#
203
204#
205#	Not everything which *should* be a module is a module yet. The
206#	following is a list of such objects which are currently part of
207#	the base kernel but should soon become kmods.
208#
209#	XXX: $(KMACCT_OBJS) is neither in the MT kernel nor was it ever
210#	     made into a module. If it is made MT safe before being made
211#	     into a module, it should be added to this list. It was in
212#	     this list pre ON-4.0.
213#
214#
215MACH_NOT_YET_KMODS	= $(AUTOCONF_OBJS)
216
217#
218# ----- END OF TRANSITIONAL SECTION -------------------------------------------
219#
220
221#
222#	The kernels modules which are "implementation architecture"
223#	specific for this machine are enumerated below. Note that most
224#	of these modules must exist (in one form or another) for each
225#	architecture.
226#
227#	Machine Specific Driver Modules (/kernel/drv)
228#	DRV_KMODS are built both 32-bit and 64-bit
229#	DRV_KMODS_32 are built only 32-bit
230#	DRV_KMODS_64 are built only 64-bit
231#
232DRV_KMODS	+= rootnex
233DRV_KMODS	+= isa
234DRV_KMODS	+= pcplusmp
235DRV_KMODS	+= apix
236DRV_KMODS	+= cpc
237DRV_KMODS	+= pci
238DRV_KMODS	+= npe
239DRV_KMODS	+= pci-ide
240DRV_KMODS	+= xsvc
241DRV_KMODS	+= tzmon
242DRV_KMODS	+= acpi_drv
243DRV_KMODS	+= acpinex
244DRV_KMODS	+= amd_iommu
245DRV_KMODS	+= dr
246DRV_KMODS	+= ioat
247DRV_KMODS	+= fipe
248DRV_KMODS	+= imc imcstub
249DRV_KMODS	+= vmm
250DRV_KMODS	+= viona
251DRV_KMODS	+= ppt
252
253DRV_KMODS	+= cpudrv
254
255
256#
257# Platform Power Modules
258#
259DRV_KMODS	+= ppm acpippm
260
261#
262#	CPU Modules
263#
264CPU_KMODS	+= amd_opteron
265CPU_KMODS	+= generic_cpu
266CPU_KMODS	+= authenticamd
267CPU_KMODS	+= genuineintel
268
269#
270#	Exec Class Modules (/kernel/exec):
271#
272EXEC_KMODS	+=
273
274#
275#	Scheduling Class Modules (/kernel/sched):
276#
277SCHED_KMODS	+=
278
279#
280#	File System Modules (/kernel/fs):
281#
282FS_KMODS	+=
283
284#
285#	Streams Modules (/kernel/strmod):
286#
287STRMOD_KMODS	+=
288
289#
290#	'System' Modules (/kernel/sys):
291#
292SYS_KMODS	+=
293
294#
295#	'Misc' Modules (/kernel/misc):
296#
297MISC_KMODS	+= gfx_private pcie
298MISC_KMODS	+= acpidev
299MISC_KMODS	+= drmach_acpi
300
301#
302#	'Dacf' modules (/kernel/dacf)
303#
304DACF_KMODS	+= consconfig_dacf
305
306#
307#	'Mach' Modules (/kernel/mach):
308#
309MACH_KMODS	+= uppc
310
311#
312#	CPR Misc Module.
313#
314MISC_KMODS	+= cpr
315