Mixed mode exception handling (#4777)
[mono.git] / mono / mini / mini-runtime.c
index 719dceaf97e39dbfe0b39739584e9c85dfc23c60..5085233d27ab9376bac85309f92de891999adf9a 100644 (file)
@@ -791,6 +791,38 @@ mono_set_lmf_addr (gpointer lmf_addr)
                mono_thread_info_tls_set (info, TLS_KEY_LMF_ADDR, lmf_addr);
 }
 
+/*
+ * mono_push_lmf:
+ *
+ *   Push an MonoLMFExt frame on the LMF stack.
+ */
+void
+mono_push_lmf (MonoLMFExt *ext)
+{
+#ifdef MONO_ARCH_HAVE_INIT_LMF_EXT
+       MonoLMF **lmf_addr;
+
+       lmf_addr = mono_get_lmf_addr ();
+
+       mono_arch_init_lmf_ext (ext, *lmf_addr);
+
+       mono_set_lmf ((MonoLMF*)ext);
+#else
+       NOT_IMPLEMENTED;
+#endif
+}
+
+/*
+ * mono_push_lmf:
+ *
+ *   Pop the last frame from the LMF stack.
+ */
+void
+mono_pop_lmf (MonoLMF *lmf)
+{
+       mono_set_lmf ((MonoLMF *)(((gssize)lmf->previous_lmf) & ~3));
+}
+
 /*
  * mono_jit_thread_attach:
  *