From: short <> Date: Tue, 5 Mar 2002 21:37:34 +0000 (+0000) Subject: Some stackchecking fixes X-Git-Tag: uc_works1~14 X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=commitdiff_plain;h=37cdea3e5f1fc5d9fec54e5bea72271b46bfaa7e;hp=694435627cf426b4f40c8df4e2cde71917eca88e Some stackchecking fixes --- 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 */