Files
u-boot/include/linux/kthread.h
Simon Glass 158eed28be ext4l: Extract kthread declarations into their own file
Create include/linux/kthread.h with stub definitions for kernel thread
support. U-Boot doesn't have multi-threading.

Includes:
- kthread_create(), kthread_run(), kthread_stop()
- kthread_should_stop(), kthread_should_park()
- wake_up_process(), set_current_state()
- task_pid_nr()

Update compat.h to include kthread.h and remove duplicate definitions.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-17 14:01:22 +00:00

29 lines
871 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/* Simple interface for creating and stopping kernel threads without mess.
*
* Stub definitions for Linux kernel thread support.
* U-Boot doesn't have multi-threading.
*/
#ifndef _LINUX_KTHREAD_H
#define _LINUX_KTHREAD_H
struct task_struct;
#define kthread_create(fn, data, fmt, ...) \
((struct task_struct *)__builtin_return_address(0))
#define kthread_run(fn, data, fmt, ...) \
((struct task_struct *)__builtin_return_address(0))
#define kthread_stop(task) do { } while (0)
#define kthread_should_stop() 0
#define kthread_should_park() 0
#define kthread_park(task) 0
#define kthread_unpark(task) do { } while (0)
#define kthread_parkme() do { } while (0)
#define wake_up_process(task) do { } while (0)
#define set_current_state(state) do { } while (0)
#define task_pid_nr(task) 0
#endif /* _LINUX_KTHREAD_H */