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.
29 # This makefile contains the common definitions for the i86pc unix
30 # and all i86pc implementation architecture dependent modules.
34 # Machine type (implementation architecture):
44 # Definitions for the platform-specific /platform directories.
46 # IMPLEMENTATIONS is used to designate i86pc machines which have
47 # platform specific modules. All code specific to a given implementation
48 # resides in the appropriately named subdirectory. This requires
49 # these platforms to have their own Makefiles to define ROOT_PLAT_DIRS,
52 IMPLEMENTATIONS = i86hvm
55 # Everybody needs to know how to build modstubs.o and to locate unix.o
57 UNIX_DIR = $(UTSBASE)/$(PLATFORM)/unix
58 GENLIB_DIR = $(UTSBASE)/intel/genunix
59 MODSTUBS_DIR = $(UNIX_DIR)
60 DSF_DIR = $(UTSBASE)/$(PLATFORM)/genassym
61 LINTS_DIR = $(OBJS_DIR)
62 LINT_LIB_DIR = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
63 GEN_LINT_LIB_DIR = $(UTSBASE)/intel/lint-libs/$(OBJS_DIR)
65 LINT32_DIRS = $(LINT32_BUILDS:%=$(UTSBASE)/$(PLATFORM)/lint-libs/%)
66 LINT32_FILES = $(LINT32_DIRS:%=%/llib-l$(MODULE).ln)
68 DTRACESTUBS_O = $(OBJS_DIR)/dtracestubs.o
69 DTRACESTUBS = $(OBJS_DIR)/libdtracestubs.so
71 SYM_MOD = $(OBJS_DIR)/unix.sym
73 UNIX_O = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
74 MODSTUBS_O = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
75 GENLIB = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
76 LINT_LIB = $(LINT_LIB_DIR)/llib-lunix.ln
77 DBOOT_LINT_LIB = $(LINT_LIB_DIR)/llib-ldboot.ln
78 GEN_LINT_LIB = $(GEN_LINT_LIB_DIR)/llib-lgenunix.ln
81 # Include the makefiles which define build rule templates, the
82 # collection of files per module, and a few specific flags. Note
83 # that order is significant, just as with an include path. The
84 # first build rule template which matches the files name will be
85 # used. By including these in order from most machine dependent
86 # to most machine independent, we allow a machine dependent file
87 # to be used in preference over a machine independent version
88 # (Such as a machine specific optimization, which preserves the
91 include $(UTSBASE)/$(PLATFORM)/Makefile.files
92 include $(UTSBASE)/intel/Makefile.files
93 include $(UTSBASE)/common/Makefile.files
96 # Include machine independent rules. Note that this does not imply
97 # that the resulting module from rules in Makefile.uts is machine
98 # independent. Only that the build rules are machine independent.
100 include $(UTSBASE)/Makefile.uts
103 # Define supported builds
105 DEF_BUILDS = $(DEF_BUILDS64) $(DEF_BUILDS32)
106 ALL_BUILDS = $(ALL_BUILDS64) $(ALL_BUILDS32)
109 # x86 or amd64 inline templates
111 INLINES_32 = $(UTSBASE)/intel/ia32/ml/ia32.il \
112 $(UTSBASE)/$(PLATFORM)/ml/ia32.il
113 INLINES_64 = $(UTSBASE)/intel/amd64/ml/amd64.il \
114 $(UTSBASE)/$(PLATFORM)/ml/amd64.il
115 INLINES += $(INLINES_$(CLASS))
118 # kernel-specific optimizations; override default in Makefile.master
121 CFLAGS_XARCH_32 = $(i386_CFLAGS)
122 CFLAGS_XARCH_64 = $(amd64_CFLAGS)
123 CFLAGS_XARCH = $(CFLAGS_XARCH_$(CLASS))
125 COPTFLAG_32 = $(COPTFLAG)
126 COPTFLAG_64 = $(COPTFLAG64)
127 COPTIMIZE = $(COPTFLAG_$(CLASS))
129 CFLAGS = $(CFLAGS_XARCH)
130 CFLAGS += $(COPTIMIZE)
131 CFLAGS += $(INLINES) -D_ASM_INLINES
133 CFLAGS += $(SPACEFLAG)
134 CFLAGS += $(CCUNBOUND)
135 CFLAGS += $(CFLAGS_uts)
138 ASFLAGS_XARCH_32 = $(i386_ASFLAGS)
139 ASFLAGS_XARCH_64 = $(amd64_ASFLAGS)
140 ASFLAGS_XARCH = $(ASFLAGS_XARCH_$(CLASS))
142 ASFLAGS += $(ASFLAGS_XARCH)
144 AS_INC_PATH += -I$(DSF_DIR)/$(OBJS_DIR)
147 # The following must be defined for all implementations:
149 # MAPFILE: ld mapfile for the build of kernel/unix.
150 # MODSTUBS: Module stubs source file.
151 # GENASSYM_SRC: genassym.c
153 MAPFILE = $(UTSBASE)/$(PLATFORM)/conf/Mapfile
154 MODSTUBS = $(UTSBASE)/intel/ia32/ml/modstubs.s
155 GENASSYM_SRC = $(UTSBASE)/$(PLATFORM)/ml/genassym.c
156 OFFSETS_SRC = $(UTSBASE)/$(PLATFORM)/ml/offsets.in
157 PLATFORM_OFFSETS_32 = $(UTSBASE)/$(PLATFORM)/ml/mach_offsets.in
158 PLATFORM_OFFSETS_64 = $(UTSBASE)/intel/amd64/ml/mach_offsets.in
159 PLATFORM_OFFSETS_SRC = $(PLATFORM_OFFSETS_$(CLASS))
160 KDI_OFFSETS_SRC = $(UTSBASE)/intel/kdi/kdi_offsets.in
163 # Define the actual specific platforms
165 MACHINE_DEFS = -D$(PLATFORM) -D_MACHDEP
168 # Software workarounds for hardware "features"
171 include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds
176 # Special knowledge of which special debugging options effect which
177 # file is used to optimize the build if these flags are changed.
179 # XXX: The above could possibly be done for more flags and files, but
180 # is left as an experiment to the interested reader. Be forewarned,
181 # that excessive use could lead to maintenance difficulties.
184 DEBUG_DEFS_DBG32 = -DDEBUG
186 DEBUG_DEFS_DBG64 = -DDEBUG
187 DEBUG_DEFS = $(DEBUG_DEFS_$(BUILD_TYPE))
189 DEBUG_COND_OBJ32 = $(POUND_SIGN)
191 DEBUG_COND_OBJ64 = $(POUND_SIGN)
193 IF_DEBUG_OBJ = $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
195 $(IF_DEBUG_OBJ)trap.o := DEBUG_DEFS += -DTRAPDEBUG -DTRAPTRACE
196 $(IF_DEBUG_OBJ)syscall_asm.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
197 $(IF_DEBUG_OBJ)syscall_asm_amd64.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
198 $(IF_DEBUG_OBJ)fast_trap_asm.o := DEBUG_DEFS += -DTRAPTRACE
199 $(IF_DEBUG_OBJ)interrupt.o := DEBUG_DEFS += -DTRAPTRACE
200 $(IF_DEBUG_OBJ)intr.o := DEBUG_DEFS += -DTRAPTRACE
201 $(IF_DEBUG_OBJ)locore.o := DEBUG_DEFS += -DTRAPTRACE
202 $(IF_DEBUG_OBJ)mp_startup.o := DEBUG_DEFS += -DTRAPTRACE
203 $(IF_DEBUG_OBJ)machdep.o := DEBUG_DEFS += -DTRAPTRACE
204 $(IF_DEBUG_OBJ)exception.o := DEBUG_DEFS += -DTRAPTRACE
205 $(IF_DEBUG_OBJ)x_call.o := DEBUG_DEFS += -DTRAPTRACE
206 $(IF_DEBUG_OBJ)mp_call.o := DEBUG_DEFS += -DTRAPTRACE
207 $(IF_DEBUG_OBJ)cbe.o := DEBUG_DEFS += -DTRAPTRACE
210 # Collect the preprocessor definitions to be associated with *all*
213 ALL_DEFS = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
215 GENASSYM_DEFS = $(MACHINE_DEFS) $(OPTION_DEFS) \
216 -_gcc=-fno-eliminate-unused-debug-symbols \
217 -_gcc=-fno-eliminate-unused-debug-types
220 # ----- TRANSITIONAL SECTION --------------------------------------------------
224 # Not everything which *should* be a module is a module yet. The
225 # following is a list of such objects which are currently part of
226 # the base kernel but should soon become kmods.
228 # XXX: $(KMACCT_OBJS) is neither in the MT kernel nor was it ever
229 # made into a module. If it is made MT safe before being made
230 # into a module, it should be added to this list. It was in
231 # this list pre ON-4.0.
234 MACH_NOT_YET_KMODS = $(AUTOCONF_OBJS)
237 # ----- END OF TRANSITIONAL SECTION -------------------------------------------
241 # The kernels modules which are "implementation architecture"
242 # specific for this machine are enumerated below. Note that most
243 # of these modules must exist (in one form or another) for each
246 # Machine Specific Driver Modules (/kernel/drv)
247 # DRV_KMODS are built both 32-bit and 64-bit
248 # DRV_KMODS_32 are built only 32-bit
249 # DRV_KMODS_64 are built only 64-bit
253 DRV_KMODS += pcplusmp
261 DRV_KMODS += acpi_drv
263 DRV_KMODS += amd_iommu
272 # Platform Power Modules
274 DRV_KMODS += ppm acpippm
279 CPU_KMODS += amd_opteron
280 CPU_KMODS += generic_cpu
281 CPU_KMODS += authenticamd
282 CPU_KMODS += genuineintel
285 # Exec Class Modules (/kernel/exec):
290 # Scheduling Class Modules (/kernel/sched):
295 # File System Modules (/kernel/fs):
300 # Streams Modules (/kernel/strmod):
305 # 'System' Modules (/kernel/sys):
310 # 'Misc' Modules (/kernel/misc):
312 MISC_KMODS += gfx_private pcie
313 MISC_KMODS += acpidev
314 MISC_KMODS += drmach_acpi
317 # 'Dacf' modules (/kernel/dacf)
319 DACF_KMODS += consconfig_dacf
322 # 'Mach' Modules (/kernel/mach):