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


Ignore:
Timestamp:
Mar 6, 2019, 4:37:15 PM (5 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.

File:
1 edited

Legend:

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

    r595 r623  
    44 * Authors   Ghassan Almaless (2008,2009,2010,2011, 2012)
    55 *           Mohamed Lamine Karaoui (2015)
    6  *           Alain Greiner (2016,2018,2019)
     6 *           Alain Greiner (2016,2017,2018,2019)
    77 *
    88 * Copyright (c) UPMC Sorbonne Universites
     
    5555        else if( vseg_type == VSEG_TYPE_FILE   ) return "FILE";
    5656        else if( vseg_type == VSEG_TYPE_REMOTE ) return "REMO";
     57        else if( vseg_type == VSEG_TYPE_KCODE  ) return "KCOD";
     58        else if( vseg_type == VSEG_TYPE_KDATA  ) return "KDAT";
     59        else if( vseg_type == VSEG_TYPE_KDEV   ) return "KDEV";
    5760    else                                     return "undefined";
    5861}
     
    142145                      VSEG_CACHE   ;
    143146    }
     147    else if( type == VSEG_TYPE_KCODE )
     148    {
     149        vseg->flags = VSEG_EXEC    |
     150                      VSEG_CACHE   |
     151                      VSEG_PRIVATE ;
     152    }
     153    else if( type == VSEG_TYPE_KDATA )
     154    {
     155        vseg->flags = VSEG_CACHE   |
     156                      VSEG_WRITE   ;
     157    }
     158    else if( type == VSEG_TYPE_KDEV )
     159    {
     160        vseg->flags = VSEG_WRITE   ;
     161    }
    144162    else
    145163    {
     
    158176
    159177    // initialize vseg with remote_read access
    160     vseg->type        =           hal_remote_l32 ( XPTR( cxy , &ptr->type        ) );
     178    vseg->type        =           hal_remote_l32( XPTR( cxy , &ptr->type        ) );
    161179    vseg->min         = (intptr_t)hal_remote_lpt( XPTR( cxy , &ptr->min         ) );
    162180    vseg->max         = (intptr_t)hal_remote_lpt( XPTR( cxy , &ptr->max         ) );
    163     vseg->vpn_base    =           hal_remote_l32 ( XPTR( cxy , &ptr->vpn_base    ) );
    164     vseg->vpn_size    =           hal_remote_l32 ( XPTR( cxy , &ptr->vpn_size    ) );
    165     vseg->flags       =           hal_remote_l32 ( XPTR( cxy , &ptr->flags       ) );
    166     vseg->file_offset =           hal_remote_l32 ( XPTR( cxy , &ptr->file_offset ) );
    167     vseg->file_size   =           hal_remote_l32 ( XPTR( cxy , &ptr->file_size   ) );
     181    vseg->vpn_base    =           hal_remote_l32( XPTR( cxy , &ptr->vpn_base    ) );
     182    vseg->vpn_size    =           hal_remote_l32( XPTR( cxy , &ptr->vpn_size    ) );
     183    vseg->flags       =           hal_remote_l32( XPTR( cxy , &ptr->flags       ) );
     184    vseg->file_offset =           hal_remote_l32( XPTR( cxy , &ptr->file_offset ) );
     185    vseg->file_size   =           hal_remote_l32( XPTR( cxy , &ptr->file_size   ) );
    168186        vseg->mapper_xp   = (xptr_t)  hal_remote_l64( XPTR( cxy , &ptr->mapper_xp   ) );
    169187
    170188    switch (vseg->type)
    171189    {
    172         case VSEG_TYPE_DATA:
     190        case VSEG_TYPE_DATA:      // unused
    173191        {
    174192            vseg->cxy = 0xffff;
    175193            break;
    176194        }
    177         case VSEG_TYPE_CODE:
     195        case VSEG_TYPE_CODE:      // always local
    178196        case VSEG_TYPE_STACK:
     197        case VSEG_TYPE_KCODE:
    179198        {
    180199            vseg->cxy = local_cxy;
    181200            break;
    182201        }
    183         case VSEG_TYPE_ANON:
     202        case VSEG_TYPE_ANON:      // intrinsic
    184203        case VSEG_TYPE_FILE:
    185204        case VSEG_TYPE_REMOTE:
     205        case VSEG_TYPE_KDEV:
     206        case VSEG_TYPE_KDATA:
    186207        {
    187208            vseg->cxy = (cxy_t) hal_remote_l32( XPTR(cxy, &ptr->cxy) );
Note: See TracChangeset for help on using the changeset viewer.