Ignore:
Timestamp:
Dec 17, 2020, 4:18:23 PM (10 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
089b1a9, f4f79dd
Parents:
c5a98f3 (diff), 68a867ee (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

    rc5a98f3 r41cde266  
    117117}
    118118
    119 size_t __page_size = 0;
     119extern size_t __page_size;
     120extern int __map_prot;
    120121
    121122//-----------------------------------------------------------------------------
     
    161162        /* paranoid */ verify( ! __preemption_enabled() );
    162163        __cfadbg_print_safe(runtime_core, "Kernel : Starting\n");
    163 
    164         __page_size = sysconf( _SC_PAGESIZE );
    165164
    166165        __cfa_dbg_global_clusters.list{ __get };
     
    681680        #if CFA_PROCESSOR_USE_MMAP
    682681                stacksize = ceiling( stacksize, __page_size ) + __page_size;
    683                 stack = mmap(0p, stacksize, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
     682                stack = mmap(0p, stacksize, __map_prot, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
    684683                if(stack == ((void*)-1)) {
    685684                        abort( "pthread stack creation : internal error, mmap failure, error(%d) %s.", errno, strerror( errno ) );
     
    727726                }
    728727        #else
     728                __cfaabi_dbg_debug_do(
     729                        // pthread has no mechanism to create the guard page in user supplied stack.
     730                        if ( mprotect( stack, __page_size, __map_prot ) == -1 ) {
     731                                abort( "mprotect : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) );
     732                        } // if
     733                );
    729734                free( stack );
    730735        #endif
Note: See TracChangeset for help on using the changeset viewer.