--- libcoro/coro.c 2010/12/03 19:21:59 1.53 +++ libcoro/coro.c 2011/05/30 02:32:06 1.56 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2009 Marc Alexander Lehmann + * Copyright (c) 2001-2011 Marc Alexander Lehmann * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: @@ -88,6 +88,11 @@ coro_transfer (new_coro, create_coro); +#ifdef __linux && __elf + /* we blindly assume on any __linux with __elf we have a new enough gas with .cfi_undefined support */ + asm (".cfi_undefined rip"); +#endif + func ((void *)arg); /* the new coro returned. bad. just abort() for now */ @@ -212,8 +217,8 @@ } /* set the new stack */ - nstk.ss_sp = STACK_ADJUST_PTR (sptr,ssize); /* yes, some platforms (IRIX) get this wrong. */ - nstk.ss_size = STACK_ADJUST_SIZE (sptr,ssize); + nstk.ss_sp = STACK_ADJUST_PTR (sptr, ssize); /* yes, some platforms (IRIX) get this wrong. */ + nstk.ss_size = STACK_ADJUST_SIZE (sptr, ssize); nstk.ss_flags = 0; if (sigaltstack (&nstk, &ostk) < 0) @@ -307,6 +312,7 @@ #endif ctx->sp -= NUM_SAVED; + memset (ctx->sp, 0, sizeof (*ctx->sp) * NUM_SAVED); # elif CORO_UCONTEXT @@ -405,7 +411,8 @@ pthread_attr_init (&attr); #if __UCLIBC__ - pthread_attr_setstacksize (&attr, (size_t)ssize); + /* exists, but is borked */ + /*pthread_attr_setstacksize (&attr, (size_t)ssize);*/ #else pthread_attr_setstack (&attr, sptr, (size_t)ssize); #endif