Changeset 597 for trunk/libs


Ignore:
Timestamp:
Nov 10, 2018, 2:56:43 PM (6 years ago)
Author:
alain
Message:

Rewrite the mmap() and stat() syscalls to implement the cat command in ksh.

Location:
trunk/libs
Files:
6 edited

Legend:

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

    r589 r597  
    219219}
    220220
    221 ////////////////////////////////
     221////////////////////////////////////
    222222int display_sched( unsigned int cxy,
    223223                   unsigned int lid )
     
    229229}
    230230
    231 /////////////////////////////////////////////////
     231////////////////////////////////////////////////
    232232int display_cluster_processes( unsigned int cxy,
    233233                               unsigned int owned )
     
    271271}
    272272
     273////////////////////////
     274int display_dqdt( void )
     275{
     276    return hal_user_syscall( SYS_DISPLAY,
     277                             DISPLAY_DQDT, 0, 0, 0 );
     278}
     279
    273280///////////////////////////////
    274281int trace( unsigned int active,
     
    281288                             (reg_t)lid, 0 );
    282289}
    283 
    284 ////////////////////////
    285 int display_dqdt( void )
    286 {
    287     return hal_user_syscall( SYS_DISPLAY,
    288                              DISPLAY_DQDT, 0, 0, 0 );
    289 }
    290290
    291291/////////////////
  • trunk/libs/libalmosmkh/almosmkh.h

    r589 r597  
    138138 * @ return 0 if success / return -1 if illegal argument.
    139139 **************************************************************************************/
    140 int display_vmm(unsigned int cxy, unsigned int  pid );
     140int display_vmm(unsigned int cxy, unsigned int pid );
    141141
    142142/***************************************************************************************
     
    174174 **************************************************************************************/
    175175int display_txt_processes( unsigned int txt_id );
     176
     177/***************************************************************************************
     178 * This debug syscall displays on the kernel terminal TXT0
     179 * the set of busylocks hold by a thread identified by the <pid> and <trdid> arguments.
     180 * It can be called by any thread running in any cluster.
     181 ***************************************************************************************
     182 * @ pid      : [in] process identifier.
     183 * @ trdid    : [in] thread identifier.
     184 * @ return 0 if success / return -1 if illegal arguments.
     185 **************************************************************************************/
     186int display_busylocks( unsigned int pid,
     187                       unsigned int trdid );
    176188
    177189/***************************************************************************************
  • trunk/libs/mini-libc/mman.c

    r473 r597  
    2828#include <stdio.h>
    2929
    30 ////////////////////////////////y
     30////////////////////////////////
    3131int munmap( void         * addr,
    3232            unsigned int   size )
     
    4747    mmap_attr_t attr;
    4848
    49     attr.addr   = addr;
     49    // addr argument must be NULL
     50    if( addr != NULL )
     51    {
     52        printf("\n[ERROR] in %s : the <addr> argument must be NULL\n", __FUNCTION__ );
     53        return NULL;
     54    }
     55
     56    //set the mmap attributes
     57    attr.addr   = NULL;
    5058    attr.length = length;
    5159    attr.prot   = prot;
  • trunk/libs/mini-libc/mman.h

    r449 r597  
    4040 * @ addr    : requested address in virtual space / unused : should be NULL.
    4141 * @ length  : requested number of bytes.
    42  * @ prot    : access mode.
    43  * @ flags   : MAP_FILE / MAP_ANON / MAP_PRIVATE / MAP_SHARED.
     42 * @ prot    : access mode bit vector (PROT_EXEC / PROT_READ / PROT_WRITE)
     43 * @ flags   : bit_vector (MAP_FILE / MAP_ANON / MAPREMOTE / MAP_PRIVATE / MAP_SHARED)
    4444 * @ fdid    : file descriptor index (if MAP_FILE).
    4545 * @ offset  : offset in file (if MAP_FILE).
  • trunk/libs/mini-libc/stat.c

    r457 r597  
    4545}
    4646
    47 ///////////////////////////////
    48 int chmod( char     * pathname,
     47///////////////////////////////////
     48int chmod( char         * pathname,
    4949           unsigned int   rights )
    5050{
  • trunk/libs/mini-libc/stat.h

    r449 r597  
    7777int stat( const char  * pathname,
    7878          struct stat * stat );
     79
    7980#endif /* _SYS_STAT_H_ */
Note: See TracChangeset for help on using the changeset viewer.