Ignore:
Timestamp:
Jul 31, 2018, 2:43:04 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
642bc83
Parents:
d1e0979 (diff), 04e367c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into demangler

File:
1 edited

Legend:

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

    rd1e0979 r3bbd012  
    3737
    3838//Start and stop routine for the kernel, declared first to make sure they run first
    39 void kernel_startup(void)  __attribute__(( constructor( STARTUP_PRIORITY_KERNEL ) ));
    40 void kernel_shutdown(void) __attribute__(( destructor ( STARTUP_PRIORITY_KERNEL ) ));
     39static void kernel_startup(void)  __attribute__(( constructor( STARTUP_PRIORITY_KERNEL ) ));
     40static void kernel_shutdown(void) __attribute__(( destructor ( STARTUP_PRIORITY_KERNEL ) ));
    4141
    4242//-----------------------------------------------------------------------------
     
    133133
    134134// Construct the processor context of non-main processors
    135 void ?{}(processorCtx_t & this, processor * proc, current_stack_info_t * info) {
     135static void ?{}(processorCtx_t & this, processor * proc, current_stack_info_t * info) {
    136136        (this.__cor){ info };
    137137        this.proc = proc;
    138138}
    139139
     140static void start(processor * this);
    140141void ?{}(processor & this, const char * name, cluster & cltr) with( this ) {
    141142        this.name = name;
     
    186187// Kernel Scheduling logic
    187188//=============================================================================================
     189static void runThread(processor * this, thread_desc * dst);
     190static void finishRunning(processor * this);
     191static void halt(processor * this);
     192
    188193//Main of the processor contexts
    189194void main(processorCtx_t & runner) {
     
    239244// runThread runs a thread by context switching
    240245// from the processor coroutine to the target thread
    241 void runThread(processor * this, thread_desc * dst) {
     246static void runThread(processor * this, thread_desc * dst) {
    242247        assert(dst->curr_cor);
    243248        coroutine_desc * proc_cor = get_coroutine(this->runner);
     
    256261
    257262// KERNEL_ONLY
    258 void returnToKernel() {
     263static void returnToKernel() {
    259264        coroutine_desc * proc_cor = get_coroutine(kernelTLS.this_processor->runner);
    260265        coroutine_desc * thrd_cor = kernelTLS.this_thread->curr_cor = kernelTLS.this_coroutine;
     
    265270// Once a thread has finished running, some of
    266271// its final actions must be executed from the kernel
    267 void finishRunning(processor * this) with( this->finish ) {
     272static void finishRunning(processor * this) with( this->finish ) {
    268273        verify( ! kernelTLS.preemption_state.enabled );
    269274        choose( action_code ) {
     
    299304// This is the entry point for processors (kernel threads)
    300305// It effectively constructs a coroutine by stealing the pthread stack
    301 void * CtxInvokeProcessor(void * arg) {
     306static void * CtxInvokeProcessor(void * arg) {
    302307        processor * proc = (processor *) arg;
    303308        kernelTLS.this_processor = proc;
     
    336341}
    337342
    338 void start(processor * this) {
     343static void start(processor * this) {
    339344        __cfaabi_dbg_print_safe("Kernel : Starting core %p\n", this);
    340345
     
    542547//-----------------------------------------------------------------------------
    543548// Kernel boot procedures
    544 void kernel_startup(void) {
     549static void kernel_startup(void) {
    545550        verify( ! kernelTLS.preemption_state.enabled );
    546551        __cfaabi_dbg_print_safe("Kernel : Starting\n");
     
    618623}
    619624
    620 void kernel_shutdown(void) {
     625static void kernel_shutdown(void) {
    621626        __cfaabi_dbg_print_safe("\n--------------------------------------------------\nKernel : Shutting down\n");
    622627
     
    655660// Kernel Quiescing
    656661//=============================================================================================
    657 
    658 void halt(processor * this) with( *this ) {
     662static void halt(processor * this) with( *this ) {
    659663        // verify( ! __atomic_load_n(&do_terminate, __ATOMIC_SEQ_CST) );
    660664
     
    683687// Unexpected Terminating logic
    684688//=============================================================================================
    685 
    686 
    687689static __spinlock_t kernel_abort_lock;
    688690static bool kernel_abort_called = false;
Note: See TracChangeset for help on using the changeset viewer.