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