summaryrefslogtreecommitdiff
path: root/src/base/loader/dtb_object.cc
diff options
context:
space:
mode:
authorCurtis Dunham <Curtis.Dunham@arm.com>2015-07-03 10:14:34 -0400
committerCurtis Dunham <Curtis.Dunham@arm.com>2015-07-03 10:14:34 -0400
commite385ae0c72993d1d58256324d0fe425247fad207 (patch)
treed133e9497e8f08ed370a0fc425b2e8f561632156 /src/base/loader/dtb_object.cc
parentd9f8f076135870de5382f2d2ec3b185b6ece6b16 (diff)
downloadgem5-e385ae0c72993d1d58256324d0fe425247fad207.tar.xz
base: remove fd from object loaders
All the object loaders directly examine the (already completely loaded by object_file.cc) memory image. There is no current motivation to keep the fd around.
Diffstat (limited to 'src/base/loader/dtb_object.cc')
-rw-r--r--src/base/loader/dtb_object.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/base/loader/dtb_object.cc b/src/base/loader/dtb_object.cc
index adf7d2c3a..841db8c12 100644
--- a/src/base/loader/dtb_object.cc
+++ b/src/base/loader/dtb_object.cc
@@ -40,21 +40,20 @@
#include "libfdt.h"
ObjectFile *
-DtbObject::tryFile(const std::string &fname, int fd, size_t len, uint8_t *data)
+DtbObject::tryFile(const std::string &fname, size_t len, uint8_t *data)
{
// Check if this is a FDT file by looking for magic number
if (fdt_magic((void*)data) == FDT_MAGIC) {
- return new DtbObject(fname, fd, len, data,
+ return new DtbObject(fname, len, data,
ObjectFile::UnknownArch, ObjectFile::UnknownOpSys);
} else {
return NULL;
}
}
-DtbObject::DtbObject(const std::string &_filename, int _fd,
- size_t _len, uint8_t *_data,
+DtbObject::DtbObject(const std::string &_filename, size_t _len, uint8_t *_data,
Arch _arch, OpSys _opSys)
- : ObjectFile(_filename, _fd, _len, _data, _arch, _opSys)
+ : ObjectFile(_filename, _len, _data, _arch, _opSys)
{
text.baseAddr = 0;
text.size = len;
@@ -73,11 +72,6 @@ DtbObject::DtbObject(const std::string &_filename, int _fd,
DtbObject::~DtbObject()
{
- if (descriptor >= 0) {
- ::close(descriptor);
- descriptor = -1;
- }
-
// Make sure to clean up memory properly depending
// on how buffer was allocated.
if (fileData && !fileDataMmapped) {