Ignore:
Timestamp:
May 29, 2013, 1:24:09 AM (11 years ago)
Author:
alain
Message:

Major evolution to support physical addresses larger than 32 bits.
The map.xml format has been modified: the vsegs associated to schedulers
are now explicitely defined and mapped in the page tables.

Location:
soft/giet_vm/memo/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/memo/include/libelfpp/elfpp/elfpp_object.hh

    r163 r238  
    5959
    6060    /** Copy all header fields of obj and set the access_ variable*/
    61     void copy_info(object& obj);
     61    void copy_info(object& obj, size_t word_width = 0);
    6262
    6363    ~object();
  • soft/giet_vm/memo/include/memo.h

    r212 r238  
    11/* -*- c++ -*-
    22 *
    3  * SOCLIB_LGPL_HEADER_BEGIN
     3 * GIET_VM_LGPL_HEADER_BEGIN
    44 *
    5  * This file is part of SoCLib, GNU LGPLv2.1.
     5 * This file is part of GIET_VM, GNU LGPLv2.1.
    66 *
    7  * SoCLib is free software; you can redistribute it and/or modify it
     7 * GIET_VM is free software; you can redistribute it and/or modify it
    88 * under the terms of the GNU Lesser General Public License as published
    99 * by the Free Software Foundation; version 2.1 of the License.
    1010 *
    11  * SoCLib is distributed in the hope that it will be useful, but
     11 * GIET_VM is distributed in the hope that it will be useful, but
    1212 * WITHOUT ANY WARRANTY; without even the implied warranty of
    1313 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     
    1515 *
    1616 * You should have received a copy of the GNU Lesser General Public
    17  * License along with SoCLib; if not, write to the Free Software
     17 * License along with GIET_VM; if not, write to the Free Software
    1818 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    1919 * 02110-1301 USA
    2020 *
    21  * SOCLIB_LGPL_HEADER_END
     21 * GIET_VM_LGPL_HEADER_END
    2222 *
    2323 * Copyright (c) UPMC, Lip6, SoC
     
    2525 *
    2626 */
    27 #ifndef _MEMO_H_
    28 #define _MEMO_H_
     27
     28#ifndef GIET_VM_MEMO_H
     29#define GIET_VM_MEMO_H
    2930
    3031#include  <stdlib.h>
     
    5758class MeMo
    5859{
     60// TODO: make the name defined in the map_info relative to this wd.
    5961
    60     std::string m_path;         //map_info path name
    61     std::string m_wd;           //map_info path to directory TODO: make the name defined in the map_info relative to this wd.
    62     std::string m_simpleName;   //map_info filename TODO
    63     void* m_data;               //map_info structure
    64     uintptr_t m_addr;           //map_info address (virtual)
    65     size_t m_size;              //size of the structure
     62    std::string                                   m_path;       // map_info path name
     63    std::string                                   m_wd;         // map_info directory TODO
     64    std::string                                   m_simpleName; // map_info filename TODO
     65    void*                                         m_data;       // map_info structure
     66    uintptr_t                                     m_addr;       // map_info address (virtual)
     67    size_t                                        m_size;       // size of the structure
    6668    mutable std::map<std::string, elfpp::object*> m_loaders;
    67     PSegHandler m_psegh;
    68     PathHandler m_pathHandler;
    69    
    70     bool m_ginit;
    71     elfpp::object* m_generator;
     69    PSegHandler                                   m_psegh;
     70    PathHandler                                   m_pathHandler;
     71    bool                                          m_ginit;
     72    elfpp::object*                                m_generator;
    7273
    7374    size_t load_bin(std::string filename, void* buffer);   
     
    7879public:
    7980
    80     MeMo( const std::string &name, const size_t pageSize = 4096);
     81    MeMo( const std::string   &name,
     82          const size_t        pageSize = 4096);
     83
    8184    ~MeMo();
    8285
     
    9396    }
    9497
     98    // The following functions handle the map.bin structure
     99    // They must keep synchronised with functions defined in boot_init.c.
    95100
    96     //The following functions handle the map.bin structure
    97     //inspired from the boot_init.c of the GIET
    98101    mapping_cluster_t* get_cluster_base( mapping_header_t* header );
    99102    mapping_pseg_t* get_pseg_base( mapping_header_t* header );
     
    108111
    109112
    110 #endif /* _MEMO_H_ */
     113#endif /* GIET_VM_MEMO_H */
    111114
    112115// Local Variables:
  • soft/giet_vm/memo/include/pseg.h

    r210 r238  
    11/* -*- c++ -*-
    22 *
    3  * SOCLIB_LGPL_HEADER_BEGIN
     3 * GIET-VM_LGPL_HEADER_BEGIN
    44 *
    5  * This file is part of SoCLib, GNU LGPLv2.1.
     5 * This file is part of the GIET-VMS, GNU LGPLv2.1.
    66 *
    7  * SoCLib is free software; you can redistribute it and/or modify it
     7 * The GIET-VM is free software; you can redistribute it and/or modify it
    88 * under the terms of the GNU Lesser General Public License as published
    99 * by the Free Software Foundation; version 2.1 of the License.
    1010 *
    11  * SoCLib is distributed in the hope that it will be useful, but
     11 * THe GIET-VM is distributed in the hope that it will be useful, but
    1212 * WITHOUT ANY WARRANTY; without even the implied warranty of
    1313 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     
    1919 * 02110-1301 USA
    2020 *
    21  * SOCLIB_LGPL_HEADER_END
     21 * GIET-VM_LGPL_HEADER_END
    2222 *
    2323 * Copyright (c) UPMC, Lip6, SoC
     
    2525 *         
    2626 */
    27 #ifndef SOCLIB_PSEG_H_
    28 #define SOCLIB_PSEG_H_
     27#ifndef GIET_MEMO_PSEG_H
     28#define GIET_MEMO_PSEG_H
    2929
    3030#include <string>
     
    3939class MeMo;
    4040
     41//////////
    4142class VSeg
    4243{
     
    4546    friend class MeMo;
    4647
    47     std::string m_name;
    48     std::string m_file;
    49     uintptr_t m_vma;   //The address of the section to load in the binary file.
    50     uintptr_t m_lma;   //Physical address to which we load the seg (getted from the associated PSeg), setted by PSeg::add/addIdent.
    51     size_t m_length;
    52     size_t m_type;
    53     bool m_loadable;     // wether this is a loadable vseg ( code, data...)
     48    typedef unsigned long long paddr_t;
     49
     50    std::string m_name;     // vseg name
     51    std::string m_file;     // file name
     52    uintptr_t   m_vma;      // Virtual address of the section to load in the binary file.
     53    paddr_t     m_lma;      // Physical address 
     54    size_t      m_length;
     55    size_t      m_type;
     56    bool        m_loadable; // loadable vseg ( code, data...)
    5457
    5558public:
    56     bool m_ident;//Indicate if the idententy mapping is activited. used by PSegHandler::makeIdent()
     59
     60    bool        m_ident;    // identity mapping required if true
    5761
    5862    const std::string& name() const;
    5963    const std::string& file() const;
    6064    uintptr_t vma() const;
    61     uintptr_t lma() const;
     65    paddr_t lma() const;
    6266    size_t length() const;
    6367    size_t type() const;
     
    7579    VSeg();
    7680    VSeg( const VSeg &ref );
    77     VSeg(std::string& binaryName, std::string& name, uintptr_t vma, size_t length, bool loadable, bool ident);
     81    VSeg(std::string&   binaryName,
     82         std::string&   name,
     83         uintptr_t      vma,
     84         size_t         length,
     85         bool           loadable,
     86         bool           ident);
    7887
    7988    ~VSeg();
    8089};
    8190
    82 
     91//////////
    8392class PSeg
    8493{
    85     std::string m_name;
    86     uintptr_t m_lma;
    87     size_t m_length;
    88     size_t m_type;
     94    std::string   m_name;
     95    paddr_t      m_lma;
     96    paddr_t      m_length;
     97    size_t        m_type;
    8998
    90     uintptr_t m_pageLimit;  //The end (m_lma + m_length)  address of the segment pageSize aligned
    91     uintptr_t m_nextLma;    //next free base
     99    paddr_t       m_pageLimit;  // m_lma + m_length aligned on page size
     100    paddr_t       m_nextLma;    // next free base
    92101   
    93     void confNextLma();     //check that m_nextLma has a correct value: whithin the seg limits
     102    void confNextLma();         // check m_nextLma is whithin the seg limits
    94103
    95104public:
     105
    96106    std::vector<VSeg> m_vsegs;
    97     uintptr_t m_limit;// m_lma + m_length
    98107
     108    paddr_t     m_limit;        // m_lma + m_length
    99109
    100110    const std::string& name() const;
    101     uintptr_t lma() const;
    102     size_t length() const;
     111    paddr_t lma() const;
     112    paddr_t length() const;
    103113    size_t type() const;
    104     uintptr_t limit() const;
    105     uintptr_t nextLma() const;
     114    paddr_t limit() const;
     115    paddr_t nextLma() const;
    106116
    107117    void check() const;
    108118
    109119    void setName(std::string& name);
    110     void setLma( uintptr_t lma);
    111     void setLength(size_t length);
     120    void setLma( paddr_t lma);
     121    void setLength(paddr_t length);
    112122
    113     static size_t align( unsigned toAlign, unsigned alignPow2);
    114     static size_t pageAlign( size_t toAlign );
     123    static paddr_t align( paddr_t toAlign, unsigned alignPow2);
     124    static paddr_t pageAlign( paddr_t toAlign );
     125
    115126    static void setPageSize(size_t pg);
     127
    116128    static size_t& pageSize();
    117129
    118     void add( VSeg& vseg );//add a VSeg
     130    void add( VSeg& vseg );    //add a VSeg
    119131    void addIdent( VSeg& vseg );
    120132
    121     void setNextLma( uintptr_t nextLma);
    122     void incNextLma( size_t inc_next);
     133    void setNextLma( paddr_t nextLma);
     134    void incNextLma( size_t inc);
    123135
    124136    void print( std::ostream &o ) const;
     
    134146    PSeg( const PSeg &ref );
    135147    PSeg( const std::string &name);
    136     PSeg( const uintptr_t lma);
     148    PSeg( const paddr_t lma);
    137149    PSeg( const std::string &name,
    138                      uintptr_t lma,
    139              size_t length,
    140              size_t type);
     150          paddr_t lma,
     151          paddr_t length,
     152          size_t type);
    141153    ~PSeg();
    142154};
    143155
    144156
    145 #endif /* SOCLIB_PSEG_H_ */
     157#endif /* GIET_MEMO_PSEG_H */
Note: See TracChangeset for help on using the changeset viewer.