Changes in / [bac5158:994d080]
- Files:
-
- 4 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
configure
rbac5158 r994d080 3471 3471 case $host_cpu in 3472 3472 i386) 3473 CFLAGS+=" -m32"3474 CXXFLAGS+=" -m32"3475 CFAFLAGS+=" -m32"3476 LDFLAGS+=" -m32"3473 CFLAGS+="-m32" 3474 CXXFLAGS+="-m32" 3475 CFAFLAGS+="-m32" 3476 LDFLAGS+="-m32" 3477 3477 ;; 3478 3478 i686) 3479 CFLAGS+=" -m32"3480 CXXFLAGS+=" -m32"3481 CFAFLAGS+=" -m32"3482 LDFLAGS+=" -m32"3479 CFLAGS+="-m32" 3480 CXXFLAGS+="-m32" 3481 CFAFLAGS+="-m32" 3482 LDFLAGS+="-m32" 3483 3483 ;; 3484 3484 x86_64) 3485 CFLAGS+=" -m64"3486 CXXFLAGS+=" -m64"3487 CFAFLAGS+=" -m64"3488 LDFLAGS+=" -m64"3485 CFLAGS+="-m64" 3486 CXXFLAGS+="-m64" 3487 CFAFLAGS+="-m64" 3488 LDFLAGS+="-m64" 3489 3489 ;; 3490 3490 esac -
configure.ac
rbac5158 r994d080 167 167 AC_SUBST([MACHINE_TYPE],[$host_cpu]) 168 168 169 if ! test "$host_cpu" = "$build_cpu"; then 169 if ! test "$host_cpu" = "$build_cpu"; then 170 170 case $host_cpu in 171 171 i386) 172 CFLAGS+=" -m32"173 CXXFLAGS+=" -m32"174 CFAFLAGS+=" -m32"175 LDFLAGS+=" -m32"172 CFLAGS+="-m32" 173 CXXFLAGS+="-m32" 174 CFAFLAGS+="-m32" 175 LDFLAGS+="-m32" 176 176 ;; 177 177 i686) 178 CFLAGS+=" -m32"179 CXXFLAGS+=" -m32"180 CFAFLAGS+=" -m32"181 LDFLAGS+=" -m32"178 CFLAGS+="-m32" 179 CXXFLAGS+="-m32" 180 CFAFLAGS+="-m32" 181 LDFLAGS+="-m32" 182 182 ;; 183 183 x86_64) 184 CFLAGS+=" -m64"185 CXXFLAGS+=" -m64"186 CFAFLAGS+=" -m64"187 LDFLAGS+=" -m64"184 CFLAGS+="-m64" 185 CXXFLAGS+="-m64" 186 CFAFLAGS+="-m64" 187 LDFLAGS+="-m64" 188 188 ;; 189 189 esac -
src/Parser/DeclarationNode.cc
rbac5158 r994d080 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:55:00 201713 // Update Count : 10 2012 // Last Modified On : Wed Jun 28 15:27:00 2017 13 // Update Count : 1019 14 14 // 15 15 … … 253 253 newnode->type->aggregate.fields = fields; 254 254 newnode->type->aggregate.body = body; 255 newnode->type->aggregate.tagged = false;256 newnode->type->aggregate.parent = nullptr;257 255 return newnode; 258 256 } // DeclarationNode::newAggregate … … 275 273 return newnode; 276 274 } // DeclarationNode::newEnumConstant 277 278 DeclarationNode * DeclarationNode::newTreeStruct( Aggregate kind, const string * name, const string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body ) {279 assert( name );280 DeclarationNode * newnode = new DeclarationNode;281 newnode->type = new TypeData( TypeData::Aggregate );282 newnode->type->aggregate.kind = kind;283 newnode->type->aggregate.name = name;284 newnode->type->aggregate.actuals = actuals;285 newnode->type->aggregate.fields = fields;286 newnode->type->aggregate.body = body;287 newnode->type->aggregate.tagged = true;288 newnode->type->aggregate.parent = parent;289 return newnode;290 } // DeclarationNode::newTreeStruct291 275 292 276 DeclarationNode * DeclarationNode::newName( string * name ) { -
src/Parser/ParseNode.h
rbac5158 r994d080 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:56:00 201713 // Update Count : 7 8012 // Last Modified On : Mon Jun 12 13:00:00 2017 13 // Update Count : 779 14 14 // 15 15 … … 248 248 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 249 249 250 // Perhaps this would best fold into newAggragate.251 static DeclarationNode * newTreeStruct( Aggregate kind, const std::string * name, const std::string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body );252 253 250 DeclarationNode(); 254 251 ~DeclarationNode(); … … 335 332 336 333 static UniqueName anonymous; 337 338 // Temp to test TreeStruct339 const std::string * parent_name;340 334 }; // DeclarationNode 341 335 -
src/Parser/TypeData.cc
rbac5158 r994d080 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:58:00 201713 // Update Count : 56 512 // Last Modified On : Wed Jun 28 15:28:00 2017 13 // Update Count : 564 14 14 // 15 15 … … 63 63 aggregate.fields = nullptr; 64 64 aggregate.body = false; 65 aggregate.tagged = false;66 aggregate.parent = nullptr;67 65 break; 68 66 case AggregateInst: … … 123 121 delete aggregate.actuals; 124 122 delete aggregate.fields; 125 delete aggregate.parent;126 123 // delete aggregate; 127 124 break; … … 195 192 newtype->aggregate.kind = aggregate.kind; 196 193 newtype->aggregate.body = aggregate.body; 197 newtype->aggregate.tagged = aggregate.tagged;198 newtype->aggregate.parent = aggregate.parent ? new string( *aggregate.parent ) : nullptr;199 194 break; 200 195 case AggregateInst: … … 624 619 switch ( td->aggregate.kind ) { 625 620 case DeclarationNode::Struct: 626 if ( td->aggregate.tagged ) {627 at = new StructDecl( *td->aggregate.name, td->aggregate.parent, attributes, linkage );628 buildForall( td->aggregate.params, at->get_parameters() );629 break;630 }631 621 case DeclarationNode::Coroutine: 632 622 case DeclarationNode::Monitor: -
src/Parser/TypeData.h
rbac5158 r994d080 10 10 // Created On : Sat May 16 15:18:36 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:57:00 201713 // Update Count : 18 712 // Last Modified On : Wed Jun 28 15:29:00 2017 13 // Update Count : 186 14 14 // 15 15 … … 31 31 DeclarationNode * fields; 32 32 bool body; 33 34 bool tagged;35 const std::string * parent;36 33 }; 37 34 -
src/Parser/parser.yy
rbac5158 r994d080 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 15 0 9:46:26201713 // Update Count : 245 112 // Last Modified On : Sat Jul 15 08:17:48 2017 13 // Update Count : 2450 14 14 // 15 15 … … 1679 1679 | aggregate_key attribute_list_opt typegen_name // CFA 1680 1680 { $$ = $3->addQualifiers( $2 ); } 1681 1682 // Temp, testing TreeStruct1683 | STRUCT TRY attribute_list_opt no_attr_identifier_or_type_name1684 {1685 typedefTable.makeTypedef( *$4 ); // create typedef1686 if ( forall ) typedefTable.changeKind( *$4, TypedefTable::TG ); // $1687 forall = false; // reset1688 }1689 '{' field_declaration_list '}'1690 {1691 $$ = DeclarationNode::newTreeStruct( DeclarationNode::Struct,1692 $4, nullptr, nullptr, $7, true )->addQualifiers( $3 );1693 }1694 | STRUCT TRY attribute_list_opt no_attr_identifier_or_type_name TYPEDEFname1695 {1696 typedefTable.makeTypedef( *$4 ); // create typedef1697 if ( forall ) typedefTable.changeKind( *$4, TypedefTable::TG ); // $1698 forall = false; // reset1699 }1700 '{' field_declaration_list '}'1701 {1702 $$ = DeclarationNode::newTreeStruct( DeclarationNode::Struct,1703 $4, $5, nullptr, $8, true )->addQualifiers( $3 );1704 }1705 1681 ; 1706 1682 -
src/SymTab/Autogen.cc
rbac5158 r994d080 10 10 // Created On : Thu Mar 03 15:45:56 2016 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:41:00 201713 // Update Count : 6 212 // Last Modified On : Wed Jun 28 15:30:00 2017 13 // Update Count : 61 14 14 // 15 15 … … 401 401 void makeStructFunctions( StructDecl *aggregateDecl, StructInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd, const std::vector< FuncData > & data ) { 402 402 // Builtins do not use autogeneration. 403 if ( aggregateDecl->get_linkage() == LinkageSpec::Builtin CFA||403 if ( aggregateDecl->get_linkage() == LinkageSpec::Builtin || 404 404 aggregateDecl->get_linkage() == LinkageSpec::BuiltinC ) { 405 405 return; -
src/SymTab/module.mk
rbac5158 r994d080 10 10 ## Author : Richard C. Bilson 11 11 ## Created On : Mon Jun 1 17:49:17 2015 12 ## Last Modified By : Andrew Beach13 ## Last Modified On : Wed Jul 12 13:06:00 201714 ## Update Count : 312 ## Last Modified By : Rob Schluntz 13 ## Last Modified On : Tue Jul 07 16:22:23 2015 14 ## Update Count : 2 15 15 ############################################################################### 16 16 … … 21 21 SymTab/ImplementationType.cc \ 22 22 SymTab/TypeEquality.cc \ 23 SymTab/Autogen.cc \ 24 SymTab/TreeStruct.cc 23 SymTab/Autogen.cc -
src/SynTree/Constant.cc
rbac5158 r994d080 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 14:50:00 201713 // Update Count : 2 912 // Last Modified On : Thr Jun 22 10:11:00 2017 13 // Update Count : 28 14 14 // 15 15 … … 46 46 } 47 47 48 Constant Constant::null( Type * ptrtype ) {49 if ( nullptr == ptrtype ) {50 ptrtype = new PointerType(51 Type::Qualifiers(),52 new VoidType( Type::Qualifiers() )53 );54 }55 56 return Constant( ptrtype, "0", (unsigned long long int)0 );57 }58 59 48 unsigned long long Constant::get_ival() const { 60 49 assertf( safe_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve ival from non-integer constant." ); -
src/SynTree/Constant.h
rbac5158 r994d080 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 13:33:00 201713 // Update Count : 1 612 // Last Modified On : Thr Jun 22 10:13:00 2017 13 // Update Count : 15 14 14 // 15 15 … … 44 44 static Constant from_double( double d ); 45 45 46 /// generates a null pointer value for the given type. void * if omitted.47 static Constant null( Type * ptrtype = nullptr );48 49 46 virtual void accept( Visitor & v ) { v.visit( this ); } 50 47 virtual Constant * acceptMutator( Mutator & m ) { return m.mutate( this ); } -
src/SynTree/Declaration.h
rbac5158 r994d080 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:59:00 201713 // Update Count : 12 312 // Last Modified On : Tus Jun 27 15:31:00 2017 13 // Update Count : 122 14 14 // 15 15 … … 266 266 typedef AggregateDecl Parent; 267 267 public: 268 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ), tagged( false ), parent_name( "" ) {} 269 StructDecl( const std::string &name, const std::string *parent, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( DeclarationNode::Struct ), tagged( true ), parent_name( parent ? *parent : "" ) {} 268 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {} 270 269 StructDecl( const StructDecl &other ) : Parent( other ) {} 271 270 … … 274 273 bool is_thread() { return kind == DeclarationNode::Thread; } 275 274 276 // Tagged/Tree Structure Excetion277 bool get_tagged() { return tagged; }278 void set_tagged( bool newValue ) { tagged = newValue; }279 bool has_parent() { return parent_name != ""; }280 std::string get_parentName() { return parent_name; }281 282 275 virtual StructDecl *clone() const { return new StructDecl( *this ); } 283 276 virtual void accept( Visitor &v ) { v.visit( this ); } … … 286 279 DeclarationNode::Aggregate kind; 287 280 virtual std::string typeString() const; 288 289 bool tagged;290 std::string parent_name;291 281 }; 292 282 -
src/benchmark/create_pthrd.c
rbac5158 r994d080 14 14 n = atoi(argv[1]); 15 15 } 16 printf(" create %lu pthreads ...", n);16 printf("%lu\n", n); 17 17 18 18 for (size_t i = 0; i < n; i++) { 19 19 pthread_t thread; 20 20 if (pthread_create(&thread, NULL, foo, NULL) < 0) { 21 perror( "failure" );22 21 return 1; 23 22 } 24 23 25 24 if (pthread_join( thread, NULL) < 0) { 26 perror( "failure" );27 25 return 1; 28 26 } 29 27 } 30 printf("finish\n"); 28 pthread_exit(NULL); 29 return 0; 31 30 } -
src/libcfa/Makefile.am
rbac5158 r994d080 11 11 ## Created On : Sun May 31 08:54:01 2015 12 12 ## Last Modified By : Andrew Beach 13 ## Last Modified On : Fri Jun 14 17:00:00 201714 ## Update Count : 21 613 ## Last Modified On : Wed Jun 28 15:36:00 2017 14 ## Update Count : 215 15 15 ############################################################################### 16 16 … … 51 51 52 52 libobjs = ${headers:=.o} 53 libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} \ 54 exception.c typeobject.c 53 libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} exception.c 55 54 56 55 # not all platforms support concurrency, add option do disable it … … 69 68 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< 70 69 71 libcfa_a-typeobject.o : typeobject.c72 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $<73 74 70 concurrency/libcfa_d_a-invoke.o : concurrency/invoke.c 75 71 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 76 72 77 73 libcfa_d_a-exception.o : exception.c 78 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<79 80 libcfa_d_a-typeobject.o : typeobject.c81 74 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 82 75 -
src/libcfa/concurrency/alarm.c
rbac5158 r994d080 43 43 44 44 void __kernel_set_timer( __cfa_time_t alarm ) { 45 LIB_DEBUG_PRINT_BUFFER_DECL( STDERR_FILENO, "Kernel : set timer to %l lu\n", (__cfa_time_t)alarm );45 LIB_DEBUG_PRINT_BUFFER_DECL( STDERR_FILENO, "Kernel : set timer to %lu\n", (__cfa_time_t)alarm ); 46 46 itimerval val; 47 47 val.it_value.tv_sec = alarm / TIMEGRAN; // seconds 48 val.it_value.tv_usec = max( (alarm % TIMEGRAN) / ( TIMEGRAN / 1_000_000L ), 1000); // microseconds48 val.it_value.tv_usec = (alarm % TIMEGRAN) / ( TIMEGRAN / 1_000_000L ); // microseconds 49 49 val.it_interval.tv_sec = 0; 50 50 val.it_interval.tv_usec = 0; -
src/libcfa/concurrency/alarm.h
rbac5158 r994d080 19 19 20 20 #include <stdbool.h> 21 #include <stdint.h>22 21 23 22 #include "assert" 24 23 25 typedef u int64_t __cfa_time_t;24 typedef unsigned long int __cfa_time_t; 26 25 27 26 struct thread_desc; -
src/libcfa/concurrency/preemption.c
rbac5158 r994d080 66 66 67 67 void tick_preemption() { 68 // LIB_DEBUG_PRINT_BUFFER_DECL( STDERR_FILENO, "Ticking preemption\n" ); 69 68 70 alarm_list_t * alarms = &systemProcessor->alarms; 69 71 __cfa_time_t currtime = __kernel_get_time(); 70 71 // LIB_DEBUG_PRINT_BUFFER_DECL( STDERR_FILENO, "Ticking preemption @ %llu\n", currtime );72 72 while( alarms->head && alarms->head->alarm < currtime ) { 73 73 alarm_node_t * node = pop(alarms); … … 83 83 verify( validate( alarms ) ); 84 84 85 __cfa_time_t period = node->period; 86 if( period > 0 ) { 87 node->alarm = currtime + period; 88 // LIB_DEBUG_PRINT_BUFFER_LOCAL( STDERR_FILENO, "Reinsert %p @ %llu (%llu + %llu)\n", node, node->alarm, currtime, period ); 85 if( node->period > 0 ) { 86 node->alarm = currtime + node->period; 89 87 insert( alarms, node ); 90 88 } … … 103 101 104 102 void update_preemption( processor * this, __cfa_time_t duration ) { 105 LIB_DEBUG_PRINT_BUFFER_DECL( STDERR_FILENO, "Processor : %p updating preemption to %l lu\n", this, duration );103 LIB_DEBUG_PRINT_BUFFER_DECL( STDERR_FILENO, "Processor : %p updating preemption to %lu\n", this, duration ); 106 104 107 105 alarm_node_t * alarm = this->preemption_alarm; … … 275 273 siginfo_t info; 276 274 int sig = sigwaitinfo( &mask, &info ); 277 assertf(sig == SIGALRM, "Kernel Internal Error, sigwait: Unexpected signal %d (%d : %d)\n", sig, info.si_code, info.si_value.sival_int);278 279 LIB_DEBUG_PRINT_SAFE("Kernel : Caught alarm from %d with %d\n", info.si_code, info.si_value.sival_int );280 switch( info.si_code)275 if( sig < 0 ) { 276 abortf( "internal error, sigwait" ); 277 } 278 else if( sig == SIGALRM ) 281 279 { 282 case SI_TIMER: 283 case SI_KERNEL: 284 LIB_DEBUG_PRINT_SAFE("Kernel : Preemption thread tick\n"); 285 lock( &systemProcessor->alarm_lock DEBUG_CTX2 ); 286 tick_preemption(); 287 unlock( &systemProcessor->alarm_lock ); 288 break; 289 case SI_QUEUE: 290 goto EXIT; 291 } 292 } 293 294 EXIT: 280 LIB_DEBUG_PRINT_SAFE("Kernel : Caught signal %d (%d)\n", sig, info.si_value.sival_int ); 281 if( info.si_value.sival_int == 0 ) 282 { 283 LIB_DEBUG_PRINT_SAFE("Kernel : Preemption thread tick\n"); 284 lock( &systemProcessor->alarm_lock DEBUG_CTX2 ); 285 tick_preemption(); 286 unlock( &systemProcessor->alarm_lock ); 287 } 288 else if( info.si_value.sival_int == 1 ) 289 { 290 break; 291 } 292 } 293 else 294 { 295 LIB_DEBUG_PRINT_SAFE("Kernel : Unexpected signal %d (%d)\n", sig, info.si_value.sival_int); 296 } 297 } 298 295 299 LIB_DEBUG_PRINT_SAFE("Kernel : Preemption thread stopping\n"); 296 300 return NULL; -
src/tests/preempt_longrun/Makefile.am
rbac5158 r994d080 31 31 all-local: ${TESTS:=.run} 32 32 33 clean-local:34 rm -f ${TESTS}35 36 33 % : %.c ${CC} 37 34 ${AM_V_GEN}${CC} ${CFLAGS} ${<} -o ${@} -
src/tests/preempt_longrun/Makefile.in
rbac5158 r994d080 790 790 clean: clean-am 791 791 792 clean-am: clean-generic clean-localmostlyclean-am792 clean-am: clean-generic mostlyclean-am 793 793 794 794 distclean: distclean-am … … 857 857 858 858 .PHONY: all all-am all-local check check-TESTS check-am clean \ 859 clean-generic c lean-local cscopelist-am ctags-am distclean \859 clean-generic cscopelist-am ctags-am distclean \ 860 860 distclean-generic distdir dvi dvi-am html html-am info info-am \ 861 861 install install-am install-data install-data-am install-dvi \ … … 875 875 all-local: ${TESTS:=.run} 876 876 877 clean-local:878 rm -f ${TESTS}879 880 877 % : %.c ${CC} 881 878 ${AM_V_GEN}${CC} ${CFLAGS} ${<} -o ${@} -
src/tests/sched-int-barge.c
rbac5158 r994d080 4 4 #include <stdlib> 5 5 #include <thread> 6 7 #ifndef N8 #define N 100_0009 #endif10 6 11 7 enum state_t { WAIT, SIGNAL, BARGE }; … … 77 73 } 78 74 79 if( c->counter >= N) c->done = true;75 if( c->counter >= 100_000 ) c->done = true; 80 76 return !c->done; 81 77 }
Note: See TracChangeset
for help on using the changeset viewer.