Changeset 651 for trunk/kernel/libk


Ignore:
Timestamp:
Nov 14, 2019, 11:50:09 AM (5 years ago)
Author:
alain
Message:

1) Improve the VMM MMAP allocator: implement the "buddy" algorithm
to allocate only aligned blocks.
2) fix a bug in the pthread_join() / pthread_exit() mmechanism.

Location:
trunk/kernel/libk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/elf.c

    r635 r651  
    216216                          process_t * process )
    217217{
     218    uint32_t     new_offset;       // unused, required by vfs_lseek()
    218219        kmem_req_t   req;              // kmem request for program header
    219220        Elf_Ehdr     header;           // local buffer for .elf header
     
    274275
    275276        // set seek pointer in file descriptor to access segment descriptors array
    276         error = vfs_lseek( file_xp , header.e_phoff, SEEK_SET , NULL );
     277        error = vfs_lseek( file_xp , header.e_phoff, SEEK_SET , &new_offset );
    277278
    278279        if( error )
  • trunk/kernel/libk/list.h

    r636 r651  
    6161
    6262/***************************************************************************
    63  * This macro return an uint32_t that is the offset (number of bytes)
     63 * This macro return an intptr_t that is the offset (number of bytes)
    6464 * of a field in a structure.
     65 ***************************************************************************
    6566 * @ type   : structure type
    6667 * @ member : name of the field
  • trunk/kernel/libk/user_dir.h

    r635 r651  
    3737 * - An user process open a directory by calling the "opendir()" syscall.
    3838 *   The user_dir_create() function allocates physical memory to create in the cluster
    39  *   containing the target inode one or several physical pages to implement an array
    40  *   of "dirent", mapped in the user process space as an ANON vseg. It allocates also
    41  *   an "user_dir_t" descriptor structure defined below, registered in the xlist rooted
    42  *   in the reference user process descriptor.
     39 *   containing the directory inode one or several physical pages to implement an array
     40 *   of "dirent". This array is mapped in the user process space as an ANON vseg.
     41 *   It allocates also an "user_dir_t" descriptor structure defined below, registered
     42 *   in the xlist rooted in the reference user process descriptor.
    4343 * - This "user_dir_t" structure contains the total number of "entries", the "current"
    4444 *   pointer used by the readdir() syscall, and an "ident" field, that is actually
     
    104104 * structures rooted in the reference process descriptor, release all memory
    105105 * allocated for the user_dir_t struct in the directory inode cluster, including
    106  * the dirent array, and delete all ANON vseg copies in all process VMM copies,
     106 * the dirent array, and delete the ANON vseg copies in all process VMM copies,
    107107 * using parallel RPCs.
    108108 * It must be executed by a thread running in the cluster containing the target inode.
Note: See TracChangeset for help on using the changeset viewer.