From patchwork Thu Apr 28 20:50:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 93304 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 49B50B6FB9 for ; Fri, 29 Apr 2011 06:53:34 +1000 (EST) Received: from localhost ([::1]:49229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFYDL-00084n-NR for incoming@patchwork.ozlabs.org; Thu, 28 Apr 2011 16:53:31 -0400 Received: from eggs.gnu.org ([140.186.70.92]:47731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFYBS-00051z-08 for qemu-devel@nongnu.org; Thu, 28 Apr 2011 16:51:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFYBR-0005Zx-3x for qemu-devel@nongnu.org; Thu, 28 Apr 2011 16:51:33 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:64385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFYBQ-0005Zh-T2 for qemu-devel@nongnu.org; Thu, 28 Apr 2011 16:51:33 -0400 Received: by mail-pv0-f173.google.com with SMTP id 3so2495040pvg.4 for ; Thu, 28 Apr 2011 13:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:subject:date:message-id:x-mailer :in-reply-to:references; bh=WuAvhGo1+6uEQJXcd9XPUeGSeNxS8Fm/EBmEG/1kFBQ=; b=vTVEnVDMAKLasqCFK0SSyvhcqgxjwu7m78+xauSLoHhSJziKA761lkwgNiMJFyEq4m VErBPd08VLvGUkwYpEYF3TtWSim46eVx27TpNGis9IjDEBdg1LsufZoPM9bVIT+5wa0S 91cECCRPiypdJj7e8mpDcONVAMc6diz4naTjQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=M/5MMhIYjb7hZWkGkzg4EHPexKdUYHXzP7yfa934jMYXfwolF3KaHnEl2w9KFk3byZ E5CP8eAMMujLa9BvGqGFG/lsvj+uQY5v5aLg9qZ0i0RvXaMvsNv2SN8oO/jta+b/Gb5a eVA/o8k3ugPg81sQSaY8gB3Oo3B3PykAKJHJs= Received: by 10.143.33.7 with SMTP id l7mr1306578wfj.228.1304023892434; Thu, 28 Apr 2011 13:51:32 -0700 (PDT) Received: from localhost.localdomain (are.twiddle.net [75.101.38.216]) by mx.google.com with ESMTPS id z10sm2266797wfj.12.2011.04.28.13.51.31 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2011 13:51:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 28 Apr 2011 13:50:49 -0700 Message-Id: <1304023875-25040-8-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1304023875-25040-1-git-send-email-rth@twiddle.net> References: <1304023875-25040-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.83.173 Subject: [Qemu-devel] [PATCH 07/33] target-alpha: Enable the alpha-softmmu target. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Compiles, but no machine defined yet, so this will crash on startup. Signed-off-by: Richard Henderson --- Makefile.target | 3 +- configure | 1 + default-configs/alpha-softmmu.mak | 9 ++++ target-alpha/machine.c | 87 +++++++++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+), 1 deletions(-) create mode 100644 default-configs/alpha-softmmu.mak create mode 100644 target-alpha/machine.c diff --git a/Makefile.target b/Makefile.target index 237e912..7c194c2 100644 --- a/Makefile.target +++ b/Makefile.target @@ -364,7 +364,8 @@ obj-m68k-y += m68k-semi.o dummy_m68k.o obj-s390x-y = s390-virtio-bus.o s390-virtio.o -obj-alpha-y = +obj-alpha-y += i8259.o mc146818rtc.o +obj-alpha-y += vga.o cirrus_vga.o main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) diff --git a/configure b/configure index 6f75e2e..214aabc 100755 --- a/configure +++ b/configure @@ -1011,6 +1011,7 @@ if test -z "$target_list" ; then target_list="\ i386-softmmu \ x86_64-softmmu \ +alpha-softmmu \ arm-softmmu \ cris-softmmu \ lm32-softmmu \ diff --git a/default-configs/alpha-softmmu.mak b/default-configs/alpha-softmmu.mak new file mode 100644 index 0000000..abadcff --- /dev/null +++ b/default-configs/alpha-softmmu.mak @@ -0,0 +1,9 @@ +# Default configuration for alpha-softmmu + +include pci.mak +CONFIG_SERIAL=y +CONFIG_I8254=y +CONFIG_VGA_PCI=y +CONFIG_IDE_CORE=y +CONFIG_IDE_QDEV=y +CONFIG_VMWARE_VGA=y diff --git a/target-alpha/machine.c b/target-alpha/machine.c new file mode 100644 index 0000000..a13b66a --- /dev/null +++ b/target-alpha/machine.c @@ -0,0 +1,87 @@ +#include "hw/hw.h" +#include "hw/boards.h" + +static int get_fpcr(QEMUFile *f, void *opaque, size_t size) +{ + CPUAlphaState *env = opaque; + cpu_alpha_store_fpcr(env, qemu_get_be64(f)); + return 0; +} + +static void put_fpcr(QEMUFile *f, void *opaque, size_t size) +{ + CPUAlphaState *env = opaque; + qemu_put_be64(f, cpu_alpha_load_fpcr(env)); +} + +static const VMStateInfo vmstate_fpcr = { + .name = "fpcr", + .get = get_fpcr, + .put = put_fpcr, +}; + +static VMStateField vmstate_cpu_fields[] = { + VMSTATE_UINTTL_ARRAY(ir, CPUState, 31), + VMSTATE_UINTTL_ARRAY(fir, CPUState, 31), + /* Save the architecture value of the fpcr, not the internally + expanded version. Since this architecture value does not + exist in memory to be stored, this requires a but of hoop + jumping. We want OFFSET=0 so that we effectively pass ENV + to the helper functions, and we need to fill in the name by + hand since there's no field of that name. */ + { + .name = "fpcr", + .version_id = 0, + .size = sizeof(uint64_t), + .info = &vmstate_fpcr, + .flags = VMS_SINGLE, + .offset = 0 + }, + VMSTATE_UINTTL(pc, CPUState), + VMSTATE_UINTTL(unique, CPUState), + VMSTATE_UINTTL(lock_addr, CPUState), + VMSTATE_UINTTL(lock_value, CPUState), + /* Note that lock_st_addr is not saved; it is a temporary + used during the execution of the st[lq]_c insns. */ + + VMSTATE_UINT8(ps, CPUState), + VMSTATE_UINT8(intr_flag, CPUState), + VMSTATE_UINT8(fen, CPUState), + VMSTATE_UINT8(pal_mode, CPUState), + + VMSTATE_UINT32(pcc_ofs, CPUState), + + VMSTATE_UINTTL(trap_arg0, CPUState), + VMSTATE_UINTTL(trap_arg1, CPUState), + VMSTATE_UINTTL(trap_arg2, CPUState), + + VMSTATE_UINTTL(exc_addr, CPUState), + VMSTATE_UINTTL(palbr, CPUState), + VMSTATE_UINTTL(ptbr, CPUState), + VMSTATE_UINTTL(vptptr, CPUState), + VMSTATE_UINTTL(sysval, CPUState), + VMSTATE_UINTTL(usp, CPUState), + + VMSTATE_UINTTL_ARRAY(shadow, CPUState, 8), + VMSTATE_UINTTL_ARRAY(scratch, CPUState, 24), + + VMSTATE_END_OF_LIST() +}; + +static const VMStateDescription vmstate_cpu = { + .name = "cpu", + .version_id = CPU_SAVE_VERSION, + .minimum_version_id = 1, + .minimum_version_id_old = 1, + .fields = vmstate_cpu_fields, +}; + +void cpu_save(QEMUFile *f, void *opaque) +{ + vmstate_save_state(f, &vmstate_cpu, opaque); +} + +int cpu_load(QEMUFile *f, void *opaque, int version_id) +{ + return vmstate_load_state(f, &vmstate_cpu, opaque, version_id); +}