Page MenuHomeFreeBSD

linuxkpi: Add a few wait_bit functions
ClosedPublic

Authored by manu on Aug 13 2020, 10:03 AM.

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

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

manu requested review of this revision.Aug 13 2020, 10:03 AM
sys/compat/linuxkpi/common/src/linux_compat.c
2495 ↗(On Diff #75771)

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 ↗(On Diff #75771)

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 ↗(On Diff #75776)

#include <linux/waitbit.h>

Here ??

sys/compat/linuxkpi/common/src/linux_compat.c
89 ↗(On Diff #75776)

Why ? it's not needed

sys/compat/linuxkpi/common/src/linux_compat.c
89 ↗(On Diff #75776)

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

sys/compat/linuxkpi/common/src/linux_compat.c
89 ↗(On Diff #75776)

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 ↗(On Diff #75776)

You can remove this include I guess.

sys/compat/linuxkpi/common/src/linux_schedule.c
43 ↗(On Diff #75776)

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.