From patchwork Thu Oct 27 19:02:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 122235 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 405161007D3 for ; Fri, 28 Oct 2011 06:37:10 +1100 (EST) Received: from localhost ([::1]:57554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJVEV-0005Dx-9M for incoming@patchwork.ozlabs.org; Thu, 27 Oct 2011 15:03:19 -0400 Received: from eggs.gnu.org ([140.186.70.92]:44313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJVEM-00050C-Or for qemu-devel@nongnu.org; Thu, 27 Oct 2011 15:03:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJVEK-00026m-VO for qemu-devel@nongnu.org; Thu, 27 Oct 2011 15:03:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJVEK-00026H-IC for qemu-devel@nongnu.org; Thu, 27 Oct 2011 15:03:08 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9RJ2W4W030433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 27 Oct 2011 15:02:32 -0400 Received: from localhost (ovpn-113-103.phx2.redhat.com [10.3.113.103]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9RJ2VK5027902; Thu, 27 Oct 2011 15:02:32 -0400 From: Luiz Capitulino To: aliguori@us.ibm.com Date: Thu, 27 Oct 2011 17:02:02 -0200 Message-Id: <1319742136-8691-6-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1319742136-8691-1-git-send-email-lcapitulino@redhat.com> References: <1319742136-8691-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 05/19] Monitor: Introduce monitor_get_cpu_index() 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 Returns 'cur_mons's CPU index. A future commit will use it. Signed-off-by: Luiz Capitulino --- monitor.c | 5 +++++ monitor.h | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/monitor.c b/monitor.c index 3f99ea0..3e1cd33 100644 --- a/monitor.c +++ b/monitor.c @@ -794,6 +794,11 @@ static CPUState *mon_get_cpu(void) return cur_mon->mon_cpu; } +int monitor_get_cpu_index(void) +{ + return mon_get_cpu()->cpu_index; +} + static void do_info_registers(Monitor *mon) { CPUState *env; diff --git a/monitor.h b/monitor.h index 9b723b2..e76795f 100644 --- a/monitor.h +++ b/monitor.h @@ -58,6 +58,7 @@ void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3); void monitor_print_filename(Monitor *mon, const char *filename); void monitor_flush(Monitor *mon); int monitor_set_cpu(int cpu_index); +int monitor_get_cpu_index(void); typedef void (MonitorCompletion)(void *opaque, QObject *ret_data);