Move the mono_ia64_context_get_... functions to mono-context.h to fix the ia64 build.
authorZoltan Varga <vargaz@gmail.com>
Tue, 19 Apr 2011 20:37:01 +0000 (22:37 +0200)
committerZoltan Varga <vargaz@gmail.com>
Tue, 19 Apr 2011 20:37:37 +0000 (22:37 +0200)
mono/mini/mini-ia64.h
mono/utils/mono-context.h

index a2fc7c82c2bd43afe5bb6b60c8b7651d0906de7c..4d4f1df44317af2ca40fe79bc3e1d48c4bded62e 100644 (file)
@@ -71,64 +71,6 @@ typedef struct MonoCompileArch {
        GHashTable *branch_targets;
 } MonoCompileArch;
 
-static inline unw_word_t
-mono_ia64_context_get_ip (MonoContext *ctx)
-{
-       unw_word_t ip;
-       int err;
-
-       err = unw_get_reg (&ctx->cursor, UNW_IA64_IP, &ip);
-       g_assert (err == 0);
-
-       if (ctx->precise_ip) {
-               return ip;
-       } else {
-               /* Subtrack 1 so ip points into the actual instruction */
-               return ip - 1;
-       }
-}
-
-static inline unw_word_t
-mono_ia64_context_get_sp (MonoContext *ctx)
-{
-       unw_word_t sp;
-       int err;
-
-       err = unw_get_reg (&ctx->cursor, UNW_IA64_SP, &sp);
-       g_assert (err == 0);
-
-       return sp;
-}
-
-static inline unw_word_t
-mono_ia64_context_get_fp (MonoContext *ctx)
-{
-       unw_cursor_t new_cursor;
-       unw_word_t fp;
-       int err;
-
-       {
-               unw_word_t ip, sp;
-
-               err = unw_get_reg (&ctx->cursor, UNW_IA64_SP, &sp);
-               g_assert (err == 0);
-
-               err = unw_get_reg (&ctx->cursor, UNW_IA64_IP, &ip);
-               g_assert (err == 0);
-       }
-
-       /* fp is the SP of the parent frame */
-       new_cursor = ctx->cursor;
-
-       err = unw_step (&new_cursor);
-       g_assert (err >= 0);
-
-       err = unw_get_reg (&new_cursor, UNW_IA64_SP, &fp);
-       g_assert (err == 0);
-
-       return fp;
-}
-
 #define MONO_INIT_CONTEXT_FROM_FUNC(ctx,start_func) do {       \
     MONO_INIT_CONTEXT_FROM_CURRENT (ctx); \
 } while (0)
index f7f2716f86efbfa676c4c54f28edc343840142ea..273a5f3cc8d6b59b245a8b7beffdf2ed7297cddd 100644 (file)
@@ -266,6 +266,64 @@ typedef struct MonoContext {
 #define MONO_CONTEXT_GET_BP(ctx) ((gpointer)(mono_ia64_context_get_fp ((ctx))))
 #define MONO_CONTEXT_GET_SP(ctx) ((gpointer)(mono_ia64_context_get_sp ((ctx))))
 
+static inline unw_word_t
+mono_ia64_context_get_ip (MonoContext *ctx)
+{
+       unw_word_t ip;
+       int err;
+
+       err = unw_get_reg (&ctx->cursor, UNW_IA64_IP, &ip);
+       g_assert (err == 0);
+
+       if (ctx->precise_ip) {
+               return ip;
+       } else {
+               /* Subtrack 1 so ip points into the actual instruction */
+               return ip - 1;
+       }
+}
+
+static inline unw_word_t
+mono_ia64_context_get_sp (MonoContext *ctx)
+{
+       unw_word_t sp;
+       int err;
+
+       err = unw_get_reg (&ctx->cursor, UNW_IA64_SP, &sp);
+       g_assert (err == 0);
+
+       return sp;
+}
+
+static inline unw_word_t
+mono_ia64_context_get_fp (MonoContext *ctx)
+{
+       unw_cursor_t new_cursor;
+       unw_word_t fp;
+       int err;
+
+       {
+               unw_word_t ip, sp;
+
+               err = unw_get_reg (&ctx->cursor, UNW_IA64_SP, &sp);
+               g_assert (err == 0);
+
+               err = unw_get_reg (&ctx->cursor, UNW_IA64_IP, &ip);
+               g_assert (err == 0);
+       }
+
+       /* fp is the SP of the parent frame */
+       new_cursor = ctx->cursor;
+
+       err = unw_step (&new_cursor);
+       g_assert (err >= 0);
+
+       err = unw_get_reg (&new_cursor, UNW_IA64_SP, &fp);
+       g_assert (err == 0);
+
+       return fp;
+}
+
 #elif defined(__mips__) && SIZEOF_REGISTER == 4 /* defined(__ia64__) */
 
 /* we define our own structure and we'll copy the data