4 ; Basic coroutine handling
6 ; © 1994-1998 Straylight
9 ;----- Licensing note -------------------------------------------------------
11 ; This file is part of Straylight's Sapphire library.
13 ; Sapphire is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
18 ; Sapphire is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ; GNU General Public License for more details.
23 ; You should have received a copy of the GNU General Public License
24 ; along with Sapphire. If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 ;----- Overview -------------------------------------------------------------
36 [ :LNOT::DEF:coRoutine__dfn
39 ; --- coRout_create ---
41 ; On entry: R0 == pointer to coroutine
42 ; R1 == R10 value to pass to coroutine
43 ; R2 == R12 value to pass to coroutine
44 ; R3 == size of stack to pass (0 for default)
46 ; On exit: R0 == coroutine handle
49 ; Use: Creates a new coroutine. It may be given control using
50 ; coRout_switch. Its registers are on entry:
52 ; R0 == its coroutine handle
53 ; R10 == value passed to coRout_create in R1
54 ; R12 == value passed to coRout_create in R2
55 ; R13 == pointer to the stack created for it
59 ; --- coRout_switch ---
61 ; On entry: R0 == coroutine to switch to, or 0 for main
65 ; Use: Switches context to another coroutine.
69 ; --- coRout_destroy ---
71 ; On entry: R0 == coroutine handle to destroy
75 ; Use: Destroys a coroutine.
85 ; Use: Terminates the current coroutine.
91 ;----- That's all, folks ----------------------------------------------------