Ignore:
Timestamp:
Aug 21, 2012, 9:30:46 AM (12 years ago)
Author:
karaoui
Message:

Avoid incremmentinting Pseg of "PERI" type, to permit multiple mapping.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/memo/src/pseg.cpp

    r173 r210  
    6363}
    6464
    65 uintptr_t VSeg::length() const
     65size_t VSeg::length() const
    6666{
    6767        return m_length;
     68}
     69
     70size_t VSeg::type() const
     71{
     72        return m_type;
    6873}
    6974
     
    152157}
    153158
    154 uintptr_t PSeg::length() const
     159size_t PSeg::length() const
    155160{
    156161        return m_length;
    157162}
    158163
     164size_t PSeg::type() const
     165{
     166        return m_type;
     167}
     168
    159169uintptr_t PSeg::nextLma() const
    160170{
     
    169179void PSeg::check() const
    170180{
     181
     182    if(this->m_type == PSEG_TYPE_PERI)
     183        return;
     184
     185    std::vector<VSeg>::const_iterator it;
    171186    size_t size = m_vsegs.size();
    172187    size_t used[size][2];//lma, lma+length
    173188    size_t i,j,error=0;
    174189   
    175     std::vector<VSeg>::const_iterator it;
    176190    for(it = m_vsegs.begin(), i= 0; it < m_vsegs.end(); it++, i++)
    177191    {
     
    179193        for(j=0; j< i; j++)
    180194        {
    181            if( 
    182                 (used[j][0] == (*it).lma() /*and (*it).length()?*/) ) //not the same lma ,
     195           if(  (used[j][0] == (*it).lma() /*and (*it).length()?*/) ) //not the same lma ,
    183196            {
    184197                error = 1;
    185198                std::cout << "ok \n";
    186199            }
    187            if( 
    188                 (used[j][1] == it_limit /*and (*it).legth()?*/))  // and not the same limit
     200           if(  (used[j][1] == it_limit /*and (*it).legth()?*/))  // and not the same limit
    189201            {
    190202                error = 2;
    191203            }
    192            if( 
    193                 ((used[j][0] < (*it).lma()) and ((*it).lma() < used[j][1] )) ) //lma  within the used slice
     204           if(  ((used[j][0] < (*it).lma()) and ((*it).lma() < used[j][1] )) ) //lma  within the used slice
    194205            {
    195206                error = 3;
    196207            }
    197            if( 
    198                 ((used[j][0] < it_limit) and (it_limit < used[j][1] )) )//limit not within the used slice
     208           if(  ((used[j][0] < it_limit) and (it_limit < used[j][1] )) )//limit not within the used slice
    199209            {
    200210                error = 4;
     211                std::cout << "base: " << std::hex << (*it).lma() << std::endl;
    201212                std::cout << "limit: " << std::hex << it_limit << std::endl;
    202213                std::cout << "used[j][0]: " << std::hex << used[j][0] << std::endl;
     
    362373
    363374PSeg::PSeg( const std::string &name,
    364                uintptr_t lma,
    365                 size_t length)
     375                uintptr_t lma,
     376                size_t length,
     377                size_t type)
    366378{
    367379    m_name = name;
    368380    m_length = length;
     381    m_type = type;
    369382
    370383    setLma(lma);
Note: See TracChangeset for help on using the changeset viewer.