ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libcoro/coro.c
(Generate patch)

Comparing libcoro/coro.c (file contents):
Revision 1.14 by root, Mon Mar 21 14:17:44 2005 UTC vs.
Revision 1.17 by root, Tue Aug 30 21:32:17 2005 UTC

44# define STACK_ADJUST_PTR(sp,ss) (sp) 44# define STACK_ADJUST_PTR(sp,ss) (sp)
45# define STACK_ADJUST_SIZE(sp,ss) (ss) 45# define STACK_ADJUST_SIZE(sp,ss) (ss)
46# endif 46# endif
47#endif 47#endif
48 48
49#if CORO_SJLJ || CORO_LOOSE || CORO_LINUX || CORO_IRIX 49#if CORO_SJLJ || CORO_LOSER || CORO_LINUX || CORO_IRIX
50
51#include <stdlib.h>
50 52
51#if CORO_SJLJ 53#if CORO_SJLJ
54# include <stdio.h>
52# include <signal.h> 55# include <signal.h>
56# include <unistd.h>
53#endif 57#endif
54 58
55static volatile coro_func coro_init_func; 59static volatile coro_func coro_init_func;
56static volatile void *coro_init_arg; 60static volatile void *coro_init_arg;
57static volatile coro_context *new_coro, *create_coro; 61static volatile coro_context *new_coro, *create_coro;
102 ctx->uc.uc_stack.ss_size = (size_t) STACK_ADJUST_SIZE (sptr,ssize); 106 ctx->uc.uc_stack.ss_size = (size_t) STACK_ADJUST_SIZE (sptr,ssize);
103 ctx->uc.uc_stack.ss_flags = 0; 107 ctx->uc.uc_stack.ss_flags = 0;
104 108
105 makecontext (&(ctx->uc), (void (*)()) coro, 1, arg); 109 makecontext (&(ctx->uc), (void (*)()) coro, 1, arg);
106 110
107#elif CORO_SJLJ || CORO_LOOSE || CORO_LINUX || CORO_IRIX 111#elif CORO_SJLJ || CORO_LOSER || CORO_LINUX || CORO_IRIX
108 112
109# if CORO_SJLJ 113# if CORO_SJLJ
110 stack_t ostk, nstk; 114 stack_t ostk, nstk;
111 struct sigaction osa, nsa; 115 struct sigaction osa, nsa;
112 sigset_t nsig, osig; 116 sigset_t nsig, osig;
162 166
163 sigaction (SIGUSR1, &osa, 0); 167 sigaction (SIGUSR1, &osa, 0);
164 168
165 sigprocmask (SIG_SETMASK, &osig, 0); 169 sigprocmask (SIG_SETMASK, &osig, 0);
166 170
167# elif CORO_LOOSE 171# elif CORO_LOSER
168 172
169 setjmp (ctx->env); 173 setjmp (ctx->env);
170 ctx->env[7] = (long)((char *)sptr + ssize); 174 ctx->env[7] = (long)((char *)sptr + ssize);
171 ctx->env[8] = (long)coro_init; 175 ctx->env[8] = (long)coro_init;
172 176

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines