Changeset 3489ea6
- Timestamp:
- Jun 15, 2021, 5:18:59 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 3814957
- Parents:
- 5e2ed05
- Location:
- libcfa/src/concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel/startup.cfa
r5e2ed05 r3489ea6 137 137 }; 138 138 139 #if defined(CFA_HAVE_LINUX_LIBRSEQ) 140 // No data needed 141 #elif defined(CFA_HAVE_LINUX_RSEQ_H) 142 extern "Cforall" { 143 thread_local volatile struct rseq __cfaabi_rseq; 144 } 145 #else 146 // No data needed 147 #endif 148 139 149 //----------------------------------------------------------------------------- 140 150 // Struct to steal stack -
libcfa/src/concurrency/kernel_private.hfa
r5e2ed05 r3489ea6 16 16 #pragma once 17 17 18 #if !defined(__cforall_thread__) 19 #error kernel_private.hfa should only be included in libcfathread source 20 #endif 21 18 22 #include "kernel.hfa" 19 23 #include "thread.hfa" … … 22 26 #include "stats.hfa" 23 27 28 extern "C" { 29 #if defined(CFA_HAVE_LINUX_LIBRSEQ) 30 #include <rseq/rseq.h> 31 #elif defined(CFA_HAVE_LINUX_RSEQ_H) 32 #include <linux/rseq.h> 33 #else 34 #ifndef _GNU_SOURCE 35 #error kernel_private requires gnu_source 36 #endif 37 #include <sched.h> 38 #endif 39 } 40 24 41 //----------------------------------------------------------------------------- 25 42 // Scheduler 26 27 28 43 extern "C" { 29 44 void disable_interrupts() OPTIONAL_THREAD; … … 39 54 40 55 //----------------------------------------------------------------------------- 56 // Hardware 57 58 #if defined(CFA_HAVE_LINUX_LIBRSEQ) 59 // No data needed 60 #elif defined(CFA_HAVE_LINUX_RSEQ_H) 61 extern "Cforall" { 62 extern __attribute__((aligned(128))) thread_local volatile struct rseq __cfaabi_rseq; 63 } 64 #else 65 // No data needed 66 #endif 67 68 static inline int __kernel_getcpu() { 69 /* paranoid */ verify( ! __preemption_enabled() ); 70 #if defined(CFA_HAVE_LINUX_LIBRSEQ) 71 return rseq_current_cpu_raw(); 72 #elif defined(CFA_HAVE_LINUX_RSEQ_H) 73 return __cfaabi_rseq.cpu_id; 74 #else 75 return sched_getcpu(); 76 #endif 77 } 78 79 //----------------------------------------------------------------------------- 41 80 // Processor 42 81 void main(processorCtx_t *); … … 44 83 void * __create_pthread( pthread_t *, void * (*)(void *), void * ); 45 84 void __destroy_pthread( pthread_t pthread, void * stack, void ** retval ); 46 47 48 85 49 86 extern cluster * mainCluster;
Note: See TracChangeset
for help on using the changeset viewer.