Changeset 445 for trunk/user


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

Restructure the mini_libc.

Location:
trunk/user
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/user/idbg/Makefile

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

    r444 r445  
    88///////////////////////////////////////////////////////////////////////////////
    99
    10 
    1110#include <stdlib.h>
    1211#include <stdio.h>
    13 #include <almos-mkh.h>
     12#include <almosmkh.h>
    1413
    1514///////////
  • trunk/user/init/Makefile

    r444 r445  
    11#########################################################################
    2 # Makefile for the ALMOS-MKH "init" application
     2# Makefile for the "init" application
    33#########################################################################
    44
     
    1111OBJS = build/init.o
    1212
    13 INCLUDES = -I.                   \
    14            -I../..               \
    15            -I$(LIBC_INCLUDE)/    \
    16            -I$(LIBPTHREAD_INCLUDE) \
     13INCLUDES = -I.                      \
     14           -I../..                  \
     15           -I$(LIBC_INCLUDE)        \
     16           -I$(LIBPTHREAD_INCLUDE)  \
    1717           -I$(LIBALMOSMKH_INCLUDE) \
    1818           -I$(SHARED_INCLUDE)
    1919
    2020compile : dirs build/init.elf
     21
    2122build/init.elf : $(OBJS) init.ld
    22         $(LD) -o $@ -T init.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lc -lpthread -lalmos-mkh -lpthread -lc
     23        $(LD) -o $@ -T init.ld $(OBJS) -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lc -lpthread -lalmosmkh -lpthread -lc
    2324        $(DU) -D $@ > $@.txt
    2425
  • trunk/user/init/init.c

    r444 r445  
    1717#include <stdio.h>
    1818#include <pthread.h>
    19 #include <almos-mkh.h>
    20 #include <assert.h>
     19#include <almosmkh.h>
    2120#include <sys/wait.h>
    2221
    2322#define DEBUG_PROCESS_INIT    0
    2423
    25 // TODO make the cxy computation portable [AG]
     24// TODO make the cxy computation portable
     25// and avoid this TSAR specific define [AG]
     26
    2627#define CXY_FROM_XY( x , y )  ((x<<4) + y)
     28
     29// TODO improve the get_config() syscall to return nb_txt_channels
     30// and avoid the hard_config include [AG]
    2731
    2832//////////
     
    3741
    3842    // check number of TXT channels
    39     assert( NB_TXT_CHANNELS > 1 );
     43    if( NB_TXT_CHANNELS < 2 )
     44    {
     45        printf("\n[ERROR] in init process : number of TXT channels must be larger than 1\n");
     46        exit( EXIT_FAILURE );
     47    }
    4048
    4149    // create the KSH processes (one per user terminal)
     
    7381             display_string( string );
    7482        }
     83
     84        // INIT wait CHILD[i] process deletion before creating KSH[i+1]
     85        // int n;
     86        // for( n = 0 ; n < 100000 ; n++ ) asm volatile ( "nop" );
     87        wait( &status );
    7588    }
    7689 
  • trunk/user/ksh/Makefile

    r444 r445  
    11#########################################################################
    2 # Makefile for the ALMOS-MKH "ksh" application
     2#     Makefile for the "ksh" application                                #
    33#########################################################################
    44
    55-include ../../params-soft.mk
     6
    67ifeq ($(ARCH_NAME),)
    78$(error Please define in ARCH_NAME parameter in params-soft.mk!)
     
    1011OBJS = build/ksh.o
    1112
    12 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)
    1318
    1419compile: dirs build/ksh.elf
     20
    1521build/ksh.elf : $(OBJS) ksh.ld
    16         $(LD) -o $@ -T ksh.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lpthread -lc -lalmos-mkh -lc -lpthread -lc
     22        $(LD) -o $@ -T ksh.ld $(OBJS) -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lc -lpthread -lalmosmkh -lpthread -lc
    1723        $(DU) -D $@ > $@.txt
    1824
  • trunk/user/ksh/ksh.c

    r444 r445  
    1313#include <signal.h>
    1414#include <unistd.h>
    15 #include <almos-mkh.h>
     15#include <almosmkh.h>
    1616
    1717#define CMD_MAX_SIZE   (256)    // max number of characters in one command
     
    320320
    321321        display_chdev();
     322    }
     323    else if( strcmp( argv[1] , "dqdt" ) == 0 )
     324    {
     325        if( argc != 2 )
     326        {
     327                    printf("  usage: display dqdt\n");
     328                    return;
     329            }
     330
     331        display_dqdt();
    322332    }
    323333    else
  • trunk/user/pgcd/Makefile

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

    r444 r445  
    88
    99
    10 #include <stdlib.h>
    1110#include <stdio.h>
    12 #include <almos-mkh.h>
     11#include <almosmkh.h>
    1312
    1413///////////
     
    2019
    2120    get_cycle( &cycle );
    22     printf( "\n[PGCD] starts / cycle %d\n", (unsigned int)cycle );
     21    printf( "\n\n[PGCD] starts / cycle %d\n", (unsigned int)cycle );
    2322
    2423    while (1)
  • 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.