18d791e5aSJohn Baldwin.\" -*- nroff -*- 28d791e5aSJohn Baldwin.\" 38d791e5aSJohn Baldwin.\" Copyright (c) 2016 John H. Baldwin <jhb@FreeBSD.org> 48d791e5aSJohn Baldwin.\" 58d791e5aSJohn Baldwin.\" Redistribution and use in source and binary forms, with or without 68d791e5aSJohn Baldwin.\" modification, are permitted provided that the following conditions 78d791e5aSJohn Baldwin.\" are met: 88d791e5aSJohn Baldwin.\" 1. Redistributions of source code must retain the above copyright 98d791e5aSJohn Baldwin.\" notice, this list of conditions and the following disclaimer. 108d791e5aSJohn Baldwin.\" 2. Redistributions in binary form must reproduce the above copyright 118d791e5aSJohn Baldwin.\" notice, this list of conditions and the following disclaimer in the 128d791e5aSJohn Baldwin.\" documentation and/or other materials provided with the distribution. 138d791e5aSJohn Baldwin.\" 148d791e5aSJohn Baldwin.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 158d791e5aSJohn Baldwin.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 168d791e5aSJohn Baldwin.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 178d791e5aSJohn Baldwin.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 188d791e5aSJohn Baldwin.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 198d791e5aSJohn Baldwin.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 208d791e5aSJohn Baldwin.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 218d791e5aSJohn Baldwin.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 228d791e5aSJohn Baldwin.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 238d791e5aSJohn Baldwin.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 248d791e5aSJohn Baldwin.\" SUCH DAMAGE. 258d791e5aSJohn Baldwin.\" 268d791e5aSJohn Baldwin.Dd March 1, 2016 278d791e5aSJohn Baldwin.Dt BUS_GET_CPUS 9 288d791e5aSJohn Baldwin.Os 298d791e5aSJohn Baldwin.Sh NAME 308d791e5aSJohn Baldwin.Nm BUS_GET_CPUS , 318d791e5aSJohn Baldwin.Nm bus_get_cpus 328d791e5aSJohn Baldwin.Nd "request a set of device-specific CPUs" 338d791e5aSJohn Baldwin.Sh SYNOPSIS 348d791e5aSJohn Baldwin.In sys/param.h 358d791e5aSJohn Baldwin.In sys/bus.h 368d791e5aSJohn Baldwin.In sys/cpuset.h 378d791e5aSJohn Baldwin.Ft int 388d791e5aSJohn Baldwin.Fo BUS_GET_CPUS 398d791e5aSJohn Baldwin.Fa "device_t dev" "device_t child" "enum cpu_sets op" "size_t setsize" 408d791e5aSJohn Baldwin.Fa "cpuset_t *cpuset" 418d791e5aSJohn Baldwin.Fc 428d791e5aSJohn Baldwin.Ft int 438d791e5aSJohn Baldwin.Fo bus_get_cpus 448d791e5aSJohn Baldwin.Fa "device_t dev" "enum cpu_sets op" "size_t setsize" "cpuset_t *cpuset" 458d791e5aSJohn Baldwin.Fc 468d791e5aSJohn Baldwin.Sh DESCRIPTION 478d791e5aSJohn BaldwinThe 488d791e5aSJohn Baldwin.Fn BUS_GET_CPUS 498d791e5aSJohn Baldwinmethod queries the parent bus device for a set of device-specific CPUs. 508d791e5aSJohn BaldwinThe 518d791e5aSJohn Baldwin.Fa op 528d791e5aSJohn Baldwinargument specifies which set of CPUs to retrieve. 538d791e5aSJohn BaldwinIf successful, 548d791e5aSJohn Baldwinthe requested set of CPUs are returned in 558d791e5aSJohn Baldwin.Fa cpuset . 568d791e5aSJohn BaldwinThe 578d791e5aSJohn Baldwin.Fa setsize 588d791e5aSJohn Baldwinargument specifies the size in bytes of the set passed in 598d791e5aSJohn Baldwin.Fa cpuset . 608d791e5aSJohn Baldwin.Pp 618d791e5aSJohn Baldwin.Fn BUS_GET_CPUS 62*cef367e6SEitan Adlersupports querying different types of CPU sets via the 638d791e5aSJohn Baldwin.Fa op argument. 648d791e5aSJohn BaldwinNot all set types are supported for every device. 658d791e5aSJohn BaldwinIf a set type is not supported, 668d791e5aSJohn Baldwin.Fn BUS_GET_CPUS 678d791e5aSJohn Baldwinfails with 688d791e5aSJohn Baldwin.Er EINVAL . 698d791e5aSJohn BaldwinThese set types are supported: 708d791e5aSJohn Baldwin.Bl -tag -width ".Dv LOCAL_CPUS" 718d791e5aSJohn Baldwin.It Dv LOCAL_CPUS 728d791e5aSJohn BaldwinThe set of CPUs that are local to the device. 738d791e5aSJohn BaldwinIf a device is closer to a specific memory domain in a non-uniform memory 748d791e5aSJohn Baldwinarchitecture system 758d791e5aSJohn Baldwin.Pq NUMA , 768d791e5aSJohn Baldwinthis will return the set of CPUs in that memory domain. 778d791e5aSJohn Baldwin.It Dv INTR_CPUS 788d791e5aSJohn BaldwinThe preferred set of CPUs that this device should use for device interrupts. 798d791e5aSJohn BaldwinThis set type must be supported by all bus drivers. 808d791e5aSJohn Baldwin.El 818d791e5aSJohn Baldwin.Pp 828d791e5aSJohn BaldwinThe 838d791e5aSJohn Baldwin.Fn bus_get_cpus 848d791e5aSJohn Baldwinfunction is a simple wrapper around 858d791e5aSJohn Baldwin.Fn BUS_GET_CPUS . 868d791e5aSJohn Baldwin.Sh RETURN VALUES 878d791e5aSJohn BaldwinZero is returned on success, otherwise an appropriate error is returned. 888d791e5aSJohn Baldwin.Sh SEE ALSO 898d791e5aSJohn Baldwin.Xr cpuset 2 , 908d791e5aSJohn Baldwin.Xr BUS_BIND_INTR 9 , 918d791e5aSJohn Baldwin.Xr device 9 928d791e5aSJohn Baldwin.Sh HISTORY 938d791e5aSJohn BaldwinThe 948d791e5aSJohn Baldwin.Fn BUS_GET_CPUS 958d791e5aSJohn Baldwinmethod and 968d791e5aSJohn Baldwin.Fn bus_get_cpus 978d791e5aSJohn Baldwinfunction first appeared in 988d791e5aSJohn Baldwin.Fx 11.0 . 99