summaryrefslogtreecommitdiff
path: root/src/base/loader/dtb_object.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/loader/dtb_object.cc')
-rw-r--r--src/base/loader/dtb_object.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/base/loader/dtb_object.cc b/src/base/loader/dtb_object.cc
index f22cee1ed..adf7d2c3a 100644
--- a/src/base/loader/dtb_object.cc
+++ b/src/base/loader/dtb_object.cc
@@ -35,6 +35,7 @@
#include <cassert>
#include "base/loader/dtb_object.hh"
+#include "sim/byteswap.hh"
#include "fdt.h"
#include "libfdt.h"
@@ -154,6 +155,26 @@ DtbObject::addBootCmdLine(const char* _args, size_t len)
return true;
}
+Addr
+DtbObject::findReleaseAddr()
+{
+ void *fd = (void*)fileData;
+
+ int offset = fdt_path_offset(fd, "/cpus/cpu@0");
+ int len;
+
+ const void* temp = fdt_getprop(fd, offset, "cpu-release-addr", &len);
+ Addr rel_addr = 0;
+
+ if (len > 3)
+ rel_addr = betoh(*static_cast<const uint32_t*>(temp));
+ if (len == 8)
+ rel_addr = (rel_addr << 32) | betoh(*(static_cast<const uint32_t*>(temp)+1));
+
+ return rel_addr;
+}
+
+
bool
DtbObject::loadGlobalSymbols(SymbolTable *symtab, Addr addrMask)
{