Page MenuHomeFreeBSD

linuxkpi: spinlock: Simplify code
ClosedPublic

Authored by manu on May 15 2024, 9:54 AM.
Tags
None
Referenced Files
F102709280: D45205.diff
Sat, Nov 16, 4:31 AM
Unknown Object (File)
Tue, Nov 5, 3:09 PM
Unknown Object (File)
Thu, Oct 24, 3:28 AM
Unknown Object (File)
Mon, Oct 21, 11:54 PM
Unknown Object (File)
Fri, Oct 18, 9:13 AM
Unknown Object (File)
Thu, Oct 17, 8:37 AM
Unknown Object (File)
Oct 16 2024, 5:32 AM
Unknown Object (File)
Oct 14 2024, 6:18 PM

Details

Summary

Just use a typedef for spinlock_t, no need to create a useless
structure.

Sponsored by: Beckhoff Automation GmbH & Co. KG

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

manu requested review of this revision.May 15 2024, 9:54 AM

The main reason for this change is that now struct mtx and spinlock_t are 100% interchangeable in code which is a first step to share structures between linuxkpi driver and native ones.

I believe this will be ABI-compatible so there should be no trouble upgrading across the commit

This revision is now accepted and ready to land.May 15 2024, 1:09 PM

The main reason for this change is that now struct mtx and spinlock_t are 100% interchangeable in code which is a first step to share structures between linuxkpi driver and native ones.

Can you elaborate on this a bit? Do you have an example? Oh, not the struct mtx you mean but structures embedding struct mtx?

In D45205#1031322, @bz wrote:

The main reason for this change is that now struct mtx and spinlock_t are 100% interchangeable in code which is a first step to share structures between linuxkpi driver and native ones.

Can you elaborate on this a bit? Do you have an example? Oh, not the struct mtx you mean but structures embedding struct mtx?

Yes, I'm working on dma-buf and I want most of the code to be usable for native driver and that structures are shareable with linuxkpi drivers too so the base structure needs to be the same, the fact that I can now spin_lock(blah) if blah is struct mtx or spinlock_t helps.

This revision was automatically updated to reflect the committed changes.