Changeset 5614a191 for libcfa/src/concurrency/kernel/startup.cfa
- Timestamp:
- Feb 17, 2022, 12:56:46 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 8ee163e2
- Parents:
- 3263e2a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel/startup.cfa
r3263e2a4 r5614a191 122 122 extern "C" { 123 123 struct { __dllist_t(cluster) list; __spinlock_t lock; } __cfa_dbg_global_clusters; 124 } 125 126 extern size_t __page_size; 127 extern int __map_prot; 124 extern size_t __cfa_page_size; 125 extern int __map_prot; 126 } 128 127 129 128 //----------------------------------------------------------------------------- … … 574 573 } 575 574 576 extern size_t __page_size;577 575 void ^?{}(processor & this) with( this ){ 578 576 /* paranoid */ verify( !__atomic_load_n(&do_terminate, __ATOMIC_ACQUIRE) ); … … 740 738 void * stack; 741 739 #if CFA_PROCESSOR_USE_MMAP 742 stacksize = ceiling( stacksize, __ page_size ) + __page_size;740 stacksize = ceiling( stacksize, __cfa_page_size ) + __cfa_page_size; 743 741 stack = mmap(0p, stacksize, __map_prot, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); 744 742 if(stack == ((void*)-1)) { 745 743 abort( "pthread stack creation : internal error, mmap failure, error(%d) %s.", errno, strerror( errno ) ); 746 744 } 747 if ( mprotect( stack, __ page_size, PROT_NONE ) == -1 ) {745 if ( mprotect( stack, __cfa_page_size, PROT_NONE ) == -1 ) { 748 746 abort( "pthread stack creation : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) ); 749 747 } // if 750 748 #else 751 749 __cfaabi_dbg_debug_do( 752 stack = memalign( __ page_size, stacksize + __page_size );750 stack = memalign( __cfa_page_size, stacksize + __cfa_page_size ); 753 751 // pthread has no mechanism to create the guard page in user supplied stack. 754 if ( mprotect( stack, __ page_size, PROT_NONE ) == -1 ) {752 if ( mprotect( stack, __cfa_page_size, PROT_NONE ) == -1 ) { 755 753 abort( "mprotect : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) ); 756 754 } // if … … 779 777 check( pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" ); 780 778 assert( stacksize >= PTHREAD_STACK_MIN ); 781 stacksize += __ page_size;779 stacksize += __cfa_page_size; 782 780 783 781 if(munmap(stack, stacksize) == -1) { … … 787 785 __cfaabi_dbg_debug_do( 788 786 // pthread has no mechanism to create the guard page in user supplied stack. 789 if ( mprotect( stack, __ page_size, __map_prot ) == -1 ) {787 if ( mprotect( stack, __cfa_page_size, __map_prot ) == -1 ) { 790 788 abort( "mprotect : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) ); 791 789 } // if
Note: See TracChangeset
for help on using the changeset viewer.