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.
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.
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]
23 # uts/i86pc/Makefile.i86pc
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.
31 # This makefile contains the common definitions for the i86pc unix
32 # and all i86pc implementation architecture dependent modules.
36 # Machine type (implementation architecture):
46 # Definitions for the platform-specific /platform directories.
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,
54 IMPLEMENTATIONS = i86hvm
57 # Everybody needs to know how to build modstubs.o and to locate unix.o
59 UNIX_DIR = $(UTSBASE)/$(PLATFORM)/unix
60 GENLIB_DIR = $(UTSBASE)/intel/genunix
61 MODSTUBS_DIR = $(UNIX_DIR)
62 DSF_DIR = $(UTSBASE)/$(PLATFORM)/genassym
64 DTRACESTUBS_O = $(OBJS_DIR)/dtracestubs.o
65 DTRACESTUBS = $(OBJS_DIR)/libdtracestubs.so
67 SYM_MOD = $(OBJS_DIR)/unix.sym
69 UNIX_O = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
70 MODSTUBS_O = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
71 GENLIB = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
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
84 include $(UTSBASE)/$(PLATFORM)/Makefile.files
85 include $(UTSBASE)/intel/Makefile.files
86 include $(UTSBASE)/common/Makefile.files
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.
93 include $(UTSBASE)/Makefile.uts
96 # Define supported builds
98 DEF_BUILDS = $(DEF_BUILDS64)
99 ALL_BUILDS = $(ALL_BUILDS64)
102 # kernel-specific optimizations; override default in Makefile.master
105 CFLAGS_XARCH_32 = $(i386_CFLAGS)
106 CFLAGS_XARCH_64 = $(amd64_CFLAGS)
107 CFLAGS_XARCH = $(CFLAGS_XARCH_$(CLASS))
109 COPTFLAG_32 = $(COPTFLAG)
110 COPTFLAG_64 = $(COPTFLAG64)
111 COPTIMIZE = $(COPTFLAG_$(CLASS))
113 CFLAGS = $(CFLAGS_XARCH)
114 CFLAGS += $(COPTIMIZE)
115 CFLAGS += -D_ASM_INLINES
116 CFLAGS += $(CFLAGS_uts)
118 ASFLAGS_XARCH_32 = $(i386_ASFLAGS)
119 ASFLAGS_XARCH_64 = $(amd64_ASFLAGS)
120 ASFLAGS_XARCH = $(ASFLAGS_XARCH_$(CLASS))
122 ASFLAGS = $(ASFLAGS_XARCH)
123 ASFLAGS += $(ASFLAGS_uts)
125 AS_INC_PATH += -I$(DSF_DIR)/$(OBJS_DIR)
128 # The following must be defined for all implementations:
130 # UNIX_MAPFILE: ld mapfile for the build of kernel/unix.
131 # MODSTUBS: Module stubs source file.
132 # GENASSYM_SRC: genassym.c
134 UNIX_MAPFILE = $(UTSBASE)/$(PLATFORM)/conf/Mapfile
135 MODSTUBS = $(UTSBASE)/intel/ml/modstubs.S
136 GENASSYM_SRC = $(UTSBASE)/$(PLATFORM)/ml/genassym.c
137 OFFSETS_SRC = $(UTSBASE)/$(PLATFORM)/ml/offsets.in
138 PLATFORM_OFFSETS_SRC = $(UTSBASE)/intel/amd64/ml/mach_offsets.in
139 KDI_OFFSETS_SRC = $(UTSBASE)/intel/kdi/kdi_offsets.in
142 # Define the actual specific platforms
144 MACHINE_DEFS = -D$(PLATFORM) -D_MACHDEP
147 # Software workarounds for hardware "features"
150 include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds
155 # Special knowledge of which special debugging options effect which
156 # file is used to optimize the build if these flags are changed.
158 # XXX: The above could possibly be done for more flags and files, but
159 # is left as an experiment to the interested reader. Be forewarned,
160 # that excessive use could lead to maintenance difficulties.
163 DEBUG_DEFS_DBG32 = -DDEBUG
165 DEBUG_DEFS_DBG64 = -DDEBUG
166 DEBUG_DEFS = $(DEBUG_DEFS_$(BUILD_TYPE))
168 DEBUG_COND_OBJ32 = $(POUND_SIGN)
170 DEBUG_COND_OBJ64 = $(POUND_SIGN)
172 IF_DEBUG_OBJ = $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
174 $(IF_DEBUG_OBJ)trap.o := DEBUG_DEFS += -DTRAPDEBUG -DTRAPTRACE
175 $(IF_DEBUG_OBJ)syscall_asm_amd64.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
176 $(IF_DEBUG_OBJ)fast_trap_asm.o := DEBUG_DEFS += -DTRAPTRACE
177 $(IF_DEBUG_OBJ)interrupt.o := DEBUG_DEFS += -DTRAPTRACE
178 $(IF_DEBUG_OBJ)intr.o := DEBUG_DEFS += -DTRAPTRACE
179 $(IF_DEBUG_OBJ)locore.o := DEBUG_DEFS += -DTRAPTRACE
180 $(IF_DEBUG_OBJ)mp_startup.o := DEBUG_DEFS += -DTRAPTRACE
181 $(IF_DEBUG_OBJ)machdep.o := DEBUG_DEFS += -DTRAPTRACE
182 $(IF_DEBUG_OBJ)exception.o := DEBUG_DEFS += -DTRAPTRACE
183 $(IF_DEBUG_OBJ)x_call.o := DEBUG_DEFS += -DTRAPTRACE
184 $(IF_DEBUG_OBJ)mp_call.o := DEBUG_DEFS += -DTRAPTRACE
185 $(IF_DEBUG_OBJ)cbe.o := DEBUG_DEFS += -DTRAPTRACE
188 # Collect the preprocessor definitions to be associated with *all*
191 ALL_DEFS = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
193 GENASSYM_DEFS = $(MACHINE_DEFS) $(OPTION_DEFS) \
194 -_gcc=-fno-eliminate-unused-debug-symbols \
195 -_gcc=-fno-eliminate-unused-debug-types
198 # ----- TRANSITIONAL SECTION --------------------------------------------------
202 # Not everything which *should* be a module is a module yet. The
203 # following is a list of such objects which are currently part of
204 # the base kernel but should soon become kmods.
206 # XXX: $(KMACCT_OBJS) is neither in the MT kernel nor was it ever
207 # made into a module. If it is made MT safe before being made
208 # into a module, it should be added to this list. It was in
209 # this list pre ON-4.0.
212 MACH_NOT_YET_KMODS = $(AUTOCONF_OBJS)
215 # ----- END OF TRANSITIONAL SECTION -------------------------------------------
219 # The kernels modules which are "implementation architecture"
220 # specific for this machine are enumerated below. Note that most
221 # of these modules must exist (in one form or another) for each
224 # Machine Specific Driver Modules (/kernel/drv)
225 # DRV_KMODS are built both 32-bit and 64-bit
226 # DRV_KMODS_32 are built only 32-bit
227 # DRV_KMODS_64 are built only 64-bit
231 DRV_KMODS += pcplusmp
239 DRV_KMODS += acpi_drv
241 DRV_KMODS += amd_iommu
251 # Platform Power Modules
253 DRV_KMODS += ppm acpippm
258 CPU_KMODS += amd_opteron
259 CPU_KMODS += generic_cpu
260 CPU_KMODS += authenticamd
261 CPU_KMODS += genuineintel
264 # Exec Class Modules (/kernel/exec):
269 # Scheduling Class Modules (/kernel/sched):
274 # File System Modules (/kernel/fs):
279 # Streams Modules (/kernel/strmod):
284 # 'System' Modules (/kernel/sys):
289 # 'Misc' Modules (/kernel/misc):
291 MISC_KMODS += gfx_private pcie pci_prd
292 MISC_KMODS += acpidev
293 MISC_KMODS += drmach_acpi
296 # 'Dacf' modules (/kernel/dacf)
298 DACF_KMODS += consconfig_dacf
301 # 'Mach' Modules (/kernel/mach):