Ignore:
Timestamp:
Nov 29, 2017, 2:50:33 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
875a72f
Parents:
8a0a64d9
Message:

Renamed internal stuff to cfaabi_...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/preemption.c

    r8a0a64d9 r36982fc  
    148148//=============================================================================================
    149149
    150 LIB_DEBUG_DO( static thread_local void * last_interrupt = 0; )
     150__cfaabi_dbg_debug_do( static thread_local void * last_interrupt = 0; )
    151151
    152152extern "C" {
     
    159159        // Enable interrupts by decrementing the counter
    160160        // If counter reaches 0, execute any pending CtxSwitch
    161         void enable_interrupts( DEBUG_CTX_PARAM ) {
     161        void enable_interrupts( __cfaabi_dbg_ctx_param ) {
    162162                processor * proc   = this_processor;      // Cache the processor now since interrupts can start happening after the atomic add
    163163                thread_desc * thrd = this_thread;         // Cache the thread now since interrupts can start happening after the atomic add
     
    173173
    174174                // For debugging purposes : keep track of the last person to enable the interrupts
    175                 LIB_DEBUG_DO( proc->last_enable = caller; )
     175                __cfaabi_dbg_debug_do( proc->last_enable = caller; )
    176176        }
    177177
     
    233233// Called from kernel_startup
    234234void kernel_start_preemption() {
    235         LIB_DEBUG_PRINT_SAFE("Kernel : Starting preemption\n");
     235        __cfaabi_dbg_print_safe("Kernel : Starting preemption\n");
    236236
    237237        // Start with preemption disabled until ready
     
    255255// Called from kernel_shutdown
    256256void kernel_stop_preemption() {
    257         LIB_DEBUG_PRINT_SAFE("Kernel : Preemption stopping\n");
     257        __cfaabi_dbg_print_safe("Kernel : Preemption stopping\n");
    258258
    259259        // Block all signals since we are already shutting down
     
    271271        // Preemption is now fully stopped
    272272
    273         LIB_DEBUG_PRINT_SAFE("Kernel : Preemption stopped\n");
     273        __cfaabi_dbg_print_safe("Kernel : Preemption stopped\n");
    274274}
    275275
     
    297297// Receives SIGUSR1 signal and causes the current thread to yield
    298298void sigHandler_ctxSwitch( __CFA_SIGPARMS__ ) {
    299         LIB_DEBUG_DO( last_interrupt = (void *)(cxt->uc_mcontext.gregs[CFA_REG_IP]); )
     299        __cfaabi_dbg_debug_do( last_interrupt = (void *)(cxt->uc_mcontext.gregs[CFA_REG_IP]); )
    300300
    301301        // Check if it is safe to preempt here
     
    346346                assertf(sig == SIGALRM, "Kernel Internal Error, sigwait: Unexpected signal %d (%d : %d)\n", sig, info.si_code, info.si_value.sival_int);
    347347
    348                 // LIB_DEBUG_PRINT_SAFE("Kernel : Caught alarm from %d with %d\n", info.si_code, info.si_value.sival_int );
     348                // __cfaabi_dbg_print_safe("Kernel : Caught alarm from %d with %d\n", info.si_code, info.si_value.sival_int );
    349349                // Switch on the code (a.k.a. the sender) to
    350350                switch( info.si_code )
     
    354354                case SI_TIMER:
    355355                case SI_KERNEL:
    356                         // LIB_DEBUG_PRINT_SAFE("Kernel : Preemption thread tick\n");
    357                         lock( event_kernel->lock DEBUG_CTX2 );
     356                        // __cfaabi_dbg_print_safe("Kernel : Preemption thread tick\n");
     357                        lock( event_kernel->lock __cfaabi_dbg_ctx2 );
    358358                        tick_preemption();
    359359                        unlock( event_kernel->lock );
     
    368368
    369369EXIT:
    370         LIB_DEBUG_PRINT_SAFE("Kernel : Preemption thread stopping\n");
     370        __cfaabi_dbg_print_safe("Kernel : Preemption thread stopping\n");
    371371        return NULL;
    372372}
     
    380380
    381381        if ( sigaction( sig, &act, NULL ) == -1 ) {
    382                 LIB_DEBUG_PRINT_BUFFER_DECL(
     382                __cfaabi_dbg_print_buffer_decl(
    383383                        " __kernel_sigaction( sig:%d, handler:%p, flags:%d ), problem installing signal handler, error(%d) %s.\n",
    384384                        sig, handler, flags, errno, strerror( errno )
     
    397397
    398398        if ( sigaction( sig, &act, NULL ) == -1 ) {
    399                 LIB_DEBUG_PRINT_BUFFER_DECL(
     399                __cfaabi_dbg_print_buffer_decl(
    400400                        " __kernel_sigdefault( sig:%d ), problem reseting signal handler, error(%d) %s.\n",
    401401                        sig, errno, strerror( errno )
     
    409409//=============================================================================================
    410410
    411 LIB_DEBUG_DO(
     411__cfaabi_dbg_debug_do(
    412412        static void __kernel_backtrace( int start ) {
    413413                // skip first N stack frames
     
    476476
    477477// void sigHandler_segv( __CFA_SIGPARMS__ ) {
    478 //      LIB_DEBUG_DO(
     478//      __cfaabi_dbg_debug_do(
    479479//              #ifdef __USE_STREAM__
    480480//              serr    | "*CFA runtime error* program cfa-cpp terminated with"
     
    493493// void sigHandler_abort( __CFA_SIGPARMS__ ) {
    494494//      // skip first 6 stack frames
    495 //      LIB_DEBUG_DO( __kernel_backtrace( 6 ); )
     495//      __cfaabi_dbg_debug_do( __kernel_backtrace( 6 ); )
    496496
    497497//      // reset default signal handler
Note: See TracChangeset for help on using the changeset viewer.