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)
Sep 18 2024, 6:39 PM
Unknown Object (File)
Sep 18 2024, 8:52 AM
Unknown Object (File)
Sep 16 2024, 4:16 PM
Unknown Object (File)
Sep 15 2024, 5:42 PM
Unknown Object (File)
Sep 13 2024, 10:43 PM
Unknown Object (File)
Sep 11 2024, 4:42 AM
Unknown Object (File)
Sep 9 2024, 1:11 PM
Unknown Object (File)
Sep 8 2024, 1:21 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 Not Applicable
Unit
Tests Not Applicable

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
400–401

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

534–537

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

535

Function declarations should all go up.

713

ditto, ditto.

743–744

ditto.

767

ditto.

1328–1329

ditto.

1328–1329

ditto.

1332

ditto. ditto.

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

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

454

linuxkpi_

473

linuxkpi_

612

no more inline

650

linuxkpi_

695

linuxkpi_

755

linuxkpi_

768–831

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

769

linuxkpi_

785

linuxkpi_

983–984

no more inline?

984

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

995

remove comment

996

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
400–401

Moved up

534–537

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

535

Moved up

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

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

612

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.