History log of /freebsd/sys/compat/linuxkpi/common/include/linux/wait.h (Results 1 – 25 of 33)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3
# 6d720cdf 27-Dec-2024 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Add `woken_wake_function()` and `wait_woken()`

They are used by the i915 DRM driver starting with Linux 6.7.

`(struct wait_queue)->flags` is no longer always zero. I wonder if some
code r

linuxkpi: Add `woken_wake_function()` and `wait_woken()`

They are used by the i915 DRM driver starting with Linux 6.7.

`(struct wait_queue)->flags` is no longer always zero. I wonder if some
code relied on this...

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48755

show more ...


# 325aa4db 12-Jan-2025 Mark Johnston <markj@FreeBSD.org>

linuxkpi: Introduce a properly typed jiffies

Now that we have a long-sized tick counter, we can migrate to using
properly typed timeout parameters in various bits of the LinuxKPI. This
fixes a subt

linuxkpi: Introduce a properly typed jiffies

Now that we have a long-sized tick counter, we can migrate to using
properly typed timeout parameters in various bits of the LinuxKPI. This
fixes a subtle incompatibility that is otherwise difficult to paper over
and leads to bugs when ticks values are sign-extended.

- Introduce a "jiffies" symbol in subr_ticks.S, declared only in the
LinuxKPI as an unsigned long.
- Remove all references to "ticks" from the LinuxKPI.
- Convert interfaces to match Linux's type signatures where it makes
sense.

Reviewed by: manu
Tested by: bz
Differential Revision: https://reviews.freebsd.org/D48523

show more ...


Revision tags: release/14.2.0, release/13.4.0
# 84f46335 27-Aug-2024 Evgenii Khramtsov <2khramtsov@gmail.com>

linuxkpi: chase spinlock_t in DECLARE_WAIT_QUEUE_HEAD

Remove member m to unbreak consumers, e.g. drm-kmod 5.10-lts branch.

[...]
/tmp/drm-kmod/drivers/gpu/drm/ttm/ttm_module.c:38:8: error: no membe

linuxkpi: chase spinlock_t in DECLARE_WAIT_QUEUE_HEAD

Remove member m to unbreak consumers, e.g. drm-kmod 5.10-lts branch.

[...]
/tmp/drm-kmod/drivers/gpu/drm/ttm/ttm_module.c:38:8: error: no member named 'm' in 'struct mtx'
38 | static DECLARE_WAIT_QUEUE_HEAD(exit_q);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/src/sys/compat/linuxkpi/common/include/linux/wait.h:113:33: note: expanded from macro 'DECLARE_WAIT_QUEUE_HEAD'
113 | MTX_SYSINIT(name, &(name).lock.m, spin_lock_name("wqhead"), MTX_DEF)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/src/sys/sys/mutex.h:528:4: note: expanded from macro 'MTX_SYSINIT'
528 | (mtx), \
| ^~~
/tmp/drm-kmod/drivers/gpu/drm/ttm/ttm_module.c:38:8: error: no member named 'm' in 'struct mtx'
38 | static DECLARE_WAIT_QUEUE_HEAD(exit_q);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/src/sys/compat/linuxkpi/common/include/linux/wait.h:113:33: note: expanded from macro 'DECLARE_WAIT_QUEUE_HEAD'
113 | MTX_SYSINIT(name, &(name).lock.m, spin_lock_name("wqhead"), MTX_DEF)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[...]

Fixes: ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code")
MFC after: ?

show more ...


Revision tags: release/14.1.0
# ae38a1a1 15-May-2024 Emmanuel Vadot <manu@FreeBSD.org>

linuxkpi: spinlock: Simplify code

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

Reviewed by: bz, emaste
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Re

linuxkpi: spinlock: Simplify code

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

Reviewed by: bz, emaste
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D45205

show more ...


Revision tags: release/13.3.0, release/14.0.0
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0
# 307f78f3 19-Dec-2021 Vladimir Kondratyev <wulf@FreeBSD.org>

LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards

MFC after: 1 week
Reviewed by: bz, emaste, hselasky, manu
Differential Revision: https://reviews.freebsd.org/D33562


Revision tags: release/12.3.0, release/13.0.0, release/12.2.0
# e2515283 27-Aug-2020 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: Rubicon Communications, LLC (netgate.com)


# de6fc2e3 15-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r364082 through r364250.


# 0e123c13 14-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

linuxkpi: Add a few wait_bit functions

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 o

linuxkpi: Add a few wait_bit functions

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.

Reviewed by: hselasky
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26054

show more ...


Revision tags: release/11.4.0
# ff443195 19-May-2020 Emmanuel Vadot <manu@FreeBSD.org>

linuxkpi: Add __init_waitqueue_head

The only difference with init_waitqueue_head is that the name and the
lock class key are provided but we don't use those so use init_waitqueue_head
directly.

Spo

linuxkpi: Add __init_waitqueue_head

The only difference with init_waitqueue_head is that the name and the
lock class key are provided but we don't use those so use init_waitqueue_head
directly.

Sponsored-by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24861

show more ...


Revision tags: release/12.1.0, release/11.3.0, release/12.0.0, release/11.2.0
# e6e028d0 06-Jun-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Implement the __add_wait_queue_entry_tail() function in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelig

Implement the __add_wait_queue_entry_tail() function in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

show more ...


# 7e95e98d 06-Jun-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Implement the might_sleep_if() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Netw

Implement the might_sleep_if() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

show more ...


# ab98f1e8 06-Jun-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Rename two structure field members while keeping backwards compatibility in
the LinuxKPI. Add a comment saying in which Linux version this change was made.

Submitted by: Johannes Lundberg <johalun0@

Rename two structure field members while keeping backwards compatibility in
the LinuxKPI. Add a comment saying in which Linux version this change was made.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

show more ...


# 1b092623 06-Jun-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Implement the init_wait_entry() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Net

Implement the init_wait_entry() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

show more ...


# bd40dea7 28-May-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Implement wait_event_killable() in the LinuxKPI.

Requested by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies


# c3bfe0de 04-Mar-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Implement wait_event_lock_irq() macro function in the LinuxKPI.

MFC after: 1 week
Requested by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies


# 8f368d48 04-Mar-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Implement DEFINE_WAIT_FUNC() function macro and default_wake_function()
in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sp

Implement DEFINE_WAIT_FUNC() function macro and default_wake_function()
in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

show more ...


# d901abf1 02-Mar-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Implement wait_on_bit() function macro in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks


Revision tags: release/10.4.0
# 083c8ded 13-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

MFhead@r322451


# 0275f9db 11-Aug-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Merge ^/head r321383 through r322397.


# 4ef8a630 10-Aug-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Fixes for wait event in the LinuxKPI. These are regression issues
after r319757.

1) Correct the return value from __wait_event_common() from 1 to 0 in
case the timeout is specified as MAX_SCHEDULE_T

Fixes for wait event in the LinuxKPI. These are regression issues
after r319757.

1) Correct the return value from __wait_event_common() from 1 to 0 in
case the timeout is specified as MAX_SCHEDULE_TIMEOUT. In the other
case __ret is zero and will be substituted in the last part of the
macro with the appropriate value before return.

2) Make sure the "timeout" argument is casted to "int" before
evaluating negativity. Else the signedness of a "long" might be
checked instead of the signedness of an integer.

3) The wait_event() function should not have a return value.

Found by: KrishnamRaju ErapaRaju <Krishna2@chelsio.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

show more ...


Revision tags: release/11.1.0
# 686fb94a 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319548 through r319778.


# 46565964 09-Jun-2017 Mark Johnston <markj@FreeBSD.org>

Augment wait queue support in the LinuxKPI.

In particular:
- Don't evaluate event conditions with a sleepqueue lock held, since such
code may attempt to acquire arbitrary locks.
- Fix the return v

Augment wait queue support in the LinuxKPI.

In particular:
- Don't evaluate event conditions with a sleepqueue lock held, since such
code may attempt to acquire arbitrary locks.
- Fix the return value for wait_event_interruptible() in the case that the
wait is interrupted by a signal.
- Implement wait_on_bit_timeout() and wait_on_atomic_t().
- Implement some functions used to test for pending signals.
- Implement a number of wait_event_*() variants and unify the existing
implementations.
- Unify the mechanism used by wait_event_*() and schedule() to put the
calling thread to sleep.

This is required to support updated DRM drivers. Thanks to hselasky for
finding and fixing a number of bugs in the original revision.

Reviewed by: hselasky
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10986

show more ...


# 6ae9acde 23-Feb-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r313896 through r314128.


# 1e3db1de 21-Feb-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Make the LinuxKPI task struct persistent accross system calls.

A set of helper functions have been added to manage the life of the
LinuxKPI task struct. When an external system call or task is invok

Make the LinuxKPI task struct persistent accross system calls.

A set of helper functions have been added to manage the life of the
LinuxKPI task struct. When an external system call or task is invoked,
a check is made to create the task struct by demand. A thread
destructor callback is registered to free the task struct when a
thread exits to avoid memory leaks.

This change lays the ground for emulating the Linux kernel more
closely which is a dependency by the code using the LinuxKPI APIs.

Add new dedicated td_lkpi_task field has been added to struct thread
instead of abusing td_retval[1].

Fix some header file inclusions to make LINT kernel build properly
after this change.

Bump the __FreeBSD_version to force a rebuild of all kernel modules.

MFC after: 1 week
Sponsored by: Mellanox Technologies

show more ...


12