From patchwork Sat Nov 4 03:45:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10041419 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 87F5E6032A for ; Sat, 4 Nov 2017 03:50:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AE3329356 for ; Sat, 4 Nov 2017 03:50:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F32429ADC; Sat, 4 Nov 2017 03:50:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, HK_RANDOM_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1345F29356 for ; Sat, 4 Nov 2017 03:50:24 +0000 (UTC) Received: from localhost ([::1]:39215 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eApTT-0008RW-8E for patchwork-qemu-devel@patchwork.kernel.org; Fri, 03 Nov 2017 23:50:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eApPI-0005yl-Hh for qemu-devel@nongnu.org; Fri, 03 Nov 2017 23:46:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eApPH-0000Zh-Dt for qemu-devel@nongnu.org; Fri, 03 Nov 2017 23:46:04 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:49624) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eApPH-0000Z9-63 for qemu-devel@nongnu.org; Fri, 03 Nov 2017 23:46:03 -0400 Received: by mail-lf0-x241.google.com with SMTP id w21so5156808lfc.6 for ; Fri, 03 Nov 2017 20:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Bj4b/T21B+MuWexRvhoIqChnxMYq+dlixyI8n3m6auI=; b=Y+kWgd6lyUmuUUX09JvkPPytjiBmH7tQiW1TzK4Y+pF1YsD1e34uWUha7yQXRKPlfR KxxXMsVhMC+wRJS5mlwLx/1YNkNJ+W7v24FufqlhK6t/ycOC6mt4CF4YDM1m05bj9M0R JQ3qOqzRF2VP6j3hdeRBI/dBulDYkkmux/DEbdwrPcLhnaiMqXsBdV/BvY2jJdOXxmpc tNRUPsUlhyGWHvCScb2Kv3Qjmpbo30Iowpwg6+jLxaiB3mNyUo+dQtRsHYFSn2/yLg/T zC0JJR+05HoqzDJ/3pcbHTaEK6GXwrd8J9+VXkGu+nk1FHontLNaDP/YlPavrMF0qhMH c+Rg== 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:in-reply-to :references; bh=Bj4b/T21B+MuWexRvhoIqChnxMYq+dlixyI8n3m6auI=; b=KCIQs7mjptjyBl5zWxO53eQroSKqKYwF4vau4rSNBt7TXrr1ftO6UxSLwT3+5T5TOb H2p5wqY0MsZj2UhGleELU+Ko+RGoVI8n8pY7MEYjJzjOZ15yS7zDsTrgCQjmZjZOj1yt oc6+EF3q0d7mQa98P8Ukgitcc50ODDn/gk5IR4SAy7DKXhY7pJhxTBTjx2vY7tzDrMu5 MwRq9QI1OZe0afoCONQD+FopP2MkoG2vp9mo4FowpAP6HlfFPoiSlLyN0HshPPHjNvAf oISdfl5PeEXru0EmgXHjreLYSJrtJAcC6KVmLzG1waZe4n6fVRInCQDdVtkGT+65Ylfs v3Lw== X-Gm-Message-State: AMCzsaV30KgcMV4jpLgF+FTmCDGeal60F+kuPxLzPYk1fOdbMETCsjJD MGuW5/8XxnTjEZHMherEC/UCYw== X-Google-Smtp-Source: ABhQp+TOuCxJ0u7ZK8ToXhwy8Dt6zOrFq8zokMQ2tIVTjpt45PVI9Xlvy8npKo2JJQvjXq4SA5/JcQ== X-Received: by 10.46.15.1 with SMTP id 1mr3305343ljp.157.1509767161684; Fri, 03 Nov 2017 20:46:01 -0700 (PDT) Received: from octofox.net (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id h3sm1258383lfj.26.2017.11.03.20.45.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Nov 2017 20:46:01 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Fri, 3 Nov 2017 20:45:10 -0700 Message-Id: <1509767121-26925-6-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1509767121-26925-1-git-send-email-jcmvbkbc@gmail.com> References: <1509767121-26925-1-git-send-email-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::241 Subject: [Qemu-devel] [PATCH 05/16] target/xtensa: update import_core.sh script for libisa X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Extract xtensa-modules.c from the overlay, fix up known issues, include it into the core-$NAME.c. Signed-off-by: Max Filippov --- target/xtensa/import_core.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/target/xtensa/import_core.sh b/target/xtensa/import_core.sh index cebb6e9c4c61..62d3243c1445 100755 --- a/target/xtensa/import_core.sh +++ b/target/xtensa/import_core.sh @@ -23,6 +23,16 @@ tar -xf "$OVERLAY" -C "$TARGET" --strip-components=1 \ --xform='s/core/core-isa/' config/core.h tar -xf "$OVERLAY" -O gdb/xtensa-config.c | \ sed -n '1,/*\//p;/XTREG/,/XTREG_END/p' > "$TARGET"/gdb-config.c +# +# Fix up known issues in the xtensa-modules.c +# +tar -xf "$OVERLAY" -O binutils/xtensa-modules.c | \ + sed -e 's/\(xtensa_opcode_encode_fn.*\[\] =\)/static \1/' \ + -e '/^int num_bypass_groups()/,/}/d' \ + -e '/^int num_bypass_group_chunks()/,/}/d' \ + -e '/^uint32 \*bypass_entry(int i)/,/}/d' \ + -e '/^Slot_[a-zA-Z0-9_]\+_decode (const xtensa_insnbuf insn)/,/^}/s/^ return 0;$/ return XTENSA_UNDEFINED;/' \ + > "$TARGET"/xtensa-modules.c cat < "${TARGET}.c" #include "qemu/osdep.h" @@ -35,6 +45,9 @@ cat < "${TARGET}.c" #include "core-$NAME/core-isa.h" #include "overlay_tool.h" +#define xtensa_modules xtensa_modules_$NAME +#include "core-$NAME/xtensa-modules.c" + static XtensaConfig $NAME __attribute__((unused)) = { .name = "$NAME", .gdb_regmap = { @@ -42,6 +55,7 @@ static XtensaConfig $NAME __attribute__((unused)) = { #include "core-$NAME/gdb-config.c" } }, + .isa_internal = &xtensa_modules, .clock_freq_khz = $FREQ, DEFAULT_SECTIONS };