summaryrefslogtreecommitdiff
path: root/gdbstub.h
diff options
context:
space:
mode:
authorWen Congyang <wency@cn.fujitsu.com>2012-05-07 12:10:05 +0800
committerLuiz Capitulino <lcapitulino@redhat.com>2012-06-04 13:49:34 -0300
commit68f4730c714b7c30ca912d7c03e199f181739da0 (patch)
tree2670938558271cef4c6f029f4f602eb5dd0e86c6 /gdbstub.h
parent0038ffb09692955b8f8f363958cbf58c205ae772 (diff)
downloadqemu-68f4730c714b7c30ca912d7c03e199f181739da0.tar.gz
make gdb_id() generally avialable and rename it to cpu_index()
The following patch also needs this API, so make it generally avialable. The function gdb_id() will not be used in gdbstub.c now, so its name is not suitable, and rename it to cpu_index() Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'gdbstub.h')
-rw-r--r--gdbstub.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdbstub.h b/gdbstub.h
index b44e27523a..668de66000 100644
--- a/gdbstub.h
+++ b/gdbstub.h
@@ -30,6 +30,15 @@ void gdb_register_coprocessor(CPUArchState *env,
gdb_reg_cb get_reg, gdb_reg_cb set_reg,
int num_regs, const char *xml, int g_pos);
+static inline int cpu_index(CPUArchState *env)
+{
+#if defined(CONFIG_USER_ONLY) && defined(CONFIG_USE_NPTL)
+ return env->host_tid;
+#else
+ return env->cpu_index + 1;
+#endif
+}
+
#endif
#ifdef CONFIG_USER_ONLY