From patchwork Tue Dec 16 21:18:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 923 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=1765919936; bh=VvSPmJR8Qc8WXVMyJc1P0WsMgzf7Aq8tVLFcIQgTAH8=; 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=U6W0qhm1uBT5tOJJhFg+3ybZMOMEaiwQj1QXU4Twn698uOalXen30zIF+QRFYYQMK iCCzDDAbGxeIeUUMM175rM5zqYkBuHK5JTkm63T2hY1Iv0WYXv+ZCF+1x2jm86hkou rOSOEHy5W/kOEZgBtS/2hOSmHX8ztnmRboFgEDaD72usr0PZeB6BkD+9GG9uuQqrHH BxSx8P/lokCtvh5Rk4PmSn9fi3s8oaiLjZ7KCe24uIxWwWfmyHJ7uZQFxABgOvg0Zu 7p7REl8ulTynZ/M68/bbvdr9Q0sWodUmluAiYeWJpBXtB3KImUMEN5sp9xhdrrzu4X nyLHrjw+OJz/Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1C1F068AF5 for ; 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 10024) with ESMTP id lJ8BdkuonAfm for ; Tue, 16 Dec 2025 14:18:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765919936; bh=VvSPmJR8Qc8WXVMyJc1P0WsMgzf7Aq8tVLFcIQgTAH8=; 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=U6W0qhm1uBT5tOJJhFg+3ybZMOMEaiwQj1QXU4Twn698uOalXen30zIF+QRFYYQMK iCCzDDAbGxeIeUUMM175rM5zqYkBuHK5JTkm63T2hY1Iv0WYXv+ZCF+1x2jm86hkou rOSOEHy5W/kOEZgBtS/2hOSmHX8ztnmRboFgEDaD72usr0PZeB6BkD+9GG9uuQqrHH BxSx8P/lokCtvh5Rk4PmSn9fi3s8oaiLjZ7KCe24uIxWwWfmyHJ7uZQFxABgOvg0Zu 7p7REl8ulTynZ/M68/bbvdr9Q0sWodUmluAiYeWJpBXtB3KImUMEN5sp9xhdrrzu4X nyLHrjw+OJz/Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0364C68B8F for ; Tue, 16 Dec 2025 14:18:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765919934; bh=hCpzRWCPVN+maatuXYz8dkzsFLWuI+7XYcli9Nt82Fc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qL0h4ymv4AZC6PuJD6G/AeBP1yt18hohBX9tCp34N3jwxFkbbwh5ma9iaNKjYSdF7 Hk6YgAAxYbRr3MDU6MXwZ0FEi42pRev3bEFT5wJOOsNj2le1arqzijsREdB4Qni2mV GnamvRmZ55sl/YhYkpawvkxAavzot6MKxVQ4dtgsheWan3RLvjfCTQxYWhZQW+o/sh odJkMmyvK2fduQLMfRJFK+pc0mImgH4sxVgxWFiDzqTB/Va5T5evHlM4QmtSyTBoXq ud91XaIl9WqwbCu+7Nq/2alDK44gf2zHH8YkJ9YZkZlFMncJlWd76NXas2RkIo1Mfv n65bnLwQRnRQQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 873C868AEE; Tue, 16 Dec 2025 14:18:54 -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 tcFIKiT3gQn0; Tue, 16 Dec 2025 14:18:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765919930; bh=ZNQq5EHHduddv7bpya2AtwwkR/X6tSM+3VozsRN6Sl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pqJSoc756ERjaIneYGpql7IyilahykJacoH5Y3VWBdaBe3rsYcMnOAgUpSGeA5a2R lSQTuAiPuG9qF0s6mof3obEQhLxXmG9/eTRie+hNvwsWUcZ6QBV1HyB95XgRE+SVe0 /l93kt+duXXKOE5jrJY4g2+w0v5UwWGjQTQTfdTGg67uL8GgCT0nx1mWZyzjTBNNkA gIr8NAJ9QUKM/SxJDm6R6QfElb636qf943Tu5/oBPFq5HkBTzRp7yCLh6508kVH7oG ibIeSZwefEVfZFnpzutZwGb4WGUzxtOYKfEM2zP+EgoTWGCeAgzHXUMUSpgWTS/rtT SS/Q8J8BjboFQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0C70568AF5; Tue, 16 Dec 2025 14:18:49 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 16 Dec 2025 14:18:09 -0700 Message-ID: <20251216211817.4131167-9-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: 6KEJ7XAAWRZOP6GI7KUABTYZPUIX3BBR X-Message-ID-Hash: 6KEJ7XAAWRZOP6GI7KUABTYZPUIX3BBR 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 08/11] ext4l: Extract initcall 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/init.h with stub definitions for kernel initialization macros. U-Boot has its own initialization mechanism. Includes: - Section markers: __init, __exit, __initdata, __devinit, etc. - Initcall levels: core_initcall(), late_initcall(), etc. Update compat.h to include init.h and remove duplicate definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- include/linux/compat.h | 10 +-------- include/linux/init.h | 49 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 include/linux/init.h diff --git a/include/linux/compat.h b/include/linux/compat.h index 3bba18d637d..fc0bfc31e5f 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -147,8 +148,6 @@ typedef unsigned long blkcnt_t; #define blocking_notifier_call_chain(...) 0 -#define __initdata -#define late_initcall(...) #define dev_set_name(...) do { } while (0) #define device_register(...) 0 @@ -197,13 +196,6 @@ typedef int wait_queue_head_t; #define cond_resched() do { } while (0) #define yield() do { } while (0) -#define __init -#define __exit -#define __devinit -#define __devinitdata -#define __devinitconst -#define __initconst -#define __initdata #define kthread_create(...) __builtin_return_address(0) #define kthread_stop(...) do { } while (0) diff --git a/include/linux/init.h b/include/linux/init.h new file mode 100644 index 00000000000..ea74422c337 --- /dev/null +++ b/include/linux/init.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * These macros are used to mark some functions or initialized data + * as 'initialization' functions. The kernel can take this as hint + * that the function is used only during the initialization phase + * and free up used memory resources after. + * + * Stub definitions for Linux kernel initialization macros. + * U-Boot has its own initialization mechanism. + */ +#ifndef _LINUX_INIT_H +#define _LINUX_INIT_H + +/* Section markers - these are no-ops in U-Boot */ +#define __init +#define __exit +#define __initdata +#define __exitdata +#define __initconst +#define __exitconst +#define __devinit +#define __devexit +#define __devinitdata +#define __devexitdata +#define __devinitconst +#define __devexitconst + +/* Initcall levels - no-ops in U-Boot */ +#define pure_initcall(fn) +#define core_initcall(fn) +#define core_initcall_sync(fn) +#define postcore_initcall(fn) +#define postcore_initcall_sync(fn) +#define arch_initcall(fn) +#define arch_initcall_sync(fn) +#define subsys_initcall(fn) +#define subsys_initcall_sync(fn) +#define fs_initcall(fn) +#define fs_initcall_sync(fn) +#define rootfs_initcall(fn) +#define device_initcall(fn) +#define device_initcall_sync(fn) +#define late_initcall(fn) +#define late_initcall_sync(fn) + +#define __initcall(fn) +#define __exitcall(fn) + +#endif /* _LINUX_INIT_H */