Date: Sat, 1 Mar 2014 19:25:24 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262666 - head/sys/boot/uboot/common Message-ID: <201403011925.s21JPOP4027805@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Sat Mar 1 19:25:23 2014 New Revision: 262666 URL: http://svnweb.freebsd.org/changeset/base/262666 Log: If we can't find the u-boot api signature, exit with an error status that includes "badab1"; u-boot displays the status in hex, so this may help give some clue about why ubldr isn't working (more than -1 does anyway). Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Sat Mar 1 19:06:43 2014 (r262665) +++ head/sys/boot/uboot/common/main.c Sat Mar 1 19:25:23 2014 (r262666) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403011925.s21JPOP4027805>