Page MenuHomeFreeBSD

linuxkpi: spinlock: Simplify code
ClosedPublic

Authored by manu on Wed, May 15, 9:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 20, 2:55 AM
Unknown Object (File)
Sat, May 18, 8:42 PM
Unknown Object (File)
Fri, May 17, 7:23 PM
Unknown Object (File)
Fri, May 17, 1:16 AM
Unknown Object (File)
Wed, May 15, 11:05 PM
Unknown Object (File)
Wed, May 15, 11:02 PM
Unknown Object (File)
Wed, May 15, 7:23 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.Wed, May 15, 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.Wed, May 15, 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.