Ignore:
Timestamp:
Dec 14, 2022, 12:23:42 PM (17 months ago)
Author:
caparson <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
441a6a7
Parents:
7d9598d (diff), d8bdf13 (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/startup.cfa

    r7d9598d r2dcd80a  
    3939#include "limits.hfa"
    4040#include "math.hfa"
     41#include "bits/random.hfa"                                                              // prng
    4142
    4243#define CFA_PROCESSOR_USE_MMAP 0
     
    107108extern void __wake_proc(processor *);
    108109extern int cfa_main_returned;                                                   // from interpose.cfa
    109 uint32_t __global_random_prime = 4_294_967_291u, __global_random_mask = false;
     110size_t __global_random_prime = 4_294_967_291u;
     111bool __global_random_mask = false;
    110112
    111113//-----------------------------------------------------------------------------
     
    133135// Global state
    134136__thread struct KernelThreadData __cfaabi_tls __attribute__ ((tls_model ( "initial-exec" ))) @= {
    135         NULL,                                                                                           // cannot use 0p
    136         NULL,
    137         false,
    138         { 1, false, false },
    139         0,
    140         { 0, 0 },
    141         NULL,
     137        .this_thread : NULL,                                                            // cannot use 0p
     138        .this_processor : NULL,
     139        .sched_lock : false,
     140        .preemption_state : { .disable_count : 1, .enabled : false, .in_progress : false },
     141        // random_state uninitialized
     142        .ready_rng : { .fwd_seed : 0, .bck_seed : 0 },
     143        .this_stats : NULL,
    142144        #ifdef __CFA_WITH_VERIFY__
    143                 false,
    144                 0,
     145                .in_sched_lock : false,
     146                .sched_id : 0,
    145147        #endif
    146148};
     
    513515        rdy_link.next = 0p;
    514516        rdy_link.ts   = MAX;
     517        user_link.next = 0p;
     518        user_link.prev = 0p;
     519        cltr_link.next = 0p;
     520        cltr_link.prev = 0p;
    515521        preferred = ready_queue_new_preferred();
    516522        last_proc = 0p;
    517         random_state = __global_random_mask ? __global_random_prime : __global_random_prime ^ rdtscl();
     523        PRNG_SET_SEED( random_state,  __global_random_mask ? __global_random_prime : __global_random_prime ^ rdtscl() );
    518524        #if defined( __CFA_WITH_VERIFY__ )
    519525                executing = 0p;
Note: See TracChangeset for help on using the changeset viewer.