aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-10-24 10:53:44 -0200
committerLuiz Capitulino <lcapitulino@redhat.com>2011-10-27 11:48:46 -0200
commit99b7796f601cd275b16b3e7122874953ed1a0b1f (patch)
tree50f5ed3dbd1221475d52c5dd001f95afd0c1ca45
parentb025c8b4ab108a5a4bb4ef1e2500fc63214e2193 (diff)
Monitor: Introduce monitor_get_cpu_index()
Returns 'cur_mons's CPU index. A future commit will use it. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r--monitor.c5
-rw-r--r--monitor.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index 3f99ea0b90..3e1cd33942 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 9b723b2ddd..e76795f1f3 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);