diff options
Diffstat (limited to 'share/man/man9')
| -rw-r--r-- | share/man/man9/VFS.9 | 3 | ||||
| -rw-r--r-- | share/man/man9/atomic.9 | 54 | ||||
| -rw-r--r-- | share/man/man9/bus_alloc_resource.9 | 24 | ||||
| -rw-r--r-- | share/man/man9/bus_attach_children.9 | 2 | ||||
| -rw-r--r-- | share/man/man9/gone_in.9 | 42 | ||||
| -rw-r--r-- | share/man/man9/insmntque.9 | 6 |
6 files changed, 78 insertions, 53 deletions
diff --git a/share/man/man9/VFS.9 b/share/man/man9/VFS.9 index a1d0a19bec13..6ea6570bbf6e 100644 --- a/share/man/man9/VFS.9 +++ b/share/man/man9/VFS.9 @@ -26,7 +26,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 9, 2010 +.Dd November 3, 2025 .Dt VFS 9 .Os .Sh NAME @@ -42,6 +42,7 @@ function from rather than implementing empty functions or casting to .Fa eopnotsupp . .Sh SEE ALSO +.Xr dtrace_vfs 4 , .Xr VFS_CHECKEXP 9 , .Xr VFS_FHTOVP 9 , .Xr VFS_MOUNT 9 , diff --git a/share/man/man9/atomic.9 b/share/man/man9/atomic.9 index c9133c6311a5..b027a0ff0bca 100644 --- a/share/man/man9/atomic.9 +++ b/share/man/man9/atomic.9 @@ -182,35 +182,42 @@ This variant is the default. The second variant has acquire semantics, and the third variant has release semantics. .Pp -When an atomic operation has acquire semantics, the operation must have +An atomic operation can only have +.Em acquire +semantics if it performs a load +from memory. +When an atomic operation has acquire semantics, a load performed as +part of the operation must have completed before any subsequent load or store (by program order) is performed. Conversely, acquire semantics do not require that prior loads or stores have -completed before the atomic operation is performed. -An atomic operation can only have acquire semantics if it performs a load -from memory. +completed before a load from the atomic operation is performed. To denote acquire semantics, the suffix .Dq Li _acq is inserted into the function name immediately prior to the .Dq Li _ Ns Aq Fa type suffix. -For example, to subtract two integers ensuring that the subtraction is +For example, to subtract two integers ensuring that the load of +the value from memory is completed before any subsequent loads and stores are performed, use .Fn atomic_subtract_acq_int . .Pp +An atomic operation can only have +.Em release +semantics if it performs a store to memory. When an atomic operation has release semantics, all prior loads or stores -(by program order) must have completed before the operation is performed. -Conversely, release semantics do not require that the atomic operation must +(by program order) must have completed before a store executed as part of +the operation that is performed. +Conversely, release semantics do not require that a store from the atomic +operation must have completed before any subsequent load or store is performed. -An atomic operation can only have release semantics if it performs a store -to memory. To denote release semantics, the suffix .Dq Li _rel is inserted into the function name immediately prior to the .Dq Li _ Ns Aq Fa type suffix. For example, to add two long integers ensuring that all prior loads and -stores are completed before the addition is performed, use +stores are completed before the store of the result is performed, use .Fn atomic_add_rel_long . .Pp When a release operation by one thread @@ -235,6 +242,33 @@ section. However, they will not prevent the compiler or processor from moving loads or stores into the critical section, which does not violate the semantics of a mutex. +.Ss Architecture-dependent caveats for compare-and-swap +The +.Fn atomic_[f]cmpset_<type> +operations, specifically those without explicitly specified memory +ordering, are defined as relaxed. +Consequently, a thread's accesses to memory locations different from +that of the atomic operation can be reordered in relation to the +atomic operation. +.Pp +However, the implementation on the +.Sy amd64 +and +.Sy i386 +architectures provide sequentially consistent semantics. +In particular, the reordering mentioned above cannot occur. +.Pp +On the +.Sy arm64/aarch64 +architecture, the operation may include either acquire +semantics on the constituent load or release semantics +on the constituent store. +This means that accesses to other locations in program order +before the atomic, might be observed as executed after the load +that is the part of the atomic operation (but not after the store +from the operation due to release). +Similarly, accesses after the atomic might be observed as executed +before the store. .Ss Thread Fence Operations Alternatively, a programmer can use atomic thread fence operations to constrain the reordering of accesses. diff --git a/share/man/man9/bus_alloc_resource.9 b/share/man/man9/bus_alloc_resource.9 index 84a4c9c530c9..5d309229a34e 100644 --- a/share/man/man9/bus_alloc_resource.9 +++ b/share/man/man9/bus_alloc_resource.9 @@ -26,7 +26,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 20, 2016 +.Dd October 30, 2025 .Dt BUS_ALLOC_RESOURCE 9 .Os .Sh NAME @@ -43,14 +43,14 @@ .In machine/resource.h .Ft struct resource * .Fo bus_alloc_resource -.Fa "device_t dev" "int type" "int *rid" "rman_res_t start" "rman_res_t end" +.Fa "device_t dev" "int type" "int rid" "rman_res_t start" "rman_res_t end" .Fa "rman_res_t count" "u_int flags" .Fc .Ft struct resource * -.Fn bus_alloc_resource_any "device_t dev" "int type" "int *rid" "u_int flags" +.Fn bus_alloc_resource_any "device_t dev" "int type" "int rid" "u_int flags" .Ft struct resource * .Fo bus_alloc_resource_anywhere -.Fa "device_t dev" "int type" "int *rid" "rman_res_t count" "u_int flags" +.Fa "device_t dev" "int type" "int rid" "rman_res_t count" "u_int flags" .Fc .Sh DESCRIPTION This is an easy interface to the resource-management functions. @@ -106,15 +106,13 @@ for I/O memory .El .It .Fa rid -points to a bus specific handle that identifies the resource being allocated. +is a bus specific handle that identifies the resource being allocated. For ISA this is an index into an array of resources that have been setup for this device by either the PnP mechanism, or via the hints mechanism. For PCCARD, this is an index into the array of resources described by the PC Card's CIS entry. For PCI, the offset into PCI config space which has the BAR to use to access the resource. -The bus methods are free to change the RIDs that they are given as a parameter. -You must not depend on the value you gave it earlier. .It .Fa start and @@ -175,20 +173,12 @@ A pointer to is returned on success, a null pointer otherwise. .Sh EXAMPLES This is some example code that allocates a 32 byte I/O port range and an IRQ. -The values of -.Va portid -and -.Va irqid -should be saved in the softc of the device after these calls. .Bd -literal struct resource *portres, *irqres; - int portid, irqid; - portid = 0; - irqid = 0; - portres = bus_alloc_resource(dev, SYS_RES_IOPORT, &portid, + portres = bus_alloc_resource(dev, SYS_RES_IOPORT, 0, 0ul, ~0ul, 32, RF_ACTIVE); - irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqid, + irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE); .Ed .Sh SEE ALSO diff --git a/share/man/man9/bus_attach_children.9 b/share/man/man9/bus_attach_children.9 index 5e3ca4c5e906..81a24a428d8e 100644 --- a/share/man/man9/bus_attach_children.9 +++ b/share/man/man9/bus_attach_children.9 @@ -105,7 +105,7 @@ Detached devices are not deleted. .Pp .Fn bus_detach_children is typically called at the start of a bus driver's -.Xr DEVICE_ATTACH 9 +.Xr DEVICE_DETACH 9 method to give child devices a chance to veto the detach request. It is usually paired with a later call to .Fn device_delete_children 9 diff --git a/share/man/man9/gone_in.9 b/share/man/man9/gone_in.9 index ebdc1ab19bfa..1b60e1eb10c2 100644 --- a/share/man/man9/gone_in.9 +++ b/share/man/man9/gone_in.9 @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 16, 2021 +.Dd June 24, 2025 .Dt GONE_IN 9 .Os .Sh NAME @@ -33,14 +33,15 @@ .Sh SYNOPSIS .In sys/systm.h .Ft void -.Fn gone_in "int major" "const char *msg" +.Fn gone_in "int major" "const char *msg" "..." .Ft void -.Fn gone_in_dev "device_t dev" "int major" "const char *msg" +.Fn gone_in_dev "device_t dev" "int major" "const char *msg" "..." .Sh DESCRIPTION The -.Fn gone_in -functions are used to provide a notice that the kernel is using a driver or -some other functionality that is deprecated, and will be removed in a future +.Nm gone_in +functions are used to provide a notice that the kernel is actively using a +driver or some other functionality that is deprecated, and is planned for +removal in a future .Fx release. The notice is sent to the kernel @@ -51,30 +52,29 @@ The argument specifies the major version of the .Fx release that will remove the deprecated functionality. +The notice shall be printed only once, thus +.Nm +functions are safe to use in often executed code paths. +.Pp +.Nm gone_in_dev +will prepend driver name before the notice. .Pp In releases before .Fa major -the deprecation notice states -.Do -Deprecated code (to be removed in FreeBSD -.Fa major Ns ): -.Fa msg -.Dc . -In releases equal to and after -.Fa major -the notice states +the provided notice will be appended with .Do -Obsolete code will be removed soon: -.Fa msg +To be removed in FreeBSD +.Fa major Ns .Dc . .Sh EXAMPLES .Bd -literal -offset indent void -sample_init(void) +example_api(foo_t *args) { - /* Initialization code omitted. */ + gone_in(16, "Warning! %s[%u] uses obsolete API. ", + curthread->td_proc->p_comm, curthread->td_proc->p_pid); - gone_in(14, "Giant-locked filesystem"); + /* API implementation omitted. */ } int @@ -82,7 +82,7 @@ example_driver_attach(struct example_driver_softc *sc) { /* Attach code omitted. */ - gone_in_dev(sc->dev, 14, "Giant-locked driver"); + gone_in_dev(sc->dev, 16, "driver is deprecated"); } .Ed .Sh HISTORY diff --git a/share/man/man9/insmntque.9 b/share/man/man9/insmntque.9 index 869d8767632b..33ba697b10b9 100644 --- a/share/man/man9/insmntque.9 +++ b/share/man/man9/insmntque.9 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH .\" DAMAGE. .\" -.Dd January 29, 2022 +.Dd October 24, 2025 .Dt INSMNTQUE 9 .Os .Sh NAME @@ -56,7 +56,7 @@ The vnode must be exclusively locked. .Pp On failure, .Fn insmntque -resets vnode' operation vector to the vector of +resets vnode's operations vector to the vector of .Xr deadfs 9 , clears .Va v_data , @@ -71,7 +71,7 @@ failure is needed, the function may be used instead. It does not do any cleanup following a failure, leaving all the work to the caller. -In particular, the operation vector +In particular, the operations vector .Va v_op and .Va v_data |
