- Timestamp:
- Aug 31, 2020, 5:23:49 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d3aa64f1
- Parents:
- 191a190 (diff), 942453a (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:
- libcfa
- Files:
-
- 1 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/prelude/Makefile.am
r191a190 r49a980b 22 22 cfalibdir = ${CFA_LIBDIR} 23 23 cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c defines.hfa 24 25 EXTRA_DIST = bootloader.cf builtins.c builtins.def extras.c extras.regx extras.regx2 prelude-gen.cc prototypes.awk prototypes.c prototypes.sed sync-builtins.cf 24 26 25 27 CC = @LOCAL_CFACC@ -
libcfa/src/Makefile.am
r191a190 r49a980b 31 31 # AM_CFAFLAGS for only cfa source 32 32 # use -no-include-stdhdr to prevent rebuild cycles 33 # The built sources must not depend on the installed headers34 AM_CFAFLAGS = -quiet -cfalib -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@33 # The built sources must not depend on the installed inst_headers_src 34 AM_CFAFLAGS = -quiet -cfalib -I$(srcdir)/stdhdr -I$(srcdir)/concurrency $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@ 35 35 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC -fexceptions -pthread @ARCH_FLAGS@ @CONFIG_CFLAGS@ 36 36 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ … … 39 39 #---------------------------------------------------------------------------------------------------------------- 40 40 if BUILDLIB 41 headers_nosrc = bitmanip.hfa exception.hfa math.hfa gmp.hfa time_t.hfa clock.hfa \ 42 bits/align.hfa bits/containers.hfa bits/defs.hfa bits/debug.hfa bits/locks.hfa \ 43 containers/list.hfa containers/stackLockFree.hfa concurrency/iofwd.hfa 41 inst_headers_nosrc = \ 42 bitmanip.hfa \ 43 clock.hfa \ 44 exception.hfa \ 45 gmp.hfa \ 46 math.hfa \ 47 time_t.hfa \ 48 bits/align.hfa \ 49 bits/containers.hfa \ 50 bits/debug.hfa \ 51 bits/defs.hfa \ 52 bits/locks.hfa \ 53 concurrency/iofwd.hfa \ 54 containers/list.hfa \ 55 containers/stackLockFree.hfa 44 56 45 headers = common.hfa fstream.hfa heap.hfa iostream.hfa iterator.hfa limits.hfa rational.hfa \ 46 time.hfa stdlib.hfa parseargs.hfa \ 47 containers/maybe.hfa containers/pair.hfa containers/result.hfa containers/vector.hfa 57 inst_headers_src = \ 58 common.hfa \ 59 fstream.hfa \ 60 heap.hfa \ 61 iostream.hfa \ 62 iterator.hfa \ 63 limits.hfa \ 64 parseargs.hfa \ 65 rational.hfa \ 66 stdlib.hfa \ 67 time.hfa \ 68 containers/maybe.hfa \ 69 containers/pair.hfa \ 70 containers/result.hfa \ 71 containers/vector.hfa 48 72 49 libsrc = startup.cfa interpose.cfa bits/debug.cfa assert.cfa exception.c virtual.c ${headers:.hfa=.cfa} 73 libsrc = ${inst_headers_src} ${inst_headers_src:.hfa=.cfa} \ 74 assert.cfa \ 75 bits/algorithm.hfa \ 76 bits/debug.cfa \ 77 exception.c \ 78 exception.h \ 79 interpose.cfa \ 80 lsda.h \ 81 startup.cfa \ 82 startup.hfa \ 83 virtual.c \ 84 virtual.h 50 85 51 86 # not all platforms support concurrency, add option do disable it 52 thread_headers_nosrc = bits/random.hfa concurrency/invoke.h concurrency/kernel/fwd.hfa 87 inst_thread_headers_nosrc = \ 88 bits/random.hfa \ 89 concurrency/invoke.h \ 90 concurrency/kernel/fwd.hfa 53 91 54 thread_headers = concurrency/coroutine.hfa concurrency/thread.hfa concurrency/kernel.hfa \ 55 concurrency/monitor.hfa concurrency/mutex.hfa concurrency/exception.hfa 92 inst_thread_headers_src = \ 93 concurrency/coroutine.hfa \ 94 concurrency/exception.hfa \ 95 concurrency/kernel.hfa \ 96 concurrency/monitor.hfa \ 97 concurrency/mutex.hfa \ 98 concurrency/thread.hfa 56 99 57 thread_libsrc = concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa \ 58 concurrency/invoke.c concurrency/io.cfa concurrency/iocall.cfa \ 59 concurrency/io/setup.cfa \ 60 concurrency/kernel/startup.cfa concurrency/preemption.cfa \ 61 concurrency/ready_queue.cfa concurrency/stats.cfa \ 62 ${thread_headers:.hfa=.cfa} 100 thread_libsrc = ${inst_thread_headers_src} ${inst_thread_headers_src:.hfa=.cfa} \ 101 bits/signal.hfa \ 102 concurrency/alarm.cfa \ 103 concurrency/alarm.hfa \ 104 concurrency/CtxSwitch-@ARCHITECTURE@.S \ 105 concurrency/invoke.c \ 106 concurrency/io.cfa \ 107 concurrency/io/setup.cfa \ 108 concurrency/io/types.hfa \ 109 concurrency/iocall.cfa \ 110 concurrency/iofwd.hfa \ 111 concurrency/kernel_private.hfa \ 112 concurrency/kernel/startup.cfa \ 113 concurrency/preemption.cfa \ 114 concurrency/preemption.hfa \ 115 concurrency/ready_queue.cfa \ 116 concurrency/ready_subqueue.hfa \ 117 concurrency/snzi.hfa \ 118 concurrency/stats.cfa \ 119 concurrency/stats.hfa \ 120 concurrency/stats.hfa 121 63 122 else 64 headers=65 thread_headers=66 headers_nosrc =67 thread_headers_nosrc =123 inst_headers_src = 124 inst_thread_headers_src = 125 inst_headers_nosrc = 126 inst_thread_headers_nosrc = 68 127 libsrc = 69 128 endif … … 115 174 116 175 #---------------------------------------------------------------------------------------------------------------- 117 libcfa_la_SOURCES = prelude.cfa ${libsrc} 176 libcfa_la_SOURCES = ${libsrc} 177 nodist_libcfa_la_SOURCES = prelude.cfa 118 178 libcfa_la_LDFLAGS = -version-info @CFA_VERSION@ 119 179 … … 124 184 125 185 cfa_includedir = $(CFA_INCDIR) 126 nobase_cfa_include_HEADERS = ${stdhdr} ${headers} ${headers_nosrc} ${thread_headers} ${thread_headers_nosrc} 186 nobase_cfa_include_HEADERS = ${stdhdr} ${inst_headers_src} ${inst_headers_nosrc} ${inst_thread_headers_src} ${inst_thread_headers_nosrc} 187 EXTRA_DIST = stdhdr 127 188 128 189 #---------------------------------------------------------------------------------------------------------------- -
libcfa/src/bits/defs.hfa
r191a190 r49a980b 10 10 // Created On : Thu Nov 9 13:24:10 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 13 22:00:23202013 // Update Count : 1912 // Last Modified On : Wed Aug 26 16:22:32 2020 13 // Update Count : 20 14 14 // 15 15 … … 49 49 50 50 static inline long long int rdtscl(void) { 51 #if defined( __aarch64__ ) 51 #if defined( __i386 ) || defined( __x86_64 ) 52 unsigned int lo, hi; 53 __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); 54 return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 ); 55 #elif defined( __aarch64__ ) || defined( __arm__ ) 52 56 // https://github.com/google/benchmark/blob/v1.1.0/src/cycleclock.h#L116 53 57 long long int virtual_timer_value; … … 55 59 return virtual_timer_value; 56 60 #else 57 unsigned int lo, hi; 58 __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); 59 return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 ); 61 #error unsupported hardware architecture 60 62 #endif // __ARM_ARCH 61 63 } -
libcfa/src/concurrency/CtxSwitch-arm64.S
r191a190 r49a980b 2 2 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 3 3 // 4 // CtxSwitch-arm .S --4 // CtxSwitch-arm64.S -- 5 5 // 6 6 // Author : Peter A. Buhr 7 7 // Created On : Sun Aug 16 07:50:13 2020 8 8 // Last Modified By : Peter A. Buhr 9 // Last Modified On : Thu Aug 20 18:43:51202010 // Update Count : 2 49 // Last Modified On : Wed Aug 26 16:24:59 2020 10 // Update Count : 25 11 11 // 12 12 … … 26 26 #define SAVE 20 * 8 27 27 28 .file "CtxSwitch-arm .S"28 .file "CtxSwitch-arm64.S" 29 29 .text 30 30 .align 2 31 31 .global __cfactx_switch 32 .type __cfactx_switch, @function32 .type __cfactx_switch, %function 33 33 __cfactx_switch: 34 34 … … 91 91 .align 2 92 92 .global __cfactx_invoke_stub 93 .type __cfactx_invoke_stub, @function93 .type __cfactx_invoke_stub, %function 94 94 __cfactx_invoke_stub: 95 95 mov x0, x19 // load main as parameter 0 -
libcfa/src/concurrency/kernel.cfa
r191a190 r49a980b 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 14 15:23:00 202013 // Update Count : 6912 // Last Modified On : Mon Aug 31 07:08:20 2020 13 // Update Count : 71 14 14 // 15 15 … … 74 74 ) 75 75 76 #elif defined( __ARM_ARCH ) 76 #elif defined( __arm__ ) 77 #define __x87_store 78 #define __x87_load 79 80 #elif defined( __aarch64__ ) 77 81 #define __x87_store \ 78 82 uint32_t __fpcntl[2]; \ … … 93 97 94 98 #else 95 #error un knownhardware architecture99 #error unsupported hardware architecture 96 100 #endif 97 101 -
libcfa/src/concurrency/preemption.cfa
r191a190 r49a980b 10 10 // Created On : Mon Jun 5 14:20:42 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 21 13:45:32202013 // Update Count : 5 212 // Last Modified On : Wed Aug 26 16:46:03 2020 13 // Update Count : 53 14 14 // 15 15 … … 56 56 #elif defined( __x86_64 ) 57 57 #define CFA_REG_IP gregs[REG_RIP] 58 #elif defined( __ARM_ARCH ) 58 #elif defined( __arm__ ) 59 #define CFA_REG_IP arm_pc 60 #elif defined( __aarch64__ ) 59 61 #define CFA_REG_IP pc 60 62 #else 61 #error un knownhardware architecture63 #error unsupported hardware architecture 62 64 #endif 63 65 -
libcfa/src/exception.c
r191a190 r49a980b 10 10 // Created On : Mon Jun 26 15:13:00 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 21 11:27:56202013 // Update Count : 2912 // Last Modified On : Sat Aug 29 15:52:22 2020 13 // Update Count : 34 14 14 // 15 15 … … 18 18 19 19 #include "exception.h" 20 21 // Implementation of the secret header is hardware dependent.22 #if defined( __x86_64 ) || defined( __i386 )23 #elif defined( __ARM_ARCH )24 #warning FIX ME: check if anything needed for ARM25 #else26 #warning Exception Handling: No known architecture detected.27 #endif28 20 29 21 #include <stdlib.h> … … 34 26 #include "stdhdr/assert.h" 35 27 36 // FIX ME: temporary hack to keep ARM build working 28 #if defined( __ARM_ARCH ) 29 #warning FIX ME: temporary hack to keep ARM build working 37 30 #ifndef _URC_FATAL_PHASE1_ERROR 38 31 #define _URC_FATAL_PHASE1_ERROR 3 … … 41 34 #define _URC_FATAL_PHASE2_ERROR 2 42 35 #endif // ! _URC_FATAL_PHASE2_ERROR 36 #endif // __ARM_ARCH 43 37 44 38 #include "lsda.h" … … 626 620 627 621 #pragma GCC pop_options 622 623 #elif defined( __ARM_ARCH ) 624 _Unwind_Reason_Code __gcfa_personality_v0( 625 int version, 626 _Unwind_Action actions, 627 unsigned long long exception_class, 628 struct _Unwind_Exception * unwind_exception, 629 struct _Unwind_Context * unwind_context) { 630 return _URC_CONTINUE_UNWIND; 631 } 632 633 __attribute__((noinline)) 634 void __cfaehm_try_terminate(void (*try_block)(), 635 void (*catch_block)(int index, exception_t * except), 636 __attribute__((unused)) int (*match_block)(exception_t * except)) { 637 } 638 #else 639 #error unsupported hardware architecture 628 640 #endif // __x86_64 || __i386
Note:
See TracChangeset
for help on using the changeset viewer.