… | |
… | |
52 | * 2007-05-02 Add assembly versions for x86 and amd64 (to avoid reliance |
52 | * 2007-05-02 Add assembly versions for x86 and amd64 (to avoid reliance |
53 | * on SIGUSR2 and sigaltstack in Crossfire). |
53 | * on SIGUSR2 and sigaltstack in Crossfire). |
54 | * 2008-01-21 Disable CFI usage on anything but GNU/Linux. |
54 | * 2008-01-21 Disable CFI usage on anything but GNU/Linux. |
55 | * 2008-03-02 Switched to 2-clause BSD license with GPL exception. |
55 | * 2008-03-02 Switched to 2-clause BSD license with GPL exception. |
56 | * 2008-04-04 New (but highly unrecommended) pthreads backend. |
56 | * 2008-04-04 New (but highly unrecommended) pthreads backend. |
|
|
57 | * 2008-04-24 Reinstate CORO_LOSER (had wrong stack adjustments). |
|
|
58 | * 2008-10-30 Support assembly method on x86 with and without frame pointer. |
|
|
59 | * 2008-11-03 Use a global asm statement for CORO_ASM, idea by pippijn. |
|
|
60 | * 2008-11-05 Hopefully fix misaligned stacks with CORO_ASM/SETJMP. |
57 | */ |
61 | */ |
58 | |
62 | |
59 | #ifndef CORO_H |
63 | #ifndef CORO_H |
60 | #define CORO_H |
64 | #define CORO_H |
61 | |
65 | |
… | |
… | |
204 | # endif |
208 | # endif |
205 | |
209 | |
206 | #elif CORO_ASM |
210 | #elif CORO_ASM |
207 | |
211 | |
208 | struct coro_context { |
212 | struct coro_context { |
209 | volatile void **sp; |
213 | volatile void **sp; /* must be at offset 0 */ |
210 | }; |
214 | }; |
211 | |
215 | |
212 | void __attribute__ ((__noinline__, __fastcall__)) |
216 | void __attribute__ ((__noinline__, __regparm__(2))) |
213 | coro_transfer (coro_context *prev, coro_context *next); |
217 | coro_transfer (coro_context *prev, coro_context *next); |
214 | |
218 | |
215 | #elif CORO_PTHREAD |
219 | #elif CORO_PTHREAD |
216 | |
220 | |
217 | #include <pthread.h> |
221 | #include <pthread.h> |
218 | |
222 | |