Changes in / [c25202b:0982b3ec]
- Files:
-
- 11 edited
-
Jenkins/FullBuild (modified) (1 diff)
-
Jenkinsfile (modified) (1 diff)
-
doc/bibliography/pl.bib (modified) (1 diff)
-
doc/uC++toCFA/uC++toCFA.tex (modified) (11 diffs)
-
libcfa/src/concurrency/cofor.cfa (modified) (1 diff)
-
libcfa/src/concurrency/coroutine.cfa (modified) (3 diffs)
-
libcfa/src/concurrency/coroutine.hfa (modified) (5 diffs)
-
libcfa/src/concurrency/invoke.h (modified) (2 diffs)
-
libcfa/src/concurrency/kernel/startup.cfa (modified) (3 diffs)
-
libcfa/src/concurrency/preemption.cfa (modified) (3 diffs)
-
libcfa/src/stdhdr/math.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/FullBuild
rc25202b r0982b3ec 26 26 gcc_11_x64_new: { trigger_build( 'gcc-11', 'x64', false ) }, 27 27 // gcc_12_x64_new: { trigger_build( 'gcc-12', 'x64', false ) }, 28 gcc_14_x64_new: { trigger_build( 'gcc-14', 'x64', false ) }, 29 gcc_10_arm64_new: { trigger_build( 'gcc-10', 'arm64', false ) }, 30 gcc_11_arm64_new: { trigger_build( 'gcc-11', 'arm64', false ) }, 28 // gcc_10_arm64_new: { trigger_build( 'gcc-10', 'arm64', false ) }, 29 // gcc_11_arm64_new: { trigger_build( 'gcc-11', 'arm64', false ) }, 31 30 //gcc_12_arm64_new: { trigger_build( 'gcc-12', 'arm64', false ) }, 32 31 clang_x64_new: { trigger_build( 'clang', 'x64', true ) }, -
Jenkinsfile
rc25202b r0982b3ec 332 332 this.Architecture = new Arch_Desc('x86', '--host=i386', 'x86') 333 333 break 334 case 'arm64':335 this.Architecture = new Arch_Desc('arm64', '--host=aarch64', 'arm64')336 break334 // case 'arm64': 335 // this.Architecture = new Arch_Desc('arm64', '--host=aarch64', 'arm64') 336 // break 337 337 default : 338 338 error "Unhandled architecture : ${arch}" -
doc/bibliography/pl.bib
rc25202b r0982b3ec 9292 9292 } 9293 9293 9294 @inproceedings{valg rind,9294 @inproceedings{valgind, 9295 9295 keywords = {Memcheck, Valgrind, dynamic binary analysis, dynamic binary instrumentation, shadow values}, 9296 9296 contributer = {pabuhr@plg}, -
doc/uC++toCFA/uC++toCFA.tex
rc25202b r0982b3ec 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Fri Feb 20 11:19:31 202614 %% Update Count : 6 71713 %% Last Modified On : Mon Nov 17 11:14:48 2025 14 %% Update Count : 6677 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 194 194 195 195 The @choose@ statement provides an implicit @break@ after the @case@ clause for safety. 196 It is possible to @ fallthrough@ label in a @case@ clause to transfer to common code orthe @default@ clause.197 \begin{cquote} 198 \begin{tabular}{@{}l|l@{}} 199 \begin{ cfa}196 It is possible to @break default@ in a @case@ clause to transfer to common code in the @default@ clause. 197 \begin{cquote} 198 \begin{tabular}{@{}l|l@{}} 199 \begin{uC++} 200 200 switch ( i ) { 201 case 3: ... @fallthrough common@; 202 case 2: if ( ... ) @fallthrough@; 203 case 1: 204 common: ... ; // implicit fall through 201 case 1: ... @break@; // explicit break 202 case 2: ... @break@; // explicit break 205 203 default: ... ; 206 204 } 207 \end{ cfa}205 \end{uC++} 208 206 & 209 207 \begin{cfa} 210 208 choose ( i ) { 211 case 3: ... @fallthrough common@; // labelled explicit fallthrough 212 case 2: if ( ... ) @fallthrough@; // conditional explicit fallthrough 213 case 1: 214 common: ... ; // implicit break 209 case 1: ... ; // implicit break 210 case 2: ... ; // implicit break 215 211 default: ... ; 216 212 } … … 254 250 for ( i; @5@ ~ @15@ ~ @2@ ) { ... } // 5 to 14 by 2 255 251 for ( i; -2 ~@=@ 10 ~ 3 ) { ... } // -2 to 10 by 3 256 for ( i; -3 @-@~ 10 ) { ... } // 10 to -2 by -1, not 10 -~= -3257 for ( i; 0 @-@~@=@ 10 ) { ... } // 10 to 0 by -1, not 10 -~= 0252 for ( i; -3 @-@~ 10 ) { ... } // not 10 -~= -3, 10 to -2 by -1 253 for ( i; 0 @-@~@=@ 10 ) { ... } // not 10 -~= 0, 10 to 0 by -1 258 254 \end{cfa} 259 255 \end{tabular} … … 912 908 public: 913 909 }; 914 T t;915 uProcessor p[3];916 910 \end{uC++} 917 911 & … … 923 917 }; 924 918 void main( @T & t@ ) { 925 ... @resumeAt( partner, ExceptionInst( E, ... ) )@;919 ... @resumeAt( partner, ExceptionInst( E, ... )@ ); 926 920 ... @active_thread();@ ... 927 921 } 928 T t; // create thread object and start thread in main 929 processor p[3]; // 4 kernel threads including program main 930 \ end{cfa}922 \end{cfa} 923 \\ 924 \multicolumn{2}{@{}l@{}}{\lstinline{T t; // start thread in main routine}} 931 925 \end{tabular} 932 926 \end{cquote} … … 1015 1009 } 1016 1010 }; 1017 Barrier b{ 3 }; 1011 enum { N = 3 }; 1012 Barrier b{ N }; 1018 1013 \end{uC++} 1019 1014 & … … 1039 1034 } 1040 1035 } 1041 Barrier b{ 3 }; 1036 enum { N = 3 }; 1037 Barrier b{ N }; 1042 1038 \end{cfa} 1043 1039 \end{tabular} … … 1182 1178 1183 1179 1184 {\lstset{tabsize= 4}1180 {\lstset{tabsize=3} 1185 1181 \setlength{\tabcolsep}{5pt} 1186 1182 \begin{tabular}{@{}l|ll@{}} … … 1190 1186 @Future_ISM@<double> fd; 1191 1187 struct Msg { int i, j; }; @Future_ISM@<Msg> fm; 1188 struct Stop {}; @Future_ISM@<Stop> fs; 1192 1189 struct Cont {}; @Future_ISM@<Cont> fc; 1193 _Exception Stop {};1194 1190 1195 1191 _Task Worker { 1196 1192 void main() { 1197 try { 1198 for ( ;; ) {1199 _Select( fi ) { cout << fi() << endl; fi.reset(); }1200 and _Select( fd ) { cout << fd() << endl; fd.reset(); }1201 and _Select( fm ) {1202 cout << fm().i << " " << fm().j << endl; fm.reset();1203 }1204 fc( (Cont){} );// synchronize1205 }1206 } catch( Stop & ) { cout << "stop" << endl;}1207 } 1193 1194 for ( ;; ) { 1195 _Select( fi ) { cout << fi() << endl; fi.reset(); } 1196 and _Select( fd ) { cout << fd() << endl; fd.reset(); } 1197 and _Select( fm ) { 1198 cout << fm().i << " " << fm().j << endl; fm.reset(); 1199 } or _Select( fs ) { cout << "stop" << endl; break; } 1200 fc.delivery( (Cont){} ); // synchronize 1201 } 1202 } 1203 1208 1204 }; 1209 1205 int main() { 1210 1206 Worker worker; 1211 1207 for ( int i = 0; i < 10; i += 1 ) { 1212 fi( i ); fd( i + 2.5 ); fm( (Msg){ i, 2 } ); // fulfil1208 fi( i ); fd( i + 2.5 ); fm( (Msg){ i, 2 } ); // fulfil 1213 1209 fc(); fc.reset(); // synchronize 1214 1210 } 1215 f i( new Stop{} ); // trigger exception1211 fs( (Stop){} ); 1216 1212 } // wait for worker to terminate 1217 1213 \end{uC++} … … 1219 1215 \begin{cfa} 1220 1216 #include <future.hfa> 1221 @future_rc@( int) fi;1222 @future_rc@( double) fd;1223 struct Msg { int i, j; }; @future_rc@( Msg) fm;1224 struct Cont {}; @future_rc@( Cont ) fc;1225 ExceptionDecl( Stop );1226 1217 @future_rc@(int) fi; 1218 @future_rc@(double) fd; 1219 struct Msg { int i, j; }; @future_rc@(Msg) fm; 1220 struct Stop {}; @future_rc@(Stop) fs; 1221 struct Cont {}; @future_rc@(Cont) fc; 1222 ExceptionDecl( Break ); 1227 1223 thread Worker {}; 1228 1224 void main( Worker & ) { … … 1231 1227 waituntil( fi ) { sout | fi(); reset( fi ); } 1232 1228 and waituntil( fd ) { sout | fd(); reset( fd ); } 1233 and waituntil( fm ) { 1234 sout | fm().i | fm().j; reset( fm ); 1229 and waituntil( fm ) { sout | fm().i | fm().j; reset( fm ); } 1230 or waituntil( fs ) { sout | "stop"; 1231 throw ExceptionInst( Break ); 1235 1232 } 1236 1233 fc( (Cont){} ); // synchronize 1237 1234 } 1238 } catch( Stop * ) { sout | "stop"; } 1239 } 1240 1235 } catch( Break * ) {} 1236 } 1241 1237 int main() { 1242 1238 Worker worker; 1243 1239 for ( i; 10 ) { 1244 fi( i ); fd( i + 2.5 ); fm( (Msg){ i, 2 } ); // fulfil1240 fi( i ); fd( i + 2.5 ); fm( (Msg){ i, 2 } ); // fulfil 1245 1241 fc(); reset( fc ); // synchronize 1246 1242 } 1247 f i( ExceptionPtr( ExceptionInst( Stop ) ));1243 fs( (Stop){} ); 1248 1244 } // wait for worker to terminate 1249 1245 \end{cfa} -
libcfa/src/concurrency/cofor.cfa
rc25202b r0982b3ec 44 44 } 45 45 } 46 47 -
libcfa/src/concurrency/coroutine.cfa
rc25202b r0982b3ec 10 10 // Created On : Mon Nov 28 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Mar 1 17:36:41 202613 // Update Count : 11512 // Last Modified On : Fri Apr 25 06:48:19 2025 13 // Update Count : 31 14 14 // 15 15 … … 326 326 void ^?{}( ehm_cleanup & this ) { free( this.ex ); } 327 327 328 void * stack_pointer( coroutine$ * cor ) libcfa_public {329 if ( active_coroutine() == cor ) { // accessing myself ?330 void * sp; // use my current stack value331 #if defined( __i386__ )332 asm( "movl %%esp,%0" : "=m" (sp) : );333 #elif defined( __x86_64__ )334 asm( "movq %%rsp,%0" : "=m" (sp) : );335 #elif defined( __arm_64__ )336 asm( "mov x9, sp; str x9,%0" : "=m" (sp) : : "x9" );337 #else338 #error Cforall : internal error, unsupported architecture339 #endif340 return sp;341 } else { // accessing another coroutine342 return cor->context.SP;343 } // if344 } // stackPointer345 346 void * stack_pointer() libcfa_public { return stack_pointer( active_coroutine() ); }347 348 #define xstr(s) str(s)349 #define str(s) #s350 #define STACK_ERROR 4351 #define STACK_WARNING 16352 353 void stack_verify( coroutine$ * cor ) libcfa_public {354 void * sp = stack_pointer( cor ); // optimizations355 struct __stack_t * cor_stack = __get_stack( cor );356 void * safelimit = (void *)((char *)cor_stack->limit + STACK_ERROR * 1024); // space needed for printing abort message and backtrace357 358 if ( sp < safelimit ) { // must leave stack space to call abort359 abort( "Stack overflow detected: stack pointer %p below safe limit %p.\n"360 "Possible cause is allocation of large stack frame(s) and/or deep call stack.",361 sp, safelimit );362 } else if ( sp < (void *)((char *)cor_stack->limit + STACK_WARNING * 1024) ) { // must leave stack space to call abort363 #define STACK_WARNING_MSG "Cforall Runtime warning : within " xstr(STACK_WARNING) "K of stack limit.\n"364 __cfaabi_bits_write( STDERR_FILENO, STACK_WARNING_MSG, sizeof( STACK_WARNING_MSG ) - 1 );365 } else if ( sp > cor_stack->base ) {366 abort( "Stack underflow detected: stack pointer %p above base %p.\n"367 "Possible cause is corrupted stack frame via overwriting memory.",368 sp, cor_stack->base );369 } // if370 } // verify371 372 void stack_verify() libcfa_public { return stack_verify( active_coroutine() ); }373 374 328 bool poll( coroutine$ * cor ) libcfa_public { 375 329 nonlocal_exception * nl_ex = pop_ehm_head( cor ); … … 397 351 // user facing ehm operations 398 352 forall(T & | is_coroutine(T)) { 399 void * stack_pointer( T & cor ) libcfa_public { return stack_pointer( get_coroutine( cor ) ); }400 void stack_verify( T & cor ) libcfa_public { return stack_verify( get_coroutine( cor ) ); }401 402 353 // enable/disable non-local exceptions 403 354 void enable_ehm( T & cor ) libcfa_public { get_coroutine( cor )->ehm_state.ehm_enabled = true; } -
libcfa/src/concurrency/coroutine.hfa
rc25202b r0982b3ec 10 10 // Created On : Mon Nov 28 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Mar 1 17:44:11 202613 // Update Count : 4312 // Last Modified On : Fri Apr 25 06:52:04 2025 13 // Update Count : 15 14 14 // 15 15 … … 98 98 } 99 99 100 void stack_verify( coroutine$ * cor );101 void stack_verify();102 103 100 // Private wrappers for context switch and stack creation 101 // Wrapper for co 104 102 static inline void $ctx_switch( coroutine$ * src, coroutine$ * dst ) __attribute__((nonnull (1, 2))) { 105 103 // set state of current coroutine to inactive … … 112 110 /* paranoid */ verify( !athrd->corctx_flag ); 113 111 athrd->corctx_flag = true; 114 115 #if defined( __CFA_DEBUG__ )116 stack_verify( src ); // test on front side of context switch, backside is too late.117 #endif // __CFA_DEBUG__118 112 119 113 // set new coroutine that task is executing … … 231 225 232 226 // non local ehm and coroutine utility routines 233 void * stack_pointer( coroutine$ * cor );234 void * stack_pointer();235 227 void enable_ehm(); 236 228 void disable_ehm(); … … 242 234 243 235 forall(T & | is_coroutine(T)) { 244 void * stack_pointer( T & cor );245 void stack_verify( T & cor );246 236 void enable_ehm( T & cor ); // enable checking non-local exceptions for cor via checked_poll 247 237 void disable_ehm( T & cor ); // disable checking non-local exceptions for cor via checked_poll -
libcfa/src/concurrency/invoke.h
rc25202b r0982b3ec 10 10 // Created On : Tue Jan 17 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Mar 1 15:43:17 202613 // Update Count : 7012 // Last Modified On : Fri Oct 31 08:46:59 2025 13 // Update Count : 67 14 14 // 15 15 … … 31 31 #define _INVOKE_H_ 32 32 33 enum { DEFAULT_STACK_SIZE = 256000 }; // raised from 6500033 enum { DEFAULT_STACK_SIZE = 65000 }; 34 34 35 35 struct __cfaehm_try_resume_node; -
libcfa/src/concurrency/kernel/startup.cfa
rc25202b r0982b3ec 474 474 //----------------------------------------------------------------------------- 475 475 // Main thread construction 476 static void ?{}( coroutine$ & this, current_stack_info_t * info ) with( this ) {476 static void ?{}( coroutine$ & this, current_stack_info_t * info) with( this ) { 477 477 stack.storage = info->storage; 478 478 with(*stack.storage) { … … 485 485 state = Start; 486 486 starter = 0p; 487 this.last = 0p; // "last" overloaded in scope => qualification487 this.last = 0p; 488 488 cancellation = 0p; 489 489 ehm_state.ehm_buffer{}; … … 492 492 } 493 493 494 static void ?{}( thread$ & this, current_stack_info_t * info ) with( this ) {494 static void ?{}( thread$ & this, current_stack_info_t * info) with( this ) { 495 495 ticket = TICKET_RUNNING; 496 496 state = Start; -
libcfa/src/concurrency/preemption.cfa
rc25202b r0982b3ec 10 10 // Created On : Mon Jun 5 14:20:42 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Mar 1 10:00:18 202613 // Update Count : 6 812 // Last Modified On : Fri Apr 25 07:24:39 2025 13 // Update Count : 63 14 14 // 15 15 … … 571 571 __cfaabi_dbg_print_buffer_decl( " KERNEL: preempting core %p (%p @ %p).\n", __cfaabi_tls.this_processor, __cfaabi_tls.this_thread, (void *)(cxt->uc_mcontext.CFA_REG_IP) ); 572 572 573 #if defined( __CFA_DEBUG__ )574 stack_verify(); // good place to check for stack overflow575 #endif // __CFA_DEBUG__576 577 573 // Sync flag : prevent recursive calls to the signal handler 578 574 __cfaabi_tls.preemption_state.in_progress = true; … … 595 591 #endif 596 592 597 force_yield( __ALARM_PREEMPTION ); // Do the actual __cfactx_switch593 force_yield( __ALARM_PREEMPTION ); // Do the actual __cfactx_switch 598 594 } 599 595 -
libcfa/src/stdhdr/math.h
rc25202b r0982b3ec 10 10 // Created On : Mon Jul 4 23:25:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 8 22:03:48 202613 // Update Count : 2 512 // Last Modified On : Fri Jun 6 06:35:49 2025 13 // Update Count : 24 14 14 // 15 15 16 16 extern "C" { 17 #if ! defined( exception ) // nesting ? 18 //#define exception ``exception // make keyword an identifier 19 #define __CFA_MATH_H__ 20 #endif 21 17 22 #include_next <math.h> // has internal check for multiple expansion 23 24 #if defined( exception ) && defined( __CFA_MATH_H__ ) // reset only if set 25 //#undef exception 26 #undef __CFA_MATH_H__ 27 #endif 18 28 } // extern "C" 19 29
Note:
See TracChangeset
for help on using the changeset viewer.