X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=gnokii%2Fcleanup.c;h=e93075db48c8464053afe0946a39022f751fcbaf;hp=2a0b51e5fb33f1f1c44ce553ad5581af0057a890;hb=37cdea3e5f1fc5d9fec54e5bea72271b46bfaa7e;hpb=694435627cf426b4f40c8df4e2cde71917eca88e diff --git a/gnokii/cleanup.c b/gnokii/cleanup.c index 2a0b51e..e93075d 100644 --- a/gnokii/cleanup.c +++ b/gnokii/cleanup.c @@ -8,9 +8,11 @@ void _cleanup(void) { /* hack for pic32 gcc */ +#if 0 #ifdef LIVE LIVE; #endif /* LIVE */ +#endif } #ifdef STACKCHECK @@ -54,17 +56,24 @@ void live_disable(int how) void stackcheck(void) { +volatile static inside=0; volatile void *func; volatile int fp_alloc; asm("movel %%d0,%0" : "=r" (fp_alloc) : /* input */ : "d0"); asm("movel %%sp@,%0" : "=r" (func) : /* input */); + if (inside) + return; + inside++; + if (live_check_disable<=0) printf("mcount(func=0x%08lX,fp_alloc=%d)\n",((long)func)-STACKCHECK_HEADER_PC_OFFSET,-fp_alloc); #ifdef LIVE_ALLOC LIVE_ALLOC((-fp_alloc)+4); #endif /* LIVE_ALLOC */ + + inside--; } #endif /* STACKCHECK */