sparc: Create a helper functions to install firmware images.
authorGabe Black <gabeblack@google.com>
Fri, 4 Oct 2019 09:08:13 +0000 (02:08 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 30 Oct 2019 00:06:50 +0000 (00:06 +0000)
commita8f6e6ceec37d96a1a5cc58e1304d3d1c11bc144
treef31b976a050864bc25a194202d6aac3ec7823006
parent248c8d36ecef89f1bd63593398e087b02b5f33e8
sparc: Create a helper functions to install firmware images.

The first function handles the repetitive process of creating an
ObjectFile for a particular purpose and checking if that was
successful.
The second conditionally offsets the images in case they were, for
instance, loaded from an ELF file which already had them in the right
place. It offsets them so that their entry point (which will be zero
for raw images) lines up with the appropriate entry address (which will
be at the start of raw images).

This is more correct in more cases, and also removes a lot of
redundancy. There's still a lot of redundancy in the code which sets
up the symbol tables, but there are some irregularities which make that
harder to wrap in a helper function.

Change-Id: I2fee8b2175faff284ff9e007307f7769043497a1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21469
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/sparc/system.cc