Page MenuHomeFreeBSD

linuxkpi: Add a few wait_bit functions
ClosedPublic

Authored by manu on Aug 13 2020, 10:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 10:46 AM
Unknown Object (File)
Sun, Nov 3, 3:03 AM
Unknown Object (File)
Oct 26 2024, 4:48 AM
Unknown Object (File)
Oct 19 2024, 11:49 PM
Unknown Object (File)
Oct 18 2024, 1:35 AM
Unknown Object (File)
Oct 17 2024, 1:01 PM
Unknown Object (File)
Sep 28 2024, 3:21 PM
Unknown Object (File)
Sep 28 2024, 3:21 PM
Subscribers

Details

Summary

The linux function does a lot more than that as multiple waitqueue could be fetch
from a static table based on the hash of the argument but since in DRM it's only used
in one place just add a single variable.
We will probably need to change that in the futur but it's ok with DRM even with current
linux.

Sponsored-by: The FreeBSD Foundation

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

manu requested review of this revision.Aug 13 2020, 10:03 AM
sys/compat/linuxkpi/common/src/linux_compat.c
2495

Declare both of these in waitbit.h and include this header file instead of duplicating the extern declarations.

sys/compat/linuxkpi/common/src/linux_schedule.c
365

What about moving these simple declarations to waitbit.h as static inline functions?

Address hselasky@'s comments.

sys/compat/linuxkpi/common/src/linux_compat.c
89

#include <linux/waitbit.h>

Here ??

sys/compat/linuxkpi/common/src/linux_compat.c
89

Why ? it's not needed

sys/compat/linuxkpi/common/src/linux_compat.c
89

Are you sure you have the prototype for those wait queues declared?

sys/compat/linuxkpi/common/src/linux_compat.c
89

Yes

Which header file does linux_compat.c include that includes wait_bit.h , I cannot see it?

Which header file does linux_compat.c include that includes wait_bit.h , I cannot see it?

Why do you want it to include wait_bit.h ? It doesn't uses any function from there.

Hi, In wait_bit.h you have the prototypes:

extern wait_queue_head_t linux_bit_waitq;
extern wait_queue_head_t linux_var_waitq;

For:

wait_queue_head_t linux_bit_waitq;
wait_queue_head_t linux_var_waitq;

Even though the module compiles, I think it is most correct to have the extern's included before the declarations!

sys/compat/linuxkpi/common/src/linux_schedule.c
43

You can remove this include I guess.

sys/compat/linuxkpi/common/src/linux_schedule.c
43

True, this one is a leftover.

Include wait_bit.h in compat.c, remove wait_bit.h from schedule.c

Don't forget the put the word LinuxKPI in the commit message and MFC after.

This revision is now accepted and ready to land.Aug 14 2020, 8:24 AM
This revision was automatically updated to reflect the committed changes.