Page MenuHomeFreeBSD

LinuxKPI: Remove sys/rman.h include from LKPI headers.
ClosedPublic

Authored by wulf on Nov 28 2023, 8:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 3, 9:09 AM
Unknown Object (File)
Sat, May 25, 7:44 AM
Unknown Object (File)
May 8 2024, 11:43 AM
Unknown Object (File)
May 8 2024, 11:43 AM
Unknown Object (File)
May 8 2024, 11:42 AM
Unknown Object (File)
May 8 2024, 9:36 AM
Unknown Object (File)
Mar 17 2024, 8:19 AM
Unknown Object (File)
Mar 17 2024, 8:19 AM

Details

Summary

sys/rman.h defines resource structure which conflicts with the Linux
structure of the same name. To fix that remove reference to sys/rman.h
from linux/pci.h and move resource management code to linux_pci.c.
Update consumers which were depending on linux/pci.h pollution.

No functional changes intended.

Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week

Diff Detail

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

Event Timeline

Owners added a reviewer: Restricted Owners Package.Nov 28 2023, 8:40 PM
wulf requested review of this revision.Nov 28 2023, 8:40 PM

The aim of this set of reviews is to reach 6.1-lts (6.1.63 at the moment of writing). https://github.com/wulf7/drm-kmod/commits/6.1-lts

bz requested changes to this revision.Dec 8 2023, 4:17 PM
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/interrupt.h
43

I really don't like this.

sys/compat/linuxkpi/common/include/linux/pci.h
383

This seems misplaced and should go up with the other function declarations.

520

Function declarations should all go up.

522

If it is a public interface we tend to use linuxkpi_ prefixes; for internal stuff (not part of the LinuxKPI, use lkpi_)

708

ditto, ditto.

740

ditto.

766

ditto.

1330

ditto.

1333

ditto.

1339

ditto. ditto.

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

Looks like copy&paste in Phabricator; are tabs preserved?

453

linuxkpi_

472

linuxkpi_

611

no more inline

649

linuxkpi_

694

linuxkpi_

754

linuxkpi_

768

linuxkpi_

784

linuxkpi_

830

Is this part of the public interface or can become static now?

980

no more inline?

981

if it's static it's lkpi_ given we touch it.

992

remove comment

993

Leading space.

This revision now requires changes to proceed.Dec 8 2023, 4:17 PM
erj added inline comments.
sys/compat/linuxkpi/common/include/linux/interrupt.h
43

I don't get it, but based on my limited understanding of the Linux KPI, If that define is part of a public API, wouldn't it make sense to match the value used in Linux instead of using our own?

lkpi->linuxkpi for public interfaces
move function declarations to beginning of pci.h and sort them in order of definition
remove forgotten inlines
make IRQF_SHARED flag FreeBSD-agnostic

wulf marked 25 inline comments as done.Dec 10 2023, 7:50 PM
wulf added inline comments.
sys/compat/linuxkpi/common/include/linux/interrupt.h
43

It is now not RF_SHAREABLE but has it's value to preserve KBI

sys/compat/linuxkpi/common/include/linux/pci.h
383

Moved up

520

Moved up

522

It got linuxkpi_ prefix while I personally prefer lkpi_ one as it shorter by 4 symbols

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

Seems to be Phabricator issue. All tabs are in place.

611

Inline removed

This revision was not accepted when it landed; it landed in state Needs Review.Dec 24 2023, 8:23 AM
This revision was automatically updated to reflect the committed changes.
wulf marked 5 inline comments as done.