diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 14:02:27 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 14:02:27 -0400 |
| commit | 6d8bdc65446a704d0750217efd05532fc641ea7d (patch) | |
| tree | 8ae6d698b3c9801750a8b117b3842fb369872a3a /static/openbsd/man9/pci_mapreg_map.9 | |
| parent | 2f467bd7ff8f8db0dafa40426166491d7f57f368 (diff) | |
docs: OpenBSD Man Pages Added
Diffstat (limited to 'static/openbsd/man9/pci_mapreg_map.9')
| -rw-r--r-- | static/openbsd/man9/pci_mapreg_map.9 | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/static/openbsd/man9/pci_mapreg_map.9 b/static/openbsd/man9/pci_mapreg_map.9 new file mode 100644 index 00000000..1cf53d40 --- /dev/null +++ b/static/openbsd/man9/pci_mapreg_map.9 @@ -0,0 +1,133 @@ +.\" $OpenBSD: pci_mapreg_map.9,v 1.2 2023/04/13 15:07:42 miod Exp $ +.\" +.\" Copyright (c) 2019 David Gwynne <dlg@openbsd.org> +.\" All rights reserved. +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 13 2023 $ +.Dt PCI_MAPREG_MAP 9 +.Os +.Sh NAME +.Nm pci_mapreg_map , +.Nm pci_mapreg_info , +.Nm pci_mapreg_probe , +.Nm pci_mapreg_type +.Nd PCI register mappings +.Sh SYNOPSIS +.In dev/pci/pcivar.h +.Ft int +.Fo pci_mapreg_map +.Fa "struct pci_attach_args *paa" +.Fa "int reg" +.Fa "pcireg_t type" +.Fa "int flags" +.Fa "bus_space_tag_t *tagp" +.Fa "bus_space_handle_t *handlep" +.Fa "bus_addr_t *basep" +.Fa "bus_size_t *sizep" +.Fa "bus_size_t maxsize" +.Fc +.Ft int +.Fo pci_mapreg_info +.Fa "pci_chipset_tag_t pc" +.Fa "pcitag_t tag" +.Fa "int reg" +.Fa "pcireg_t type" +.Fa "bus_addr_t *basep" +.Fa "bus_size_t *sizep" +.Fa "int *flagsp" +.Fc +.Ft int +.Fo pci_mapreg_probe +.Fa "pci_chipset_tag_t pc" +.Fa "pcitag_t tag" +.Fa "int reg" +.Fa "pcireg_t *typep" +.Fc +.Ft pcireg_t +.Fo pci_mapreg_type +.Fa "pci_chipset_tag_t pc" +.Fa "pcitag_t tag" +.Fa "int reg" +.Fc +.Sh DESCRIPTION +These functions provide wrappers and helpers around +.Xr bus_space 9 +mappings for device registers described by the Base Address Registers +(BARs) in a PCI devices configuration space. +.Pp +.Nm pci_mapreg_map +wraps a call to +.Xr bus_space_map 9 +using information from the BAR referenced by +.Fa reg +for the device being attached with +.Fa paa . +Memory or I/O mappings are derived from the +.Fa type +argument. +The size of the register mapping can be restricted by specifying a +non-zero value in +.Fa maxsize . +The bus space tag and handle used for the mapping, as well +as the base address and size of the mapping, will be provided +to the caller via the optional +.Fa tagp , +.Fa handlep , +.Fa basep , +and +.Fa sizep +pointers. +.Pp +.Nm pci_mapreg_info +provides bus space mapping information from the BAR referenced by +.Fa reg . +The +.Fa type +argument specifies whether the mapping provides Memory or I/O access. +The base address, size, and bus space flags are optionally provided +to the caller via the +.Fa basep , +.Fa sizep , +and +.Fa flagsp +pointers. +.Pp +.Nm pci_mapreg_probe +attempts to determine if the BAR referenced by +.Fa reg +describes a valid register mapping. +.Pp +.Nm pci_mapreg_type +returns the type of register access for the registers at the BAR +referenced by +.Fa reg . +.Sh RETURN VALUES +.Nm pci_mapreg_map , +.Nm pci_mapreg_info , +and +.Nm pci_mapreg_probe +return 0 on success, or an +.Xr errno 2 +style value on failure. +.Pp +.Nm pci_mapreg_type +returns either +.Dv PCI_MAPREG_TYPE_IO +or +.Dv PCI_MAPREG_TYPE_MEM . +.Sh SEE ALSO +.Xr pci 4 , +.Xr bus_space 9 , +.Xr pci_conf_read 9 |
