summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2018-10-24 15:46:51 -0700
committerRonald G. Minnich <rminnich@gmail.com>2018-10-25 16:57:51 +0000
commitc308554c10a33c977657b627c880cde60a590eb4 (patch)
treea030259c0bcd8557f792e693dc3dbf1eac655a33 /src/include
parentde332f35da72814722c053ae591b8dace0d54169 (diff)
selfboot: create selfboot_check function, remove check param
The selfboot function was changed at some point to take a parameter which meant "check the allocated descriptors to see if they target regions of real memory." The region check had to be buried deep in the last step of loading since that is where those descriptors were created and used. An issue with the use of the parameter was that it was not possible for compilers to easily divine whether the check code was used, and it was hence possible for the code, and its dependencies, to be compiled in even if never used (which caused problems for the rampayload code). Now that bounce buffers are gone, we can hoist the check code to the outermost level. Further, by creating a selfload_check and selfload function, we can make it easy for compilers to discard unused code: if selfload_check is never called, all the code it uses can be discarded too. Change-Id: Id5b3f450fd18480d54ffb6e395429fba71edcd77 Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: https://review.coreboot.org/29259 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/program_loading.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/include/program_loading.h b/src/include/program_loading.h
index aa21cf57ab..e185b9271b 100644
--- a/src/include/program_loading.h
+++ b/src/include/program_loading.h
@@ -197,12 +197,15 @@ void payload_run(void);
void mirror_payload(struct prog *payload);
/*
- * Set check_regions to true to check that the payload targets usable memory.
- * With this flag set, if it does not, the load will fail and this function
- * will return false. On successful payload loading this functions return true.
+ * selfload() and selfload_check() load payloads into memory.
+ * selfload() does not check the payload to see if it targets memory.
+ * Call selfload_check() to check that the payload targets usable memory.
+ * If it does not, the load will fail and this function
+ * will return false. On successful payload loading these functions return true.
*
* Defined in src/lib/selfboot.c
*/
-bool selfload(struct prog *payload, bool check_regions);
+bool selfload_check(struct prog *payload);
+bool selfload(struct prog *payload);
#endif /* PROGRAM_LOADING_H */