From patchwork Sat Oct 1 13:00:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1685188 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=B8XsxrIJ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MfnQ55rLMz1yqj for ; Sat, 1 Oct 2022 23:05:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 95F3384D32; Sat, 1 Oct 2022 15:05:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com 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=canonical.com header.i=@canonical.com header.b="B8XsxrIJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A74F84D38; Sat, 1 Oct 2022 15:05:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E809E84D32 for ; Sat, 1 Oct 2022 15:04:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from LT2ubnt.fritz.box (ip-084-118-157-002.um23.pools.vodafone-ip.de [84.118.157.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 4D9A53FC4B; Sat, 1 Oct 2022 13:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1664629499; bh=71junPrRTyhq4K+5bFF+iCfC9TGdily3UfA2AMG7d+4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B8XsxrIJOaDn9W4A0wKUhRtWK1TznawLP1lSoeRMTX2r2G6Z5y+HWi+PvgFG7tqNw a7jdkqW1K4KW9IcU0EvdmRBkzL9F0y+2fI+eCWa7T/i+Pk7PS8xY0SY+PK5p+JgLjx iUIdXr628BcWPpza0uxe30nd7Jl21binwE2Y+2M5kubzEgh663NvbHvA6QsewrNonV J1W1EW7dejOOYp0wJT5y+JunyuucdbJuWkq27HPsangoUq9m2UOfGZqwRL88+x6JBA IAPmhhcT5VMHOH324MshKITCdg5WZoNGgQsNIi6ys0bgKnBNp9+e32cbHY1PX10ZHN 6Ylo/sP5iLhKg== From: Heinrich Schuchardt To: Simon Glass , Bin Meng Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 1/2] x86: fix longjmp() implementation Date: Sat, 1 Oct 2022 15:00:21 +0200 Message-Id: <20221001130022.161518-2-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221001130022.161518-1-heinrich.schuchardt@canonical.com> References: <20221001130022.161518-1-heinrich.schuchardt@canonical.com> 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.6 at phobos.denx.de X-Virus-Status: Clean If longjmp(jmp_buf env, int val) is called with val = 0, the setjmp() macro must return 1. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- arch/x86/cpu/i386/setjmp.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/cpu/i386/setjmp.S b/arch/x86/cpu/i386/setjmp.S index 40b10dc8df..eceeafa7c8 100644 --- a/arch/x86/cpu/i386/setjmp.S +++ b/arch/x86/cpu/i386/setjmp.S @@ -49,12 +49,17 @@ longjmp: xchgl %eax, %edx #else movl 4(%esp), %edx /* jmp_ptr address */ + movl 8(%esp), %eax /* Return value */ #endif movl (%edx), %ebx movl 4(%edx), %esp movl 8(%edx), %ebp movl 12(%edx), %esi movl 16(%edx), %edi + test %eax, %eax + jnz nz + inc %eax +nz: jmp *20(%edx) .size longjmp, .-longjmp From patchwork Sat Oct 1 13:00:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1685190 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=l/thKqbw; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MfnQb4mKHz1yqj for ; Sat, 1 Oct 2022 23:05:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 06DAB84D3F; Sat, 1 Oct 2022 15:05:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com 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=canonical.com header.i=@canonical.com header.b="l/thKqbw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E0E4584D33; Sat, 1 Oct 2022 15:05:05 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 39FD184D35 for ; Sat, 1 Oct 2022 15:05:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from LT2ubnt.fritz.box (ip-084-118-157-002.um23.pools.vodafone-ip.de [84.118.157.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 9FE1A41709; Sat, 1 Oct 2022 13:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1664629499; bh=OF4ZnD2ElsqO5MIVTj3wnPztgIBsqc/pmqDy1b3qDPw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=l/thKqbwG7H6lkPBuNXXqJJqJQY1aZGwz9NRAt6Cq0iVzcDNOI0tOjHnJm4WD9no5 Uzmf+O5amnjVA8Tnn1Wj369FtRu83IFY0/KeGsJt83kiplE0ehcWMYtFu/W4TQ6Cid aeYztdGaZQD+djFi+XtObvZuwm7J6XW+fQrIjcE09hxShQB7YRWPYXx8JSYc+nj0oH PwNhkYfExR/9EAJ2+JBEKtnf/J0KOPyZcLg2PvqlJ4d+42y4cYH56WJXZkW6En5UAz v80DtFjra4EI+a5OYqe24m/kOP2YAaSGfimbEtDd7F+F9UbDaYzlCTS0lASFCaIHwY dmkOpS6LKCtKg== From: Heinrich Schuchardt To: Simon Glass , Bin Meng Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 2/2] x86: provide typedef jmp_buf Date: Sat, 1 Oct 2022 15:00:22 +0200 Message-Id: <20221001130022.161518-3-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221001130022.161518-1-heinrich.schuchardt@canonical.com> References: <20221001130022.161518-1-heinrich.schuchardt@canonical.com> 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.6 at phobos.denx.de X-Virus-Status: Clean The jmp_buf type is required by the C99 specification. Defining it for x86 fixes building the longjmp unit test. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- arch/x86/include/asm/setjmp.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/setjmp.h b/arch/x86/include/asm/setjmp.h index 49c36c1cc8..788d59e231 100644 --- a/arch/x86/include/asm/setjmp.h +++ b/arch/x86/include/asm/setjmp.h @@ -34,7 +34,9 @@ struct jmp_buf_data { #endif -int setjmp(struct jmp_buf_data *jmp_buf); -void longjmp(struct jmp_buf_data *jmp_buf, int val); +typedef struct jmp_buf_data jmp_buf[1]; + +int setjmp(jmp_buf env); +void longjmp(jmp_buf env, int val); #endif