Changeset b2f6113 for libcfa/src/concurrency/invoke.h
- Timestamp:
- Apr 4, 2019, 3:37:55 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8c01e1b
- Parents:
- 2fabdc02
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/invoke.h
r2fabdc02 rb2f6113 62 62 #endif 63 63 64 struct coStack_t { 65 size_t size; // size of stack 66 void * storage; // pointer to stack 67 void * limit; // stack grows towards stack limit 68 void * base; // base of stack 69 void * context; // address of cfa_context_t 70 void * top; // address of top of storage 71 bool userStack; // whether or not the user allocated the stack 64 struct __stack_context_t { 65 void * SP; 66 67 void * FP; 68 // copy of global UNIX variable errno 69 int errno_; 70 }; 71 72 // low adresses : +----------------------+ <- start of allocation 73 // | optional guard page | 74 // +----------------------+ <- __stack_t.limit 75 // | | 76 // | /\ /\ /\ | 77 // | || || || | 78 // | | 79 // | program stack | 80 // | | 81 // __stack_info_t.storage -> +----------------------+ <- __stack_t.base 82 // | __stack_t | 83 // high adresses : +----------------------+ <- end of allocation 84 85 struct __stack_t { 86 // size of stack 87 size_t size; 88 89 // stack grows towards stack limit 90 void * limit; 91 92 // base of stack 93 void * base; 94 }; 95 96 struct __stack_info_t { 97 // pointer to stack 98 struct __stack_t * storage; 99 100 // whether or not the user allocated the stack 101 bool userStack; 72 102 }; 73 103 … … 75 105 76 106 struct coroutine_desc { 107 // context that is switch during a CtxSwitch 108 struct __stack_context_t context; 109 77 110 // stack information of the coroutine 78 struct coStack_t stack;111 struct __stack_info_t stack; 79 112 80 113 // textual name for coroutine/task, initialized by uC++ generated code 81 114 const char * name; 82 115 83 // copy of global UNIX variable errno84 int errno_;85 86 116 // current execution status for coroutine 87 117 enum coroutine_state state; 118 88 119 // first coroutine to resume this one 89 120 struct coroutine_desc * starter; … … 230 261 // assembler routines that performs the context switch 231 262 extern void CtxInvokeStub( void ); 232 void CtxSwitch( void * from, void* to ) asm ("CtxSwitch");263 void CtxSwitch( struct __stack_context_t * from, struct __stack_context_t * to ) asm ("CtxSwitch"); 233 264 // void CtxStore ( void * this ) asm ("CtxStore"); 234 265 // void CtxRet ( void * dst ) asm ("CtxRet");
Note: See TracChangeset
for help on using the changeset viewer.