diff options
author | Aaron Durbin <adurbin@chromium.org> | 2015-03-20 10:20:15 -0500 |
---|---|---|
committer | Aaron Durbin <adurbin@google.com> | 2015-03-31 19:31:57 +0200 |
commit | ebf2ed46211e0ccd82d11c34226eb578f9532a2a (patch) | |
tree | 4f6ee80302be89c88aa7dfa8d227231fec723487 /src/lib/loaders | |
parent | fcfdff84f4ddd6fe7bf68c3bc84c0173911d13de (diff) |
payload loading: remove passing of struct payload
There's no need to keep track of struct payload within
the boot state machine. It is completely contained within
the payload loader module.
Change-Id: I16fcecf43d7fb41fc311955fdb82eabbd5c96b11
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/8836
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/lib/loaders')
-rw-r--r-- | src/lib/loaders/load_and_run_payload.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lib/loaders/load_and_run_payload.c b/src/lib/loaders/load_and_run_payload.c index 4bb29c10e5..89b6da61f3 100644 --- a/src/lib/loaders/load_and_run_payload.c +++ b/src/lib/loaders/load_and_run_payload.c @@ -44,7 +44,7 @@ void __attribute__((weak)) mirror_payload(struct payload *payload) return; } -struct payload *payload_load(void) +void payload_load(void) { int i; void *entry; @@ -65,24 +65,22 @@ struct payload *payload_load(void) } if (i == ARRAY_SIZE(payload_ops)) - return NULL; + goto out; mirror_payload(payload); entry = selfload(payload); - if (entry == NULL) - return NULL; - payload->entry = entry; - return payload; +out: + if (payload->entry == NULL) + die("Payload not loaded.\n"); } -void payload_run(const struct payload *payload) +void payload_run(void) { - if (payload == NULL) - return; + const struct payload *payload = &global_payload; /* Reset to booting from this image as late as possible */ boot_successful(); |