Changeset 651 for trunk/kernel/mm/vseg.c


Ignore:
Timestamp:
Nov 14, 2019, 11:50:09 AM (4 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/vseg.c

    r635 r651  
    8181}
    8282
    83 ///////////////////////////////////
    84 void vseg_init( vseg_t      * vseg,
    85                 vseg_type_t   type,
    86                     intptr_t      base,
    87                 uint32_t      size,
    88                 vpn_t         vpn_base,
    89                 vpn_t         vpn_size,
    90                         uint32_t      file_offset,
    91                 uint32_t      file_size,
    92                 xptr_t        mapper_xp,
    93                 cxy_t         cxy )
     83/////////////////////////////////////////
     84void vseg_init_flags( vseg_t      * vseg,
     85                      vseg_type_t   type )
    9486{
    95     vseg->type        = type;
    96         vseg->min         = base;
    97         vseg->max         = base + size;
    98     vseg->vpn_base    = vpn_base;
    99         vseg->vpn_size    = vpn_size;
    100     vseg->file_offset = file_offset;
    101     vseg->file_size   = file_size;
    102         vseg->mapper_xp   = mapper_xp;
    103     vseg->cxy         = cxy;
    104 
    10587    // set vseg flags depending on type
    106         if     ( type == VSEG_TYPE_CODE )
     88        if( type == VSEG_TYPE_CODE )
    10789    {
    10890        vseg->flags = VSEG_USER    |
Note: See TracChangeset for help on using the changeset viewer.