Changeset 238 for soft/giet_vm/memo/include
- Timestamp:
- May 29, 2013, 1:24:09 AM (11 years ago)
- 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 59 59 60 60 /** 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); 62 62 63 63 ~object(); -
soft/giet_vm/memo/include/memo.h
r212 r238 1 1 /* -*- c++ -*- 2 2 * 3 * SOCLIB_LGPL_HEADER_BEGIN3 * GIET_VM_LGPL_HEADER_BEGIN 4 4 * 5 * This file is part of SoCLib, GNU LGPLv2.1.5 * This file is part of GIET_VM, GNU LGPLv2.1. 6 6 * 7 * SoCLibis free software; you can redistribute it and/or modify it7 * GIET_VM is free software; you can redistribute it and/or modify it 8 8 * under the terms of the GNU Lesser General Public License as published 9 9 * by the Free Software Foundation; version 2.1 of the License. 10 10 * 11 * SoCLibis distributed in the hope that it will be useful, but11 * GIET_VM is distributed in the hope that it will be useful, but 12 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU … … 15 15 * 16 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with SoCLib; if not, write to the Free Software17 * License along with GIET_VM; if not, write to the Free Software 18 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 19 * 02110-1301 USA 20 20 * 21 * SOCLIB_LGPL_HEADER_END21 * GIET_VM_LGPL_HEADER_END 22 22 * 23 23 * Copyright (c) UPMC, Lip6, SoC … … 25 25 * 26 26 */ 27 #ifndef _MEMO_H_ 28 #define _MEMO_H_ 27 28 #ifndef GIET_VM_MEMO_H 29 #define GIET_VM_MEMO_H 29 30 30 31 #include <stdlib.h> … … 57 58 class MeMo 58 59 { 60 // TODO: make the name defined in the map_info relative to this wd. 59 61 60 std::string m_path; //map_info path name61 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 TODO63 void* m_data; //map_info structure64 uintptr_t m_addr; //map_info address (virtual)65 size_t m_size; //size of the structure62 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 66 68 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; 72 73 73 74 size_t load_bin(std::string filename, void* buffer); … … 78 79 public: 79 80 80 MeMo( const std::string &name, const size_t pageSize = 4096); 81 MeMo( const std::string &name, 82 const size_t pageSize = 4096); 83 81 84 ~MeMo(); 82 85 … … 93 96 } 94 97 98 // The following functions handle the map.bin structure 99 // They must keep synchronised with functions defined in boot_init.c. 95 100 96 //The following functions handle the map.bin structure97 //inspired from the boot_init.c of the GIET98 101 mapping_cluster_t* get_cluster_base( mapping_header_t* header ); 99 102 mapping_pseg_t* get_pseg_base( mapping_header_t* header ); … … 108 111 109 112 110 #endif /* _MEMO_H_*/113 #endif /* GIET_VM_MEMO_H */ 111 114 112 115 // Local Variables: -
soft/giet_vm/memo/include/pseg.h
r210 r238 1 1 /* -*- c++ -*- 2 2 * 3 * SOCLIB_LGPL_HEADER_BEGIN3 * GIET-VM_LGPL_HEADER_BEGIN 4 4 * 5 * This file is part of SoCLib, GNU LGPLv2.1.5 * This file is part of the GIET-VMS, GNU LGPLv2.1. 6 6 * 7 * SoCLibis free software; you can redistribute it and/or modify it7 * The GIET-VM is free software; you can redistribute it and/or modify it 8 8 * under the terms of the GNU Lesser General Public License as published 9 9 * by the Free Software Foundation; version 2.1 of the License. 10 10 * 11 * SoCLibis distributed in the hope that it will be useful, but11 * THe GIET-VM is distributed in the hope that it will be useful, but 12 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU … … 19 19 * 02110-1301 USA 20 20 * 21 * SOCLIB_LGPL_HEADER_END21 * GIET-VM_LGPL_HEADER_END 22 22 * 23 23 * Copyright (c) UPMC, Lip6, SoC … … 25 25 * 26 26 */ 27 #ifndef SOCLIB_PSEG_H_28 #define SOCLIB_PSEG_H_27 #ifndef GIET_MEMO_PSEG_H 28 #define GIET_MEMO_PSEG_H 29 29 30 30 #include <string> … … 39 39 class MeMo; 40 40 41 ////////// 41 42 class VSeg 42 43 { … … 45 46 friend class MeMo; 46 47 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...) 54 57 55 58 public: 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 57 61 58 62 const std::string& name() const; 59 63 const std::string& file() const; 60 64 uintptr_t vma() const; 61 uintptr_t lma() const;65 paddr_t lma() const; 62 66 size_t length() const; 63 67 size_t type() const; … … 75 79 VSeg(); 76 80 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); 78 87 79 88 ~VSeg(); 80 89 }; 81 90 82 91 ////////// 83 92 class PSeg 84 93 { 85 std::string m_name;86 uintptr_tm_lma;87 size_tm_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; 89 98 90 uintptr_t m_pageLimit; //The end (m_lma + m_length) address of the segment pageSize aligned91 uintptr_t m_nextLma; //next free base99 paddr_t m_pageLimit; // m_lma + m_length aligned on page size 100 paddr_t m_nextLma; // next free base 92 101 93 void confNextLma(); //check that m_nextLma has a correct value:whithin the seg limits102 void confNextLma(); // check m_nextLma is whithin the seg limits 94 103 95 104 public: 105 96 106 std::vector<VSeg> m_vsegs; 97 uintptr_t m_limit;// m_lma + m_length98 107 108 paddr_t m_limit; // m_lma + m_length 99 109 100 110 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; 103 113 size_t type() const; 104 uintptr_t limit() const;105 uintptr_t nextLma() const;114 paddr_t limit() const; 115 paddr_t nextLma() const; 106 116 107 117 void check() const; 108 118 109 119 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); 112 122 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 115 126 static void setPageSize(size_t pg); 127 116 128 static size_t& pageSize(); 117 129 118 void add( VSeg& vseg ); //add a VSeg130 void add( VSeg& vseg ); //add a VSeg 119 131 void addIdent( VSeg& vseg ); 120 132 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); 123 135 124 136 void print( std::ostream &o ) const; … … 134 146 PSeg( const PSeg &ref ); 135 147 PSeg( const std::string &name); 136 PSeg( const uintptr_t lma);148 PSeg( const paddr_t lma); 137 149 PSeg( const std::string &name, 138 uintptr_t lma,139 size_t length,140 150 paddr_t lma, 151 paddr_t length, 152 size_t type); 141 153 ~PSeg(); 142 154 }; 143 155 144 156 145 #endif /* SOCLIB_PSEG_H_*/157 #endif /* GIET_MEMO_PSEG_H */
Note: See TracChangeset
for help on using the changeset viewer.