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, Version 1.0 only 6# (the "License"). You may not use this file except in compliance 7# with the License. 8# 9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10# or http://www.opensolaris.org/os/licensing. 11# See the License for the specific language governing permissions 12# and limitations under the License. 13# 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# 22# 23# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24# Use is subject to license terms. 25# 26# ident "%Z%%M% %I% %E% SMI" 27# 28# This makefile contains the common definitions for the sun4v unix 29# and all sun4v implementation architecture dependent modules. 30# 31 32# 33# Machine type (implementation architecture): 34# 35PLATFORM = sun4v 36OPLATFORM = sun4u 37LINKED_PLATFORMS += SUNW,Sun-Fire-T1000 38PROMIF = ieee1275 39PSMBASE = $(UTSBASE)/../psm 40 41# 42# Definitions for the platform-specific /platform directories. 43# 44# PLATFORMS designates those sun4v machines which have no platform 45# specific code. 46# 47# IMPLEMENTATIONS is used to designate sun4v machines which have 48# platform specific modules. All code specific to a given implementation 49# resides in the appropriately named subdirectory. This requires 50# these platforms to have their own Makefiles to define ROOT_PLAT_DIRS, 51# USR_PLAT_DIRS, etc. 52# The number of IMPLEMENTATIONS should not grow! 53# 54# So if we had an implementation named 'foo', we would need the following 55# Makefiles in the foo subdirectory: 56# 57# sun4v/foo/Makefile 58# sun4v/foo/Makefile.foo 59# sun4v/foo/Makefile.targ 60# 61 62# 63# all PLATFORMS that do not belong in the $(IMPLEMENTATIONS) list. 64# This list should be empty. A platform without platform modules 65# is a plain, generic sun4v platform. 66# 67#IMPLEMENTED_PLATFORM = 68#PLATFORMS = $(IMPLEMENTED_PLATFORM) 69 70# IMPLEMENTATIONS is used by Install.sh, must not use backslash to continue 71# the lines. 72IMPLEMENTATIONS = ontario 73 74#ROOT_PLAT_DIRS = $(PLATFORMS:%=$(ROOT_PLAT_DIR)/%) 75#USR_PLAT_DIRS = $(PLATFORMS:%=$(USR_PLAT_DIR)/%) 76 77#USR_DESKTOP_DIR = $(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM) 78#USR_DESKTOP_INC_DIR = $(USR_DESKTOP_DIR)/include 79#USR_DESKTOP_SBIN_DIR = $(USR_DESKTOP_DIR)/sbin 80#USR_DESKTOP_LIB_DIR = $(USR_DESKTOP_DIR)/lib 81 82# 83# Define supported builds 84# 85DEF_BUILDS = $(DEF_BUILDS64) 86ALL_BUILDS = $(ALL_BUILDS64) 87 88# 89# Everybody needs to know how to build modstubs.o and to locate unix.o 90# 91UNIX_DIR = $(UTSBASE)/$(PLATFORM)/unix 92GENLIB_DIR = $(UTSBASE)/$(PLATFORM)/genunix 93MODSTUBS_DIR = $(UNIX_DIR) 94DSF_DIR = $(UTSBASE)/$(PLATFORM)/genassym 95LINTS_DIR = $(OBJS_DIR) 96LINT_LIB_DIR = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR) 97 98DTRACESTUBS_O = $(OBJS_DIR)/dtracestubs.o 99DTRACESTUBS = $(OBJS_DIR)/libdtracestubs.so 100 101UNIX_O = $(UNIX_DIR)/$(OBJS_DIR)/unix.o 102MODSTUBS_O = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o 103GENLIB = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so 104 105LINT_LIB = $(LINT_LIB_DIR)/llib-lunix.ln 106GEN_LINT_LIB = $(LINT_LIB_DIR)/llib-lgenunix.ln 107 108LINT64_DIRS = $(LINT64_BUILDS:%=$(UTSBASE)/$(PLATFORM)/lint-libs/%) 109LINT64_FILES = $(LINT64_DIRS:%=%/llib-l$(MODULE).ln) 110 111# 112# cpu and platform modules need to know how to build their own symcheck module 113# 114PLATMOD = platmod 115PLATLIB = $(PLAT_DIR)/$(OBJS_DIR)/libplatmod.so 116 117CPUNAME = cpu 118CPULIB = $(CPU_DIR)/$(OBJS_DIR)/libcpu.so 119 120SYM_MOD = $(OBJS_DIR)/unix.sym 121 122# 123# Include the makefiles which define build rule templates, the 124# collection of files per module, and a few specific flags. Note 125# that order is significant, just as with an include path. The 126# first build rule template which matches the files name will be 127# used. By including these in order from most machine dependent 128# to most machine independent, we allow a machine dependent file 129# to be used in preference over a machine independent version 130# (Such as a machine specific optimization, which preserves the 131# interfaces.) 132# 133include $(UTSBASE)/sun4/Makefile.files 134include $(UTSBASE)/$(PLATFORM)/Makefile.files 135include $(UTSBASE)/sfmmu/Makefile.files 136include $(UTSBASE)/sparc/v9/Makefile.files 137include $(UTSBASE)/sparc/Makefile.files 138include $(UTSBASE)/sun/Makefile.files 139include $(SRC)/psm/promif/$(PROMIF)/common/Makefile.files 140include $(SRC)/psm/promif/$(PROMIF)/$(PLATFORM)/Makefile.files 141include $(UTSBASE)/common/Makefile.files 142 143# 144# Include machine independent rules. Note that this does not imply 145# that the resulting module from rules in Makefile.uts is machine 146# independent. Only that the build rules are machine independent. 147# 148include $(UTSBASE)/Makefile.uts 149 150CTFMERGE_GUDIR = sun4v 151 152# 153# machine specific optimization, override default in Makefile.master 154# 155QTOOLS_ROOT= $(SPRO_ROOT)/sun4v 156sparc_AS= $(QTOOLS_ROOT)/qas -xregsym=no 157sparcv9_AS= $(QTOOLS_ROOT)/qas -xregsym=no 158 159CC_XARCH = -xarch=v9a 160AS_XARCH = -xarch=v9d 161COPTIMIZE = -xO3 162CCMODE = -Xa 163 164CFLAGS = -xchip=ultra $(CCABS32) $(CCREGSYM) 165CFLAGS += $(CC_XARCH) 166CFLAGS += $(COPTIMIZE) 167CFLAGS += $(EXTRA_CFLAGS) 168CFLAGS += $(XAOPT) 169CFLAGS += $(INLINES) 170CFLAGS += $(CCMODE) 171CFLAGS += $(SPACEFLAG) 172CFLAGS += $(CERRWARN) 173CFLAGS += $(CTF_FLAGS) 174CFLAGS += $(C99MODE) 175CFLAGS += $(CCUNBOUND) 176CFLAGS += -xregs=no%float 177CPPFLAGS += -DGLREG 178 179ASFLAGS += $(AS_XARCH) -DGLREG 180 181AS_INC_PATH += -I$(DSF_DIR)/$(OBJS_DIR) 182 183LINT_KMODS += $(GENUNIX_KMODS) 184 185LINT_DEFS = -Xarch=v9 186 187# 188# The following must be defined for all implementations: 189# 190# MAPFILE: ld mapfile for the build of kernel/unix. 191# MODSTUBS: Module stubs source file. 192# GENCONST_SRC: genconst.c 193# OFFSETS: offsets.in 194# PLATFORM_OFFSETS: Platform specific mach_offsets.in 195# FDOFFSETS: fd_offsets.in 196# 197MAPFILE = $(UTSBASE)/$(OPLATFORM)/conf/Mapfile 198MODSTUBS = $(UTSBASE)/sparc/ml/modstubs.s 199GENCONST_SRC = $(UTSBASE)/sun4/ml/genconst.c 200OFFSETS = $(UTSBASE)/sun4/ml/offsets.in 201PLATFORM_OFFSETS = $(UTSBASE)/sun4v/ml/mach_offsets.in 202FDOFFSETS = $(UTSBASE)/sun/io/fd_offsets.in 203 204# 205# Define the actual specific platforms 206# 207 208MACHINE_DEFS = -D$(PLATFORM) -D_MACHDEP -DSFMMU 209 210$(MPSAS_BUILD)MACHINE_DEFS += -DMPSAS 211 212# 213# Software workarounds for hardware "features" 214# 215 216include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds 217 218# 219# Debugging level 220# 221# Special knowledge of which special debugging options effect which 222# file is used to optimize the build if these flags are changed. 223# 224# XXX: The above could possibly be done for more flags and files, but 225# is left as an experiment to the interested reader. Be forewarned, 226# that excessive use could lead to maintenance difficulties. 227# 228# Note: kslice can be enabled for the sun4v, but is disabled by default 229# in all cases. 230# 231 232DEBUG_DEFS_OBJ64 = 233DEBUG_DEFS_DBG64 = -DDEBUG 234DEBUG_DEFS = $(DEBUG_DEFS_$(BUILD_TYPE)) 235 236DEBUG_COND_OBJ64 :sh = echo \\043 237DEBUG_COND_DBG64 = 238IF_DEBUG_OBJ = $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/ 239 240$(IF_DEBUG_OBJ)trap.o := DEBUG_DEFS += -DTRAPDEBUG 241$(IF_DEBUG_OBJ)mach_trap.o := DEBUG_DEFS += -DTRAPDEBUG 242$(IF_DEBUG_OBJ)syscall_trap.o := DEBUG_DEFS += -DSYSCALLTRACE 243$(IF_DEBUG_OBJ)clock.o := DEBUG_DEFS += -DKSLICE=0 244 245IF_TRAPTRACE_OBJ = $(IF_DEBUG_OBJ) 246# comment this out for a non-debug kernel with TRAPTRACE 247#IF_TRAPTRACE_OBJ = $(OBJS_DIR)/ 248 249$(IF_TRAPTRACE_OBJ)locore.o := DEBUG_DEFS += -DTRAPTRACE 250$(IF_TRAPTRACE_OBJ)mach_locore.o := DEBUG_DEFS += -DTRAPTRACE 251$(IF_TRAPTRACE_OBJ)mlsetup.o := DEBUG_DEFS += -DTRAPTRACE 252$(IF_TRAPTRACE_OBJ)syscall_trap.o := DEBUG_DEFS += -DTRAPTRACE 253$(IF_TRAPTRACE_OBJ)startup.o := DEBUG_DEFS += -DTRAPTRACE 254$(IF_TRAPTRACE_OBJ)mach_startup.o := DEBUG_DEFS += -DTRAPTRACE 255$(IF_TRAPTRACE_OBJ)mp_startup.o := DEBUG_DEFS += -DTRAPTRACE 256$(IF_TRAPTRACE_OBJ)mach_mp_startup.o := DEBUG_DEFS += -DTRAPTRACE 257$(IF_TRAPTRACE_OBJ)cpu_states.o := DEBUG_DEFS += -DTRAPTRACE 258$(IF_TRAPTRACE_OBJ)mach_cpu_states.o := DEBUG_DEFS += -DTRAPTRACE 259$(IF_TRAPTRACE_OBJ)interrupt.o := DEBUG_DEFS += -DTRAPTRACE 260$(IF_TRAPTRACE_OBJ)mach_interrupt.o := DEBUG_DEFS += -DTRAPTRACE 261$(IF_TRAPTRACE_OBJ)mach_sfmmu_asm.o := DEBUG_DEFS += -DTRAPTRACE 262$(IF_TRAPTRACE_OBJ)sfmmu_asm.o := DEBUG_DEFS += -DTRAPTRACE 263$(IF_TRAPTRACE_OBJ)trap_table.o := DEBUG_DEFS += -DTRAPTRACE 264$(IF_TRAPTRACE_OBJ)xc.o := DEBUG_DEFS += -DTRAPTRACE 265$(IF_TRAPTRACE_OBJ)mach_xc.o := DEBUG_DEFS += -DTRAPTRACE 266$(IF_TRAPTRACE_OBJ)wbuf.o := DEBUG_DEFS += -DTRAPTRACE 267$(IF_TRAPTRACE_OBJ)trap.o := DEBUG_DEFS += -DTRAPTRACE 268$(IF_TRAPTRACE_OBJ)mach_trap.o := DEBUG_DEFS += -DTRAPTRACE 269$(IF_TRAPTRACE_OBJ)cheetah_asm.o := DEBUG_DEFS += -DTRAPTRACE 270 271# Comment these out if you don't want dispatcher lock statistics. 272 273#$(IF_DEBUG_OBJ)lock_prim.o := DEBUG_DEFS += -DDISP_LOCK_STATS 274#$(IF_DEBUG_OBJ)disp.o := DEBUG_DEFS += -DDISP_LOCK_STATS 275 276# Comment these out if you don't want dispatcher debugging 277 278#$(IF_DEBUG_OBJ)lock_prim.o := DEBUG_DEFS += -DDISP_DEBUG 279 280# 281# Build `options'. These are mostly historical and the need for these 282# is largely removed by the module technology. However, the static 283# build will continue to require these. 284# 285OPTION_DEFS = -DC2_AUDIT 286 287# 288# Collect the preprocessor definitions to be associated with *all* 289# files. 290# 291ALL_DEFS = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \ 292 $(OPTION_DEFS) 293GENCONST_DEFS = $(MACHINE_DEFS) $(OPTION_DEFS) 294 295# 296# ----- TRANSITIONAL SECTION -------------------------------------------------- 297# 298 299# 300# Not everything which *should* be a module is a module yet. The 301# following is a list of such objects which are currently part of 302# the base kernel but should soon become kmods. 303# 304MACH_NOT_YET_KMODS = $(AUTOCONF_OBJS) 305 306# 307# ----- END OF TRANSITIONAL SECTION ------------------------------------------- 308# 309 310# 311# The kernels modules which are "implementation architecture" 312# specific for this machine are enumerated below. Note that most 313# of these modules must exist (in one form or another) for each 314# architecture. 315# 316# Common Drivers (usually pseudo drivers) (/kernel/drv): 317# 318 319# 320# Machine Specific Driver Modules (/kernel/drv): 321# 322DRV_KMODS += vnex 323DRV_KMODS += qcn 324DRV_KMODS += dma 325DRV_KMODS += cpc 326DRV_KMODS += rootnex 327DRV_KMODS += trapstat 328DRV_KMODS += px 329DRV_KMODS += glvc 330DRV_KMODS += bge 331DRV_KMODS += mdesc 332DRV_KMODS += ncp 333DRV_KMODS += ebus 334DRV_KMODS += su 335# 336# Exec Class Modules (/kernel/exec): 337# 338EXEC_KMODS += 339 340# 341# Scheduling Class Modules (/kernel/sched): 342# 343SCHED_KMODS += 344 345# 346# File System Modules (/kernel/fs): 347# 348FS_KMODS += 349 350# 351# Streams Modules (/kernel/strmod): 352# 353# STRMOD_KMODS += kb 354 355# 356# 'System' Modules (/kernel/sys): 357# 358SYS_KMODS += 359 360# 361# 'User' Modules (/kernel/misc): 362# 363MISC_KMODS += obpsym bootdev vis platmod 364 365# 366# generic-unix module (/kernel/genunix): 367# 368GENUNIX_KMODS += genunix 369 370# 'User' "Modules" excluded from the Full Kernel lint target: 371# 372NLMISC_KMODS += forthdebug 373 374# 375# Modules eXcluded from the product: 376# 377XMODS += 378 379# 380# cpu modules 381# 382CPU_KMODS += generic niagara 383 384# 385# Performance Counter BackEnd Modules (/usr/kernel/pcbe): 386# 387PCBE_KMODS += niagara_pcbe 388