-# Copyright (c) 2009, 2012-2013, 2015 ARM Limited
+# Copyright (c) 2009, 2012-2013, 2015-2017 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
class ArmSystem(System):
type = 'ArmSystem'
cxx_header = "arch/arm/system.hh"
- load_addr_mask = 0xffffffff
multi_proc = Param.Bool(True, "Multiprocessor system?")
boot_loader = VectorParam.String([],
"File that contains the boot loader code. Zero or more files may be "
class GenericArmSystem(ArmSystem):
type = 'GenericArmSystem'
cxx_header = "arch/arm/system.hh"
- load_addr_mask = 0x0fffffff
machine_type = Param.ArmMachineType('DTOnly',
"Machine id from http://www.arm.linux.org.uk/developer/machines/")
atags_addr = Param.Addr("Address where default atags structure should " \
"""Dump dmesg from the simulated kernel to standard out"""
pass
+ # Have Linux systems for ARM auto-calc their load_addr_mask for proper
+ # kernel relocation.
+ load_addr_mask = 0x0
+
class FreebsdArmSystem(GenericArmSystem):
type = 'FreebsdArmSystem'
cxx_header = "arch/arm/freebsd/system.hh"
self.nvmem.port = mem_bus.master
cur_sys.boot_loader = loc('boot.arm')
cur_sys.atags_addr = 0x100
- cur_sys.load_addr_mask = 0xfffffff
cur_sys.load_offset = 0
if not cur_sys.boot_loader:
cur_sys.boot_loader = loc('boot_emm.arm')
cur_sys.atags_addr = 0x8000000
- cur_sys.load_addr_mask = 0xfffffff
cur_sys.load_offset = 0x80000000
class VExpress_EMM64(VExpress_EMM):
if not cur_sys.boot_loader:
cur_sys.boot_loader = loc('boot_emm.arm64')
cur_sys.atags_addr = 0x8000000
- cur_sys.load_addr_mask = 0xfffffff
cur_sys.load_offset = 0x80000000
if not cur_sys.boot_loader:
cur_sys.boot_loader = [ loc('boot_emm.arm64'), loc('boot_emm.arm') ]
cur_sys.atags_addr = 0x8000000
- # the old load_add_mask 0xfffffff works for 32-bit kernel
- # but not the 64-bit one. The new value 0x7ffffff works for both
- cur_sys.load_addr_mask = 0x7ffffff
cur_sys.load_offset = 0x80000000
# Setup m5ops. It's technically not a part of the boot
+# Copyright (c) 2017 ARM Limited
+# All rights reserved.
+#
+# 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) 2005-2007 The Regents of The University of Michigan
# Copyright (c) 2011 Regents of the University of California
# All rights reserved.
kernel_extras = VectorParam.String([],"Additional object files to load")
readfile = Param.String("", "file to read startup script from")
symbolfile = Param.String("", "file to get the symbols from")
- load_addr_mask = Param.UInt64(0xffffffffff,
- "Address to mask loading binaries with")
+ load_addr_mask = Param.UInt64(0xffffffffffffffff,
+ "Address to mask loading binaries with, if 0, system "
+ "auto-calculates the mask to be the most restrictive, "
+ "otherwise it obeys a custom mask.")
load_offset = Param.UInt64(0, "Address to offset loading binaries with")
multi_thread = Param.Bool(False,
/*
- * Copyright (c) 2011-2014 ARM Limited
+ * Copyright (c) 2011-2014,2017 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
kernelEnd = kernel->bssBase() + kernel->bssSize();
kernelEntry = kernel->entryPoint();
+ // If load_addr_mask is set to 0x0, then auto-calculate
+ // the smallest mask to cover all kernel addresses so gem5
+ // can relocate the kernel to a new offset.
+ if (loadAddrMask == 0) {
+ Addr shift_amt = findMsbSet(kernelEnd - kernelStart) + 1;
+ loadAddrMask = ((Addr)1 << shift_amt) - 1;
+ }
+
// load symbols
if (!kernel->loadGlobalSymbols(kernelSymtab))
fatal("could not load kernel symbols\n");