Changeset 08e8851 for libcfa/src


Ignore:
Timestamp:
Sep 29, 2020, 1:51:01 PM (5 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
1526e86, 87b9332, 9dc3eb21
Parents:
2ff78aae (diff), d13dd6b (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' of plg.uwaterloo.ca:software/cfa/cfa-cc into master

Location:
libcfa/src
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/Makefile.am

    r2ff78aae r08e8851  
    8888inst_thread_headers_nosrc = \
    8989        bits/random.hfa \
     90        concurrency/clib/cfathread.h \
    9091        concurrency/invoke.h \
    9192        concurrency/kernel/fwd.hfa
     
    103104        concurrency/alarm.cfa \
    104105        concurrency/alarm.hfa \
     106        concurrency/clib/cfathread.cfa \
    105107        concurrency/CtxSwitch-@ARCHITECTURE@.S \
    106108        concurrency/invoke.c \
  • libcfa/src/concurrency/io/setup.cfa

    r2ff78aae r08e8851  
    147147        static void * iopoll_loop( __attribute__((unused)) void * args ) {
    148148                __processor_id_t id;
     149                id.full_proc = false;
    149150                id.id = doregister(&id);
    150151                __cfaabi_dbg_print_safe( "Kernel : IO poller thread starting\n" );
  • libcfa/src/concurrency/kernel.cfa

    r2ff78aae r08e8851  
    237237        $coroutine * proc_cor = get_coroutine(this->runner);
    238238
    239         // Update global state
    240         kernelTLS.this_thread = thrd_dst;
    241 
    242239        // set state of processor coroutine to inactive
    243240        verify(proc_cor->state == Active);
     
    253250                        thrd_dst->unpark_stale = true;
    254251                )
     252                // Update global state
     253                kernelTLS.this_thread = thrd_dst;
    255254
    256255                /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
     
    259258                /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) > ((uintptr_t)__get_stack(thrd_dst->curr_cor)->limit) || thrd_dst->curr_cor == proc_cor, "ERROR : Destination $thread %p has been corrupted.\n StackPointer too large.\n", thrd_dst ); // add escape condition if we are setting up the processor
    260259
     260
    261261                // set context switch to the thread that the processor is executing
    262262                verify( thrd_dst->context.SP );
     
    269269                /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
    270270
     271                // Reset global state
     272                kernelTLS.this_thread = 0p;
    271273
    272274                // We just finished running a thread, there are a few things that could have happened.
     
    313315        // Just before returning to the processor, set the processor coroutine to active
    314316        proc_cor->state = Active;
    315         kernelTLS.this_thread = 0p;
    316317
    317318        /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
     
    521522        disable_interrupts();
    522523                /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
    523                 bool ret = post( this->idle );
     524                post( this->idle );
    524525        enable_interrupts( __cfaabi_dbg_ctx );
    525526}
  • libcfa/src/concurrency/kernel.hfa

    r2ff78aae r08e8851  
    4848// Processor id, required for scheduling threads
    4949struct __processor_id_t {
    50         unsigned id;
     50        unsigned id:24;
     51        bool full_proc:1;
    5152
    5253        #if !defined(__CFA_NO_STATISTICS__)
  • libcfa/src/concurrency/kernel/startup.cfa

    r2ff78aae r08e8851  
    470470        this.name = name;
    471471        this.cltr = &_cltr;
    472         id = -1u;
     472        full_proc = true;
    473473        destroyer = 0p;
    474474        do_terminate = false;
  • libcfa/src/concurrency/preemption.cfa

    r2ff78aae r08e8851  
    411411static void * alarm_loop( __attribute__((unused)) void * args ) {
    412412        __processor_id_t id;
     413        id.full_proc = false;
    413414        id.id = doregister(&id);
    414415
  • libcfa/src/parseargs.cfa

    r2ff78aae r08e8851  
    2525#include "limits.hfa"
    2626
    27 extern int cfa_args_argc;
    28 extern char ** cfa_args_argv;
    29 extern char ** cfa_args_envp;
     27extern int cfa_args_argc __attribute__((weak));
     28extern char ** cfa_args_argv __attribute__((weak));
     29extern char ** cfa_args_envp __attribute__((weak));
    3030
    3131static void usage(char * cmd, cfa_option options[], size_t opt_count, const char * usage, FILE * out)  __attribute__ ((noreturn));
    3232
    3333void parse_args( cfa_option options[], size_t opt_count, const char * usage, char ** & left ) {
    34         parse_args(cfa_args_argc, cfa_args_argv, options, opt_count, usage, left );
     34        if( 0p != &cfa_args_argc ) {
     35                parse_args(cfa_args_argc, cfa_args_argv, options, opt_count, usage, left );
     36        }
     37        else {
     38                char * temp = "";
     39                parse_args(0, &temp, options, opt_count, usage, left );
     40        }
    3541}
    3642
Note: See TracChangeset for help on using the changeset viewer.