From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfoU0-0004Pn-1Y for qemu-devel@nongnu.org; Sun, 19 Oct 2014 07:17:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XfoTt-00088S-6T for qemu-devel@nongnu.org; Sun, 19 Oct 2014 07:17:07 -0400 Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:38382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfoTs-00087j-Tp for qemu-devel@nongnu.org; Sun, 19 Oct 2014 07:17:01 -0400 Received: by mail-la0-f53.google.com with SMTP id gq15so2557391lab.40 for ; Sun, 19 Oct 2014 04:16:59 -0700 (PDT) From: Max Filippov Date: Sun, 19 Oct 2014 15:16:39 +0400 Message-Id: <1413717399-4623-1-git-send-email-jcmvbkbc@gmail.com> Subject: [Qemu-devel] [PATCH] target-xtensa: add core importing script List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Max Filippov This script copies configuration and gdb information from the xtensa configuration overlay archive and registers new xtensa core. Signed-off-by: Max Filippov --- target-xtensa/import_core.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 target-xtensa/import_core.sh diff --git a/target-xtensa/import_core.sh b/target-xtensa/import_core.sh new file mode 100755 index 0000000..73791ec --- /dev/null +++ b/target-xtensa/import_core.sh @@ -0,0 +1,53 @@ +#! /bin/bash -e + +OVERLAY="$1" +NAME="$2" +FREQ=40000 +BASE=$(dirname "$0") +TARGET="$BASE"/core-$NAME + +[ $# -ge 2 -a -f "$OVERLAY" ] || { cat < "$TARGET"/gdb-config.c +NUM_REGS=$(grep XTREG "$TARGET"/gdb-config.c | wc -l) + +cat < "${TARGET}.c" +#include "cpu.h" +#include "exec/exec-all.h" +#include "exec/gdbstub.h" +#include "qemu/host-utils.h" + +#include "core-$NAME/core-isa.h" +#include "overlay_tool.h" + +static const XtensaConfig $NAME __attribute__((unused)) = { + .name = "$NAME", + .gdb_regmap = { + .num_regs = $NUM_REGS, + .reg = { +#include "core-$NAME/gdb-config.c" + } + }, + .clock_freq_khz = $FREQ, + DEFAULT_SECTIONS +}; + +REGISTER_CORE($NAME) +EOF + +grep -q core-${NAME}.o "$BASE"/Makefile.objs || \ + echo "obj-y += core-${NAME}.o" >> "$BASE"/Makefile.objs -- 1.8.1.4