From 43aa76658ba3563b040db35be2d75e05256be181 Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 29 Apr 2014 00:38:46 +0000 Subject: [PATCH] MFC r262666: exit with code 0xbadab1 if the u-boot API support is missing. git-svn-id: svn://svn.freebsd.org/base/stable/10@265070 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/boot/uboot/common/main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/boot/uboot/common/main.c b/sys/boot/uboot/common/main.c index a24aaa142..52dc9d7a5 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); -- 2.45.0