Changeset 7f6a7c9 for libcfa/src/bits
- Timestamp:
- Sep 21, 2022, 11:02:15 AM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 95dab9e
- Parents:
- 428adbc (diff), 0bd46fd (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/src/bits
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/defs.hfa
r428adbc r7f6a7c9 25 25 #define likely(x) __builtin_expect(!!(x), 1) 26 26 #define unlikely(x) __builtin_expect(!!(x), 0) 27 #define thread_local _Thread_local28 27 29 28 typedef void (*fptr_t)(); … … 38 37 #endif 39 38 39 40 #if defined(__has_attribute) 41 #if !__has_attribute(__noclone__) 42 #define ATTRIBUTE_NOCLONE 43 #endif 44 #endif 45 #ifndef ATTRIBUTE_NOCLONE 46 #define ATTRIBUTE_NOCLONE __attribute__((__noclone__)) 47 #endif 48 40 49 #define libcfa_public __attribute__((visibility("default"))) 50 #define libcfa_nopreempt __attribute__((section("cfatext_nopreempt"))) __attribute__((__noinline__)) ATTRIBUTE_NOCLONE 51 52 struct __cfa_nopreempt_region { 53 void * start; 54 void * stop; 55 }; 41 56 42 57 #ifdef __cforall -
libcfa/src/bits/locks.hfa
r428adbc r7f6a7c9 13 13 // Created On : Tue Oct 31 15:14:38 2017 14 14 // Last Modified By : Peter A. Buhr 15 // Last Modified On : Wed Aug 12 14:18:07 202016 // Update Count : 1 315 // Last Modified On : Mon Sep 19 18:51:53 2022 16 // Update Count : 17 17 17 // 18 18 … … 32 32 extern void disable_interrupts() OPTIONAL_THREAD; 33 33 extern void enable_interrupts( bool poll = true ) OPTIONAL_THREAD; 34 extern bool poll_interrupts() OPTIONAL_THREAD; 34 35 #define __cfaabi_dbg_record_lock(x, y) 35 36 } … … 59 60 60 61 disable_interrupts(); 61 for ( unsigned int i = 1;; i += 1) {62 for ( i; 1 ~ @ ) { 62 63 if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break; 63 64 #ifndef NOEXPBACK 64 65 // exponential spin 65 for ( volatile unsigned int s = 0; s < spin; s += 1) Pause();66 for ( volatile unsigned int s; 0 ~ spin ) Pause(); 66 67 67 68 // slowly increase by powers of 2
Note:
See TracChangeset
for help on using the changeset viewer.