Changeset 6e0f4bd for src/libcfa/concurrency
- Timestamp:
- Jan 25, 2018, 1:00:12 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- dbe9b08
- Parents:
- f7d6bb0 (diff), b6ec245 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/libcfa/concurrency
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/invoke.c
rf7d6bb0 r6e0f4bd 10 10 // Created On : Tue Jan 17 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 21 22:28:33 201713 // Update Count : 112 // Last Modified On : Tue Jan 23 14:04:56 2018 13 // Update Count : 2 14 14 // 15 15 … … 133 133 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->mxcr = 0x1F80; //Vol. 2A 3-520 134 134 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fcw = 0x037F; //Vol. 1 8-7 135 136 #elif defined( __ARM_ARCH ) 137 138 struct FakeStack { 139 float fpRegs[16]; // floating point registers 140 void *intRegs[9]; // integer/pointer registers 141 void *arg[2]; // placeholder for this pointer 142 }; 143 144 ((struct machine_context_t *)stack->context)->SP = (char *)stack->base - sizeof( struct FakeStack ); 145 ((struct machine_context_t *)stack->context)->FP = NULL; 146 147 struct FakeStack *fs = (struct FakeStack *)((struct machine_context_t *)stack->context)->SP; 148 149 fs->intRegs[8] = CtxInvokeStub; 150 fs->arg[0] = this; 151 fs->arg[1] = invoke; 135 152 #else 136 153 #error Only __i386__ and __x86_64__ is supported for threads in cfa -
src/libcfa/concurrency/invoke.h
rf7d6bb0 r6e0f4bd 10 10 // Created On : Tue Jan 17 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 21 22:28:56 201713 // Update Count : 112 // Last Modified On : Tue Jan 23 14:55:46 2018 13 // Update Count : 3 14 14 // 15 15 … … 209 209 "movl %%ebp,%1\n" \ 210 210 : "=rm" (ctx.SP), "=rm" (ctx.FP) ) 211 #elif defined( __ARM_ARCH ) 212 #define CtxGet( ctx ) __asm__ ( \ 213 "mov %0,%%sp\n" \ 214 "mov %1,%%r11\n" \ 215 : "=rm" (ctx.SP), "=rm" (ctx.FP) ) 211 216 #endif 212 217 -
src/libcfa/concurrency/kernel.c
rf7d6bb0 r6e0f4bd 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 21 22:33:18201713 // Update Count : 212 // Last Modified On : Fri Dec 8 16:23:33 2017 13 // Update Count : 3 14 14 // 15 15 16 16 //C Includes 17 17 #include <stddef.h> 18 #define ftype `ftype` 18 19 extern "C" { 19 20 #include <stdio.h> … … 23 24 #include <unistd.h> 24 25 } 26 #undef ftype 25 27 26 28 //CFA Includes -
src/libcfa/concurrency/preemption.c
rf7d6bb0 r6e0f4bd 10 10 // Created On : Mon Jun 5 14:20:42 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 21 22:36:05 201713 // Update Count : 212 // Last Modified On : Tue Jan 23 17:59:30 2018 13 // Update Count : 7 14 14 // 15 15 16 16 #include "preemption.h" 17 17 18 #define ftype `ftype` 18 19 extern "C" { 19 20 #include <errno.h> … … 26 27 #include <unistd.h> 27 28 } 28 29 #undef ftype 29 30 30 31 #ifdef __USE_STREAM__ … … 60 61 61 62 // Machine specific register name 62 #if def __x86_64__63 #if defined(__x86_64__) 63 64 #define CFA_REG_IP REG_RIP 64 #el se65 #elif defined(__i386__) 65 66 #define CFA_REG_IP REG_EIP 67 #elif defined(__ARM_ARCH__) 68 #define CFA_REG_IP REG_R15 66 69 #endif 67 70 … … 296 299 // Receives SIGUSR1 signal and causes the current thread to yield 297 300 void sigHandler_ctxSwitch( __CFA_SIGPARMS__ ) { 301 #if defined( __ARM_ARCH ) 302 __cfaabi_dbg_debug_do( last_interrupt = (void *)(cxt->uc_mcontext.arm_pc); ) 303 #else 298 304 __cfaabi_dbg_debug_do( last_interrupt = (void *)(cxt->uc_mcontext.gregs[CFA_REG_IP]); ) 299 300 // Check if it is safe to preempt here 305 #endif 306 307 // Check if it is safe to preempt here 301 308 if( !preemption_ready() ) { return; } 302 309
Note: See TracChangeset
for help on using the changeset viewer.