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 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 24 # Copyright (c) 2013 Andrew Stormont. All rights reserved. 25 # Copyright (c) 2015, 2017 by Delphix. All rights reserved. 26 # Copyright 2019 Joyent, Inc. 27 # Copyright 2016 Gary Mills 28 # Copyright 2016 Nexenta Systems, Inc. 29 # Copyright 2019 RackTop Systems 30 # 31 32 # 33 # This makefile contains the common definitions for all sparc 34 # implementation architecture independent modules. 35 # 36 37 # 38 # Define supported builds 39 # 40 DEF_BUILDS = $(DEF_BUILDS64) 41 ALL_BUILDS = $(ALL_BUILDS64) 42 43 # 44 # Everybody needs to know how to build modstubs.o and to locate unix.o. 45 # Note that unix.o must currently be selected from among the possible 46 # "implementation architectures". Note further, that unix.o is only 47 # used as an optional error check for undefines so (theoretically) 48 # any "implementation architectures" could be used. We choose sun4u 49 # because it is the reference port. 50 # 51 UNIX_DIR = $(UTSBASE)/sun4u/unix 52 GENLIB_DIR = $(UTSBASE)/sun4u/genunix 53 IPDRV_DIR = $(UTSBASE)/sparc/ip 54 MODSTUBS_DIR = $(UNIX_DIR) 55 DSF_DIR = $(UNIX_DIR) 56 LINTS_DIR = $(OBJS_DIR) 57 LINT_LIB_DIR = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR) 58 59 UNIX_O = $(UNIX_DIR)/$(OBJS_DIR)/unix.o 60 MODSTUBS_O = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o 61 GENLIB = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/libgenunix.so 62 63 LINT_LIB_32 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lunix.ln 64 GEN_LINT_LIB_32 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lgenunix.ln 65 66 LINT_LIB_64 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lunix.ln 67 GEN_LINT_LIB_64 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lgenunix.ln 68 69 LINT_LIB = $(LINT_LIB_$(CLASS)) 70 GEN_LINT_LIB = $(GEN_LINT_LIB_$(CLASS)) 71 72 LINT32_DIRS = $(LINT32_BUILDS:%=$(UTSBASE)/sparc/lint-libs/%) 73 LINT32_FILES = $(LINT32_DIRS:%=%/llib-l$(MODULE).ln) 74 75 LINT64_DIRS = $(LINT64_BUILDS:%=$(UTSBASE)/sparc/lint-libs/%) 76 LINT64_FILES = $(LINT64_DIRS:%=%/llib-l$(MODULE).ln) 77 78 # 79 # Include the makefiles which define build rule templates, the 80 # collection of files per module, and a few specific flags. Note 81 # that order is significant, just as with an include path. The 82 # first build rule template which matches the files name will be 83 # used. By including these in order from most machine dependent 84 # to most machine independent, we allow a machine dependent file 85 # to be used in preference over a machine independent version 86 # (Such as a machine specific optimization, which preserves the 87 # interfaces.) 88 # 89 include $(UTSBASE)/sparc/Makefile.files 90 include $(UTSBASE)/sparc/v9/Makefile.files 91 include $(UTSBASE)/sun/Makefile.files 92 include $(UTSBASE)/common/Makefile.files 93 94 # 95 # ----- TRANSITIONAL SECTION -------------------------------------------------- 96 # 97 98 # 99 # Not everything which *should* be a module is a module yet. The 100 # following is a list of such objects which are currently part of 101 # genunix but which might someday become kmods. This must be 102 # defined before we include Makefile.uts, or else genunix's build 103 # won't be as parallel as we might like. 104 # 105 NOT_YET_KMODS = $(OLDPTY_OBJS) $(PTY_OBJS) $(VCONS_CONF_OBJS) $(MOD_OBJS) 106 107 # 108 # ----- END OF TRANSITIONAL SECTION ------------------------------------------- 109 # 110 # Include machine independent rules. Note that this does not imply 111 # that the resulting module from rules in Makefile.uts is machine 112 # independent. Only that the build rules are machine independent. 113 # 114 include $(UTSBASE)/Makefile.uts 115 116 # 117 # machine specific optimization, override default in Makefile.master 118 # 119 XARCH_32 = -xarch=v8 120 XARCH_64 = -m64 121 XARCH = $(XARCH_$(CLASS)) 122 123 COPTIMIZE_32 = -xO3 124 COPTIMIZE_64 = -xO3 125 COPTIMIZE = $(COPTIMIZE_$(CLASS)) 126 127 CCMODE = -Xa 128 129 CFLAGS_32 = -xcg92 130 CFLAGS_64 = -xchip=ultra $(CCABS32) $(CCREGSYM) 131 CFLAGS = $(CFLAGS_$(CLASS)) 132 133 CFLAGS += $(XARCH) 134 CFLAGS += $(COPTIMIZE) 135 CFLAGS += $(EXTRA_CFLAGS) 136 CFLAGS += $(XAOPT) 137 CFLAGS += $(INLINES) -D_ASM_INLINES 138 CFLAGS += $(CCMODE) 139 CFLAGS += $(SPACEFLAG) 140 CFLAGS += $(CERRWARN) 141 CFLAGS += $(CTF_FLAGS_$(CLASS)) 142 CFLAGS += $(CSTD) 143 CFLAGS += $(CCUNBOUND) 144 CFLAGS += $(CCSTATICSYM) 145 CFLAGS += $(CC32BITCALLERS) 146 CFLAGS += $(CCNOAUTOINLINE) 147 CFLAGS += $(IROPTFLAG) 148 CFLAGS += $(CGLOBALSTATIC) 149 CFLAGS += -xregs=no%float 150 CFLAGS += -xstrconst 151 CFLAGS += $(CSOURCEDEBUGFLAGS) 152 CFLAGS += $(CUSERFLAGS) 153 154 ASFLAGS += $(XARCH) 155 156 LINT_DEFS_32 = 157 LINT_DEFS_64 = -m64 158 LINT_DEFS += $(LINT_DEFS_$(CLASS)) 159 160 # 161 # The following must be defined for all implementations: 162 # 163 # MODSTUBS: Module stubs source file. 164 # 165 MODSTUBS = $(UTSBASE)/sparc/ml/modstubs.s 166 167 # 168 # Define the actual specific platforms - obviously none. 169 # 170 MACHINE_DEFS = 171 172 # 173 # Debugging level 174 # 175 # Special knowledge of which special debugging options effect which 176 # file is used to optimize the build if these flags are changed. 177 # 178 # XXX: The above could possibly be done for more flags and files, but 179 # is left as an experiment to the interested reader. Be forewarned, 180 # that excessive use could lead to maintenance difficulties. 181 # 182 DEBUG_DEFS_OBJ32 = 183 DEBUG_DEFS_DBG32 = -DDEBUG 184 DEBUG_DEFS_OBJ64 = 185 DEBUG_DEFS_DBG64 = -DDEBUG 186 DEBUG_DEFS = $(DEBUG_DEFS_$(BUILD_TYPE)) 187 188 DEBUG_COND_OBJ32 = $(POUND_SIGN) 189 DEBUG_COND_DBG32 = 190 DEBUG_COND_OBJ64 = $(POUND_SIGN) 191 DEBUG_COND_DBG64 = 192 IF_DEBUG_OBJ = $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/ 193 194 $(IF_DEBUG_OBJ)syscall.o := DEBUG_DEFS += -DSYSCALLTRACE 195 $(IF_DEBUG_OBJ)clock.o := DEBUG_DEFS += -DKSLICE=1 196 197 # Comment these out if you don't want dispatcher lock statistics. 198 199 # $(IF_DEBUG_OBJ)disp_lock.o := DEBUG_DEFS += -DDISP_LOCK_STATS 200 201 # 202 # Collect the preprocessor definitions to be associated with *all* 203 # files. 204 # 205 ALL_DEFS = $(MACHINE_DEFS) $(DEBUG_DEFS) $(OPTION_DEFS) 206 207 # 208 # TCP congestion control modules (/kernel/cc) 209 # 210 MISC_KMODS += cc 211 CC_KMODS += cc_newreno cc_cubic cc_sunreno 212 213 # 214 # 215 # The kernels modules which are "implementation architecture" 216 # specific for this machine are enumerated below. Note that most 217 # of these modules must exist (in one form or another) for each 218 # architecture. 219 # 220 # Common Drivers (usually pseudo drivers) (/kernel/drv): 221 # 222 DRV_KMODS += aggr arp audio bl blkdev bofi clone cn conskbd consms cpuid 223 DRV_KMODS += crypto cryptoadm devinfo dump 224 DRV_KMODS += dtrace fasttrap fbt lockstat profile sdt systrace dcpc 225 DRV_KMODS += fssnap icmp icmp6 ip ip6 ipnet ipsecah 226 DRV_KMODS += ipsecesp iptun iwscn keysock kmdb kstat ksyms llc1 227 DRV_KMODS += lofi 228 DRV_KMODS += log logindmux kssl mm nca physmem pm poll pool 229 DRV_KMODS += pseudo ptc ptm pts ptsl ramdisk random rsm rts sad 230 DRV_KMODS += simnet softmac sppp sppptun sy sysevent sysmsg 231 DRV_KMODS += spdsock 232 DRV_KMODS += tcp tcp6 timerfd tl tnf ttymux udp udp6 wc winlock zcons 233 DRV_KMODS += ippctl 234 DRV_KMODS += dld 235 DRV_KMODS += ipd 236 DRV_KMODS += ipf 237 DRV_KMODS += rpcib 238 DRV_KMODS += dlpistub 239 DRV_KMODS += vnic 240 DRV_KMODS += xge 241 DRV_KMODS += rds 242 DRV_KMODS += rdsv3 243 DRV_KMODS += chxge 244 DRV_KMODS += smbsrv 245 DRV_KMODS += vscan 246 DRV_KMODS += nsmb 247 DRV_KMODS += fm 248 DRV_KMODS += nulldriver 249 DRV_KMODS += bridge trill 250 DRV_KMODS += bpf 251 DRV_KMODS += dca 252 DRV_KMODS += eventfd 253 DRV_KMODS += signalfd 254 DRV_KMODS += ufm 255 DRV_KMODS += ufmtest 256 257 # 258 # Hardware Drivers in common space 259 # 260 261 DRV_KMODS += afe 262 DRV_KMODS += audio1575 263 DRV_KMODS += audioens 264 DRV_KMODS += audiols 265 DRV_KMODS += audiop16x 266 DRV_KMODS += audiopci 267 DRV_KMODS += audiots 268 DRV_KMODS += bnxe 269 DRV_KMODS += e1000g 270 DRV_KMODS += efe 271 DRV_KMODS += hxge 272 DRV_KMODS += mxfe 273 DRV_KMODS += rge 274 DRV_KMODS += rtls 275 DRV_KMODS += sfe 276 DRV_KMODS += aac 277 DRV_KMODS += igb 278 DRV_KMODS += ixgbe 279 DRV_KMODS += vr 280 DRV_KMODS += mr_sas 281 DRV_KMODS += yge 282 283 # 284 # Machine Specific Driver Modules (/kernel/drv): 285 # 286 DRV_KMODS += audiocs 287 DRV_KMODS += bge dmfe eri fas hme qfe 288 DRV_KMODS += openeepr options sd ses st 289 DRV_KMODS += ssd 290 DRV_KMODS += ecpp 291 DRV_KMODS += hid hubd ehci ohci uhci usb_mid usb_ia scsa2usb usbprn ugen 292 DRV_KMODS += usbser usbsacm usbsksp usbsprl 293 DRV_KMODS += usb_as usb_ac 294 DRV_KMODS += usbskel 295 DRV_KMODS += usbvc 296 DRV_KMODS += usbftdi 297 DRV_KMODS += usbecm 298 DRV_KMODS += hci1394 av1394 scsa1394 dcam1394 299 DRV_KMODS += sbp2 300 DRV_KMODS += ib ibp eibnx eoib rdsib sdp iser daplt hermon tavor sol_ucma sol_uverbs 301 DRV_KMODS += sol_umad 302 DRV_KMODS += pci_pci pcieb pcieb_bcm 303 DRV_KMODS += i8042 kb8042 mouse8042 304 DRV_KMODS += fcode 305 DRV_KMODS += mpt_sas 306 DRV_KMODS += socal 307 DRV_KMODS += sgen 308 DRV_KMODS += myri10ge 309 DRV_KMODS += smp 310 DRV_KMODS += dad 311 DRV_KMODS += scsi_vhci 312 DRV_KMODS += fcp 313 DRV_KMODS += fcip 314 DRV_KMODS += fcsm 315 DRV_KMODS += fp 316 DRV_KMODS += qlc 317 DRV_KMODS += qlge 318 DRV_KMODS += stmf 319 DRV_KMODS += stmf_sbd 320 DRV_KMODS += fct 321 DRV_KMODS += fcoe 322 DRV_KMODS += fcoet 323 DRV_KMODS += fcoei 324 DRV_KMODS += qlt 325 DRV_KMODS += iscsit 326 DRV_KMODS += pppt 327 DRV_KMODS += iscsi 328 DRV_KMODS += emlxs 329 DRV_KMODS += oce 330 DRV_KMODS += srpt 331 DRV_KMODS += pmcs 332 DRV_KMODS += pmcs8001fw 333 334 # 335 # I/O framework test drivers 336 # 337 DRV_KMODS += pshot 338 DRV_KMODS += gen_drv 339 DRV_KMODS += tvhci tphci tclient 340 DRV_KMODS += emul64 341 342 # 343 # PCMCIA specific module(s) 344 # 345 DRV_KMODS += pcs 346 MISC_KMODS += busra cardbus dada pcmcia 347 DRV_KMODS += pcic 348 349 # 350 # Exec Class Modules (/kernel/exec): 351 # 352 EXEC_KMODS += aoutexec elfexec intpexec shbinexec javaexec 353 354 # 355 # Scheduling Class Modules (/kernel/sched): 356 # 357 SCHED_KMODS += RT TS RT_DPTBL TS_DPTBL IA FSS FX FX_DPTBL SDC 358 359 # 360 # File System Modules (/kernel/fs): 361 # 362 FS_KMODS += dev devfs fdfs fifofs hsfs lofs namefs nfs pcfs tmpfs zfs 363 FS_KMODS += zut specfs udfs ufs autofs procfs sockfs mntfs 364 FS_KMODS += ctfs objfs sharefs dcfs smbfs bootfs 365 366 # 367 # Streams Modules (/kernel/strmod): 368 # 369 STRMOD_KMODS += bufmod connld dedump ldterm ms pckt pfmod 370 STRMOD_KMODS += pipemod ptem redirmod rpcmod rlmod telmod timod 371 STRMOD_KMODS += spppasyn spppcomp 372 STRMOD_KMODS += tirdwr ttcompat 373 STRMOD_KMODS += usbkbm usbms usbwcm usb_ah 374 STRMOD_KMODS += drcompat 375 STRMOD_KMODS += cryptmod 376 STRMOD_KMODS += vuid3ps2 377 378 # 379 # 'System' Modules (/kernel/sys): 380 # 381 SYS_KMODS += c2audit 382 SYS_KMODS += exacctsys 383 SYS_KMODS += inst_sync kaio msgsys semsys shmsys sysacct pipe 384 SYS_KMODS += doorfs pset acctctl portfs 385 386 # 387 # 'User' Modules (/kernel/misc): 388 # 389 MISC_KMODS += ac97 390 MISC_KMODS += bignum 391 MISC_KMODS += consconfig gld ipc nfs_dlboot nfssrv scsi 392 MISC_KMODS += strplumb swapgeneric tlimod 393 MISC_KMODS += rpcsec rpcsec_gss kgssapi kmech_dummy 394 MISC_KMODS += kmech_krb5 395 MISC_KMODS += fssnap_if 396 MISC_KMODS += hidparser kbtrans usba usba10 usbs49_fw 397 MISC_KMODS += s1394 398 MISC_KMODS += hpcsvc pcihp 399 MISC_KMODS += rsmops 400 MISC_KMODS += sata 401 MISC_KMODS += kcf 402 MISC_KMODS += ksocket 403 MISC_KMODS += ibcm 404 MISC_KMODS += ibdm 405 MISC_KMODS += ibdma 406 MISC_KMODS += ibmf 407 MISC_KMODS += ibtl 408 MISC_KMODS += sol_ofs 409 MISC_KMODS += idm 410 MISC_KMODS += idmap 411 MISC_KMODS += hook 412 MISC_KMODS += neti 413 MISC_KMODS += ctf 414 MISC_KMODS += mac dls 415 MISC_KMODS += cmlb 416 MISC_KMODS += tem 417 MISC_KMODS += pcicfg fcodem fcpci 418 MISC_KMODS += scsi_vhci_f_sym scsi_vhci_f_tpgs 419 MISC_KMODS += scsi_vhci_f_sym_hds 420 MISC_KMODS += scsi_vhci_f_tape scsi_vhci_f_tpgs_tape 421 MISC_KMODS += fctl 422 MISC_KMODS += emlxs_fw 423 MISC_KMODS += qlc_fw_2200 424 MISC_KMODS += qlc_fw_2300 425 MISC_KMODS += qlc_fw_2400 426 MISC_KMODS += qlc_fw_2500 427 MISC_KMODS += qlc_fw_6322 428 MISC_KMODS += qlc_fw_8100 429 MISC_KMODS += mii 430 431 MISC_KMODS += klmmod klmops 432 433 # 434 # Software Cryptographic Providers (/kernel/crypto): 435 # 436 CRYPTO_KMODS += aes 437 CRYPTO_KMODS += arcfour 438 CRYPTO_KMODS += blowfish 439 CRYPTO_KMODS += des 440 CRYPTO_KMODS += ecc 441 CRYPTO_KMODS += edonr 442 CRYPTO_KMODS += md4 443 CRYPTO_KMODS += md5 444 CRYPTO_KMODS += rsa 445 CRYPTO_KMODS += sha1 446 CRYPTO_KMODS += sha2 447 CRYPTO_KMODS += skein 448 CRYPTO_KMODS += swrand 449 450 # 451 # IP Policy Modules (/kernel/ipp): 452 # 453 IPP_KMODS += dlcosmk 454 IPP_KMODS += flowacct 455 IPP_KMODS += ipgpc 456 IPP_KMODS += dscpmk 457 IPP_KMODS += tokenmt 458 IPP_KMODS += tswtclmt 459 460 # 461 # 'Dacf' modules (/kernel/dacf) 462 DACF_KMODS += consconfig_dacf 463 464 # 465 # SVVS Testing Modules (/kernel/strmod): 466 # 467 # These are streams and driver modules which are not to be 468 # delivered with a released system. However, during development 469 # it is convenient to build and install the SVVS kernel modules. 470 # 471 SVVS_KMODS += lmodb lmode lmodr lmodt svvslo tidg tivc tmux 472 473 # 474 # Modules eXcluded from the product: 475 # 476 XMODS += 477 478 # 479 # 'Dacf' Modules (/kernel/dacf): 480 # 481 DACF_KMODS += net_dacf 482 483 # 484 # MAC-Type Plugin Modules (/kernel/mac) 485 # 486 MAC_KMODS += mac_6to4 487 MAC_KMODS += mac_ether 488 MAC_KMODS += mac_ipv4 489 MAC_KMODS += mac_ipv6 490 MAC_KMODS += mac_wifi 491 MAC_KMODS += mac_ib 492 493 # 494 # socketmod (kernel/socketmod) 495 # 496 SOCKET_KMODS += sockpfp 497 SOCKET_KMODS += socksctp 498 SOCKET_KMODS += socksdp 499 SOCKET_KMODS += sockrds 500 SOCKET_KMODS += ksslf 501 502 # 503 # kiconv modules (/kernel/kiconv): 504 # 505 KICONV_KMODS += kiconv_emea kiconv_ja kiconv_ko kiconv_sc kiconv_tc 506 507 # 508 # Ensure that the variable member of the cpu_t (cpu_m) is defined 509 # for the lint builds so as not to cause lint errors during the 510 # global cross check. 511 # 512 $(LINTFLAGSUPPRESS)LINTFLAGS += -D_MACHDEP -I$(UTSBASE)/sun4 \ 513 -I$(UTSBASE)/sun4u -I$(UTSBASE)/sfmmu