Changeset 445 for trunk/user/sort
- Timestamp:
- May 29, 2018, 9:27:23 AM (7 years ago)
- Location:
- trunk/user/sort
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/user/sort/Makefile
r444 r445 11 11 OBJS = build/sort.o 12 12 13 INCLUDES = -I. -I$(LIBC_INCLUDE) -I$(LIBPTHREAD_INCLUDE) -I$(LIBALMOSMKH_INCLUDE) -I$(SHARED_INCLUDE) 13 INCLUDES = -I. \ 14 -I$(LIBC_INCLUDE) \ 15 -I$(LIBPTHREAD_INCLUDE) \ 16 -I$(LIBALMOSMKH_INCLUDE) \ 17 -I$(SHARED_INCLUDE) 14 18 15 19 compile: dirs build/sort.elf 16 20 17 21 build/sort.elf : $(OBJS) sort.ld 18 $(LD) -o $@ -T sort.ld $(OBJS) - nostdlib -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lpthread -lalmos-mkh-lc22 $(LD) -o $@ -T sort.ld $(OBJS) -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lc -lpthread -lalmosmkh -lpthread -lc 19 23 $(DU) -D $@ > $@.txt 20 24 -
trunk/user/sort/sort.c
r444 r445 25 25 #include <stdlib.h> 26 26 #include <pthread.h> 27 #include <almos -mkh.h>27 #include <almosmkh.h> 28 28 29 29 #define ARRAY_LENGTH 0x400 // 1024 values … … 163 163 bubbleSort( array0, items, items * thread_uid ); 164 164 165 printf("\n[SORT] thread[%d] /stage 0 completed\n", thread_uid );165 printf("\n[SORT] thread[%d] : stage 0 completed\n", thread_uid ); 166 166 167 167 ///////////////////////////////// … … 177 177 if( (thread_uid & ((1<<i)-1)) == 0 ) 178 178 { 179 printf("\n[SORT] thread[%d] /stage %d start\n", thread_uid , i );179 printf("\n[SORT] thread[%d] : stage %d start\n", thread_uid , i ); 180 180 181 181 if((i % 2) == 1) // odd stage … … 197 197 items * thread_uid ); 198 198 199 printf("\n[SORT] thread[%d] /stage %d completed\n", thread_uid , i );199 printf("\n[SORT] thread[%d] : stage %d completed\n", thread_uid , i ); 200 200 } 201 201 … … 328 328 329 329 #if INTERACTIVE_MODE 330 idbg();330 // idbg(); 331 331 #endif 332 332 } … … 336 336 get_cycle( &cycle ); 337 337 printf("\n[SORT] main completes threads create at cycle %d\n", (unsigned int)cycle ); 338 339 // main run also the sort() function340 sort( &arg[main_uid] );341 338 342 339 #if INTERACTIVE_MODE … … 344 341 #endif 345 342 343 // the main thread run also the sort() function 344 sort( &arg[main_uid] ); 345 346 346 // Check result 347 347 int success = 1;
Note: See TracChangeset
for help on using the changeset viewer.