Changeset 7f6a7c9 for libcfa/src/bits


Ignore:
Timestamp:
Sep 21, 2022, 11:02:15 AM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
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.
Message:

Merge branch 'master' into pthread-emulation

Location:
libcfa/src/bits
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/defs.hfa

    r428adbc r7f6a7c9  
    2525#define likely(x)   __builtin_expect(!!(x), 1)
    2626#define unlikely(x) __builtin_expect(!!(x), 0)
    27 #define thread_local _Thread_local
    2827
    2928typedef void (*fptr_t)();
     
    3837#endif
    3938
     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
    4049#define libcfa_public __attribute__((visibility("default")))
     50#define libcfa_nopreempt __attribute__((section("cfatext_nopreempt"))) __attribute__((__noinline__)) ATTRIBUTE_NOCLONE
     51
     52struct __cfa_nopreempt_region {
     53        void * start;
     54        void * stop;
     55};
    4156
    4257#ifdef __cforall
  • libcfa/src/bits/locks.hfa

    r428adbc r7f6a7c9  
    1313// Created On       : Tue Oct 31 15:14:38 2017
    1414// Last Modified By : Peter A. Buhr
    15 // Last Modified On : Wed Aug 12 14:18:07 2020
    16 // Update Count     : 13
     15// Last Modified On : Mon Sep 19 18:51:53 2022
     16// Update Count     : 17
    1717//
    1818
     
    3232                extern void disable_interrupts() OPTIONAL_THREAD;
    3333                extern void enable_interrupts( bool poll = true ) OPTIONAL_THREAD;
     34                extern bool poll_interrupts() OPTIONAL_THREAD;
    3435                #define __cfaabi_dbg_record_lock(x, y)
    3536        }
     
    5960
    6061                disable_interrupts();
    61                 for ( unsigned int i = 1;; i += 1 ) {
     62                for ( i; 1 ~ @ ) {
    6263                        if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break;
    6364                        #ifndef NOEXPBACK
    6465                                // exponential spin
    65                                 for ( volatile unsigned int s = 0; s < spin; s += 1 ) Pause();
     66                        for ( volatile unsigned int s; 0 ~ spin ) Pause();
    6667
    6768                                // slowly increase by powers of 2
Note: See TracChangeset for help on using the changeset viewer.