Changeset 623 for trunk/libs


Ignore:
Timestamp:
Mar 6, 2019, 4:37:15 PM (3 years ago)
Author:
alain
Message:

Introduce three new types of vsegs (KCODE,KDATA,KDEV)
to map the kernel vsegs in the process VSL and GPT.
This now used by both the TSAR and the I86 architectures.

Location:
trunk/libs
Files:
5 edited

Legend:

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

    r611 r623  
    288288                             (reg_t)page_id,
    289289                             (reg_t)nbytes );
     290}
     291
     292///////////////////////////////////////
     293int display_barrier( unsigned int pid )
     294{
     295    return hal_user_syscall( SYS_DISPLAY,
     296                             DISPLAY_BARRIER,
     297                             (reg_t)pid, 0, 0 );
    290298}
    291299
  • trunk/libs/libalmosmkh/almosmkh.h

    r611 r623  
    227227                    unsigned int  nbytes);
    228228
     229/***************************************************************************************
     230 * This debug syscall displays on the kernel terminal TXT0
     231 * the state of the barrier used by the process identified by the <pid> argument.
     232 * It can be called by any thread running in any cluster.
     233 ***************************************************************************************
     234 * @ pid      : [in] process identifier.
     235 * @ return 0 if success / return -1 if illegal arguments.
     236 **************************************************************************************/
     237int display_barrier( unsigned int pid );
     238
    229239/*****************************************************************************************
    230240* This debug syscall is used to activate / desactivate the context switches trace
  • trunk/libs/mini-libc/mman.h

    r597 r623  
    3838 * virtual space, as defined by the arguments.
    3939 *****************************************************************************************
    40  * @ addr    : requested address in virtual space / unused : should be NULL.
     40 * @ addr    : requested address in virtual space / unsupported : should be NULL.
    4141 * @ length  : requested number of bytes.
    4242 * @ prot    : access mode bit vector (PROT_EXEC / PROT_READ / PROT_WRITE)
    43  * @ flags   : bit_vector (MAP_FILE / MAP_ANON / MAPREMOTE / MAP_PRIVATE / MAP_SHARED)
     43 * @ flags   : bit_vector (MAP_FILE / MAP_ANON / MAP_REMOTE / MAP_PRIVATE / MAP_SHARED)
    4444 * @ fdid    : file descriptor index (if MAP_FILE).
    4545 * @ offset  : offset in file (if MAP_FILE).
  • trunk/libs/mini-libc/stdio.c

    r610 r623  
    3535////////////////////////////////////////////////////////////////////////////////////////
    3636
     37// This user space array registers all FILE descriptors open by a given process
    3738FILE open_file_array[MAX_OPEN_FILE_PER_PROCESS];  // array of open files structures
    3839
     
    340341    if( mode != NULL )
    341342    {
    342         printf("\n[ERROR] in %s : the mode argument must be NULL\n", __FUNCTION__ );
     343        printf("\n[%s] error : the mode argument must be NULL\n", __FUNCTION__ );
    343344        return NULL;
    344345    }
     
    351352    if( fd < 0 )
    352353    {
    353         printf("\n[ERROR] in %s : file %s not found\n", __FUNCTION__ , pathname );
     354        printf("\n[%s] error : file <%s> not found\n", __FUNCTION__ , pathname );
    354355        return NULL;
    355356    }
    356357    if( fd > MAX_OPEN_FILE_PER_PROCESS )
    357358    {
    358         printf("\n[ERROR] in %s : not enough space for file %s\n", __FUNCTION__ , pathname );
     359        printf("\n[%s] error : not enough space for file <%s>\n", __FUNCTION__ , pathname );
    359360        return NULL;
    360361    }
     
    365366
    366367    return &open_file_array[fd];
     368
    367369}  // end fopen()
    368370
     
    376378    int fd = stream->fd;
    377379
    378     // remove stream from open_file_array[]
     380    // remove stream from user open_file_array[]
    379381    open_file_array[fd].key = 0;
    380382   
    381     return close( fd );
     383    // close the kernel file descriptor
     384    if( close( fd ) )
     385    {
     386        printf("\n[%s] error : cannot close file %d\n", __FUNCTION__ , fd );
     387        return -1;
     388    }
     389
     390    return 0;
     391
    382392}  // end fclose()
    383393
     
    407417        // get file descriptor from file pointer
    408418        fd = stream->fd;
    409        
     419
     420        // set terminating NUL
    410421        string[count] = 0;
    411422
     423printf("\n[%s] fd = %d for string :\n", __FUNCTION__, fd, string );
     424
    412425        return write( fd , &string , count );
    413426    }
  • trunk/libs/mini-libc/stdio.h

    r610 r623  
    4040 ********************************************************************************************/
    4141
    42 typedef struct file_s
     42typedef struct stream_s
    4343{
    44     int fd;
    45     int key;
     44    int fd;          // index in both kernel fd_array[], and user open_file_array[]
     45    int key;         // entry valid in open_file_array[] when (key == VALID_OPEN_FILE)
    4646}
    4747FILE;
Note: See TracChangeset for help on using the changeset viewer.