From patchwork Tue Dec 19 05:38:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10122443 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 2D18860390 for ; Tue, 19 Dec 2017 05:43:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F14029042 for ; Tue, 19 Dec 2017 05:43:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 142352905A; Tue, 19 Dec 2017 05:43:39 +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, 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 B6F0B29042 for ; Tue, 19 Dec 2017 05:43:38 +0000 (UTC) Received: from localhost ([::1]:50623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRAgj-0004Hl-OV for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Dec 2017 00:43:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRAcv-0000ic-1j for qemu-devel@nongnu.org; Tue, 19 Dec 2017 00:39:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRAcu-0001n2-33 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 00:39:41 -0500 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:42583) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRAct-0001ma-Tk for qemu-devel@nongnu.org; Tue, 19 Dec 2017 00:39:40 -0500 Received: by mail-wr0-x244.google.com with SMTP id s66so16983014wrc.9 for ; Mon, 18 Dec 2017 21:39:39 -0800 (PST) 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=GzszHv1jn9DSIvA4dXn2Fcqmvk7o+KPpSjN0fSBEBfk=; b=aonO3cqwoog3EtHoQccxjsUPourPY86zJEdgH3uW7x62Mi9EEFwn+CAfuSpDcC/CJP KuYar/x3T4+/2ARjoBy4RnlzXgjx3wu+1YnBea26rXBpvU0yDPhl7Y/M1w+hChxx2Zyx AEuiynIO4Ktr+0fjabt4C+rGHoWyjI1edaoRth2+ONaTC97cA2M9VZDzsxjQanUNL1Uw k8ADDURAtg4rUWAsNHR6hl9of4jDfg53eAKDy7av38VuhCsBP/ly78EEkA4bb8loFohF /3eu2jk9DlIm6cZ+onCK0VnEF5kBNs/dVcYGUJyG60mWJyVf7Uun3EMc4/MEWUYWC/4k fKXg== 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=GzszHv1jn9DSIvA4dXn2Fcqmvk7o+KPpSjN0fSBEBfk=; b=lhztE7+lfHL1Uk6ScEyBc4EkQOtxRnLW0/eJH2BUXmMS/1NhTpop4ffwmyb+EytHHk piXkZVsWVokif9dkM2Da3GIDd/gfbpLRgBuLFHM7NVv6f1Le4lFQIMFfpRsQwgRqsseG Dz2PEEt4qDB/ySSl9B0xsdACajOBJ7oyBfwr8disGP91mJ2a6K5u+BtyltG0nCcyT+t8 qb772TgJlftEBCVnb1kswjEjD9Aa4QyN7rwPjsI2PN6Wf2TcDdBoUjo+MJiCzl2uZLzs bTPoIAObkzu/2Yw+vQZ3KUgi41LY/8XHt9iR/qIHyYQiJ87GFlcNCOXLoV0+Mumclky0 vP6A== X-Gm-Message-State: AKGB3mK0yJoo3w5UQ7aug9j1KZE8FIN2UfIARJWl7Z/I7i53ncI07e0f EiIDUmeKrrmHDZ2j76eySaMtJg== X-Google-Smtp-Source: ACJfBotdEZ2CxgwWCYYGg0s0HdaXOfnOFJjy1RBC0BrzS+fTqhDww5OxXPeb2EMzcnmrtd+RXvq+hA== X-Received: by 10.25.29.80 with SMTP id d77mr1295241lfd.39.1513661978644; Mon, 18 Dec 2017 21:39:38 -0800 (PST) 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 f67sm673187lfb.83.2017.12.18.21.39.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Dec 2017 21:39:38 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Mon, 18 Dec 2017 21:38:41 -0800 Message-Id: <1513661932-6849-6-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1513661932-6849-1-git-send-email-jcmvbkbc@gmail.com> References: <1513661932-6849-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:400c:c0c::244 Subject: [Qemu-devel] [PATCH v2 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 --- Changes v1->v2: - add sed transformation to target/xtensa/import-core.sh that drops #include "ansidecl.h" from imported xtensa-modules.c; target/xtensa/import_core.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/target/xtensa/import_core.sh b/target/xtensa/import_core.sh index cebb6e9c4c61..32255eea9b1b 100755 --- a/target/xtensa/import_core.sh +++ b/target/xtensa/import_core.sh @@ -23,6 +23,17 @@ 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 '/^#include "ansidecl.h"/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 +46,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 +56,7 @@ static XtensaConfig $NAME __attribute__((unused)) = { #include "core-$NAME/gdb-config.c" } }, + .isa_internal = &xtensa_modules, .clock_freq_khz = $FREQ, DEFAULT_SECTIONS };