Ignore:
Timestamp:
Jul 8, 2020, 2:01:05 PM (16 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
69237cd
Parents:
b9237fe
Message:

Added stats macro to reduce typing when using stats
Added new macros for Complete polling and submit polling (not implemented yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel_private.hfa

    rb9237fe r47746a2  
    286286// Statics call at the end of each thread to register statistics
    287287#if !defined(__CFA_NO_STATISTICS__)
    288 static inline struct __stats_t * __tls_stats() {
    289         /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
    290         /* paranoid */ verify( kernelTLS.this_stats );
    291         return kernelTLS.this_stats;
    292 }
     288        static inline struct __stats_t * __tls_stats() {
     289                /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
     290                /* paranoid */ verify( kernelTLS.this_stats );
     291                return kernelTLS.this_stats;
     292        }
     293
     294        #define __STATS__(in_kernel, ...) { \
     295                if( !(in_kernel) ) disable_interrupts(); \
     296                with( *__tls_stats() ) { \
     297                        __VA_ARGS__ \
     298                } \
     299                if( !(in_kernel) ) enable_interrupts( __cfaabi_dbg_ctx ); \
     300        }
     301#else
     302        #define __STATS__(in_kernel, ...)
    293303#endif
    294304
Note: See TracChangeset for help on using the changeset viewer.