Changeset 457 for trunk/libs


Ignore:
Timestamp:
Aug 2, 2018, 11:47:13 AM (6 years ago)
Author:
alain
Message:

This version modifies the exec syscall and fixes a large number of small bugs.
The version number has been updated (0.1)

Location:
trunk/libs
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/libs/libalmosmkh/almosmkh.c

    r445 r457  
    2424#include <almosmkh.h>
    2525#include <hal_user.h>
    26 #include <hal_types.h>
     26#include <hal_shared_types.h>
    2727#include <syscalls_numbers.h>
    2828#include <string.h>
     
    3939    return hal_user_syscall( SYS_FG,
    4040                             (reg_t)pid, 0, 0, 0 );
     41}
     42
     43//////////////////////////////
     44int is_fg( unsigned int   pid,
     45           unsigned int * owner )
     46{
     47    return hal_user_syscall( SYS_IS_FG,
     48                             (reg_t)pid,
     49                             (reg_t)owner, 0, 0 );
    4150}
    4251
     
    224233//////////////////////////////////
    225234int trace( unsigned int active,
    226            unsigned int pid,
     235           unsigned int cxy,
    227236           unsigned int lid )
    228237{
    229238    return hal_user_syscall( SYS_TRACE,
    230239                             (reg_t)active,
    231                              (reg_t)pid,
     240                             (reg_t)cxy,
    232241                             (reg_t)lid, 0 );
    233242}
     
    316325
    317326
    318 ///////////////    non standard debug functions    //////////////////////////
     327///////////////    non standard malloc functions    //////////////////////////
    319328
    320329#define  MALLOC_DEBUG  0
  • trunk/libs/libalmosmkh/almosmkh.h

    r450 r457  
    2626
    2727/***************************************************************************************
    28  * various the user level, ALMOS-MKH specific library. It contains:
     28 * This file defines an user level, ALMOS-MKH specific library, containing:
    2929 * - non standard system calls.
    3030 * - debug functions.
     
    4040/***************************************************************************************
    4141 * This function is used to give the process identified by the <pid> argument the
    42  * exclusive ownership of the attached TXT_RX terminal.
     42 * exclusive ownership of its TXT terminal.
    4343 ***************************************************************************************
    4444 * @ pid        : process identifier.
     
    4646 **************************************************************************************/
    4747int fg( unsigned int pid );
     48
     49/***************************************************************************************
     50 * This function stores in the buffer identified by the <owner> argument a non zero
     51 * value when the process identified by the <pid> argument is currently the exclusive
     52 * owner of its TXT terminal.
     53 ***************************************************************************************
     54 * @ pid        : [in]  process identifier.
     55 * @ owner      : [out] pointer on buffer to store the
     56 * @ returns O if success / returns -1 if process not found.
     57 **************************************************************************************/
     58int is_fg( unsigned int pid,
     59           unsigned int * owner );
    4860
    4961/***************************************************************************************
  • trunk/libs/libpthread/Makefile

    r445 r457  
    99endif
    1010
    11 SRCS = pthread.c
    12 
    13 OBJS = $(addprefix build/, $(SRCS:.c=.o)) \
     11OBJS = build/pthread.o                    \
    1412       $(HAL_ARCH)/build/core/hal_user.o
    1513
     
    3735
    3836headers: build
    39         cp $(SRCS:.c=.h)  build/include/.
     37        cp pthread.h  build/include/.
    4038
    4139
  • trunk/libs/libpthread/pthread.c

    r445 r457  
    11/*
    2  * pthread.c - User leve <pthread> library implementation.
     2 * pthread.c - User level <pthread> library implementation.
    33 *
    44 * Author     Alain Greiner (2016,2017,2018)
     
    2323
    2424#include <hal_user.h>
    25 #include <hal_types.h>
     25#include <hal_shared_types.h>
    2626#include <stdio.h>
    2727#include <stdlib.h>
    2828#include <pthread.h>
     29#include <shared_pthread.h>
    2930#include <almosmkh.h>
    3031#include <syscalls_numbers.h>
  • trunk/libs/libpthread/pthread.h

    r445 r457  
    2525#define _PTHREAD_H_
    2626
     27//////////////////////////////////////////////////////////////////////////////////////////////
     28//             POSIX Threads related functions (including barriers and mutexes)
     29//////////////////////////////////////////////////////////////////////////////////////////////
     30
    2731#include <shared_pthread.h>
    28 
    29 //////////////////////////////////////////////////////////////////////////////////////////////
    30 //             POSIX Threads related functions
    31 //////////////////////////////////////////////////////////////////////////////////////////////
    3232
    3333/*********************************************************************************************
  • trunk/libs/mini-libc/dirent.c

    r449 r457  
    2323
    2424#include <dirent.h>
    25 #include <hal_types.h>
     25#include <hal_shared_types.h>
    2626#include <hal_user.h>
    2727#include <syscalls_numbers.h>
  • trunk/libs/mini-libc/fcntl.c

    r449 r457  
    2323
    2424#include <fcntl.h>
    25 #include <hal_types.h>
     25#include <hal_shared_types.h>
    2626#include <hal_user.h>
    2727#include <syscalls_numbers.h>
  • trunk/libs/mini-libc/mman.c

    r449 r457  
    2323
    2424#include <mman.h>
    25 #include <hal_types.h>
     25#include <hal_shared_types.h>
    2626#include <hal_user.h>
    2727#include <syscalls_numbers.h>
  • trunk/libs/mini-libc/signal.c

    r449 r457  
    11/*
    2  * signal.c - User side signals related syscalls implementation.
     2 * signal.c - User side signals related library implementation.
    33 *
    44 * Author     Alain Greiner (2016,2017,2018)
     
    2323
    2424#include <signal.h>
    25 #include <hal_types.h>
     25#include <hal_shared_types.h>
    2626#include <hal_user.h>
    2727#include <syscalls_numbers.h>
  • trunk/libs/mini-libc/stat.c

    r449 r457  
    11/*
    2  * stat.c - User side file stat related syscalls implementation.
     2 * stat.c - User side file statistics related library implementation.
    33 *
    44 * Author     Alain Greiner (2016,2017,2018)
     
    2424#include <stat.h>
    2525#include <hal_user.h>
    26 #include <hal_types.h>
     26#include <hal_shared_types.h>
    2727#include <syscalls_numbers.h>
    2828
  • trunk/libs/mini-libc/stdio.c

    r445 r457  
    266266    if ( count == -1 )
    267267    {
    268         display_string( "stdlib : xprintf failure" );
     268        display_string( "printf : xprintf failure" );
    269269        return -1;
    270270    }
     
    272272    {
    273273        string[count] = 0;
    274         return write( 1 , &string , count + 1 );
     274        return write( 1 , &string , count );
    275275    }
    276276}
  • trunk/libs/mini-libc/stdlib.c

    r445 r457  
    2323
    2424#include <stdlib.h>
    25 #include <hal_types.h>
     25#include <hal_shared_types.h>
    2626#include <hal_user.h>
     27#include <syscalls_numbers.h>
    2728#include <almosmkh.h>
    2829#include <stdio.h>
    29 #include <syscalls_numbers.h>
    3030
    3131//////////////////////////
  • trunk/libs/mini-libc/time.c

    r449 r457  
    2424#include <time.h>
    2525#include <hal_user.h>
    26 #include <hal_user.h>
    27 #include <hal_types.h>
     26#include <hal_shared_types.h>
    2827#include <syscalls_numbers.h>
    2928
     
    3231                  struct timezone * tz )
    3332{
    34     return hal_user_syscall( SYS_TIMEOFDAY, // TODO SYS_SIGNAL ?
     33    return hal_user_syscall( SYS_TIMEOFDAY,
    3534                             (reg_t)tv,
    3635                             (reg_t)tz, 0, 0 );
  • trunk/libs/mini-libc/unistd.c

    r449 r457  
    2323
    2424#include <unistd.h>
    25 #include <hal_types.h>
     25#include <hal_shared_types.h>
    2626#include <hal_user.h>
    2727#include <syscalls_numbers.h>
  • trunk/libs/mini-libc/wait.c

    r449 r457  
    2424#include <wait.h>
    2525#include <hal_user.h>
    26 #include <hal_types.h>
     26#include <hal_shared_types.h>
    2727#include <syscalls_numbers.h>
    2828
  • trunk/libs/mini-libc/wait.h

    r449 r457  
    3737 * This blocking function returns only when one child process of the calling process
    3838 * changes state (from RUNNING to STOPPED / EXITED / KILLED). It returns the terminating
    39  * child process PID, and set in the <status> buffer the new child process state.
     39 * child process PID, and set in the <status> buffer the terminating child process state.
    4040 *****************************************************************************************
    41  * @ status    : [out] terminating child process state.
     41 * @ status    : [out] pointer on buffer for terminating child process state.
    4242 * @ returns terminating child process pid.
    4343 ****************************************************************************************/
Note: See TracChangeset for help on using the changeset viewer.