summaryrefslogtreecommitdiff
path: root/src/arch/arm/system.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2015-12-03 23:53:37 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2015-12-03 23:53:37 +0000
commita1aeff27ce2978bb5fd0a3da66878d914cfb4da2 (patch)
tree6ec8b023033566edef0276710153fabc2917e33e /src/arch/arm/system.hh
parent146dfd0356c4a086e397679eba1ffb57b19ce07a (diff)
downloadgem5-a1aeff27ce2978bb5fd0a3da66878d914cfb4da2.tar.xz
arm: Add support for automatic boot loader selection
Add support for automatically selecting a boot loader that matches the guest system's kernel. Instead of accepting a single boot loader, the ArmSystem class now accepts a vector of boot loaders. When initializing a system, the we now look for the first boot loader with an architecture that matches the kernel. This changeset makes it possible to use the same system for both 64-bit and 32-bit kernels.
Diffstat (limited to 'src/arch/arm/system.hh')
-rw-r--r--src/arch/arm/system.hh16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/arch/arm/system.hh b/src/arch/arm/system.hh
index 0b652f76c..511118d4d 100644
--- a/src/arch/arm/system.hh
+++ b/src/arch/arm/system.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012-2013 ARM Limited
+ * Copyright (c) 2010, 2012-2013, 2015 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -43,6 +43,7 @@
#ifndef __ARCH_ARM_SYSTEM_HH__
#define __ARCH_ARM_SYSTEM_HH__
+#include <memory>
#include <string>
#include <vector>
@@ -64,6 +65,9 @@ class ArmSystem : public System
*/
Linux::DebugPrintkEvent *debugPrintkEvent;
+ /** Bootloaders */
+ std::vector<std::unique_ptr<ObjectFile>> bootLoaders;
+
/**
* Pointer to the bootloader object
*/
@@ -112,6 +116,16 @@ class ArmSystem : public System
*/
const bool _haveLargeAsid64;
+ protected:
+ /**
+ * Get a boot loader that matches the kernel.
+ *
+ * @param obj Kernel binary
+ * @return Pointer to boot loader ObjectFile or nullptr if there
+ * is no matching boot loader.
+ */
+ ObjectFile *getBootLoader(ObjectFile *const obj);
+
public:
typedef ArmSystemParams Params;
const Params *