From patchwork Mon Jan 19 06:15:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1625 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=1768803430; bh=ca5zHqTD47wayMuSMO+0jtfymYMMcdmjYbVxoFHOrWQ=; 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=tOfusgmf8jTLIrcefsbo900GVtjmHrUvZfLP2CPfuqlw/+ga8JO3mQlSEAuPY2gl6 o6H8+IZVLUYDuIKmJq9h83MFl72nDddryzlEh/vc2fxipk439posSnUMyF94v5ecO0 D17q1nNm+3iWbH7P4ntYoKTWKTilkGipCumaEtH8GQiRbBeU36gk1DY/ZUGZZNfVe3 gJHwOe5U2l26HFl0vuPBqqVqEO003pL/46FO6v3quOYIW65FQX38/feUQv+j7b72i3 NgyP78+jb+Q0shKgDpSzLILjQnlU8E0x6FdN5IDW6wRNR6cbwJhJSU5go988O6qJJT f95TLNmx7DStA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 60652694DD for ; Sun, 18 Jan 2026 23:17:10 -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 YEzSdoRRCbQN for ; Sun, 18 Jan 2026 23:17:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803430; bh=ca5zHqTD47wayMuSMO+0jtfymYMMcdmjYbVxoFHOrWQ=; 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=tOfusgmf8jTLIrcefsbo900GVtjmHrUvZfLP2CPfuqlw/+ga8JO3mQlSEAuPY2gl6 o6H8+IZVLUYDuIKmJq9h83MFl72nDddryzlEh/vc2fxipk439posSnUMyF94v5ecO0 D17q1nNm+3iWbH7P4ntYoKTWKTilkGipCumaEtH8GQiRbBeU36gk1DY/ZUGZZNfVe3 gJHwOe5U2l26HFl0vuPBqqVqEO003pL/46FO6v3quOYIW65FQX38/feUQv+j7b72i3 NgyP78+jb+Q0shKgDpSzLILjQnlU8E0x6FdN5IDW6wRNR6cbwJhJSU5go988O6qJJT f95TLNmx7DStA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4ED3C694CE for ; Sun, 18 Jan 2026 23:17:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803429; bh=3zaX2uU6rEd4qJ4cIU1J3RfTQVnlNtQZbz5AYBlhnHU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kQe/KgCzRNEO2eamOjlcOt8y2iHiHqeGus0QvQOeq9/2e+C4H0ZTuIeAGKGAo+LRp JXvt6DLfQbN06RR6tol32y9vUzKqYYHG/oBrIwvY/WuQg6MiYJj3ohizYvwtE9mU6q Wb8hGzYRSl65qgzm/2A5mM0EWX81mM4nJfKbEYfM1OEb5DVCqwh4YjP2aFD0A9f5n5 b8G60v8ZfhEHG6y/S/5N3J3E6AkaGEr5NMdV+1b3+99Wa9WKmc8YP6s7HiuR26zR1m BDD7uRJrJvDkA3uZtv8CKm/hYeqP414SjiI6S60B1FGNOsCXv86NTAPmjanwxb3dTM QeoAjM+aorBpw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 171BF693AE; Sun, 18 Jan 2026 23:17:09 -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 jTs74drRdaYE; Sun, 18 Jan 2026 23:17:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768803425; bh=iudjQOQdbnecfTy5fM9eb++XgunwBzM2CBJg6+HNy4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KxMoXrBn6IObrHyzYfbQnNdtVhJTSrSBIF7tUzhzp+uJuN+O1/INkhUPzvf4xqDaW gW62FumJ71bTg473Y2BBEEtQBNv0WiSpYU0eQGULJSfMNqWzVla7ZBb8CbvbbZvktm u6CkMQXeevLS2nsthzxDPGl+mpauy9xj67kKb52dp5LWXjcJT+4fTxDz1U8C0QEhXR eRK2DkIYX316ku8QtLDdBU5OjvA6Gtk6YUtBp52hJbXiyYQfDvup4fAglE4/IpNmH4 GMCtZpt1xCgjWeX2XedYZ7U6ywfA3/gxhT06RNlhjvDGMd1UzwpnyJHrzlPx79d1U+ XDaeWlTgOmseA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C406D694C0; Sun, 18 Jan 2026 23:17:04 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 23:15:16 -0700 Message-ID: <20260119061529.3383191-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119061529.3383191-1-sjg@u-boot.org> References: <20260119061529.3383191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: IXEQETFGWANB4MVACNPAUEL5TR65BM6N X-Message-ID-Hash: IXEQETFGWANB4MVACNPAUEL5TR65BM6N 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 18/23] ext4l: Move system_state definitions to linux/kernel.h 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 Add the system_states enum and system_state macro to linux/kernel.h where it belongs in Linux kernel organisation. U-Boot is single-threaded so system_state is always SYSTEM_RUNNING Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 6 +----- include/linux/kernel.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index b35559b8b18..9e3d59a3174 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1108,11 +1108,7 @@ static u64 __attribute__((unused)) __ext4_sectors[2]; #define sectors __ext4_sectors #define part_stat_read(p, f) ({ (void)(p); (void)(f); 0ULL; }) -/* System state - U-Boot is always running */ -#define system_state 0 -#define SYSTEM_HALT 1 -#define SYSTEM_POWER_OFF 2 -#define SYSTEM_RESTART 3 +/* system_state, SYSTEM_HALT, etc. are in linux/kernel.h */ /* Hex dump */ #define DUMP_PREFIX_ADDRESS 0 diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 9467edd65ab..d6cd54f20b9 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -296,4 +296,21 @@ */ #define find_closest(x, a, as) __find_closest(x, a, as, <=) +/* + * System state values - stub for U-Boot. + * U-Boot is always in running state. + */ +enum system_states { + SYSTEM_BOOTING, + SYSTEM_SCHEDULING, + SYSTEM_FREEING_INITMEM, + SYSTEM_RUNNING, + SYSTEM_HALT, + SYSTEM_POWER_OFF, + SYSTEM_RESTART, + SYSTEM_SUSPEND, +}; + +#define system_state SYSTEM_RUNNING + #endif