From patchwork Sat Sep 5 19:15:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1358109 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=e5TbBCls; 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BkPQf42gQz9sTd for ; Sun, 6 Sep 2020 05:15:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0CB68822AF; Sat, 5 Sep 2020 21:15:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="e5TbBCls"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 85DAA822AF; Sat, 5 Sep 2020 21:15:43 +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.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (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 CD4AB82286 for ; Sat, 5 Sep 2020 21:15:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id u20so373990ilk.6 for ; Sat, 05 Sep 2020 12:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L8QeyMJ4JGWT88VD6lVB5wYcacPtFiTnsm2TuGwD0go=; b=e5TbBClsY+ogApfAwOFOgXr8lYDjqzRIP12q3PUiWhoOhH7X9xgtDZM9jGh0sTMxUH ocwlBswQtTNUCWn2XuKehatz2FYaM+o9QorW9ehTBcqeS1sMxIvIiBvKt18j03oVNtUw QqFTzwYJZKK0PZP7yIoc8eYnG1nEp6xo8ZiRI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L8QeyMJ4JGWT88VD6lVB5wYcacPtFiTnsm2TuGwD0go=; b=swdGA6GQMAyJf9VclWoNkcLaNA3QRPgBjEJaaMJqaE96MyVGOPEUy+i1yDOx6lEkco lhgBYB9GGftLdcNR3oimlon583l2WSqndJqyh3uhKndVw6K23WrCPaA7RBtkRuMmtFs6 AVFpywoKzINCSrJwATUO9qqF1hL7bTW312dApuGeePde8lvcjHM4vXjF+rhZhadRPsr9 LvAKkN8+VvpSiaR5jni+yMIfxRI9HqE+jMWFr5GFUjQwYRisgiJ/WwI+6xJTTHHxZU1o 24xQSxz1xPdMrMKbjcKeGAZRk6E4KhpsLDzL4CL0gva6v3LTKByIAqFo8+Ufbnb2QsTj N8Nw== X-Gm-Message-State: AOAM5309w345jPRMEussJUcVdrTCdanlawCloh8G3hJ67HLHBqNmeYbH XDVGnCug55b5mRp8EJmCNx5MXBTAOV3pQTDz X-Google-Smtp-Source: ABdhPJx/qUG/I6+D4WjybKWGgNlB3VgVwgAZ4JExZd9Gb61QA9R71P+Wj+fN7L5rJZsXmmDu/uG7Ag== X-Received: by 2002:a92:4b0f:: with SMTP id m15mr1661214ilg.140.1599333339288; Sat, 05 Sep 2020 12:15:39 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id t10sm894512ilf.34.2020.09.05.12.15.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Sep 2020 12:15:38 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Heinrich Schuchardt , Bin Meng Subject: [PATCH] x86: Drop duplicate declaration of emulator state Date: Sat, 5 Sep 2020 13:15:24 -0600 Message-Id: <20200905191524.1603618-1-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean With x86 we can execute an option ROM either natively or using the x86 emulator (if enabled with CONFIG_BIOSEMU). Both of these share the _X86EMU_env variable, with the native code using it to hold register state during interrupt processing. At present, in 32-bit U-Boot, the variable is declared twice, once in common code and once in code only compiled with CONFIG_BIOSEMU. With gcc-10 this causes a 'multiple definitions' error on boards with CONFIG_BIOSEMU. Drop the emulator definition, except for 64-bit builds. Also drop inclusion of the emulator in 64-bit U-Boot since this does not work at present, and generally isn't needed if 32-bit code has already set up the option ROMs. Reported-by: Heinrich Schuchardt Signed-off-by: Simon Glass Tested-by: Wolfgang Wallner --- drivers/bios_emulator/x86emu/sys.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/bios_emulator/x86emu/sys.c b/drivers/bios_emulator/x86emu/sys.c index c2db1213fe6..146586b3ceb 100644 --- a/drivers/bios_emulator/x86emu/sys.c +++ b/drivers/bios_emulator/x86emu/sys.c @@ -44,7 +44,11 @@ /*------------------------- Global Variables ------------------------------*/ +/* Definite this here since the emulator is not present on 64-bit */ +#ifdef CONFIG_X86_64 X86EMU_sysEnv _X86EMU_env; /* Global emulator machine state */ +#endif + X86EMU_intrFuncs _X86EMU_intrTab[256]; int debug_intr;