Skip to content

freebsd: add pciio.h - #5766

Open
jheanlee wants to merge 1 commit into
rust-lang:mainfrom
jheanlee:freebsd-pciio
Open

jheanlee wants to merge 1 commit into
rust-lang:mainfrom
jheanlee:freebsd-pciio

Conversation

@jheanlee

@jheanlee jheanlee commented Nov 22, 2026 •

Copy link
Copy Markdown

Description

Add bindings for all members of sys/pciio.h.

sys/pciio.h provides enumeration and information of PCI(e) devices through ioctl.

Compatibility for #define PCIOCGETCONF _IOWR('p', 1, struct pci_conf_io) is not added because it was deprecated in FreeBSD 7.0.

Help needed

FreeBSD added pci_conf::pc_secbus and pci_conf::pc_subbus, and reduced pci_conf::pc_spare from 64 to 62 in version 15.1.

Checklist

  • Relevant tests in libc-test/semver have been updated
  • Commit messages permalink to headers for added or changed API
  • Placeholder or unstable values like *LAST or *MAX have the standard
    doc comment
  • Tested locally (cargo test -p libc-test --target mytarget);
    especially relevant for platforms that may not be checked in CI

I ran the test locally on FreeBSD 14.5 and 15.1, and they both failed.
For 14.5, according to #5026, it seems that I have a different toolchain than CI.
For 15.1, FreeBSD added pci_conf::pc_secbus and pci_conf::pc_subbus, and reduced pci_conf::pc_spare from 64 to 62. The API is backwards compatible, but libc-test won't pass when comparing it to the new API.

@rustbot label +stable-nominated

@rustbot rustbot added O-bsd O-freebsd S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Nov 22, 2026
@jheanlee
jheanlee marked this pull request as draft November 22, 2026 05:14
@jheanlee

jheanlee commented Nov 22, 2026 •

Copy link
Copy Markdown
Author

I need a bit of help with libc-test. I added sys/pciio.h in the headers! macro call, but it breaks other parts like kvm and file on FreeBSD 14.5.

Update: According to #5026, it seems that I have a different toolchain than CI

@jheanlee
jheanlee force-pushed the freebsd-pciio branch 3 times, most recently from 668441d to bfa5d37 Compare November 23, 2026 03:07
@jheanlee

Copy link
Copy Markdown
Author

FreeBSD added pci_conf::pc_secbus and pci_conf::pc_subbus, and reduced pci_conf::pc_spare from 64 to 62 in version 15.1. Is there a cfg value for minor releases?

@jheanlee
jheanlee marked this pull request as ready for review November 23, 2026 03:30
@rustbot

This comment has been minimized.

Add bindings for all members of `sys/pciio.h`.

`sys/pciio.h` provides enumeration and information of PCI(e) devices through `ioctl`.

Compatibility for `#define PCIOCGETCONF _IOWR('p', 1, struct pci_conf_io)` is not added because it was deprecated in FreeBSD 7.0.

Link: https://github.com/freebsd/freebsd-src/blob/4f6f4aacaf97f301e5c5646649a1217ca8099349/sys/sys/pciio.h

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-bsd O-freebsd S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants