Changeset b2f6113 for libcfa/src/concurrency/invoke.c
- Timestamp:
- Apr 4, 2019, 3:37:55 PM (7 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, stuck-waitfor-destruct
- Children:
- 8c01e1b
- Parents:
- 2fabdc02
- File:
-
- 1 edited
-
libcfa/src/concurrency/invoke.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/invoke.c
r2fabdc02 rb2f6113 122 122 void (*invoke)(void *) 123 123 ) { 124 struct coStack_t* stack = &get_coroutine( this )->stack; 124 struct coroutine_desc * cor = get_coroutine( this ); 125 struct __stack_t * stack = cor->stack.storage; 125 126 126 127 #if defined( __i386 ) … … 136 137 }; 137 138 138 ((struct machine_context_t *)stack->context)->SP = (char *)stack->base - sizeof( struct FakeStack );139 ((struct machine_context_t *)stack->context)->FP = NULL; // terminate stack with NULL fp139 cor->context.SP = (char *)stack->base - sizeof( struct FakeStack ); 140 cor->context.FP = NULL; // terminate stack with NULL fp 140 141 141 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->dummyReturn = NULL; 142 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->argument[0] = this; // argument to invoke 143 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->rturn = invoke; 144 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->mxcr = 0x1F80; //Vol. 2A 3-520 145 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fcw = 0x037F; //Vol. 1 8-7 142 struct FakeStack *fs = (struct FakeStack *)cor->context.SP; 143 144 fs->dummyReturn = NULL; 145 fs->argument[0] = this; // argument to invoke 146 fs->rturn = invoke; 147 fs->mxcr = 0x1F80; //Vol. 2A 3-520 148 fs->fcw = 0x037F; //Vol. 1 8-7 146 149 147 150 #elif defined( __x86_64 ) … … 155 158 }; 156 159 157 ((struct machine_context_t *)stack->context)->SP = (char *)stack->base - sizeof( struct FakeStack );158 ((struct machine_context_t *)stack->context)->FP = NULL; // terminate stack with NULL fp160 cor->context.SP = (char *)stack->base - sizeof( struct FakeStack ); 161 cor->context.FP = NULL; // terminate stack with NULL fp 159 162 160 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->dummyReturn = NULL; 161 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->rturn = CtxInvokeStub; 162 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[0] = this; 163 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[1] = invoke; 164 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->mxcr = 0x1F80; //Vol. 2A 3-520 165 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fcw = 0x037F; //Vol. 1 8-7 163 struct FakeStack *fs = (struct FakeStack *)cor->context.SP; 164 165 fs->dummyReturn = NULL; 166 fs->rturn = CtxInvokeStub; 167 fs->fixedRegisters[0] = this; 168 fs->fixedRegisters[1] = invoke; 169 fs->mxcr = 0x1F80; //Vol. 2A 3-520 170 fs->fcw = 0x037F; //Vol. 1 8-7 166 171 167 172 #elif defined( __ARM_ARCH ) … … 173 178 }; 174 179 175 ((struct machine_context_t *)stack->context)->SP = (char *)stack->base - sizeof( struct FakeStack );176 ((struct machine_context_t *)stack->context)->FP = NULL;180 cor->context.SP = (char *)stack->base - sizeof( struct FakeStack ); 181 cor->context.FP = NULL; 177 182 178 struct FakeStack *fs = (struct FakeStack *) ((struct machine_context_t *)stack->context)->SP;183 struct FakeStack *fs = (struct FakeStack *)cor->context.SP; 179 184 180 185 fs->intRegs[8] = CtxInvokeStub;
Note:
See TracChangeset
for help on using the changeset viewer.