diff options
Diffstat (limited to 'sys/libn/coro.c')
-rw-r--r-- | sys/libn/coro.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/libn/coro.c b/sys/libn/coro.c index 2e50164..2ad629b 100644 --- a/sys/libn/coro.c +++ b/sys/libn/coro.c @@ -4,8 +4,8 @@ // ----------------------------------------------------------------------- // Assembly routines -extern void _newcoro(coro *co, uintptr (*func)(coro*, uintptr), void *stk); -extern uintptr _coroyield(coro *co, uintptr arg); +extern void _newcoro(Coro *co, uintptr (*func)(Coro*, uintptr), void *stk); +extern uintptr _coroyield(Coro *co, uintptr arg); // ----------------------------------------------------------------------- // Globals @@ -16,7 +16,7 @@ extern uintptr _coroyield(coro *co, uintptr arg); // C interface /* Co-routine context */ -struct coro +struct Coro { void* sp; void* bp; @@ -24,14 +24,14 @@ struct coro void* user; }; -coro* -coro·new(uintptr stk, uintptr (*func)(coro*, uintptr)) +Coro* +coro·new(uintptr stk, uintptr (*func)(Coro*, uintptr)) { if (!func) return nil; if (stk == 0) stk = 8192; byte *block = malloc(stk); - coro *co = (coro*)&block[stk - sizeof(coro)]; + Coro *co = (Coro*)&block[stk - sizeof(Coro)]; co->bp = block; co->size = stk; @@ -40,7 +40,7 @@ coro·new(uintptr stk, uintptr (*func)(coro*, uintptr)) } error -coro·free(coro *co) +coro·free(Coro *co) { enum { @@ -60,7 +60,7 @@ coro·free(coro *co) } uintptr -coro·yield(coro *c, uintptr arg) +coro·yield(Coro *c, uintptr arg) { return _coroyield(c, arg); } |