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