From patchwork Tue Apr 30 16:55:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WHR X-Patchwork-Id: 1929768 X-Patchwork-Delegate: trini@ti.com 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VTRCN1Vlvz20fY for ; Wed, 1 May 2024 02:55:28 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D9F59886BF; Tue, 30 Apr 2024 18:55:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=rivoreo.one Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 160D28870C; Tue, 30 Apr 2024 18:55:24 +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.9 required=5.0 tests=BAYES_00, RCVD_IN_PBL, RDNS_NONE, SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from tianjin2.rivoreo.one (unknown [60.25.139.170]) (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 DBF4D885F4 for ; Tue, 30 Apr 2024 18:55:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=rivoreo.one Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=whr@rivoreo.one Received: from [10.1.105.1] (localhost [127.0.0.1]) by tianjin2.rivoreo.one (Postfix) with ESMTP id 4C70672179; Wed, 1 May 2024 00:55:10 +0800 (CST) Received: from 10.1.107.31 (SquirrelMail authenticated user whr) by _ with HTTP; Wed, 1 May 2024 00:55:10 +0800 Message-ID: <98e71d2cd17cd9992e60190ede4a5b03.squirrel@_> Date: Wed, 1 May 2024 00:55:10 +0800 Subject: [PATCH v3] sandbox: make function 'do_undefined' properly compiles for PowerPC From: "WHR" To: u-boot@lists.denx.de Cc: "Heinrich Schuchardt" , "Simon Glass" , "Tom Rini" User-Agent: SquirrelMail/1.4.23 [SVN] MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal 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 The 2 bytes 0xffff is too short for being a PowerPC instruction, resulting in an error similar to: /tmp/ccW8yjie.s: Assembler messages: /tmp/ccW8yjie.s: Error: unaligned opcodes detected in executable segment /tmp/ccW8yjie.s:223: Error: instruction address is not a multiple of 4 make[2]: *** [/tmp/ccyF4HIC.mk:17: /tmp/ccCKUFuF.ltrans5.ltrans.o] Error 1 Signed-off-by: WHR --- v2: Resubmit with diff content in plain text. v3: Reformat commit message body that was previously mangled by my email client. cmd/sandbox/exception.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/sandbox/exception.c b/cmd/sandbox/exception.c index cfa153da26..f9c847d8ff 100644 --- a/cmd/sandbox/exception.c +++ b/cmd/sandbox/exception.c @@ -19,7 +19,11 @@ static int do_sigsegv(struct cmd_tbl *cmdtp, int flag, int argc, static int do_undefined(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { +#ifdef __powerpc__ + asm volatile (".long 0xffffffff\n"); +#else asm volatile (".word 0xffff\n"); +#endif return CMD_RET_FAILURE; }