Giacomo Travaglini has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/22849 )
Change subject: base: configurable entrypoint for Raw Images
......................................................................
base: configurable entrypoint for Raw Images
This patch adds an alternative constructor for raw images
which lets users specify a load address for the blob.
Change-Id: Ib5bd88cbdf79bd40b5f8086b6af83fb8061f9770
Reviewed-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
---
M src/base/loader/memory_image.hh
M src/base/loader/raw_image.hh
2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/src/base/loader/memory_image.hh
b/src/base/loader/memory_image.hh
index a10daba..dc1a4c8 100644
--- a/src/base/loader/memory_image.hh
+++ b/src/base/loader/memory_image.hh
@@ -1,4 +1,15 @@
/*
+ * Copyright (c) 2019 ARM Limited
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder. You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
* Copyright (c) 2002-2004 The Regents of The University of Michigan
* All rights reserved.
*
@@ -72,6 +83,11 @@
Segment(_name, 0, _ifd, 0, _ifd->len())
{}
+ Segment(const std::string &_name, Addr _base,
+ const ImageFileDataPtr &_ifd) :
+ Segment(_name, _base, _ifd, 0, _ifd->len())
+ {}
+
ImageFileDataPtr ifd;
std::string name;
Addr base = 0;
diff --git a/src/base/loader/raw_image.hh b/src/base/loader/raw_image.hh
index aae82a3..0e825fd 100644
--- a/src/base/loader/raw_image.hh
+++ b/src/base/loader/raw_image.hh
@@ -1,4 +1,15 @@
/*
+ * Copyright (c) 2019 ARM Limited
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder. You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
* Copyright (c) 2006 The Regents of The University of Michigan
* All rights reserved.
*
@@ -42,10 +53,14 @@
RawImage(ImageFileDataPtr(new ImageFileData(filename)))
{}
+ RawImage(ImageFileDataPtr ifd, const Addr load_addr) :
+ RawImage(ifd)
+ { entry = load_addr; }
+
MemoryImage
buildImage() const override
{
- return {{ "data", imageData }};
+ return {{ "data", entry, imageData }};
}
};
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/22849
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ib5bd88cbdf79bd40b5f8086b6af83fb8061f9770
Gerrit-Change-Number: 22849
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev