Changeset 459 for trunk/user


Ignore:
Timestamp:
Aug 13, 2018, 1:43:20 PM (3 years ago)
Author:
alain
Message:

Introduce the math library, to support the floating point
data used by the multi-thread fft application.
Fix several bugs regarding the FPU context save/restore.
Introduce support for the %f format in printf.

Location:
trunk/user
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/user/ksh/ksh.c

    r458 r459  
    795795        unsigned int state;                   // escape sequence state
    796796
    797 char string[80];
     797// @@@
     798// parse( "load /bin/user/fft.elf" );
     799// @@@
    798800
    799801        enum fsm_states
     
    10001002    // get KSH process pid and core
    10011003    parent_pid = getpid();
    1002     get_core( &cxy , & lid );
    1003 
    1004         printf( "\n\n~~~ KSH on core[%x,%d] ~~~\n\n", cxy , lid );
     1004    get_core( &cxy , &lid );
    10051005
    10061006    // initializes the semaphore used to unblock the interactive thread
  • trunk/user/sort/Makefile

    r445 r459  
    11############################################################################
    2 # Makefile for the ALMOS-MKH "sort" application
     2# Makefile for the "sort" application running on ALMOS-MKH
    33############################################################################
    44
     
    1515           -I$(LIBPTHREAD_INCLUDE)  \
    1616           -I$(LIBALMOSMKH_INCLUDE) \
    17            -I$(SHARED_INCLUDE)
     17           -I$(SHARED_INCLUDE)      \
     18           -I$(HAL_INCLUDE)
    1819
    1920compile: dirs build/sort.elf
    2021
    2122build/sort.elf : $(OBJS) sort.ld
    22         $(LD) -o $@ -T sort.ld $(OBJS) -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lc -lpthread -lalmosmkh -lpthread -lc
     23        $(LD) -o $@ -T sort.ld $(OBJS) -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) \
     24        -lc -lpthread -lalmosmkh -lpthread -lc
    2325        $(DU) -D $@ > $@.txt
    2426
  • trunk/user/sort/sort.c

    r457 r459  
    2626#include <pthread.h>
    2727#include <almosmkh.h>
     28#include <hal_macros.h>
    2829
    2930#define ARRAY_LENGTH        0x400    // 1024 values
     
    3334#define DISPLAY_ARRAY       0
    3435#define INTERACTIVE_MODE    0
    35 
    36 ///////////////////////////////////////////////////////
    37 // macros for fixed format cxy <=> (x,y) translation
    38 // TODO these macros are only for TSAR architecture...
    39 ///////////////////////////////////////////////////////
    40 
    41 #define CXY_FROM_XY( x , y )  ((x<<4) + y)
    42 
    43 #define X_FROM_CXY( cxy )     ((cxy>>4) & 0xF)
    44 
    45 #define Y_FROM_CXY( cxy )     (cxy & 0xF)
    4636
    4737/////////////////////////////////////////////////////////////
     
    239229    // get core coordinates and user index for the main thread
    240230    get_core( &main_cxy , & main_lid );
    241     main_x   = X_FROM_CXY( main_cxy );
    242     main_y   = Y_FROM_CXY( main_cxy );
     231    main_x   = HAL_X_FROM_CXY( main_cxy );
     232    main_y   = HAL_Y_FROM_CXY( main_cxy );
    243233    main_uid = (((main_x * y_size) + main_y) * ncores) + main_lid;
    244234
     
    308298                // set thread attributes for all threads
    309299                attr[thread_uid].attributes = PT_ATTR_CLUSTER_DEFINED | PT_ATTR_CORE_DEFINED;
    310                 attr[thread_uid].cxy        = CXY_FROM_XY( x , y );
     300                attr[thread_uid].cxy        = HAL_CXY_FROM_XY( x , y );
    311301                attr[thread_uid].lid        = lid;
    312302
Note: See TracChangeset for help on using the changeset viewer.