Files
u-boot/include/linux/sched.h
Simon Glass 166dcda718 linux: Add compatibility headers for ext4l
Add stub headers to support ext4l filesystem compilation:

New headers:
- bit_spinlock.h: bit-based spinlock stubs
- blkdev.h: block device structures and operations
- buffer_head.h: buffer head management with state functions
- crc32c.h: CRC32C checksum stub
- fs.h: filesystem structures (super_block, inode operations)
- journal-head.h: journal buffer head structure
- mutex.h: mutex stubs

Updates to existing headers:
- compat.h: add rcu_head callback structure
- jbd2.h: add wait.h and init.h includes for types
- sched.h: add current task stub
- workqueue.h: fix flush_work macro warning

These provide the minimal Linux kernel interfaces needed for
ext4 code to compile in U-Boot's single-threaded environment.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-18 12:34:17 -07:00

38 lines
817 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Define 'struct task_struct' and provide the main scheduler
* APIs (schedule(), wakeup variants, etc.)
*
* Stub definitions for Linux kernel scheduler.
* U-Boot is single-threaded.
*/
#ifndef _LINUX_SCHED_H
#define _LINUX_SCHED_H
#include <linux/types.h>
struct task_struct {
int pid;
char comm[16];
void *journal_info; /* For jbd2 */
};
extern struct task_struct *current;
#define TASK_RUNNING 0
#define TASK_INTERRUPTIBLE 1
#define TASK_UNINTERRUPTIBLE 2
#define cond_resched() do { } while (0)
#define yield() do { } while (0)
/* Note: schedule() is implemented in common/cyclic.c */
#define in_interrupt() 0
#define in_atomic() 0
#define in_task() 1
#define signal_pending(task) 0
#define fatal_signal_pending(task) 0
#endif /* _LINUX_SCHED_H */