Changes in / [c916e12:764b4b2]
- Location:
- src/libcfa
- Files:
-
- 1 deleted
- 5 edited
-
bits/locks.h (modified) (4 diffs)
-
concurrency/CtxSwitch-armv7l.S (deleted)
-
concurrency/invoke.c (modified) (2 diffs)
-
concurrency/invoke.h (modified) (2 diffs)
-
concurrency/kernel.c (modified) (2 diffs)
-
concurrency/preemption.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/bits/locks.h
rc916e12 r764b4b2 9 9 // Author : Thierry Delisle 10 10 // Created On : Tue Oct 31 15:14:38 2017 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Dec 8 16:02:22 201713 // Update Count : 111 // Last Modified By : -- 12 // Last Modified On : -- 13 // Update Count : 0 14 14 // 15 15 … … 24 24 #elif defined( __i386 ) || defined( __x86_64 ) 25 25 #define Pause() __asm__ __volatile__ ( "pause" : : : ) 26 #elif defined( __ARM_ARCH )27 #define Pause() __asm__ __volatile__ ( "nop" : : : )28 26 #else 29 27 #error unsupported architecture 30 28 #endif 31 29 32 #if defined( __i386 ) || defined( __x86_64 ) || defined( __ARM_ARCH )30 #if defined( __i386 ) || defined( __x86_64 ) 33 31 // Intel recommendation 34 32 #define __ALIGN__ __attribute__(( aligned (128) )) … … 39 37 #endif 40 38 41 #if __SIZEOF_SIZE_T__ == 839 #if defined( __x86_64 ) 42 40 #define __lock_test_and_test_and_set( lock ) (lock) == 0 && __sync_lock_test_and_set_8( &(lock), 1 ) == 0 43 41 #define __lock_release( lock ) __sync_lock_release_8( &(lock) ); 44 #elif __SIZEOF_SIZE_T__ == 442 #elif defined( __i386 ) 45 43 #define __lock_test_and_test_and_set( lock ) (lock) == 0 && __sync_lock_test_and_set_4( &(lock), 1 ) == 0 46 44 #define __lock_release( lock ) __sync_lock_release_4( &(lock) ); … … 50 48 51 49 struct __spinlock_t { 52 __ALIGN__ volatile size_t lock;50 __ALIGN__ volatile uintptr_t lock; 53 51 #ifdef __CFA_DEBUG__ 54 52 const char * prev_name; -
src/libcfa/concurrency/invoke.c
rc916e12 r764b4b2 10 10 // Created On : Tue Jan 17 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jan 23 14:04:56 201813 // Update Count : 212 // Last Modified On : Fri Jul 21 22:28:33 2017 13 // Update Count : 1 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 registers140 void *intRegs[9]; // integer/pointer registers141 void *arg[2]; // placeholder for this pointer142 };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;152 135 #else 153 136 #error Only __i386__ and __x86_64__ is supported for threads in cfa -
src/libcfa/concurrency/invoke.h
rc916e12 r764b4b2 10 10 // Created On : Tue Jan 17 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jan 23 14:55:46 201813 // Update Count : 312 // Last Modified On : Fri Jul 21 22:28:56 2017 13 // Update Count : 1 14 14 // 15 15 … … 203 203 "movl %%ebp,%1\n" \ 204 204 : "=rm" (ctx.SP), "=rm" (ctx.FP) ) 205 #elif defined( __ARM_ARCH )206 #define CtxGet( ctx ) __asm__ ( \207 "mov %0,%%sp\n" \208 "mov %1,%%r11\n" \209 : "=rm" (ctx.SP), "=rm" (ctx.FP) )210 205 #endif 211 206 -
src/libcfa/concurrency/kernel.c
rc916e12 r764b4b2 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 8 16:23:33201713 // Update Count : 312 // Last Modified On : Fri Jul 21 22:33:18 2017 13 // Update Count : 2 14 14 // 15 15 16 16 //C Includes 17 17 #include <stddef.h> 18 #define ftype `ftype`19 18 extern "C" { 20 19 #include <stdio.h> … … 24 23 #include <unistd.h> 25 24 } 26 #undef ftype27 25 28 26 //CFA Includes -
src/libcfa/concurrency/preemption.c
rc916e12 r764b4b2 10 10 // Created On : Mon Jun 5 14:20:42 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jan 23 17:59:30 201813 // Update Count : 712 // Last Modified On : Fri Jul 21 22:36:05 2017 13 // Update Count : 2 14 14 // 15 15 16 16 #include "preemption.h" 17 17 18 #define ftype `ftype`19 18 extern "C" { 20 19 #include <errno.h> … … 27 26 #include <unistd.h> 28 27 } 29 #undef ftype 28 30 29 31 30 #ifdef __USE_STREAM__ … … 61 60 62 61 // Machine specific register name 63 #if defined(__x86_64__)62 #ifdef __x86_64__ 64 63 #define CFA_REG_IP REG_RIP 65 #el if defined(__i386__)64 #else 66 65 #define CFA_REG_IP REG_EIP 67 #elif defined(__ARM_ARCH__)68 #define CFA_REG_IP REG_R1569 66 #endif 70 67 … … 299 296 // Receives SIGUSR1 signal and causes the current thread to yield 300 297 void sigHandler_ctxSwitch( __CFA_SIGPARMS__ ) { 301 #if defined( __ARM_ARCH )302 __cfaabi_dbg_debug_do( last_interrupt = (void *)(cxt->uc_mcontext.arm_pc); )303 #else304 298 __cfaabi_dbg_debug_do( last_interrupt = (void *)(cxt->uc_mcontext.gregs[CFA_REG_IP]); ) 305 #endif 306 307 // Check if it is safe to preempt here 299 300 // Check if it is safe to preempt here 308 301 if( !preemption_ready() ) { return; } 309 302
Note:
See TracChangeset
for help on using the changeset viewer.