gem5  v22.1.0.0
dtb_file.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 The Regents of The University of Michigan
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef __BASE_LOADER_DTB_FILE_HH__
30 #define __BASE_LOADER_DTB_FILE_HH__
31 
32 #include "base/compiler.hh"
34 
35 namespace gem5
36 {
37 
38 GEM5_DEPRECATED_NAMESPACE(Loader, loader);
39 namespace loader
40 {
41 
47 class DtbFile : public ImageFile
48 {
49  protected:
54  uint8_t *fileData = nullptr;
55  size_t length = 0;
56 
57  public:
58  DtbFile(const std::string &name);
59  ~DtbFile();
60 
69  bool addBootData(const char* _cmdline, size_t cmdline_len,
70  off_t initrd_addr, size_t initrd_len);
71 
78  inline bool
79  addBootCmdLine(const char* _args, size_t len) {
80  return addBootData(_args, len, 0, 0);
81  }
82 
88 
89  MemoryImage buildImage() const override;
90 };
91 
92 } // namespace loader
93 } // namespace gem5
94 
95 #endif //__BASE_LOADER_DTB_FILE_HH__
bool addBootData(const char *_cmdline, size_t cmdline_len, off_t initrd_addr, size_t initrd_len)
Adds the passed in Command Line options and initrd for the kernel to the proper location in the devic...
Definition: dtb_file.cc:66
uint8_t * fileData
Definition: dtb_file.hh:54
Addr findReleaseAddr()
Parse the DTB file enough to find the provided release address and return it.
Definition: dtb_file.cc:161
DtbFile(const std::string &name)
Definition: dtb_file.cc:47
MemoryImage buildImage() const override
Definition: dtb_file.cc:182
bool addBootCmdLine(const char *_args, size_t len)
Adds the passed in Command Line options for the kernel to the proper location in the device tree.
Definition: dtb_file.hh:79
bool fileDataMmapped
Bool marking if this dtb file has replaced the original read in DTB file with a new modified buffer.
Definition: dtb_file.hh:53
uint16_t len
Definition: helpers.cc:62
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
const std::string & name()
Definition: trace.cc:49

Generated on Wed Dec 21 2022 10:22:29 for gem5 by doxygen 1.9.1