pkgsrc/lang/ocaml/patches/patch-ah
2005-02-06 15:25:35 +00:00

64 lines
1.8 KiB
Text

$NetBSD: patch-ah,v 1.11 2005/02/06 15:25:36 adrianp Exp $
--- asmrun/power-bsd.S.orig 2005-02-06 15:00:21.000000000 +0000
+++ asmrun/power-bsd.S
@@ -15,2 +15,31 @@
+#if defined(PROFILING)
+#define PROFILE_CAML \
+ stwu 1, -32(1) \
+ mflr 0 \
+ stw 0, 4(1) \
+ stw 2, 8(1) \
+ stw 3, 12(1) \
+ stw 4, 16(1) \
+ stw 5, 20(1) \
+ stw 6, 24(1) \
+ stw 7, 28(1) \
+ bl _mcount \
+ lwz 2, 8(1) \
+ lwz 3, 12(1) \
+ lwz 4, 16(1) \
+ lwz 5, 20(1) \
+ lwz 6, 24(1) \
+ lwz 7, 28(1) \
+ addic 1, 1, 32
+
+#define PROFILE_C \
+ mflr 0 \
+ stw 0, 4(1) \
+ bl _mcount
+#else
+#define PROFILE_CAML
+#define PROFILE_C
+#endif
+
#define Addrglobal(reg,glob) \
@@ -32,2 +61,3 @@
caml_call_gc:
+ PROFILE_CAML
/* Set up stack frame */
@@ -184,2 +214,3 @@ caml_call_gc:
caml_c_call:
+ PROFILE_CAML
/* Save return address */
@@ -212,2 +243,3 @@ caml_c_call:
caml_raise_exception:
+ PROFILE_C
/* Reload Caml global registers */
@@ -232,2 +264,3 @@ caml_raise_exception:
caml_start_program:
+ PROFILE_C
Addrglobal(12, caml_program)
@@ -382,2 +415,3 @@ caml_start_program:
caml_callback_exn:
+ PROFILE_C
/* Initial shuffling of arguments */
@@ -392,2 +426,3 @@ caml_callback_exn:
caml_callback2_exn:
+ PROFILE_C
mr 0, 3 /* Closure */
@@ -402,2 +437,3 @@ caml_callback2_exn:
caml_callback3_exn:
+ PROFILE_C
mr 0, 3 /* Closure */