From patchwork Mon Mar 4 09:01:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 224641 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0C9742C030C for ; Mon, 4 Mar 2013 20:05:13 +1100 (EST) Received: from localhost ([::1]:45754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCRKZ-0006we-73 for incoming@patchwork.ozlabs.org; Mon, 04 Mar 2013 04:05:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCRK5-0006ed-WE for qemu-devel@nongnu.org; Mon, 04 Mar 2013 04:04:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCRK1-00076N-9V for qemu-devel@nongnu.org; Mon, 04 Mar 2013 04:04:41 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:44839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCRK1-00076F-47 for qemu-devel@nongnu.org; Mon, 04 Mar 2013 04:04:37 -0500 Received: by mail-pa0-f53.google.com with SMTP id bg4so3020764pad.40 for ; Mon, 04 Mar 2013 01:04:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references:x-gm-message-state; bh=LbFyJSxgIlMqCSJb1Y+PfWJdMbT3lZ892EMKCccaSVk=; b=a8dhWesMyheuUmg26k1Q/W3Hz7C8iubBqZ5BziiwRNaBcnr+UgXgxJ0rksQF6eDTlA 3qg08Zv1SjXUcQRK8i8UEAKf1dY7jziaQzKCdcN6kmZhfy1eAIVURFi9Afz0V1xKf7SL 4KhqzAbSIu0AuzwPPlaiLI0jOeydCUiNJaHUexqy1K/AiQfDAgyN3wPBPphIUcALqHyR eAbBC7R2GoCRvIvTFcQTM4ee+ONG+QjgdV5KAOgLuBkDqngPHk3LvHfDq65mkC6JJmQA 8WK3N/ELIAbPlnCNqLixruhFP+3tHZ0Ic7N4I9zv3RNNDO6RfFUPhsh6eZmhdumGodWn 0XCQ== X-Received: by 10.68.11.135 with SMTP id q7mr27079473pbb.5.1362387876435; Mon, 04 Mar 2013 01:04:36 -0800 (PST) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPS id hu2sm21645761pbc.38.2013.03.04.01.04.34 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 04 Mar 2013 01:04:35 -0800 (PST) From: Peter Crosthwaite To: qemu-devel@nongnu.org Date: Mon, 4 Mar 2013 19:01:35 +1000 Message-Id: X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQlCokyur9KiRD2AO8V88qxnpuPHIocKJeIJ74xFtk5slpzjMb2Z/iKCmrt6jlhM4R0A5LBd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.53 Cc: Peter Crosthwaite , andreas.faerber@suse.de, dantesu@faraday-tech.com Subject: [Qemu-devel] [RFC PATCH v1 3/7] qom/cpu.c: Hook CPU reset up to device reset 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 Hookup the CPU::reset function up as the Device::reset function. This allows devices that abstract away the fact that the device is a CPU to reset it. Signed-off-by: Peter Crosthwaite --- qom/cpu.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/qom/cpu.c b/qom/cpu.c index 00a07d9..7084a67 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -43,6 +43,11 @@ static void cpu_common_reset(CPUState *cpu) cpu->halted = 0; } +static void cpu_device_reset(DeviceState *dev) +{ + cpu_reset(CPU(dev)); +} + static void cpu_common_halt(DeviceState *dev) { CPUState *s = CPU(dev); @@ -80,6 +85,7 @@ static void cpu_class_init(ObjectClass *klass, void *data) k->class_by_name = cpu_common_class_by_name; k->reset = cpu_common_reset; + dc->reset = cpu_device_reset; dc->halt = cpu_common_halt; dc->unhalt = cpu_common_unhalt; dc->realize = cpu_common_realizefn;