]> Git Repo - qemu.git/commitdiff
tcg: Register the helper info struct rather than the name
authorRichard Henderson <[email protected]>
Tue, 8 Apr 2014 07:17:53 +0000 (00:17 -0700)
committerRichard Henderson <[email protected]>
Wed, 28 May 2014 16:33:54 +0000 (09:33 -0700)
This will let us find all the info from the hash table.

Reviewed-by: Alex BennĂ©e <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
tcg/tcg.c

index 4679c19846f4413c978901dab8f9d3cff2792021..56ef0fd74f0fb170bcd46ab70c37880ee0a9625c 100644 (file)
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -356,7 +356,7 @@ void tcg_context_init(TCGContext *s)
 
     for (i = 0; i < ARRAY_SIZE(all_helpers); ++i) {
         g_hash_table_insert(helper_table, (gpointer)all_helpers[i].func,
-                            (gpointer)all_helpers[i].name);
+                            (gpointer)&all_helpers[i]);
     }
 
     tcg_target_init(s);
@@ -1149,7 +1149,10 @@ static inline const char *tcg_find_helper(TCGContext *s, uintptr_t val)
 {
     const char *ret = NULL;
     if (s->helpers) {
-        ret = g_hash_table_lookup(s->helpers, (gpointer)val);
+        TCGHelperInfo *info = g_hash_table_lookup(s->helpers, (gpointer)val);
+        if (info) {
+            ret = info->name;
+        }
     }
     return ret;
 }
This page took 0.030716 seconds and 4 git commands to generate.