summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-04-29 00:38:46 +0000
committerian <ian@FreeBSD.org>2014-04-29 00:38:46 +0000
commit4d985863b1ca378d0225d5c7089e922c5d53e868 (patch)
treef256b86904119ea65459b9546d16e71459d0af9e
parent0eaada9b3bb473513e2f89f24b948075c2385269 (diff)
downloadFreeBSD-src-4d985863b1ca378d0225d5c7089e922c5d53e868.zip
FreeBSD-src-4d985863b1ca378d0225d5c7089e922c5d53e868.tar.gz
MFC r262666: exit with code 0xbadab1 if the u-boot API support is missing.
-rw-r--r--sys/boot/uboot/common/main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/boot/uboot/common/main.c b/sys/boot/uboot/common/main.c
index a24aaa1..52dc9d7 100644
--- a/sys/boot/uboot/common/main.c
+++ b/sys/boot/uboot/common/main.c
@@ -124,15 +124,21 @@ main(void)
struct open_file f;
const char * loaderdev;
+ /*
+ * If we can't find the magic signature and related info, exit with a
+ * unique error code that U-Boot reports as "## Application terminated,
+ * rc = 0xnnbadab1". Hopefully 'badab1' looks enough like "bad api" to
+ * provide a clue. It's better than 0xffffffff anyway.
+ */
if (!api_search_sig(&sig))
- return (-1);
+ return (0x01badab1);
syscall_ptr = sig->syscall;
if (syscall_ptr == NULL)
- return (-2);
+ return (0x02badab1);
if (sig->version > API_SIG_VERSION)
- return (-3);
+ return (0x03badab1);
/* Clear BSS sections */
bzero(__sbss_start, __sbss_end - __sbss_start);
OpenPOWER on IntegriCloud