Changeset c59a346


Ignore:
Timestamp:
Apr 29, 2020, 3:49:30 PM (17 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
f6660520
Parents:
44aad8f
Message:

Minor fixes to I/O

Location:
libcfa/src
Files:
3 edited

Legend:

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

    r44aad8f rc59a346  
    5454                        sig, handler, flags, errno, strerror( errno )
    5555                );
    56                 _exit( EXIT_FAILURE );
     56                _Exit( EXIT_FAILURE );
    5757        } // if
    5858}
  • libcfa/src/concurrency/io.cfa

    r44aad8f rc59a346  
    7575       #endif
    7676
    77 
    7877//=============================================================================================
    7978// I/O Startup / Shutdown logic
     
    150149                sq.array   = (         uint32_t *)(((intptr_t)sq.ring_ptr) + params.sq_off.array);
    151150                sq.alloc = *sq.tail;
     151                sq.ready = *sq.tail;
    152152
    153153                // completion queue
     
    190190        void __kernel_io_shutdown( cluster & this ) {
    191191                // Stop the IO Poller
     192                #if __CFA_IO_POLLING__ == __CFA_IO_POLLING_NAIVE__
    192193                // Notify the poller thread of the shutdown
    193194                __atomic_store_n(&this.io.done, true, __ATOMIC_SEQ_CST);
     
    245246        // Process a single completion message from the io_uring
    246247        // This is NOT thread-safe
    247         int __drain_io( struct io_ring & ring, sigset_t & mask, int waitcnt ) {
     248        static int __drain_io( struct io_ring & ring, sigset_t & mask, int waitcnt ) {
    248249                int ret = syscall( __NR_io_uring_enter, ring.fd, 0, waitcnt, IORING_ENTER_GETEVENTS, &mask, _NSIG / 8);
    249250                if( ret < 0 ) {
  • libcfa/src/concurrency/preemption.cfa

    r44aad8f rc59a346  
    4343// FwdDeclarations : Signal handlers
    4444static void sigHandler_ctxSwitch( __CFA_SIGPARMS__ );
     45static void sigHandler_alarm    ( __CFA_SIGPARMS__ );
    4546static void sigHandler_segv     ( __CFA_SIGPARMS__ );
    4647static void sigHandler_ill      ( __CFA_SIGPARMS__ );
     
    256257
    257258        if ( pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) {
    258             abort( "internal error, pthread_sigmask" );
     259                abort( "internal error, pthread_sigmask" );
    259260        }
    260261}
     
    303304        // Setup proper signal handlers
    304305        __cfaabi_sigaction( SIGUSR1, sigHandler_ctxSwitch, SA_SIGINFO | SA_RESTART ); // __cfactx_switch handler
     306        __cfaabi_sigaction( SIGALRM, sigHandler_alarm    , SA_SIGINFO | SA_RESTART ); // debug handler
    305307
    306308        signal_block( SIGALRM );
     
    394396
    395397        force_yield( __ALARM_PREEMPTION ); // Do the actual __cfactx_switch
     398}
     399
     400static void sigHandler_alarm( __CFA_SIGPARMS__ ) {
     401        abort("SIGALRM should never reach the signal handler");
    396402}
    397403
Note: See TracChangeset for help on using the changeset viewer.