diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2007-07-02 08:37:31 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2007-07-02 08:37:31 +0000 |
commit | 7f1b560b27b156a25d45d8724e78383513847543 (patch) | |
tree | cc669b7460bb0d3d5428df07e0a0d3b4cef90d96 /devel/libcoro/files | |
parent | 2104d78f03a72908cfc078f5fb2382298ad8bafa (diff) |
Notes
Diffstat (limited to 'devel/libcoro/files')
-rw-r--r-- | devel/libcoro/files/patch-aa | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/devel/libcoro/files/patch-aa b/devel/libcoro/files/patch-aa index e3bb6caeb2d3..b87ec116ac8d 100644 --- a/devel/libcoro/files/patch-aa +++ b/devel/libcoro/files/patch-aa @@ -1,7 +1,15 @@ -diff -u arch/x86-freebsd/coro.c arch/x86-freebsd/coro.c --- arch/x86-freebsd/coro.c Fri Jun 23 00:15:18 2000 +++ arch/x86-freebsd/coro.c Fri Jun 23 00:16:38 2000 -@@ -63,7 +63,7 @@ +@@ -53,6 +53,8 @@ + co_create(void *func, void *stack, int size) + { + struct coroutine *co; ++ intptr_t _co; ++ void **sp; + int to_free = 0; + + if (size < 128) +@@ -63,14 +65,15 @@ size += 4096-1; size &= ~(4096-1); stack = mmap(0, size, PROT_READ|PROT_WRITE, @@ -10,5 +18,31 @@ diff -u arch/x86-freebsd/coro.c arch/x86-freebsd/coro.c if (stack == (void*)-1) return 0; -Only in arch/x86-freebsd: coro.o -Only in arch/x86-freebsd: libcoro.a + to_free = size; + } + co = stack + size; +- (unsigned long)co &= ~3; ++ _co = (intptr_t)co & ~3; ++ co = (struct coroutine *)_co; + co -= 1; + + co->sp = co; +@@ -80,11 +83,13 @@ + co->func = func; + co->to_free = to_free; + +- *--(void **)co->sp = wrap; // return addr (here: start addr) +- *--(void **)co->sp = 0; // ebp +- *--(void **)co->sp = 0; // ebx +- *--(void **)co->sp = 0; // esi +- *--(void **)co->sp = 0; // edi ++ sp = (void **)co->sp; ++ ++ *--sp = wrap; // return addr (here: start addr) ++ *--sp = 0; // ebp ++ *--sp = 0; // ebx ++ *--sp = 0; // esi ++ *--sp = 0; // edi + return co; + } + |