Page MenuHomeFreeBSD

LinuxKPI: pci: make internal variables file local
AcceptedPublic

Authored by bz on Thu, Jun 4, 9:46 AM.

Details

Reviewers
emaste
Group Reviewers
linuxkpi
Summary

The only reason the internal lists and lock are shared seems to be
because the SYSINIT code was in linux_compat.c.

Migrate the three variables (pci_drivers, pci_devices, and pci_lock)
to linux_pci.c and make them file local.

While doing so adjust a few things:
(a) mark the various sections of the linux_pci.c file as we add new

SYSINIT code to the middle of the file.  The file currently really
contains three parts.

(b) rename the variables by adding a lkpi_ prefix indicating that they

are part of our internal code and not part of the public KPI, and
to clearly distinguish them from any native PCI code upon which
we call as well.

(c) factor the locking code out into macros as we have often done in

various parts of the kernel to make the lock itself more opaque.

No functional changes.

Sponsored by: The FreBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 73659
Build 70542: arc lint + arc unit

Event Timeline

bz requested review of this revision.Thu, Jun 4, 9:46 AM
This revision is now accepted and ready to land.Fri, Jun 5, 2:28 PM
wulf added inline comments.
sys/compat/linuxkpi/common/src/linux_pci.c
124

As these variable became private it make sense to make it native FreeBSD structures to get benefits of witness, static initializers and implicit SYSINIT hooks.

sys/compat/linuxkpi/common/src/linux_pci.c
124

As these variable became private it make sense to make it native FreeBSD structures to get benefits of witness, static initializers and implicit SYSINIT hooks.

Oops. There is no static initializer for mutexes. Only MTX_SYSINIT macro