Changes in / [bd21af5:460bd3a]


Ignore:
Location:
src
Files:
5 edited

Legend:

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

    rbd21af5 r460bd3a  
    3737
    3838//Start and stop routine for the kernel, declared first to make sure they run first
    39 static void kernel_startup(void)  __attribute__(( constructor( STARTUP_PRIORITY_KERNEL ) ));
    40 static void kernel_shutdown(void) __attribute__(( destructor ( STARTUP_PRIORITY_KERNEL ) ));
     39void kernel_startup(void)  __attribute__(( constructor( STARTUP_PRIORITY_KERNEL ) ));
     40void kernel_shutdown(void) __attribute__(( destructor ( STARTUP_PRIORITY_KERNEL ) ));
    4141
    4242//-----------------------------------------------------------------------------
     
    133133
    134134// Construct the processor context of non-main processors
    135 static void ?{}(processorCtx_t & this, processor * proc, current_stack_info_t * info) {
     135void ?{}(processorCtx_t & this, processor * proc, current_stack_info_t * info) {
    136136        (this.__cor){ info };
    137137        this.proc = proc;
    138138}
    139139
    140 static void start(processor * this);
    141140void ?{}(processor & this, const char * name, cluster & cltr) with( this ) {
    142141        this.name = name;
     
    187186// Kernel Scheduling logic
    188187//=============================================================================================
    189 static void runThread(processor * this, thread_desc * dst);
    190 static void finishRunning(processor * this);
    191 static void halt(processor * this);
    192 
    193188//Main of the processor contexts
    194189void main(processorCtx_t & runner) {
     
    244239// runThread runs a thread by context switching
    245240// from the processor coroutine to the target thread
    246 static void runThread(processor * this, thread_desc * dst) {
     241void runThread(processor * this, thread_desc * dst) {
    247242        assert(dst->curr_cor);
    248243        coroutine_desc * proc_cor = get_coroutine(this->runner);
     
    261256
    262257// KERNEL_ONLY
    263 static void returnToKernel() {
     258void returnToKernel() {
    264259        coroutine_desc * proc_cor = get_coroutine(kernelTLS.this_processor->runner);
    265260        coroutine_desc * thrd_cor = kernelTLS.this_thread->curr_cor = kernelTLS.this_coroutine;
     
    270265// Once a thread has finished running, some of
    271266// its final actions must be executed from the kernel
    272 static void finishRunning(processor * this) with( this->finish ) {
     267void finishRunning(processor * this) with( this->finish ) {
    273268        verify( ! kernelTLS.preemption_state.enabled );
    274269        choose( action_code ) {
     
    304299// This is the entry point for processors (kernel threads)
    305300// It effectively constructs a coroutine by stealing the pthread stack
    306 static void * CtxInvokeProcessor(void * arg) {
     301void * CtxInvokeProcessor(void * arg) {
    307302        processor * proc = (processor *) arg;
    308303        kernelTLS.this_processor = proc;
     
    341336}
    342337
    343 static void start(processor * this) {
     338void start(processor * this) {
    344339        __cfaabi_dbg_print_safe("Kernel : Starting core %p\n", this);
    345340
     
    547542//-----------------------------------------------------------------------------
    548543// Kernel boot procedures
    549 static void kernel_startup(void) {
     544void kernel_startup(void) {
    550545        verify( ! kernelTLS.preemption_state.enabled );
    551546        __cfaabi_dbg_print_safe("Kernel : Starting\n");
     
    623618}
    624619
    625 static void kernel_shutdown(void) {
     620void kernel_shutdown(void) {
    626621        __cfaabi_dbg_print_safe("\n--------------------------------------------------\nKernel : Shutting down\n");
    627622
     
    660655// Kernel Quiescing
    661656//=============================================================================================
    662 static void halt(processor * this) with( *this ) {
     657
     658void halt(processor * this) with( *this ) {
    663659        // verify( ! __atomic_load_n(&do_terminate, __ATOMIC_SEQ_CST) );
    664660
     
    687683// Unexpected Terminating logic
    688684//=============================================================================================
     685
     686
    689687static __spinlock_t kernel_abort_lock;
    690688static bool kernel_abort_called = false;
  • src/libcfa/concurrency/kernel_private.h

    rbd21af5 r460bd3a  
    5454// Processor
    5555void main(processorCtx_t *);
     56void start(processor * this);
     57void runThread(processor * this, thread_desc * dst);
     58void finishRunning(processor * this);
     59void halt(processor * this);
    5660
    5761static inline void wake_fast(processor * this) {
  • src/libcfa/concurrency/preemption.c

    rbd21af5 r460bd3a  
    3939
    4040// FwdDeclarations : Signal handlers
    41 static void sigHandler_ctxSwitch( __CFA_SIGPARMS__ );
    42 static void sigHandler_segv     ( __CFA_SIGPARMS__ );
    43 static void sigHandler_ill      ( __CFA_SIGPARMS__ );
    44 static void sigHandler_fpe      ( __CFA_SIGPARMS__ );
    45 static void sigHandler_abort    ( __CFA_SIGPARMS__ );
     41void sigHandler_ctxSwitch( __CFA_SIGPARMS__ );
     42void sigHandler_segv     ( __CFA_SIGPARMS__ );
     43void sigHandler_ill      ( __CFA_SIGPARMS__ );
     44void sigHandler_fpe      ( __CFA_SIGPARMS__ );
     45void sigHandler_abort    ( __CFA_SIGPARMS__ );
    4646
    4747// FwdDeclarations : alarm thread main
    48 static void * alarm_loop( __attribute__((unused)) void * args );
     48void * alarm_loop( __attribute__((unused)) void * args );
    4949
    5050// Machine specific register name
     
    6363static pthread_t alarm_thread;                        // pthread handle to alarm thread
    6464
    65 static void ?{}(event_kernel_t & this) with( this ) {
     65void ?{}(event_kernel_t & this) with( this ) {
    6666        alarms{};
    6767        lock{};
     
    8585
    8686// Tick one frame of the Discrete Event Simulation for alarms
    87 static void tick_preemption() {
     87void tick_preemption() {
    8888        alarm_node_t * node = NULL;                     // Used in the while loop but cannot be declared in the while condition
    8989        alarm_list_t * alarms = &event_kernel->alarms;  // Local copy for ease of reading
     
    350350// Context switch signal handler
    351351// Receives SIGUSR1 signal and causes the current thread to yield
    352 static void sigHandler_ctxSwitch( __CFA_SIGPARMS__ ) {
     352void sigHandler_ctxSwitch( __CFA_SIGPARMS__ ) {
    353353        __cfaabi_dbg_debug_do( last_interrupt = (void *)(cxt->uc_mcontext.CFA_REG_IP); )
    354354
     
    393393// Main of the alarm thread
    394394// Waits on SIGALRM and send SIGUSR1 to whom ever needs it
    395 static void * alarm_loop( __attribute__((unused)) void * args ) {
     395void * alarm_loop( __attribute__((unused)) void * args ) {
    396396        // Block sigalrms to control when they arrive
    397397        sigset_t mask;
  • src/libcfa/concurrency/preemption.h

    rbd21af5 r460bd3a  
    2222void kernel_stop_preemption();
    2323void update_preemption( processor * this, Duration duration );
     24void tick_preemption();
    2425
    2526struct preemption_scope {
  • src/tests/.expect/attributes.x86.txt

    rbd21af5 r460bd3a  
    367367signed int __apd7__Fi_Fi_i_Fi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object23)(__attribute__ ((unused)) signed int __anonymous_object24), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object25)(__attribute__ ((unused)) signed int __anonymous_object26));
    368368struct Vad {
    369     __attribute__ ((unused)) signed int __anonymous_object27:4;
     369    __attribute__ ((unused)) signed int __anonymous_object27;
    370370    __attribute__ ((unused)) signed int __anonymous_object28:4;
    371     __attribute__ ((unused,unused)) signed int __anonymous_object29:6;
     371    __attribute__ ((unused)) signed int __anonymous_object29:4;
     372    __attribute__ ((unused,unused)) signed int __anonymous_object30:6;
    372373};
    373374static inline void ___constructor__F_4sVad_autogen___1(struct Vad *___dst__4sVad_1);
     
    375376static inline void ___destructor__F_4sVad_autogen___1(struct Vad *___dst__4sVad_1);
    376377static inline struct Vad ___operator_assign__F4sVad_4sVad4sVad_autogen___1(struct Vad *___dst__4sVad_1, struct Vad ___src__4sVad_1);
     378static inline void ___constructor__F_4sVadi_autogen___1(struct Vad *___dst__4sVad_1, __attribute__ ((unused)) signed int __anonymous_object31);
    377379static inline void ___constructor__F_4sVad_autogen___1(struct Vad *___dst__4sVad_1){
     380    ((void)((*___dst__4sVad_1).__anonymous_object27) /* ?{} */);
    378381}
    379382static inline void ___constructor__F_4sVad4sVad_autogen___1(struct Vad *___dst__4sVad_1, struct Vad ___src__4sVad_1){
     383    ((void)((*___dst__4sVad_1).__anonymous_object27=___src__4sVad_1.__anonymous_object27) /* ?{} */);
    380384}
    381385static inline void ___destructor__F_4sVad_autogen___1(struct Vad *___dst__4sVad_1){
     386    ((void)((*___dst__4sVad_1).__anonymous_object27) /* ^?{} */);
    382387}
    383388static inline struct Vad ___operator_assign__F4sVad_4sVad4sVad_autogen___1(struct Vad *___dst__4sVad_1, struct Vad ___src__4sVad_1){
    384389    struct Vad ___ret__4sVad_1;
     390    ((void)((*___dst__4sVad_1).__anonymous_object27=___src__4sVad_1.__anonymous_object27));
    385391    ((void)___constructor__F_4sVad4sVad_autogen___1((&___ret__4sVad_1), (*___dst__4sVad_1)));
    386392    return ___ret__4sVad_1;
    387393}
     394static inline void ___constructor__F_4sVadi_autogen___1(struct Vad *___dst__4sVad_1, __attribute__ ((unused)) signed int __anonymous_object32){
     395    ((void)((*___dst__4sVad_1).__anonymous_object27=__anonymous_object32) /* ?{} */);
     396}
Note: See TracChangeset for help on using the changeset viewer.