diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 4c9c160d89a0..e6a1fc52a23e 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,1798 +1,1795 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd November 16, 2022 +.Dd November 18, 2022 .Dt SRC.CONF 5 .Os .Sh NAME .Nm src.conf .Nd "source build options" .Sh DESCRIPTION The .Nm file contains variables that control what components will be generated during the build process of the .Fx source tree; see .Xr build 7 . .Pp The .Nm file uses the standard makefile syntax. However, .Nm should not specify any dependencies to .Xr make 1 . Instead, .Nm is to set .Xr make 1 variables that control the aspects of how the system builds. .Pp The default location of .Nm is .Pa /etc/src.conf , though an alternative location can be specified in the .Xr make 1 variable .Va SRCCONF . Overriding the location of .Nm may be necessary if the system-wide settings are not suitable for a particular build. For instance, setting .Va SRCCONF to .Pa /dev/null effectively resets all build controls to their defaults. .Pp The only purpose of .Nm is to control the compilation of the .Fx source code, which is usually located in .Pa /usr/src . As a rule, the system administrator creates .Nm when the values of certain control variables need to be changed from their defaults. .Pp In addition, control variables can be specified for a particular build via the .Fl D option of .Xr make 1 or in its environment; see .Xr environ 7 . .Pp The environment of .Xr make 1 for the build can be controlled via the .Va SRC_ENV_CONF variable, which defaults to .Pa /etc/src-env.conf . Some examples that may only be set in this file are .Va WITH_DIRDEPS_BUILD , and .Va WITH_META_MODE , and .Va MAKEOBJDIRPREFIX as they are environment-only variables. .Pp The values of variables are ignored regardless of their setting; even if they would be set to .Dq Li FALSE or .Dq Li NO . The presence of an option causes it to be honored by .Xr make 1 . .Pp This list provides a name and short description for variables that can be used for source builds. .Bl -tag -width indent .It Va WITHOUT_ACCT Do not build process accounting tools such as .Xr accton 8 and .Xr sa 8 . .It Va WITHOUT_ACPI Do not build .Xr acpiconf 8 , .Xr acpidump 8 and related programs. .It Va WITHOUT_APM Do not build .Xr apm 8 , .Xr apmd 8 and related programs. .It Va WITH_ASAN Build the base system with Address Sanitizer (ASan) to detect memory corruption bugs such as buffer overflows or use-after-free. Requires that Clang be used as the base system compiler and that the runtime support library is available. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITH_LLVM_BINUTILS .It .Va WITH_LLVM_CXXFILT .El .It Va WITHOUT_ASSERT_DEBUG Compile programs and libraries without the .Xr assert 3 checks. .It Va WITHOUT_AT Do not build .Xr at 1 and related utilities. .It Va WITHOUT_ATM Do not build programs and libraries related to ATM networking. .It Va WITHOUT_AUDIT Do not build audit support into system programs. .It Va WITHOUT_AUTHPF Do not build .Xr authpf 8 . .It Va WITHOUT_AUTOFS Do not build .Xr autofs 5 related programs, libraries, and kernel modules. .It Va WITHOUT_AUTO_OBJ Disable automatic creation of objdirs. This is enabled by default if the wanted OBJDIR is writable by the current user. .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITH_BEARSSL Build the BearSSL library. .Pp BearSSL is a tiny SSL library suitable for embedded environments. For details see .Lk https://www.BearSSL.org/ .Pp This library is currently only used to perform signature verification and related operations for Verified Exec and .Xr loader 8 . When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITH_LOADER_EFI_SECUREBOOT (unless .Va WITHOUT_LOADER_EFI_SECUREBOOT is set explicitly) .It Va WITH_LOADER_VERIEXEC (unless .Va WITHOUT_LOADER_VERIEXEC is set explicitly) .It Va WITH_LOADER_VERIEXEC_VECTX (unless .Va WITHOUT_LOADER_VERIEXEC_VECTX is set explicitly) .It Va WITH_VERIEXEC (unless .Va WITHOUT_VERIEXEC is set explicitly) .El .It Va WITHOUT_BHYVE Do not build or install .Xr bhyve 8 , associated utilities, and examples. .Pp This option only affects amd64/amd64. .It Va WITH_BHYVE_SNAPSHOT Include support for save and restore (snapshots) in .Xr bhyve 8 and .Xr bhyvectl 8 . .Pp This option only affects amd64/amd64. .It Va WITH_BIND_NOW Build all binaries with the .Dv DF_BIND_NOW flag set to indicate that the run-time loader should perform all relocation processing at process startup rather than on demand. The combination of the .Va BIND_NOW and .Va RELRO options provide "full" Relocation Read-Only (RELRO) support. With full RELRO the entire GOT is made read-only after performing relocation at startup, avoiding GOT overwrite attacks. .It Va WITHOUT_BLACKLIST Set this if you do not want to build .Xr blacklistd 8 and .Xr blacklistctl 8 . When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_BLACKLIST_SUPPORT (unless .Va WITH_BLACKLIST_SUPPORT is set explicitly) .El .It Va WITHOUT_BLACKLIST_SUPPORT Build some programs without .Xr libblacklist 3 support, like .Xr fingerd 8 , .Xr ftpd 8 , and .Xr sshd 8 . .It Va WITHOUT_BLUETOOTH Do not build Bluetooth related kernel modules, programs and libraries. .It Va WITHOUT_BOOT Do not build the boot blocks and loader. .It Va WITHOUT_BOOTPARAMD Do not build or install .Xr bootparamd 8 . .It Va WITHOUT_BOOTPD Do not build or install .Xr bootpd 8 . .It Va WITHOUT_BSDINSTALL Do not build .Xr bsdinstall 8 , .Xr sade 8 , and related programs. .It Va WITHOUT_BSD_CPIO Do not build the BSD licensed version of cpio based on .Xr libarchive 3 . .It Va WITHOUT_BSNMP Do not build or install .Xr bsnmpd 1 and related libraries and data files. .It Va WITHOUT_BZIP2 Do not build contributed bzip2 software as a part of the base system. .Bf -symbolic The option has no effect yet. .Ef When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_BZIP2_SUPPORT (unless .Va WITH_BZIP2_SUPPORT is set explicitly) .El .It Va WITHOUT_BZIP2_SUPPORT Build some programs without optional bzip2 support. .It Va WITHOUT_CALENDAR Do not build .Xr calendar 1 . .It Va WITHOUT_CAPSICUM Do not build Capsicum support into system programs. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CASPER .El .It Va WITHOUT_CAROOT Do not add the trusted certificates from the Mozilla NSS bundle to base. .It Va WITHOUT_CASPER Do not build Casper program and related libraries. .It Va WITH_CCACHE_BUILD Use .Xr ccache 1 for the build. No configuration is required except to install the .Sy devel/ccache package. When using with .Xr distcc 1 , set .Sy CCACHE_PREFIX=/usr/local/bin/distcc . The default cache directory of .Pa $HOME/.ccache will be used, which can be overridden by setting .Sy CCACHE_DIR . The .Sy CCACHE_COMPILERCHECK option defaults to .Sy content when using the in-tree bootstrap compiler, and .Sy mtime when using an external compiler. The .Sy CCACHE_CPP2 option is used for Clang but not GCC. .Pp Sharing a cache between multiple work directories requires using a layout similar to .Pa /some/prefix/src .Pa /some/prefix/obj and an environment such as: .Bd -literal -offset indent CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj' .Ed .Pp See .Xr ccache 1 for more configuration options. .It Va WITHOUT_CCD Do not build .Xr geom_ccd 4 and related utilities. .It Va WITHOUT_CDDL Do not build code licensed under Sun's CDDL. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CTF .It .Va WITHOUT_DTRACE .It .Va WITHOUT_LOADER_ZFS .It .Va WITHOUT_ZFS .El .It Va WITHOUT_CLANG Do not build the Clang C/C++ compiler during the regular phase of the build. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CLANG_EXTRAS .It .Va WITHOUT_CLANG_FORMAT .It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_LLVM_COV .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_LLVM_TARGET_AARCH64 (unless .Va WITH_LLVM_TARGET_AARCH64 is set explicitly) .It Va WITHOUT_LLVM_TARGET_ALL (unless .Va WITH_LLVM_TARGET_ALL is set explicitly) .It Va WITHOUT_LLVM_TARGET_ARM (unless .Va WITH_LLVM_TARGET_ARM is set explicitly) .It Va WITHOUT_LLVM_TARGET_POWERPC (unless .Va WITH_LLVM_TARGET_POWERPC is set explicitly) .It Va WITHOUT_LLVM_TARGET_RISCV (unless .Va WITH_LLVM_TARGET_RISCV is set explicitly) .El .It Va WITHOUT_CLANG_BOOTSTRAP Do not build the Clang C/C++ compiler during the bootstrap phase of the build. To be able to build the system, either gcc or clang bootstrap must be enabled unless an alternate compiler is provided via XCC. .It Va WITH_CLANG_EXTRAS Build additional clang and llvm tools, such as bugpoint and clang-format. .It Va WITH_CLANG_FORMAT Build clang-format. .It Va WITHOUT_CLANG_FULL Avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .It Va WITHOUT_CLANG_IS_CC Do not install links to the Clang C/C++ compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ and .Pa /usr/bin/cpp . .It Va WITHOUT_CLEAN Do not clean before building world and/or kernel. .It Va WITHOUT_CPP Do not build .Xr cpp 1 . .It Va WITHOUT_CROSS_COMPILER Do not build any cross compiler in the cross-tools stage of buildworld. When compiling a different version of .Fx than what is installed on the system, provide an alternate compiler with XCC to ensure success. When compiling with an identical version of .Fx to the host, this option may be safely used. This option may also be safe when the host version of .Fx is close to the sources being built, but all bets are off if there have been any changes to the toolchain between the versions. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CLANG_BOOTSTRAP .It .Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP .It .Va WITHOUT_LLD_BOOTSTRAP .El .It Va WITHOUT_CRYPT Do not build any crypto code. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_DMAGENT .It .Va WITHOUT_KERBEROS .It .Va WITHOUT_KERBEROS_SUPPORT .It .Va WITHOUT_LDNS .It .Va WITHOUT_LDNS_UTILS .It .Va WITHOUT_OPENSSH .It .Va WITHOUT_OPENSSL .It .Va WITHOUT_OPENSSL_KTLS .It .Va WITHOUT_PKGBOOTSTRAP .It .Va WITHOUT_UNBOUND .It .Va WITHOUT_ZFS .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_GSSAPI (unless .Va WITH_GSSAPI is set explicitly) .El .It Va WITH_CTF Compile with CTF (Compact C Type Format) data. CTF data encapsulates a reduced form of debugging information similar to DWARF and the venerable stabs and is required for DTrace. .It Va WITHOUT_CUSE Do not build CUSE-related programs and libraries. .It Va WITHOUT_CXGBETOOL Do not build .Xr cxgbetool 8 .Pp This is a default setting on arm/armv6, arm/armv7, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_CXGBETOOL Build .Xr cxgbetool 8 .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_CXX Do not build C++ headers and runtime libraries. It also prevents building binaries and libraries written in C++, including .Xr devd 8 . When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CLANG .It .Va WITHOUT_CLANG_EXTRAS .It .Va WITHOUT_CLANG_FORMAT .It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_DTRACE_TESTS .It .Va WITHOUT_GOOGLETEST .It .Va WITHOUT_LLD .It .Va WITHOUT_LLDB .It .Va WITHOUT_LLVM_COV .It .Va WITHOUT_OFED .It .Va WITHOUT_OFED_EXTRA .It .Va WITHOUT_OPENMP .It .Va WITHOUT_PMC .It .Va WITHOUT_TESTS .El .It Va WITHOUT_DEBUG_FILES Avoid building or installing standalone debug files for each executable binary and shared library. .It Va WITH_DETECT_TZ_CHANGES Make the time handling code detect changes to the timezone files. .It Va WITHOUT_DIALOG Do not build .Xr dialog 1 , .Xr dialog 3 , .Xr dpv 1 , and .Xr dpv 3 . When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_BSDINSTALL .El .It Va WITHOUT_DICT Do not build the Webster dictionary files. .It Va WITH_DIRDEPS_BUILD This is an experimental build system. For details see https://www.crufty.net/sjg/docs/freebsd-meta-mode.htm. Build commands can be seen from the top-level with: .Dl make show-valid-targets The build is driven by dirdeps.mk using .Va DIRDEPS stored in Makefile.depend files found in each directory. .Pp The build can be started from anywhere, and behaves the same. The initial instance of .Xr make 1 recursively reads .Va DIRDEPS from .Pa Makefile.depend , computing a graph of tree dependencies from the current origin. Setting .Va NO_DIRDEPS skips checking dirdep dependencies and will only build in the current and child directories. .Va NO_DIRDEPS_BELOW skips building any dirdeps and only build the current directory. .Pp This also utilizes the .Va WITH_META_MODE logic for incremental builds. .Pp The build hides commands executed unless .Va NO_SILENT is defined. .Pp Note that there is currently no mass install feature for this. .Pp When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITH_INSTALL_AS_USER .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITH_META_MODE (unless .Va WITHOUT_META_MODE is set explicitly) .It Va WITH_STAGING (unless .Va WITHOUT_STAGING is set explicitly) .It Va WITH_STAGING_MAN (unless .Va WITHOUT_STAGING_MAN is set explicitly) .It Va WITH_STAGING_PROG (unless .Va WITHOUT_STAGING_PROG is set explicitly) .It Va WITH_SYSROOT (unless .Va WITHOUT_SYSROOT is set explicitly) .El .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITH_DIRDEPS_CACHE Cache result of dirdeps.mk which can save significant time for subsequent builds. Depends on .Va WITH_DIRDEPS_BUILD . .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITHOUT_DMAGENT Do not build dma Mail Transport Agent. .It Va WITHOUT_DOCCOMPRESS Do not install compressed system documentation. Only the uncompressed version will be installed. .It Va WITHOUT_DTRACE Do not build DTrace framework kernel modules, libraries, and user commands. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CTF .El .It Va WITH_DTRACE_TESTS Build and install the DTrace test suite in .Pa /usr/tests/cddl/usr.sbin/dtrace . This test suite is considered experimental on architectures other than amd64/amd64 and running it may cause system instability. .It Va WITHOUT_DYNAMICROOT Set this if you do not want to link .Pa /bin and .Pa /sbin dynamically. .It Va WITHOUT_EE Do not build and install .Xr edit 1 , .Xr ee 1 , and related programs. .It Va WITHOUT_EFI Set not to build .Xr efivar 3 and .Xr efivar 8 . .Pp This is a default setting on powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITH_EFI Build .Xr efivar 3 and .Xr efivar 8 . .Pp This is a default setting on amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP Do not build ELF Tool Chain tools (addr2line, nm, size, strings and strip) as part of the bootstrap process. .Bf -symbolic An alternate bootstrap tool chain must be provided. .Ef .It Va WITHOUT_EXAMPLES Avoid installing examples to .Pa /usr/share/examples/ . .It Va WITH_EXPERIMENTAL Include experimental features in the build. .It Va WITH_EXTRA_TCP_STACKS Build extra TCP stack modules. .It Va WITH_FDT Build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. .It Va WITHOUT_FILE Do not build .Xr file 1 and related programs. .It Va WITHOUT_FINGER Do not build or install .Xr finger 1 and .Xr fingerd 8 . .It Va WITHOUT_FLOPPY Do not build or install programs for operating floppy disk driver. .It Va WITHOUT_FORMAT_EXTENSIONS Do not enable .Fl fformat-extensions when compiling the kernel. Also disables all format checking. .It Va WITHOUT_FORTH Build bootloaders without Forth support. .It Va WITHOUT_FP_LIBC Build .Nm libc without floating-point support. .It Va WITHOUT_FREEBSD_UPDATE Do not build .Xr freebsd-update 8 . .It Va WITHOUT_FTP Do not build or install .Xr ftp 1 and .Xr ftpd 8 . .It Va WITHOUT_GAMES Do not build games. .It Va WITHOUT_GH_BC Install the traditional FreeBSD .Xr bc 1 and .Xr dc 1 programs instead of the enhanced versions. .It Va WITHOUT_GNU_DIFF Do not build GNU .Xr diff3 1 . .It Va WITHOUT_GOOGLETEST Neither build nor install .Lb libgmock , .Lb libgtest , and dependent tests. .It Va WITHOUT_GPIO Do not build .Xr gpioctl 8 as part of the base system. .It Va WITHOUT_GSSAPI Do not build libgssapi. .It Va WITHOUT_HAST Do not build .Xr hastd 8 and related utilities. .It Va WITH_HESIOD Build Hesiod support. .It Va WITHOUT_HTML Do not build HTML docs. .It Va WITHOUT_HYPERV Do not build or install HyperV utilities. .Pp This is a default setting on arm/armv6, arm/armv7, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_HYPERV Build or install HyperV utilities. .Pp This is a default setting on amd64/amd64, arm64/aarch64 and i386/i386. .It Va WITHOUT_ICONV Do not build iconv as part of libc. .It Va WITHOUT_INCLUDES Do not install header files. This option used to be spelled .Va NO_INCS . .Bf -symbolic The option does not work for build targets. .Ef .It Va WITHOUT_INET Do not build programs and libraries related to IPv4 networking. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_INET_SUPPORT .El .It Va WITHOUT_INET6 Do not build programs and libraries related to IPv6 networking. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_INET6_SUPPORT .El .It Va WITHOUT_INET6_SUPPORT Build libraries, programs, and kernel modules without IPv6 support. .It Va WITHOUT_INETD Do not build .Xr inetd 8 . .It Va WITHOUT_INET_SUPPORT Build libraries, programs, and kernel modules without IPv4 support. .It Va WITH_INIT_ALL_PATTERN Build the base system or kernel with stack variables initialized to .Pq compiler defined debugging patterns on function entry. This option requires the clang compiler. .It Va WITH_INIT_ALL_ZERO Build the base system or kernel with stack variables initialized to zero on function entry. This option requires that the clang compiler be used. .It Va WITHOUT_INSTALLLIB Set this to not install optional libraries. For example, when creating a .Xr nanobsd 8 image. .Bf -symbolic The option does not work for build targets. .Ef .It Va WITH_INSTALL_AS_USER Make install targets succeed for non-root users by installing files with owner and group attributes set to that of the user running the .Xr make 1 command. The user still must set the .Va DESTDIR variable to point to a directory where the user has write permissions. .It Va WITHOUT_IPFILTER Do not build IP Filter package. .It Va WITHOUT_IPFW Do not build IPFW tools. .It Va WITHOUT_IPSEC_SUPPORT Do not build the kernel with .Xr ipsec 4 support. This option is needed for .Xr ipsec 4 and .Xr tcpmd5 4 . .It Va WITHOUT_ISCSI Do not build .Xr iscsid 8 and related utilities. .It Va WITHOUT_JAIL Do not build tools for the support of jails; e.g., .Xr jail 8 . .It Va WITHOUT_KDUMP Do not build .Xr kdump 1 and .Xr truss 1 . .It Va WITHOUT_KERBEROS Set this to not build Kerberos 5 (KTH Heimdal). When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_GSSAPI (unless .Va WITH_GSSAPI is set explicitly) .It Va WITHOUT_KERBEROS_SUPPORT (unless .Va WITH_KERBEROS_SUPPORT is set explicitly) .El .It Va WITHOUT_KERBEROS_SUPPORT Build some programs without Kerberos support, like .Xr ssh 1 , .Xr telnet 1 , and .Xr sshd 8 . .It Va WITH_KERNEL_RETPOLINE Enable the "retpoline" mitigation for CVE-2017-5715 in the kernel build. .It Va WITHOUT_KERNEL_SYMBOLS Do not install standalone kernel debug symbol files. This option has no effect at build time. .It Va WITHOUT_KVM Do not build the .Nm libkvm library as a part of the base system. .Bf -symbolic The option has no effect yet. .Ef When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_KVM_SUPPORT (unless .Va WITH_KVM_SUPPORT is set explicitly) .El .It Va WITHOUT_KVM_SUPPORT Build some programs without optional .Nm libkvm support. .It Va WITHOUT_LDNS Setting this variable will prevent the LDNS library from being built. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_LDNS_UTILS .It .Va WITHOUT_UNBOUND .El .It Va WITHOUT_LDNS_UTILS Setting this variable will prevent building the LDNS utilities .Xr drill 1 and .Xr host 1 . .It Va WITHOUT_LEGACY_CONSOLE Do not build programs that support a legacy PC console; e.g., .Xr kbdcontrol 1 and .Xr vidcontrol 1 . .It Va WITHOUT_LIB32 On 64-bit platforms, do not build 32-bit library set and a .Nm ld-elf32.so.1 runtime linker. .Pp This is a default setting on arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64le, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLD Do not build LLVM's lld linker. .It Va WITHOUT_LLDB Do not build the LLDB debugger. .Pp This is a default setting on arm/armv6, arm/armv7, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_LLDB Build the LLDB debugger. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_LLD_BOOTSTRAP Do not build the LLD linker during the bootstrap phase of the build. To be able to build the system an alternate linker must be provided via XLD. .It Va WITHOUT_LLD_IS_LD Do not install a .Pa /usr/bin/ld symlink to .Pa ld.lld . The system will not have a usable tool chain unless a linker is provided some other way. .It Va WITHOUT_LLVM_ASSERTIONS Disable debugging assertions in LLVM. .It Va WITH_LLVM_BINUTILS Install LLVM's binutils (ar, addr2line, nm, etc.) instead of ELF Tool Chain's. .It Va WITHOUT_LLVM_COV Do not build the .Xr llvm-cov 1 tool. .It Va WITHOUT_LLVM_CXXFILT Install ELF Tool Chain's cxxfilt as c++filt, instead of LLVM's llvm-cxxfilt. .It Va WITHOUT_LLVM_TARGET_AARCH64 Do not build LLVM target support for AArch64. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITHOUT_LLVM_TARGET_ALL Only build the required LLVM target support. This option is preferred to specific target support options. When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_LLVM_TARGET_AARCH64 (unless .Va WITH_LLVM_TARGET_AARCH64 is set explicitly) .It Va WITHOUT_LLVM_TARGET_ARM (unless .Va WITH_LLVM_TARGET_ARM is set explicitly) .It Va WITHOUT_LLVM_TARGET_POWERPC (unless .Va WITH_LLVM_TARGET_POWERPC is set explicitly) .It Va WITHOUT_LLVM_TARGET_RISCV (unless .Va WITH_LLVM_TARGET_RISCV is set explicitly) .El .It Va WITHOUT_LLVM_TARGET_ARM Do not build LLVM target support for ARM. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITH_LLVM_TARGET_BPF Build LLVM target support for BPF. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITH_LLVM_TARGET_MIPS Build LLVM target support for MIPS. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITHOUT_LLVM_TARGET_POWERPC Do not build LLVM target support for PowerPC. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITHOUT_LLVM_TARGET_RISCV Do not build LLVM target support for RISC-V. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITHOUT_LLVM_TARGET_X86 Do not build LLVM target support for X86. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. .It Va WITH_LOADER_EFI_SECUREBOOT Enable building .Xr loader 8 with support for verification based on certificates obtained from UEFI. -.It Va WITH_LOADER_FIREWIRE -Enable firewire support in /boot/loader on x86. -This option is a nop on all other platforms. .It Va WITHOUT_LOADER_GELI Disable inclusion of GELI crypto support in the boot chain binaries. .Pp This is a default setting on powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITH_LOADER_GELI Build GELI bootloader support. .Pp This is a default setting on amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LOADER_KBOOT Do not build kboot, a linuxboot environment loader .Pp This is a default setting on arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64le, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_LOADER_KBOOT Build kboot, a linuxboot environment loader .Pp This is a default setting on amd64/amd64 and powerpc/powerpc64. .It Va WITHOUT_LOADER_LUA Do not build LUA bindings for the boot loader. .Pp This is a default setting on powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITH_LOADER_LUA Build LUA bindings for the boot loader. .Pp This is a default setting on amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LOADER_OFW Disable building of openfirmware bootloader components. .Pp This is a default setting on amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_LOADER_OFW Build openfirmware bootloader components. .Pp This is a default setting on powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_LOADER_UBOOT Disable building of ubldr. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64le, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_LOADER_UBOOT Build ubldr. .Pp This is a default setting on arm/armv6, arm/armv7, powerpc/powerpc and powerpc/powerpc64. .It Va WITH_LOADER_VERBOSE Build with extra verbose debugging in the loader. May explode already nearly too large loader over the limit. Use with care. .It Va WITH_LOADER_VERIEXEC Enable building .Xr loader 8 with support for verification similar to Verified Exec. .Pp Depends on .Va WITH_BEARSSL . When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITH_LOADER_EFI_SECUREBOOT (unless .Va WITHOUT_LOADER_EFI_SECUREBOOT is set explicitly) .It Va WITH_LOADER_VERIEXEC_VECTX (unless .Va WITHOUT_LOADER_VERIEXEC_VECTX is set explicitly) .El .It Va WITH_LOADER_VERIEXEC_PASS_MANIFEST Enable building .Xr loader 8 with support to pass a verified manifest to the kernel. The kernel has to be built with a module to parse the manifest. .Pp Depends on .Va WITH_LOADER_VERIEXEC . .It Va WITHOUT_LOADER_ZFS Do not build ZFS file system boot loader support. .It Va WITHOUT_LOCALES Do not build localization files; see .Xr locale 1 . .It Va WITHOUT_LOCATE Do not build .Xr locate 1 and related programs. .It Va WITHOUT_LPR Do not build .Xr lpr 1 and related programs. .It Va WITHOUT_LS_COLORS Build .Xr ls 1 without support for colors to distinguish file types. .It Va WITHOUT_MACHDEP_OPTIMIZATIONS Prefer machine-independent non-assembler code in libc and libm. .It Va WITHOUT_MAIL Do not build any mail support (MUA or MTA). When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_DMAGENT .It .Va WITHOUT_MAILWRAPPER .It .Va WITHOUT_SENDMAIL .El .It Va WITHOUT_MAILWRAPPER Do not build the .Xr mailwrapper 8 MTA selector. .It Va WITHOUT_MAKE Do not install .Xr make 1 and related support files. .It Va WITHOUT_MAKE_CHECK_USE_SANDBOX Do not execute .Dq Li "make check" in limited sandbox mode. This option should be paired with .Va WITH_INSTALL_AS_USER if executed as an unprivileged user. See .Xr tests 7 for more details. .It Va WITH_MALLOC_PRODUCTION Disable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to off. .It Va WITHOUT_MAN Do not build manual pages. When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_MAN_UTILS (unless .Va WITH_MAN_UTILS is set explicitly) .El .It Va WITHOUT_MANCOMPRESS Do not install compressed man pages. Only the uncompressed versions will be installed. .It Va WITH_MANSPLITPKG Split man pages into their own packages during make package. .It Va WITHOUT_MAN_UTILS Do not build utilities for manual pages, .Xr apropos 1 , .Xr makewhatis 1 , .Xr man 1 , .Xr whatis 1 , .Xr manctl 8 , and related support files. .It Va WITH_META_MODE Create .Xr make 1 meta files when building, which can provide a reliable incremental build when using .Xr filemon 4 . The meta file is created in OBJDIR as .Pa target.meta . These meta files track the command that was executed, its output, and the current directory. The .Xr filemon 4 module is required unless .Va NO_FILEMON is defined. When the module is loaded, any files used by the commands executed are tracked as dependencies for the target in its meta file. The target is considered out-of-date and rebuilt if any of these conditions are true compared to the last build: .Bl -bullet -compact .It The command to execute changes. .It The current working directory changes. .It The target's meta file is missing. .It The target's meta file is missing filemon data when filemon is loaded and a previous run did not have it loaded. .It [requires .Xr filemon 4 ] Files read, executed or linked to are newer than the target. .It [requires .Xr filemon 4 ] Files read, written, executed or linked are missing. .El The meta files can also be useful for debugging. .Pp The build hides commands that are executed unless .Va NO_SILENT is defined. Errors cause .Xr make 1 to show some of its environment for further debugging. .Pp The build operates as it normally would otherwise. This option originally invoked a different build system but that was renamed to .Va WITH_DIRDEPS_BUILD . .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITHOUT_MLX5TOOL Do not build .Xr mlx5tool 8 .Pp This is a default setting on arm/armv6, arm/armv7, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_MLX5TOOL Build .Xr mlx5tool 8 .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_NETCAT Do not build .Xr nc 1 utility. .It Va WITHOUT_NETGRAPH Do not build applications to support .Xr netgraph 4 . When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_ATM .It .Va WITHOUT_BLUETOOTH .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_NETGRAPH_SUPPORT (unless .Va WITH_NETGRAPH_SUPPORT is set explicitly) .El .It Va WITHOUT_NETGRAPH_SUPPORT Build libraries, programs, and kernel modules without netgraph support. .It Va WITHOUT_NIS Do not build .Xr NIS 8 support and related programs. If set, you might need to adopt your .Xr nsswitch.conf 5 and remove .Sq nis entries. .It Va WITHOUT_NLS Do not build NLS catalogs. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_NLS_CATALOGS .El .It Va WITHOUT_NLS_CATALOGS Do not build NLS catalog support for .Xr csh 1 . .It Va WITHOUT_NS_CACHING Disable name caching in the .Pa nsswitch subsystem. The generic caching daemon, .Xr nscd 8 , will not be built either if this option is set. .It Va WITHOUT_NTP Do not build .Xr ntpd 8 and related programs. .It Va WITHOUT_NVME Do not build nvme related tools and kernel modules. .Pp This is a default setting on arm/armv6, arm/armv7, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_NVME Build nvme related tools and kernel modules. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_OFED Disable the build of the .Dq "OpenFabrics Enterprise Distribution" Infiniband software stack, including kernel modules and userspace libraries. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_OFED_EXTRA .El .It Va WITH_OFED_EXTRA Build the non-essential components of the .Dq "OpenFabrics Enterprise Distribution" Infiniband software stack, mostly examples. .It Va WITH_OPENLDAP Enable building LDAP support for kerberos using an openldap client from ports. .It Va WITHOUT_OPENMP Do not build LLVM's OpenMP runtime. .Pp This is a default setting on arm/armv6, arm/armv7 and powerpc/powerpc. .It Va WITH_OPENMP Build LLVM's OpenMP runtime. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64, powerpc/powerpc64le, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_OPENSSH Do not build OpenSSH. .It Va WITHOUT_OPENSSL Do not build OpenSSL. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_DMAGENT .It .Va WITHOUT_KERBEROS .It .Va WITHOUT_KERBEROS_SUPPORT .It .Va WITHOUT_LDNS .It .Va WITHOUT_LDNS_UTILS .It .Va WITHOUT_OPENSSH .It .Va WITHOUT_OPENSSL_KTLS .It .Va WITHOUT_PKGBOOTSTRAP .It .Va WITHOUT_UNBOUND .It .Va WITHOUT_ZFS .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_GSSAPI (unless .Va WITH_GSSAPI is set explicitly) .El .It Va WITHOUT_OPENSSL_KTLS Do not include kernel TLS support in OpenSSL. .Pp This is a default setting on arm/armv6, arm/armv7, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_OPENSSL_KTLS Include kernel TLS support in OpenSSL. .Pp This is a default setting on amd64/amd64 and arm64/aarch64. .It Va WITHOUT_PAM Do not build PAM library and modules. .Bf -symbolic This option is deprecated and does nothing. .Ef When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_PAM_SUPPORT (unless .Va WITH_PAM_SUPPORT is set explicitly) .El .It Va WITHOUT_PAM_SUPPORT Build some programs without PAM support, particularly .Xr ftpd 8 and .Xr ppp 8 . .It Va WITHOUT_PF Do not build PF firewall package. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_AUTHPF .El .It Va WITHOUT_PIE Do not build dynamically linked binaries as Position-Independent Executable (PIE). .It Va WITHOUT_PKGBOOTSTRAP Do not build .Xr pkg 7 bootstrap tool. .It Va WITHOUT_PMC Do not build .Xr pmccontrol 8 and related programs. .It Va WITHOUT_PORTSNAP Do not build or install .Xr portsnap 8 and related files. .It Va WITHOUT_PPP Do not build .Xr ppp 8 and related programs. .It Va WITH_PROFILE Build profiled libraries for use with .Xr gprof 8 . This option is deprecated and may not be present in a future version of .Fx . .It Va WITHOUT_QUOTAS Do not build .Xr quota 1 and related programs. .It Va WITHOUT_RADIUS_SUPPORT Do not build radius support into various applications, like .Xr pam_radius 8 and .Xr ppp 8 . .It Va WITH_RATELIMIT Build the system with rate limit support. .Pp This makes .Dv SO_MAX_PACING_RATE effective in .Xr getsockopt 2 , and .Ar txrlimit support in .Xr ifconfig 8 , by proxy. .It Va WITHOUT_RBOOTD Do not build or install .Xr rbootd 8 . .It Va WITHOUT_RELRO Do not apply the Relocation Read-Only (RELRO) vulnerability mitigation. See also the .Va BIND_NOW option. .It Va WITH_REPRODUCIBLE_BUILD Exclude build metadata (such as the build time, user, or host) from the kernel, boot loaders, and uname output, so that builds produce bit-for-bit identical output. .It Va WITHOUT_RESCUE Do not build .Xr rescue 8 . .It Va WITH_RETPOLINE Build the base system with the retpoline speculative execution vulnerability mitigation for CVE-2017-5715. .It Va WITHOUT_ROUTED Do not build .Xr routed 8 utility. .It Va WITH_RPCBIND_WARMSTART_SUPPORT Build .Xr rpcbind 8 with warmstart support. .It Va WITHOUT_SENDMAIL Do not build .Xr sendmail 8 and related programs. .It Va WITHOUT_SERVICESDB Do not install .Pa /var/db/services.db . .It Va WITHOUT_SETUID_LOGIN Set this to disable the installation of .Xr login 1 as a set-user-ID root program. .It Va WITHOUT_SHAREDOCS Do not build the .Bx 4.4 legacy docs. .It Va WITHOUT_SHARED_TOOLCHAIN Build the toolchain binaries as statically linked executables. The set includes .Xr cc 1 , .Xr make 1 and necessary utilities like assembler, linker and library archive manager. .It Va WITH_SORT_THREADS Enable threads in .Xr sort 1 . .It Va WITHOUT_SOURCELESS Do not build kernel modules that include sourceless code (either microcode or native code for host CPU). When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_SOURCELESS_HOST .It .Va WITHOUT_SOURCELESS_UCODE .El .It Va WITHOUT_SOURCELESS_HOST Do not build kernel modules that include sourceless native code for host CPU. .It Va WITHOUT_SOURCELESS_UCODE Do not build kernel modules that include sourceless microcode. .It Va WITHOUT_SPLIT_KERNEL_DEBUG Do not build standalone kernel debug files. Debug data (if enabled by the kernel configuration file) will be included in the kernel and modules. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_KERNEL_SYMBOLS .El .It Va WITHOUT_SSP Do not build world with propolice stack smashing protection. .It Va WITH_STAGING Enable staging of files to a stage tree. This can be best thought of as auto-install to .Va DESTDIR with some extra meta data to ensure dependencies can be tracked. Depends on .Va WITH_DIRDEPS_BUILD . When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITH_STAGING_MAN (unless .Va WITHOUT_STAGING_MAN is set explicitly) .It Va WITH_STAGING_PROG (unless .Va WITHOUT_STAGING_PROG is set explicitly) .El .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITH_STAGING_MAN Enable staging of man pages to stage tree. .It Va WITH_STAGING_PROG Enable staging of PROGs to stage tree. .It Va WITH_STALE_STAGED Check staged files are not stale. .It Va WITHOUT_STATS Neither build nor install .Lb libstats and dependent binaries. .It Va WITHOUT_SYSCONS Do not build .Xr syscons 4 support files such as keyboard maps, fonts, and screen output maps. .It Va WITH_SYSROOT Enable use of sysroot during build. Depends on .Va WITH_DIRDEPS_BUILD . .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITHOUT_SYSTEM_COMPILER Do not opportunistically skip building a cross-compiler during the bootstrap phase of the build. Normally, if the currently installed compiler matches the planned bootstrap compiler type and revision, then it will not be built. This does not prevent a compiler from being built for installation though, only for building one for the build itself. The .Va WITHOUT_CLANG option controls that. .It Va WITHOUT_SYSTEM_LINKER Do not opportunistically skip building a cross-linker during the bootstrap phase of the build. Normally, if the currently installed linker matches the planned bootstrap linker type and revision, then it will not be built. This does not prevent a linker from being built for installation though, only for building one for the build itself. The .Va WITHOUT_LLD option controls that. .Pp This option is only relevant when .Va WITH_LLD_BOOTSTRAP is set. .It Va WITHOUT_TALK Do not build or install .Xr talk 1 and .Xr talkd 8 . .It Va WITHOUT_TCP_WRAPPERS Do not build or install .Xr tcpd 8 , and related utilities. .It Va WITHOUT_TCSH Do not build and install .Pa /bin/csh (which is .Xr tcsh 1 ) . .It Va WITHOUT_TELNET Do not build .Xr telnet 1 and related programs. .It Va WITHOUT_TESTS Do not build nor install the .Fx Test Suite in .Pa /usr/tests/ . See .Xr tests 7 for more details. This also disables the build of all test-related dependencies, including ATF. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_DTRACE_TESTS .El .Pp When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_GOOGLETEST (unless .Va WITH_GOOGLETEST is set explicitly) .It Va WITHOUT_TESTS_SUPPORT (unless .Va WITH_TESTS_SUPPORT is set explicitly) .El .It Va WITHOUT_TESTS_SUPPORT Disable the build of all test-related dependencies, including ATF. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_GOOGLETEST .El .It Va WITHOUT_TEXTPROC Do not build programs used for text processing. .It Va WITHOUT_TFTP Do not build or install .Xr tftp 1 and .Xr tftpd 8 . .It Va WITHOUT_TOOLCHAIN Do not install header or programs used for program development, compilers, debuggers etc. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CLANG .It .Va WITHOUT_CLANG_EXTRAS .It .Va WITHOUT_CLANG_FORMAT .It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_INCLUDES .It .Va WITHOUT_LLD .It .Va WITHOUT_LLDB .It .Va WITHOUT_LLVM_COV .El .It Va WITH_UBSAN Build the base system with Undefined Behavior Sanitizer (UBSan) to detect various kinds of undefined behavior at runtime. Requires that Clang be used as the base system compiler and that the runtime support library is available .It Va WITHOUT_UNBOUND Do not build .Xr unbound 8 and related programs. .It Va WITHOUT_UNIFIED_OBJDIR Use the historical object directory format for .Xr build 7 targets. For native-builds and builds done directly in sub-directories the format of .Pa ${MAKEOBJDIRPREFIX}/${.CURDIR} is used, while for cross-builds .Pa ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}/${.CURDIR} is used. .Pp This option is transitional and will be removed in a future version of .Fx , at which time .Va WITH_UNIFIED_OBJDIR will be enabled permanently. .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . .It Va WITHOUT_USB Do not build USB-related programs and libraries. .It Va WITHOUT_USB_GADGET_EXAMPLES Do not build USB gadget kernel modules. .It Va WITHOUT_UTMPX Do not build user accounting tools such as .Xr last 1 , .Xr users 1 , .Xr who 1 , .Xr ac 8 , .Xr lastlogin 8 and .Xr utx 8 . .It Va WITH_VERIEXEC Enable building .Xr veriexec 8 which loads the contents of verified manifests into the kernel for use by .Xr mac_veriexec 4 .Pp Depends on .Va WITH_BEARSSL . .It Va WITHOUT_VI Do not build and install vi, view, ex and related programs. .It Va WITHOUT_VT Do not build .Xr vt 4 support files (fonts and keymaps). .It Va WITHOUT_WARNS Set this to not add warning flags to the compiler invocations. Useful as a temporary workaround when code enters the tree which triggers warnings in environments that differ from the original developer. .It Va WITHOUT_WERROR Set this to not treat compiler warnings as errors. Useful as a temporary workaround when working on fixing compiler warnings. When set, warnings are still printed in the build log but do not fail the build. .It Va WITHOUT_WIRELESS Do not build programs used for 802.11 wireless networks; especially .Xr wpa_supplicant 8 and .Xr hostapd 8 . When set, these options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_WIRELESS_SUPPORT (unless .Va WITH_WIRELESS_SUPPORT is set explicitly) .El .It Va WITHOUT_WIRELESS_SUPPORT Build libraries, programs, and kernel modules without 802.11 wireless support. .It Va WITHOUT_WPA_SUPPLICANT_EAPOL Build .Xr wpa_supplicant 8 without support for the IEEE 802.1X protocol and without support for EAP-PEAP, EAP-TLS, EAP-LEAP, and EAP-TTLS protocols (usable only via 802.1X). .It Va WITHOUT_ZFS Do not build the ZFS file system kernel module, libraries such as .Xr libbe 3 , and user commands such as .Xr zpool 8 or .Xr zfs 8 . Also disable ZFS support in utilities and libraries which implement ZFS-specific functionality. .It Va WITHOUT_ZONEINFO Do not build the timezone database. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_ZONEINFO_LEAPSECONDS_SUPPORT .El .It Va WITH_ZONEINFO_LEAPSECONDS_SUPPORT Build leapsecond information in to the timezone database. .El .Sh FILES .Bl -tag -compact -width Pa .It Pa /etc/src.conf .It Pa /etc/src-env.conf .It Pa /usr/share/mk/bsd.own.mk .El .Sh SEE ALSO .Xr make 1 , .Xr make.conf 5 , .Xr build 7 , .Xr ports 7 .Sh HISTORY The .Nm file appeared in .Fx 7.0 . .Sh AUTHORS This manual page was autogenerated by .An tools/build/options/makeman . diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index ff8c359acc42..f69208f21556 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -1,508 +1,507 @@ # $FreeBSD$ # # Option file for FreeBSD /usr/src builds, at least the userland and boot loader # portions of the tree. These options generally chose what parts of the tree to # include or omit and are FreeBSD source tree specific. # # Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf # and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no} # with sensible (usually) defaults. # # Makefiles must include bsd.opts.mk after defining specific MK_FOO options that # are applicable for that Makefile (typically there are none, but sometimes there # are exceptions). Recursive makes usually add MK_FOO=no for options that they wish # to omit from that make. # # Makefiles must include bsd.mkopt.mk before they test the value of any MK_FOO # variable. # # Makefiles may also assume that this file is included by src.opts.mk should it # need variables defined there prior to the end of the Makefile where # bsd.{subdir,lib.bin}.mk is traditionally included. # # The old-style YES_FOO and NO_FOO are being phased out. No new instances of them # should be added. Old instances should be removed since they were just to # bridge the gap between FreeBSD 4 and FreeBSD 5. # # Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an # exception is made for _WITHOUT_SRCONF which turns off this mechanism # completely inside bsd.*.mk files). # .if !target(____) ____: .include # # Define MK_* variables (which are either "yes" or "no") for users # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the # make(1) environment. # These should be tested with `== "no"' or `!= "no"' in makefiles. # The NO_* variables should only be set by makefiles for variables # that haven't been converted over. # # These options are used by the src builds. Those listed in # __DEFAULT_YES_OPTIONS default to 'yes' and will build unless turned # off. __DEFAULT_NO_OPTIONS will default to 'no' and won't build # unless turned on. Any options listed in 'BROKEN_OPTIONS' will be # hard-wired to 'no'. "Broken" here means not working or # not-appropriate and/or not supported. It doesn't imply something is # wrong with the code. There's not a single good word for this, so # BROKEN was selected as the least imperfect one considered at the # time. Options are added to BROKEN_OPTIONS list on a per-arch basis. # At this time, there's no provision for mutually incompatible options. __DEFAULT_YES_OPTIONS = \ ACCT \ ACPI \ APM \ AT \ ATM \ AUDIT \ AUTHPF \ AUTOFS \ BHYVE \ BLACKLIST \ BLUETOOTH \ BOOT \ BOOTPARAMD \ BOOTPD \ BSD_CPIO \ BSDINSTALL \ BSNMP \ BZIP2 \ CALENDAR \ CAPSICUM \ CAROOT \ CASPER \ CCD \ CDDL \ CLANG \ CLANG_BOOTSTRAP \ CLANG_IS_CC \ CLEAN \ CPP \ CROSS_COMPILER \ CRYPT \ CUSE \ CXX \ CXGBETOOL \ DIALOG \ DICT \ DMAGENT \ DTRACE \ DYNAMICROOT \ EE \ EFI \ ELFTOOLCHAIN_BOOTSTRAP \ EXAMPLES \ FDT \ FILE \ FINGER \ FLOPPY \ FORTH \ FP_LIBC \ FREEBSD_UPDATE \ FTP \ GAMES \ GH_BC \ GNU_DIFF \ GOOGLETEST \ GPIO \ HAST \ HTML \ HYPERV \ ICONV \ INET \ INET6 \ INETD \ IPFILTER \ IPFW \ ISCSI \ JAIL \ KDUMP \ KVM \ LDNS \ LDNS_UTILS \ LEGACY_CONSOLE \ LLD \ LLD_BOOTSTRAP \ LLD_IS_LD \ LLVM_ASSERTIONS \ LLVM_COV \ LLVM_CXXFILT \ LOADER_GELI \ LOADER_KBOOT \ LOADER_LUA \ LOADER_OFW \ LOADER_UBOOT \ LOCALES \ LOCATE \ LPR \ LS_COLORS \ MACHDEP_OPTIMIZATIONS \ MAIL \ MAILWRAPPER \ MAKE \ MLX5TOOL \ NDIS \ NETCAT \ NETGRAPH \ NLS_CATALOGS \ NS_CACHING \ NTP \ NVME \ OFED \ OPENSSL \ PAM \ PF \ PKGBOOTSTRAP \ PMC \ PORTSNAP \ PPP \ QUOTAS \ RADIUS_SUPPORT \ RBOOTD \ RESCUE \ ROUTED \ SENDMAIL \ SERVICESDB \ SETUID_LOGIN \ SHARED_TOOLCHAIN \ SHAREDOCS \ SOURCELESS \ SOURCELESS_HOST \ SOURCELESS_UCODE \ STATS \ SYSCONS \ SYSTEM_COMPILER \ SYSTEM_LINKER \ TALK \ TCP_WRAPPERS \ TCSH \ TELNET \ TEXTPROC \ TFTP \ UNBOUND \ USB \ UTMPX \ VI \ VT \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ LOADER_ZFS \ ZONEINFO __DEFAULT_NO_OPTIONS = \ BEARSSL \ BHYVE_SNAPSHOT \ CLANG_EXTRAS \ CLANG_FORMAT \ DETECT_TZ_CHANGES \ DTRACE_TESTS \ EXPERIMENTAL \ HESIOD \ - LOADER_FIREWIRE \ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ LLVM_BINUTILS \ MALLOC_PRODUCTION \ OFED_EXTRA \ OPENLDAP \ REPRODUCIBLE_BUILD \ RPCBIND_WARMSTART_SUPPORT \ SORT_THREADS \ ZONEINFO_LEAPSECONDS_SUPPORT \ # LEFT/RIGHT. Left options which default to "yes" unless their corresponding # RIGHT option is disabled. __DEFAULT_DEPENDENT_OPTIONS= \ CLANG_FULL/CLANG \ LLVM_TARGET_ALL/CLANG \ LOADER_VERIEXEC/BEARSSL \ LOADER_EFI_SECUREBOOT/LOADER_VERIEXEC \ LOADER_VERIEXEC_VECTX/LOADER_VERIEXEC \ VERIEXEC/BEARSSL \ # MK_*_SUPPORT options which default to "yes" unless their corresponding # MK_* variable is set to "no". # .for var in \ BLACKLIST \ BZIP2 \ INET \ INET6 \ KERBEROS \ KVM \ NETGRAPH \ PAM \ TESTS \ WIRELESS __DEFAULT_DEPENDENT_OPTIONS+= ${var}_SUPPORT/${var} .endfor # # Default behaviour of some options depends on the architecture. Unfortunately # this means that we have to test TARGET_ARCH (the buildworld case) as well # as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not # used at all in bsd.*.mk, but we have to make an exception here if we want # to allow defaults for some things like clang to vary by target architecture. # Additional, per-target behavior should be rarely added only after much # gnashing of teeth and grinding of gears. # .if defined(TARGET_ARCH) __T=${TARGET_ARCH} .else __T=${MACHINE_ARCH} .endif # All supported backends for LLVM_TARGET_XXX __LLVM_TARGETS= \ aarch64 \ arm \ powerpc \ riscv \ x86 __LLVM_TARGET_FILT= C/(amd64|i386)/x86/:C/powerpc.*/powerpc/:C/armv[67]/arm/:C/riscv.*/riscv/:C/mips.*/mips/ .for __llt in ${__LLVM_TARGETS} # Default enable the given TARGET's LLVM_TARGET support .if ${__T:${__LLVM_TARGET_FILT}} == ${__llt} __DEFAULT_YES_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu} # aarch64 needs arm for -m32 support. .elif ${__T} == "aarch64" && ${__llt:Marm*} != "" __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_ARM/LLVM_TARGET_AARCH64 # Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL. .else __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL .endif .endfor __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF LLVM_TARGET_MIPS .include .if ${__T:Marm*} == "" && ${__T:Mriscv64*} == "" __DEFAULT_YES_OPTIONS+=LLDB .else __DEFAULT_NO_OPTIONS+=LLDB .endif # LIB32 is supported on amd64 and powerpc64 .if (${__T} == "amd64" || ${__T} == "powerpc64") __DEFAULT_YES_OPTIONS+=LIB32 .else BROKEN_OPTIONS+=LIB32 .endif # EFI doesn't exist on powerpc (well, officially) .if ${__T:Mpowerpc*} BROKEN_OPTIONS+=EFI .endif # OFW is only for powerpc, exclude others .if ${__T:Mpowerpc*} == "" BROKEN_OPTIONS+=LOADER_OFW .endif # KBOOT is only for powerpc64 (powerpc64le broken) and kinda for amd64 .if ${__T} != "powerpc64" && ${__T} != "amd64" BROKEN_OPTIONS+=LOADER_KBOOT .endif # UBOOT is only for arm, and big-endian powerpc .if (${__T:Marm*} == "" && ${__T:Mpowerpc*} == "") || ${__T} == "powerpc64le" BROKEN_OPTIONS+=LOADER_UBOOT .endif # GELI and Lua in loader currently cause boot failures on powerpc. # Further debugging is required -- probably they are just broken on big # endian systems generically (they jump to null pointers or try to read # crazy high addresses, which is typical of endianness problems). .if ${__T:Mpowerpc*} BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA .endif # Kernel TLS is enabled by default on amd64 and aarch64 .if ${__T} == "aarch64" || ${__T} == "amd64" __DEFAULT_YES_OPTIONS+=OPENSSL_KTLS .else __DEFAULT_NO_OPTIONS+=OPENSSL_KTLS .endif .if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \ ${__T:Mpowerpc64*} == "" BROKEN_OPTIONS+=CXGBETOOL BROKEN_OPTIONS+=MLX5TOOL .endif .if ${__T} != "amd64" && ${__T} != "i386" && ${__T} != "aarch64" BROKEN_OPTIONS+=HYPERV .endif # NVME is only aarch64, x86 and powerpc64* .if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \ ${__T:Mpowerpc64*} == "" BROKEN_OPTIONS+=NVME .endif .if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ ${__T:Mpowerpc64*} != "" || ${__T:Mriscv64*} != "" __DEFAULT_YES_OPTIONS+=OPENMP .else __DEFAULT_NO_OPTIONS+=OPENMP .endif .include # # Force some options off if their dependencies are off. # Order is somewhat important. # .if ${MK_CAPSICUM} == "no" MK_CASPER:= no .endif .if ${MK_SOURCELESS} == "no" MK_SOURCELESS_HOST:= no MK_SOURCELESS_UCODE:= no .endif .if ${MK_CDDL} == "no" MK_CTF:= no MK_DTRACE:= no MK_LOADER_ZFS:= no MK_ZFS:= no .endif .if ${MK_CRYPT} == "no" MK_OPENSSL:= no MK_OPENSSH:= no MK_KERBEROS:= no MK_KERBEROS_SUPPORT:= no .endif .if ${MK_CXX} == "no" MK_CLANG:= no MK_LLD:= no MK_LLDB:= no MK_LLVM_BINUTILS:= no MK_GOOGLETEST:= no MK_OFED:= no MK_OPENMP:= no MK_PMC:= no MK_TESTS:= no .endif .if ${MK_DIALOG} == "no" MK_BSDINSTALL:= no .endif .if ${MK_DTRACE} == "no" MK_CTF:= no .endif .if ${MK_MAIL} == "no" MK_MAILWRAPPER:= no MK_SENDMAIL:= no MK_DMAGENT:= no .endif .if ${MK_NETGRAPH} == "no" MK_ATM:= no MK_BLUETOOTH:= no .endif .if ${MK_NLS} == "no" MK_NLS_CATALOGS:= no .endif .if ${MK_OPENSSL} == "no" MK_DMAGENT:= no MK_OPENSSH:= no MK_OPENSSL_KTLS:= no MK_KERBEROS:= no MK_KERBEROS_SUPPORT:= no MK_LDNS:= no MK_PKGBOOTSTRAP:= no MK_ZFS:= no .endif .if ${MK_LDNS} == "no" MK_LDNS_UTILS:= no MK_UNBOUND:= no .endif .if ${MK_PF} == "no" MK_AUTHPF:= no .endif .if ${MK_OFED} == "no" MK_OFED_EXTRA:= no .endif .if ${MK_TESTS} == "no" MK_DTRACE_TESTS:= no .endif .if ${MK_TESTS_SUPPORT} == "no" MK_GOOGLETEST:= no .endif .if ${MK_ZONEINFO} == "no" MK_ZONEINFO_LEAPSECONDS_SUPPORT:= no .endif .if ${MK_CROSS_COMPILER} == "no" MK_CLANG_BOOTSTRAP:= no MK_ELFTOOLCHAIN_BOOTSTRAP:= no MK_LLD_BOOTSTRAP:= no .endif .if ${MK_TOOLCHAIN} == "no" MK_CLANG:= no MK_INCLUDES:= no MK_LLD:= no MK_LLDB:= no MK_LLVM_BINUTILS:= no .endif .if ${MK_CLANG} == "no" MK_CLANG_EXTRAS:= no MK_CLANG_FORMAT:= no MK_CLANG_FULL:= no MK_LLVM_COV:= no .endif .if ${MK_ASAN} == "yes" # In order to get sensible backtraces from ASAN we have to install # llvm-symbolizer as /usr/bin/addr2line instead of the elftoolchain version. MK_LLVM_BINUTILS:= yes .endif .if ${MK_LLVM_BINUTILS} == "yes" # MK_LLVM_CXXFILT is a subset of MK_LLVM_BINUTILS and should therefore be # enabled if MK_LLVM_BINUTILS is set. MK_LLVM_CXXFILT:= yes .endif .if ${MK_LOADER_VERIEXEC} == "no" MK_LOADER_VERIEXEC_PASS_MANIFEST := no .endif # # MK_* options whose default value depends on another option. # .for vv in \ GSSAPI/KERBEROS \ MAN_UTILS/MAN .if defined(WITH_${vv:H}) MK_${vv:H}:= yes .elif defined(WITHOUT_${vv:H}) MK_${vv:H}:= no .else MK_${vv:H}:= ${MK_${vv:T}} .endif .endfor # # Set defaults for the MK_*_SUPPORT variables. # .endif # !target(____) diff --git a/stand/i386/Makefile b/stand/i386/Makefile index 9aa33462f309..e1555388961a 100644 --- a/stand/i386/Makefile +++ b/stand/i386/Makefile @@ -1,28 +1,27 @@ # $FreeBSD$ NO_OBJ=t .include # Almost everything else here relies on btxldr, so we must make sure it's built # before everything else proceeds so we don't end up building against a stale # btxldr and ending up with a build-during-install scenario. SUBDIR.yes+= btx libi386 -SUBDIR.${MK_LOADER_FIREWIRE}+= libfirewire SUBDIR.yes+= .WAIT SUBDIR.yes+= mbr pmbr boot0 boot0sio boot2 cdboot gptboot \ isoboot SUBDIR.${MK_FORTH}+= loader_4th SUBDIR.${MK_LOADER_LUA}+= loader_lua SUBDIR.yes+= loader_simp # special boot programs, 'self-extracting boot2+loader' SUBDIR.yes+= pxeldr SUBDIR.${MK_LOADER_ZFS}+= zfsboot gptzfsboot SUBDIR_DEPEND_pxeldr+= loader_${LOADER_DEFAULT_INTERP} .include diff --git a/stand/i386/Makefile.inc b/stand/i386/Makefile.inc index d12434487877..13d17b5b48dd 100644 --- a/stand/i386/Makefile.inc +++ b/stand/i386/Makefile.inc @@ -1,41 +1,36 @@ # Common defines for all of stand/i386/ # # $FreeBSD$ .include "bsd.linker.mk" LOADER_ADDRESS?=0x200000 LDFLAGS+= -nostdlib LDFLAGS.lld+= -Wl,--no-rosegment MK_PIE:= no # BTX components BTXDIR= ${BOOTOBJ}/i386/btx BTXLDR= ${BTXDIR}/btxldr/btxldr BTXKERN= ${BTXDIR}/btx/btx BTXCRT= ${BTXDIR}/lib/crt0.o BTXSRC= ${BOOTSRC}/i386/btx BTXLIB= ${BTXSRC}/lib CFLAGS+= -I${BTXLIB} # compact binary with no padding between text, data, bss LDSCRIPT= ${BOOTSRC}/i386/boot.ldscript LDFLAGS_ORG= -Wl,--defsym,ORG=${ORG},-T,${LDSCRIPT} LDFLAGS_BIN= -e start ${LDFLAGS_ORG} -Wl,-N,-S,--oformat,binary .if ${LINKER_FEATURES:Mbuild-id} != "" LDFLAGS_BIN+= -Wl,--build-id=none .endif LD_FLAGS_BIN= -static -N --gc-sections .if ${MACHINE_CPUARCH} == "amd64" DO32=1 .endif -.if defined(LOADER_FIREWIRE_SUPPORT) -MK_LOADER_FIREWIRE=yes -.warning LOADER_FIREWIRE_SUPPORT deprecated, please move to WITH_LOADER_FIREWIRE -.endif - .include "../Makefile.inc" diff --git a/stand/i386/libfirewire/Makefile b/stand/i386/libfirewire/Makefile deleted file mode 100644 index bf42c26a918f..000000000000 --- a/stand/i386/libfirewire/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# $FreeBSD$ - -.include - -LIB= firewire - -.PATH: ${SYSDIR}/dev/dcons ${SYSDIR}/dev/firewire -SRCS+= firewire.c fwohci.c dconsole.c -SRCS+= dcons.c fwcrom.c - -.include "${BOOTSRC}/veriexec.mk" - -CFLAGS+= -D_BOOT - -CFLAGS+= -I${LDRSRC} -CFLAGS+= -I${BOOTSRC}/i386/libi386 - -CFLAGS+= -Wformat -Wall - -.include diff --git a/stand/i386/libfirewire/Makefile.depend b/stand/i386/libfirewire/Makefile.depend deleted file mode 100644 index 18be76b0cb6f..000000000000 --- a/stand/i386/libfirewire/Makefile.depend +++ /dev/null @@ -1,13 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/xlocale \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/stand/i386/libfirewire/dconsole.c b/stand/i386/libfirewire/dconsole.c deleted file mode 100644 index 338ed26aa417..000000000000 --- a/stand/i386/libfirewire/dconsole.c +++ /dev/null @@ -1,127 +0,0 @@ -/*- - * Copyright (c) 2004 Hidetoshi Shimokawa - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include - -void fw_enable(void); -void fw_poll(void); - -static void dconsole_probe(struct console *cp); -static int dconsole_init(int arg); -static void dconsole_putchar(int c); -static int dconsole_getchar(void); -static int dconsole_ischar(void); - -static int dcons_started = 0; - -#define DCONS_BUF_SIZE (64*1024) -static struct dcons_softc sc[DCONS_NPORT]; -uint32_t dcons_paddr; - -/* The buffer must be allocated in BSS because: - * - The dcons driver in the kernel is initialized before VM/pmap is - * initialized, so that the buffer must be allocate in the region - * that is mapped at the very early boot state. - * - We expect identiy map only for regions before KERNLOAD - * (i386:4MB amd64:1MB). - * - It seems that heap in conventional memory(640KB) is not sufficient - * and we move it to high address as LOADER_SUPPORT_BZIP2. - * - BSS is placed in conventional memory. - */ -static char dcons_buffer[DCONS_BUF_SIZE + PAGE_SIZE]; - -struct console dconsole = { - "dcons", - "dumb console port", - 0, - dconsole_probe, - dconsole_init, - dconsole_putchar, - dconsole_getchar, - dconsole_ischar -}; - -#define DCONSOLE_AS_MULTI_CONSOLE 1 - -static void -dconsole_probe(struct console *cp) -{ - /* XXX check the BIOS equipment list? */ - cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); -#if DCONSOLE_AS_MULTI_CONSOLE - dconsole_init(0); - cp->c_flags |= (C_ACTIVEIN | C_ACTIVEOUT); -#endif -} - -static int -dconsole_init(int arg) -{ - char buf[16], *dbuf; - int size; - - if (dcons_started && arg == 0) - return 0; - dcons_started = 1; - - size = DCONS_BUF_SIZE; - dbuf = (char *)round_page((vm_offset_t)&dcons_buffer[0]); - dcons_paddr = VTOP(dbuf); - sprintf(buf, "0x%08x", dcons_paddr); - setenv("dcons.addr", buf, 1); - - dcons_init((struct dcons_buf *)dbuf, size, sc); - sprintf(buf, "%d", size); - setenv("dcons.size", buf, 1); - fw_enable(); - return(0); -} - -static void -dconsole_putchar(int c) -{ - dcons_putc(&sc[0], c); -} - -static int -dconsole_getchar(void) -{ - fw_poll(); - return (dcons_checkc(&sc[0])); -} - -static int -dconsole_ischar(void) -{ - fw_poll(); - return (dcons_ischar(&sc[0])); -} diff --git a/stand/i386/libfirewire/firewire.c b/stand/i386/libfirewire/firewire.c deleted file mode 100644 index c4e4bdaa065f..000000000000 --- a/stand/i386/libfirewire/firewire.c +++ /dev/null @@ -1,485 +0,0 @@ -/*- - * Copyright (c) 2004 Hidetoshi Shimokawa - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * FireWire disk device handling. - * - */ - -#include - -#include - -#include - -#include -#include -#include -#include -#include "fwohci.h" -#include - -/* XXX */ -#define BIT4x2(x,y) uint8_t y:4, x:4 -#define BIT16x2(x,y) uint32_t y:16, x:16 -#define _KERNEL -#include - -extern uint32_t dcons_paddr; -extern struct console dconsole; - -struct crom_src_buf { - struct crom_src src; - struct crom_chunk root; - struct crom_chunk vendor; - struct crom_chunk hw; - /* for dcons */ - struct crom_chunk unit; - struct crom_chunk spec; - struct crom_chunk ver; -}; - -static int fw_init(void); -static int fw_strategy(void *devdata, int flag, daddr_t dblk, - size_t size, char *buf, size_t *rsize); -static int fw_open(struct open_file *f, ...); -static int fw_close(struct open_file *f); -static int fw_print(int verbose); -static void fw_cleanup(void); - -void fw_enable(void); - -struct devsw fwohci = { - .dv_name = "FW1394", /* 7 chars at most */ - .dv_type = DEVT_NET, - .dv_init = fw_init, - .dv_strategy = fw_strategy, - .dv_open = fw_open, - .dv_close = fw_close, - .dv_ioctl = noioctl, - .dv_print = fw_print, - .dv_cleanup = fw_cleanup, -}; - -static struct fwohci_softc fwinfo[MAX_OHCI]; -static int fw_initialized = 0; - -static void -fw_probe(int index, struct fwohci_softc *sc) -{ - int err; - - sc->state = FWOHCI_STATE_INIT; - err = biospci_find_devclass( - 0x0c0010 /* Serial:FireWire:OHCI */, - index /* index */, - &sc->locator); - - if (err != 0) { - sc->state = FWOHCI_STATE_DEAD; - return; - } - - biospci_write_config(sc->locator, - 0x4 /* command */, - BIOSPCI_16BITS, - 0x6 /* enable bus master and memory mapped I/O */); - - biospci_read_config(sc->locator, 0x00 /*devid*/, BIOSPCI_32BITS, - &sc->devid); - biospci_read_config(sc->locator, 0x10 /*base_addr*/, BIOSPCI_32BITS, - &sc->base_addr); - - sc->handle = (uint32_t)PTOV(sc->base_addr); - sc->bus_id = OREAD(sc, OHCI_BUS_ID); - - return; -} - -static int -fw_init(void) -{ - int i, avail; - struct fwohci_softc *sc; - - if (fw_initialized) - return (0); - - avail = 0; - for (i = 0; i < MAX_OHCI; i ++) { - sc = &fwinfo[i]; - fw_probe(i, sc); - if (sc->state == FWOHCI_STATE_DEAD) - break; - avail ++; - break; - } - fw_initialized = 1; - - return (0); -} - - -/* - * Print information about OHCI chips - */ -static int -fw_print(int verbose) -{ - char line[80]; - int i, ret = 0; - struct fwohci_softc *sc; - - printf("%s devices:", fwohci.dv_name); - if ((ret = pager_output("\n")) != 0) - return (ret); - - for (i = 0; i < MAX_OHCI; i ++) { - sc = &fwinfo[i]; - if (sc->state == FWOHCI_STATE_DEAD) - break; - snprintf(line, sizeof(line), "%d: locator=0x%04x devid=0x%08x" - " base_addr=0x%08x handle=0x%08x bus_id=0x%08x\n", - i, sc->locator, sc->devid, - sc->base_addr, sc->handle, sc->bus_id); - ret = pager_output(line); - if (ret != 0) - break; - } - return (ret); -} - -static int -fw_open(struct open_file *f, ...) -{ -#if 0 - va_list ap; - struct i386_devdesc *dev; - struct open_disk *od; - int error; - - va_start(ap, f); - dev = va_arg(ap, struct i386_devdesc *); - va_end(ap); -#endif - - return (ENXIO); -} - -static int -fw_close(struct open_file *f) -{ - return (0); -} - -static void -fw_cleanup() -{ - struct dcons_buf *db; - - /* invalidate dcons buffer */ - if (dcons_paddr) { - db = (struct dcons_buf *)PTOV(dcons_paddr); - db->magic = 0; - } -} - -static int -fw_strategy(void *devdata, int rw, daddr_t dblk, size_t size, - char *buf, size_t *rsize) -{ - return (EIO); -} - -static void -fw_init_crom(struct fwohci_softc *sc) -{ - struct crom_src *src; - - printf("fw_init_crom\n"); - sc->crom_src_buf = (struct crom_src_buf *) - malloc(sizeof(struct crom_src_buf)); - if (sc->crom_src_buf == NULL) - return; - - src = &sc->crom_src_buf->src; - bzero(src, sizeof(struct crom_src)); - - /* BUS info sample */ - src->hdr.info_len = 4; - - src->businfo.bus_name = CSR_BUS_NAME_IEEE1394; - - src->businfo.irmc = 1; - src->businfo.cmc = 1; - src->businfo.isc = 1; - src->businfo.bmc = 1; - src->businfo.pmc = 0; - src->businfo.cyc_clk_acc = 100; - src->businfo.max_rec = sc->maxrec; - src->businfo.max_rom = MAXROM_4; -#define FW_GENERATION_CHANGEABLE 2 - src->businfo.generation = FW_GENERATION_CHANGEABLE; - src->businfo.link_spd = sc->speed; - - src->businfo.eui64.hi = sc->eui.hi; - src->businfo.eui64.lo = sc->eui.lo; - - STAILQ_INIT(&src->chunk_list); - - sc->crom_src = src; - sc->crom_root = &sc->crom_src_buf->root; -} - -static void -fw_reset_crom(struct fwohci_softc *sc) -{ - struct crom_src_buf *buf; - struct crom_src *src; - struct crom_chunk *root; - - printf("fw_reset\n"); - if (sc->crom_src_buf == NULL) - fw_init_crom(sc); - - buf = sc->crom_src_buf; - src = sc->crom_src; - root = sc->crom_root; - - STAILQ_INIT(&src->chunk_list); - - bzero(root, sizeof(struct crom_chunk)); - crom_add_chunk(src, NULL, root, 0); - crom_add_entry(root, CSRKEY_NCAP, 0x0083c0); /* XXX */ - /* private company_id */ - crom_add_entry(root, CSRKEY_VENDOR, CSRVAL_VENDOR_PRIVATE); -#ifdef __DragonFly__ - crom_add_simple_text(src, root, &buf->vendor, "DragonFly Project"); -#else - crom_add_simple_text(src, root, &buf->vendor, "FreeBSD Project"); -#endif -} - - -#define ADDR_HI(x) (((x) >> 24) & 0xffffff) -#define ADDR_LO(x) ((x) & 0xffffff) - -static void -dcons_crom(struct fwohci_softc *sc) -{ - struct crom_src_buf *buf; - struct crom_src *src; - struct crom_chunk *root; - - buf = sc->crom_src_buf; - src = sc->crom_src; - root = sc->crom_root; - - bzero(&buf->unit, sizeof(struct crom_chunk)); - - crom_add_chunk(src, root, &buf->unit, CROM_UDIR); - crom_add_entry(&buf->unit, CSRKEY_SPEC, CSRVAL_VENDOR_PRIVATE); - crom_add_simple_text(src, &buf->unit, &buf->spec, "FreeBSD"); - crom_add_entry(&buf->unit, CSRKEY_VER, DCONS_CSR_VAL_VER); - crom_add_simple_text(src, &buf->unit, &buf->ver, "dcons"); - crom_add_entry(&buf->unit, DCONS_CSR_KEY_HI, ADDR_HI(dcons_paddr)); - crom_add_entry(&buf->unit, DCONS_CSR_KEY_LO, ADDR_LO(dcons_paddr)); -} - -void -fw_crom(struct fwohci_softc *sc) -{ - struct crom_src *src; - void *newrom; - - fw_reset_crom(sc); - dcons_crom(sc); - - newrom = malloc(CROMSIZE); - src = &sc->crom_src_buf->src; - crom_load(src, (uint32_t *)newrom, CROMSIZE); - if (bcmp(newrom, sc->config_rom, CROMSIZE) != 0) { - /* Bump generation and reload. */ - src->businfo.generation++; - - /* Handle generation count wraps. */ - if (src->businfo.generation < 2) - src->businfo.generation = 2; - - /* Recalculate CRC to account for generation change. */ - crom_load(src, (uint32_t *)newrom, CROMSIZE); - bcopy(newrom, (void *)sc->config_rom, CROMSIZE); - } - free(newrom); -} - -static int -fw_busreset(struct fwohci_softc *sc) -{ - int count; - - if (sc->state < FWOHCI_STATE_ENABLED) { - printf("fwohci not enabled\n"); - return(CMD_OK); - } - fw_crom(sc); - fwohci_ibr(sc); - count = 0; - while (sc->state< FWOHCI_STATE_NORMAL) { - fwohci_poll(sc); - count ++; - if (count > 1000) { - printf("give up to wait bus initialize\n"); - return (-1); - } - } - printf("poll count = %d\n", count); - return (0); -} - -void -fw_enable(void) -{ - struct fwohci_softc *sc; - int i; - - if (fw_initialized == 0) - fw_init(); - - for (i = 0; i < MAX_OHCI; i ++) { - sc = &fwinfo[i]; - if (sc->state != FWOHCI_STATE_INIT) - break; - - sc->config_rom = (uint32_t *) - (((uint32_t)sc->config_rom_buf - + (CROMSIZE - 1)) & ~(CROMSIZE - 1)); -#if 0 - printf("configrom: %08p %08p\n", - sc->config_rom_buf, sc->config_rom); -#endif - if (fwohci_init(sc, 0) == 0) { - sc->state = FWOHCI_STATE_ENABLED; - fw_busreset(sc); - } else - sc->state = FWOHCI_STATE_DEAD; - } -} - -void -fw_poll(void) -{ - struct fwohci_softc *sc; - int i; - - if (fw_initialized == 0) - return; - - for (i = 0; i < MAX_OHCI; i ++) { - sc = &fwinfo[i]; - if (sc->state < FWOHCI_STATE_ENABLED) - break; - fwohci_poll(sc); - } -} - -#if 0 /* for debug */ -static int -fw_busreset_cmd(int argc, char *argv[]) -{ - struct fwohci_softc *sc; - int i; - - for (i = 0; i < MAX_OHCI; i ++) { - sc = &fwinfo[i]; - if (sc->state < FWOHCI_STATE_INIT) - break; - fw_busreset(sc); - } - return(CMD_OK); -} - -static int -fw_poll_cmd(int argc, char *argv[]) -{ - fw_poll(); - return(CMD_OK); -} - -static int -fw_enable_cmd(int argc, char *argv[]) -{ - fw_print(0); - fw_enable(); - return(CMD_OK); -} - - -static int -dcons_enable(int argc, char *argv[]) -{ - dconsole.c_init(0); - fw_enable(); - dconsole.c_flags |= C_ACTIVEIN | C_ACTIVEOUT; - return(CMD_OK); -} - -static int -dcons_read(int argc, char *argv[]) -{ - char c; - while (dconsole.c_ready()) { - c = dconsole.c_in(); - printf("%c", c); - } - printf("\r\n"); - return(CMD_OK); -} - -static int -dcons_write(int argc, char *argv[]) -{ - int len, i; - if (argc < 2) - return(CMD_OK); - - len = strlen(argv[1]); - for (i = 0; i < len; i ++) - dconsole.c_out(argv[1][i]); - dconsole.c_out('\r'); - dconsole.c_out('\n'); - return(CMD_OK); -} -COMMAND_SET(firewire, "firewire", "enable firewire", fw_enable_cmd); -COMMAND_SET(fwbusreset, "fwbusreset", "firewire busreset", fw_busreset_cmd); -COMMAND_SET(fwpoll, "fwpoll", "firewire poll", fw_poll_cmd); -COMMAND_SET(dcons, "dcons", "enable dcons", dcons_enable); -COMMAND_SET(dread, "dread", "read from dcons", dcons_read); -COMMAND_SET(dwrite, "dwrite", "write to dcons", dcons_write); -#endif diff --git a/stand/i386/libfirewire/fwohci.c b/stand/i386/libfirewire/fwohci.c deleted file mode 100644 index 85e6173dc9be..000000000000 --- a/stand/i386/libfirewire/fwohci.c +++ /dev/null @@ -1,474 +0,0 @@ -/* - * Copyright (c) 2003 Hidetoshi Shimokawa - * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the acknowledgement as bellow: - * - * This product includes software developed by K. Kobayashi and H. Shimokawa - * - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - * - */ - -#include -#include -#include - -#include -#include "fwohci.h" -#include -#include - -static uint32_t fwphy_wrdata ( struct fwohci_softc *, uint32_t, uint32_t); -static uint32_t fwphy_rddata ( struct fwohci_softc *, uint32_t); -int firewire_debug=0; - -#if 0 -#define device_printf(a, x, ...) printf("FW1394: " x, ## __VA_ARGS__) -#else -#define device_printf(a, x, ...) -#endif - -#define device_t int -#define DELAY(x) delay(x) - -#define MAX_SPEED 3 -#define MAXREC(x) (2 << (x)) -char *linkspeed[] = { - "S100", "S200", "S400", "S800", - "S1600", "S3200", "undef", "undef" -}; - -/* - * Communication with PHY device - */ -static uint32_t -fwphy_wrdata( struct fwohci_softc *sc, uint32_t addr, uint32_t data) -{ - uint32_t fun; - - addr &= 0xf; - data &= 0xff; - - fun = (PHYDEV_WRCMD | (addr << PHYDEV_REGADDR) | (data << PHYDEV_WRDATA)); - OWRITE(sc, OHCI_PHYACCESS, fun); - DELAY(100); - - return(fwphy_rddata( sc, addr)); -} - -static uint32_t -fwphy_rddata(struct fwohci_softc *sc, u_int addr) -{ - uint32_t fun, stat; - u_int i, retry = 0; - - addr &= 0xf; -#define MAX_RETRY 100 -again: - OWRITE(sc, FWOHCI_INTSTATCLR, OHCI_INT_REG_FAIL); - fun = PHYDEV_RDCMD | (addr << PHYDEV_REGADDR); - OWRITE(sc, OHCI_PHYACCESS, fun); - for ( i = 0 ; i < MAX_RETRY ; i ++ ){ - fun = OREAD(sc, OHCI_PHYACCESS); - if ((fun & PHYDEV_RDCMD) == 0 && (fun & PHYDEV_RDDONE) != 0) - break; - DELAY(100); - } - if(i >= MAX_RETRY) { - if (firewire_debug) - device_printf(sc->fc.dev, "phy read failed(1).\n"); - if (++retry < MAX_RETRY) { - DELAY(100); - goto again; - } - } - /* Make sure that SCLK is started */ - stat = OREAD(sc, FWOHCI_INTSTAT); - if ((stat & OHCI_INT_REG_FAIL) != 0 || - ((fun >> PHYDEV_REGADDR) & 0xf) != addr) { - if (firewire_debug) - device_printf(sc->fc.dev, "phy read failed(2).\n"); - if (++retry < MAX_RETRY) { - DELAY(100); - goto again; - } - } - if (firewire_debug || retry >= MAX_RETRY) - device_printf(sc->fc.dev, - "fwphy_rddata: 0x%x loop=%d, retry=%d\n", addr, i, retry); -#undef MAX_RETRY - return((fun >> PHYDEV_RDDATA )& 0xff); -} - - -static int -fwohci_probe_phy(struct fwohci_softc *sc, device_t dev) -{ - uint32_t reg, reg2; - int e1394a = 1; - int nport, speed; -/* - * probe PHY parameters - * 0. to prove PHY version, whether compliance of 1394a. - * 1. to probe maximum speed supported by the PHY and - * number of port supported by core-logic. - * It is not actually available port on your PC . - */ - OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_LPS); - DELAY(500); - - reg = fwphy_rddata(sc, FW_PHY_SPD_REG); - - if((reg >> 5) != 7 ){ - nport = reg & FW_PHY_NP; - speed = reg & FW_PHY_SPD >> 6; - if (speed > MAX_SPEED) { - device_printf(dev, "invalid speed %d (fixed to %d).\n", - speed, MAX_SPEED); - speed = MAX_SPEED; - } - device_printf(dev, - "Phy 1394 only %s, %d ports.\n", - linkspeed[speed], nport); - }else{ - reg2 = fwphy_rddata(sc, FW_PHY_ESPD_REG); - nport = reg & FW_PHY_NP; - speed = (reg2 & FW_PHY_ESPD) >> 5; - if (speed > MAX_SPEED) { - device_printf(dev, "invalid speed %d (fixed to %d).\n", - speed, MAX_SPEED); - speed = MAX_SPEED; - } - device_printf(dev, - "Phy 1394a available %s, %d ports.\n", - linkspeed[speed], nport); - - /* check programPhyEnable */ - reg2 = fwphy_rddata(sc, 5); -#if 0 - if (e1394a && (OREAD(sc, OHCI_HCCCTL) & OHCI_HCC_PRPHY)) { -#else /* XXX force to enable 1394a */ - if (e1394a) { -#endif - if (firewire_debug) - device_printf(dev, - "Enable 1394a Enhancements\n"); - /* enable EAA EMC */ - reg2 |= 0x03; - /* set aPhyEnhanceEnable */ - OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_PHYEN); - OWRITE(sc, OHCI_HCCCTLCLR, OHCI_HCC_PRPHY); - } else { - /* for safe */ - reg2 &= ~0x83; - } - reg2 = fwphy_wrdata(sc, 5, reg2); - } - sc->speed = speed; - - reg = fwphy_rddata(sc, FW_PHY_SPD_REG); - if((reg >> 5) == 7 ){ - reg = fwphy_rddata(sc, 4); - reg |= 1 << 6; - fwphy_wrdata(sc, 4, reg); - reg = fwphy_rddata(sc, 4); - } - return 0; -} - - -void -fwohci_reset(struct fwohci_softc *sc, device_t dev) -{ - int i, max_rec, speed; - uint32_t reg, reg2; - - /* Disable interrupts */ - OWRITE(sc, FWOHCI_INTMASKCLR, ~0); - - /* FLUSH FIFO and reset Transmitter/Receiver */ - OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_RESET); - if (firewire_debug) - device_printf(dev, "resetting OHCI..."); - i = 0; - while(OREAD(sc, OHCI_HCCCTL) & OHCI_HCC_RESET) { - if (i++ > 100) break; - DELAY(1000); - } - if (firewire_debug) - printf("done (loop=%d)\n", i); - - /* Probe phy */ - fwohci_probe_phy(sc, dev); - - /* Probe link */ - reg = OREAD(sc, OHCI_BUS_OPT); - reg2 = reg | OHCI_BUSFNC; - max_rec = (reg & 0x0000f000) >> 12; - speed = (reg & 0x00000007); - device_printf(dev, "Link %s, max_rec %d bytes.\n", - linkspeed[speed], MAXREC(max_rec)); - /* XXX fix max_rec */ - sc->maxrec = sc->speed + 8; - if (max_rec != sc->maxrec) { - reg2 = (reg2 & 0xffff0fff) | (sc->maxrec << 12); - device_printf(dev, "max_rec %d -> %d\n", - MAXREC(max_rec), MAXREC(sc->maxrec)); - } - if (firewire_debug) - device_printf(dev, "BUS_OPT 0x%x -> 0x%x\n", reg, reg2); - OWRITE(sc, OHCI_BUS_OPT, reg2); - - /* Initialize registers */ - OWRITE(sc, OHCI_CROMHDR, sc->config_rom[0]); - OWRITE(sc, OHCI_CROMPTR, VTOP(sc->config_rom)); -#if 0 - OWRITE(sc, OHCI_SID_BUF, sc->sid_dma.bus_addr); -#endif - OWRITE(sc, OHCI_HCCCTLCLR, OHCI_HCC_BIGEND); - OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_POSTWR); -#if 0 - OWRITE(sc, OHCI_LNKCTL, OHCI_CNTL_SID); -#endif - - /* Enable link */ - OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_LINKEN); -} - -int -fwohci_init(struct fwohci_softc *sc, device_t dev) -{ - int i, mver; - uint32_t reg; - uint8_t ui[8]; - -/* OHCI version */ - reg = OREAD(sc, OHCI_VERSION); - mver = (reg >> 16) & 0xff; - device_printf(dev, "OHCI version %x.%x (ROM=%d)\n", - mver, reg & 0xff, (reg>>24) & 1); - if (mver < 1 || mver > 9) { - device_printf(dev, "invalid OHCI version\n"); - return (ENXIO); - } - -/* Available Isochronous DMA channel probe */ - OWRITE(sc, OHCI_IT_MASK, 0xffffffff); - OWRITE(sc, OHCI_IR_MASK, 0xffffffff); - reg = OREAD(sc, OHCI_IT_MASK) & OREAD(sc, OHCI_IR_MASK); - OWRITE(sc, OHCI_IT_MASKCLR, 0xffffffff); - OWRITE(sc, OHCI_IR_MASKCLR, 0xffffffff); - for (i = 0; i < 0x20; i++) - if ((reg & (1 << i)) == 0) - break; - device_printf(dev, "No. of Isochronous channels is %d.\n", i); - if (i == 0) - return (ENXIO); - -#if 0 -/* SID receive buffer must align 2^11 */ -#define OHCI_SIDSIZE (1 << 11) - sc->sid_buf = fwdma_malloc(&sc->fc, OHCI_SIDSIZE, OHCI_SIDSIZE, - &sc->sid_dma, BUS_DMA_WAITOK); - if (sc->sid_buf == NULL) { - device_printf(dev, "sid_buf alloc failed."); - return ENOMEM; - } -#endif - - sc->eui.hi = OREAD(sc, FWOHCIGUID_H); - sc->eui.lo = OREAD(sc, FWOHCIGUID_L); - for( i = 0 ; i < 8 ; i ++) - ui[i] = FW_EUI64_BYTE(&sc->eui,i); - device_printf(dev, "EUI64 %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", - ui[0], ui[1], ui[2], ui[3], ui[4], ui[5], ui[6], ui[7]); - fwohci_reset(sc, dev); - - return 0; -} - -void -fwohci_ibr(struct fwohci_softc *sc) -{ - uint32_t fun; - - device_printf(sc->dev, "Initiate bus reset\n"); - - /* - * Make sure our cached values from the config rom are - * initialised. - */ - OWRITE(sc, OHCI_CROMHDR, ntohl(sc->config_rom[0])); - OWRITE(sc, OHCI_BUS_OPT, ntohl(sc->config_rom[2])); - - /* - * Set root hold-off bit so that non cyclemaster capable node - * shouldn't became the root node. - */ -#if 1 - fun = fwphy_rddata(sc, FW_PHY_IBR_REG); - fun |= FW_PHY_IBR; - fun = fwphy_wrdata(sc, FW_PHY_IBR_REG, fun); -#else /* Short bus reset */ - fun = fwphy_rddata(sc, FW_PHY_ISBR_REG); - fun |= FW_PHY_ISBR; - fun = fwphy_wrdata(sc, FW_PHY_ISBR_REG, fun); -#endif -} - - -void -fwohci_sid(struct fwohci_softc *sc) -{ - uint32_t node_id; - int plen; - - node_id = OREAD(sc, FWOHCI_NODEID); - if (!(node_id & OHCI_NODE_VALID)) { -#if 0 - printf("Bus reset failure\n"); -#endif - return; - } - - /* Enable bus reset interrupt */ - OWRITE(sc, FWOHCI_INTMASK, OHCI_INT_PHY_BUS_R); - /* Allow async. request to us */ - OWRITE(sc, OHCI_AREQHI, 1 << 31); - /* XXX insecure ?? */ - OWRITE(sc, OHCI_PREQHI, 0x7fffffff); - OWRITE(sc, OHCI_PREQLO, 0xffffffff); - OWRITE(sc, OHCI_PREQUPPER, 0x10000); - /* Set ATRetries register */ - OWRITE(sc, OHCI_ATRETRY, 1<<(13+16) | 0xfff); -/* -** Checking whether the node is root or not. If root, turn on -** cycle master. -*/ - plen = OREAD(sc, OHCI_SID_CNT); - device_printf(fc->dev, "node_id=0x%08x, gen=%d, ", - node_id, (plen >> 16) & 0xff); - if (node_id & OHCI_NODE_ROOT) { - device_printf(sc->dev, "CYCLEMASTER mode\n"); - OWRITE(sc, OHCI_LNKCTL, - OHCI_CNTL_CYCMTR | OHCI_CNTL_CYCTIMER); - } else { - device_printf(sc->dev, "non CYCLEMASTER mode\n"); - OWRITE(sc, OHCI_LNKCTLCLR, OHCI_CNTL_CYCMTR); - OWRITE(sc, OHCI_LNKCTL, OHCI_CNTL_CYCTIMER); - } - if (plen & OHCI_SID_ERR) { - device_printf(fc->dev, "SID Error\n"); - return; - } - device_printf(sc->dev, "bus reset phase done\n"); - sc->state = FWOHCI_STATE_NORMAL; -} - -static void -fwohci_intr_body(struct fwohci_softc *sc, uint32_t stat, int count) -{ -#undef OHCI_DEBUG -#ifdef OHCI_DEBUG -#if 0 - if(stat & OREAD(sc, FWOHCI_INTMASK)) -#else - if (1) -#endif - device_printf(fc->dev, "INTERRUPT < %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s> 0x%08x, 0x%08x\n", - stat & OHCI_INT_EN ? "DMA_EN ":"", - stat & OHCI_INT_PHY_REG ? "PHY_REG ":"", - stat & OHCI_INT_CYC_LONG ? "CYC_LONG ":"", - stat & OHCI_INT_ERR ? "INT_ERR ":"", - stat & OHCI_INT_CYC_ERR ? "CYC_ERR ":"", - stat & OHCI_INT_CYC_LOST ? "CYC_LOST ":"", - stat & OHCI_INT_CYC_64SECOND ? "CYC_64SECOND ":"", - stat & OHCI_INT_CYC_START ? "CYC_START ":"", - stat & OHCI_INT_PHY_INT ? "PHY_INT ":"", - stat & OHCI_INT_PHY_BUS_R ? "BUS_RESET ":"", - stat & OHCI_INT_PHY_SID ? "SID ":"", - stat & OHCI_INT_LR_ERR ? "DMA_LR_ERR ":"", - stat & OHCI_INT_PW_ERR ? "DMA_PW_ERR ":"", - stat & OHCI_INT_DMA_IR ? "DMA_IR ":"", - stat & OHCI_INT_DMA_IT ? "DMA_IT " :"", - stat & OHCI_INT_DMA_PRRS ? "DMA_PRRS " :"", - stat & OHCI_INT_DMA_PRRQ ? "DMA_PRRQ " :"", - stat & OHCI_INT_DMA_ARRS ? "DMA_ARRS " :"", - stat & OHCI_INT_DMA_ARRQ ? "DMA_ARRQ " :"", - stat & OHCI_INT_DMA_ATRS ? "DMA_ATRS " :"", - stat & OHCI_INT_DMA_ATRQ ? "DMA_ATRQ " :"", - stat, OREAD(sc, FWOHCI_INTMASK) - ); -#endif -/* Bus reset */ - if(stat & OHCI_INT_PHY_BUS_R ){ - device_printf(fc->dev, "BUS reset\n"); - if (sc->state == FWOHCI_STATE_BUSRESET) - goto busresetout; - sc->state = FWOHCI_STATE_BUSRESET; - /* Disable bus reset interrupt until sid recv. */ - OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_PHY_BUS_R); - - OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_CYC_LOST); - OWRITE(sc, OHCI_LNKCTLCLR, OHCI_CNTL_CYCSRC); - - OWRITE(sc, OHCI_CROMHDR, ntohl(sc->config_rom[0])); - OWRITE(sc, OHCI_BUS_OPT, ntohl(sc->config_rom[2])); - } else if (sc->state == FWOHCI_STATE_BUSRESET) { - fwohci_sid(sc); - } -busresetout: - return; -} - -static uint32_t -fwochi_check_stat(struct fwohci_softc *sc) -{ - uint32_t stat; - - stat = OREAD(sc, FWOHCI_INTSTAT); - if (stat == 0xffffffff) { - device_printf(sc->fc.dev, - "device physically ejected?\n"); - return(stat); - } - if (stat) - OWRITE(sc, FWOHCI_INTSTATCLR, stat); - return(stat); -} - -void -fwohci_poll(struct fwohci_softc *sc) -{ - uint32_t stat; - - stat = fwochi_check_stat(sc); - if (stat != 0xffffffff) - fwohci_intr_body(sc, stat, 1); -} diff --git a/stand/i386/libfirewire/fwohci.h b/stand/i386/libfirewire/fwohci.h deleted file mode 100644 index 3c1d29013cda..000000000000 --- a/stand/i386/libfirewire/fwohci.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2007 Hidetoshi Shimokawa - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the acknowledgement as bellow: - * - * This product includes software developed by K. Kobayashi and H. Shimokawa - * - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - * - */ - -#define MAX_OHCI 5 -#define CROMSIZE 0x400 - -struct fwohci_softc { - uint32_t locator; - uint32_t devid; - uint32_t base_addr; - uint32_t bus_id; - uint32_t handle; - int32_t state; - struct crom_src_buf *crom_src_buf; - struct crom_src *crom_src; - struct crom_chunk *crom_root; - struct fw_eui64 eui; - int speed; - int maxrec; - uint32_t *config_rom; - char config_rom_buf[CROMSIZE*2]; /* double size for alignment */ -}; - -int fwohci_init(struct fwohci_softc *, int); -void fwohci_ibr(struct fwohci_softc *); -void fwohci_poll(struct fwohci_softc *); - -#define FWOHCI_STATE_DEAD (-1) -#define FWOHCI_STATE_INIT 0 -#define FWOHCI_STATE_ENABLED 1 -#define FWOHCI_STATE_BUSRESET 2 -#define FWOHCI_STATE_NORMAL 3 - -#define OREAD(f, o) (*(volatile uint32_t *)((f)->handle + (o))) -#define OWRITE(f, o, v) (*(volatile uint32_t *)((f)->handle + (o)) = (v)) - -#define OHCI_VERSION 0x00 -#define OHCI_ATRETRY 0x08 -#define OHCI_CROMHDR 0x18 -#define OHCI_BUS_ID 0x1c -#define OHCI_BUS_OPT 0x20 -#define OHCI_BUSIRMC (1U << 31) -#define OHCI_BUSCMC (1 << 30) -#define OHCI_BUSISC (1 << 29) -#define OHCI_BUSBMC (1 << 28) -#define OHCI_BUSPMC (1 << 27) -#define OHCI_BUSFNC OHCI_BUSIRMC | OHCI_BUSCMC | OHCI_BUSISC |\ - OHCI_BUSBMC | OHCI_BUSPMC - -#define OHCI_EUID_HI 0x24 -#define OHCI_EUID_LO 0x28 - -#define OHCI_CROMPTR 0x34 -#define OHCI_HCCCTL 0x50 -#define OHCI_HCCCTLCLR 0x54 -#define OHCI_AREQHI 0x100 -#define OHCI_AREQHICLR 0x104 -#define OHCI_AREQLO 0x108 -#define OHCI_AREQLOCLR 0x10c -#define OHCI_PREQHI 0x110 -#define OHCI_PREQHICLR 0x114 -#define OHCI_PREQLO 0x118 -#define OHCI_PREQLOCLR 0x11c -#define OHCI_PREQUPPER 0x120 - -#define OHCI_SID_BUF 0x64 -#define OHCI_SID_CNT 0x68 -#define OHCI_SID_ERR (1U << 31) -#define OHCI_SID_CNT_MASK 0xffc - -#define OHCI_IT_STAT 0x90 -#define OHCI_IT_STATCLR 0x94 -#define OHCI_IT_MASK 0x98 -#define OHCI_IT_MASKCLR 0x9c - -#define OHCI_IR_STAT 0xa0 -#define OHCI_IR_STATCLR 0xa4 -#define OHCI_IR_MASK 0xa8 -#define OHCI_IR_MASKCLR 0xac - -#define OHCI_LNKCTL 0xe0 -#define OHCI_LNKCTLCLR 0xe4 - -#define OHCI_PHYACCESS 0xec -#define OHCI_CYCLETIMER 0xf0 - -#define OHCI_DMACTL(off) (off) -#define OHCI_DMACTLCLR(off) (off + 4) -#define OHCI_DMACMD(off) (off + 0xc) -#define OHCI_DMAMATCH(off) (off + 0x10) - -#define OHCI_ATQOFF 0x180 -#define OHCI_ATQCTL OHCI_ATQOFF -#define OHCI_ATQCTLCLR (OHCI_ATQOFF + 4) -#define OHCI_ATQCMD (OHCI_ATQOFF + 0xc) -#define OHCI_ATQMATCH (OHCI_ATQOFF + 0x10) - -#define OHCI_ATSOFF 0x1a0 -#define OHCI_ATSCTL OHCI_ATSOFF -#define OHCI_ATSCTLCLR (OHCI_ATSOFF + 4) -#define OHCI_ATSCMD (OHCI_ATSOFF + 0xc) -#define OHCI_ATSMATCH (OHCI_ATSOFF + 0x10) - -#define OHCI_ARQOFF 0x1c0 -#define OHCI_ARQCTL OHCI_ARQOFF -#define OHCI_ARQCTLCLR (OHCI_ARQOFF + 4) -#define OHCI_ARQCMD (OHCI_ARQOFF + 0xc) -#define OHCI_ARQMATCH (OHCI_ARQOFF + 0x10) - -#define OHCI_ARSOFF 0x1e0 -#define OHCI_ARSCTL OHCI_ARSOFF -#define OHCI_ARSCTLCLR (OHCI_ARSOFF + 4) -#define OHCI_ARSCMD (OHCI_ARSOFF + 0xc) -#define OHCI_ARSMATCH (OHCI_ARSOFF + 0x10) - -#define OHCI_ITOFF(CH) (0x200 + 0x10 * (CH)) -#define OHCI_ITCTL(CH) (OHCI_ITOFF(CH)) -#define OHCI_ITCTLCLR(CH) (OHCI_ITOFF(CH) + 4) -#define OHCI_ITCMD(CH) (OHCI_ITOFF(CH) + 0xc) - -#define OHCI_IROFF(CH) (0x400 + 0x20 * (CH)) -#define OHCI_IRCTL(CH) (OHCI_IROFF(CH)) -#define OHCI_IRCTLCLR(CH) (OHCI_IROFF(CH) + 4) -#define OHCI_IRCMD(CH) (OHCI_IROFF(CH) + 0xc) -#define OHCI_IRMATCH(CH) (OHCI_IROFF(CH) + 0x10) diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index 3195cb00c6be..99a814497802 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -1,137 +1,132 @@ # $FreeBSD$ HAVE_ZFS= ${MK_LOADER_ZFS} LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes LOADER_EXT2FS_SUPPORT?= yes LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= yes .include LOADER?= loader_${LOADER_INTERP} PROG= ${LOADER}.sym INTERNALPROG= NEWVERSWHAT?= "bootstrap loader" x86 VERSION_FILE= ${.CURDIR}/../loader/version # # There's 640k - 40k maximum space, less however much memory the BIOS uses. A # non-random survey suggests that 20k-25k is a good value for 'most' machines. # We also need to subtract maximum stack usage (20-25k). # # So 640k - 40k - 25k - 25k = 550k = 563,200 bytes, but use 550,000 below for # some extra buffer for more complex setups and/or wider BIOS lomem variation. # # Some systems use more stack or have BIOS reserve more RAM (or both), and will # need to set this lower in /etc/src.conf if the above buffer is too small. # # sudo dd if=/dev/mem bs=1 iseek=0x413 count=2 | hd -d # # will tell you how many kiB of lomem are available. # LOADERSIZE?= 550000 # Largest known safe size for loader.bin .PATH: ${BOOTSRC}/i386/loader # architecture-specific loader code SRCS= main.c conf.c vers.c chain.c gfx_fb.c 8x16.c CFLAGS.gfx_fb.c += -I${.CURDIR}/../libi386 CFLAGS.gfx_fb.c += -I$(SRCTOP)/sys/teken CFLAGS.gfx_fb.c += -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 CFLAGS.gfx_fb.c += -I${SRCTOP}/contrib/pnglite CFLAGS.gfx_fb.c += -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib # Include bcache code. HAVE_BCACHE= yes # Enable PnP and ISA-PnP code. HAVE_PNP= yes HAVE_ISABUS= yes -.if ${MK_LOADER_FIREWIRE} == "yes" -CFLAGS+= -DLOADER_FIREWIRE_SUPPORT -LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a -.endif - .if ${MK_LOADER_ZFS} == "yes" CFLAGS.main.c+= -I${SYSDIR}/contrib/openzfs/include CFLAGS.main.c+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs .endif .if exists(${.CURDIR}/help.i386) HELP_FILES= ${.CURDIR}/help.i386 .endif # Always add MI sources .include "${BOOTSRC}/loader.mk" CLEANFILES+= ${LOADER} ${LOADER}.bin 8x16.c ORG= 0x0 CFLAGS+= -Wall LDFLAGS+= -static ${LDFLAGS_ORG} -Wl,--gc-sections .if ${LINKER_TYPE} == "lld" && ${LINKER_VERSION} >= 130000 # lld 13 and higher default to garbage collecting start/stop symbols, # completely ruining our linker sets. For now, work around it by # disabling this un-feature. LDFLAGS+= -Wl,-z,nostart-stop-gc .endif # i386 standalone support library LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a CFLAGS+= -I${BOOTSRC}/i386 # Debug me! #CFLAGS+= -g #LDFLAGS+= -g 8x16.c: ${SRCTOP}/contrib/terminus/ter-u16b.bdf vtfontcvt -f compressed-source -o ${.TARGET} ${.ALLSRC} ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ -b ${BTXKERN} ${LOADER}.bin ${LOADER}.bin: ${LOADER}.sym ${STRIPBIN} -R .comment -R .note -o ${.TARGET} ${.ALLSRC} @set -- `ls -l ${.TARGET}` ; x=$$((${LOADERSIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 .if ${MK_LOADER_ZFS} == "yes" && ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} LINKS+= ${BINDIR}/${LOADER} ${BINDIR}/zfsloader .endif .if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} LINKS+= ${BINDIR}/${LOADER} ${BINDIR}/loader .endif FILES+= ${LOADER} FILESMODE_${LOADER}= ${BINMODE} -b # Note: crt0.o needs to be first for pxeboot(8) to work. It assumes that the # startup code is located at the start of the loader and will jump # there. Although btx is more flexible than this, the emulated boot2 environment # that pxeldr provides has none of that flexibility assumes an entry point of # 0. In addition, pxeldr and cdboot assume that it is loading an a.out file. # # We must add it to the LDFLAGS instead of the OBJS because the former won't try # to clean it. When it is in OBJS, this cleaning can lead to races where # btxcrt.o is rebuilt, but boot2 isn't, leading to errors at installation time. # LDFLAGS does not have this baggage and will be included first in the list of # files. LDFLAGS+= ${BTXCRT} -DPADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBI386} ${LIBSA32} -LDADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBI386} ${LIBSA32} +DPADD= ${LDR_INTERP32} ${LIBI386} ${LIBSA32} +LDADD= ${LDR_INTERP32} ${LIBI386} ${LIBSA32} .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -DLOADER_PREFER_AMD64 .endif .include diff --git a/stand/i386/loader/conf.c b/stand/i386/loader/conf.c index 35052b5423cd..9d7f4c7b8144 100644 --- a/stand/i386/loader/conf.c +++ b/stand/i386/loader/conf.c @@ -1,167 +1,155 @@ /*- * Copyright (c) 1998 Michael Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include "libi386/libi386.h" #if defined(LOADER_ZFS_SUPPORT) #include "libzfs.h" #endif /* * We could use linker sets for some or all of these, but * then we would have to control what ended up linked into * the bootstrap. So it's easier to conditionalise things * here. * * XXX rename these arrays to be consistent and less namespace-hostile * * XXX as libi386 and biosboot merge, some of these can become linker sets. */ -#if defined(LOADER_FIREWIRE_SUPPORT) -extern struct devsw fwohci; -#endif extern struct devsw vdisk_dev; /* Exported for libsa */ struct devsw *devsw[] = { &biosfd, &bioscd, &bioshd, #if defined(LOADER_NFS_SUPPORT) || defined(LOADER_TFTP_SUPPORT) &pxedisk, -#endif -#if defined(LOADER_FIREWIRE_SUPPORT) - &fwohci, #endif &vdisk_dev, #if defined(LOADER_ZFS_SUPPORT) &zfs_dev, #endif NULL }; struct fs_ops *file_system[] = { #if defined(LOADER_ZFS_SUPPORT) &zfs_fsops, #endif #if defined(LOADER_UFS_SUPPORT) &ufs_fsops, #endif #if defined(LOADER_EXT2FS_SUPPORT) &ext2fs_fsops, #endif #if defined(LOADER_MSDOS_SUPPORT) &dosfs_fsops, #endif #if defined(LOADER_CD9660_SUPPORT) &cd9660_fsops, #endif #ifdef LOADER_NFS_SUPPORT &nfs_fsops, #endif #ifdef LOADER_TFTP_SUPPORT &tftp_fsops, #endif #ifdef LOADER_GZIP_SUPPORT &gzipfs_fsops, #endif #ifdef LOADER_BZIP2_SUPPORT &bzipfs_fsops, #endif #ifdef LOADER_SPLIT_SUPPORT &splitfs_fsops, #endif NULL }; /* Exported for i386 only */ /* * Sort formats so that those that can detect based on arguments * rather than reading the file go first. */ extern struct file_format i386_elf; extern struct file_format i386_elf_obj; extern struct file_format amd64_elf; extern struct file_format amd64_elf_obj; extern struct file_format multiboot; extern struct file_format multiboot_obj; struct file_format *file_formats[] = { &multiboot, &multiboot_obj, #ifdef LOADER_PREFER_AMD64 &amd64_elf, &amd64_elf_obj, #endif &i386_elf, &i386_elf_obj, #ifndef LOADER_PREFER_AMD64 &amd64_elf, &amd64_elf_obj, #endif NULL }; /* * Consoles * * We don't prototype these in libi386.h because they require * data structures from bootstrap.h as well. */ extern struct console vidconsole; extern struct console comconsole; -#if defined(LOADER_FIREWIRE_SUPPORT) -extern struct console dconsole; -#endif extern struct console nullconsole; extern struct console spinconsole; struct console *consoles[] = { &vidconsole, &comconsole, -#if defined(LOADER_FIREWIRE_SUPPORT) - &dconsole, -#endif &nullconsole, &spinconsole, NULL }; extern struct pnphandler isapnphandler; extern struct pnphandler biospnphandler; extern struct pnphandler biospcihandler; struct pnphandler *pnphandlers[] = { &biospnphandler, /* should go first, as it may set isapnp_readport */ &isapnphandler, &biospcihandler, NULL }; diff --git a/stand/i386/loader/main.c b/stand/i386/loader/main.c index 15d1c312b278..dd1a35daead0 100644 --- a/stand/i386/loader/main.c +++ b/stand/i386/loader/main.c @@ -1,466 +1,466 @@ /*- * Copyright (c) 1998 Michael Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); /* * MD bootstrap main() and assorted miscellaneous * commands. */ #include #include #include #include #include #include #include #include #include #include "bootstrap.h" #include "common/bootargs.h" #include "libi386/libi386.h" #include #include "btxv86.h" #ifdef LOADER_ZFS_SUPPORT #include #include "libzfs.h" #endif CTASSERT(sizeof(struct bootargs) == BOOTARGS_SIZE); CTASSERT(offsetof(struct bootargs, bootinfo) == BA_BOOTINFO); CTASSERT(offsetof(struct bootargs, bootflags) == BA_BOOTFLAGS); CTASSERT(offsetof(struct bootinfo, bi_size) == BI_SIZE); /* Arguments passed in from the boot1/boot2 loader */ static struct bootargs *kargs; static uint32_t initial_howto; static uint32_t initial_bootdev; static struct bootinfo *initial_bootinfo; struct arch_switch archsw; /* MI/MD interface boundary */ static void extract_currdev(void); static int isa_inb(int port); static void isa_outb(int port, int value); void exit(int code); #ifdef LOADER_GELI_SUPPORT #include "geliboot.h" struct geli_boot_args *gargs; struct geli_boot_data *gbdata; #endif #ifdef LOADER_ZFS_SUPPORT struct zfs_boot_args *zargs; static void i386_zfs_probe(void); #endif /* XXX debugging */ extern char end[]; static void *heap_top; static void *heap_bottom; caddr_t ptov(uintptr_t x) { return (PTOV(x)); } int main(void) { int i; /* Pick up arguments */ kargs = (void *)__args; initial_howto = kargs->howto; initial_bootdev = kargs->bootdev; initial_bootinfo = kargs->bootinfo ? (struct bootinfo *)PTOV(kargs->bootinfo) : NULL; /* Initialize the v86 register set to a known-good state. */ bzero(&v86, sizeof(v86)); v86.efl = PSL_RESERVED_DEFAULT | PSL_I; /* * Initialise the heap as early as possible. * Once this is done, malloc() is usable. */ bios_getmem(); -#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || \ +#if defined(LOADER_BZIP2_SUPPORT) || \ defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) if (high_heap_size > 0) { heap_top = PTOV(high_heap_base + high_heap_size); heap_bottom = PTOV(high_heap_base); if (high_heap_base < memtop_copyin) memtop_copyin = high_heap_base; } else #endif { heap_top = (void *)PTOV(bios_basemem); heap_bottom = (void *)end; } setheap(heap_bottom, heap_top); /* * Now that malloc is usable, allocate a buffer for tslog and start * logging timestamps during the boot process. */ tslog_init(); /* * detect ACPI for future reference. This may set console to comconsole * if we do have ACPI SPCR table. */ biosacpi_detect(); /* * XXX Chicken-and-egg problem; we want to have console output early, * but some console attributes may depend on reading from eg. the boot * device, which we can't do yet. * * We can use printf() etc. once this is done. * If the previous boot stage has requested a serial console, * prefer that. */ bi_setboothowto(initial_howto); if (initial_howto & RB_MULTIPLE) { if (initial_howto & RB_SERIAL) setenv("console", "comconsole vidconsole", 1); else setenv("console", "vidconsole comconsole", 1); } else if (initial_howto & RB_SERIAL) { setenv("console", "comconsole", 1); } else if (initial_howto & RB_MUTE) { setenv("console", "nullconsole", 1); } cons_probe(); /* Set up currdev variable to have hooks in place. */ env_setenv("currdev", EV_VOLATILE | EV_NOHOOK, "", i386_setcurrdev, env_nounset); /* * Initialise the block cache. Set the upper limit. */ bcache_init(32768, 512); /* * Special handling for PXE and CD booting. */ if (kargs->bootinfo == 0) { /* * We only want the PXE disk to try to init itself in the below * walk through devsw if we actually booted off of PXE. */ if (kargs->bootflags & KARGS_FLAGS_PXE) pxe_enable(kargs->pxeinfo ? PTOV(kargs->pxeinfo) : NULL); else if (kargs->bootflags & KARGS_FLAGS_CD) bc_add(initial_bootdev); } archsw.arch_autoload = i386_autoload; archsw.arch_getdev = i386_getdev; archsw.arch_copyin = i386_copyin; archsw.arch_copyout = i386_copyout; archsw.arch_readin = i386_readin; archsw.arch_isainb = isa_inb; archsw.arch_isaoutb = isa_outb; archsw.arch_hypervisor = x86_hypervisor; #ifdef LOADER_ZFS_SUPPORT archsw.arch_zfs_probe = i386_zfs_probe; /* * zfsboot and gptzfsboot have always passed KARGS_FLAGS_ZFS, * so if that is set along with KARGS_FLAGS_EXTARG we know we * can interpret the extarg data as a struct zfs_boot_args. */ #define KARGS_EXTARGS_ZFS (KARGS_FLAGS_EXTARG | KARGS_FLAGS_ZFS) if ((kargs->bootflags & KARGS_EXTARGS_ZFS) == KARGS_EXTARGS_ZFS) { zargs = (struct zfs_boot_args *)(kargs + 1); } #endif /* LOADER_ZFS_SUPPORT */ #ifdef LOADER_GELI_SUPPORT /* * If we decided earlier that we have zfs_boot_args extarg data, * and it is big enough to contain the embedded geli data * (the early zfs_boot_args structs weren't), then init the gbdata * pointer accordingly. If there is extarg data which isn't * zfs_boot_args data, determine whether it is geli_boot_args data. * Recent versions of gptboot set KARGS_FLAGS_GELI to indicate that. * Earlier versions didn't, but we presume that's what we * have if the extarg size exactly matches the size of the * geli_boot_args struct during that pre-flag era. */ #define LEGACY_GELI_ARGS_SIZE 260 /* This can never change */ #ifdef LOADER_ZFS_SUPPORT if (zargs != NULL) { if (zargs->size > offsetof(struct zfs_boot_args, gelidata)) { gbdata = &zargs->gelidata; } } else #endif /* LOADER_ZFS_SUPPORT */ if ((kargs->bootflags & KARGS_FLAGS_EXTARG) != 0) { gargs = (struct geli_boot_args *)(kargs + 1); if ((kargs->bootflags & KARGS_FLAGS_GELI) || gargs->size == LEGACY_GELI_ARGS_SIZE) { gbdata = &gargs->gelidata; } } if (gbdata != NULL) import_geli_boot_data(gbdata); #endif /* LOADER_GELI_SUPPORT */ /* * March through the device switch probing for things. */ for (i = 0; devsw[i] != NULL; i++) if (devsw[i]->dv_init != NULL) (devsw[i]->dv_init)(); printf("BIOS %dkB/%dkB available memory\n", bios_basemem / 1024, bios_extmem / 1024); if (initial_bootinfo != NULL) { initial_bootinfo->bi_basemem = bios_basemem / 1024; initial_bootinfo->bi_extmem = bios_extmem / 1024; } /* detect SMBIOS for future reference */ smbios_detect(NULL); /* detect PCI BIOS for future reference */ biospci_detect(); printf("\n%s", bootprog_info); extract_currdev(); /* set $currdev and $loaddev */ autoload_font(true); bios_getsmap(); interact(); /* if we ever get here, it is an error */ return (1); } /* * Set the 'current device' by (if possible) recovering the boot device as * supplied by the initial bootstrap. * * XXX should be extended for netbooting. */ static void extract_currdev(void) { struct i386_devdesc new_currdev; #ifdef LOADER_ZFS_SUPPORT char buf[20]; char *bootonce; #endif int biosdev = -1; /* Assume we are booting from a BIOS disk by default */ new_currdev.dd.d_dev = &bioshd; /* new-style boot loaders such as pxeldr and cdldr */ if (kargs->bootinfo == 0) { if ((kargs->bootflags & KARGS_FLAGS_CD) != 0) { /* we are booting from a CD with cdboot */ new_currdev.dd.d_dev = &bioscd; new_currdev.dd.d_unit = bd_bios2unit(initial_bootdev); } else if ((kargs->bootflags & KARGS_FLAGS_PXE) != 0) { /* we are booting from pxeldr */ new_currdev.dd.d_dev = &pxedisk; new_currdev.dd.d_unit = 0; } else { /* we don't know what our boot device is */ new_currdev.disk.d_slice = -1; new_currdev.disk.d_partition = 0; biosdev = -1; } #ifdef LOADER_ZFS_SUPPORT } else if ((kargs->bootflags & KARGS_FLAGS_ZFS) != 0) { /* * zargs was set in main() if we have new style extended * argument */ if (zargs != NULL && zargs->size >= offsetof(struct zfs_boot_args, primary_pool)) { /* sufficient data is provided */ new_currdev.zfs.pool_guid = zargs->pool; new_currdev.zfs.root_guid = zargs->root; if (zargs->size >= sizeof(*zargs) && zargs->primary_vdev != 0) { sprintf(buf, "%llu", zargs->primary_pool); setenv("vfs.zfs.boot.primary_pool", buf, 1); sprintf(buf, "%llu", zargs->primary_vdev); setenv("vfs.zfs.boot.primary_vdev", buf, 1); } } else { /* old style zfsboot block */ new_currdev.zfs.pool_guid = kargs->zfspool; new_currdev.zfs.root_guid = 0; } new_currdev.dd.d_dev = &zfs_dev; if ((bootonce = malloc(VDEV_PAD_SIZE)) != NULL) { if (zfs_get_bootonce(&new_currdev, OS_BOOTONCE_USED, bootonce, VDEV_PAD_SIZE) == 0) { setenv("zfs-bootonce", bootonce, 1); } free(bootonce); (void) zfs_attach_nvstore(&new_currdev); } #endif } else if ((initial_bootdev & B_MAGICMASK) != B_DEVMAGIC) { /* The passed-in boot device is bad */ new_currdev.disk.d_slice = -1; new_currdev.disk.d_partition = 0; biosdev = -1; } else { new_currdev.disk.d_slice = B_SLICE(initial_bootdev) - 1; new_currdev.disk.d_partition = B_PARTITION(initial_bootdev); biosdev = initial_bootinfo->bi_bios_dev; /* * If we are booted by an old bootstrap, we have to guess at * the BIOS unit number. We will lose if there is more than * one disk type and we are not booting from the * lowest-numbered disk type (ie. SCSI when IDE also exists). */ if ((biosdev == 0) && (B_TYPE(initial_bootdev) != 2)) { /* * biosdev doesn't match major, assume harddisk */ biosdev = 0x80 + B_UNIT(initial_bootdev); } } /* * If we are booting off of a BIOS disk and we didn't succeed * in determining which one we booted off of, just use disk0: * as a reasonable default. */ if ((new_currdev.dd.d_dev->dv_type == bioshd.dv_type) && ((new_currdev.dd.d_unit = bd_bios2unit(biosdev)) == -1)) { printf("Can't work out which disk we are booting " "from.\nGuessed BIOS device 0x%x not found by " "probes, defaulting to disk0:\n", biosdev); new_currdev.dd.d_unit = 0; } #ifdef LOADER_ZFS_SUPPORT if (new_currdev.dd.d_dev->dv_type == DEVT_ZFS) init_zfs_boot_options(devformat(&new_currdev.dd)); #endif env_setenv("currdev", EV_VOLATILE, devformat(&new_currdev.dd), i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, devformat(&new_currdev.dd), env_noset, env_nounset); } COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); static int command_reboot(int argc, char *argv[]) { int i; for (i = 0; devsw[i] != NULL; ++i) if (devsw[i]->dv_cleanup != NULL) (devsw[i]->dv_cleanup)(); printf("Rebooting...\n"); delay(1000000); __exit(0); } /* provide this for panic, as it's not in the startup code */ void exit(int code) { __exit(code); } COMMAND_SET(heap, "heap", "show heap usage", command_heap); static int command_heap(int argc, char *argv[]) { mallocstats(); printf("heap base at %p, top at %p, upper limit at %p\n", heap_bottom, sbrk(0), heap_top); return (CMD_OK); } /* ISA bus access functions for PnP. */ static int isa_inb(int port) { return (inb(port)); } static void isa_outb(int port, int value) { outb(port, value); } #ifdef LOADER_ZFS_SUPPORT static void i386_zfs_probe(void) { char devname[32]; struct i386_devdesc dev; /* * Open all the disks we can find and see if we can reconstruct * ZFS pools from them. */ dev.dd.d_dev = &bioshd; for (dev.dd.d_unit = 0; bd_unit2bios(&dev) >= 0; dev.dd.d_unit++) { snprintf(devname, sizeof(devname), "%s%d:", bioshd.dv_name, dev.dd.d_unit); zfs_probe_dev(devname, NULL); } } #endif diff --git a/tools/boot/universe.sh b/tools/boot/universe.sh index 6fcb496baf8c..20b89fb5dfe4 100755 --- a/tools/boot/universe.sh +++ b/tools/boot/universe.sh @@ -1,107 +1,98 @@ #!/bin/sh # $FreeBSD$ # # Full list of all arches we don't build. # # powerpc/powerpcspe riscv/riscv64sf arm/armv6 # # This script is expected to be run in stand (though you could run it anywhere # in the tree). It does a full clean build. For stand you can do all the archs in # about a minute or two on a fast machine. It's also possible that you need a full # make universe for this to work completely. # # Output is put into _.boot.$TARGET_ARCH.log in sys.boot. # die() { echo $* exit 1 } dobuild() { local ta=$1 local lf=$2 local opt=$3 echo -n "Building $ta ${opt} ... " objdir=$(make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make -V .OBJDIR" | tail -1) case ${objdir} in /*) ;; make*) echo Error message from make: $objdir continue ;; *) die Crazy object dir: $objdir ;; esac rm -rf ${objdir} if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend" \ > $lf 2>&1; then echo "Fail (cleanup)" continue fi if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make ${opt} -j 40 all" \ >> $lf 2>&1; then echo "Fail (build)" continue fi echo "Success" } top=$(make -V SRCTOP) cd $top/stand # Build without forth for i in \ arm64/aarch64 \ amd64/amd64 \ i386/i386 \ ; do ta=${i##*/} dobuild $ta _.boot.${ta}.no_forth.log "WITHOUT_FORTH=yes" done # Build without GELI for i in \ arm64/aarch64 \ amd64/amd64 \ i386/i386 \ ; do ta=${i##*/} dobuild $ta _.boot.${ta}.no_geli.log "WITHOUT_LOADER_GEIL=yes" done # Default build for a almost all architectures for i in \ amd64/amd64 \ arm/armv7 \ arm64/aarch64 \ i386/i386 \ powerpc/powerpc \ powerpc/powerpc64 \ powerpc/powerpc64le \ riscv/riscv64 \ ; do ta=${i##*/} dobuild $ta _.boot.${ta}.log "" done # Build w/o ZFS for i in \ arm64/aarch64 \ amd64/amd64 \ i386/i386 \ ; do ta=${i##*/} dobuild $ta _.boot.${ta}.no_zfs.log "MK_LOADER_ZFS=no" done - -# Build with firewire -for i in \ - amd64/amd64 \ - i386/i386 \ - ; do - ta=${i##*/} - dobuild $ta _.boot.${ta}.firewire.log "MK_LOADER_FIREWIRE=yes" -done diff --git a/tools/build/options/WITH_LOADER_FIREWIRE b/tools/build/options/WITH_LOADER_FIREWIRE deleted file mode 100644 index 0204357f4345..000000000000 --- a/tools/build/options/WITH_LOADER_FIREWIRE +++ /dev/null @@ -1,3 +0,0 @@ -.\" $FreeBSD$ -Enable firewire support in /boot/loader on x86. -This option is a nop on all other platforms.