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)
Thu, Feb 29, 4:53 PM
Unknown Object (File)
Jan 13 2024, 11:25 AM
Unknown Object (File)
Dec 20 2023, 6:40 AM
Unknown Object (File)
Apr 22 2023, 3:44 AM
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.