mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: libpayload: x86/main - propagate return value of main()
According to coreboots payload API [1], the called payload should be
able to return a value via %eax. Support this by changing the prototype
of start_main() and pass on the return value of main() to the caller
instead of discarding it.
[1] https://www.coreboot.org/Payload_API
BUG=none
BRANCH=none
TEST=none
Change-Id: I1782c45b615d431de8be5a533d5890ed53ddb9d8
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Original-Commit-Id: 7b681c5926
Original-Change-Id: I8442faea19cc8e04487092f8e61aa4e5cba3ba76
Original-Signed-off-by: Mathias Krause <minipli@googlemail.com>
Original-Reviewed-on: https://review.coreboot.org/18334
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/444815
This commit is contained in:
parent
d808757641
commit
f8e37efbcf
1 changed files with 4 additions and 5 deletions
|
@ -42,8 +42,8 @@ char *main_argv[MAX_ARGC_COUNT];
|
|||
* This is our C entry function - set up the system
|
||||
* and jump into the payload entry point.
|
||||
*/
|
||||
void start_main(void);
|
||||
void start_main(void)
|
||||
int start_main(void);
|
||||
int start_main(void)
|
||||
{
|
||||
extern int main(int argc, char **argv);
|
||||
|
||||
|
@ -67,10 +67,9 @@ void start_main(void)
|
|||
* In the future we may care about the return value.
|
||||
*/
|
||||
|
||||
(void) main(main_argc, (main_argc != 0) ? main_argv : NULL);
|
||||
|
||||
/*
|
||||
* Returning here will go to the _leave function to return
|
||||
* Returning from main() will go to the _leave function to return
|
||||
* us to the original context.
|
||||
*/
|
||||
return main(main_argc, (main_argc != 0) ? main_argv : NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue