Changeset 445 for trunk/user/sort


Ignore:
Timestamp:
May 29, 2018, 9:27:23 AM (7 years ago)
Author:
alain
Message:

Restructure the mini_libc.

Location:
trunk/user/sort
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/user/sort/Makefile

    r444 r445  
    1111OBJS = build/sort.o
    1212
    13 INCLUDES = -I. -I$(LIBC_INCLUDE) -I$(LIBPTHREAD_INCLUDE) -I$(LIBALMOSMKH_INCLUDE) -I$(SHARED_INCLUDE)
     13INCLUDES = -I.                      \
     14           -I$(LIBC_INCLUDE)        \
     15           -I$(LIBPTHREAD_INCLUDE)  \
     16           -I$(LIBALMOSMKH_INCLUDE) \
     17           -I$(SHARED_INCLUDE)
    1418
    1519compile: dirs build/sort.elf
    1620
    1721build/sort.elf : $(OBJS) sort.ld
    18         $(LD) -o $@ -T sort.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lpthread -lalmos-mkh -lc
     22        $(LD) -o $@ -T sort.ld $(OBJS) -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lc -lpthread -lalmosmkh -lpthread -lc
    1923        $(DU) -D $@ > $@.txt
    2024
  • trunk/user/sort/sort.c

    r444 r445  
    2525#include <stdlib.h>
    2626#include <pthread.h>
    27 #include <almos-mkh.h>
     27#include <almosmkh.h>
    2828
    2929#define ARRAY_LENGTH        0x400    // 1024 values
     
    163163    bubbleSort( array0, items, items * thread_uid );
    164164
    165     printf("\n[SORT] thread[%d] / stage 0 completed\n", thread_uid );
     165    printf("\n[SORT] thread[%d] : stage 0 completed\n", thread_uid );
    166166
    167167    /////////////////////////////////
     
    177177        if( (thread_uid & ((1<<i)-1)) == 0 )
    178178        {
    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 );
    180180
    181181            if((i % 2) == 1)               // odd stage
     
    197197                   items * thread_uid );
    198198
    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 );
    200200        }
    201201
     
    328328
    329329#if INTERACTIVE_MODE
    330 idbg();
     330// idbg();
    331331#endif
    332332            }
     
    336336    get_cycle( &cycle );
    337337    printf("\n[SORT] main completes threads create at cycle %d\n", (unsigned int)cycle );
    338 
    339     // main run also the sort() function
    340     sort( &arg[main_uid] );
    341338
    342339#if INTERACTIVE_MODE
     
    344341#endif
    345342   
     343    // the main thread run also the sort() function
     344    sort( &arg[main_uid] );
     345
    346346    // Check result
    347347    int    success = 1;
Note: See TracChangeset for help on using the changeset viewer.