xref: /illumos-gate/usr/src/uts/i86xpv/Makefile.i86xpv (revision 22028508fd28d36ff74dc02c5774a8ba1f0db045)
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/i86xpv/Makefile.i86xpv
24#
25# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27# Copyright (c) 2013 Andrew Stormont.  All rights reserved.
28# Copyright 2019 Joyent, Inc.
29#
30
31#
32#	This makefile contains the common definitions for the i86xpv unix
33#	and all i86xpv implementation architecture dependent modules.
34#
35
36#
37#	Machine type (implementation architecture):
38#
39PLATFORM	 = i86xpv
40
41#
42#	uname -m value
43#
44UNAME_M		 = i86pc
45
46#
47#	Everybody needs to know how to build modstubs.o and to locate unix.o
48#
49UNIX_DIR	 = $(UTSBASE)/$(PLATFORM)/unix
50GENLIB_DIR	 = $(UTSBASE)/intel/genunix
51MODSTUBS_DIR	 = $(UNIX_DIR)
52DSF_DIR		 = $(UTSBASE)/$(PLATFORM)/genassym
53
54DTRACESTUBS_O	 = $(OBJS_DIR)/dtracestubs.o
55DTRACESTUBS	 = $(OBJS_DIR)/libdtracestubs.so
56
57SYM_MOD		= $(OBJS_DIR)/unix.sym
58
59UNIX_O		 = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
60MODSTUBS_O	 = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
61GENLIB		 = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
62
63#
64#	Include the makefiles which define build rule templates, the
65#	collection of files per module, and a few specific flags. Note
66#	that order is significant, just as with an include path. The
67#	first build rule template which matches the files name will be
68#	used. By including these in order from most machine dependent
69#	to most machine independent, we allow a machine dependent file
70#	to be used in preference over a machine independent version
71#	(Such as a machine specific optimization, which preserves the
72#	interfaces.)
73#
74include $(UTSBASE)/$(PLATFORM)/Makefile.files
75include $(UTSBASE)/intel/Makefile.files
76include $(UTSBASE)/common/Makefile.files
77
78#
79#	Include machine independent rules. Note that this does not imply
80#	that the resulting module from rules in Makefile.uts is	machine
81#	independent. Only that the build rules are machine independent.
82#
83include $(UTSBASE)/Makefile.uts
84
85#
86#	Define supported builds
87#
88DEF_BUILDS		= $(DEF_BUILDS64)
89ALL_BUILDS		= $(ALL_BUILDS64)
90
91#
92#	kernel-specific optimizations; override default in Makefile.master
93#
94
95CFLAGS_XARCH_32		= $(i386_CFLAGS)
96CFLAGS_XARCH_64		= $(amd64_CFLAGS)
97CFLAGS_XARCH		= $(CFLAGS_XARCH_$(CLASS))
98
99COPTFLAG_32		= $(COPTFLAG)
100COPTFLAG_64		= $(COPTFLAG64)
101COPTIMIZE		= $(COPTFLAG_$(CLASS))
102
103CFLAGS			= $(CFLAGS_XARCH)
104CFLAGS			+= $(COPTIMIZE)
105CFLAGS			+= -D_ASM_INLINES
106CFLAGS			+= $(CCMODE)
107CFLAGS			+= $(SPACEFLAG)
108CFLAGS			+= $(CCUNBOUND)
109CFLAGS			+= $(CFLAGS_uts)
110
111ASFLAGS_XARCH_32	= $(i386_ASFLAGS)
112ASFLAGS_XARCH_64	= $(amd64_ASFLAGS)
113ASFLAGS_XARCH		= $(ASFLAGS_XARCH_$(CLASS))
114
115ASFLAGS			+= $(ASFLAGS_XARCH)
116
117AS_INC_PATH		+= -I$(DSF_DIR)/$(OBJS_DIR)
118
119#
120#	The following must be defined for all implementations:
121#
122#	UNIX_MAPFILE:	ld mapfile for the build of kernel/unix.
123#	MODSTUBS:	Module stubs source file.
124#	GENASSYM_SRC:	genassym.c
125
126UNIX_MAPFILE	= $(UTSBASE)/$(PLATFORM)/conf/Mapfile
127MODSTUBS	= $(UTSBASE)/intel/ml/modstubs.s
128GENASSYM_SRC	= $(UTSBASE)/i86pc/ml/genassym.c
129OFFSETS_SRC	= $(UTSBASE)/i86pc/ml/offsets.in
130
131PLATFORM_OFFSETS_SRC	= $(UTSBASE)/intel/amd64/ml/mach_offsets.in
132KDI_OFFSETS_SRC		= $(UTSBASE)/intel/kdi/kdi_offsets.in
133
134#
135#	Define the actual specific platforms
136#
137MACHINE_DEFS	 = -D__$(PLATFORM) -D__xpv -D_MACHDEP
138
139#
140#	Software workarounds for hardware "features"
141#
142
143include	$(UTSBASE)/i86pc/Makefile.workarounds
144
145#
146#	Debugging level
147#
148#	Special knowledge of which special debugging options effect which
149#	file is used to optimize the build if these flags are changed.
150#
151#	XXX: The above could possibly be done for more flags and files, but
152#	     is left as an experiment to the interested reader. Be forewarned,
153#	     that excessive use could lead to maintenance difficulties.
154#
155DEBUG_DEFS_OBJ32	=
156DEBUG_DEFS_DBG32	= -DDEBUG
157DEBUG_DEFS_OBJ64	=
158DEBUG_DEFS_DBG64	= -DDEBUG
159DEBUG_DEFS		= $(DEBUG_DEFS_$(BUILD_TYPE))
160
161DEBUG_COND_OBJ32	= $(POUND_SIGN)
162DEBUG_COND_DBG32	=
163DEBUG_COND_OBJ64	= $(POUND_SIGN)
164DEBUG_COND_DBG64	=
165IF_DEBUG_OBJ		= $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
166
167$(IF_DEBUG_OBJ)trap.o		:= DEBUG_DEFS += -DTRAPDEBUG -DTRAPTRACE
168$(IF_DEBUG_OBJ)syscall_asm_amd64.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
169$(IF_DEBUG_OBJ)fast_trap_asm.o	:= DEBUG_DEFS += -DTRAPTRACE
170$(IF_DEBUG_OBJ)interrupt.o	:= DEBUG_DEFS += -DTRAPTRACE
171$(IF_DEBUG_OBJ)intr.o		:= DEBUG_DEFS += -DTRAPTRACE
172$(IF_DEBUG_OBJ)locore.o		:= DEBUG_DEFS += -DTRAPTRACE
173$(IF_DEBUG_OBJ)mp_startup.o	:= DEBUG_DEFS += -DTRAPTRACE
174$(IF_DEBUG_OBJ)machdep.o	:= DEBUG_DEFS += -DTRAPTRACE
175$(IF_DEBUG_OBJ)exception.o	:= DEBUG_DEFS += -DTRAPTRACE
176$(IF_DEBUG_OBJ)x_call.o		:= DEBUG_DEFS += -DTRAPTRACE
177$(IF_DEBUG_OBJ)mp_call.o	:= DEBUG_DEFS += -DTRAPTRACE
178$(IF_DEBUG_OBJ)cbe.o		:= DEBUG_DEFS += -DTRAPTRACE
179$(IF_DEBUG_OBJ)hyperevent.o	:= DEBUG_DEFS += -DTRAPTRACE
180$(IF_DEBUG_OBJ)evtchn.o		:= DEBUG_DEFS += -DTRAPTRACE
181
182#
183#	Collect the preprocessor definitions to be associated with *all*
184#	files.
185#
186ALL_DEFS	 = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
187		   $(OPTION_DEFS)
188GENASSYM_DEFS	 = $(MACHINE_DEFS) $(OPTION_DEFS) \
189			-_gcc=-fno-eliminate-unused-debug-symbols \
190			-_gcc=-fno-eliminate-unused-debug-types
191
192#
193# ----- TRANSITIONAL SECTION --------------------------------------------------
194#
195
196#
197#	Not everything which *should* be a module is a module yet. The
198#	following is a list of such objects which are currently part of
199#	the base kernel but should soon become kmods.
200#
201#	XXX: $(KMACCT_OBJS) is neither in the MT kernel nor was it ever
202#	     made into a module. If it is made MT safe before being made
203#	     into a module, it should be added to this list. It was in
204#	     this list pre ON-4.0.
205#
206#
207MACH_NOT_YET_KMODS	= $(AUTOCONF_OBJS)
208
209#
210# ----- END OF TRANSITIONAL SECTION -------------------------------------------
211#
212
213#
214#	The kernels modules which are "implementation architecture"
215#	specific for this machine are enumerated below. Note that most
216#	of these modules must exist (in one form or another) for each
217#	architecture.
218#
219#	Machine Specific Driver Modules (/kernel/drv):
220#	DRV_KMODS are built both 32-bit and 64-bit
221#	DRV_KMODS_32 are built only 32-bit
222#	DRV_KMODS_64 are built only 64-bit
223#
224
225DRV_KMODS	+= rootnex
226DRV_KMODS	+= ioat
227DRV_KMODS	+= isa
228DRV_KMODS	+= pci
229DRV_KMODS	+= pit_beep
230DRV_KMODS	+= npe
231DRV_KMODS	+= pci-ide
232DRV_KMODS	+= xsvc
233DRV_KMODS	+= xenbus
234DRV_KMODS	+= xencons
235DRV_KMODS	+= xpvd
236DRV_KMODS	+= xnbe
237DRV_KMODS	+= xnbo
238DRV_KMODS	+= xnbu
239DRV_KMODS	+= xnf
240DRV_KMODS	+= xdb
241DRV_KMODS	+= xdf
242DRV_KMODS	+= privcmd
243DRV_KMODS	+= domcaps
244DRV_KMODS	+= evtchn
245DRV_KMODS	+= balloon
246DRV_KMODS	+= xpvtap
247DRV_KMODS	+= xdt
248
249#
250#	CPU Modules
251#
252CPU_KMODS	+= generic_cpu
253CPU_KMODS	+= amd_opteron
254CPU_KMODS	+= genuineintel
255CPU_KMODS	+= authenticamd
256
257#
258#	Exec Class Modules (/kernel/exec):
259#
260EXEC_KMODS	+=
261
262#
263#	Scheduling Class Modules (/kernel/sched):
264#
265SCHED_KMODS	+=
266
267#
268#	File System Modules (/kernel/fs):
269#
270FS_KMODS	+=
271
272#
273#	Streams Modules (/kernel/strmod):
274#
275STRMOD_KMODS	+=
276
277#
278#	'System' Modules (/kernel/sys):
279#
280SYS_KMODS	+=
281
282#
283#	'Misc' Modules (/kernel/misc):
284#
285MISC_KMODS	+= xpv_autoconfig gfx_private xnb
286
287#	'Dacf' modules (/kernel/dacf)
288#
289DACF_KMODS	+= consconfig_dacf
290
291#
292#	'Mach' Modules (/kernel/mach):
293#
294MACH_KMODS	+= xpv_psm xpv_uppc
295
296#
297#	'TOD' modules (/platform/.../kernel/tod):
298#
299TOD_KMODS	+= xpvtod
300