Not yet working stack checking (symbol STACKCHECK)
[gnokii.git] / gnokii / mcount.c
diff --git a/gnokii/mcount.c b/gnokii/mcount.c
new file mode 100644 (file)
index 0000000..cf40629
--- /dev/null
@@ -0,0 +1,26 @@
+#ifdef GNOKII_MAIN
+#include "config.h"
+#endif
+
+#ifdef STACKCHECK
+
+#include <stdio.h>
+
+void mcount(void)
+{
+#ifdef __m68k__X
+static void *arg;
+
+#if 0
+       asm("movel %%a0,%0" : "=r" (arg) : /* input */ : "a0");
+#endif
+       asm("movel %%fp@(+4),%0" : "=r" (arg) : /* input */);
+
+       printf("mcount(0x%08lX)\n",(long)arg);
+#endif /* __m68k__ */
+#ifdef LIVEX
+       LIVE;
+#endif /* LIVE */
+}
+
+#endif /* STACKCHECK */