sim: kernelExtras if no kernel provided
authorAdrian Herrera <adrian.herrera@arm.com>
Thu, 14 Nov 2019 09:57:13 +0000 (09:57 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 16 Dec 2019 10:33:56 +0000 (10:33 +0000)
kernelExtras facilitates a way for users to provide additional
blobs to load into memory. As of now, the creation of the extra
images is done independently of the kernel being provided, but
the loading is only done if the kernel is present.

This patch refactors the loading of extra images to be committed
if no kernel is present.

Change-Id: I900542e1034ade8d757d01823cfd4a30f0b36734
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22850
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

src/sim/system.cc

index 0e7db5964c4a04270780c083ab30b6c412a3d255..8c438086bd086200101525e4d21f52d475b308d8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2014,2017-2018 ARM Limited
+ * Copyright (c) 2011-2014,2017-2019 ARM Limited
  * All rights reserved
  *
  * The license below extends only to copyright in the software and shall
@@ -354,14 +354,14 @@ System::initState()
             }
             // Load program sections into memory
             kernelImage.write(physProxy);
-            for (const auto &extra_kernel : kernelExtras)
-                extra_kernel->buildImage().move(mapper).write(physProxy);
 
             DPRINTF(Loader, "Kernel start = %#x\n", kernelStart);
             DPRINTF(Loader, "Kernel end   = %#x\n", kernelEnd);
             DPRINTF(Loader, "Kernel entry = %#x\n", kernelEntry);
             DPRINTF(Loader, "Kernel loaded...\n");
         }
+        for (const auto &extra_kernel : kernelExtras)
+            extra_kernel->buildImage().move(mapper).write(physProxy);
     }
 }