Ignore:
Timestamp:
Jan 20, 2021, 4:40:28 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
dafbde8
Parents:
78a8440
Message:

Revisited abort again to be more streamlined and simple.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel.cfa

    r78a8440 r92bfda0  
    624624// Unexpected Terminating logic
    625625//=============================================================================================
    626 
    627 extern "C" {
    628         extern void __cfaabi_real_abort(void);
    629 }
    630 static volatile bool kernel_abort_called = false;
    631 
    632 void * kernel_abort(void) __attribute__ ((__nothrow__)) {
    633         // abort cannot be recursively entered by the same or different processors because all signal handlers return when
    634         // the globalAbort flag is true.
    635         bool first = !__atomic_test_and_set( &kernel_abort_called, __ATOMIC_SEQ_CST);
    636 
    637         // first task to abort ?
    638         if ( !first ) {
    639                 // We aren't the first to abort.
    640                 // I give up, just let C handle it
    641                 __cfaabi_real_abort();
    642         }
    643 
    644         // disable interrupts, it no longer makes sense to try to interrupt this processor
    645         disable_interrupts();
    646 
    647         return __cfaabi_tls.this_thread;
    648 }
    649 
    650 void kernel_abort_msg( void * kernel_data, char * abort_text, int abort_text_size ) {
    651         $thread * thrd = ( $thread * ) kernel_data;
     626void __kernel_abort_msg( char * abort_text, int abort_text_size ) {
     627        $thread * thrd = __cfaabi_tls.this_thread;
    652628
    653629        if(thrd) {
     
    669645}
    670646
    671 int kernel_abort_lastframe( void ) __attribute__ ((__nothrow__)) {
    672         return get_coroutine(kernelTLS().this_thread) == get_coroutine(mainThread) ? 4 : 2;
     647int __kernel_abort_lastframe( void ) __attribute__ ((__nothrow__)) {
     648        return get_coroutine(__cfaabi_tls.this_thread) == get_coroutine(mainThread) ? 4 : 2;
    673649}
    674650
Note: See TracChangeset for help on using the changeset viewer.