Date: Sat, 2 Dec 2017 00:07:31 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326447 - in head/stand/mips/beri: boot2 common loader Message-ID: <201712020007.vB207VQ6033991@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Sat Dec 2 00:07:31 2017 New Revision: 326447 URL: https://svnweb.freebsd.org/changeset/base/326447 Log: Tweaks to the beri boot loader so that it builds w/o warnings. Sponsored by: Netflix Modified: head/stand/mips/beri/boot2/Makefile head/stand/mips/beri/boot2/boot2.c head/stand/mips/beri/common/altera_jtag_uart.c head/stand/mips/beri/loader/Makefile head/stand/mips/beri/loader/devicename.c head/stand/mips/beri/loader/exec.c head/stand/mips/beri/loader/loader.h Modified: head/stand/mips/beri/boot2/Makefile ============================================================================== --- head/stand/mips/beri/boot2/Makefile Sat Dec 2 00:07:25 2017 (r326446) +++ head/stand/mips/beri/boot2/Makefile Sat Dec 2 00:07:31 2017 (r326447) @@ -47,9 +47,7 @@ MAN= AFLAGS= -G0 -CFLAGS+= -I${.CURDIR} \ - -I${LDRSRC} \ - -D_KERNEL \ +CFLAGS+= -I${LDRSRC} \ -Wall \ -G0 \ -fno-pic -mno-abicalls \ Modified: head/stand/mips/beri/boot2/boot2.c ============================================================================== --- head/stand/mips/beri/boot2/boot2.c Sat Dec 2 00:07:25 2017 (r326446) +++ head/stand/mips/beri/boot2/boot2.c Sat Dec 2 00:07:31 2017 (r326447) @@ -500,7 +500,7 @@ parse() */ unit = q[len-1]; if (unit < '0' || unit > '9') { - printf("Invalid device: invalid unit\n", q, + printf("Invalid device: invalid unit %c\n", unit); return (-1); } Modified: head/stand/mips/beri/common/altera_jtag_uart.c ============================================================================== --- head/stand/mips/beri/common/altera_jtag_uart.c Sat Dec 2 00:07:25 2017 (r326446) +++ head/stand/mips/beri/common/altera_jtag_uart.c Sat Dec 2 00:07:31 2017 (r326447) @@ -131,13 +131,6 @@ uart_control_write(uint32_t v) } static int -uart_writable(void) -{ - - return ((uart_control_read() & ALTERA_JTAG_UART_CONTROL_WSPACE) != 0); -} - -static int uart_readable(void) { uint32_t v; Modified: head/stand/mips/beri/loader/Makefile ============================================================================== --- head/stand/mips/beri/loader/Makefile Sat Dec 2 00:07:25 2017 (r326446) +++ head/stand/mips/beri/loader/Makefile Sat Dec 2 00:07:31 2017 (r326447) @@ -67,7 +67,7 @@ SRCS+= altera_jtag_uart.c \ # Since we don't have a backward compatibility issue, default to this on BERI. CFLAGS+= -DBOOT_PROMPT_123 -HELP_FILES+= help.mips +HELP_FILES+= ${.CURDIR}/help.mips # Always add MI sources .include "${BOOTSRC}/loader.mk" Modified: head/stand/mips/beri/loader/devicename.c ============================================================================== --- head/stand/mips/beri/loader/devicename.c Sat Dec 2 00:07:25 2017 (r326446) +++ head/stand/mips/beri/loader/devicename.c Sat Dec 2 00:07:31 2017 (r326447) @@ -88,7 +88,7 @@ beri_arch_parsedev(struct disk_devdesc **dev, const ch struct disk_devdesc *idev; struct devsw *dv; int i, unit, err; - const char *cp; + char *cp; const char *np; /* minimum length check */ @@ -130,8 +130,10 @@ beri_arch_parsedev(struct disk_devdesc **dev, const ch goto fail; } } else { - cp = np; + err = EUNIT; + goto fail; } + if (*cp && (*cp != ':')) { err = EINVAL; goto fail; Modified: head/stand/mips/beri/loader/exec.c ============================================================================== --- head/stand/mips/beri/loader/exec.c Sat Dec 2 00:07:25 2017 (r326446) +++ head/stand/mips/beri/loader/exec.c Sat Dec 2 00:07:31 2017 (r326447) @@ -119,7 +119,7 @@ beri_elf64_exec(struct preloaded_file *fp) * least bootinfop. */ (*entry)(boot2_argc, (register_t)boot2_argv, (register_t)boot2_envv, - &bootinfo); + (register_t)&bootinfo); panic("exec returned"); } Modified: head/stand/mips/beri/loader/loader.h ============================================================================== --- head/stand/mips/beri/loader/loader.h Sat Dec 2 00:07:25 2017 (r326446) +++ head/stand/mips/beri/loader/loader.h Sat Dec 2 00:07:31 2017 (r326447) @@ -41,6 +41,7 @@ extern struct devsw beri_cfi_disk; extern struct devsw beri_sdcard_disk; /* devicename.c */ +struct env_var; int beri_arch_setcurrdev(struct env_var *, int, const void *); char *beri_arch_fmtdev(void *); int beri_arch_getdev(void **, const char *, const char **);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712020007.vB207VQ6033991>