From patchwork Tue Feb 25 16:34:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 868113 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f56:0:b0:38f:210b:807b with SMTP id cm22csp388583wrb; Tue, 25 Feb 2025 08:35:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVveaoyOEtWawOPs5eaf5kI2B5AEvbRgm8zidvJYW6asrDcUkCtU8x6zDf1L+iIYPMp4Tn/XQ==@linaro.org X-Google-Smtp-Source: AGHT+IFxqTnM2rMV5041jPmYypHpjAg4Vpj8kbI99pD3ycNRDJVyfN01jVLRixX7k+ykZlPY6p7D X-Received: by 2002:a5d:6d82:0:b0:38f:2b49:7bfe with SMTP id ffacd0b85a97d-38f6f0ae7eamr17381554f8f.47.1740501321444; Tue, 25 Feb 2025 08:35:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1740501321; cv=none; d=google.com; s=arc-20240605; b=LqRSn6+9FK2ZpDkhHB4lEFxh73zoj7EYUltoth+pOww973593Dld6GIbjPYNACLyeu 0v4ZOJo9s5Pr4YSvakFACuqNkc0mLoPrNrqjNCJluUz6dflzL9nYMykNZvbKT0a/QOoI vRPvina+c93J0+tCKzPNnOJwSwOgfocAp6c/09S9RQVYCRu1UzgxgYK5CttAlNcnWDyQ lrymGk/MQ7HMtC1uWL27MmaaQz/1uTtRNbpryy+jWR2LWN3kRqj00tjanNg8lMwsrfSu pgTLxqcFtEL31iVXHcp0iP/TcWd0eY2Kiw1lDwxR7C2GrP3P9csUQwL9iM4WKghgMcL4 ouXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RDfKby4rgYi6Um9EPDrRuQexeymWhXMTc0fOwNjxpFM=; fh=KelW0js8qhC0fZluMhUfWO7EM7IB2Cgo58iKBMeAelo=; b=Z5Odw/DzrJz2Grrsi/k3u+ZGBni2Z+VoRZYVjOGMmD9Jr8SsPkvEPxvKn2tHx3bowg F07bbH2GbEuZZ7oOnQBg+a0DVdFrjzaphcqhA9EUJjNWst3xEIvsTduZHxNG48sQ+Bcb 6gSls7Ujr6NIC9xLWPI8aUmzxmKEcQkOzS/Ch3hrXNN684hZ8RYjRxkbRNG8NL49D/Gh H2DL1fFemefAxk/PpECFmz0VjBiwnFgNHyry9lG+fSBAiwGa1ZOY70JknzKypTQjZRhC g5jKWXgV9IBfWPwcdDNpRP878fYV04e9t4Eu+lwZjv6jfOR2aLPqYW+iGEaDPRSNogcA IddA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="pAA9Ar0/"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ffacd0b85a97d-390cd8fba05si1347278f8f.697.2025.02.25.08.35.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 08:35:21 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="pAA9Ar0/"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6492680FAA; Tue, 25 Feb 2025 17:35:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="pAA9Ar0/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AEF28807EE; Tue, 25 Feb 2025 17:35:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B1A7880F53 for ; Tue, 25 Feb 2025 17:35:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43aac0390e8so14719395e9.2 for ; Tue, 25 Feb 2025 08:35:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740501311; x=1741106111; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RDfKby4rgYi6Um9EPDrRuQexeymWhXMTc0fOwNjxpFM=; b=pAA9Ar0/fRT1rsQNw7zZvbcG0yFCSMz4FwZF9LKCDElHHJ+H5ZJBFI4xEoCbni9NkD oOonTriCNoP0LdkicVvoprW+BQxo9/hbdqasBpXicL7NSL8MwTAmPnsgsDex3NlACkq7 +AgCYyB83Khk2+sIuqLBZf39/yGV+IU21X7fgpvukzEXDUnQs8pcrzdmQuh48j7V0gJJ dTxpgrC1BxlOU9WMhAyYumjQwFx7HPdxfZH6ZmZwZ2UAY2eCDXGWSOU+KuDo8reDT1yv j1hcIgBO/OoZBN8ah6jzjHlUte8Pny9D22c9Tg2KF4USOgAR/42M9GtQl0s4IMbekqMB /Usw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740501311; x=1741106111; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RDfKby4rgYi6Um9EPDrRuQexeymWhXMTc0fOwNjxpFM=; b=AMJ+dLqetYx1Ra/u+0YqYqa5oFQl8eJn3YBQmMTUnsZuBvUi3GcfHemErf0+UiHATn l8XIR5YCDa1mucmjOzLRZikJtkwMmuX47Y649sM2bS02DDc6emce0XL387QCDckNY9Tp TxEXqj7BuFr0kDTFlqC4oL1f/aFmms0YLoQxakydx8uPZDqF0dzFXw8tn2PXqHHScDO+ ZNDP8xachzQTvewgA77SQ0fhsM8vEszyP5iIcMAgO912t8Km+tkY1dJBOIAbpPsy+izP 5Bu2lVaKiMvFZ37hmDR/Cu2IQGLGNfJyuLg5AMNOb3zvpfRaZbIjX6fWTQQIyWRbxhs8 qJUA== X-Gm-Message-State: AOJu0YwYNErabx/aDsV6b4yBTX7e57cMSYXq6qhIIWGD+6oc71UtdZ5+ EjmY/XsLhC2YqxcdBRgNYn/yBr8DvvjNbCkVjrDL455sbUCTGf5Ra9JZEF1pnE3kKVCSQS1okK0 EsQkYQQ== X-Gm-Gg: ASbGncss8yJDVDfzQ6I/8MuBVNgY4l3ykOplgCMvuk3+z+bUD2+9HpFnb3y2vuGj4mT np8Vck6VPQialuLfcuGKGrD9LDyUHFeQMPGfw9AH045FTMHk7yRwVOsAbUNKpc/f7m1c9EYnTYA +77RNDDKBsfwcl93lA3Ew9kifJwGDBX9Kg/mUVXh0f5zugk9aVf/U1uOmPIQm+RkWGFjQsX+BnO d4YFXiDYmsEVNx0sNKYmKEWwonXOz7Ng+3PafIvM2rqSRlwp/3xMApJPsgx98TZA7lRy3eqc4X7 HEqIvaW2M0At3u0DRgWLQX34z5Uvmpo07ds= X-Received: by 2002:a05:600c:3150:b0:439:955d:7adb with SMTP id 5b1f17b1804b1-439ae222a7amr192159345e9.30.1740501310945; Tue, 25 Feb 2025 08:35:10 -0800 (PST) Received: from builder.. ([2a01:e0a:3cb:7bb0:af71:dfb2:66ef:80c3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439b02ce735sm146356195e9.3.2025.02.25.08.35.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 08:35:10 -0800 (PST) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Jerome Forissier , Tom Rini , Heinrich Schuchardt , Dan Carpenter , Simon Glass , Leo Yu-Chi Liang , Andrew Goodbody , Jiaxun Yang , Yu-Chien Peter Lin Subject: [PATCH v2 01/14] arch: introduce symbol HAVE_INITJMP Date: Tue, 25 Feb 2025 17:34:27 +0100 Message-ID: <2589612a53a9e9feb67b8e8286e87893359676d1.1740499185.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean HAVE_INIJMP will be set by architectures that support initjmp(), a non-standard extension to setjmp()/longjmp() allowing to initialize a jump buffer with a function pointer and a stack pointer. This will be useful to later introduce threads. With this new function it becomes possible to longjmp() to a particular function pointer (rather than to a point previously reached during program execution as is the case with setjmp()), and with a custom stack. Both things are needed to spin off a new thread. Then the usual setjmp()/ longjmp() pair is enough to save and restore a context, i.e., switch thread. Signed-off-by: Jerome Forissier --- arch/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index 35b19f9bfdc..8d5b54031b3 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -13,6 +13,12 @@ config HAVE_SETJMP help The architecture supports setjmp() and longjmp(). +config HAVE_INITJMP + bool + help + The architecture supports initjmp(), a non-standard companion to + setjmp() and longjmp(). + config SUPPORT_BIG_ENDIAN bool