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):
39 # Everybody needs to know how to build modstubs.o and to locate unix.o
41 UNIX_DIR = $(UTSBASE)/$(PLATFORM)/unix
42 GENLIB_DIR = $(UTSBASE)/intel/genunix
43 MODSTUBS_DIR = $(UNIX_DIR)
44 DSF_DIR = $(UTSBASE)/$(PLATFORM)/genassym
46 DTRACESTUBS_O = $(OBJS_DIR)/dtracestubs.o
47 DTRACESTUBS = $(OBJS_DIR)/libdtracestubs.so
49 SYM_MOD = $(OBJS_DIR)/unix.sym
51 UNIX_O = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
52 MODSTUBS_O = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
53 GENLIB = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
56 # Include the makefiles which define build rule templates, the
57 # collection of files per module, and a few specific flags. Note
58 # that order is significant, just as with an include path. The
59 # first build rule template which matches the files name will be
60 # used. By including these in order from most machine dependent
61 # to most machine independent, we allow a machine dependent file
62 # to be used in preference over a machine independent version
63 # (Such as a machine specific optimization, which preserves the
66 include $(UTSBASE)/$(PLATFORM)/Makefile.files
67 include $(UTSBASE)/intel/Makefile.files
68 include $(UTSBASE)/common/Makefile.files
71 # Include machine independent rules. Note that this does not imply
72 # that the resulting module from rules in Makefile.uts is machine
73 # independent. Only that the build rules are machine independent.
75 include $(UTSBASE)/Makefile.uts
78 # Define supported builds
80 DEF_BUILDS = $(DEF_BUILDS64)
81 ALL_BUILDS = $(ALL_BUILDS64)
84 # kernel-specific optimizations; override default in Makefile.master
87 CFLAGS_XARCH_32 = $(i386_CFLAGS)
88 CFLAGS_XARCH_64 = $(amd64_CFLAGS)
89 CFLAGS_XARCH = $(CFLAGS_XARCH_$(CLASS))
91 COPTFLAG_32 = $(COPTFLAG)
92 COPTFLAG_64 = $(COPTFLAG64)
93 COPTIMIZE = $(COPTFLAG_$(CLASS))
95 CFLAGS = $(CFLAGS_XARCH)
96 CFLAGS += $(COPTIMIZE)
97 CFLAGS += -D_ASM_INLINES
98 CFLAGS += $(CFLAGS_uts)
100 ASFLAGS_XARCH_32 = $(i386_ASFLAGS)
101 ASFLAGS_XARCH_64 = $(amd64_ASFLAGS)
102 ASFLAGS_XARCH = $(ASFLAGS_XARCH_$(CLASS))
104 ASFLAGS += $(ASFLAGS_XARCH)
106 AS_INC_PATH += -I$(DSF_DIR)/$(OBJS_DIR)
109 # The following must be defined for all implementations:
111 # MAPFILE: ld mapfile for the build of kernel/unix.
112 # MODSTUBS: Module stubs source file.
113 # GENASSYM_SRC: genassym.c
115 MAPFILE = $(SRCTOP)/arch/x86/kernel/mapfile-$(CLASS)
116 MODSTUBS = $(SRCTOP)/arch/x86/kernel/ml/modstubs.s
117 GENASSYM_SRC = $(UTSBASE)/$(PLATFORM)/ml/genassym.c
118 OFFSETS_SRC = $(SRCTOP)/arch/x86/kernel/offsets.in
119 PLATFORM_OFFSETS_SRC = $(SRCTOP)/arch/x86/kernel/mach_offsets_$(CLASS).in
120 KDI_OFFSETS_SRC = $(SRCTOP)/arch/x86/kernel/kdi/offsets.in
123 # Define the actual specific platforms
125 MACHINE_DEFS = -D$(PLATFORM) -D_MACHDEP
128 # Software workarounds for hardware "features"
131 include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds
136 # Special knowledge of which special debugging options effect which
137 # file is used to optimize the build if these flags are changed.
139 # XXX: The above could possibly be done for more flags and files, but
140 # is left as an experiment to the interested reader. Be forewarned,
141 # that excessive use could lead to maintenance difficulties.
144 DEBUG_DEFS_DBG32 = -DDEBUG
146 DEBUG_DEFS_DBG64 = -DDEBUG
147 DEBUG_DEFS = $(DEBUG_DEFS_$(BUILD_TYPE))
149 DEBUG_COND_OBJ32 = $(POUND_SIGN)
151 DEBUG_COND_OBJ64 = $(POUND_SIGN)
153 IF_DEBUG_OBJ = $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
155 $(IF_DEBUG_OBJ)trap.o := DEBUG_DEFS += -DTRAPDEBUG -DTRAPTRACE
156 $(IF_DEBUG_OBJ)syscall_asm.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
157 $(IF_DEBUG_OBJ)syscall_asm_amd64.o := DEBUG_DEFS += -DSYSCALLTRACE -DTRAPTRACE
158 $(IF_DEBUG_OBJ)fast_trap_asm.o := DEBUG_DEFS += -DTRAPTRACE
159 $(IF_DEBUG_OBJ)interrupt.o := DEBUG_DEFS += -DTRAPTRACE
160 $(IF_DEBUG_OBJ)intr.o := DEBUG_DEFS += -DTRAPTRACE
161 $(IF_DEBUG_OBJ)locore.o := DEBUG_DEFS += -DTRAPTRACE
162 $(IF_DEBUG_OBJ)mp_startup.o := DEBUG_DEFS += -DTRAPTRACE
163 $(IF_DEBUG_OBJ)machdep.o := DEBUG_DEFS += -DTRAPTRACE
164 $(IF_DEBUG_OBJ)exception.o := DEBUG_DEFS += -DTRAPTRACE
165 $(IF_DEBUG_OBJ)x_call.o := DEBUG_DEFS += -DTRAPTRACE
166 $(IF_DEBUG_OBJ)mp_call.o := DEBUG_DEFS += -DTRAPTRACE
167 $(IF_DEBUG_OBJ)cbe.o := DEBUG_DEFS += -DTRAPTRACE
170 # Collect the preprocessor definitions to be associated with *all*
173 ALL_DEFS = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
175 GENASSYM_DEFS = $(MACHINE_DEFS) $(OPTION_DEFS) \
176 -fno-eliminate-unused-debug-symbols \
177 -fno-eliminate-unused-debug-types
180 # ----- TRANSITIONAL SECTION --------------------------------------------------
184 # Not everything which *should* be a module is a module yet. The
185 # following is a list of such objects which are currently part of
186 # the base kernel but should soon become kmods.
188 # XXX: $(KMACCT_OBJS) is neither in the MT kernel nor was it ever
189 # made into a module. If it is made MT safe before being made
190 # into a module, it should be added to this list. It was in
191 # this list pre ON-4.0.
194 MACH_NOT_YET_KMODS = $(AUTOCONF_OBJS)
197 # ----- END OF TRANSITIONAL SECTION -------------------------------------------
201 # The kernels modules which are "implementation architecture"
202 # specific for this machine are enumerated below. Note that most
203 # of these modules must exist (in one form or another) for each
206 # Machine Specific Driver Modules (/kernel/drv)
207 # DRV_KMODS are built both 32-bit and 64-bit
208 # DRV_KMODS_32 are built only 32-bit
209 # DRV_KMODS_64 are built only 64-bit
213 DRV_KMODS += pcplusmp
221 DRV_KMODS += acpi_drv
223 DRV_KMODS += amd_iommu
232 # Platform Power Modules
234 DRV_KMODS += ppm acpippm
239 CPU_KMODS += amd_opteron
240 CPU_KMODS += generic_cpu
241 CPU_KMODS += authenticamd
242 CPU_KMODS += genuineintel
245 # Exec Class Modules (/kernel/exec):
250 # File System Modules (/kernel/fs):
255 # Streams Modules (/kernel/strmod):
260 # 'System' Modules (/kernel/sys):
265 # 'Misc' Modules (/kernel/misc):
267 MISC_KMODS += gfx_private pcie
268 MISC_KMODS += acpidev
269 MISC_KMODS += drmach_acpi
272 # 'Dacf' modules (/kernel/dacf)
274 DACF_KMODS += consconfig_dacf
277 # 'Mach' Modules (/kernel/mach):