From patchwork Tue Dec 16 21:18:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 925 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765919938; bh=MVIGHF4cIbbMbGrIKjxQ1by21Z1/lKClE28UvRWhtLo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=WEu6MKnKv2VIDahji+oc9xB7eC9BeGeuUdYUV0eR+le6EN1p/weOWLTUE+TxuaDTc p8j2pf8ocL8M9+fsGPK2ERPAsCghtf8VklYfQ/1kD/Ct1Ct3LJd2ZSLJ+ZSVAfKA4O PMKWBitwq15ClQQVh4xpVn5nIndekfbpxoAlSN6MR0GpSOMx8vX7sPqWFNM8A2vwgP 8kt5IUfuKPVrzKU6Glkvhouo9JwymknT6YD+YzCOMtL3xqBZg2fhRZwWFslc96cPMb nEj3MIu/jH6a+i7Rm11a1jIMa5Sz4lD7yh0+uMz3+UNajqG5T7cPs3wZZxGxqkwao+ 4Wlvwg9ZhSHBw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B9C0A68AF5 for ; Tue, 16 Dec 2025 14:18:58 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 1wXWbb2oj6vw for ; Tue, 16 Dec 2025 14:18:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765919937; bh=MVIGHF4cIbbMbGrIKjxQ1by21Z1/lKClE28UvRWhtLo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=KS+N2a6cIM6hrEkD9fePD4OTGQEEehl1Ts1n5Kr2WVwPAQy+IogjioqgAyPO5s/5i oYPDTER1zv9S48grsDitdaNKSYvMeYcj+O0tyjIbhLjf7emz8zQc8z1ekQYAnAVuxY pAzisMfx6JKn1cxPgKMMgqD39rtAqPC5ql0wVRwhkh6FrFS99fw7qxPt0OAJhRUAlO ahP42frUC86lD/weKrGe/2G88rr8rmBhseGre6SFmKWFzLPfknxLdAHw7hzUY4yBv1 CM0C7l+fFO5mOb9BiXQToC/aT/VKEqspkRX8mIy/Ydtif2FxhzX9UI8IvqBf5ABv0s Zln3v5IsSaEUw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 62A5968B9D for ; Tue, 16 Dec 2025 14:18:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765919936; bh=xk6FeSyeT4UNP3hHYNpPZRncWi4oYCq2dNhrS2H0vj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LBWJV/gTR7ENb3DtYw+yfjmWuQ/s6QXY5YYqMxJlxlJiScYs4QckrvlkBhfJbPlx1 van/1ivftk23jMJUGc/QvTipBlNAH9MjAgT7O16MmoKnCdtw8I3vemGpaLVnyJEZt0 +O0yjv8lWUWb4WkRlYNhZJDiw9TCG2KoBM4mai3tprA5rPlslQ8mZhuIjhVGqBvgC7 mzd4/X1/SnTqwYfa4Qu93b263wRkXa1cQc/txbnRCZBc68W4q8jOyoiLKRv9mjzlMh DoMNmayNgYI4d+gdnY3T35rEHNIIt2BGYyL6bIV8dc7e/2ADPWC3IbWZ1g11Ts9hk2 P/BHMRZbqHhGQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0BAA668B95; Tue, 16 Dec 2025 14:18:56 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id ll7nHQkDs3oi; Tue, 16 Dec 2025 14:18:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765919935; bh=rIgM19h/yFfBaR8A2tZ1Yv8qNON0hvAgLWTOz5mk4Lg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I9FHYCdLKQcqkWbK58AXzhLJrVuT+eG8uOlukmmSJPDvrcpZ+HqUDYs04vHyvrd8V SNBFsOKCmoKNXHfC98oQgjMy0iuZvte5bGNi+M8+nHWAeaqFH+VG6PTBfPeSI76llR w23dYyU3wnpKcaoO4oJ5xDNKUqjBSsJNdr6A2suRP8EzqFZvqce2xmbu1KLAt5atkS 1qzcjLLM7aUPRhN4c6134KchpzL7WA3prNAhClzxsuJ+q+slBLBMAOKYA+bbL/z8Rb udrnh9aWFV5eMZy2d08s5PxQzx5K3r9Y9J6iF7r21M9gLtse2xtoGsV1yAJAbOuQpD 9yhcpl11ExeGg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 6ADF868AEE; Tue, 16 Dec 2025 14:18:55 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 16 Dec 2025 14:18:11 -0700 Message-ID: <20251216211817.4131167-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251216211817.4131167-1-sjg@u-boot.org> References: <20251216211817.4131167-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YOIWO2S57EOKJ6MPEDOB7RCX3KKADZWC X-Message-ID-Hash: YOIWO2S57EOKJ6MPEDOB7RCX3KKADZWC X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/11] ext4l: Extract timer declarations into their own file List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Create include/linux/timer.h and include/linux/workqueue.h with stub definitions for kernel timer and workqueue support. U-Boot doesn't use these subsystems. timer.h: - struct timer_list - setup_timer(), del_timer(), del_timer_sync() - timer_setup(), mod_timer(), timer_pending() workqueue.h: - struct work_struct, struct delayed_work - INIT_WORK(), schedule_work() - queue_work(), cancel_work_sync() - alloc_workqueue(), destroy_workqueue() Update compat.h to include these headers and remove duplicate definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- include/linux/compat.h | 9 ++------- include/linux/timer.h | 30 ++++++++++++++++++++++++++++++ include/linux/workqueue.h | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 include/linux/timer.h create mode 100644 include/linux/workqueue.h diff --git a/include/linux/compat.h b/include/linux/compat.h index e9db2120de6..6892decf3ec 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -18,8 +18,10 @@ #include #include #include +#include #include #include +#include #ifdef CONFIG_XEN #include @@ -162,12 +164,6 @@ typedef unsigned long blkcnt_t; #define dump_stack(...) do { } while (0) -#define setup_timer(timer, func, data) do {} while (0) -#define del_timer_sync(timer) do {} while (0) -#define schedule_work(work) do {} while (0) -#define INIT_WORK(work, fun) do {} while (0) - -struct work_struct {}; typedef unused_t spinlock_t; @@ -280,7 +276,6 @@ struct writeback_control { typedef int irqreturn_t; -struct timer_list {}; struct notifier_block {}; typedef unsigned long dmaaddr_t; diff --git a/include/linux/timer.h b/include/linux/timer.h new file mode 100644 index 00000000000..71274df1125 --- /dev/null +++ b/include/linux/timer.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Stub definitions for Linux kernel timer support. + * U-Boot doesn't use kernel timers. + */ +#ifndef _LINUX_TIMER_H +#define _LINUX_TIMER_H + +struct timer_list { + unsigned long expires; + void (*function)(struct timer_list *); + unsigned long data; +}; + +#define DEFINE_TIMER(name, func) \ + struct timer_list name = { .function = func } + +#define setup_timer(timer, func, data) do { } while (0) +#define timer_setup(timer, func, flags) do { } while (0) +#define init_timer(timer) do { } while (0) +#define add_timer(timer) do { } while (0) +#define del_timer(timer) 0 +#define del_timer_sync(timer) 0 +#define mod_timer(timer, expires) 0 +#define timer_pending(timer) 0 + +#define from_timer(var, callback_timer, timer_fieldname) \ + container_of(callback_timer, typeof(*var), timer_fieldname) + +#endif /* _LINUX_TIMER_H */ diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h new file mode 100644 index 00000000000..8f0cc25a2ea --- /dev/null +++ b/include/linux/workqueue.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * workqueue.h --- work queue handling for Linux. + * + * Stub definitions for Linux kernel workqueue support. + * U-Boot doesn't use workqueues. + */ +#ifndef _LINUX_WORKQUEUE_H +#define _LINUX_WORKQUEUE_H + +struct work_struct { + void (*func)(struct work_struct *); +}; + +struct delayed_work { + struct work_struct work; +}; + +#define INIT_WORK(work, func) do { } while (0) +#define INIT_DELAYED_WORK(work, func) do { } while (0) +#define schedule_work(work) 0 +#define schedule_delayed_work(work, delay) 0 +#define cancel_work_sync(work) 0 +#define cancel_delayed_work(work) 0 +#define cancel_delayed_work_sync(work) 0 +#define flush_work(work) 0 +#define flush_delayed_work(work) 0 +#define queue_work(wq, work) 0 +#define queue_delayed_work(wq, work, delay) 0 + +#define alloc_workqueue(fmt, flags, max, ...) ((struct workqueue_struct *)1) +#define create_singlethread_workqueue(name) ((struct workqueue_struct *)1) +#define destroy_workqueue(wq) do { } while (0) + +struct workqueue_struct; + +#endif /* _LINUX_WORKQUEUE_H */