Changeset 68 for trunk/kernel/mm


Ignore:
Timestamp:
Jun 27, 2017, 10:24:13 AM (7 years ago)
Author:
alain
Message:

Fix bug in kernel_init, and reduce size of remote_fifo.

Location:
trunk/kernel/mm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/page.h

    r23 r68  
    6161{
    6262    uint32_t          flags;          /*! flags defined above                  (4)  */
    63     uint32_t          order;          /*! log2( number of 4Kbytes pages)       (4)  */
     63    uint32_t          order;          /*! log2( number of small pages)         (4)  */
    6464    struct mapper_s * mapper;         /*! local pointer on associated mapper   (4)  */
    6565    uint32_t          index;          /*! page index in mapper                 (4)  */
  • trunk/kernel/mm/vmm.c

    r50 r68  
    616616
    617617
    618 //////////////////////////////////////////
    619 error_t vmm_map_vseg( vseg_t    * vseg,
    620                       uint32_t    attr )
     618//////////////////////////////////////////////
     619error_t vmm_map_kernel_vseg( vseg_t    * vseg,
     620                             uint32_t    attr )
    621621{
    622622    vpn_t       vpn;        // VPN of PTE to be set
     
    628628    error_t     error;
    629629
    630     // check vseg type
     630    // check vseg type : must be a kernel vseg
    631631    uint32_t type = vseg->type;
    632     if( (type != VSEG_TYPE_KCODE) && (type != VSEG_TYPE_KDATA) && (type != VSEG_TYPE_KDEV) )
    633     {
    634         printk("\n[PANIC] in %s : not a kernel vseg\n", __FUNCTION__ );
    635         hal_core_sleep();
    636     }
     632    assert( ((type==VSEG_TYPE_KCODE) || (type==VSEG_TYPE_KDATA) || (type==VSEG_TYPE_KDEV)),
     633            __FUNCTION__ , "not a kernel vseg\n" );
    637634
    638635    // get pointer on page table
     
    648645        for( vpn = vpn_min ; vpn < vpn_max ; vpn++ )
    649646        {
     647        // allocate a physical page from local PPM
    650648            kmem_req_t req;
    651649            req.type  = KMEM_PAGE;
     
    782780
    783781    // this function must be called by a thread running in the reference cluster
    784     if( GET_CXY( process->ref_xp ) != local_cxy );
    785     {
    786         printk("\n[PANIC] in %s : not called in the reference cluster\n", __FUNCTION__ );
    787         hal_core_sleep();
    788     }
     782    assert( (GET_CXY( process->ref_xp ) == local_cxy ) , __FUNCTION__ ,
     783             " not called in the reference cluster\n" );
    789784
    790785    // get VMM pointer
     
    954949}  // end vmm_v2p_translate()
    955950
    956 //////////////////////////////////////////////
    957951
    958952
  • trunk/kernel/mm/vmm.h

    r23 r68  
    223223 * This function allocates physical memory from the local cluster to map all PTEs
    224224 * of a "kernel" vseg (type KCODE , KDATA, or KDEV) in the page table of process_zero.
    225  * It should not be used for other vseg types, because "user" vsegs use the
     225 * WARNING : It should not be used for "user" vsegs, that must be mapped using the
    226226 * "on-demand-paging" policy.
    227227 *********************************************************************************************
     
    230230 * @ returns 0 if success / returns ENOMEM if no memory
    231231 ********************************************************************************************/
    232 error_t vmm_map_vseg( vseg_t           * vseg,
    233                       uint32_t           attr );
     232error_t vmm_map_kernel_vseg( vseg_t           * vseg,
     233                             uint32_t           attr );
    234234
    235235/*********************************************************************************************
     
    312312/*********************************************************************************************
    313313 * This function makes the virtual to physical address translation, using the calling
    314  * process page table. It uses identity mapping if required by the ident flag.
     314 * process page table. It uses identity mapping if required by the <ident> argument.
    315315 * This address translation is required to configure the peripherals having a DMA
    316316 * capability, or to implement the software L2/L3 cache cohérence, using the MMC device
Note: See TracChangeset for help on using the changeset viewer.