trapping code: transition from native to haskell rts
[mate.git] / trap.c
1 #include <stdio.h>
2
3 void callertrap(void)
4 {
5         char buf[5];
6         unsigned int *ptr = (unsigned int) (buf + 1);
7
8         printf("callertrap by 0x%08x\n", *(ptr + 4));
9         /* TODO:
10          * call magic haskell function
11          * with environment information */
12 }
13
14 unsigned int getaddr(void)
15 {
16         return (unsigned int) callertrap;
17 }