From 62da5e13f7b1d2be2ff47ea2b41a6b6a525e4ab4 Mon Sep 17 00:00:00 2001 From: jh Date: Tue, 22 Nov 2011 16:44:50 +0000 Subject: Append unit number to the WMI status device name to allow attaching multiple acpi_wmi(4) instances. PR: kern/162491 Reviewed by: avg --- share/man/man4/acpi_wmi.4 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'share') diff --git a/share/man/man4/acpi_wmi.4 b/share/man/man4/acpi_wmi.4 index 6d93ff9..0825249 100644 --- a/share/man/man4/acpi_wmi.4 +++ b/share/man/man4/acpi_wmi.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2010 +.Dd November 22, 2011 .Dt ACPI_WMI 4 .Os .Sh NAME @@ -49,16 +49,16 @@ The .Nm driver provides an interface for vendor specific WMI implementations (e.g. HP and Acer laptops). -It creates /dev/wmistat, which can be read to get +It creates /dev/wmistat%d, which can be read to get information about GUIDs found in the system. .Sh FILES -.Bl -tag -width /dev/wmistat -compact -.It Pa /dev/wmistat +.Bl -tag -width /dev/wmistat%d -compact +.It Pa /dev/wmistat%d WMI status device. .El .Sh EXAMPLES .Bd -literal -# cat /dev/wmistat +# cat /dev/wmistat0 GUID INST EXPE METH STR EVENT OID {5FB7F034-2C63-45E9-BE91-3D44E2C707E4} 1 NO WMAA NO NO AA {95F24279-4D7B-4334-9387-ACCDC67EF61C} 1 NO NO NO 0x80+ - -- cgit v1.1 From c20986bc61d36fa343f74f7e5f03b4a356a00366 Mon Sep 17 00:00:00 2001 From: marius Date: Tue, 22 Nov 2011 19:31:43 +0000 Subject: - Add a DEVMETHOD_END alias for KOBJMETHOD_END so that along with 'driver_t' and DEVMETHOD() we can fully hide the explicit mention of kobj(9) from device drivers. - Update the example in driver.9 to use DEVMETHOD_END. Submitted by: jhb MFC after: 3 days --- share/man/man9/driver.9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/man/man9/driver.9 b/share/man/man9/driver.9 index 960c9ae..93ab992 100644 --- a/share/man/man9/driver.9 +++ b/share/man/man9/driver.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2010 +.Dd November 22, 2011 .Dt DRIVER 9 .Os .Sh NAME @@ -58,7 +58,7 @@ static device_method_t foo_methods[] = { DEVMETHOD(bogo_twiddle, foo_twiddle), /* Terminate method list */ - { 0, 0 } + DEVMETHOD_END }; static driver_t foo_driver = { -- cgit v1.1 From b5276a5d440b9f4954485149410c766095f71ba9 Mon Sep 17 00:00:00 2001 From: marius Date: Tue, 22 Nov 2011 21:49:29 +0000 Subject: Update to use DEVMETHOD_END. --- share/examples/drivers/make_device_driver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/examples/drivers/make_device_driver.sh b/share/examples/drivers/make_device_driver.sh index d7b9259..4796a0c 100755 --- a/share/examples/drivers/make_device_driver.sh +++ b/share/examples/drivers/make_device_driver.sh @@ -261,7 +261,7 @@ static device_method_t ${1}_methods[] = { DEVMETHOD(device_probe, ${1}_isa_probe), DEVMETHOD(device_attach, ${1}_isa_attach), DEVMETHOD(device_detach, ${1}_isa_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t ${1}_isa_driver = { -- cgit v1.1 From bb1376b565f11d1111c9b10e2b7e79aca7fb1aa3 Mon Sep 17 00:00:00 2001 From: des Date: Thu, 24 Nov 2011 13:13:50 +0000 Subject: Add CTF magic to the new .c.o rule. MFC after: 3 weeks --- share/mk/bsd.lib.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'share') diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 264f889..46b05da 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -69,6 +69,9 @@ PO_FLAG=-pg .c.o: ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ + (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) .c.po: ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} -- cgit v1.1 From 6b1253786db1ae2f5aececb06fc2c6aa974392ff Mon Sep 17 00:00:00 2001 From: fjoe Date: Thu, 24 Nov 2011 20:31:06 +0000 Subject: libodialog: disconnect from the build and obsolete. --- share/mk/bsd.libnames.mk | 1 - 1 file changed, 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index d3fb51a..c1fd38b 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -100,7 +100,6 @@ LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a LIBNGATM?= ${DESTDIR}${LIBDIR}/libngatm.a LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a -LIBODIALOG?= ${DESTDIR}${LIBDIR}/libodialog.a LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a # The static PAM library doesn't know its secondary dependencies, -- cgit v1.1 From 2f543fefda2636e391589aa9c133f78b3fbe31aa Mon Sep 17 00:00:00 2001 From: marius Date: Fri, 25 Nov 2011 19:29:21 +0000 Subject: Deorbit the broken amd(4) (see PR 124667), which was superseded by esp(4) as of r227006. --- share/man/man4/Makefile | 1 - share/man/man4/amd.4 | 78 ------------------------------------------------- 2 files changed, 79 deletions(-) delete mode 100644 share/man/man4/amd.4 (limited to 'share') diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 0d5a780..91edb50 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -32,7 +32,6 @@ MAN= aac.4 \ ale.4 \ alpm.4 \ altq.4 \ - amd.4 \ amdpm.4 \ ${_amdsbwd.4} \ ${_amdsmb.4} \ diff --git a/share/man/man4/amd.4 b/share/man/man4/amd.4 deleted file mode 100644 index ee42360..0000000 --- a/share/man/man4/amd.4 +++ /dev/null @@ -1,78 +0,0 @@ -.\" -.\" Copyright (c) 1999 Alexey Zelkin -.\" 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. 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$ -.\" -.Dd August 8, 2004 -.Dt AMD 4 -.Os -.Sh NAME -.Nm amd -.Nd amd53c974 PCI SCSI driver -.Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "device scbus" -.Cd "device amd" -.Ed -.Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -amd_load="YES" -.Ed -.Sh DESCRIPTION -The -.Nm -driver provides support for the -.Tn amd53c974 -based SCSI cards. -.Sh HARDWARE -Controllers supported by the -.Nm -driver include: -.Pp -.Bl -bullet -compact -.It -MELCO IFC-DP (PC-98) -.It -Tekram DC390 -.It -Tekram DC390T -.El -.Sh SEE ALSO -.Xr cd 4 , -.Xr ch 4 , -.Xr da 4 , -.Xr intro 4 , -.Xr sa 4 , -.Xr scsi 4 -.Sh AUTHORS -The -.Nm -driver was written and submitted to -.Fx -by Tekram, Inc. -- cgit v1.1 From 85d58c885455bf5b3bbe3d4ff65e93d6d4682de7 Mon Sep 17 00:00:00 2001 From: dim Date: Sat, 26 Nov 2011 03:26:06 +0000 Subject: Fix breakage after r227983; lib/libcxxrt still got built, because it was not disabled in the usual way (by adding it to __DEFAULT_NO_OPTIONS in share/mk/bsd.own.mk), and because the test for MK_LIBCPLUSPLUS in Makefile.inc1 was incorrect. Pointy hat to: dim --- share/mk/bsd.own.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 2d3617a..e0afdf4 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -413,6 +413,7 @@ __DEFAULT_NO_OPTIONS = \ HESIOD \ ICONV \ IDEA \ + LIBCPLUSPLUS \ OFED # @@ -553,8 +554,6 @@ MK_GCC:= no MK_GDB:= no .endif -MK_LIBCPLUSPLUS?= no - # # Set defaults for the MK_*_SUPPORT variables. # -- cgit v1.1 From b62a6b0ed16f8d1065b4e9c231c860e7b98e4f33 Mon Sep 17 00:00:00 2001 From: gjb Date: Sun, 27 Nov 2011 06:55:57 +0000 Subject: Remove a seemingly unnecessary [1] ellipsis from netmap.4. Spotted by: manlint [1] --- share/man/man4/netmap.4 | 1 - 1 file changed, 1 deletion(-) (limited to 'share') diff --git a/share/man/man4/netmap.4 b/share/man/man4/netmap.4 index 8b646f9..1ad574d 100644 --- a/share/man/man4/netmap.4 +++ b/share/man/man4/netmap.4 @@ -155,7 +155,6 @@ Some macros support the access to objects in the shared memory region. In particular: .Bd -literal struct netmap_if *nifp; -... struct netmap_ring *txring = NETMAP_TXRING(nifp, i); struct netmap_ring *rxring = NETMAP_RXRING(nifp, i); int i = txring->slot[txring->cur].buf_idx; -- cgit v1.1 From b433b3878b4c61dbde37ca63a1b435bdc22ede74 Mon Sep 17 00:00:00 2001 From: rwatson Date: Sun, 27 Nov 2011 19:44:15 +0000 Subject: Add an introductory Capsicum man page providing a high-level description of its mechanisms, pointing at other pertinent man pages, and cautioning about the experimental status of Capsicum in FreeBSD. MFC after: 3 days Sponsored by: Google, Inc. --- share/man/man4/Makefile | 1 + share/man/man4/capsicum.4 | 120 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 share/man/man4/capsicum.4 (limited to 'share') diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 91edb50..0707131 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -67,6 +67,7 @@ MAN= aac.4 \ bt.4 \ bwi.4 \ bwn.4 \ + capsicum.4 \ cardbus.4 \ carp.4 \ cas.4 \ diff --git a/share/man/man4/capsicum.4 b/share/man/man4/capsicum.4 new file mode 100644 index 0000000..980ab79 --- /dev/null +++ b/share/man/man4/capsicum.4 @@ -0,0 +1,120 @@ +.\" +.\" Copyright (c) 2011 Robert N. M. Watson +.\" Copyright (c) 2011 Jonathan Anderson +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd September 20, 2011 +.Dt CAPSICUM 4 +.Os +.Sh NAME +.Nm Capsicum +.Nd lightweight OS capability and sandbox framework +.Sh SYNOPSIS +.Cd "options CAPABILITY_MODE" +.Cd "options CAPABILITIES" +.Cd "options PROCDESC" +.Sh DESCRIPTION +.Nm +is a lightweight OS capability and sandbox framework implementing a hybrid +capability system model. +.Nm +can be used for application and library compartmentalisation, the +decomposition of larger bodies of software into isolated (sandboxed) +components in order to implement security policies and limit the impact of +software vulnerabilities. +.Pp +.Nm +provides two core kernel primitives: +.Bl -tag -width indent +.It capability mode +A process mode, entered by invoking +.Xr cap_enter 2 , +in which access to global OS namespaces (such as the file system and PID +namespaces) is restricted; only explicitly delegated rights, referenced by +memory mappings or file descriptors, may be used. +Once set, the flag is inherited by future children proceses, and may not be +cleared. +.It capabilities +File descriptors that wrap other file descriptors, masking operations that can +be called on them; for example, a file descriptor returned by +.Xr open 2 +may be refined using +.Xr cap_new 2 +so that only +.Xr read 2 +and +.Xr write 2 +can be called, but not +.Xr fchmod 2 . +.El +.Pp +In some cases, +.Nm +requires use of alternatives to traditional POSIX APIs in order to name +objects using capabilities rather than global namespaces: +.Bl -tag -width indent +.It process descriptors +File descriptors representing processes, allowing parent processes to manage +child processes without requiring access to the PID namespace. +.It anonymous shared memory +An extension to the POSIX shared memory API to support anonymous swap objects +associated with file descriptors. +.El +.Sh SEE ALSO +.Xr cap_enter 2 , +.Xr cap_getmode 2 , +.Xr cap_getrights 2 , +.Xr cap_new 2 , +.Xr fchmod 2 , +.Xr open 2 , +.Xr pdfork 2 , +.Xr pdgetpid 2 , +.Xr pdkill 2 , +.Xr pdwait4 2 , +.Xr read 2 , +.Xr shm_open 2 , +.Xr write 2 +.Sh HISTORY +.Nm +first appeared in +.Fx 9.0 , +and was developed at the University of Cambridge. +.Sh AUTHORS +.Nm +was developed by +.An -nosplit +.An "Robert Watson" Aq rwatson@FreeBSD.org +and +.An "Jonathan Anderson" Aq jonathan@FreeBSD.org +at the University of Cambridge, and +.An "Ben Laurie" Aq benl@FreeBSD.org +and +.An "Kris Kennaway" Aq kris@FreeBSD.org +at Google, Inc. +.Sh BUGS +.Nm +is considered experimental in +.Fx . -- cgit v1.1 From f3d31009fed04192b552b3f95e6940d10089fd7c Mon Sep 17 00:00:00 2001 From: philip Date: Mon, 28 Nov 2011 16:25:27 +0000 Subject: Only install the sfxge(4) manpage on amd64, while the driver is amd64-only. Pointed out by: bz --- share/man/man4/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 0707131..2da670c 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -378,7 +378,7 @@ MAN= aac.4 \ send.4 \ ses.4 \ sf.4 \ - sfxge.4 \ + ${_sfxge.4} \ sge.4 \ si.4 \ siba.4 \ @@ -718,6 +718,7 @@ MLINKS+=lindev.4 full.4 .if ${MACHINE_CPUARCH} == "amd64" _qlxgb.4= qlxgb.4 +_sfxge.4= sfxge.4 .endif .if ${MACHINE_CPUARCH} == "powerpc" -- cgit v1.1 From 45cfbee4328323423dde1eeceba82c852b7700fb Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 28 Nov 2011 17:58:57 +0000 Subject: Regenerate src.conf.5. --- share/man/man5/src.conf.5 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'share') diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 544344c..49b5527 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd June 17, 2011 +.Dd November 28, 2011 .Dt SRC.CONF 5 .Os .Sh NAME @@ -265,13 +265,13 @@ When set, it also enforces the following options: Set to not build the Clang C/C++ compiler. .Pp It is a default setting on -arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb, powerpc/powerpc64 and sparc64/sparc64. +arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb and sparc64/sparc64. .It Va WITH_CLANG .\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru Set to build the Clang C/C++ compiler. .Pp It is a default setting on -amd64/amd64, i386/i386, pc98/i386 and powerpc/powerpc. +amd64/amd64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build @@ -345,14 +345,14 @@ Set to not build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. .Pp It is a default setting on -amd64/amd64, i386/i386, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb, pc98/i386, powerpc/powerpc64 and sparc64/sparc64. +amd64/amd64, i386/i386, ia64/ia64, pc98/i386 and sparc64/sparc64. .It Va WITH_FDT .\" from FreeBSD: head/tools/build/options/WITH_FDT 221730 2011-05-10 11:14:40Z ru Set to build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. .Pp It is a default setting on -arm/arm, arm/armeb and powerpc/powerpc. +arm/arm, arm/armeb, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_FLOPPY .\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru Set to not build or install programs @@ -409,7 +409,7 @@ Set to build some programs without optional GNU support. .\" from FreeBSD: head/tools/build/options/WITHOUT_GPIB 156932 2006-03-21 07:50:50Z ru Set to not build GPIB bus support. .It Va WITHOUT_GPIO -.\" from FreeBSD: head/tools/build/options/WITHOUT_GPIO 221541 2011-05-06 19:14:06Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_GPIO 228081 2011-11-28 17:54:34Z dim Set to not build .Xr gpioctl 8 as part of the base system. @@ -563,6 +563,9 @@ and On amd64, set to not build 32-bit library set and a .Nm ld-elf32.so.1 runtime linker. +.It Va WITH_LIBCPLUSPLUS +.\" from FreeBSD: head/tools/build/options/WITH_LIBCPLUSPLUS 228082 2011-11-28 17:56:46Z dim +Set to build libcxxrt and libc++. .It Va WITHOUT_LIBPTHREAD .\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm Set to not build the @@ -734,7 +737,7 @@ Set to not build .Xr ntpd 8 and related programs. .It Va WITH_OFED -.\" from FreeBSD: head/tools/build/options/WITH_OFED 222016 2011-05-17 11:06:41Z ru +.\" from FreeBSD: head/tools/build/options/WITH_OFED 228081 2011-11-28 17:54:34Z dim Set to build the .Dq "OpenFabrics Enterprise Distribution" Infiniband software stack. -- cgit v1.1 From c986ef0cb9b8419ddca540949fcba800d44dcccc Mon Sep 17 00:00:00 2001 From: fjoe Date: Tue, 29 Nov 2011 08:20:23 +0000 Subject: Allow NO_FOO to override WITH_FOO that could be specified in /etc/src.conf. This is required to override knobs (e.g. WITH_PROFILE) during buildworld stages in Makefile.inc1 (otherwise the build is stopped due to both WITH_FOO and WITHOUT_FOO defined). --- share/mk/bsd.own.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'share') diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index e0afdf4..82ccefc 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -207,6 +207,9 @@ COMPRESS_EXT?= .gz MAN \ PROFILE .if defined(NO_${var}) +.if defined(WITH_${var}) +.undef WITH_${var} +.endif WITHOUT_${var}= .endif .endfor -- cgit v1.1 From 009670e1b3313d3f82eaae112e37d4479c304cd0 Mon Sep 17 00:00:00 2001 From: fjoe Date: Tue, 29 Nov 2011 08:38:47 +0000 Subject: Conditionalize ctfconvert/ctfmerge runs on make level (.if/.endif) instead of executing a shell on every object or executable/library file. This shaves off more than 30,000 shell invocations during buildworld. --- share/mk/bsd.lib.mk | 60 +++++++++++++-------------- share/mk/bsd.prog.mk | 12 +++--- share/mk/sys.mk | 114 +++++++++++++++++++++++++-------------------------- 3 files changed, 93 insertions(+), 93 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 46b05da..6132a75 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -75,15 +75,15 @@ PO_FLAG=-pg .c.po: ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .c.So: ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .cc.o: ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} @@ -96,47 +96,47 @@ PO_FLAG=-pg .f.po: ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .f.So: ${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .s.po .s.So: ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .asm.po: ${CC} -x assembler-with-cpp -DPROF ${PO_CFLAGS} ${ACFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .asm.So: ${CC} -x assembler-with-cpp ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .S.po: ${CC} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .S.So: ${CC} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif all: objwarn @@ -211,9 +211,9 @@ ${SHLIB_NAME}: ${SOBJS} -o ${.TARGET} -Wl,-soname,${SONAME} \ `NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD} .endif - @[ -z "${CTFMERGE}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS} && \ - ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}) +.if !defined(NO_CTF) + ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS} +.endif .endif .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index e71ce01..193ebb1 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -60,9 +60,9 @@ ${PROG}: ${OBJS} .else ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .endif - @[ -z "${CTFMERGE}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} && \ - ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}) +.if !defined(NO_CTF) + ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} +.endif .else # !defined(SRCS) @@ -90,9 +90,9 @@ ${PROG}: ${OBJS} .else ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .endif - @[ -z "${CTFMERGE}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} && \ - ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}) +.if !defined(NO_CTF) + ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} +.endif .endif .endif diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 1760573..d5577b1 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -158,15 +158,15 @@ YFLAGS ?= -d # SINGLE SUFFIX RULES .c: ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .f: ${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .sh: cp -f ${.IMPSRC} ${.TARGET} @@ -176,33 +176,33 @@ YFLAGS ?= -d .c.o: ${CC} ${CFLAGS} -c ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .f.o: ${FC} ${FFLAGS} -c ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .y.o: ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c y.tab.c rm -f y.tab.c mv y.tab.o ${.TARGET} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .l.o: ${LEX} ${LFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c lex.yy.c rm -f lex.yy.c mv lex.yy.o ${.TARGET} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .y.c: ${YACC} ${YFLAGS} ${.IMPSRC} @@ -240,15 +240,15 @@ YFLAGS ?= -d .c: ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .c.o: ${CC} ${CFLAGS} -c ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .cc .cpp .cxx .C: ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} @@ -258,15 +258,15 @@ YFLAGS ?= -d .m.o: ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .p.o: ${PC} ${PFLAGS} -c ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .e .r .F .f: ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} \ @@ -277,38 +277,38 @@ YFLAGS ?= -d .S.o: ${CC} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .asm.o: ${CC} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .s.o: ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif # XXX not -j safe .y.o: ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET} rm -f y.tab.c - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .l.o: ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c ${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET} rm -f ${.PREFIX}.tmp.c - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif # XXX not -j safe .y.c: @@ -320,34 +320,34 @@ YFLAGS ?= -d .s.out .c.out .o.out: ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .f.out .F.out .r.out .e.out: ${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \ ${LDLIBS} -o ${.TARGET} rm -f ${.PREFIX}.o - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif # XXX not -j safe .y.out: ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET} rm -f y.tab.c - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .l.out: ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c ${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET} rm -f ${.PREFIX}.tmp.c - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.if !defined(NO_CTF) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif # FreeBSD build pollution. Hide it in the non-POSIX part of the ifdef. __MAKE_CONF?=/etc/make.conf -- cgit v1.1 From 5f9c1025cef6244c48aa39fa82ea90d42586396c Mon Sep 17 00:00:00 2001 From: fjoe Date: Tue, 29 Nov 2011 16:34:44 +0000 Subject: - fix WITH_CTF when specified in /etc/src.conf [1] - CTFCONVERT_CMD=... is a hack (should be defined to empty string instead): make(1) should be taught to ignore empty commands silently in compat mode (as it does in !compat mode, GNU make also silently ignores empty commands) and to skip printing empty commands in !compat mode - config(8) should generate ${NORMAL_CTFCONVERT} invocation without '@': this will allow to simplify kern.pre.mk even more and lessen the number of shell invocations during kernel build when CTF is turned off - WITH_CTF can now be converted to usual MK_CTF=yes/no infrastructure Pointy hat to: fjoe [1] --- share/mk/bsd.lib.mk | 49 ++++++++----------------------- share/mk/bsd.own.mk | 6 ++++ share/mk/bsd.prog.mk | 11 ++----- share/mk/sys.mk | 82 ++++++++++++---------------------------------------- 4 files changed, 40 insertions(+), 108 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 6132a75..a575536 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -33,15 +33,10 @@ CFLAGS+= -DNDEBUG NO_WERROR= .endif -# Enable CTF conversion on request. -.if defined(WITH_CTF) -.undef NO_CTF -.endif - .if defined(DEBUG_FLAGS) CFLAGS+= ${DEBUG_FLAGS} -.if !defined(NO_CTF) && (${DEBUG_FLAGS:M-g} != "") +.if defined(WITH_CTF) && (${DEBUG_FLAGS:M-g} != "") CTFFLAGS+= -g .endif .endif @@ -69,21 +64,15 @@ PO_FLAG=-pg .c.o: ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} - @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ - (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) + ${CTFCONVERT_CMD} .c.po: ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .c.So: ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .cc.o: ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} @@ -96,47 +85,33 @@ PO_FLAG=-pg .f.po: ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .f.So: ${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .s.po .s.So: ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .asm.po: ${CC} -x assembler-with-cpp -DPROF ${PO_CFLAGS} ${ACFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .asm.So: ${CC} -x assembler-with-cpp ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \ -c ${.IMPSRC} -o ${.TARGET} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .S.po: ${CC} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .S.So: ${CC} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} all: objwarn @@ -211,7 +186,7 @@ ${SHLIB_NAME}: ${SOBJS} -o ${.TARGET} -Wl,-soname,${SONAME} \ `NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD} .endif -.if !defined(NO_CTF) +.if defined(WITH_CTF) ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS} .endif .endif diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 82ccefc..4791612 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -189,6 +189,12 @@ STRIP?= -s COMPRESS_CMD?= gzip -cn COMPRESS_EXT?= .gz +.if defined(WITH_CTF) +CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.else +CTFCONVERT_CMD= ... +.endif + .if !defined(_WITHOUT_SRCCONF) # # Define MK_* variables (which are either "yes" or "no") for users diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 193ebb1..f9801b0 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -15,16 +15,11 @@ CFLAGS+= -DNDEBUG NO_WERROR= .endif -# Enable CTF conversion on request. -.if defined(WITH_CTF) -.undef NO_CTF -.endif - .if defined(DEBUG_FLAGS) CFLAGS+=${DEBUG_FLAGS} CXXFLAGS+=${DEBUG_FLAGS} -.if !defined(NO_CTF) && (${DEBUG_FLAGS:M-g} != "") +.if defined(WITH_CTF) && (${DEBUG_FLAGS:M-g} != "") CTFFLAGS+= -g .endif .endif @@ -60,7 +55,7 @@ ${PROG}: ${OBJS} .else ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .endif -.if !defined(NO_CTF) +.if defined(WITH_CTF) ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} .endif @@ -90,7 +85,7 @@ ${PROG}: ${OBJS} .else ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .endif -.if !defined(NO_CTF) +.if defined(WITH_CTF) ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} .endif .endif diff --git a/share/mk/sys.mk b/share/mk/sys.mk index d5577b1..e8ec4c1 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -59,12 +59,6 @@ CFLAGS += -fno-strict-aliasing .endif PO_CFLAGS ?= ${CFLAGS} -# Turn CTF conversion off by default for now. This default could be -# changed later if DTrace becomes popular. -.if !defined(WITH_CTF) -NO_CTF = 1 -.endif - # C Type Format data is required for DTrace CTFFLAGS ?= -L VERSION @@ -158,15 +152,11 @@ YFLAGS ?= -d # SINGLE SUFFIX RULES .c: ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .f: ${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .sh: cp -f ${.IMPSRC} ${.TARGET} @@ -176,33 +166,25 @@ YFLAGS ?= -d .c.o: ${CC} ${CFLAGS} -c ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .f.o: ${FC} ${FFLAGS} -c ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .y.o: ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c y.tab.c rm -f y.tab.c mv y.tab.o ${.TARGET} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .l.o: ${LEX} ${LFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c lex.yy.c rm -f lex.yy.c mv lex.yy.o ${.TARGET} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .y.c: ${YACC} ${YFLAGS} ${.IMPSRC} @@ -240,15 +222,11 @@ YFLAGS ?= -d .c: ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .c.o: ${CC} ${CFLAGS} -c ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .cc .cpp .cxx .C: ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} @@ -258,15 +236,11 @@ YFLAGS ?= -d .m.o: ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .p.o: ${PC} ${PFLAGS} -c ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .e .r .F .f: ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} \ @@ -277,38 +251,28 @@ YFLAGS ?= -d .S.o: ${CC} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .asm.o: ${CC} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .s.o: ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} # XXX not -j safe .y.o: ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET} rm -f y.tab.c -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .l.o: ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c ${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET} rm -f ${.PREFIX}.tmp.c -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} # XXX not -j safe .y.c: @@ -320,34 +284,26 @@ YFLAGS ?= -d .s.out .c.out .o.out: ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .f.out .F.out .r.out .e.out: ${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \ ${LDLIBS} -o ${.TARGET} rm -f ${.PREFIX}.o -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} # XXX not -j safe .y.out: ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET} rm -f y.tab.c -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} .l.out: ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c ${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET} rm -f ${.PREFIX}.tmp.c -.if !defined(NO_CTF) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif + ${CTFCONVERT_CMD} # FreeBSD build pollution. Hide it in the non-POSIX part of the ifdef. __MAKE_CONF?=/etc/make.conf -- cgit v1.1 From d235e86b9ee4443c3e1bc35c770dd2e2f80634dc Mon Sep 17 00:00:00 2001 From: fjoe Date: Tue, 29 Nov 2011 19:46:17 +0000 Subject: Turn off profiled libs build by default. Can be enabled back using WITH_PROFILE=yes in /etc/src.conf --- share/mk/bsd.own.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 4791612..e2ab187 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -388,7 +388,6 @@ __DEFAULT_YES_OPTIONS = \ PMC \ PORTSNAP \ PPP \ - PROFILE \ QUOTAS \ RCMDS \ RCS \ @@ -423,7 +422,8 @@ __DEFAULT_NO_OPTIONS = \ ICONV \ IDEA \ LIBCPLUSPLUS \ - OFED + OFED \ + PROFILE # # Default behaviour of some options depends on the architecture. Unfortunately -- cgit v1.1 From 7570c54af71eaae2e318a65f6a61f24323d55b3d Mon Sep 17 00:00:00 2001 From: fjoe Date: Tue, 29 Nov 2011 20:06:27 +0000 Subject: CTFCONVERT_CMD=... hack does not work sufficiently well in parallel builds. Put a bandaid until make(1) is taught to ignore empty commands. --- share/mk/bsd.own.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index e2ab187..fe580a3 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -192,7 +192,7 @@ COMPRESS_EXT?= .gz .if defined(WITH_CTF) CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .else -CTFCONVERT_CMD= ... +CTFCONVERT_CMD= @: .endif .if !defined(_WITHOUT_SRCCONF) -- cgit v1.1 From f4904d54c66224509faadc55ae5e3461bb545466 Mon Sep 17 00:00:00 2001 From: fjoe Date: Wed, 30 Nov 2011 18:11:49 +0000 Subject: - CTF knob is now implemented using common scheme: MK_CTF=yes/no is defined based on WITH/WITHOUT_CTF settings, default is WITHOUT_CTF, NO_CTF overrides WITH_CTF (used by Makefile.inc1) - CTFCONVERT_CMD/NORMAL_CTFCONVERT are now defined to empty string if make(1) can handle empty commands --- share/mk/bsd.lib.mk | 4 ++-- share/mk/bsd.own.mk | 17 +++++++++++------ share/mk/bsd.prog.mk | 6 +++--- 3 files changed, 16 insertions(+), 11 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index a575536..1e43921 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -36,7 +36,7 @@ NO_WERROR= .if defined(DEBUG_FLAGS) CFLAGS+= ${DEBUG_FLAGS} -.if defined(WITH_CTF) && (${DEBUG_FLAGS:M-g} != "") +.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" CTFFLAGS+= -g .endif .endif @@ -186,7 +186,7 @@ ${SHLIB_NAME}: ${SOBJS} -o ${.TARGET} -Wl,-soname,${SONAME} \ `NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD} .endif -.if defined(WITH_CTF) +.if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS} .endif .endif diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index fe580a3..55234e1 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -189,12 +189,6 @@ STRIP?= -s COMPRESS_CMD?= gzip -cn COMPRESS_EXT?= .gz -.if defined(WITH_CTF) -CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.else -CTFCONVERT_CMD= @: -.endif - .if !defined(_WITHOUT_SRCCONF) # # Define MK_* variables (which are either "yes" or "no") for users @@ -209,6 +203,7 @@ CTFCONVERT_CMD= @: # regardless of user's setting). # .for var in \ + CTF \ INSTALLLIB \ MAN \ PROFILE @@ -418,6 +413,7 @@ __DEFAULT_NO_OPTIONS = \ BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ + CTF \ HESIOD \ ICONV \ IDEA \ @@ -516,6 +512,7 @@ MK_BIND_ETC:= no .if ${MK_CDDL} == "no" MK_ZFS:= no +MK_CTF:= no .endif .if ${MK_CRYPT} == "no" @@ -616,6 +613,14 @@ MK_${vv:H}:= ${MK_${vv:T}} .endif .endfor +.if ${MK_CTF} != "no" +CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.elif ${MAKE_VERSION} >= 5201111300 +CTFCONVERT_CMD= +.else +CTFCONVERT_CMD= @: +.endif + .endif # !_WITHOUT_SRCCONF .endif # !target(____) diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index f9801b0..fae8366 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -19,7 +19,7 @@ NO_WERROR= CFLAGS+=${DEBUG_FLAGS} CXXFLAGS+=${DEBUG_FLAGS} -.if defined(WITH_CTF) && (${DEBUG_FLAGS:M-g} != "") +.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" CTFFLAGS+= -g .endif .endif @@ -55,7 +55,7 @@ ${PROG}: ${OBJS} .else ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .endif -.if defined(WITH_CTF) +.if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} .endif @@ -85,7 +85,7 @@ ${PROG}: ${OBJS} .else ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .endif -.if defined(WITH_CTF) +.if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} .endif .endif -- cgit v1.1 From 457df496e1065b8417ab72144e2000659c3141d1 Mon Sep 17 00:00:00 2001 From: fjoe Date: Wed, 30 Nov 2011 18:24:43 +0000 Subject: Regen. --- share/man/man5/src.conf.5 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'share') diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 49b5527..26719f9 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd November 28, 2011 +.Dd December 1, 2011 .Dt SRC.CONF 5 .Os .Sh NAME @@ -258,6 +258,8 @@ When set, it also enforces the following options: .Pp .Bl -item -compact .It +.Va WITHOUT_CTF +.It .Va WITHOUT_ZFS .El .It Va WITHOUT_CLANG @@ -300,6 +302,11 @@ When set, the following options are also in effect: .Va WITH_GSSAPI is set explicitly) .El +.It Va WITH_CTF +.\" $FreeBSD$ +Set to 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_CTM .\" from FreeBSD: head/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam Set to not build @@ -813,9 +820,9 @@ and related files. Set to not build .Xr ppp 8 and related programs. -.It Va WITHOUT_PROFILE -.\" from FreeBSD: head/tools/build/options/WITHOUT_PROFILE 156932 2006-03-21 07:50:50Z ru -Set to avoid compiling profiled libraries. +.It Va WITH_PROFILE +.\" from FreeBSD: head/tools/build/options/WITH_PROFILE 228143 2011-11-29 19:46:17Z fjoe +Set to build profiled libraries. .It Va WITHOUT_QUOTAS .\" from FreeBSD: head/tools/build/options/WITHOUT_QUOTAS 183242 2008-09-21 22:02:26Z sam Set to not build -- cgit v1.1 From 313c8641792060169fdcd62fee68db2c917149f5 Mon Sep 17 00:00:00 2001 From: lstewart Date: Thu, 1 Dec 2011 07:41:30 +0000 Subject: Add a man page describing the feed-forward clock kernel support, including how to enable and configure the functionality. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ Discussed with: Julien Ridoux (jridoux at unimelb edu au) Submitted by: Julien Ridoux (jridoux at unimelb edu au) --- share/man/man4/Makefile | 1 + share/man/man4/ffclock.4 | 128 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 share/man/man4/ffclock.4 (limited to 'share') diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 2da670c..b366dd5 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -123,6 +123,7 @@ MAN= aac.4 \ fdc.4 \ fdt.4 \ fdtbus.4 \ + ffclock.4 \ firewire.4 \ fpa.4 \ fwe.4 \ diff --git a/share/man/man4/ffclock.4 b/share/man/man4/ffclock.4 new file mode 100644 index 0000000..d47edb2 --- /dev/null +++ b/share/man/man4/ffclock.4 @@ -0,0 +1,128 @@ +.\" Copyright (c) 2011 The University of Melbourne +.\" All rights reserved. +.\" +.\" This documentation was written by Julien Ridoux at the University of +.\" Melbourne under sponsorship from the FreeBSD Foundation. +.\" +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd December 1, 2011 +.Dt FFCLOCK 4 +.Os +.Sh NAME +.Nm FFCLOCK +.Nd Feed-forward system clock +.Sh SYNOPSIS +.Cd options FFCLOCK +.Sh DESCRIPTION +The +.Xr ntpd 8 +daemon has been the dominant solution for system clock synchronisation for many +years, which has in turn influenced the design of the system clock. +The ntpd daemon implements a feedback control algorithm which has been +demonstrated to perform poorly in common use cases. +.Pp +Feed-forward clock synchronisation algorithms implemented by an appropriate +daemon, in concert with the +.Nm +kernel support, have been shown to provide highly robust and accurate clock +synchronisation. +In addition to time keeping, the +.Nm +kernel mechanism provides new timestamping capabilities and the ability to +use specialised clocks. +Feed-forward synchronisation is also very well suited for virtualised +environments, reducing the overhead of timekeeping in guests and ensuring +continued smooth operation of the system clock during guest live migration. +.Pp +The +.Nm +kernel support provides feed-forward timestamping functions within the kernel +and system calls to support feed-forward synchronisation daemons +.Po see +.Xr ffclock 2 +.Pc . +.Ss Kernel Options +The following kernel configuration options are related to +.Nm : +.Pp +.Bl -tag -width ".Dv FFCLOCK" -compact +.It Dv FFCLOCK +Enable feed-forward clock support. +.El +.Ss Configuration +When feed-forward clock support is compiled into the kernel, multiple system +clocks become available to choose from. +System clock configuration is possible via the +.Va kern.sysclock +.Xr sysctl 8 +tree which provides the following variables: +.Bl -tag -width " " -offset indent +.It Va kern.sysclock.active +Name of the current active system clock which is serving time. +Set to one of the names in +.Va kern.sysclock.available +in order to change the default active system clock. +.It Va kern.sysclock.available +Lists the names of available system clocks +.Po +read only +.Pc . +.El +.Pp +Feed-forward system clock configuration is possible via the +.Va kern.sysclock.ffclock +sysctl tree which provides the following variables: +.Bl -tag -width " " -offset indent +.It Va kern.sysclock.ffclock.version +Feed-forward clock kernel version +.Po +read only +.Pc . +.It Va kern.sysclock.ffclock.ffcounter_bypass +Use reliable hardware timecounter as the feed-forward counter. +Will eventually be useful for virtualised environment like +.Xr xen 4 , +but currently does nothing. +.El +.Sh SEE ALSO +.Xr clock_gettime 2 , +.Xr ffclock 2 , +.Xr bpf 4 , +.Xr sysctl 8 +.Sh HISTORY +Feed-forward clock support first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The feed-forward clock support was written by +.An Julien Ridoux Aq jridoux@unimelb.edu.au +in collaboration with +.An Darryl Veitch Aq dveitch@unimelb.edu.au +at the University of Melbourne under sponsorship from the FreeBSD Foundation. +.Pp +This manual page was written by +.An Julien Ridoux Aq jridoux@unimelb.edu.au +and +.An Lawrence Stewart Aq lstewart@FreeBSD.org . -- cgit v1.1 From f8cf30568102c9c0f13da1b96663247c0637fe32 Mon Sep 17 00:00:00 2001 From: fjoe Date: Fri, 2 Dec 2011 09:09:54 +0000 Subject: Revert to conservative defaults. WITH_PROFILE is a default now. NO_PROFILE overrides in Makefile.inc1 and bsd.own.m are left intact so that the reversal to the WITHOUT_PROFILE will be easier in future. --- share/mk/bsd.own.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 55234e1..9a51608 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -383,6 +383,7 @@ __DEFAULT_YES_OPTIONS = \ PMC \ PORTSNAP \ PPP \ + PROFILE \ QUOTAS \ RCMDS \ RCS \ @@ -418,8 +419,7 @@ __DEFAULT_NO_OPTIONS = \ ICONV \ IDEA \ LIBCPLUSPLUS \ - OFED \ - PROFILE + OFED # # Default behaviour of some options depends on the architecture. Unfortunately -- cgit v1.1 From 25bbb2595f2eeb26912bdcfce0e9a23fa5c0f8ae Mon Sep 17 00:00:00 2001 From: fjoe Date: Fri, 2 Dec 2011 09:28:19 +0000 Subject: Regen. --- share/man/man5/src.conf.5 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'share') diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 26719f9..ab5adc5 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd December 1, 2011 +.Dd December 2, 2011 .Dt SRC.CONF 5 .Os .Sh NAME @@ -303,7 +303,7 @@ When set, the following options are also in effect: is set explicitly) .El .It Va WITH_CTF -.\" $FreeBSD$ +.\" from FreeBSD: head/tools/build/options/WITH_CTF 228159 2011-11-30 18:22:44Z fjoe Set to 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. @@ -820,9 +820,9 @@ and related files. Set to not build .Xr ppp 8 and related programs. -.It Va WITH_PROFILE +.It Va WITHOUT_PROFILE .\" from FreeBSD: head/tools/build/options/WITH_PROFILE 228143 2011-11-29 19:46:17Z fjoe -Set to build profiled libraries. +Set to avoid compiling profiled libraries. .It Va WITHOUT_QUOTAS .\" from FreeBSD: head/tools/build/options/WITHOUT_QUOTAS 183242 2008-09-21 22:02:26Z sam Set to not build -- cgit v1.1 From 9be1bfa322fff9a906d73bb1d09940d86d489415 Mon Sep 17 00:00:00 2001 From: mav Date: Fri, 2 Dec 2011 12:52:33 +0000 Subject: Add hw.ahci.force tunable to control whether AHCI drivers should attach to known AHCI-capable chips (AMD/NVIDIA), configured for legacy emulation. Enabled by default to get additional performance and functionality of AHCI when it can't be enabled by BIOS. Can be disabled to honor BIOS settings if needed for some reason. MFC after: 1 month --- share/man/man4/ahci.4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man4/ahci.4 b/share/man/man4/ahci.4 index 68aea35..08e9013 100644 --- a/share/man/man4/ahci.4 +++ b/share/man/man4/ahci.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2011 +.Dd December 2, 2011 .Dt AHCI 4 .Os .Sh NAME @@ -96,6 +96,9 @@ A manual bus reset is needed on device hot-plug. .It Va hint.ahcich. Ns Ar X Ns Va .sata_rev setting to nonzero value limits maximum SATA revision (speed). Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. +.It Va hw.ahci.force +setting to nonzero value forces driver attach to some known AHCI-capable +chips even if they are configured for legacy IDE emulation. Default is 1. .El .Sh DESCRIPTION This driver provides the -- cgit v1.1 From 15257e476af152112d4b46d01f27f03350e922eb Mon Sep 17 00:00:00 2001 From: yongari Date: Fri, 2 Dec 2011 19:01:26 +0000 Subject: Add more controllers that support jumbo frame. --- share/man/man4/bge.4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'share') diff --git a/share/man/man4/bge.4 b/share/man/man4/bge.4 index cf0d84a..13a4aa6 100644 --- a/share/man/man4/bge.4 +++ b/share/man/man4/bge.4 @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 23, 2010 +.Dd December 2, 2011 .Dt BGE 4 .Os .Sh NAME @@ -82,9 +82,9 @@ copper gigabit transceivers, which support autonegotiation of 10, 100 and 1000Mbps modes in full or half duplex. .Pp -The BCM5700, BCM5701, BCM5702, BCM5703, BCM5704 and BCM5717 also support -jumbo frames, which can be configured -via the interface MTU setting. +The BCM5700, BCM5701, BCM5702, BCM5703, BCM5704, BCM5714, BCM5717, BCM5719, +BCM5720, BCM5780 and BCM57765 also support jumbo frames, which can be +configured via the interface MTU setting. Selecting an MTU larger than 1500 bytes with the .Xr ifconfig 8 utility configures the adapter to receive and transmit jumbo frames. -- cgit v1.1 From 43579bf1af85145e6078826428d1a755414bd00b Mon Sep 17 00:00:00 2001 From: jhibbits Date: Sat, 3 Dec 2011 14:03:53 +0000 Subject: Add myself to the relevant doc files. Approved by: nwhitehorn (mentor) --- share/misc/committers-src.dot | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share') diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index a0c2dd8..6043dcf 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -159,6 +159,7 @@ jchandra [label="Jayachandran C.\njchandra@FreeBSD.org\n2010/05/19"] jeff [label="Jeff Roberson\njeff@FreeBSD.org\n2002/02/21"] jh [label="Jaakko Heinonen\njh@FreeBSD.org\n2009/10/02"] jhb [label="John Baldwin\njhb@FreeBSD.org\n1999/08/23"] +jhibbits [label="Justin Hibbits\njhibbits@FreeBSD.org\n2011/11/30"] jilles [label="Jilles Tjoelker\njilles@FreeBSD.org\n2009/05/22"] jinmei [label="JINMEI Tatuya\njinmei@FreeBSD.org\n2007/03/17"] jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2005/07/06"] @@ -497,6 +498,7 @@ njl -> rpaulo njl -> sepotvin nwhitehorn -> andreast +nwhitehorn -> jhibbits obrien -> benno obrien -> groudier -- cgit v1.1 From f8f306b32a4ee9cf17446f1997817dafecceb424 Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 6 Dec 2011 09:12:11 +0000 Subject: Mention that Cold Presence Detection feature used for hot-plug detection when interface power management is enabled. --- share/man/man4/ahci.4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'share') diff --git a/share/man/man4/ahci.4 b/share/man/man4/ahci.4 index 08e9013..29abd8c 100644 --- a/share/man/man4/ahci.4 +++ b/share/man/man4/ahci.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2011 +.Dd December 6, 2011 .Dt AHCI 4 .Os .Sh NAME @@ -90,9 +90,9 @@ Some controllers, such as ICH8, do not implement modes 2 and 3 with NCQ used. Because of artificial entering latency, performance degradation in modes 4 and 5 is much smaller then in modes 2 and 3. .Pp -Note that interface Power Management is not compatible with -device presence detection. -A manual bus reset is needed on device hot-plug. +Note that interface Power Management complicates device presence detection. +A manual bus reset/rescan may be needed after device hot-plug, unless hardware +implements Cold Presence Detection. .It Va hint.ahcich. Ns Ar X Ns Va .sata_rev setting to nonzero value limits maximum SATA revision (speed). Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. -- cgit v1.1 From a56c72dcf2baa76870e19aeed748720318e27afc Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 6 Dec 2011 11:28:17 +0000 Subject: Force linker error when created shared library contains a relocation against text. Provide the override switch to turn off the strict behaviour. Apparently, openssl libcrypto needs it due to assembler code not being PIC. Discussed with: bf MFC after: 2 weeks --- share/mk/bsd.lib.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 1e43921..a4abe2f 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -167,6 +167,11 @@ SOBJS+= ${OBJS:.o=.So} .if defined(SHLIB_NAME) _LIBS+= ${SHLIB_NAME} +SOLINKOPTS= -shared -Wl,-x +.if !defined(ALLOW_SHARED_TEXTREL) +SOLINKOPTS+= -Wl,--fatal-warnings -Wl,--warn-shared-textrel +.endif + .if target(beforelinking) ${SHLIB_NAME}: ${SOBJS} beforelinking .else @@ -178,11 +183,11 @@ ${SHLIB_NAME}: ${SOBJS} @ln -fs ${.TARGET} ${SHLIB_LINK} .endif .if !defined(NM) - @${CC} ${LDFLAGS} ${SSP_CFLAGS} -shared -Wl,-x \ + @${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ -o ${.TARGET} -Wl,-soname,${SONAME} \ `lorder ${SOBJS} | tsort -q` ${LDADD} .else - @${CC} ${LDFLAGS} ${SSP_CFLAGS} -shared -Wl,-x \ + @${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ -o ${.TARGET} -Wl,-soname,${SONAME} \ `NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD} .endif -- cgit v1.1 From 18e9c445ab0f31a8d041d23c9f05ee4f7de1f49e Mon Sep 17 00:00:00 2001 From: pfg Date: Thu, 8 Dec 2011 22:33:37 +0000 Subject: Add myself as new committer: add PGP key and announce.. Approved by: jhb (mentor) --- share/misc/committers-src.dot | 1 + 1 file changed, 1 insertion(+) (limited to 'share') diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index 6043dcf..3f799c4 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -203,6 +203,7 @@ obrien [label="David E. O'Brien\nobrien@FreeBSD.org\n1996/10/29"] olli [label="Oliver Fromme\nolli@FreeBSD.org\n2008/02/14"] peadar [label="Peter Edwards\npeadar@FreeBSD.org\n2004/03/08"] peter [label="Peter Wemm\npeter@FreeBSD.org\n????/??/??"] +pfg [label="Pedro Giffuni\npfg@FreeBSD.org\n2011/12/01"] philip [label="Philip Paeps\nphilip@FreBSD.org\n2004/01/21"] phk [label="Poul-Henning Kamp\nphk@FreeBSD.org\n1994/02/21"] pho [label="Peter Holm\npho@FreeBSD.org\n2008/11/16"] -- cgit v1.1 From 9bcc23b7951d32298299c516ff06e92dff3a7651 Mon Sep 17 00:00:00 2001 From: gjb Date: Thu, 8 Dec 2011 23:58:26 +0000 Subject: As of r226865, daily_scrub_zfs_default_threshold is 35 days; document accordingly. PR: 162890 Submitted by: Oliver Hartmann (ohartman ! mail.zedat.fu-berlin.de) Patch by: Niclas Zeising (niclas.zeising ! gmail.com) MFC after: 1 week X-Need-MFC: r226865 --- share/man/man5/periodic.conf.5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index 3213615..540ef2e 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 15, 2010 +.Dd December 8, 2011 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -631,7 +631,7 @@ If the list is empty or not set, all zfs pools are scrubbed. .It Va daily_scrub_zfs_default_threshold .Pq Vt int Number of days between a scrub if no pool-specific threshold is set. -The default value if no value is set is 30. +If not set, the default value is 35, corresponding to 5 weeks. .It Va daily_scrub_zfs_ Ns Ao Ar poolname Ac Ns Va _threshold .Pq Vt int The same as -- cgit v1.1 From e24a24747620a375df38a58e7dda6ba531cd441b Mon Sep 17 00:00:00 2001 From: jh Date: Fri, 9 Dec 2011 13:15:19 +0000 Subject: - Fix markup. - Remove trailing whitespace. --- share/man/man9/sbuf.9 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/man/man9/sbuf.9 b/share/man/man9/sbuf.9 index d17b34c..3ea2db3 100644 --- a/share/man/man9/sbuf.9 +++ b/share/man/man9/sbuf.9 @@ -117,7 +117,7 @@ defined in .Pp Any errors encountered during the allocation or composition of the string will be latched in the data structure, -making a single error test at the end of the composition +making a single error test at the end of the composition sufficient to determine success or failure of the entire process. .Pp The @@ -391,7 +391,8 @@ function returns the actual string; only works on a finished .Fa sbuf . The -.Fn sbuf_len function returns the length of the string. +.Fn sbuf_len +function returns the length of the string. For an .Fa sbuf with an attached drain, @@ -482,7 +483,7 @@ being finished, or returns the error code from the drain if one is attached. .Pp The -.Fn sbuf_finish 3 +.Fn sbuf_finish 3 function (the userland version) will return zero for success and \-1 and set errno on error. .Sh EXAMPLES -- cgit v1.1 From a274e72947d9b0f3729b2d06c42826a43ec46097 Mon Sep 17 00:00:00 2001 From: jh Date: Fri, 9 Dec 2011 13:28:41 +0000 Subject: sbuf_data() hasn't returned NULL for overflowed buffers since r71721. --- share/man/man9/sbuf.9 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'share') diff --git a/share/man/man9/sbuf.9 b/share/man/man9/sbuf.9 index 3ea2db3..4ee05f4 100644 --- a/share/man/man9/sbuf.9 +++ b/share/man/man9/sbuf.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2011 +.Dd December 9, 2011 .Dt SBUF 9 .Os .Sh NAME @@ -463,12 +463,8 @@ function returns a non-zero value if the buffer has an overflow or drain error, and zero otherwise. .Pp The -.Fn sbuf_data -and .Fn sbuf_len -functions return -.Dv NULL -and \-1, respectively, if the buffer overflowed. +function returns \-1 if the buffer overflowed. .Pp The .Fn sbuf_copyin -- cgit v1.1 From 78a31892a11a2b9b16b67f57b6b262c74e510c3e Mon Sep 17 00:00:00 2001 From: yongari Date: Fri, 9 Dec 2011 19:17:51 +0000 Subject: After r228293, et(4) supports altq(4). --- share/man/man4/altq.4 | 3 ++- share/man/man4/et.4 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/man/man4/altq.4 b/share/man/man4/altq.4 index 90fe440..7b6fc4c 100644 --- a/share/man/man4/altq.4 +++ b/share/man/man4/altq.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2011 +.Dd December 9, 2011 .Dt ALTQ 4 .Os .Sh NAME @@ -134,6 +134,7 @@ They have been applied to the following hardware drivers: .Xr em 4 , .Xr ep 4 , .Xr epair 4 , +.Xr et 4 , .Xr fxp 4 , .Xr gem 4 , .Xr hme 4 , diff --git a/share/man/man4/et.4 b/share/man/man4/et.4 index f99b094..9b99470 100644 --- a/share/man/man4/et.4 +++ b/share/man/man4/et.4 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 25, 2010 +.Dd December 9, 2011 .Dt ET 4 .Os .Sh NAME @@ -156,6 +156,7 @@ to achieve TX interrupt moderation. The default value is 1000000000 (nanoseconds). .El .Sh SEE ALSO +.Xr altq 4 , .Xr arp 4 , .Xr miibus 4 , .Xr netintro 4 , -- cgit v1.1 From d15b8ff272c54c08ae581cf634ade03093703022 Mon Sep 17 00:00:00 2001 From: jimharris Date: Fri, 9 Dec 2011 20:23:58 +0000 Subject: Added jimharris. --- share/misc/committers-src.dot | 1 + 1 file changed, 1 insertion(+) (limited to 'share') diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index 3f799c4..b58713b 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -161,6 +161,7 @@ jh [label="Jaakko Heinonen\njh@FreeBSD.org\n2009/10/02"] jhb [label="John Baldwin\njhb@FreeBSD.org\n1999/08/23"] jhibbits [label="Justin Hibbits\njhibbits@FreeBSD.org\n2011/11/30"] jilles [label="Jilles Tjoelker\njilles@FreeBSD.org\n2009/05/22"] +jimharris [label="Jim Harris\njimharris@FreeBSD.org\n2011/12/09"] jinmei [label="JINMEI Tatuya\njinmei@FreeBSD.org\n2007/03/17"] jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2005/07/06"] jkoshy [label="A. Joseph Koshy\njkoshy@FreeBSD.org\n1998/05/13"] -- cgit v1.1 From 3e732791dc5be0163e2b6107cd440188becc86f1 Mon Sep 17 00:00:00 2001 From: gjb Date: Sun, 11 Dec 2011 19:53:11 +0000 Subject: Document the SVN variable needs to be set in make.conf(5) when SVN_UPDATE is set. PR: 163162 Submitted by: Oliver Hartmann Patch by: Benjamin Kaduk (original) MFC after: 1 week --- share/man/man5/make.conf.5 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man5/make.conf.5 b/share/man/man5/make.conf.5 index c424a1e..a0b362f 100644 --- a/share/man/man5/make.conf.5 +++ b/share/man/man5/make.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2011 +.Dd December 11, 2011 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -333,6 +333,12 @@ to update your .Pa src tree with .Dq Li "make update" . +Note that since a subversion client is not included in the base system, +you will need to set +.Va SVN +to the full path of a +.Xr svn 1 +binary. .It Va WWWSUPFILE .Pq Vt str The www -- cgit v1.1 From 405220fbc9446f7196efe65977d840b4009367ea Mon Sep 17 00:00:00 2001 From: gjb Date: Sun, 11 Dec 2011 20:01:37 +0000 Subject: Minor whitespace cleanup to make.conf(5). MFC after: 1 week X-MFC-With: 228418 --- share/man/man5/make.conf.5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/man/man5/make.conf.5 b/share/man/man5/make.conf.5 index a0b362f..d9967ea 100644 --- a/share/man/man5/make.conf.5 +++ b/share/man/man5/make.conf.5 @@ -500,7 +500,7 @@ rather than load the server's kernel. .Pq Vt bool Defining this and recompiling .Pa /usr/src/sys/boot/i386 -will add +will add .Xr dcons 4 console driver to .Xr loader 8 @@ -640,7 +640,7 @@ The default value is 0640. .Pq Vt str Additional maps to rebuild when using .Pa /etc/mail/Makefile . -The +The .Pa access , .Pa bitdomain , .Pa domaintable , -- cgit v1.1 From e31b2d85e24e129e3299181446c2edb578c54938 Mon Sep 17 00:00:00 2001 From: fabient Date: Mon, 12 Dec 2011 09:50:33 +0000 Subject: Add watchdog support for VIA south bridge chipset. Tested on VT8251, VX900 but CX700, VX800, VX855 should works. MFC after: 1 month Sponsored by: NETASQ --- share/man/man4/Makefile | 2 ++ share/man/man4/viawd.4 | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 share/man/man4/viawd.4 (limited to 'share') diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index b366dd5..5b41aea 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -499,6 +499,7 @@ MAN= aac.4 \ vga.4 \ vge.4 \ viapm.4 \ + ${_viawd.4} \ vinum.4 \ vkbd.4 \ vlan.4 \ @@ -711,6 +712,7 @@ _speaker.4= speaker.4 _spkr.4= spkr.4 _tpm.4= tpm.4 _urtw.4= urtw.4 +_viawd.4= viawd.4 _wpi.4= wpi.4 _xen.4= xen.4 diff --git a/share/man/man4/viawd.4 b/share/man/man4/viawd.4 new file mode 100644 index 0000000..47473cf --- /dev/null +++ b/share/man/man4/viawd.4 @@ -0,0 +1,79 @@ +.\"- +.\" Copyright (c) 2011 Fabien Thomas +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd December 7, 2011 +.Dt VIAWD 4 +.Os +.Sh NAME +.Nm viawd +.Nd device driver for VIA south bridge watchdog timer +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device viawd" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +viawd_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr watchdog 4 +support for the watchdog interrupt timer present on +VIA south bridge chipset (VT8251, CX700, VX800, VX855, VX900). +.Pp +The VIA south bridge have a built-in watchdog timer, +which can be enabled and disabled by user's program and set between +1 to 1023 seconds. +.Pp +The +.Nm +driver when unloaded with running watchdog will reschedule the watchdog +to 5 minutes. +.Sh SEE ALSO +.Xr watchdog 4 , +.Xr watchdog 8 , +.Xr watchdogd 8 , +.Xr watchdog 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver and this manual page were written by +.An Fabien Thomas Aq fabient@FreeBSD.org . -- cgit v1.1 From 805302f0990bd298651e1bbad8237f88d86255f6 Mon Sep 17 00:00:00 2001 From: eadler Date: Mon, 12 Dec 2011 21:12:07 +0000 Subject: - Add support for ASCII art splash screens in TheDraw format PR: kern/143370 Submitted by: Antony Mawer Reviewed by: gjb (doc) Reviewed by: des (style) Approved by: ed MFC after: 1 month --- share/man/man4/splash.4 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'share') diff --git a/share/man/man4/splash.4 b/share/man/man4/splash.4 index 29a9693..4b5f224 100644 --- a/share/man/man4/splash.4 +++ b/share/man/man4/splash.4 @@ -74,6 +74,14 @@ Bitmaps of other color depths will not be displayed. ZSoft PCX decoder. This decoder currently only supports version 5 8-bpp single-plane images. +.It Pa splash_txt.ko +TheDraw binary ASCII drawing file decoder. +Displays a text-mode 80x25 ASCII drawing, such as that produced by +the Binary save format in TheDraw. +This format consists of a sequence +of two byte pairs representing the 80x25 display, where the first byte +is the ASCII character to draw and the second byte indicates the +colors/attributes to use when drawing the character. .El .Pp The @@ -223,6 +231,16 @@ If the VESA support is statically linked to the kernel, it is not necessary to load the VESA module. Just load the bitmap file and the splash decoder module as in the first example above. +.Pp +To load a binary ASCII drawing and display this while booting, include the +following into your +.Pa /boot/loader.conf +: +.Bd -literal -offset indent +splash_txt_load="YES" +bitmap_load="YES" +bitmap_name="/boot/splash.bin" +.Ed .\".Sh DIAGNOSTICS .Sh SEE ALSO .Xr vidcontrol 1 , @@ -256,6 +274,15 @@ module was written by based on the .Pa splash_bmp code. +The +.Pa splash_txt +module was written by +.An Antony Mawer Aq antony@mawer.org +based on the +.Pa splash_bmp +code, with some additional inspiration from the +.Pa daemon_saver +code. .Sh CAVEATS Both the splash screen and the screen saver work with .Xr syscons 4 -- cgit v1.1 From 6487a966c893ce051413fd3dc82e9a1469109d43 Mon Sep 17 00:00:00 2001 From: ru Date: Tue, 13 Dec 2011 08:23:03 +0000 Subject: The "inet" keyword in the "ifconfig_IF_aliasN" is mandatory for IPv4 aliases to work since network.subr@197139. MFC after: 3 days --- share/man/man5/rc.conf.5 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index e4a058a..47a325b 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 23, 2011 +.Dd December 13, 2011 .Dt RC.CONF 5 .Os .Sh NAME @@ -1101,7 +1101,9 @@ ipv4_addrs_ed0="192.0.2.129/27 192.0.2.1-5/28" .Pp It is also possible to add IP alias entries using .Xr ifconfig 8 -syntax. +syntax with the +.Dq Li inet +keyword. Assuming that the interface in question was .Li ed0 , it might look @@ -1114,7 +1116,9 @@ ifconfig_ed0_alias1="inet 127.0.0.254 netmask 0xffffffff" And so on. For each .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n -entry that is found, +entry with the +.Dq Li inet +keyword that is found, its contents are passed to .Xr ifconfig 8 . Execution stops at the first unsuccessful access, so if -- cgit v1.1 From bb0222f95e3e892736f522401b02d2c2ba049fe7 Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 13 Dec 2011 11:13:28 +0000 Subject: - Fix different variable types use in different files after r121184, causing problems on amd64. - s/%lud/%lu/. MFC after: 1 month --- share/examples/scsi_target/scsi_cmds.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'share') diff --git a/share/examples/scsi_target/scsi_cmds.c b/share/examples/scsi_target/scsi_cmds.c index 10295d7..b0da04e 100644 --- a/share/examples/scsi_target/scsi_cmds.c +++ b/share/examples/scsi_target/scsi_cmds.c @@ -103,8 +103,8 @@ static struct targ_cdb_handlers cdb_handlers[] = { static struct scsi_inquiry_data inq_data; static struct initiator_state istates[MAX_INITIATORS]; extern int debug; -extern uint64_t volume_size; -extern size_t sector_size; +extern off_t volume_size; +extern u_int sector_size; extern size_t buf_size; cam_status @@ -609,7 +609,7 @@ start_io(struct ccb_accept_tio *atio, struct ccb_scsiio *ctio, int dir) if (dir == CAM_DIR_IN) { if (notaio) { if (debug) - warnx("read sync %lud @ block " OFF_FMT, + warnx("read sync %lu @ block " OFF_FMT, (unsigned long) (ctio->dxfer_len / sector_size), c_descr->offset / sector_size); @@ -625,7 +625,7 @@ start_io(struct ccb_accept_tio *atio, struct ccb_scsiio *ctio, int dir) } } else { if (debug) - warnx("read async %lud @ block " OFF_FMT, + warnx("read async %lu @ block " OFF_FMT, (unsigned long) (ctio->dxfer_len / sector_size), c_descr->offset / sector_size); @@ -725,7 +725,7 @@ tcmd_rdwr_done(struct ccb_accept_tio *atio, struct ccb_scsiio *ctio, a_descr->targ_req += ctio->dxfer_len; if (notaio) { if (debug) - warnx("write sync %lud @ block " + warnx("write sync %lu @ block " OFF_FMT, (unsigned long) (ctio->dxfer_len / sector_size), c_descr->offset / sector_size); @@ -742,7 +742,7 @@ tcmd_rdwr_done(struct ccb_accept_tio *atio, struct ccb_scsiio *ctio, tcmd_rdwr_done(atio, ctio, AIO_DONE); } else { if (debug) - warnx("write async %lud @ block " + warnx("write async %lu @ block " OFF_FMT, (unsigned long) (ctio->dxfer_len / sector_size), c_descr->offset / sector_size); -- cgit v1.1 From 145914e3e7153161b6dd67fdcd58c7a8201845bc Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 13 Dec 2011 21:26:33 +0000 Subject: Change targ(4) to use cdevpriv, instead of multiple character devices. Also update the manpage and the scsi_target example program accordingly. Discussed on: scsi@ Tested by: Chuck Tuffli --- share/examples/scsi_target/scsi_target.c | 16 +++++----------- share/man/man4/targ.4 | 18 +++++------------- 2 files changed, 10 insertions(+), 24 deletions(-) (limited to 'share') diff --git a/share/examples/scsi_target/scsi_target.c b/share/examples/scsi_target/scsi_target.c index e6ff5c71..6f665af 100644 --- a/share/examples/scsi_target/scsi_target.c +++ b/share/examples/scsi_target/scsi_target.c @@ -100,8 +100,8 @@ static void usage(void); int main(int argc, char *argv[]) { - int ch, unit; - char *file_name, targname[16]; + int ch; + char *file_name; u_int16_t req_flags, sim_flags; off_t user_size; @@ -283,17 +283,11 @@ main(int argc, char *argv[]) warnx("aio support tested ok"); } - /* Go through all the control devices and find one that isn't busy. */ - unit = 0; - do { - snprintf(targname, sizeof(targname), "/dev/targ%d", unit++); - targ_fd = open(targname, O_RDWR); - } while (targ_fd < 0 && errno == EBUSY); - + targ_fd = open("/dev/targ", O_RDWR); if (targ_fd < 0) - errx(1, "Tried to open %d devices, none available", unit); + err(1, "/dev/targ"); else - warnx("opened %s", targname); + warnx("opened /dev/targ"); /* The first three are handled by kevent() later */ signal(SIGHUP, SIG_IGN); diff --git a/share/man/man4/targ.4 b/share/man/man4/targ.4 index 5e78200..6c61735 100644 --- a/share/man/man4/targ.4 +++ b/share/man/man4/targ.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 15, 2002 +.Dd December 13, 2011 .Dt TARG 4 .Os .Sh NAME @@ -49,16 +49,8 @@ can be found in .Pp The .Nm -driver supplies control devices, -.Pa /dev/targ0 , -.Pa /dev/targ1 , -etc. -If a device is already in use, -.Xr open 2 -will fail and -.Va errno -will be set to -.Er EBUSY . +driver supplies the control device +.Pa /dev/targ . After opening the device, the file descriptor must be bound to a specific bus/target/LUN and enabled to process CCBs using the .Dv TARGIOCENABLE @@ -123,8 +115,8 @@ it. describes the usermode interface. .It Pa /sys/cam/scsi/scsi_target.c is the driver source file. -.It Pa /dev/targ* -are the control devices. +.It Pa /dev/targ +is the control device. .El .Sh SEE ALSO .Pa /usr/share/examples/scsi_target , -- cgit v1.1 From 3c35ef76bc22af433cddf684c023a14e91e11604 Mon Sep 17 00:00:00 2001 From: glebius Date: Wed, 14 Dec 2011 14:52:50 +0000 Subject: Update this page to describe modern interfaces. --- share/man/man9/rtalloc.9 | 261 ++++++++++++++++++++++++++--------------------- 1 file changed, 147 insertions(+), 114 deletions(-) (limited to 'share') diff --git a/share/man/man9/rtalloc.9 b/share/man/man9/rtalloc.9 index 31d5ebb..ab5379a 100644 --- a/share/man/man9/rtalloc.9 +++ b/share/man/man9/rtalloc.9 @@ -28,160 +28,163 @@ .\" .\" $FreeBSD$ .\" -.Dd December 11, 2008 +.Dd December 14, 2011 .Dt RTALLOC 9 .Os .Sh NAME -.Nm rtalloc , -.Nm rtalloc_ign , -.Nm rtalloc1 , -.Nm rtfree +.Nm rtalloc1_fib , +.Nm rtalloc_ign_fib , +.Nm rtalloc_fib .Nd look up a route in the kernel routing table .Sh SYNOPSIS .In sys/types.h .In sys/socket.h .In net/route.h -.Ft void -.Fn rtalloc "struct route *ro" -.Ft void -.Fn rtalloc_ign "struct route *ro" "u_long flags" .Ft "struct rtentry *" -.Fn rtalloc1 "struct sockaddr *sa" "int report" "u_long flags" +.Fn rtalloc1_fib "struct sockaddr *dst" "int report" "u_long flags" "u_int fibnum" .Ft void -.Fn rtfree "struct rt_entry *rt" +.Fn rtalloc_fib "struct route *ro" "u_int fibnum" +.Ft void +.Fn rtalloc_ign_fib "struct route *ro" "u_long flags" "u_int fibnum" +.Fn RTFREE_LOCKED "struct rt_entry *rt" .Fn RTFREE "struct rt_entry *rt" .Fn RT_LOCK "struct rt_entry *rt" .Fn RT_UNLOCK "struct rt_entry *rt" .Fn RT_ADDREF "struct rt_entry *rt" .Fn RT_REMREF "struct rt_entry *rt" +.Ft void +.Fn rtfree "struct rt_entry *rt" +.Ft "struct rtentry *" +.Fn rtalloc1 "struct sockaddr *dst" "int report" "u_long flags" +.Ft void +.Fn rtalloc "struct route *ro" +.Ft void +.Fn rtalloc_ign "struct route *ro" "u_long flags" +.Pp +.Cd options RADIX_MPATH .Sh DESCRIPTION The kernel uses a radix tree structure to manage routes for the networking subsystem. +If compiled with +.Cd options RADIX_MPATH +kernel may maintain several independent forwarding information databases (FIBs). The .Fn rtalloc -family of routines is used by protocols to query this structure for a +family of routines is used by protocols to query these structures for a route corresponding to a particular end-node address, and to cause certain protocol\- and interface-specific actions to take place. -.\" XXX - -mdoc should contain a standard request for getting em and -.\" en dashes. .Pp -.Dv RTF_PRCLONING -flag is obsolete and thus ignored by facility. -If the -.Dv RTF_XRESOLVE -flag is set, then the -.Dv RTM_RESOLVE -message is sent instead on the -.Xr route 4 -socket interface, requesting that an external program resolve the -address in question and modify the route appropriately. +The +.Fn rtalloc1_fib +function is the most general form of +.Fn rtalloc , +and all of the other forms are implemented as calls to it. +It takes a +.Fa "struct sockaddr *" +directly as the +.Fa dst +argument. +The second argument, +.Fa report , +controls whether the routing sockets are notified when a lookup fails. +The third argument, +.Fa flags , +is a combination of +the following values: +.Bl -item -offset indent +.It +.Dv RTF_RNH_LOCKED +indicates that the radix tree lock is already held +.El +.Pp +The last argument +.Fa fibnum +specifies number of forwarding information database (FIB) on which +the lookup should be performed. +In case of success the +.Fn rtalloc1_fib +function returns a pointer to a locked +.Vt "struct rtentry" +with an additional reference. .Pp -The default interface is -.Fn rtalloc . -Its only argument is +The +.Fn rtalloc_fib +is the most simple variant. +Its main argument is .Fa ro , a pointer to a -.Dq Li "struct route" , +.Fa "struct route" , which is defined as follows: .Bd -literal -offset indent struct route { - struct sockaddr ro_dst; struct rtentry *ro_rt; + struct llentry *ro_lle; + struct sockaddr ro_dst; }; .Ed .Pp Thus, this function can only be used for address families which are smaller than the default -.Dq Li "struct sockaddr" . +.Ft "struct sockaddr" . Before calling -.Fn rtalloc +.Fn rtalloc_fib for the first time, callers should ensure that unused bits of the structure are set to zero. +The second argument +.Fa fibnum +is FIB number. +In case of success of the +.Fn rtalloc_fib +the +.Fa ro_rt +points to a valid and unlocked +.Xr rtentry 9 , +which has an additional reference put on it, freeing which is +responsibility of the caller. On subsequent calls, -.Fn rtalloc +.Fn rtalloc_fib returns without performing a lookup if .Fa ro->ro_rt is non-null and the .Dv RTF_UP -flag is set in the route's -.Li rt_flags +flag is set in the rtentry's +.Fa rt_flags field. .Pp The -.Fn rtalloc_ign -interface can be used when the caller does not want to receive -the returned -.Fa rtentry -locked. -The -.Fa ro -argument is the same as -.Fn rtalloc , -but there is additionally a +.Fn rtalloc_ign_fib +function is the same as the +.Fn rtalloc_fib , +but there is additional .Fa flags -argument, which is now only used to pass -.Dv RTF_RNH_LOCKED -indicating that the radix tree lock is already held. -Both -.Fn rtalloc -and -.Fn rtalloc_ign -functions return a pointer to an unlocked -.Vt "struct rtentry" . +argument, which is same as in +.Fn rtalloc1_fib . .Pp The -.Fn rtalloc1 -function is the most general form of -.Fn rtalloc -(and both of the other forms are implemented as calls to rtalloc1). -It does not use the -.Dq Li "struct route" , -and is therefore suitable for address families which require more -space than is in a traditional -.Dq Li "struct sockaddr" . -Instead, it takes a -.Dq Li "struct sockaddr *" -directly as the -.Fa sa -argument. -The second argument, -.Fa report , -controls whether the lower layers are notified when a lookup fails. -The third argument, -.Fa flags , -is a set of flags to ignore, as in -.Fn rtalloc_ign . -The -.Fn rtalloc1 -function returns a pointer to a locked -.Vt "struct rtentry" . -.Pp -The -.Fn rtfree -function frees a locked route entry, e.g., a previously allocated by -.Fn rtalloc1 . +.Fn RTFREE_LOCKED +macro is used to unref and possibly free a locked routing entry +with one our reference, for example previously allocated by +.Fn rtalloc1_fib . .Pp The .Fn RTFREE -macro is used to free unlocked route entries, previously allocated by -.Fn rtalloc +macro is used to unref and possibly free an unlocked route entries with +one our reference, for example previously allocated by +.Fn rtalloc_fib or -.Fn rtalloc_ign . -The -.Fn RTFREE -macro decrements the reference count on the routing table entry (see below), -and frees it if the reference count has reached zero. +.Fn rtalloc_ign_fib . .Pp -The preferred usage is allocating a route using -.Fn rtalloc -or -.Fn rtalloc_ign -and freeing using -.Fn RTFREE . +Both +.Fn RTFREE_LOCKED +and +.Fn RTFREE +macros decrement the reference count on the routing table entry, +and proceed with actual freeing if the reference count has reached zero. .Pp The .Fn RT_LOCK macro is used to lock a routing table entry. +.Pp The .Fn RT_UNLOCK macro is used to unlock a routing table entry. @@ -189,20 +192,53 @@ macro is used to unlock a routing table entry. The .Fn RT_ADDREF macro increments the reference count on a previously locked route entry. +It should be used whenever a reference to an +.Xr rtentry 9 +is going to be stored outside the routing table. +.Pp The .Fn RT_REMREF macro decrements the reference count on a previously locked route entry. -.Sh RETURN VALUES +Its usage is contrary to +.Fn RT_ADDREF . +.Pp The -.Fn rtalloc , -.Fn rtalloc_ign -and .Fn rtfree -functions do not return a value. +function does the actual free of the routing table entry, and shouldn't +be called directly by facilities, that just perform routing table lookups. +.Sh LEGACY INTERFACE +Prior to introduction of multiple routing tables functions did not +require the +.Fa "u_int fibnum" +argument. +Legacy +.Fn rtalloc1 , +.Fn rtalloc +and +.Fn rtalloc_ign +functions are kept for compatibility, and are equivalent to +calling new interface with +.Fa fibnum +argument equal to +.Va 0 , +which implies default forwarding table. +.Sh RETURN VALUES The -.Fn rtalloc1 -function returns a pointer to a routing-table entry if it succeeds, +.Fn rtalloc1_fib +function returns a pointer to a locked routing-table entry if it succeeds, otherwise a null pointer. +The +.Fn rtalloc_fib +and +.Fn rtalloc_ign_fib +functions do not return a value, but they fill in the +.Fa *ro_rt +member of the +.Fa *ro +argument with a pointer to an unlocked routing-table entry if they +succeed, otherwise a null pointer. +In a case of success all functions put a reference on the +routing-table entry, freeing of which is responsibility of the caller. Lack of a route should in most cases be translated to the .Xr errno 2 @@ -213,7 +249,7 @@ value .Xr rtentry 9 .Sh HISTORY The -.Nm +.Nm rtalloc facility first appeared in .Bx 4.2 , although with much different internals. @@ -227,14 +263,11 @@ first appeared in .Fx 2.0 . Routing table locking was introduced in .Fx 5.2 . +Multiple routing tables were introduced in +.Fx 8.0 . .Sh AUTHORS -This manual page was written by -.An Garrett Wollman , -as were the changes to implement -.Dv RTF_PRCLONING -and the -.Fn rtalloc_ign -function and the -.Fa flags -argument to -.Fn rtalloc1 . +The original version of this manual page was written by +.An -nosplit +.An "Garrett Wollman" . +It was significantly updated by +.An "Gleb Smirnoff" . -- cgit v1.1 From a4234fdf185a5036101ba09c6631e87c3b0f242b Mon Sep 17 00:00:00 2001 From: glebius Date: Wed, 14 Dec 2011 14:55:19 +0000 Subject: More MLINKS for rtalloc.9 --- share/man/man9/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 0870355..a577854 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1023,8 +1023,12 @@ MLINKS+=rmlock.9 rm_destroy.9 \ rmlock.9 rm_wunlock.9 MLINKS+=rtalloc.9 rtalloc1.9 \ rtalloc.9 rtalloc_ign.9 \ + rtalloc.9 RTFREE_LOCKED.9 \ rtalloc.9 RTFREE.9 \ - rtalloc.9 rtfree.9 + rtalloc.9 rtfree.9 \ + rtalloc.9 rtalloc1_fib.9 \ + rtalloc.9 rtalloc_ign_fib.9 \ + rtalloc.9 rtalloc_fib.9 MLINKS+=runqueue.9 choosethread.9 \ runqueue.9 procrunnable.9 \ runqueue.9 remrunqueue.9 \ -- cgit v1.1 From 93b09a6b44a3801ddf5a9f12291a430a2147ee83 Mon Sep 17 00:00:00 2001 From: mav Date: Wed, 14 Dec 2011 15:19:40 +0000 Subject: After several suggestions from people, move eventtimers page from 7 to 4. --- share/man/man4/Makefile | 1 + share/man/man4/atrtc.4 | 2 +- share/man/man4/attimer.4 | 2 +- share/man/man4/eventtimers.4 | 133 +++++++++++++++++++++++++++++++++++++++++++ share/man/man4/hpet.4 | 2 +- share/man/man7/Makefile | 1 - share/man/man7/eventtimers.7 | 133 ------------------------------------------- 7 files changed, 137 insertions(+), 137 deletions(-) create mode 100644 share/man/man4/eventtimers.4 delete mode 100644 share/man/man7/eventtimers.7 (limited to 'share') diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 5b41aea..69e9a7c 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -116,6 +116,7 @@ MAN= aac.4 \ epair.4 \ esp.4 \ et.4 \ + eventtimers.4 \ exca.4 \ faith.4 \ fatm.4 \ diff --git a/share/man/man4/atrtc.4 b/share/man/man4/atrtc.4 index 51d6f05..2a75d03 100644 --- a/share/man/man4/atrtc.4 +++ b/share/man/man4/atrtc.4 @@ -53,4 +53,4 @@ Event timer provided by the driver is irrelevant to CPU power states. .Sh SEE ALSO .Xr attimer 4 , .Xr hpet 4 , -.Xr eventtimers 7 +.Xr eventtimers 4 diff --git a/share/man/man4/attimer.4 b/share/man/man4/attimer.4 index 67d001e..6dd4ee2 100644 --- a/share/man/man4/attimer.4 +++ b/share/man/man4/attimer.4 @@ -72,4 +72,4 @@ Event timer provided by the driver is irrelevant to CPU power states. .Sh SEE ALSO .Xr atrtc 4 , .Xr hpet 4 , -.Xr eventtimers 7 +.Xr eventtimers 4 diff --git a/share/man/man4/eventtimers.4 b/share/man/man4/eventtimers.4 new file mode 100644 index 0000000..37d5fc8 --- /dev/null +++ b/share/man/man4/eventtimers.4 @@ -0,0 +1,133 @@ +.\" Copyright (c) 2010 Alexander Motin +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd September 15, 2010 +.Dt EVENTTIMERS 4 +.Os +.Sh NAME +.Nm eventtimers +.Nd kernel event timers subsystem +.Sh SYNOPSIS +Kernel uses several types of time-related devices, such as: real time clocks, +time counters and event timers. +Real time clocks responsible for tracking real world time, mostly when system +is down. +Time counters are responsible for generation of monotonically increasing +timestamps for precise uptime tracking purposes, when system is running. +Event timers are responsible for generating interrupts at specified time or +periodically, to run different time-based events. +This page is about the last. +.Sh DESCRIPTION +Kernel uses time-based events for many different purposes: scheduling, +statistics, time keeping, profiling and many other things, based on +.Xr callout 9 +mechanism. +These purposes now grouped into three main callbacks: +.Bl -tag +.It hardclock() +.Xr callout 9 +and timekeeping events entry. Called with frequency defined by hz variable, +usually 1000Hz. +.It statclock() +statistics and scheduler events entry. Called with frequency about 128Hz. +.It profclock() +profiler events entry. When enabled, called with frequency about 8KHz. +.El +Different platforms provide different kinds of timer hardware. +The goal of the event timers subsystem is to provide unified way to control +that hardware, and to use it, supplying kernel with all required time-based +events. +.Pp +Each driver implementing event timers, registers them at the subsystem. +It is possible to see the list of present event timers, like this, via +.Va kern.eventtimer +sysctl: +.Bd -literal +kern.eventtimer.choice: HPET(550) LAPIC(400) i8254(100) RTC(0) +kern.eventtimer.et.LAPIC.flags: 15 +kern.eventtimer.et.LAPIC.frequency: 0 +kern.eventtimer.et.LAPIC.quality: 400 +kern.eventtimer.et.i8254.flags: 1 +kern.eventtimer.et.i8254.frequency: 1193182 +kern.eventtimer.et.i8254.quality: 100 +kern.eventtimer.et.RTC.flags: 17 +kern.eventtimer.et.RTC.frequency: 32768 +kern.eventtimer.et.RTC.quality: 0 +kern.eventtimer.et.HPET.flags: 7 +kern.eventtimer.et.HPET.frequency: 14318180 +kern.eventtimer.et.HPET.quality: 550 +.Ed +, where: +.Bl -tag +.It Va kern.eventtimer.et. Ns Ar X Ns Va .flags +bitmask, defining event timer capabilities: +.Bl -tag -compact +.It 1 +periodic mode supported, +.It 2 +one-shot mode supported, +.It 4 +timer is per-CPU, +.It 8 +timer may stop when CPU goes to sleep state, +.It 16 +timer supports only power-of-2 divisors. +.El +.It Va kern.eventtimer.et. Ns Ar X Ns Va .frequency +timer base frequency, +.It Va kern.eventtimer.et. Ns Ar X Ns Va .quality +integral value, defining how good is this timer, comparing to others. +.El +.Pp +Timers management code of the kernel chooses one timer from that list. +Current choice can be read and affected via +.Va kern.eventtimer.timer +tunable/sysctl. +Several other tunables/sysctls are affecting how exactly this timer is used: +.Bl -tag +.It Va kern.eventtimer.periodic +allows to choose periodic and one-shot operation mode. +In periodic mode, periodic interrupts from timer hardware are taken as the +only source of time for time events. +One-shot mode instead uses currently selected time counter to precisely +schedule all needed events and programs event timer to generate interrupt +exactly in specified time. +Default value depends of chosen timer capabilities, but one-shot mode is +preferred, until other is forced by user or hardware. +.It Va kern.eventtimer.singlemul +in periodic mode specifies how much times higher timer frequency should be, +to not strictly alias hardclock() and statclock() events. Default values are +1, 2 or 4, depending on configured HZ value. +.It Va kern.eventtimer.idletick +makes each CPU to receive every timer interrupt independently of whether they +busy or not. By default this options is disabled. If chosen timer is per-CPU +and runs in periodic mode, this option has no effect - all interrupts are +always generating. +.El +.Sh SEE ALSO +.Xr attimer 4 , +.Xr atrtc 4 , +.Xr hpet 4 diff --git a/share/man/man4/hpet.4 b/share/man/man4/hpet.4 index f501e0b..bcfea1c 100644 --- a/share/man/man4/hpet.4 +++ b/share/man/man4/hpet.4 @@ -96,7 +96,7 @@ of these comparators has own unsharable IRQ. .Xr acpi 4 , .Xr atrtc 4 , .Xr attimer 4 , -.Xr eventtimers 7 +.Xr eventtimers 4 .Sh HISTORY The .Nm diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index e279b37..011fbaf 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -10,7 +10,6 @@ MAN= adding_user.7 \ c99.7 \ development.7 \ environ.7 \ - eventtimers.7 \ ffs.7 \ firewall.7 \ hier.7 \ diff --git a/share/man/man7/eventtimers.7 b/share/man/man7/eventtimers.7 deleted file mode 100644 index 37d5fc8..0000000 --- a/share/man/man7/eventtimers.7 +++ /dev/null @@ -1,133 +0,0 @@ -.\" Copyright (c) 2010 Alexander Motin -.\" 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. -.\" -.\" $FreeBSD$ -.\" -.Dd September 15, 2010 -.Dt EVENTTIMERS 4 -.Os -.Sh NAME -.Nm eventtimers -.Nd kernel event timers subsystem -.Sh SYNOPSIS -Kernel uses several types of time-related devices, such as: real time clocks, -time counters and event timers. -Real time clocks responsible for tracking real world time, mostly when system -is down. -Time counters are responsible for generation of monotonically increasing -timestamps for precise uptime tracking purposes, when system is running. -Event timers are responsible for generating interrupts at specified time or -periodically, to run different time-based events. -This page is about the last. -.Sh DESCRIPTION -Kernel uses time-based events for many different purposes: scheduling, -statistics, time keeping, profiling and many other things, based on -.Xr callout 9 -mechanism. -These purposes now grouped into three main callbacks: -.Bl -tag -.It hardclock() -.Xr callout 9 -and timekeeping events entry. Called with frequency defined by hz variable, -usually 1000Hz. -.It statclock() -statistics and scheduler events entry. Called with frequency about 128Hz. -.It profclock() -profiler events entry. When enabled, called with frequency about 8KHz. -.El -Different platforms provide different kinds of timer hardware. -The goal of the event timers subsystem is to provide unified way to control -that hardware, and to use it, supplying kernel with all required time-based -events. -.Pp -Each driver implementing event timers, registers them at the subsystem. -It is possible to see the list of present event timers, like this, via -.Va kern.eventtimer -sysctl: -.Bd -literal -kern.eventtimer.choice: HPET(550) LAPIC(400) i8254(100) RTC(0) -kern.eventtimer.et.LAPIC.flags: 15 -kern.eventtimer.et.LAPIC.frequency: 0 -kern.eventtimer.et.LAPIC.quality: 400 -kern.eventtimer.et.i8254.flags: 1 -kern.eventtimer.et.i8254.frequency: 1193182 -kern.eventtimer.et.i8254.quality: 100 -kern.eventtimer.et.RTC.flags: 17 -kern.eventtimer.et.RTC.frequency: 32768 -kern.eventtimer.et.RTC.quality: 0 -kern.eventtimer.et.HPET.flags: 7 -kern.eventtimer.et.HPET.frequency: 14318180 -kern.eventtimer.et.HPET.quality: 550 -.Ed -, where: -.Bl -tag -.It Va kern.eventtimer.et. Ns Ar X Ns Va .flags -bitmask, defining event timer capabilities: -.Bl -tag -compact -.It 1 -periodic mode supported, -.It 2 -one-shot mode supported, -.It 4 -timer is per-CPU, -.It 8 -timer may stop when CPU goes to sleep state, -.It 16 -timer supports only power-of-2 divisors. -.El -.It Va kern.eventtimer.et. Ns Ar X Ns Va .frequency -timer base frequency, -.It Va kern.eventtimer.et. Ns Ar X Ns Va .quality -integral value, defining how good is this timer, comparing to others. -.El -.Pp -Timers management code of the kernel chooses one timer from that list. -Current choice can be read and affected via -.Va kern.eventtimer.timer -tunable/sysctl. -Several other tunables/sysctls are affecting how exactly this timer is used: -.Bl -tag -.It Va kern.eventtimer.periodic -allows to choose periodic and one-shot operation mode. -In periodic mode, periodic interrupts from timer hardware are taken as the -only source of time for time events. -One-shot mode instead uses currently selected time counter to precisely -schedule all needed events and programs event timer to generate interrupt -exactly in specified time. -Default value depends of chosen timer capabilities, but one-shot mode is -preferred, until other is forced by user or hardware. -.It Va kern.eventtimer.singlemul -in periodic mode specifies how much times higher timer frequency should be, -to not strictly alias hardclock() and statclock() events. Default values are -1, 2 or 4, depending on configured HZ value. -.It Va kern.eventtimer.idletick -makes each CPU to receive every timer interrupt independently of whether they -busy or not. By default this options is disabled. If chosen timer is per-CPU -and runs in periodic mode, this option has no effect - all interrupts are -always generating. -.El -.Sh SEE ALSO -.Xr attimer 4 , -.Xr atrtc 4 , -.Xr hpet 4 -- cgit v1.1 From c6a888391d3df4701756499ff831b8e9400e4fec Mon Sep 17 00:00:00 2001 From: joel Date: Wed, 14 Dec 2011 19:48:21 +0000 Subject: Add SEE ALSO. --- share/man/man8/yp.8 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man8/yp.8 b/share/man/man8/yp.8 index f57c8df..db5610b 100644 --- a/share/man/man8/yp.8 +++ b/share/man/man8/yp.8 @@ -28,7 +28,7 @@ .\" from: @(#)yp.8 1.0 (deraadt) 4/26/93 .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd December 14, 2011 .Dt YP 8 .Os .Sh NAME @@ -519,6 +519,20 @@ a v1 and v2 server. .Xr ypserv 8 manual page for a detailed description of these special features and flags.) +.Sh SEE ALSO +.Xr domainname 1 , +.Xr ypcat 1 , +.Xr ypmatch 1 , +.Xr ypwhich 1 , +.Xr nsswitch.conf 5 , +.Xr yp_mkdb 8 , +.Xr ypbind 8 , +.Xr ypinit 8 , +.Xr yppoll 8 , +.Xr yppush 8 , +.Xr ypserv 8 , +.Xr ypset 8 , +.Xr ypxfr 8 .Sh HISTORY The .Nm YP -- cgit v1.1 From 6d1299a388490b22f5d0619237868efafa3f3428 Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 14 Dec 2011 22:22:19 +0000 Subject: Add a helper API to allow in-kernel code to map portions of shared memory objects created by shm_open(2) into the kernel's address space. This provides a convenient way for creating shared memory buffers between userland and the kernel without requiring custom character devices. --- share/man/man9/Makefile | 2 + share/man/man9/shm_map.9 | 187 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 189 insertions(+) create mode 100644 share/man/man9/shm_map.9 (limited to 'share') diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index a577854..b150b64 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -234,6 +234,7 @@ MAN= accept_filter.9 \ sema.9 \ sf_buf.9 \ sglist.9 \ + shm_map.9 \ signal.9 \ sleep.9 \ sleepqueue.9 \ @@ -1111,6 +1112,7 @@ MLINKS+=sglist.9 sglist_alloc.9 \ sglist.9 sglist_reset.9 \ sglist.9 sglist_slice.9 \ sglist.9 sglist_split.9 +MLINKS+=shm_map.9 shm_unmap.9 MLINKS+=signal.9 cursig.9 \ signal.9 execsigs.9 \ signal.9 issignal.9 \ diff --git a/share/man/man9/shm_map.9 b/share/man/man9/shm_map.9 new file mode 100644 index 0000000..6f61147 --- /dev/null +++ b/share/man/man9/shm_map.9 @@ -0,0 +1,187 @@ +.\" +.\" Copyright (c) 2011 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd December 14, 2011 +.Dt SHM_MAP 9 +.Os +.Sh NAME +.Nm shm_map , +.Nm shm_unmap +.Nd map shared memory objects into the kernel's address space +.Sh SYNOPSIS +.In sys/types.h +.In sys/mman.h +.Ft int +.Fn shm_map "struct file *fp" "size_t size" "off_t offset" "void **memp" +.Ft int +.Fn shm_unmap "struct file *fp" "void *mem" "size_t size" +.Sh DESCRIPTION +The +.Nm shm_map +and +.Nm shm_unmap +functions provide an API for mapping shared memory objects into the kernel. +Shared memory objects are created by +.Xr shm_open 2 . +These objects can then be passed into the kernel via file descriptors. +.Pp +A shared memory object cannot be shrunk while it is mapped into the kernel. +This is to avoid invalidating any pages that may be wired into the kernel's +address space. +Shared memory objects can still be grown while mapped into the kernel. +.Pp +To simplify the accounting needed to enforce the above requirement, +callers of this API are required to unmap the entire region mapped by +.Nm shm_map +when calling +.Nm shm_unmap . +Unmapping only a portion of the region is not permitted. +.Pp +The +.Nm shm_map +function locates the shared memory object associated with the open file +.Fa fp . +It maps the region of that object described by +.Fa offset +and +.Fa size +into the kernel's address space. +If it succeeds, +.Fa *memp +will be set to the start of the mapping. +All pages for the range will be wired into memory upon successful return. +.Pp +The +.Nm shm_unmap +function unmaps a region previously mapped by +.Nm shm_map . +The +.Fa mem +argument should match the value previously returned in +.Fa *memp , +and the +.Fa size +argument should match the value passed to +.Nm shm_map . +.Pp +Note that +.Nm shm_map +will not hold an extra reference on the open file +.Fa fp +for the lifetime of the mapping. +Instead, +the calling code is required to do this if it wishes to use +.Nm shm_unmap +on the region in the future. +.Sh RETURN VALUES +The +.Nm shm_map +and +.Nm shm_unmap +functions return zero on success or an error on failure. +.Sh EXAMPLES +The following function accepts a file descriptor for a shared memory +object. +It maps the first sixteen kilobytes of the object into the kernel, +performs some work on that address, +and then unmaps the address before returning. +.Bd -literal +int +shm_example(int fd) +{ + struct file *fp; + void *mem; + int error; + + error = fget(curthread, fd, CAP_MMAP, &fp) + if (error) + return (error); + error = shm_map(fp, 16384, 0, &mem); + if (error) { + fdrop(fp, curthread); + return (error); + } + + /* Do something with 'mem'. */ + + error = shm_unmap(fp, mem, 16384); + fdrop(fp, curthread); + return (error); +} +.Ed +.Sh ERRORS +The +.Nm shm_map +function returns the following errors on failure: +.Bl -tag -width Er +.It Bq Er EINVAL +The open file +.Fa fp +is not a shared memory object. +.It Bq Er EINVAL +The requested region described by +.Fa offset +and +.Fa size +extends beyond the end of the shared memory object. +.It Bq Er ENOMEM +Insufficient address space was available. +.It Bq Er EACCES +The shared memory object could not be mapped due to a protection error. +.It Bq Er EINVAL +The shared memory object could not be mapped due to some other VM error. +.El +.Pp +The +.Nm shm_unmap +function returns the following errors on failure: +.Bl -tag -width Er +.It Bq Er EINVAL +The open file +.Fa fp +is not a shared memory object. +.It Bq Er EINVAL +The address range described by +.Fa mem +and +.Fa size +is not a valid address range. +.It Bq Er EINVAL +The address range described by +.Fa mem +and +.Fa size +is not backed by the shared memory object associated with the open file +.Fa fp , +or the address range does not cover the entire mapping of the object. +.El +.Sh SEE ALSO +.Xr shm_open 2 +.Sh HISTORY +This API was first introduced in +.Fx 10.0 . -- cgit v1.1 From 634fe42a7686851f7c0235f4c2220cb4a89841ec Mon Sep 17 00:00:00 2001 From: dim Date: Thu, 15 Dec 2011 22:08:08 +0000 Subject: Clang has more warnings enabled by default, and when using -Wall, so if WARNS is set to low values, some of them have to be disabled explicitly. MFC after: 1 week --- share/mk/bsd.sys.mk | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'share') diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 796d169..1101995 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -57,6 +57,19 @@ CWARNFLAGS += -Wchar-subscripts -Winline -Wnested-externs\ CWARNFLAGS += -Wno-uninitialized . endif CWARNFLAGS += -Wno-pointer-sign +# Clang has more warnings enabled by default, and when using -Wall, so if WARNS +# is set to low values, these have to be disabled explicitly. +. if ${CC:T:Mclang} == "clang" +. if ${WARNS} <= 3 +CWARNFLAGS += -Wno-tautological-compare -Wno-unused-value +. endif +. if ${WARNS} <= 2 +CWARNFLAGS += -Wno-switch-enum +. endif +. if ${WARNS} <= 1 +CWARNFLAGS += -Wno-parentheses +. endif +. endif . endif . if defined(FORMAT_AUDIT) -- cgit v1.1 From b2a5a1cc3fbb414a4da6e92a8cdef13e116442ca Mon Sep 17 00:00:00 2001 From: dim Date: Thu, 15 Dec 2011 23:13:57 +0000 Subject: Disable one more clang warning when WARNS <= 3. MFC after: 1 week --- share/mk/bsd.sys.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 1101995..de7355f 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -61,7 +61,8 @@ CWARNFLAGS += -Wno-pointer-sign # is set to low values, these have to be disabled explicitly. . if ${CC:T:Mclang} == "clang" . if ${WARNS} <= 3 -CWARNFLAGS += -Wno-tautological-compare -Wno-unused-value +CWARNFLAGS += -Wno-tautological-compare -Wno-unused-value\ + -Wno-parentheses-equality . endif . if ${WARNS} <= 2 CWARNFLAGS += -Wno-switch-enum -- cgit v1.1 From 65b6b4fa8f3369ae8f1ddf883233883607f6abb8 Mon Sep 17 00:00:00 2001 From: np Date: Fri, 16 Dec 2011 02:09:51 +0000 Subject: Many updates to cxgbe(4) - Device configuration via plain text config file. Also able to operate when not attached to the chip as the master driver. - Generic "work request" queue that serves as the base for both ctrl and ofld tx queues. - Generic interrupt handler routine that can process any event on any kind of ingress queue (via a dispatch table). - A couple of new driver ioctls. cxgbetool can now install a firmware to the card ("loadfw" command) and can read the card's memory ("memdump" and "tcb" commands). - Lots of assorted information within dev.t4nex.X.misc.* This is primarily for debugging and won't show up in sysctl -a. - Code to manage the L2 tables on the chip. - Updates to cxgbe(4) man page to go with the tunables that have changed. - Updates to the shared code in common/ - Updates to the driver-firmware interface (now at fw 1.4.16.0) MFC after: 1 month --- share/man/man4/cxgbe.4 | 78 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 12 deletions(-) (limited to 'share') diff --git a/share/man/man4/cxgbe.4 b/share/man/man4/cxgbe.4 index ab2979a..4bf5ac3 100644 --- a/share/man/man4/cxgbe.4 +++ b/share/man/man4/cxgbe.4 @@ -99,18 +99,29 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent -.It Va hw.cxgbe.max_ntxq_10G_port -The maximum number of tx queues to use for a 10Gb port. -The default value is 8. -.It Va hw.cxgbe.max_nrxq_10G_port -The maximum number of rx queues to use for a 10Gb port. -The default value is 8. -.It Va hw.cxgbe.max_ntxq_1G_port -The maximum number of tx queues to use for a 1Gb port. -The default value is 2. -.It Va hw.cxgbe.max_nrxq_1G_port -The maximum number of rx queues to use for a 1Gb port. -The default value is 2. +.It Va hw.cxgbe.ntxq10g +The number of tx queues to use for a 10Gb port. The default is 16 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nrxq10g +The number of rx queues to use for a 10Gb port. The default is 8 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.ntxq1g +The number of tx queues to use for a 1Gb port. The default is 4 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nrxq1g +The number of rx queues to use for a 1Gb port. The default is 2 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldtxq10g +The number of TOE tx queues to use for a 10Gb port. The default is 8 or the +number of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldrxq10g +The number of TOE rx queues to use for a 10Gb port. The default is 2 or the +number of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldtxq1g +The number of TOE tx queues to use for a 1Gb port. The default is 2 or the +number of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldrxq1g +The number of TOE rx queues to use for a 1Gb port. The default is 1. .It Va hw.cxgbe.holdoff_timer_idx_10G .It Va hw.cxgbe.holdoff_timer_idx_1G The timer index value to use to delay interrupts. @@ -119,6 +130,8 @@ by default (all values are in microseconds) and the index selects a value from this list. The default value is 1 for both 10Gb and 1Gb ports, which means the timer value is 5us. +Different cxgbe interfaces can be assigned different values at any time via the +dev.cxgbe.X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G The packet-count index value to use to delay interrupts. @@ -127,6 +140,11 @@ and the index selects a value from this list. The default value is 2 for both 10Gb and 1Gb ports, which means 16 packets (or the holdoff timer going off) before an interrupt is generated. +-1 disables packet counting. +Different cxgbe interfaces can be assigned different values via the +dev.cxgbe.X.holdoff_pktc_idx sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). .It Va hw.cxgbe.qsize_txq The size, in number of entries, of the descriptor ring used for a tx queue. @@ -134,10 +152,46 @@ A buf_ring of the same size is also allocated for additional software queuing. See .Xr ifnet 9 . The default value is 1024. +Different cxgbe interfaces can be assigned different values via the +dev.cxgbe.X.qsize_txq sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). .It Va hw.cxgbe.qsize_rxq The size, in number of entries, of the descriptor ring used for an rx queue. The default value is 1024. +Different cxgbe interfaces can be assigned different values via the +dev.cxgbe.X.qsize_rxq sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). +.It Va hw.cxgbe.interrupt_types +The interrupt types that the driver is allowed to use. +Bit 0 represents INTx (line interrupts), bit 1 MSI, bit 2 MSI-X. +The default is 7 (all allowed). +The driver will select the best possible type out of the allowed types by +itself. +.It Va hw.cxgbe.config_file +Select a pre-packaged device configuration file. +A configuration file contains a recipe for partitioning and configuring the +hardware resources on the card. +This tunable is for specialized applications only and should not be used in +normal operation. +The configuration profile currently in use is available in the dev.t4nex.X.cf +and dev.t4nex.X.cfcsum sysctls. +.It Va hw.cxgbe.linkcaps_allowed +.It Va hw.cxgbe.niccaps_allowed +.It Va hw.cxgbe.toecaps_allowed +.It Va hw.cxgbe.rdmacaps_allowed +.It Va hw.cxgbe.iscsicaps_allowed +.It Va hw.cxgbe.fcoecaps_allowed +Disallowing capabilities provides a hint to the driver and firmware to not +reserve hardware resources for that feature. +Each of these is a bit field with a bit for each sub-capability within the +capability. +This tunable is for specialized applications only and should not be used in +normal operation. +The capabilities for which hardware resources have been reserved are listed in +dev.t4nex.X.*caps sysctls. .El .Sh SUPPORT For general information and support, -- cgit v1.1 From b646d3f6998d3f539bcda6f94be4926461780cf7 Mon Sep 17 00:00:00 2001 From: kib Date: Fri, 16 Dec 2011 11:52:33 +0000 Subject: Document 'findstack'. MFC after: 1 week --- share/man/man4/ddb.4 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index b9a8c82..c174b51 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 5, 2010 +.Dd December 16, 2011 .Dt DDB 4 .Os .Sh NAME @@ -523,6 +523,16 @@ The optional argument limits the search. .\" .Pp +.It Xo +.Ic findstack +.Ar addr +.Xc +Prints the thread address for a thread kernel-mode stack of which contains the +specified address. +If the thread is not found, search the thread stack cache and prints the +cached stack address. +Otherwise, prints nothing. +.Pp .It Ic show Cm all procs Ns Op Li / Ns Cm m .It Ic ps Ns Op Li / Ns Cm m Display all process information. -- cgit v1.1 From 27a36f6ac8242750daa092abd7180b10d16f4508 Mon Sep 17 00:00:00 2001 From: glebius Date: Fri, 16 Dec 2011 12:16:56 +0000 Subject: A major overhaul of the CARP implementation. The ip_carp.c was started from scratch, copying needed functionality from the old implemenation on demand, with a thorough review of all code. The main change is that interface layer has been removed from the CARP. Now redundant addresses are configured exactly on the interfaces, they run on. The CARP configuration itself is, as before, configured and read via SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or SIOCAIFADDR_IN6 may now be configured to a particular virtual host id, which makes the prefix redundant. ifconfig(8) semantics has been changed too: now one doesn't need to clone carpXX interface, he/she should directly configure a vhid on a Ethernet interface. To supply vhid data from the kernel to an application the getifaddrs(8) function had been changed to pass ifam_data with each address. [1] The new implementation definitely closes all PRs related to carp(4) being an interface, and may close several others. It also allows to run a single redundant IP per interface. Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for idea on using ifam_data and for several rounds of reviewing! PR: kern/117000, kern/126945, kern/126714, kern/120130, kern/117448 Reviewed by: bz Submitted by: bz [1] --- share/man/man4/carp.4 | 246 +++++++++++++++++++++++--------------------------- 1 file changed, 115 insertions(+), 131 deletions(-) (limited to 'share') diff --git a/share/man/man4/carp.4 b/share/man/man4/carp.4 index 4064c6c..7c214ff 100644 --- a/share/man/man4/carp.4 +++ b/share/man/man4/carp.4 @@ -1,6 +1,7 @@ .\" $OpenBSD: carp.4,v 1.16 2004/12/07 23:41:35 jmc Exp $ .\" .\" Copyright (c) 2003, Ryan McBride. All rights reserved. +.\" Copyright (c) 2011, Gleb Smirnoff .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -25,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2011 +.Dd December 16, 2011 .Dt CARP 4 .Os .Sh NAME @@ -34,33 +35,17 @@ .Sh SYNOPSIS .Cd "device carp" .Sh DESCRIPTION -The -.Nm -interface is a pseudo-device that implements and controls the -CARP protocol. -CARP allows multiple hosts on the same local network to share a set of IP addresses. +The CARP allows multiple hosts on the same local network to share a set of +IPv4 and/or IPv6 addresses. Its primary purpose is to ensure that these -addresses are always available, but in some configurations -.Nm -can also provide load balancing functionality. -.Pp -A -.Nm -interface can be created at runtime using the -.Nm ifconfig Li carp Ns Ar N Cm create -command or by configuring -it via -.Va cloned_interfaces -in the -.Pa /etc/rc.conf -file. +addresses are always available. .Pp To use .Nm , -the administrator needs to configure at minimum a common virtual host ID (VHID) -and virtual host IP address on each machine which is to take part in the virtual -group. -Additional parameters can also be set on a per-interface basis: +the administrator needs to configure at minimum a common virtual host ID +(vhid) and attach at least one IP address to this vhid on each machine which +is to take part in the virtual group. +Additional parameters can also be set on a per-vhid basis: .Cm advbase and .Cm advskew , @@ -93,9 +78,20 @@ or through the .Dv SIOCSVH .Xr ioctl 2 . .Pp +CARP virtual hosts can be configured on multicast capable interfaces: Ethernet, +layer 2 VLAN, FDDI and Token Ring. +An arbitrary number of virtual host IDs can be configured on an interface. +An arbitrary number of IPv4 or IPv6 addresses can be attached to a particular +vhid. +It is important that all hosts participating in a vhid have the same list +of prefixes configured on the vhid, since all prefixes are included in the +cryptographic checksum supplied in each advertisement. +Multiple vhids running on one interface participate in master/backup +elections independently. +.Pp Additionally, there are a number of global parameters which can be set using .Xr sysctl 8 : -.Bl -tag -width ".Va net.inet.carp.arpbalance" +.Bl -tag -width ".Va net.inet.carp.preempt" .It Va net.inet.carp.allow Accept incoming .Nm @@ -125,9 +121,6 @@ Values above 1 enable logging of bad .Nm packets. Default value is 1. -.It Va net.inet.carp.arpbalance -Balance local traffic using ARP (see below). -Disabled by default. .It Va net.inet.carp.suppress_preempt A read only value showing the status of preemption suppression. Preemption can be suppressed if link on an interface is down @@ -138,36 +131,36 @@ Value of 0 means that preemption is not suppressed, since no problems are detected. Every problem increments suppression counter. .El -.Sh ARP level load balancing -The -.Nm -has limited abilities for load balancing the incoming connections -between hosts in Ethernet network. -For load balancing operation, one needs several CARP interfaces that -are configured to the same IP address, but to a different VHIDs. -Once an ARP request is received, the CARP protocol will use a hashing -function against the source IP address in the ARP request to determine -which VHID should this request belong to. -If the corresponding CARP interface is in master state, the ARP request -will be replied, otherwise it will be ignored. -See the -.Sx EXAMPLES -section for a practical example of load balancing. -.Pp -The ARP load balancing has some limitations. -First, ARP balancing only works on the local network segment. -It cannot balance traffic that crosses a router, because the -router itself will always be balanced to the same virtual host. -Second, ARP load balancing can lead to asymmetric routing -of incoming and outgoing traffic, and thus combining it with -.Xr pfsync 4 -is dangerous, because this creates a race condition between -balanced routers and a host they are serving. -Imagine an incoming packet creating state on the first router, being -forwarded to its destination, and destination replying faster -than the state information is packed and synced with the second router. -If the reply would be load balanced to second router, it will be -dropped due to no state. +.\".Sh ARP level load balancing +.\"The +.\".Nm +.\"has limited abilities for load balancing the incoming connections +.\"between hosts in Ethernet network. +.\"For load balancing operation, one needs several CARP interfaces that +.\"are configured to the same IP address, but to a different vhids. +.\"Once an ARP request is received, the CARP protocol will use a hashing +.\"function against the source IP address in the ARP request to determine +.\"which vhid should this request belong to. +.\"If the corresponding CARP interface is in master state, the ARP request +.\"will be replied, otherwise it will be ignored. +.\"See the +.\".Sx EXAMPLES +.\"section for a practical example of load balancing. +.\".Pp +.\"The ARP load balancing has some limitations. +.\"First, ARP balancing only works on the local network segment. +.\"It cannot balance traffic that crosses a router, because the +.\"router itself will always be balanced to the same virtual host. +.\"Second, ARP load balancing can lead to asymmetric routing +.\"of incoming and outgoing traffic, and thus combining it with +.\".Xr pfsync 4 +.\"is dangerous, because this creates a race condition between +.\"balanced routers and a host they are serving. +.\"Imagine an incoming packet creating state on the first router, being +.\"forwarded to its destination, and destination replying faster +.\"than the state information is packed and synced with the second router. +.\"If the reply would be load balanced to second router, it will be +.\"dropped due to no state. .Sh STATE CHANGE NOTIFICATIONS Sometimes it is useful to get notified about .Nm @@ -175,13 +168,10 @@ status change events. This can be accomplished by using .Xr devd 8 hooks. -Master/slave events are signalled as -.Nm -interface -.Dv LINK_UP -or -.Dv LINK_DOWN -event. +Master/slave events are signalled under system +.Dv CARP . +Subsystem specifies vhid and name of interface, where event occured. +Type of the message displays new state of vhid. Please see .Xr devd.conf 5 and @@ -197,23 +187,19 @@ Enable it on both host A and B: .Pp .Dl sysctl net.inet.carp.preempt=1 .Pp -Assume that host A is the preferred master and 192.168.1.x/24 is -configured on one physical interface and 192.168.2.y/24 on another. +Assume that host A is the preferred master and we are running the +192.168.1.0/24 prefix on em0 and 192.168.2.0/24 on em1. This is the setup for host A: .Bd -literal -offset indent -ifconfig carp0 create -ifconfig carp0 vhid 1 pass mekmitasdigoat 192.168.1.1/24 -ifconfig carp1 create -ifconfig carp1 vhid 2 pass mekmitasdigoat 192.168.2.1/24 +ifconfig em0 vhid 1 pass mekmitasdigoat 192.168.1.1/24 +ifconfig em1 vhid 2 pass mekmitasdigoat 192.168.2.1/24 .Ed .Pp The setup for host B is identical, but it has a higher .Cm advskew : .Bd -literal -offset indent -ifconfig carp0 create -ifconfig carp0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.1/24 -ifconfig carp1 create -ifconfig carp1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.2.1/24 +ifconfig em0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.1/24 +ifconfig em1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.2.1/24 .Ed .Pp Because of the preempt option, when one of the physical interfaces of @@ -224,67 +210,60 @@ is adjusted to 240 on all its interfaces. This will cause host B to preempt on both interfaces instead of just the failed one. -.Pp -In order to set up an ARP balanced virtual host, it is necessary to configure -one virtual host for each physical host which would respond to ARP requests -and thus handle the traffic. -In the following example, two virtual hosts are configured on two hosts to -provide balancing and failover for the IP address 192.168.1.10. -.Pp -First the -.Nm -interfaces on host A are configured. -The -.Cm advskew -of 100 on the second virtual host means that its advertisements will be sent -out slightly less frequently. -.Bd -literal -offset indent -ifconfig carp0 create -ifconfig carp0 vhid 1 pass mekmitasdigoat 192.168.1.10/24 -ifconfig carp1 create -ifconfig carp1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.1.10/24 -.Ed -.Pp -The configuration for host B is identical, except the -.Cm advskew -is on virtual host 1 rather than virtual host 2. -.Bd -literal -offset indent -ifconfig carp0 create -ifconfig carp0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.10/24 -ifconfig carp1 create -ifconfig carp1 vhid 2 pass mekmitasdigoat 192.168.1.10/24 -.Ed -.Pp -Finally, the ARP balancing feature must be enabled on both hosts: -.Pp -.Dl sysctl net.inet.carp.arpbalance=1 -.Pp -When the hosts receive an ARP request for 192.168.1.10, the source IP address -of the request is used to compute which virtual host should answer the request. -The host which is master of the selected virtual host will reply to the -request, the other(s) will ignore it. -.Pp -This way, locally connected systems will receive different ARP replies and -subsequent IP traffic will be balanced among the hosts. -If one of the hosts fails, the other will take over the virtual MAC address, -and begin answering ARP requests on its behalf. +.\".Pp +.\"In order to set up an ARP balanced virtual host, it is necessary to configure +.\"one virtual host for each physical host which would respond to ARP requests +.\"and thus handle the traffic. +.\"In the following example, two virtual hosts are configured on two hosts to +.\"provide balancing and failover for the IP address 192.168.1.10. +.\".Pp +.\"First the +.\".Nm +.\"interfaces on host A are configured. +.\"The +.\".Cm advskew +.\"of 100 on the second virtual host means that its advertisements will be sent +.\"out slightly less frequently. +.\".Bd -literal -offset indent +.\"ifconfig carp0 create +.\"ifconfig carp0 vhid 1 pass mekmitasdigoat 192.168.1.10/24 +.\"ifconfig carp1 create +.\"ifconfig carp1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.1.10/24 +.\".Ed +.\".Pp +.\"The configuration for host B is identical, except the +.\".Cm advskew +.\"is on virtual host 1 rather than virtual host 2. +.\".Bd -literal -offset indent +.\"ifconfig carp0 create +.\"ifconfig carp0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.10/24 +.\"ifconfig carp1 create +.\"ifconfig carp1 vhid 2 pass mekmitasdigoat 192.168.1.10/24 +.\".Ed +.\".Pp +.\"Finally, the ARP balancing feature must be enabled on both hosts: +.\".Pp +.\".Dl sysctl net.inet.carp.arpbalance=1 +.\".Pp +.\"When the hosts receive an ARP request for 192.168.1.10, the source IP address +.\"of the request is used to compute which virtual host should answer the request. +.\"The host which is master of the selected virtual host will reply to the +.\"request, the other(s) will ignore it. +.\".Pp +.\"This way, locally connected systems will receive different ARP replies and +.\"subsequent IP traffic will be balanced among the hosts. +.\"If one of the hosts fails, the other will take over the virtual MAC address, +.\"and begin answering ARP requests on its behalf. .Pp Processing of .Nm -status change events can be set up by using the following devd.conf rules: +status change events can be set up by using the following devd.conf rule: .Bd -literal -offset indent notify 0 { - match "system" "IFNET"; - match "type" "LINK_UP"; - match "subsystem" "carp*"; - action "/root/carpcontrol.sh $type $subsystem"; -}; - -notify 0 { - match "system" "IFNET"; - match "type" "LINK_DOWN"; - match "subsystem" "carp*"; - action "/root/carpcontrol.sh $type $subsystem"; + match "system" "CARP"; + match "subsystem" "[0-9]+@"; + match "type" "(MASTER|BACKUP)"; + action "/root/carpcontrol.sh $subsystem $type"; }; .Ed .Sh SEE ALSO @@ -303,3 +282,8 @@ The .Nm device was imported into .Fx 5.4 . +In +.Fx 10 +the +.Nm +was significantly rewritten, and is no longer a pseudo-interface. -- cgit v1.1 From bdf9f67646239b0d85ac3d47928768aefa05f164 Mon Sep 17 00:00:00 2001 From: mav Date: Fri, 16 Dec 2011 14:19:46 +0000 Subject: Some formatting fixes. Submitted by: ru --- share/man/man4/eventtimers.4 | 45 ++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) (limited to 'share') diff --git a/share/man/man4/eventtimers.4 b/share/man/man4/eventtimers.4 index 37d5fc8..f5ce95f 100644 --- a/share/man/man4/eventtimers.4 +++ b/share/man/man4/eventtimers.4 @@ -46,16 +46,22 @@ statistics, time keeping, profiling and many other things, based on .Xr callout 9 mechanism. These purposes now grouped into three main callbacks: -.Bl -tag -.It hardclock() +.Bl -tag -width ".Fn hardclock" +.It Fn hardclock .Xr callout 9 -and timekeeping events entry. Called with frequency defined by hz variable, +and timekeeping events entry. +Called with frequency defined by +.Va hz +variable, usually 1000Hz. -.It statclock() -statistics and scheduler events entry. Called with frequency about 128Hz. -.It profclock() -profiler events entry. When enabled, called with frequency about 8KHz. +.It Fn statclock +statistics and scheduler events entry. +Called with frequency about 128Hz. +.It Fn profclock +profiler events entry. +When enabled, called with frequency about 8KHz. .El +.Pp Different platforms provide different kinds of timer hardware. The goal of the event timers subsystem is to provide unified way to control that hardware, and to use it, supplying kernel with all required time-based @@ -80,11 +86,13 @@ kern.eventtimer.et.HPET.flags: 7 kern.eventtimer.et.HPET.frequency: 14318180 kern.eventtimer.et.HPET.quality: 550 .Ed -, where: -.Bl -tag +.Pp +where: +.Bl -inset .It Va kern.eventtimer.et. Ns Ar X Ns Va .flags +is a bitmask, defining event timer capabilities: -.Bl -tag -compact +.Bl -tag -offset indent -width indent -compact .It 1 periodic mode supported, .It 2 @@ -97,8 +105,10 @@ timer may stop when CPU goes to sleep state, timer supports only power-of-2 divisors. .El .It Va kern.eventtimer.et. Ns Ar X Ns Va .frequency +is a timer base frequency, .It Va kern.eventtimer.et. Ns Ar X Ns Va .quality +is an integral value, defining how good is this timer, comparing to others. .El .Pp @@ -107,7 +117,7 @@ Current choice can be read and affected via .Va kern.eventtimer.timer tunable/sysctl. Several other tunables/sysctls are affecting how exactly this timer is used: -.Bl -tag +.Bl -inset .It Va kern.eventtimer.periodic allows to choose periodic and one-shot operation mode. In periodic mode, periodic interrupts from timer hardware are taken as the @@ -119,15 +129,22 @@ Default value depends of chosen timer capabilities, but one-shot mode is preferred, until other is forced by user or hardware. .It Va kern.eventtimer.singlemul in periodic mode specifies how much times higher timer frequency should be, -to not strictly alias hardclock() and statclock() events. Default values are +to not strictly alias +.Fn hardclock +and +.Fn statclock +events. +Default values are 1, 2 or 4, depending on configured HZ value. .It Va kern.eventtimer.idletick makes each CPU to receive every timer interrupt independently of whether they -busy or not. By default this options is disabled. If chosen timer is per-CPU +busy or not. +By default this options is disabled. +If chosen timer is per-CPU and runs in periodic mode, this option has no effect - all interrupts are always generating. .El .Sh SEE ALSO -.Xr attimer 4 , .Xr atrtc 4 , +.Xr attimer 4 , .Xr hpet 4 -- cgit v1.1 From d9e99680845314a5d7c26de7a5c5801efdb70526 Mon Sep 17 00:00:00 2001 From: dim Date: Fri, 16 Dec 2011 23:42:25 +0000 Subject: Add a NO_WARRAY_BOUNDS setting to bsd.sys.mk, only applicable to clang, to selectively work around warnings in programs that don't use flexible array members, but instead define arrays of length 1 at the end of the struct, and then access those beyond their declared bounds. MFC after: 1 week --- share/mk/bsd.sys.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'share') diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index de7355f..061a270 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -70,6 +70,9 @@ CWARNFLAGS += -Wno-switch-enum . if ${WARNS} <= 1 CWARNFLAGS += -Wno-parentheses . endif +. if defined(NO_WARRAY_BOUNDS) +CWARNFLAGS += -Wno-array-bounds +. endif . endif . endif -- cgit v1.1 From f68951a3ddbe41d2393a823e0b1a8ff61138da73 Mon Sep 17 00:00:00 2001 From: dim Date: Sat, 17 Dec 2011 01:51:12 +0000 Subject: Disable yet another clang warning when WARNS <= 3. MFC after: 1 week --- share/mk/bsd.sys.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 061a270..b7f330c 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -62,7 +62,7 @@ CWARNFLAGS += -Wno-pointer-sign . if ${CC:T:Mclang} == "clang" . if ${WARNS} <= 3 CWARNFLAGS += -Wno-tautological-compare -Wno-unused-value\ - -Wno-parentheses-equality + -Wno-parentheses-equality -Wno-unused-function . endif . if ${WARNS} <= 2 CWARNFLAGS += -Wno-switch-enum -- cgit v1.1 From a6ba1663e403051d36000b3b14ac9e5c92576a29 Mon Sep 17 00:00:00 2001 From: ru Date: Sat, 17 Dec 2011 06:57:35 +0000 Subject: Fixed some of markup. Reviewed by: jhb --- share/man/man9/shm_map.9 | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'share') diff --git a/share/man/man9/shm_map.9 b/share/man/man9/shm_map.9 index 6f61147..a711fb6 100644 --- a/share/man/man9/shm_map.9 +++ b/share/man/man9/shm_map.9 @@ -30,9 +30,8 @@ .Dt SHM_MAP 9 .Os .Sh NAME -.Nm shm_map , -.Nm shm_unmap -.Nd map shared memory objects into the kernel's address space +.Nm shm_map , shm_unmap +.Nd "map shared memory objects into the kernel's address space" .Sh SYNOPSIS .In sys/types.h .In sys/mman.h @@ -42,9 +41,9 @@ .Fn shm_unmap "struct file *fp" "void *mem" "size_t size" .Sh DESCRIPTION The -.Nm shm_map +.Fn shm_map and -.Nm shm_unmap +.Fn shm_unmap functions provide an API for mapping shared memory objects into the kernel. Shared memory objects are created by .Xr shm_open 2 . @@ -57,13 +56,13 @@ Shared memory objects can still be grown while mapped into the kernel. .Pp To simplify the accounting needed to enforce the above requirement, callers of this API are required to unmap the entire region mapped by -.Nm shm_map +.Fn shm_map when calling -.Nm shm_unmap . +.Fn shm_unmap . Unmapping only a portion of the region is not permitted. .Pp The -.Nm shm_map +.Fn shm_map function locates the shared memory object associated with the open file .Fa fp . It maps the region of that object described by @@ -77,9 +76,9 @@ will be set to the start of the mapping. All pages for the range will be wired into memory upon successful return. .Pp The -.Nm shm_unmap +.Fn shm_unmap function unmaps a region previously mapped by -.Nm shm_map . +.Fn shm_map . The .Fa mem argument should match the value previously returned in @@ -87,22 +86,22 @@ argument should match the value previously returned in and the .Fa size argument should match the value passed to -.Nm shm_map . +.Fn shm_map . .Pp Note that -.Nm shm_map +.Fn shm_map will not hold an extra reference on the open file .Fa fp for the lifetime of the mapping. Instead, the calling code is required to do this if it wishes to use -.Nm shm_unmap +.Fn shm_unmap on the region in the future. .Sh RETURN VALUES The -.Nm shm_map +.Fn shm_map and -.Nm shm_unmap +.Fn shm_unmap functions return zero on success or an error on failure. .Sh EXAMPLES The following function accepts a file descriptor for a shared memory @@ -110,7 +109,7 @@ object. It maps the first sixteen kilobytes of the object into the kernel, performs some work on that address, and then unmaps the address before returning. -.Bd -literal +.Bd -literal -offset indent int shm_example(int fd) { @@ -118,7 +117,7 @@ shm_example(int fd) void *mem; int error; - error = fget(curthread, fd, CAP_MMAP, &fp) + error = fget(curthread, fd, CAP_MMAP, &fp); if (error) return (error); error = shm_map(fp, 16384, 0, &mem); @@ -136,7 +135,7 @@ shm_example(int fd) .Ed .Sh ERRORS The -.Nm shm_map +.Fn shm_map function returns the following errors on failure: .Bl -tag -width Er .It Bq Er EINVAL @@ -158,7 +157,7 @@ The shared memory object could not be mapped due to some other VM error. .El .Pp The -.Nm shm_unmap +.Fn shm_unmap function returns the following errors on failure: .Bl -tag -width Er .It Bq Er EINVAL -- cgit v1.1 From 6990aaaaad9033700839123d1cd90d89b80444b4 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 18 Dec 2011 00:24:11 +0000 Subject: Disable yet another clang warning (-Wconversion) when WARNS <= 3. MFC after: 1 week --- share/mk/bsd.sys.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index b7f330c..d4830f1 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -62,7 +62,8 @@ CWARNFLAGS += -Wno-pointer-sign . if ${CC:T:Mclang} == "clang" . if ${WARNS} <= 3 CWARNFLAGS += -Wno-tautological-compare -Wno-unused-value\ - -Wno-parentheses-equality -Wno-unused-function + -Wno-parentheses-equality -Wno-unused-function\ + -Wno-conversion . endif . if ${WARNS} <= 2 CWARNFLAGS += -Wno-switch-enum -- cgit v1.1 From c33f43657fb18a2032cf85bbbe9de44fd81475e4 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 18 Dec 2011 00:34:42 +0000 Subject: Disable another clang warning (-Wempty-body) when WARNS <= 2. MFC after: 1 week --- share/mk/bsd.sys.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index d4830f1..7a72ca6 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -66,7 +66,7 @@ CWARNFLAGS += -Wno-tautological-compare -Wno-unused-value\ -Wno-conversion . endif . if ${WARNS} <= 2 -CWARNFLAGS += -Wno-switch-enum +CWARNFLAGS += -Wno-switch-enum -Wno-empty-body . endif . if ${WARNS} <= 1 CWARNFLAGS += -Wno-parentheses -- cgit v1.1 From 68a134710c655dcf316d05f6071b84d881abde0b Mon Sep 17 00:00:00 2001 From: jhb Date: Mon, 19 Dec 2011 18:55:13 +0000 Subject: Add a TASK_INITIALIZER() macro that can be used to statically initialize a task structure. Reviewed by: gj MFC after: 2 weeks --- share/man/man9/Makefile | 1 + share/man/man9/taskqueue.9 | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index b150b64..124fae9 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1250,6 +1250,7 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_entry_add.9 \ sysctl_ctx_init.9 sysctl_ctx_free.9 MLINKS+=SYSINIT.9 SYSUNINIT.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ + taskqueue.9 TASK_INITIALIZER.9 \ taskqueue.9 taskqueue_cancel.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 taskqueue_create_fast.9 \ diff --git a/share/man/man9/taskqueue.9 b/share/man/man9/taskqueue.9 index 40d64af..056ee66 100644 --- a/share/man/man9/taskqueue.9 +++ b/share/man/man9/taskqueue.9 @@ -80,6 +80,7 @@ struct timeout_task; .Ft void .Fn taskqueue_run "struct taskqueue *queue" .Fn TASK_INIT "struct task *task" "int priority" "task_fn_t func" "void *context" +.Fn TASK_INITIALIZER "int priority" "task_fn_t func" "void *context" .Fn TASKQUEUE_DECLARE "name" .Fn TASKQUEUE_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" .Fn TASKQUEUE_FAST_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" @@ -243,9 +244,14 @@ A convenience macro, is provided to initialise a .Va task structure. +The +.Fn TASK_INITIALIZER +macro generates an initializer for a task structure. A macro .Fn TIMEOUT_TASK_INIT "queue" "timeout_task" "priority" "func" "context" -initializes the timeout_task structure. +initializes the +.Va timeout_task +structure. The values of .Va priority , .Va func , -- cgit v1.1 From cb7060fb0090efad0fe7704e6ab3c8c43aa1ab3f Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 20 Dec 2011 11:40:22 +0000 Subject: Add eventtimers(9) man page, describing related KPIs. Sponsored by: iXsystems, Inc. MFC after: 1 month --- share/man/man4/eventtimers.4 | 3 +- share/man/man9/Makefile | 11 ++ share/man/man9/eventtimers.9 | 236 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 share/man/man9/eventtimers.9 (limited to 'share') diff --git a/share/man/man4/eventtimers.4 b/share/man/man4/eventtimers.4 index f5ce95f..c74c3c4 100644 --- a/share/man/man4/eventtimers.4 +++ b/share/man/man4/eventtimers.4 @@ -147,4 +147,5 @@ always generating. .Sh SEE ALSO .Xr atrtc 4 , .Xr attimer 4 , -.Xr hpet 4 +.Xr hpet 4 , +.Xr eventtimers 9 diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 124fae9..2b9f3bb 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -102,6 +102,7 @@ MAN= accept_filter.9 \ driver.9 \ DRIVER_MODULE.9 \ EVENTHANDLER.9 \ + eventtimers.9 \ extattr.9 \ fail.9 \ fetch.9 \ @@ -614,6 +615,16 @@ MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECLARE.9 \ EVENTHANDLER.9 eventhandler_prune_list.9 \ EVENTHANDLER.9 EVENTHANDLER_REGISTER.9 \ EVENTHANDLER.9 eventhandler_register.9 +MLINKS+=eventtimers.9 et_register.9 \ + eventtimers.9 et_deregister.9 \ + eventtimers.9 et_ban.9 \ + eventtimers.9 et_find.9 \ + eventtimers.9 et_free.9 \ + eventtimers.9 et_init.9 \ + eventtimers.9 ET_LOCK.9 \ + eventtimers.9 ET_UNLOCK.9 \ + eventtimers.9 et_start.9 \ + eventtimers.9 et_stop.9 MLINKS+=fetch.9 fubyte.9 \ fetch.9 fuswintr.9 \ fetch.9 fuword.9 \ diff --git a/share/man/man9/eventtimers.9 b/share/man/man9/eventtimers.9 new file mode 100644 index 0000000..db530a9 --- /dev/null +++ b/share/man/man9/eventtimers.9 @@ -0,0 +1,236 @@ +.\" +.\" Copyright (c) 2011 Alexander Motin +.\" 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 DEVELOPERS ``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 DEVELOPERS 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$ +.\" +.Dd December 14, 2011 +.Dt EVENTTIMERS 9 +.Os +.Sh NAME +.Nm eventtimers +.Nd kernel event timers subsystem +.Sh SYNOPSIS +.In sys/timeet.h +.Bd -literal +struct eventtimer; + +typedef int et_start_t(struct eventtimer *et, + struct bintime *first, struct bintime *period); +typedef int et_stop_t(struct eventtimer *et); +typedef void et_event_cb_t(struct eventtimer *et, void *arg); +typedef int et_deregister_cb_t(struct eventtimer *et, void *arg); + +struct eventtimer { + SLIST_ENTRY(eventtimer) et_all; + char *et_name; + int et_flags; +#define ET_FLAGS_PERIODIC 1 +#define ET_FLAGS_ONESHOT 2 +#define ET_FLAGS_PERCPU 4 +#define ET_FLAGS_C3STOP 8 +#define ET_FLAGS_POW2DIV 16 + int et_quality; + int et_active; + u_int64_t et_frequency; + struct bintime et_min_period; + struct bintime et_max_period; + et_start_t *et_start; + et_stop_t *et_stop; + et_event_cb_t *et_event_cb; + et_deregister_cb_t *et_deregister_cb; + void *et_arg; + void *et_priv; + struct sysctl_oid *et_sysctl; +}; +.Ed +.Ft int +.Fn et_register "struct eventtimer *et" +.Ft int +.Fn et_deregister "struct eventtimer *et" +.Fn ET_LOCK +.Fn ET_UNLOCK +.Ft struct eventtimer * +.Fn et_find "const char *name" "int check" "int want" +.Ft int +.Fn et_init "struct eventtimer *et" "et_event_cb_t *event" "et_deregister_cb_t *deregister" "void *arg" +.Ft int +.Fn et_start "struct eventtimer *et" "struct bintime *first" "struct bintime *period" +.Ft int +.Fn et_stop "struct eventtimer *et" +.Ft int +.Fn et_ban "struct eventtimer *et" +.Ft int +.Fn et_free "struct eventtimer *et" +.Sh DESCRIPTION +Event timers are responsible for generating interrupts at specified time +or periodically, to run different time-based events. +Subsystem consists of three main parts: +.Bl -tag +.It Drivers +Manage hardware to generate requested time events. +.It Consumers +.Pa sys/kern/kern_clocksource.c +uses event timers to supply kernel with +.Fn hardclock , +.Fn statclock +and +.Fn profclock +time events. +.It Glue code +.Pa sys/sys/timeet.h , +.Pa sys/kern/kern_et.c +provide APIs for event timer drivers and consumers. +.El +.Sh DRIVER API +Driver API is built around eventtimer structure. +To register its functionality driver allocates that structure and calls +.Fn et_register . +Driver should fill following fields there: +.Bl -tag +.It Va et_name +Unique name of the event timer for management purposes. +.It Va et_flags +Set of flags, describing timer capabilities: +.Bl -tag -width "ET_FLAGS_PERIODIC" -compact +.It ET_FLAGS_PERIODIC +Periodic mode supported. +.It ET_FLAGS_ONESHOT +One-shot mode supported. +.It ET_FLAGS_PERCPU +Timer is per-CPU. +.It ET_FLAGS_C3STOP +Timer may stop in CPU sleep state. +.It ET_FLAGS_POW2DIV +Timer supports only 2^n divisors. +.El +.It Va et_quality +Abstract value to certify whether this timecounter is better than the others. +Higher value means better. +.It Va et_frequency +Timer oscillator's base frequency, if applicable and known. +Used by consumers to predict set of possible frequencies that could be +obtained by dividing it. +Should be zero if not applicable or unknown. +.It Va et_min_period , et_max_period +Minimal and maximal reliably programmable time periods. +.It Va et_start +Driver's timer start function pointer. +.It Va et_stop +Driver's timer stop function pointer. +.It Va et_priv +Driver's private data storage. +.El +.Pp +After the event timer functionality is registered, it is controlled via +.Va et_start +and +.Va et_stop +methods. +.Va et_start +method is called to start the specified event timer. +The last two arguments are used to specify time when events should be +generated. +.Va first +argument specifies time period before the first event generated. +In periodic mode NULL value specifies that first period is equal to the +.Va period +argument value. +.Va period +argument specifies the time period between following events for the +periodic mode. +The NULL value there specifies the one-shot mode. +At least one of these two arguments should be not NULL. +When event time arrive, driver should call +.Va et_event_cb +callback function, passing +.Va et_arg +as the second argument. +.Va et_stop +method is called to stop the specified event timer. +For the per-CPU event timers +.Va et_start +and +.Va et_stop +methods control timers associated with the current CPU. +.Pp +Driver may deregister its functionality by calling +.Fn et_deregister . +.Sh CONSUMER API +.Fn et_find +allows consumer to find available event timer, optionally matching specific +name and/or capability flags. +Consumer may read returned eventtimer structure, but should not modify it. +When wanted event timer is found, +.Fn et_init +should be called for it, submitting +.Va event +and optionally +.Va deregister +callbacks functions, and the opaque argument +.Va arg . +That argument will be passed as argument to the callbacks. +Event callback function will be called on scheduled time events. +It is called from the hardware interrupt context, so no sleep is permitted +there. +Deregister callback function may be called to report consumer that the event +timer functionality is no longer available. +On this call, consumer should stop using event timer before the return. +.Pp +After the timer is found and initialized, it can be controlled via +.Fn et_start +and +.Fn et_stop . +The arguments are the same as described in driver API. +Per-CPU event timers can be controlled only from specific CPUs. +.Pp +.Fn et_ban +allows consumer to mark event timer as broken via clearing both one-shot and +periodic capability flags, if it was somehow detected. +.Fn et_free +is the opposite to +.Fn et_init . +It releases the event timer for other consumers use. +.Pp +.Fn ET_LOCK +and +.Fn ET_UNLOCK +macros should be used to manage +.Xr mutex 9 +lock around +.Fn et_find , +.Fn et_init +and +.Fn et_free +calls to serialize access to the list of the registered event timers and the +pointers returned by +.Fn et_find . +.Fn et_start +and +.Fn et_stop +calls should be serialized in consumer's internal way to avoid concurrent +timer hardware access. +.Sh SEE ALSO +.Xr eventtimers 4 +.Sh AUTHORS +.An Alexander Motin Aq mav@FreeBSD.org -- cgit v1.1 From 7cd583b49ab304c1a94bc8e9c2be06e7634dc2bf Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 20 Dec 2011 13:49:52 +0000 Subject: Add apic(4) man page, now mostly to cover its event timer functionality. --- share/man/man4/Makefile | 2 ++ share/man/man4/apic.4 | 78 ++++++++++++++++++++++++++++++++++++++++++++ share/man/man4/atrtc.4 | 5 +-- share/man/man4/attimer.4 | 5 +-- share/man/man4/eventtimers.4 | 1 + share/man/man4/hpet.4 | 1 + 6 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 share/man/man4/apic.4 (limited to 'share') diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 69e9a7c..4c93cfc 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -38,6 +38,7 @@ MAN= aac.4 \ ${_amdtemp.4} \ amr.4 \ an.4 \ + ${_apic.4} \ arcmsr.4 \ ${_asmc.4} \ asr.4 \ @@ -673,6 +674,7 @@ _acpi_sony.4= acpi_sony.4 _acpi_toshiba.4=acpi_toshiba.4 _acpi_wmi.4= acpi_wmi.4 _aesni.4= aesni.4 +_apic.4= apic.4 _atrtc.4= atrtc.4 _attimer.4= attimer.4 _aibs.4= aibs.4 diff --git a/share/man/man4/apic.4 b/share/man/man4/apic.4 new file mode 100644 index 0000000..89a869d --- /dev/null +++ b/share/man/man4/apic.4 @@ -0,0 +1,78 @@ +.\" Copyright (c) 2011 Alexander Motin +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd December 20, 2011 +.Dt APIC 4 +.Os +.Sh NAME +.Nm apic +.Nd Advanced Programmable Interrupt Controller (APIC) driver +.Sh SYNOPSIS +This driver is a mandatory part of amd64 kernel. +To compile this driver into i386 or pc98 kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device apic" +.Ed +.Pp +The following tunable is settable from the +.Xr loader 8 : +.Bl -ohang +.It Va hint.apic. Ns Ar X Ns Va .clock +controls event timers functionality support. Setting to 0, disables it. +Default value is 1. +.It Va hint.apic. Ns Ar X Ns Va .disabled +Set this to 1 to disable APIC support, falling back to the legacy PIC. +.El +.Sh DESCRIPTION +There are two components in the Intel APIC system, the local APIC (LAPIC) +and the I/O APIC. +There is one LAPIC in each CPU in the system. +There is typically one I/O APIC for each peripheral bus in the system. +.Pp +LAPICs manage all external and interrupts for specific processor in an +SMP system. +In addition, they are able to accept and generate inter-processor interrupts +(IPIs). +.Pp +I/O APICs contain a redirection table, which is used to route the interrupts +they receive from peripheral buses to one or more local APICs. +.Pp +Each LAPIC includes one 32-bit programable timer. +This driver uses them to supply kernel with one event timer named "LAPIC". +Event timer provided by the driver supports both one-shot an periodic modes. +Because of LAPIC nature it is per-CPU. +The timer frequency is not reported by the platform and so automatically +measured by the driver on the first use. +Depending on CPU model this timer may stop in C3 and deeper CPU sleep states. +Driver automatically adjusts event timer priority and reports it to prevent +entering dangerous sleep states when it is used. +.Sh SEE ALSO +.Xr atrtc 4 , +.Xr attimer 4 , +.Xr eventtimers 4 , +.Xr hpet 4 diff --git a/share/man/man4/atrtc.4 b/share/man/man4/atrtc.4 index 2a75d03..0b0dd8f 100644 --- a/share/man/man4/atrtc.4 +++ b/share/man/man4/atrtc.4 @@ -51,6 +51,7 @@ divisors. .Pp Event timer provided by the driver is irrelevant to CPU power states. .Sh SEE ALSO +.Xr apic 4 , .Xr attimer 4 , -.Xr hpet 4 , -.Xr eventtimers 4 +.Xr eventtimers 4 , +.Xr hpet 4 diff --git a/share/man/man4/attimer.4 b/share/man/man4/attimer.4 index 6dd4ee2..78d40d4 100644 --- a/share/man/man4/attimer.4 +++ b/share/man/man4/attimer.4 @@ -70,6 +70,7 @@ functionality is disabled. .Pp Event timer provided by the driver is irrelevant to CPU power states. .Sh SEE ALSO +.Xr apic 4 , .Xr atrtc 4 , -.Xr hpet 4 , -.Xr eventtimers 4 +.Xr eventtimers 4 , +.Xr hpet 4 diff --git a/share/man/man4/eventtimers.4 b/share/man/man4/eventtimers.4 index c74c3c4..e29d32f8 100644 --- a/share/man/man4/eventtimers.4 +++ b/share/man/man4/eventtimers.4 @@ -145,6 +145,7 @@ and runs in periodic mode, this option has no effect - all interrupts are always generating. .El .Sh SEE ALSO +.Xr apic 4 , .Xr atrtc 4 , .Xr attimer 4 , .Xr hpet 4 , diff --git a/share/man/man4/hpet.4 b/share/man/man4/hpet.4 index bcfea1c..092996c 100644 --- a/share/man/man4/hpet.4 +++ b/share/man/man4/hpet.4 @@ -94,6 +94,7 @@ group is bound to specific CPU core. This is possible only when each of these comparators has own unsharable IRQ. .Sh SEE ALSO .Xr acpi 4 , +.Xr apic 4 , .Xr atrtc 4 , .Xr attimer 4 , .Xr eventtimers 4 -- cgit v1.1 From 8c74bad9f352ee33107ec1cbfa7273cb27d41a98 Mon Sep 17 00:00:00 2001 From: glebius Date: Tue, 20 Dec 2011 13:53:31 +0000 Subject: Restore a feature that was present in 5.x and 6.x, and was cleared in 7.x, 8.x and 9.x with pf(4) imports: pfsync(4) should suppress CARP preemption, while it is running its bulk update. However, reimplement the feature in more elegant manner, that is partially inspired by newer OpenBSD: - Rename term "suppression" to "demotion", to match with OpenBSD. - Keep a global demotion factor, that can be raised by several conditions, for now these are: - interface goes down - carp(4) has problems with ip_output() or ip6_output() - pfsync performs bulk update - Unlike in OpenBSD the demotion factor isn't a counter, but is actual value added to advskew. The adjustment values for particular error conditions are also configurable, and their defaults are maximum advskew value, so a single failure bumps demotion to maximum. This is for POLA compatibility, and should satisfy most users. - Demotion factor is a writable sysctl, so user can do foot shooting, if he desires to. --- share/man/man4/carp.4 | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to 'share') diff --git a/share/man/man4/carp.4 b/share/man/man4/carp.4 index 7c214ff..1b59e72 100644 --- a/share/man/man4/carp.4 +++ b/share/man/man4/carp.4 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 16, 2011 +.Dd December 20, 2011 .Dt CARP 4 .Os .Sh NAME @@ -121,15 +121,38 @@ Values above 1 enable logging of bad .Nm packets. Default value is 1. -.It Va net.inet.carp.suppress_preempt -A read only value showing the status of preemption suppression. -Preemption can be suppressed if link on an interface is down -or when +.It Va net.inet.carp.demotion +This value shows current level of CARP demotion. +The value is added to the actual advskew sent in announcements for +all vhids. +At normal system operation the demotion factor is zero. +However, problematic conditions raise its level: when +.Nm +experiences problem with sending announcements, when an interface +running a vhid goes down, or while the .Xr pfsync 4 interface is not synchronized. -Value of 0 means that preemption is not suppressed, since no -problems are detected. -Every problem increments suppression counter. +The demotion value is writable, so that user may alter it +depending on some external conditions, for example on status of some +daemon utility. +However, altering the value should be performed with care, do +not conflict with subsystems that adjust demotion factor +automatically: +.Nm +and +.Xr pfsync 4 . +.It Va net.inet.carp.ifdown_demotion_factor +Value added to +.Va net.inet.carp.demotion +when interface running a vhid goes down. +Default value is 240 (maximum advskew value). +.It Va net.inet.carp.senderr_demotion_factor +Value added to +.Va net.inet.carp.demotion +when +.Nm +experiences errors sending its announcements. +Default value is 240 (maximum advskew value). .El .\".Sh ARP level load balancing .\"The -- cgit v1.1 From 1eeaa2989fb2285b0318968605f3fe7826f8e863 Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 20 Dec 2011 14:12:50 +0000 Subject: Remove extra "and" left from earlier version. --- share/man/man4/apic.4 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'share') diff --git a/share/man/man4/apic.4 b/share/man/man4/apic.4 index 89a869d..bcd9c3f 100644 --- a/share/man/man4/apic.4 +++ b/share/man/man4/apic.4 @@ -54,8 +54,7 @@ and the I/O APIC. There is one LAPIC in each CPU in the system. There is typically one I/O APIC for each peripheral bus in the system. .Pp -LAPICs manage all external and interrupts for specific processor in an -SMP system. +LAPICs manage all external interrupts for specific processor in an SMP system. In addition, they are able to accept and generate inter-processor interrupts (IPIs). .Pp -- cgit v1.1 From 49c984362d622d868ec5b0bbdac3ea63cb9add25 Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 20 Dec 2011 15:19:33 +0000 Subject: s/LAPIC/local APIC/ to closer follow Intel documents. Submitted by: jhb --- share/man/man4/apic.4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'share') diff --git a/share/man/man4/apic.4 b/share/man/man4/apic.4 index bcd9c3f..224e4f6 100644 --- a/share/man/man4/apic.4 +++ b/share/man/man4/apic.4 @@ -51,20 +51,20 @@ Set this to 1 to disable APIC support, falling back to the legacy PIC. .Sh DESCRIPTION There are two components in the Intel APIC system, the local APIC (LAPIC) and the I/O APIC. -There is one LAPIC in each CPU in the system. +There is one local APIC in each CPU in the system. There is typically one I/O APIC for each peripheral bus in the system. .Pp -LAPICs manage all external interrupts for specific processor in an SMP system. +Local APICs manage all external interrupts for a specific processor. In addition, they are able to accept and generate inter-processor interrupts (IPIs). .Pp I/O APICs contain a redirection table, which is used to route the interrupts they receive from peripheral buses to one or more local APICs. .Pp -Each LAPIC includes one 32-bit programable timer. +Each local APIC includes one 32-bit programable timer. This driver uses them to supply kernel with one event timer named "LAPIC". Event timer provided by the driver supports both one-shot an periodic modes. -Because of LAPIC nature it is per-CPU. +Because of local APIC nature it is per-CPU. The timer frequency is not reported by the platform and so automatically measured by the driver on the first use. Depending on CPU model this timer may stop in C3 and deeper CPU sleep states. -- cgit v1.1 From 46767d49f7d233a5bd8e2fc157a4ca7c84d338e1 Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 20 Dec 2011 17:10:34 +0000 Subject: Add timecounters(4) man page alike to eventtimers(4). --- share/man/man4/Makefile | 1 + share/man/man4/attimer.4 | 3 +- share/man/man4/eventtimers.4 | 1 + share/man/man4/hpet.4 | 3 +- share/man/man4/timecounters.4 | 105 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 share/man/man4/timecounters.4 (limited to 'share') diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 4c93cfc..d13d348 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -445,6 +445,7 @@ MAN= aac.4 \ termios.4 \ textdump.4 \ ti.4 \ + timecounters.4 \ tl.4 \ tnt4882.4 \ ${_tpm.4} \ diff --git a/share/man/man4/attimer.4 b/share/man/man4/attimer.4 index 78d40d4..751b9ea 100644 --- a/share/man/man4/attimer.4 +++ b/share/man/man4/attimer.4 @@ -73,4 +73,5 @@ Event timer provided by the driver is irrelevant to CPU power states. .Xr apic 4 , .Xr atrtc 4 , .Xr eventtimers 4 , -.Xr hpet 4 +.Xr hpet 4 , +.Xr timecounters 4 diff --git a/share/man/man4/eventtimers.4 b/share/man/man4/eventtimers.4 index e29d32f8..c935c3e 100644 --- a/share/man/man4/eventtimers.4 +++ b/share/man/man4/eventtimers.4 @@ -149,4 +149,5 @@ always generating. .Xr atrtc 4 , .Xr attimer 4 , .Xr hpet 4 , +.Xr timecounters 4 , .Xr eventtimers 9 diff --git a/share/man/man4/hpet.4 b/share/man/man4/hpet.4 index 092996c..cd1b766 100644 --- a/share/man/man4/hpet.4 +++ b/share/man/man4/hpet.4 @@ -97,7 +97,8 @@ of these comparators has own unsharable IRQ. .Xr apic 4 , .Xr atrtc 4 , .Xr attimer 4 , -.Xr eventtimers 4 +.Xr eventtimers 4 , +.Xr timecounters 4 .Sh HISTORY The .Nm diff --git a/share/man/man4/timecounters.4 b/share/man/man4/timecounters.4 new file mode 100644 index 0000000..8cbcdc1 --- /dev/null +++ b/share/man/man4/timecounters.4 @@ -0,0 +1,105 @@ +.\" Copyright (c) 2011 Alexander Motin +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd December 20, 2011 +.Dt TIMECOUNTERS 4 +.Os +.Sh NAME +.Nm timecounters +.Nd kernel time counters subsystem +.Sh SYNOPSIS +Kernel uses several types of time-related devices, such as: real time clocks, +time counters and event timers. +Real time clocks responsible for tracking real world time, mostly when system +is down. +Time counters are responsible for tracking purposes, when system is running. +Event timers are responsible for generating interrupts at specified time or +periodically, to run different time-based events. +This page is about the second. +.Sh DESCRIPTION +Time counters are the lowest level of time tracking in kernel. +They provide monotonically increasing timestamps with known width and +update frequency. +They can overflow, drift, etc and so in raw form used only in very limited +performance-critical places like process scheduler. +.Pp +More usable time is created by scaling the values read from the selected +time counter and combining it with some offset, regularly updated by +.Fn tc_windup +on +.Fn hardclock +invocation. +.Pp +Different platforms provide different kinds of timer hardware. +The goal of the time counters subsystem is to provide unified way to access +that hardware. +.Pp +Each driver implementing time counters, registers them at the subsystem. +It is possible to see the list of present time counters, like this, via +.Va kern.timecounter +sysctl: +.Bd -literal +kern.timecounter.choice: TSC-low(-100) HPET(950) i8254(0) ACPI-fast(900) dummy(-1000000) +kern.timecounter.tc.ACPI-fast.mask: 16777215 +kern.timecounter.tc.ACPI-fast.counter: 13467909 +kern.timecounter.tc.ACPI-fast.frequency: 3579545 +kern.timecounter.tc.ACPI-fast.quality: 900 +kern.timecounter.tc.i8254.mask: 65535 +kern.timecounter.tc.i8254.counter: 62692 +kern.timecounter.tc.i8254.frequency: 1193182 +kern.timecounter.tc.i8254.quality: 0 +kern.timecounter.tc.HPET.mask: 4294967295 +kern.timecounter.tc.HPET.counter: 3013495652 +kern.timecounter.tc.HPET.frequency: 14318180 +kern.timecounter.tc.HPET.quality: 950 +kern.timecounter.tc.TSC-low.mask: 4294967295 +kern.timecounter.tc.TSC-low.counter: 4067509463 +kern.timecounter.tc.TSC-low.frequency: 11458556 +kern.timecounter.tc.TSC-low.quality: -100 +.Ed +.Pp +where: +.Bl -inset +.It Va kern.timecounter.tc. Ns Ar X Ns Va .mask +is a bitmask, defining valid counter bits, +.It Va kern.timecounter.tc. Ns Ar X Ns Va .counter +is a present counter value, +.It Va kern.eventtimer.tc. Ns Ar X Ns Va .frequency +is a counter update frequency, +.It Va kern.eventtimer.tc. Ns Ar X Ns Va .quality +is an integral value, defining how good is this time counter, +comparing to others. +Negative value means that this time counter is broken and should not be used. +.El +.Pp +Time management code of the kernel chooses one time counter from that list. +Current choice can be read and affected via +.Va kern.timecounter.hardware +tunable/sysctl. +.Sh SEE ALSO +.Xr attimer 4 , +.Xr eventtimers 4 , +.Xr hpet 4 -- cgit v1.1 From dff6a31a10f81950594ad7bc25e226040cfc8290 Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 20 Dec 2011 17:32:13 +0000 Subject: Fix copy-paste typo. --- share/man/man4/timecounters.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/man/man4/timecounters.4 b/share/man/man4/timecounters.4 index 8cbcdc1..340512e 100644 --- a/share/man/man4/timecounters.4 +++ b/share/man/man4/timecounters.4 @@ -87,9 +87,9 @@ where: is a bitmask, defining valid counter bits, .It Va kern.timecounter.tc. Ns Ar X Ns Va .counter is a present counter value, -.It Va kern.eventtimer.tc. Ns Ar X Ns Va .frequency +.It Va kern.timecounter.tc. Ns Ar X Ns Va .frequency is a counter update frequency, -.It Va kern.eventtimer.tc. Ns Ar X Ns Va .quality +.It Va kern.timecounter.tc. Ns Ar X Ns Va .quality is an integral value, defining how good is this time counter, comparing to others. Negative value means that this time counter is broken and should not be used. -- cgit v1.1 From 0517523a4ff441ede1240cd8858b14e49eecf87b Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 20 Dec 2011 17:44:25 +0000 Subject: Add some more cross-references. --- share/man/man4/cpufreq.4 | 1 + share/man/man4/ffclock.4 | 1 + share/man/man4/man4.i386/CPU_ELAN.4 | 1 + share/man/man4/timecounters.4 | 1 + 4 files changed, 4 insertions(+) (limited to 'share') diff --git a/share/man/man4/cpufreq.4 b/share/man/man4/cpufreq.4 index bd6885e..d4a2a3f 100644 --- a/share/man/man4/cpufreq.4 +++ b/share/man/man4/cpufreq.4 @@ -286,6 +286,7 @@ then it should set all elements to .Dv CPUFREQ_VAL_UNKNOWN . .Sh SEE ALSO .Xr acpi 4 , +.Xr timecounters 4 , .Xr powerd 8 , .Xr sysctl 8 .Sh AUTHORS diff --git a/share/man/man4/ffclock.4 b/share/man/man4/ffclock.4 index d47edb2..9110c16 100644 --- a/share/man/man4/ffclock.4 +++ b/share/man/man4/ffclock.4 @@ -110,6 +110,7 @@ but currently does nothing. .Xr clock_gettime 2 , .Xr ffclock 2 , .Xr bpf 4 , +.Xr timecounters 4 , .Xr sysctl 8 .Sh HISTORY Feed-forward clock support first appeared in diff --git a/share/man/man4/man4.i386/CPU_ELAN.4 b/share/man/man4/man4.i386/CPU_ELAN.4 index 7fe7741..4a0611f 100644 --- a/share/man/man4/man4.i386/CPU_ELAN.4 +++ b/share/man/man4/man4.i386/CPU_ELAN.4 @@ -148,6 +148,7 @@ and the GPIO pins which are not available will be disabled. .Sh SEE ALSO .Xr led 4 , +.Xr timecounters 4 , .Xr sysctl 8 .Sh HISTORY The diff --git a/share/man/man4/timecounters.4 b/share/man/man4/timecounters.4 index 340512e..b6fc85e 100644 --- a/share/man/man4/timecounters.4 +++ b/share/man/man4/timecounters.4 @@ -102,4 +102,5 @@ tunable/sysctl. .Sh SEE ALSO .Xr attimer 4 , .Xr eventtimers 4 , +.Xr ffclock 4 , .Xr hpet 4 -- cgit v1.1 From 1d5050a94b01dd5fb04194a79908e299a3becc7d Mon Sep 17 00:00:00 2001 From: jgh Date: Tue, 20 Dec 2011 21:16:49 +0000 Subject: Add myself with mentor relationships Add tabthorpe -> crees Approved by: crees (mentor) --- share/misc/committers-ports.dot | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'share') diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot index 35587e2..a4e858c 100644 --- a/share/misc/committers-ports.dot +++ b/share/misc/committers-ports.dot @@ -99,6 +99,7 @@ ijliao [label="Ying-Chieh Liao\nijliao@FreeBSD.org\n2001/01/20"] itetcu [label="Ion-Mihai Tetcu\nitetcu@FreeBSD.org\n2006/06/07"] jacula [label="Giuseppe Pilichi\njacula@FreeBSD.org\n2010/04/05"] jadawin [label="Philippe Audeoud\njadawin@FreeBSD.org\n2008/03/02"] +jgh [label="Jason Helfman\njgh@FreeBSD.org\n2011/12/16"] jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2007/09/12"] jlaffaye [label="Julien Laffaye\njlaffaye@FreeBSD.org\n2011/06/06"] jmelo [label="Jean Milanez Melo\njmelo@FreeBSD.org\n2006/03/31"] @@ -234,6 +235,8 @@ clement -> lawrance clsung -> lwhsu clsung -> tabthorpe +crees -> jgh + delphij -> nemoliu delphij -> rafan @@ -395,6 +398,7 @@ philip -> koitsu rafan -> chinsan rene -> crees +rene -> jgh sahil -> culot sahil -> eadler @@ -422,6 +426,7 @@ tabthorpe -> ashish tabthorpe -> avilla tabthorpe -> avl tabthorpe -> bapt +tabthorpe -> crees tabthorpe -> dhn tabthorpe -> fluffy tabthorpe -> jacula -- cgit v1.1 From c2dfd4451c331c3e687830de21030c8793557162 Mon Sep 17 00:00:00 2001 From: jh Date: Wed, 21 Dec 2011 17:03:30 +0000 Subject: Follow style(9) more closely in the example. --- share/man/man9/sbuf.9 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/man/man9/sbuf.9 b/share/man/man9/sbuf.9 index 4ee05f4..7336c42 100644 --- a/share/man/man9/sbuf.9 +++ b/share/man/man9/sbuf.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2011 +.Dd December 21, 2011 .Dt SBUF 9 .Os .Sh NAME @@ -495,8 +495,8 @@ TAILQ_FOREACH(foo, &foolist, list) { sbuf_printf(sb, " Address: %s\en", foo->address); sbuf_printf(sb, " Zip: %s\en", foo->zipcode); } -if (sbuf_finish(sb)) /* Check for any and all errors */ - err(1,"Could not generate message"); +if (sbuf_finish(sb) != 0) /* Check for any and all errors */ + err(1, "Could not generate message"); transmit_msg(sbuf_data(sb), sbuf_len(sb)); sbuf_delete(sb); .Ed -- cgit v1.1 From f175ea262c7e6109950c12c5b712387bf8fb078f Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 27 Dec 2011 12:58:54 +0000 Subject: Add manual page for atomic operations. --- share/man/man3/ATOMIC_VAR_INIT.3 | 295 +++++++++++++++++++++++++++++++++++++++ share/man/man3/Makefile | 25 +++- 2 files changed, 319 insertions(+), 1 deletion(-) create mode 100644 share/man/man3/ATOMIC_VAR_INIT.3 (limited to 'share') diff --git a/share/man/man3/ATOMIC_VAR_INIT.3 b/share/man/man3/ATOMIC_VAR_INIT.3 new file mode 100644 index 0000000..6f20b84 --- /dev/null +++ b/share/man/man3/ATOMIC_VAR_INIT.3 @@ -0,0 +1,295 @@ +.\" Copyright (c) 2011 Ed Schouten +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd December 27, 2011 +.Dt ATOMIC_VAR_INIT 3 +.Os +.Sh NAME +.Nm ATOMIC_VAR_INIT , +.Nm atomic_init , +.Nm atomic_load , +.Nm atomic_store , +.Nm atomic_exchange , +.Nm atomic_compare_exchange_strong , +.Nm atomic_compare_exchange_weak , +.Nm atomic_fetch_add , +.Nm atomic_fetch_and , +.Nm atomic_fetch_or , +.Nm atomic_fetch_sub , +.Nm atomic_fetch_xor , +.Nm atomic_is_lock_free +.Nd type-generic atomic operations +.Sh SYNOPSIS +.In stdatomic.h +.Pp +_Atomic(T) +.Fa v += ATOMIC_VAR_INIT(c); +.Ft void +.Fn atomic_init "_Atomic(T) *object" "T value" +.Ft T +.Fn atomic_load "_Atomic(T) *object" +.Ft T +.Fn atomic_load_explicit "_Atomic(T) *object" "memory_order order" +.Ft void +.Fn atomic_store "_Atomic(T) *object" "T desired" +.Ft void +.Fn atomic_store_explicit "_Atomic(T) *object" "T desired" "memory_order order" +.Ft T +.Fn atomic_exchange "_Atomic(T) *object" "T desired" +.Ft T +.Fn atomic_exchange_explicit "_Atomic(T) *object" "T desired" "memory_order order" +.Ft _Bool +.Fn atomic_compare_exchange_strong "_Atomic(T) *object" "T *expected" "T desired" +.Ft _Bool +.Fn atomic_compare_exchange_strong_explicit "_Atomic(T) *object" "T *expected" "T desired" "memory_order success" "memory_order failure" +.Ft _Bool +.Fn atomic_compare_exchange_weak "_Atomic(T) *object" "T *expected" "T desired" +.Ft _Bool +.Fn atomic_compare_exchange_weak_explicit "_Atomic(T) *object" "T *expected" "T desired" "memory_order success" "memory_order failure" +.Ft T +.Fn atomic_fetch_add "_Atomic(T) *object" "T operand" +.Ft T +.Fn atomic_fetch_add_explicit "_Atomic(T) *object" "T operand" "memory_order order" +.Ft T +.Fn atomic_fetch_and "_Atomic(T) *object" "T operand" +.Ft T +.Fn atomic_fetch_and_explicit "_Atomic(T) *object" "T operand" "memory_order order" +.Ft T +.Fn atomic_fetch_or "_Atomic(T) *object" "T operand" +.Ft T +.Fn atomic_fetch_or_explicit "_Atomic(T) *object" "T operand" "memory_order order" +.Ft T +.Fn atomic_fetch_sub "_Atomic(T) *object" "T operand" +.Ft T +.Fn atomic_fetch_sub_explicit "_Atomic(T) *object" "T operand" "memory_order order" +.Ft T +.Fn atomic_fetch_xor "_Atomic(T) *object" "T operand" +.Ft T +.Fn atomic_fetch_xor_explicit "_Atomic(T) *object" "T operand" "memory_order order" +.Ft _Bool +.Fn atomic_is_lock_free "const _Atomic(T) *object" +.Sh DESCRIPTION +The header +.In stdatomic.h +provides type-generic macros for atomic operations. +Atomic operations can be used by multithreaded programs to provide +shared variables between threads that in most cases may be modified +without acquiring locks. +.Pp +Atomic variables are declared using the +.Fn _Atomic +type specifier. +These variables are not type-compatible with their non-atomic +counterparts. +Depending on the compiler used, atomic variables may be opaque and can +therefore only be influenced using the macros described. +.Pp +The +.Fn atomic_init +macro initializes the atomic variable +.Fa object +with a +.Fa value . +Atomic variables can be initialized while being declared using +.Fn ATOMIC_VAR_INIT . +.Pp +The +.Fn atomic_load +macro returns the value of atomic variable +.Fa object . +The +.Fn atomic_store +macro sets the atomic variable +.Fa object +to its +.Fa desired +value. +.Pp +The +.Fn atomic_exchange +macro combines the behaviour of +.Fn atomic_load +and +.Fn atomic_store . +It sets the atomic variable +.Fa object +to its desired +.Fa value +and returs the original contents of the atomic variable. +.Pp +The +.Fn atomic_compare_exchange_strong +macro stores a +.Fa desired +value into atomic variable +.Fa object , +only if the atomic variable is equal to its +.Fa expected +value. +Upon success, the macro returns +.Dv true . +Upon failure, the +.Fa desired +value is overwritten with the value of the atomic variable and +.Dv false +is returned. +The +.Fn atomic_compare_exchange_weak +macro is identical to +.Fn atomic_compare_exchange_strong , +but is allowed to fail even if atomic variable +.Fa object +is equal to its +.Fa expected +value. +.Pp +The +.Fn atomic_fetch_add +macro adds the value +.Fa operand +to atomic variable +.Fa object +and returns the original contents of the atomic variable. +.Pp +The +.Fn atomic_fetch_and +macro applies the +.Em and +operator to atomic variable +.Fa object +and +.Fa operand +and stores the value into +.Fa object , +while returning the original contents of the atomic variable. +.Pp +The +.Fn atomic_fetch_or +macro applies the +.Em or +operator to atomic variable +.Fa object +and +.Fa operand +and stores the value into +.Fa object , +while returning the original contents of the atomic variable. +.Pp +The +.Fn atomic_fetch_sub +macro subtracts the value +.Fa operand +to atomic variable +.Fa object +and returns the original contents of the atomic variable. +.Pp +The +.Fn atomic_fetch_xor +macro applies the +.Em xor +operator to atomic variable +.Fa object +and +.Fa operand +and stores the value into +.Fa object , +while returning the original contents of the atomic variable. +.Pp +The +.Fn atomic_is_lock_free +macro returns whether atomic variable +.Fa object +uses locks when using atomic operations. +.Sh BARRIERS +The atomic operations described previously are implemented in such a way +that they disallow both the compiler and the executing processor to +re-order any nearby memory operations across the atomic operation. +In certain cases this behaviour may cause suboptimal performance. +To mitigate this, every atomic operation has an +.Fn _explicit +version that allows the re-ordering to be configured. +.Pp +The +.Fa order +parameter of these +.Fn _explicit +macros can have one of the following values. +.Bl -tag -width memory_order_relaxed +.It Dv memory_order_relaxed +No operation orders memory. +.It Dv memory_order_consume +Perform consume operation. +.It Dv memory_order_acquire +Acquire fence. +.It Dv memory_order_release +Release fence. +.It Dv memory_order_acq_rel +Acquire and release fence. +.It Dv memory_order_seq_cst +Sequentially consistent acquire and release fence. +.El +.Pp +The previously described macros are identical to the +.Fn _explicit +macros, when +.Fa order +is +.Dv memory_order_seq_cst . +.Sh COMPILER SUPPORT +These atomic operations are typically implemented by the compiler, as +they must be implemented type-generically and must often use special +hardware instructions. +As this interface has not been adopted by most compilers yet, the +.In stdatomic.h +header implements these macros on top of existing compiler intrinsics to +provide forward compatibility. +.Pp +This means that certain aspects of the interface, such as support for +different barrier types may simply be ignored. +When using GCC, all atomic operations are executed as if they are using +.Dv memory_order_seq_cst . +.Pp +Instead of using the atomic operations provided by this interface, +.St -isoC-11 +allows the atomic variables to be modified directly using built-in +language operators. +This behaviour cannot be emulated for older compilers. +To prevent unintended non-atomic access to these variables, this header +file places the atomic variable in a structure when using an older +compiler. +.Sh SEE ALSO +.Xr pthread 3 , +.Xr atomic 9 +.Sh STANDARDS +These macros attempt to conform to +.St -isoC-11 . +.Sh HISTORY +These macros appeared in +.Fx 10.0 . +.Sh AUTHORS +.An Ed Schouten Aq ed@FreeBSD.org , +.An David Chisnall Aq theraven@FreeBSD.org diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index 148f460..6b47b23 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -4,6 +4,7 @@ .include MAN= assert.3 \ + ATOMIC_VAR_INIT.3 \ bitstring.3 \ end.3 \ fpgetround.3 \ @@ -18,7 +19,29 @@ MAN= assert.3 \ timeradd.3 \ tree.3 -MLINKS= bitstring.3 bit_alloc.3 \ +MLINKS= ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong.3 \ + ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong_explicit.3 \ + ATOMIC_VAR_INIT.3 atomic_compare_exchange_weak.3 \ + ATOMIC_VAR_INIT.3 atomic_compare_exchange_weak_explicit.3 \ + ATOMIC_VAR_INIT.3 atomic_exchange.3 \ + ATOMIC_VAR_INIT.3 atomic_exchange_explicit.3 \ + ATOMIC_VAR_INIT.3 atomic_fetch_add.3 \ + ATOMIC_VAR_INIT.3 atomic_fetch_add_explicit.3 \ + ATOMIC_VAR_INIT.3 atomic_fetch_and.3 \ + ATOMIC_VAR_INIT.3 atomic_fetch_and_explicit.3 \ + ATOMIC_VAR_INIT.3 atomic_fetch_or.3 \ + ATOMIC_VAR_INIT.3 atomic_fetch_or_explicit.3 \ + ATOMIC_VAR_INIT.3 atomic_fetch_sub.3 \ + ATOMIC_VAR_INIT.3 atomic_fetch_sub_explicit.3 \ + ATOMIC_VAR_INIT.3 atomic_fetch_xor.3 \ + ATOMIC_VAR_INIT.3 atomic_fetch_xor_explicit.3 \ + ATOMIC_VAR_INIT.3 atomic_init.3 \ + ATOMIC_VAR_INIT.3 atomic_is_lock_free.3 + ATOMIC_VAR_INIT.3 atomic_load.3 \ + ATOMIC_VAR_INIT.3 atomic_load_explicit.3 \ + ATOMIC_VAR_INIT.3 atomic_store.3 \ + ATOMIC_VAR_INIT.3 atomic_store_explicit.3 +MLINKS+= bitstring.3 bit_alloc.3 \ bitstring.3 bit_clear.3 \ bitstring.3 bit_decl.3 \ bitstring.3 bit_ffc.3 \ -- cgit v1.1 From cbd2bf6e793e1dc43e2689a160600f207eca1eff Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 27 Dec 2011 13:01:10 +0000 Subject: Add missing \. While sorting the MLINKS by name, I forgot to re-add it. --- share/man/man3/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index 6b47b23..4706506 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -36,7 +36,7 @@ MLINKS= ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong.3 \ ATOMIC_VAR_INIT.3 atomic_fetch_xor.3 \ ATOMIC_VAR_INIT.3 atomic_fetch_xor_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_init.3 \ - ATOMIC_VAR_INIT.3 atomic_is_lock_free.3 + ATOMIC_VAR_INIT.3 atomic_is_lock_free.3 \ ATOMIC_VAR_INIT.3 atomic_load.3 \ ATOMIC_VAR_INIT.3 atomic_load_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_store.3 \ -- cgit v1.1 From 88405d6b4db506be77862821665c43143a4c5c4b Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 27 Dec 2011 22:14:35 +0000 Subject: Document restriction on 32-bits and 64-bits datatypes. --- share/man/man3/ATOMIC_VAR_INIT.3 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'share') diff --git a/share/man/man3/ATOMIC_VAR_INIT.3 b/share/man/man3/ATOMIC_VAR_INIT.3 index 6f20b84..41f28db 100644 --- a/share/man/man3/ATOMIC_VAR_INIT.3 +++ b/share/man/man3/ATOMIC_VAR_INIT.3 @@ -281,6 +281,12 @@ This behaviour cannot be emulated for older compilers. To prevent unintended non-atomic access to these variables, this header file places the atomic variable in a structure when using an older compiler. +.Pp +When using GCC on architectures on which it lacks support for built-in +atomic intrinsics, these macros may emit function calls to fallback +routines. +These fallback routines are only implemented for 32-bits and 64-bits +datatypes, if supported by the CPU. .Sh SEE ALSO .Xr pthread 3 , .Xr atomic 9 -- cgit v1.1 From 363702cea3848545dce0402237b384a5a599623e Mon Sep 17 00:00:00 2001 From: bapt Date: Wed, 28 Dec 2011 17:45:26 +0000 Subject: Add myself as a src committer Approved by: des (mentor) --- share/misc/committers-src.dot | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share') diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index b58713b..9273e7a 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -34,6 +34,7 @@ archie [label="Archie Cobbs\narchie@FreeBSD.org\n1998/11/06\n2006/06/09"] arr [label="Andrew R. Reiter\narr@FreeBSD.org\n2001/11/02\n2005/05/25"] arun [label="Arun Sharma\narun@FreeBSD.org\n2003/03/06\n2006/12/16"] asmodai [label="Jeroen Ruigrok\nasmodai@FreeBSD.org\n1999/12/16\n2001/11/16"] +bapt [label="Baptiste Daroussin\nbapt@FreeBSD.org\n2011/12/23"] benjsc [label="Benjamin Close\nbenjsc@FreeBSD.org\n2007/02/09\n2010/09/15"] billf [label="Bill Fumerola\nbillf@FreeBSD.org\n1998/11/11\n2008/11/10"] bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2002/01/29\n2009/09/13"] @@ -333,6 +334,7 @@ des -> hmp des -> mike des -> olli des -> ru +des -> bapt dds -> versus -- cgit v1.1 From 4b4e03aec0d7f0c6cb2aea32d60176814567d049 Mon Sep 17 00:00:00 2001 From: delphij Date: Wed, 28 Dec 2011 23:26:58 +0000 Subject: Import the first release of HighPoint RocketRAID 27xx SAS 6Gb/s HBA card driver. This driver works for FreeBSD/i386 and FreeBSD/amd64 platforms. Many thanks to HighPoint for providing this driver. MFC after: 2 weeks --- share/man/man4/Makefile | 2 + share/man/man4/hpt27xx.4 | 101 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 share/man/man4/hpt27xx.4 (limited to 'share') diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index d13d348..01c75ca 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -150,6 +150,7 @@ MAN= aac.4 \ hifn.4 \ hme.4 \ hpet.4 \ + ${_hpt27xx.4} \ ${_hptiop.4} \ ${_hptmv.4} \ ${_hptrr.4} \ @@ -687,6 +688,7 @@ _atp.4= atp.4 _coretemp.4= coretemp.4 _cpuctl.4= cpuctl.4 _dpms.4= dpms.4 +_hpt27xx.4= hpt27xx.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 _hptrr.4= hptrr.4 diff --git a/share/man/man4/hpt27xx.4 b/share/man/man4/hpt27xx.4 new file mode 100644 index 0000000..01f9ba5 --- /dev/null +++ b/share/man/man4/hpt27xx.4 @@ -0,0 +1,101 @@ +.\" +.\" Copyright (c) 2011 iXsystems, Inc. +.\" 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 DEVELOPERS ``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 DEVELOPERS 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$ +.\" +.Dd December 28, 2011 +.Dt HPT27XX 4 +.Os +.Sh NAME +.Nm hpt27xx +.Nd "HighPoint RocketRAID 27xx SAS 6Gb/s HBA card driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hpt27xx" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hpt27xx_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for HighPoint's RocketRAID 27xx based RAID controller. +.Pp +These devices support SAS disk drives +and provide RAID0 (striping), RAID1 (mirroring), and RAID5 functionality. +.Sh HARDWARE +The +.Nm +driver supports the following SAS +controllers: +.Pp +.Bl -bullet -compact +.It +HighPoint's RocketRAID 271x series +.It +HighPoint's RocketRAID 272x series +.It +HighPoint's RocketRAID 274x series +.It +HighPoint's RocketRAID 276x series +.It +HighPoint's RocketRAID 278x series +.El +.Sh NOTES +The +.Nm +driver only works on the i386 and amd64 platforms as it requires a binary +blob object from the manufacturer which they only supply for these platforms. +The +.Nm +driver does +.Em not +work on i386 with +.Xr pae 4 +enabled. +.Sh SEE ALSO +.Xr kld 4 , +.Xr kldload 8 , +.Xr loader 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +device driver was written by +.An HighPoint Technologies, Inc. . +This manual page was written by +.An Xin LI Aq delphij@FreeBSD.org +for iXsystems, Inc. -- cgit v1.1 From 2dffff0726dd91f70878da59e1093b35a571686c Mon Sep 17 00:00:00 2001 From: bapt Date: Thu, 29 Dec 2011 08:13:11 +0000 Subject: I'm not yet an alumni, add myself in the right section Approved by: des (mentor) --- share/misc/committers-src.dot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index 9273e7a..c894455 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -34,7 +34,6 @@ archie [label="Archie Cobbs\narchie@FreeBSD.org\n1998/11/06\n2006/06/09"] arr [label="Andrew R. Reiter\narr@FreeBSD.org\n2001/11/02\n2005/05/25"] arun [label="Arun Sharma\narun@FreeBSD.org\n2003/03/06\n2006/12/16"] asmodai [label="Jeroen Ruigrok\nasmodai@FreeBSD.org\n1999/12/16\n2001/11/16"] -bapt [label="Baptiste Daroussin\nbapt@FreeBSD.org\n2011/12/23"] benjsc [label="Benjamin Close\nbenjsc@FreeBSD.org\n2007/02/09\n2010/09/15"] billf [label="Bill Fumerola\nbillf@FreeBSD.org\n1998/11/11\n2008/11/10"] bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2002/01/29\n2009/09/13"] @@ -102,6 +101,7 @@ antoine [label="Antoine Brodin\nantoine@FreeBSD.org\n2008/02/03"] ariff [label="Ariff Abdullah\nariff@FreeBSD.org\n2005/11/14"] art [label="Artem Belevich\nart@FreeBSD.org\n2011/03/29"] avg [label="Andriy Gapon\navg@FreeBSD.org\n2009/02/18"] +bapt [label="Baptiste Daroussin\nbapt@FreeBSD.org\n2011/12/23"] benl [label="Ben Laurie\nbenl@FreeBSD.org\n2011/05/18"] benno [label="Benno Rice\nbenno@FreeBSD.org\n2000/11/02"] bms [label="Bruce M Simpson\nbms@FreeBSD.org\n2003/08/06"] -- cgit v1.1 From 1b1510811a06578c05771a8149372df5665231b7 Mon Sep 17 00:00:00 2001 From: lstewart Date: Fri, 30 Dec 2011 08:57:58 +0000 Subject: - Introduce the net.bpf.tscfg sysctl tree and associated code so as to make one aspect of time stamp configuration per interface rather than per BPF descriptor. Prior to this, the order in which BPF devices were opened and the per descriptor time stamp configuration settings could cause non-deterministic and unintended behaviour with respect to time stamping. With the new scheme, a BPF attached interface's tscfg sysctl entry can be set to "default", "none", "fast", "normal" or "external". Setting "default" means use the system default option (set with the net.bpf.tscfg.default sysctl), "none" means do not generate time stamps for tapped packets, "fast" means generate time stamps for tapped packets using a hz granularity system clock read, "normal" means generate time stamps for tapped packets using a full timecounter granularity system clock read and "external" (currently unimplemented) means use the time stamp provided with the packet from an underlying source. - Utilise the recently introduced sysclock_getsnapshot() and sysclock_snap2bintime() KPIs to ensure the system clock is only read once per packet, regardless of the number of BPF descriptors and time stamp formats requested. Use the per BPF attached interface time stamp configuration to control if sysclock_getsnapshot() is called and whether the system clock read is fast or normal. The per BPF descriptor time stamp configuration is then used to control how the system clock snapshot is converted to a bintime by sysclock_snap2bintime(). - Remove all FAST related BPF descriptor flag variants. Performing a "fast" read of the system clock is now controlled per BPF attached interface using the net.bpf.tscfg sysctl tree. - Update the bpf.4 man page. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ In collaboration with: Julien Ridoux (jridoux at unimelb edu au) --- share/man/man4/bpf.4 | 101 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 65 insertions(+), 36 deletions(-) (limited to 'share') diff --git a/share/man/man4/bpf.4 b/share/man/man4/bpf.4 index e69456a..54d1a59 100644 --- a/share/man/man4/bpf.4 +++ b/share/man/man4/bpf.4 @@ -49,7 +49,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 15, 2010 +.Dd December 30, 2011 .Dt BPF 4 .Os .Sh NAME @@ -516,61 +516,48 @@ by default. .It Dv BIOCSTSTAMP .It Dv BIOCGTSTAMP .Pq Li u_int -Set or get format and resolution of the time stamps returned by BPF. +Set or get the format and resolution of time stamps returned by BPF. +The per-BPF descriptor configuration provided by the +.Dv BIOCSTSTAMP +IOCTL complements the per-interface time stamp configuration detailed in the +.Sx CONFIGURATION +section. +.Pp Set to -.Dv BPF_T_MICROTIME , -.Dv BPF_T_MICROTIME_FAST , -.Dv BPF_T_MICROTIME_MONOTONIC , +.Dv BPF_T_MICROTIME or -.Dv BPF_T_MICROTIME_MONOTONIC_FAST +.Dv BPF_T_MICROTIME_MONOTONIC to get time stamps in 64-bit .Vt struct timeval format. Set to -.Dv BPF_T_NANOTIME , -.Dv BPF_T_NANOTIME_FAST , -.Dv BPF_T_NANOTIME_MONOTONIC , +.Dv BPF_T_NANOTIME or -.Dv BPF_T_NANOTIME_MONOTONIC_FAST +.Dv BPF_T_NANOTIME_MONOTONIC to get time stamps in 64-bit .Vt struct timespec format. Set to -.Dv BPF_T_BINTIME , -.Dv BPF_T_BINTIME_FAST , -.Dv BPF_T_NANOTIME_MONOTONIC , +.Dv BPF_T_BINTIME or -.Dv BPF_T_BINTIME_MONOTONIC_FAST +.Dv BPF_T_BINTIME_MONOTONIC to get time stamps in 64-bit .Vt struct bintime format. Set to .Dv BPF_T_NONE -to ignore time stamp. +to not set a time stamp. +By default, time stamps are initilized to +.Dv BPF_T_MICROTIME . +.Pp All 64-bit time stamp formats are wrapped in .Vt struct bpf_ts . The -.Dv BPF_T_MICROTIME_FAST , -.Dv BPF_T_NANOTIME_FAST , -.Dv BPF_T_BINTIME_FAST , -.Dv BPF_T_MICROTIME_MONOTONIC_FAST , -.Dv BPF_T_NANOTIME_MONOTONIC_FAST , -and -.Dv BPF_T_BINTIME_MONOTONIC_FAST -are analogs of corresponding formats without _FAST suffix but do not perform -a full time counter query, so their accuracy is one timer tick. -The .Dv BPF_T_MICROTIME_MONOTONIC , .Dv BPF_T_NANOTIME_MONOTONIC , -.Dv BPF_T_BINTIME_MONOTONIC , -.Dv BPF_T_MICROTIME_MONOTONIC_FAST , -.Dv BPF_T_NANOTIME_MONOTONIC_FAST , and -.Dv BPF_T_BINTIME_MONOTONIC_FAST +.Dv BPF_T_BINTIME_MONOTONIC store the time elapsed since kernel boot. -This setting is initialized to -.Dv BPF_T_MICROTIME -by default. .It Dv BIOCFEEDBACK .Pq Li u_int Set packet feedback mode. @@ -692,14 +679,14 @@ Currently, .Vt bpf_hdr is used when the time stamp is set to .Dv BPF_T_MICROTIME , -.Dv BPF_T_MICROTIME_FAST , .Dv BPF_T_MICROTIME_MONOTONIC , -.Dv BPF_T_MICROTIME_MONOTONIC_FAST , or .Dv BPF_T_NONE -for backward compatibility reasons. Otherwise, +for backward compatibility reasons. +Otherwise, .Vt bpf_xhdr -is used. However, +is used. +However, .Vt bpf_hdr may be deprecated in the near future. Suitable precautions @@ -952,6 +939,48 @@ array initializers: .Fn BPF_STMT opcode operand and .Fn BPF_JUMP opcode operand true_offset false_offset . +.Sh CONFIGURATION +Per-interface BPF time stamp configuration is possible via the +.Va net.bpf.tscfg +.Xr sysctl 8 +tree which provides the following variables: +.Bl -tag -width " " -offset indent +.It Va net.bpf.tscfg.default +The default time stamp configuration setting used by all BPF attached interfaces +which have not been explicitly changed. +Valid values are "none", "fast", "normal" and "external". +The default is "normal". +.It Va net.bpf.tscfg. +The time stamp configuration setting used by a specific BPF attached interface. +There will be a separate entry in the +.Va net.bpf.tscfg +sysctl tree for each BPF attached interface. +Valid values are "default", "none", "fast", "normal" and "external". +The default is "default", which means the system wide default setting specified +by the +.Va net.bpf.tscfg.default +sysctl is used. +.El +.Pp +The meaning of each per-interface time stamp configuration option is as follows: +.Bl -tag -width " " -offset indent +.It none +Do not generate a time stamp for all packets tapped from this interface. +.It fast +Generate a time stamp for all packets tapped from this interface by doing a fast +read of the system clock. +Fast reads have a granularity equivalent to the underlying kernel tick rate. +.It normal +Generate a time stamp for all packets tapped from this interface by doing a full +read of the system clock. +Full reads are slower than fast reads, but provide full hardware time counter +granularity for the time stamp. +.It external +Something external to BPF is capable of generating time stamps for all packets +tapped from this interface and BPF should use these external time stamps. +Currently unimplemented, but will become useful when drivers for NICs which +support hardware packet time stamping add support for this feature. +.El .Sh FILES .Bl -tag -compact -width /dev/bpf .It Pa /dev/bpf -- cgit v1.1 From bf1efdbdcd58706a3ec26b3a10d7522a26a246a6 Mon Sep 17 00:00:00 2001 From: uqs Date: Fri, 30 Dec 2011 11:11:54 +0000 Subject: Spelling fixes for share/ --- share/doc/IPv6/IMPLEMENTATION | 34 +++++++++++++++++----------------- share/termcap/termcap.src | 6 +++--- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'share') diff --git a/share/doc/IPv6/IMPLEMENTATION b/share/doc/IPv6/IMPLEMENTATION index 9b5d8ee..95cff2c 100644 --- a/share/doc/IPv6/IMPLEMENTATION +++ b/share/doc/IPv6/IMPLEMENTATION @@ -1404,7 +1404,7 @@ both definitions. As an userland programmer, the most portable way of dealing with it is to: (1) ensure ss_family and/or ss_len are available on the platform, by using GNU autoconf, -(2) have -Dss_family=__ss_family to unify all occurences (including header +(2) have -Dss_family=__ss_family to unify all occurrences (including header file) into __ss_family, or (3) never touch __ss_family. cast to sockaddr * and use sa_family like: struct sockaddr_storage ss; @@ -1414,7 +1414,7 @@ dealing with it is to: Some of IPv6 transition technologies embed IPv4 address into IPv6 address. These specifications themselves are fine, however, there can be certain -set of attacks enabled by these specifications. Recent speicifcation +set of attacks enabled by these specifications. Recent specification documents covers up those issues, however, there are already-published RFCs that does not have protection against those (like using source address of ::ffff:127.0.0.1 to bypass "reject packet from remote" filter). @@ -1441,7 +1441,7 @@ compatible is very rare. You should take caution if you see those on the wire. If we see IPv6 packets with IPv4 mapped address (::ffff:0.0.0.0/96) in the header in dual-stack environment (not in SIIT environment), they indicate -that someone is trying to inpersonate IPv4 peer. The packet should be dropped. +that someone is trying to impersonate IPv4 peer. The packet should be dropped. IPv6 specifications do not talk very much about IPv6 unspecified address (::) in the IPv6 source address field. Clarification is in progress. @@ -1456,10 +1456,10 @@ Here are couple of comments: - The following examples are seemingly illegal. It seems that there's general consensus among ipngwg for those. (1) Mobile IPv6 home address option, (2) offlink packets (so routers should not forward them). - KAME implmements (2) already. + KAME implements (2) already. KAME code is carefully written to avoid such incidents. More specifically, -KAME kernel will reject packets with certain source/dstination address in IPv6 +KAME kernel will reject packets with certain source/destination address in IPv6 base header, or IPv6 routing header. Also, KAME default configuration file is written carefully, to avoid those attacks. @@ -1552,7 +1552,7 @@ KAME implementation treats them as follows: 1.17 DNS resolver KAME ships with modified DNS resolver, in libinet6.a. -libinet6.a has a comple of extensions against libc DNS resolver: +libinet6.a has a couple of extensions against libc DNS resolver: - Can take "options insecure1" and "options insecure2" in /etc/resolv.conf, which toggles RES_INSECURE[12] option flag bit. - EDNS0 receive buffer size notification support. It can be enabled by @@ -1870,7 +1870,7 @@ Tunnel mode works basically fine, but comes with the following restrictions: - Path MTU discovery does not work across IPv6 IPsec tunnel gateway due to insufficient code. -AH specificaton does not talk much about "multiple AH on a packet" case. +AH specification does not talk much about "multiple AH on a packet" case. We incrementally compute AH checksum, from inside to outside. Also, we treat inner AH to be immutable. For example, if we are to create the following packet: @@ -1890,8 +1890,8 @@ to randomly pad packets shorter than N bytes, to random length smaller than or equal to N. Note that N does not include ESP authentication data length. Also note that the random padding is not included in TCP segment size computation. Negative value will turn off the functionality. -Recommeded value for N is like 128, or 256. If you use a too big number -as N, you may experience inefficiency due to fragmented packtes. +Recommended value for N is like 128, or 256. If you use a too big number +as N, you may experience inefficiency due to fragmented packets. 4.4 IPComp handling @@ -2097,7 +2097,7 @@ RFC2401 defines IPsec tunnel mode, within the context of IPsec. RFC2401 defines tunnel mode packet encapsulation/decapsulation on its own, and does not refer other tunnelling specifications. Since RFC2401 advocates filter-based SPD database matches, it would be natural for us to implement -IPsec IPsec tunnel mode as filters - not as pseudo interfaces. +IPsec tunnel mode as filters - not as pseudo interfaces. There are some people who are trying to separate IPsec "tunnel mode" from the IPsec itself. They would like to implement IPsec transport mode only, @@ -2110,7 +2110,7 @@ interpretation. The KAME stack implements can be configured in two ways. You may need to recompile your kernel to switch the behavior. -- RFC2401 IPsec tunnel mode appraoch (4.8.1) +- RFC2401 IPsec tunnel mode approach (4.8.1) - draft-touch-ipsec-vpn approach (4.8.2) Works in all kernel configuration, but racoon(8) may not interoperate. @@ -2226,7 +2226,7 @@ ALTQ occupies single character device number. For FreeBSD, it is officially allocated. For OpenBSD and NetBSD, we use the number which is not currently allocated (will eventually get an official number). The character device is enabled for i386 architecture only. To enable and -compile ALTQ-ready kernel for other archititectures, take the following steps: +compile ALTQ-ready kernel for other architectures, take the following steps: - assume that your architecture is FOOBAA. - modify sys/arch/FOOBAA/FOOBAA/conf.c (or somewhere that defines cdevsw), to include a line for ALTQ. look at sys/arch/i386/i386/conf.c for @@ -2243,7 +2243,7 @@ compile ALTQ-ready kernel for other archititectures, take the following steps: 6.1 KAME node as correspondent node Default installation recognizes home address option (in destination -options header). No sub-options are supported. interaction with +options header). No sub-options are supported. Interaction with IPsec, and/or 2292bis API, needs further study. 6.2 KAME node as home agent/mobile node @@ -2262,7 +2262,7 @@ are other implementations available: The KAME developers basically do not make a bother about coding style. However, there is still some agreement on the style, in order -to make the distributed develoment smooth. +to make the distributed development smooth. - follow *BSD KNF where possible. note: there are multiple KNF standards. - the tab character should be 8 columns wide (tabstops are at 8, 16, 24, ... @@ -2291,13 +2291,13 @@ to make the distributed develoment smooth. where "(dollar)" is the dollar character ($), and around "$" are tabs. (this is for C. For other language, you should use its own comment line.) - Once commited to the CVS repository, this line will contain its + Once committed to the CVS repository, this line will contain its version number (see, for example, at the top of this file). This would make it easy to report a bug. - when creating a new file with the WIDE copyright, tap "make copyright.c" at the top-level, and use copyright.c as a template. KAME RCS tag will be included automatically. -- when editting a third-party package, keep its own coding style as +- when editing a third-party package, keep its own coding style as much as possible, even if the style does not follow the items above. - it is recommended to always wrap an expression containing bitwise operators by parentheses, especially when the expression is @@ -2384,7 +2384,7 @@ is free of IPR infringement, you MUST check it if you are to integrate KAME into your product (or whatever): READ CAREFULLY: Several countries have legal enforcement for export/import/use of cryptographic software. Check it before playing - with the kit. We do not intend to be your legalease clearing house + with the kit. We do not intend to be your legalese clearing house (NO WARRANTY). If you intend to include KAME stack into your product, you'll need to check if the licenses on each file fit your situations, and/or possible intellectual property right issues. diff --git a/share/termcap/termcap.src b/share/termcap/termcap.src index 90e889b..a5117a8 100644 --- a/share/termcap/termcap.src +++ b/share/termcap/termcap.src @@ -4409,11 +4409,11 @@ yterm10|yterm 1.0 UCB ascii.kbd:\ :ku=^K:kd=^J:kl=^H:kr=^L:kh=^^:ma=^Hh\012j^Kk^Ll^^H:\ :k0=\E0:k1=\E1:k2=\E2:k3=\E3:k4=\E4:k5=\E5:k6=\E6:k7=\E7:k8=\E8:k9=\E9:\ :vs=^O\E[7i\E[m\E[?7h\E[?3g\r\EHY0 \EH \EH \EH \EH \EH \EH \EH \EH \EH\r: -# YTERM varient version 1.1. (gts 9-13-84) Version 1.1 has :xn:. +# YTERM variant version 1.1. (gts 9-13-84) Version 1.1 has :xn:. yterm11|yterm 1.1 UCB ascii.kbd:\ :xn:is=^O\E[7i\E[m\E[?7h\E[?3g\r\EHY1 for \EHYTERM 1.\EH1 with A\EHSCII.KBD\EH 9-13-84\EH \EH \EH \EH \EH\n:\ :tc=yterm10: -# YTERM 1.0 varient no autowrap or tabs +# YTERM 1.0 variant no autowrap or tabs # X does not remember autowrap or tabs when T is deleted and restarted. yterm10nat|yterm 1.0 UCB ascii.kbd no autowrap or tabs:\ :am@:pt@:vs=^O\E[7i\E[m\E[?7l\E[?3g\rY2\r:\ @@ -4475,7 +4475,7 @@ h19k|h19kermit|heathkit emulation provided by Kermit (no auto margin):\ :am@:ta@:pt@:xt:da:db:tc=h19-u: # Amiga termcap by Kent Polk, kent@swrinde.nde.swri.edu (30 May 90) # Added a few more entries, converted caret-type control sequence (^x) entries -# to '\0xx' entries since a couple of people mentioned loosing '^x' sequences. +# to '\0xx' entries since a couple of people mentioned losing '^x' sequences. # # :as, :ae Support for alternate character sets. # :ve=\E[\040p:vi=\E[\060\040p cursor visible/invisible. -- cgit v1.1 From 8a799f2a2fc40cc67b9553f01a90520534216440 Mon Sep 17 00:00:00 2001 From: lstewart Date: Sat, 31 Dec 2011 07:21:28 +0000 Subject: Revert r228986 until it can be reworked to avoid panicing the kernel when the same interface is attached multiple times with different DLTs, as is done in net80211 for example. Reported by: adrian --- share/man/man4/bpf.4 | 101 ++++++++++++++++++--------------------------------- 1 file changed, 36 insertions(+), 65 deletions(-) (limited to 'share') diff --git a/share/man/man4/bpf.4 b/share/man/man4/bpf.4 index 54d1a59..e69456a 100644 --- a/share/man/man4/bpf.4 +++ b/share/man/man4/bpf.4 @@ -49,7 +49,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 30, 2011 +.Dd June 15, 2010 .Dt BPF 4 .Os .Sh NAME @@ -516,48 +516,61 @@ by default. .It Dv BIOCSTSTAMP .It Dv BIOCGTSTAMP .Pq Li u_int -Set or get the format and resolution of time stamps returned by BPF. -The per-BPF descriptor configuration provided by the -.Dv BIOCSTSTAMP -IOCTL complements the per-interface time stamp configuration detailed in the -.Sx CONFIGURATION -section. -.Pp +Set or get format and resolution of the time stamps returned by BPF. Set to -.Dv BPF_T_MICROTIME +.Dv BPF_T_MICROTIME , +.Dv BPF_T_MICROTIME_FAST , +.Dv BPF_T_MICROTIME_MONOTONIC , or -.Dv BPF_T_MICROTIME_MONOTONIC +.Dv BPF_T_MICROTIME_MONOTONIC_FAST to get time stamps in 64-bit .Vt struct timeval format. Set to -.Dv BPF_T_NANOTIME +.Dv BPF_T_NANOTIME , +.Dv BPF_T_NANOTIME_FAST , +.Dv BPF_T_NANOTIME_MONOTONIC , or -.Dv BPF_T_NANOTIME_MONOTONIC +.Dv BPF_T_NANOTIME_MONOTONIC_FAST to get time stamps in 64-bit .Vt struct timespec format. Set to -.Dv BPF_T_BINTIME +.Dv BPF_T_BINTIME , +.Dv BPF_T_BINTIME_FAST , +.Dv BPF_T_NANOTIME_MONOTONIC , or -.Dv BPF_T_BINTIME_MONOTONIC +.Dv BPF_T_BINTIME_MONOTONIC_FAST to get time stamps in 64-bit .Vt struct bintime format. Set to .Dv BPF_T_NONE -to not set a time stamp. -By default, time stamps are initilized to -.Dv BPF_T_MICROTIME . -.Pp +to ignore time stamp. All 64-bit time stamp formats are wrapped in .Vt struct bpf_ts . The +.Dv BPF_T_MICROTIME_FAST , +.Dv BPF_T_NANOTIME_FAST , +.Dv BPF_T_BINTIME_FAST , +.Dv BPF_T_MICROTIME_MONOTONIC_FAST , +.Dv BPF_T_NANOTIME_MONOTONIC_FAST , +and +.Dv BPF_T_BINTIME_MONOTONIC_FAST +are analogs of corresponding formats without _FAST suffix but do not perform +a full time counter query, so their accuracy is one timer tick. +The .Dv BPF_T_MICROTIME_MONOTONIC , .Dv BPF_T_NANOTIME_MONOTONIC , +.Dv BPF_T_BINTIME_MONOTONIC , +.Dv BPF_T_MICROTIME_MONOTONIC_FAST , +.Dv BPF_T_NANOTIME_MONOTONIC_FAST , and -.Dv BPF_T_BINTIME_MONOTONIC +.Dv BPF_T_BINTIME_MONOTONIC_FAST store the time elapsed since kernel boot. +This setting is initialized to +.Dv BPF_T_MICROTIME +by default. .It Dv BIOCFEEDBACK .Pq Li u_int Set packet feedback mode. @@ -679,14 +692,14 @@ Currently, .Vt bpf_hdr is used when the time stamp is set to .Dv BPF_T_MICROTIME , +.Dv BPF_T_MICROTIME_FAST , .Dv BPF_T_MICROTIME_MONOTONIC , +.Dv BPF_T_MICROTIME_MONOTONIC_FAST , or .Dv BPF_T_NONE -for backward compatibility reasons. -Otherwise, +for backward compatibility reasons. Otherwise, .Vt bpf_xhdr -is used. -However, +is used. However, .Vt bpf_hdr may be deprecated in the near future. Suitable precautions @@ -939,48 +952,6 @@ array initializers: .Fn BPF_STMT opcode operand and .Fn BPF_JUMP opcode operand true_offset false_offset . -.Sh CONFIGURATION -Per-interface BPF time stamp configuration is possible via the -.Va net.bpf.tscfg -.Xr sysctl 8 -tree which provides the following variables: -.Bl -tag -width " " -offset indent -.It Va net.bpf.tscfg.default -The default time stamp configuration setting used by all BPF attached interfaces -which have not been explicitly changed. -Valid values are "none", "fast", "normal" and "external". -The default is "normal". -.It Va net.bpf.tscfg. -The time stamp configuration setting used by a specific BPF attached interface. -There will be a separate entry in the -.Va net.bpf.tscfg -sysctl tree for each BPF attached interface. -Valid values are "default", "none", "fast", "normal" and "external". -The default is "default", which means the system wide default setting specified -by the -.Va net.bpf.tscfg.default -sysctl is used. -.El -.Pp -The meaning of each per-interface time stamp configuration option is as follows: -.Bl -tag -width " " -offset indent -.It none -Do not generate a time stamp for all packets tapped from this interface. -.It fast -Generate a time stamp for all packets tapped from this interface by doing a fast -read of the system clock. -Fast reads have a granularity equivalent to the underlying kernel tick rate. -.It normal -Generate a time stamp for all packets tapped from this interface by doing a full -read of the system clock. -Full reads are slower than fast reads, but provide full hardware time counter -granularity for the time stamp. -.It external -Something external to BPF is capable of generating time stamps for all packets -tapped from this interface and BPF should use these external time stamps. -Currently unimplemented, but will become useful when drivers for NICs which -support hardware packet time stamping add support for this feature. -.El .Sh FILES .Bl -tag -compact -width /dev/bpf .It Pa /dev/bpf -- cgit v1.1 From a201da71788983b3f0445aa46bca32751fc7393c Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 1 Jan 2012 20:26:11 +0000 Subject: Introducing memcchr(3). It seems two of the file system drivers we have in the tree, namely ufs and ext3, use a function called `skpc()'. The meaning of this function does not seem to be documented in FreeBSD, but it turns out one needs to be a VAX programmer to understand what it does. SPKC is an instruction on the VAX that does the opposite of memchr(). It searches for the non-equal character. Add a new function called memcchr() to the tree that has the following advantages over skpc(): - It has a name that makes more sense than skpc(). Just like strcspn() matches the complement of strspn(), memcchr() is the complement of memchr(). - It is faster than skpc(). Similar to our strlen() in libc, it compares entire words, instead of single bytes. It seems that for this routine this yields a sixfold performance increase on amd64. - It has a man page. --- share/man/man9/memcchr.3 | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 share/man/man9/memcchr.3 (limited to 'share') diff --git a/share/man/man9/memcchr.3 b/share/man/man9/memcchr.3 new file mode 100644 index 0000000..a3ade21 --- /dev/null +++ b/share/man/man9/memcchr.3 @@ -0,0 +1,59 @@ +.\" Copyright (c) 2012 Ed Schouten +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd January 1, 2012 +.Dt MEMCCHR 9 +.Os +.Sh NAME +.Nm memcchr +.Nd locate the complement of a byte in byte string +.Sh SYNOPSIS +.In sys/libkern.h +.Ft void * +.Fn memcchr "const void *b" "int c" "size_t len" +.Sh DESCRIPTION +The +.Fn memcchr +function locates the first occurrence of a byte unequal to +.Fa c +(converted to an +.Vt "unsigned char" ) +in string +.Fa b . +.Sh RETURN VALUES +The +.Fn memcchr +function return a pointer to the byte located, or NULL if no such byte +exists within +.Fa len +bytes. +.Sh SEE ALSO +.Xr memchr 3 +.Sh HISTORY +The +.Fn memcchr +function first appeared in +.Fx 10.0 . -- cgit v1.1 From 5f479a9ff5848e7febb91161677e846f8167d4ea Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 1 Jan 2012 20:30:48 +0000 Subject: Fix typo; return -> returns. --- share/man/man9/memcchr.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man9/memcchr.3 b/share/man/man9/memcchr.3 index a3ade21..0be3b79 100644 --- a/share/man/man9/memcchr.3 +++ b/share/man/man9/memcchr.3 @@ -46,7 +46,7 @@ in string .Sh RETURN VALUES The .Fn memcchr -function return a pointer to the byte located, or NULL if no such byte +function returns a pointer to the byte located, or NULL if no such byte exists within .Fa len bytes. -- cgit v1.1 From eed6691a080145735804eccfd9d2deced720d642 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 1 Jan 2012 20:59:42 +0000 Subject: Fix sloppyness in memcchr() man page. I was considering adding it to libc as well, but last minute I thought it would be good enough to add it to libkern exclusively. I forgot to rename the man page and hook it up. --- share/man/man9/Makefile | 1 + share/man/man9/memcchr.3 | 59 ------------------------------------------------ share/man/man9/memcchr.9 | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 59 deletions(-) delete mode 100644 share/man/man9/memcchr.3 create mode 100644 share/man/man9/memcchr.9 (limited to 'share') diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 2b9f3bb..7d2af8a 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -164,6 +164,7 @@ MAN= accept_filter.9 \ mbuf_tags.9 \ MD5.9 \ mdchain.9 \ + memcchr.9 \ memguard.9 \ microseq.9 \ microtime.9 \ diff --git a/share/man/man9/memcchr.3 b/share/man/man9/memcchr.3 deleted file mode 100644 index 0be3b79..0000000 --- a/share/man/man9/memcchr.3 +++ /dev/null @@ -1,59 +0,0 @@ -.\" Copyright (c) 2012 Ed Schouten -.\" 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. -.\" -.\" $FreeBSD$ -.\" -.Dd January 1, 2012 -.Dt MEMCCHR 9 -.Os -.Sh NAME -.Nm memcchr -.Nd locate the complement of a byte in byte string -.Sh SYNOPSIS -.In sys/libkern.h -.Ft void * -.Fn memcchr "const void *b" "int c" "size_t len" -.Sh DESCRIPTION -The -.Fn memcchr -function locates the first occurrence of a byte unequal to -.Fa c -(converted to an -.Vt "unsigned char" ) -in string -.Fa b . -.Sh RETURN VALUES -The -.Fn memcchr -function returns a pointer to the byte located, or NULL if no such byte -exists within -.Fa len -bytes. -.Sh SEE ALSO -.Xr memchr 3 -.Sh HISTORY -The -.Fn memcchr -function first appeared in -.Fx 10.0 . diff --git a/share/man/man9/memcchr.9 b/share/man/man9/memcchr.9 new file mode 100644 index 0000000..0be3b79 --- /dev/null +++ b/share/man/man9/memcchr.9 @@ -0,0 +1,59 @@ +.\" Copyright (c) 2012 Ed Schouten +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd January 1, 2012 +.Dt MEMCCHR 9 +.Os +.Sh NAME +.Nm memcchr +.Nd locate the complement of a byte in byte string +.Sh SYNOPSIS +.In sys/libkern.h +.Ft void * +.Fn memcchr "const void *b" "int c" "size_t len" +.Sh DESCRIPTION +The +.Fn memcchr +function locates the first occurrence of a byte unequal to +.Fa c +(converted to an +.Vt "unsigned char" ) +in string +.Fa b . +.Sh RETURN VALUES +The +.Fn memcchr +function returns a pointer to the byte located, or NULL if no such byte +exists within +.Fa len +bytes. +.Sh SEE ALSO +.Xr memchr 3 +.Sh HISTORY +The +.Fn memcchr +function first appeared in +.Fx 10.0 . -- cgit v1.1 From 0494e8ff396fa7b13e09da8c014c574e6a72e67f Mon Sep 17 00:00:00 2001 From: rwatson Date: Mon, 2 Jan 2012 21:57:58 +0000 Subject: Add WITHOUT_CAPSICUM src.conf(5) define, which can be used to compile out use of Capsicum by userspace applications. MFC after: 3 weeks Sponsored by: Google, Inc. --- share/man/man5/src.conf.5 | 7 +++++-- share/mk/bsd.own.mk | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index ab5adc5..37f490f 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd December 2, 2011 +.Dd December 30, 2011 .Dt SRC.CONF 5 .Os .Sh NAME @@ -251,6 +251,9 @@ Set to build some programs without optional bzip2 support. .\" from FreeBSD: head/tools/build/options/WITHOUT_CALENDAR 156932 2006-03-21 07:50:50Z ru Set to not build .Xr calendar 1 . +.It Va WITHOUT_CAPSICUM +.\" $FreeBSD$ +Set to not build Capsicum support into system programs. .It Va WITHOUT_CDDL .\" from FreeBSD: head/tools/build/options/WITHOUT_CDDL 163861 2006-11-01 09:02:11Z jb Set to not build code licensed under Sun's CDDL. @@ -821,7 +824,7 @@ Set to not build .Xr ppp 8 and related programs. .It Va WITHOUT_PROFILE -.\" from FreeBSD: head/tools/build/options/WITH_PROFILE 228143 2011-11-29 19:46:17Z fjoe +.\" from FreeBSD: head/tools/build/options/WITHOUT_PROFILE 228196 2011-12-02 09:09:54Z fjoe Set to avoid compiling profiled libraries. .It Va WITHOUT_QUOTAS .\" from FreeBSD: head/tools/build/options/WITHOUT_QUOTAS 183242 2008-09-21 22:02:26Z sam diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 9a51608..d3183c4 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -322,6 +322,7 @@ __DEFAULT_YES_OPTIONS = \ BSNMP \ BZIP2 \ CALENDAR \ + CAPSICUM \ CDDL \ CPP \ CRYPT \ -- cgit v1.1