CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: joerg Date: Sun May 3 21:02:24 UTC 2020 Modified Files: src/sys/arch/zaurus/stand/zboot: boot.h Log Message: Avoid common symbol declarations. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/zaurus/stand/zboot/boot.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/boot.h diff -u src/sys/arch/zaurus/stand/zboot/boot.h:1.3 src/sys/arch/zaurus/stand/zboot/boot.h:1.4 --- src/sys/arch/zaurus/stand/zboot/boot.h:1.3 Sat Jun 28 09:16:18 2014 +++ src/sys/arch/zaurus/stand/zboot/boot.h Sun May 3 21:02:24 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.h,v 1.3 2014/06/28 09:16:18 rtr Exp $ */ +/* $NetBSD: boot.h,v 1.4 2020/05/03 21:02:24 joerg Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro @@ -37,9 +37,9 @@ extern int debug; /* boot.c */ -char *default_devname; -uint default_unit, default_partition; -const char *default_filename; +extern char *default_devname; +extern uint default_unit, default_partition; +extern const char *default_filename; extern int default_timeout; void boot(dev_t);
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: dholland Date: Sat Jun 11 06:58:42 UTC 2016 Modified Files: src/sys/arch/zaurus/stand/zboot: boot.c bootmenu.c Log Message: PR 51200 gets in libsa considered harmful: use kgets To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/zaurus/stand/zboot/boot.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/zaurus/stand/zboot/bootmenu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/boot.c diff -u src/sys/arch/zaurus/stand/zboot/boot.c:1.7 src/sys/arch/zaurus/stand/zboot/boot.c:1.8 --- src/sys/arch/zaurus/stand/zboot/boot.c:1.7 Tue May 31 04:13:26 2016 +++ src/sys/arch/zaurus/stand/zboot/boot.c Sat Jun 11 06:58:42 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.7 2016/05/31 04:13:26 dholland Exp $ */ +/* $NetBSD: boot.c,v 1.8 2016/06/11 06:58:42 dholland Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro @@ -416,7 +416,7 @@ bootmenu(void) input[0] = '\0'; printf("> "); - gets(input); + kgets(input, sizeof(input)); /* * Skip leading whitespace. Index: src/sys/arch/zaurus/stand/zboot/bootmenu.c diff -u src/sys/arch/zaurus/stand/zboot/bootmenu.c:1.4 src/sys/arch/zaurus/stand/zboot/bootmenu.c:1.5 --- src/sys/arch/zaurus/stand/zboot/bootmenu.c:1.4 Sun Aug 10 07:40:50 2014 +++ src/sys/arch/zaurus/stand/zboot/bootmenu.c Sat Jun 11 06:58:42 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: bootmenu.c,v 1.4 2014/08/10 07:40:50 isaki Exp $ */ +/* $NetBSD: bootmenu.c,v 1.5 2016/06/11 06:58:42 dholland Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -99,7 +99,7 @@ doboottypemenu(void) printf("\nOption: [%d]:", bootcfg_info.def + 1); - gets(input); + kgets(input, sizeof(input)); choice = getchoicefrominput(input, bootcfg_info.def); } else if (bootcfg_info.timeout == 0) choice = bootcfg_info.def;
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: dholland Date: Tue May 31 04:13:26 UTC 2016 Modified Files: src/sys/arch/zaurus/stand/zboot: boot.c Log Message: PR 51195 David Binderman: simplify redundant conditional. XXX: there are too many copies of this function floating around ("gettrailer") To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/zaurus/stand/zboot/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/boot.c diff -u src/sys/arch/zaurus/stand/zboot/boot.c:1.6 src/sys/arch/zaurus/stand/zboot/boot.c:1.7 --- src/sys/arch/zaurus/stand/zboot/boot.c:1.6 Sat Jun 28 09:16:18 2014 +++ src/sys/arch/zaurus/stand/zboot/boot.c Tue May 31 04:13:26 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.6 2014/06/28 09:16:18 rtr Exp $ */ +/* $NetBSD: boot.c,v 1.7 2016/05/31 04:13:26 dholland Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro @@ -445,7 +445,7 @@ gettrailer(char *arg) *options++ = '\0'; /* trim leading blanks */ - while (*options && *options == ' ') + while (*options == ' ') options++; return options;
CVS commit: src/sys/arch/zaurus/stand
Module Name:src Committed By: christos Date: Sun Jan 31 15:32:13 UTC 2016 Modified Files: src/sys/arch/zaurus/stand/zboot: Makefile src/sys/arch/zaurus/stand/zbsdmod: Makefile Log Message: include bsd.init.mk to get Makefile.inc To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/zaurus/stand/zboot/Makefile cvs rdiff -u -r1.9 -r1.10 src/sys/arch/zaurus/stand/zbsdmod/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.17 src/sys/arch/zaurus/stand/zboot/Makefile:1.18 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.17 Tue Aug 26 23:17:21 2014 +++ src/sys/arch/zaurus/stand/zboot/Makefile Sun Jan 31 10:32:12 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.17 2014/08/27 03:17:21 matt Exp $ +# $NetBSD: Makefile,v 1.18 2016/01/31 15:32:12 christos Exp $ PROG= zboot @@ -12,7 +12,7 @@ SRCS+= pathfs.c NOMAN= # defined -.include +.include CFLAGS+= -Wall -Wno-main CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith Index: src/sys/arch/zaurus/stand/zbsdmod/Makefile diff -u src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.9 src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.10 --- src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.9 Tue Oct 14 04:33:38 2014 +++ src/sys/arch/zaurus/stand/zbsdmod/Makefile Sun Jan 31 10:32:13 2016 @@ -1,7 +1,9 @@ -# $NetBSD: Makefile,v 1.9 2014/10/14 08:33:38 nonaka Exp $ +# $NetBSD: Makefile,v 1.10 2016/01/31 15:32:13 christos Exp $ WARNS?= 4 +.include + S= ${.CURDIR}/../../../.. OBJS= zbsdmod.o
CVS commit: src/sys/arch/zaurus/stand
Module Name:src Committed By: christos Date: Sat Jan 23 22:28:09 UTC 2016 Modified Files: src/sys/arch/zaurus/stand: Makefile.inc Log Message: revert previous, we'll do differently To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/zaurus/stand/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/Makefile.inc diff -u src/sys/arch/zaurus/stand/Makefile.inc:1.4 src/sys/arch/zaurus/stand/Makefile.inc:1.5 --- src/sys/arch/zaurus/stand/Makefile.inc:1.4 Sat Jan 23 17:20:45 2016 +++ src/sys/arch/zaurus/stand/Makefile.inc Sat Jan 23 17:28:09 2016 @@ -1,5 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.4 2016/01/23 22:20:45 christos Exp $ +# $NetBSD: Makefile.inc,v 1.5 2016/01/23 22:28:09 christos Exp $ BINDIR= /usr/mdec KLINK_MACHINE= zaurus -CPPFLAGS+= -D_KERNTYPES
CVS commit: src/sys/arch/zaurus/stand
Module Name:src Committed By: christos Date: Sat Jan 23 22:20:45 UTC 2016 Modified Files: src/sys/arch/zaurus/stand: Makefile.inc Log Message: Add -D_KERNTYPES To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/zaurus/stand/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/Makefile.inc diff -u src/sys/arch/zaurus/stand/Makefile.inc:1.3 src/sys/arch/zaurus/stand/Makefile.inc:1.4 --- src/sys/arch/zaurus/stand/Makefile.inc:1.3 Thu May 2 00:22:45 2013 +++ src/sys/arch/zaurus/stand/Makefile.inc Sat Jan 23 17:20:45 2016 @@ -1,4 +1,5 @@ -# $NetBSD: Makefile.inc,v 1.3 2013/05/02 04:22:45 matt Exp $ +# $NetBSD: Makefile.inc,v 1.4 2016/01/23 22:20:45 christos Exp $ BINDIR= /usr/mdec KLINK_MACHINE= zaurus +CPPFLAGS+= -D_KERNTYPES
CVS commit: src/sys/arch/zaurus/stand/zbsdmod
Module Name:src Committed By: nonaka Date: Tue Oct 14 08:33:38 UTC 2014 Modified Files: src/sys/arch/zaurus/stand/zbsdmod: Makefile Log Message: Avoid "unhandled relocation of type 3 for" error when load module. "insmod zbsdmod.o" is successful now. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/zaurus/stand/zbsdmod/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zbsdmod/Makefile diff -u src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.8 src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.9 --- src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.8 Sun Dec 15 18:08:37 2013 +++ src/sys/arch/zaurus/stand/zbsdmod/Makefile Tue Oct 14 08:33:38 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 2013/12/15 18:08:37 joerg Exp $ +# $NetBSD: Makefile,v 1.9 2014/10/14 08:33:38 nonaka Exp $ WARNS?= 4 @@ -9,6 +9,7 @@ SRCS= zbsdmod.c NOMAN= # defined realall: ${OBJS} + ${OBJCOPY} -R .eh_frame ${.OBJDIR}/zbsdmod.o .include .include
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: matt Date: Wed Aug 27 03:17:21 UTC 2014 Modified Files: src/sys/arch/zaurus/stand/zboot: Makefile Log Message: Don't use ${MACHINE} but zaurus instead. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/zaurus/stand/zboot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.16 src/sys/arch/zaurus/stand/zboot/Makefile:1.17 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.16 Sun Jan 12 15:26:31 2014 +++ src/sys/arch/zaurus/stand/zboot/Makefile Wed Aug 27 03:17:21 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.16 2014/01/12 15:26:31 tsutsui Exp $ +# $NetBSD: Makefile,v 1.17 2014/08/27 03:17:21 matt Exp $ PROG= zboot @@ -61,7 +61,7 @@ LIBSA= ${SALIB} ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${VERSIONFILE} ${_MKTARGET_LINK} ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \ - ${VERSIONFILE} ${MACHINE} ${NEWVERSWHAT} + ${VERSIONFILE} zaurus ${NEWVERSWHAT} ${CC} ${CFLAGS} ${CPPFLAGS} -c vers.c ${LD} ${LDFLAGS} -o ${PROG} ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: christos Date: Wed Mar 26 08:02:38 UTC 2014 Modified Files: src/sys/arch/zaurus/stand/zboot: unixcons.c Log Message: use snprintf To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/zaurus/stand/zboot/unixcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/unixcons.c diff -u src/sys/arch/zaurus/stand/zboot/unixcons.c:1.2 src/sys/arch/zaurus/stand/zboot/unixcons.c:1.3 --- src/sys/arch/zaurus/stand/zboot/unixcons.c:1.2 Sat Nov 30 21:54:53 2013 +++ src/sys/arch/zaurus/stand/zboot/unixcons.c Wed Mar 26 04:02:38 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: unixcons.c,v 1.2 2013/12/01 02:54:53 joerg Exp $ */ +/* $NetBSD: unixcons.c,v 1.3 2014/03/26 08:02:38 christos Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro @@ -170,8 +170,7 @@ awaitkey(int timeout, int tell) char numbuf[20]; int len, j; - sprintf(numbuf, "%d ", i); - len = strlen(numbuf); + len = snprintf(numbuf, sizeof(numbuf), "%d ", i); for (j = 0; j < len; j++) numbuf[len + j] = '\b'; numbuf[len + j] = '\0';
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: joerg Date: Sun Dec 1 02:54:53 UTC 2013 Modified Files: src/sys/arch/zaurus/stand/zboot: unixcons.c Log Message: Use format string. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/zaurus/stand/zboot/unixcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/unixcons.c diff -u src/sys/arch/zaurus/stand/zboot/unixcons.c:1.1 src/sys/arch/zaurus/stand/zboot/unixcons.c:1.2 --- src/sys/arch/zaurus/stand/zboot/unixcons.c:1.1 Mon Mar 2 09:33:02 2009 +++ src/sys/arch/zaurus/stand/zboot/unixcons.c Sun Dec 1 02:54:53 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: unixcons.c,v 1.1 2009/03/02 09:33:02 nonaka Exp $ */ +/* $NetBSD: unixcons.c,v 1.2 2013/12/01 02:54:53 joerg Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro @@ -175,7 +175,7 @@ awaitkey(int timeout, int tell) for (j = 0; j < len; j++) numbuf[len + j] = '\b'; numbuf[len + j] = '\0'; - printf(numbuf); + printf("%s", numbuf); } c = common_getc(infd, 1); if (c == 0)
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: christos Date: Mon Nov 4 21:59:15 UTC 2013 Modified Files: src/sys/arch/zaurus/stand/zboot: unixdev.c Log Message: fix unused variables To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/zaurus/stand/zboot/unixdev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/unixdev.c diff -u src/sys/arch/zaurus/stand/zboot/unixdev.c:1.3 src/sys/arch/zaurus/stand/zboot/unixdev.c:1.4 --- src/sys/arch/zaurus/stand/zboot/unixdev.c:1.3 Wed Jan 18 18:12:21 2012 +++ src/sys/arch/zaurus/stand/zboot/unixdev.c Mon Nov 4 16:59:15 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: unixdev.c,v 1.3 2012/01/18 23:12:21 nonaka Exp $ */ +/* $NetBSD: unixdev.c,v 1.4 2013/11/04 21:59:15 christos Exp $ */ /* $OpenBSD: unixdev.c,v 1.6 2007/06/16 00:26:33 deraadt Exp $ */ /* @@ -86,6 +86,8 @@ unixopen(struct open_file *f, ...) #ifdef UNIX_DEBUG printf("%s: devname=%s, unit=%d, partition=%d, fname=%s\n", __func__, devname, unit, partition, fname); +#else + __USE(fname); #endif f->f_devdata = NULL; @@ -146,6 +148,8 @@ unixpathopen(struct open_file *f, ...) #ifdef UNIX_DEBUG printf("%s: devname=%s, unit=%d, partition=%d, fname=%s\n", __func__, devname, unit, partition, fname); +#else + __USE(devname); __USE(partition); __USE(unit); #endif if (fname == NULL || fname[0] == '\0')
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: christos Date: Mon Nov 4 21:30:16 UTC 2013 Modified Files: src/sys/arch/zaurus/stand/zboot: Makefile Log Message: fix more -mno-thumb. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/zaurus/stand/zboot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.12 src/sys/arch/zaurus/stand/zboot/Makefile:1.13 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.12 Thu Aug 15 17:41:09 2013 +++ src/sys/arch/zaurus/stand/zboot/Makefile Mon Nov 4 16:30:16 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.12 2013/08/15 21:41:09 matt Exp $ +# $NetBSD: Makefile,v 1.13 2013/11/04 21:30:16 christos Exp $ PROG= zboot @@ -22,7 +22,11 @@ CPPFLAGS+= -nostdinc -I. -I${.CURDIR} -I CPPFLAGS+= -D_STANDALONE -DHEAP_VARIABLE CPPFLAGS+= -DLIBSA_ENABLE_LS_OP CPPFLAGS+= -mabi=apcs-gnu -mfloat-abi=soft -mcpu=xscale +.if ${HAVE_GCC} < 48 CPPFLAGS+= -mno-thumb -mno-thumb-interwork +.else +CPPFLAGS+= -marm +.endif CPUFLAGS= AFLAGS+= -D_LOCORE LDFLAGS+= -nostdlib -Bstatic
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: matt Date: Mon Aug 12 22:50:51 UTC 2013 Modified Files: src/sys/arch/zaurus/stand/zboot: Makefile Log Message: Add -fno-unwind-tables To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/zaurus/stand/zboot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.10 src/sys/arch/zaurus/stand/zboot/Makefile:1.11 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.10 Thu May 2 03:56:42 2013 +++ src/sys/arch/zaurus/stand/zboot/Makefile Mon Aug 12 22:50:51 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2013/05/02 03:56:42 matt Exp $ +# $NetBSD: Makefile,v 1.11 2013/08/12 22:50:51 matt Exp $ PROG= zboot @@ -17,6 +17,7 @@ NOMAN= # defined CFLAGS+= -Wall -Wno-main CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith CFLAGS+= -fno-stack-protector -fno-builtin -ffreestanding +CFLAGS+= -fno-unwind-tables CPPFLAGS+= -nostdinc -I. -I${.CURDIR} -I${.OBJDIR} -I${S} CPPFLAGS+= -D_STANDALONE -DHEAP_VARIABLE CPPFLAGS+= -DLIBSA_ENABLE_LS_OP
CVS commit: src/sys/arch/zaurus/stand
Module Name:src Committed By: matt Date: Wed May 1 22:16:16 UTC 2013 Modified Files: src/sys/arch/zaurus/stand: Makefile Makefile.inc src/sys/arch/zaurus/stand/zboot: Makefile src/sys/arch/zaurus/stand/zbsdmod: Makefile Log Message: Force abi/float-abi/cpu Only allow to build on little-endian. Force MACHINE to be zaurus. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/zaurus/stand/Makefile cvs rdiff -u -r1.1 -r1.2 src/sys/arch/zaurus/stand/Makefile.inc cvs rdiff -u -r1.8 -r1.9 src/sys/arch/zaurus/stand/zboot/Makefile cvs rdiff -u -r1.6 -r1.7 src/sys/arch/zaurus/stand/zbsdmod/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/Makefile diff -u src/sys/arch/zaurus/stand/Makefile:1.2 src/sys/arch/zaurus/stand/Makefile:1.3 --- src/sys/arch/zaurus/stand/Makefile:1.2 Mon Mar 2 09:33:02 2009 +++ src/sys/arch/zaurus/stand/Makefile Wed May 1 22:16:15 2013 @@ -1,5 +1,9 @@ -# $NetBSD: Makefile,v 1.2 2009/03/02 09:33:02 nonaka Exp $ +# $NetBSD: Makefile,v 1.3 2013/05/01 22:16:15 matt Exp $ +.include + +.if ${TARGET_ENDIANNESS} == "1234" SUBDIR= zbsdmod zboot +.endif .include Index: src/sys/arch/zaurus/stand/Makefile.inc diff -u src/sys/arch/zaurus/stand/Makefile.inc:1.1 src/sys/arch/zaurus/stand/Makefile.inc:1.2 --- src/sys/arch/zaurus/stand/Makefile.inc:1.1 Thu Aug 9 16:08:59 2007 +++ src/sys/arch/zaurus/stand/Makefile.inc Wed May 1 22:16:15 2013 @@ -1,3 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.1 2007/08/09 16:08:59 nonaka Exp $ +# $NetBSD: Makefile.inc,v 1.2 2013/05/01 22:16:15 matt Exp $ BINDIR= /usr/mdec +MACHINE= zaurus Index: src/sys/arch/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.8 src/sys/arch/zaurus/stand/zboot/Makefile:1.9 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.8 Wed Jan 18 23:12:21 2012 +++ src/sys/arch/zaurus/stand/zboot/Makefile Wed May 1 22:16:16 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 2012/01/18 23:12:21 nonaka Exp $ +# $NetBSD: Makefile,v 1.9 2013/05/01 22:16:16 matt Exp $ PROG= zboot @@ -20,6 +20,8 @@ CFLAGS+= -fno-stack-protector -fno-built CPPFLAGS+= -nostdinc -I. -I${.CURDIR} -I${.OBJDIR} -I${S} CPPFLAGS+= -D_STANDALONE -DHEAP_VARIABLE CPPFLAGS+= -DLIBSA_ENABLE_LS_OP +CPPFLAGS+= -mabi=apcs-gnu -mfloat-abi=soft -mcpu=xscale +CPUFLAGS= AFLAGS+= -D_LOCORE LDFLAGS+= -nostdlib -Bstatic @@ -50,6 +52,7 @@ SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE LIBSA= ${SALIB} ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${VERSIONFILE} + ${_MKTARGET_LINK} ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \ ${VERSIONFILE} ${MACHINE} ${NEWVERSWHAT} ${CC} -c vers.c Index: src/sys/arch/zaurus/stand/zbsdmod/Makefile diff -u src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.6 src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.7 --- src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.6 Sun Dec 11 14:05:39 2011 +++ src/sys/arch/zaurus/stand/zbsdmod/Makefile Wed May 1 22:16:16 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.6 2011/12/11 14:05:39 nonaka Exp $ +# $NetBSD: Makefile,v 1.7 2013/05/01 22:16:16 matt Exp $ WARNS?= 4 @@ -21,6 +21,7 @@ CPUFLAGS= COPTS= -Os CFLAGS+= -fno-strict-aliasing CFLAGS+= -DMACHINE=\"${MACHINE}\" -DUTS_RELEASE=\"2.4.20\" +CPPFLAGS+= -mabi=apcs-gnu -mfloat-abi=soft -mcpu=xscale CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -I${.OBJDIR} -I${S}
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: nonaka Date: Wed Jan 18 23:12:22 UTC 2012 Modified Files: src/sys/arch/zaurus/stand/zboot: Makefile boot.c boot.h bootmenu.c conf.c devopen.c diskprobe.c pathnames.h unixdev.c unixdev.h version Added Files: src/sys/arch/zaurus/stand/zboot: pathfs.c pathfs.h Log Message: Support to read the kernel from local file system. ex. boot path:/mnt/card/netbsd To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/zaurus/stand/zboot/Makefile cvs rdiff -u -r1.4 -r1.5 src/sys/arch/zaurus/stand/zboot/boot.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/zaurus/stand/zboot/boot.h \ src/sys/arch/zaurus/stand/zboot/bootmenu.c \ src/sys/arch/zaurus/stand/zboot/conf.c \ src/sys/arch/zaurus/stand/zboot/devopen.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/zaurus/stand/zboot/diskprobe.c \ src/sys/arch/zaurus/stand/zboot/pathnames.h \ src/sys/arch/zaurus/stand/zboot/unixdev.c \ src/sys/arch/zaurus/stand/zboot/unixdev.h \ src/sys/arch/zaurus/stand/zboot/version cvs rdiff -u -r0 -r1.1 src/sys/arch/zaurus/stand/zboot/pathfs.c \ src/sys/arch/zaurus/stand/zboot/pathfs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.7 src/sys/arch/zaurus/stand/zboot/Makefile:1.8 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.7 Sun Dec 25 06:09:10 2011 +++ src/sys/arch/zaurus/stand/zboot/Makefile Wed Jan 18 23:12:21 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 2011/12/25 06:09:10 tsutsui Exp $ +# $NetBSD: Makefile,v 1.8 2012/01/18 23:12:21 nonaka Exp $ PROG= zboot @@ -8,6 +8,7 @@ SRCS= crt0.c SRCS+= boot.c bootinfo.c bootmenu.c conf.c devopen.c diskprobe.c SRCS+= loadfile_zboot.c SRCS+= getsecs.c termios.c unixcons.c unixdev.c unixsys.S +SRCS+= pathfs.c NOMAN= # defined @@ -33,7 +34,7 @@ NEWVERSWHAT?= "Boot" VERSIONFILE?= ${.CURDIR}/version ### find out what to use for libkern -KERN_AS= library +KERN_AS= library .include "${S}/lib/libkern/Makefile.inc" LIBKERN= ${KERNLIB} @@ -48,7 +49,7 @@ SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE .include "${S}/lib/libsa/Makefile.inc" LIBSA= ${SALIB} -${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} +${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${VERSIONFILE} ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \ ${VERSIONFILE} ${MACHINE} ${NEWVERSWHAT} ${CC} -c vers.c Index: src/sys/arch/zaurus/stand/zboot/boot.c diff -u src/sys/arch/zaurus/stand/zboot/boot.c:1.4 src/sys/arch/zaurus/stand/zboot/boot.c:1.5 --- src/sys/arch/zaurus/stand/zboot/boot.c:1.4 Sun Dec 25 06:09:10 2011 +++ src/sys/arch/zaurus/stand/zboot/boot.c Wed Jan 18 23:12:21 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.4 2011/12/25 06:09:10 tsutsui Exp $ */ +/* $NetBSD: boot.c,v 1.5 2012/01/18 23:12:21 nonaka Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro @@ -53,6 +53,7 @@ const char *default_filename; int default_timeout = 5; static char probed_disks[256]; +static char bootconfpath[1024]; static void bootcmd_help(char *); static void bootcmd_ls(char *); @@ -196,7 +197,10 @@ boot(dev_t bootdev) diskprobe(probed_disks, sizeof(probed_disks)); - parsebootconf(_PATH_BOOTCONF); + snprintf(bootconfpath, sizeof(bootconfpath), "%s%d%c:%s", + default_devname, default_unit, 'a' + default_partition, + _PATH_BOOTCONF); + parsebootconf(bootconfpath); #ifdef SUPPORT_CONSDEV /* @@ -296,8 +300,9 @@ bootcmd_help(char *arg) { printf("commands are:\n" - "boot [xdNx:][filename] [-acdqsv]\n" - " (ex. \"hd0a:netbsd.old -s\"\n" + "boot [xdNx:][filename] [-1acdqsv]\n" + " (ex. \"boot hd0a:netbsd.old -s\")\n" + " (ex. \"boot path:/mnt/card/netbsd -1\")\n" "ls [path]\n" #ifdef SUPPORT_CONSDEV "consdev {glass|com [speed]}\n" Index: src/sys/arch/zaurus/stand/zboot/boot.h diff -u src/sys/arch/zaurus/stand/zboot/boot.h:1.1 src/sys/arch/zaurus/stand/zboot/boot.h:1.2 --- src/sys/arch/zaurus/stand/zboot/boot.h:1.1 Mon Mar 2 09:33:02 2009 +++ src/sys/arch/zaurus/stand/zboot/boot.h Wed Jan 18 23:12:21 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.h,v 1.1 2009/03/02 09:33:02 nonaka Exp $ */ +/* $NetBSD: boot.h,v 1.2 2012/01/18 23:12:21 nonaka Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro @@ -52,6 +52,7 @@ void bootmenu(void); /* conf.c */ extern char devname_hd[]; extern char devname_mmcd[]; +extern char devname_path[]; /* loadfile_zboot.c */ int loadfile_zboot(const char *fname, u_long *marks, int flags); Index: src/sys/arch/zaurus/stand/zboot/bootmenu.c diff -u src/sys/arch/zaurus/stand/zboot/bootmenu.c:1.1 src/sys/arch/zaurus/stand/zboot/bootmenu.c:1.2 --- src/sys/arch/zaurus/stand/zboot/bootmenu.c:1.1 Mon Mar 2 09:33:02 2009 +++ src/sys/arch/zaurus/stand/zboot/bootmenu.c Wed Jan 18 23:12:21 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: boot
CVS commit: src/sys/arch/zaurus/stand/zbsdmod
Module Name:src Committed By: nonaka Date: Fri Dec 16 14:17:41 UTC 2011 Modified Files: src/sys/arch/zaurus/stand/zbsdmod: zbsdmod.c Log Message: more clean D-cache. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c diff -u src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.7 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.8 --- src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.7 Sun Dec 11 14:05:39 2011 +++ src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c Fri Dec 16 14:17:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: zbsdmod.c,v 1.7 2011/12/11 14:05:39 nonaka Exp $ */ +/* $NetBSD: zbsdmod.c,v 1.8 2011/12/16 14:17:41 nonaka Exp $ */ /* $OpenBSD: zbsdmod.c,v 1.7 2005/05/02 02:45:29 uwe Exp $ */ /* @@ -94,6 +94,7 @@ static int havesyms; /* The maximum size of a kernel image is restricted to 5MB. */ static u_int bsdimage[5242880/sizeof(u_int)]; /* XXX use kmalloc() */ static char bootargs[BOOTARGS_BUFSIZ]; +static u_int datacacheclean[65536/sizeof(u_int)] __attribute__((aligned(32))); /* * Boot the loaded BSD kernel image, or return if an error is found. @@ -265,17 +266,31 @@ elf32bsdboot(void) addr = (int *)(elf->e_entry); __asm volatile ( + /* Clean D-cache */ + "mov r0, %1;" + "mov r1, #65536;" + "1:" + "ldr r2, [r0], #32;" + "subs r1, r1, #32;" + "bne 1b;" + "mcr p15, 0, r1, c7, c10, 4;" /*drain write and fill buffer*/ + "mrc p15, 0, r1, c2, c0, 0;" /* CPWAIT */ + "mov r1, r1;" + "sub pc, pc, #4;" + /* Disable MMU and jump to kernel entry address */ "mov r0, %0;" - "mcr p15, 0, r1, c7, c7, 0;" - "mrc p15, 0, r1, c2, c0, 0;" + "mcr p15, 0, r1, c7, c7, 0;" /* flush I+D cache */ + "mrc p15, 0, r1, c2, c0, 0;" /* CPWAIT */ "mov r1, r1;" "sub pc, pc, #4;" "mov r1, #(0x0010 | 0x0020);" - "mcr p15, 0, r1, c1, c0, 0;" - "mcr p15, 0, r1, c8, c7, 0;" - "mrc p15, 0, r1, c2, c0, 0;" + "mcr p15, 0, r1, c1, c0, 0;" /* Write new control register */ + "mcr p15, 0, r1, c8, c7, 0;" /* invalidate I+D TLB */ + "mcr p15, 0, r1, c7, c5, 0;" /* invalidate I$ and BTB */ + "mcr p15, 0, r1, c7, c10, 4;" /*drain write and fill buffer*/ + "mrc p15, 0, r1, c2, c0, 0;" /* CPWAIT_AND_RETURN */ "sub pc, r0, r1, lsr #32;" - :: "r" (addr) : "r0", "r1"); + :: "r" (addr), "r" (datacacheclean) : "r0", "r1", "r2"); } /* @@ -329,7 +344,7 @@ zbsdmod_write(struct file *f, const char return 0; if (*offp + len >= sizeof(bsdimage)) - return EFBIG; + return -EFBIG; memcpy(((char *)bsdimage) + *offp, buf, len);
CVS commit: src/sys/arch/zaurus/stand/zbsdmod
Module Name:src Committed By: nonaka Date: Sun Dec 11 14:05:39 UTC 2011 Modified Files: src/sys/arch/zaurus/stand/zbsdmod: Makefile compat_linux.h zbsdmod.c Log Message: - WARNS=4 - object size is more smaller. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/zaurus/stand/zbsdmod/Makefile \ src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h cvs rdiff -u -r1.6 -r1.7 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zbsdmod/Makefile diff -u src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.5 src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.6 --- src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.5 Mon Apr 13 12:25:36 2009 +++ src/sys/arch/zaurus/stand/zbsdmod/Makefile Sun Dec 11 14:05:39 2011 @@ -1,10 +1,12 @@ -# $NetBSD: Makefile,v 1.5 2009/04/13 12:25:36 nonaka Exp $ +# $NetBSD: Makefile,v 1.6 2011/12/11 14:05:39 nonaka Exp $ + +WARNS?= 4 S= ${.CURDIR}/../../../.. OBJS= zbsdmod.o SRCS= zbsdmod.c -NOMAN= yes +NOMAN= # defined realall: ${OBJS} @@ -15,7 +17,9 @@ afterinstall: ${INSTALL_FILE} ${INSTALL_COPY} -o root -g wheel -m 644 \ ${OBJS} ${DESTDIR}/${BINDIR} -CFLAGS= -Wall -Wmissing-prototypes -Wstrict-prototypes +CPUFLAGS= +COPTS= -Os +CFLAGS+= -fno-strict-aliasing CFLAGS+= -DMACHINE=\"${MACHINE}\" -DUTS_RELEASE=\"2.4.20\" CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -I${.OBJDIR} -I${S} Index: src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h diff -u src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h:1.5 src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h:1.6 --- src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h:1.5 Sun Dec 26 09:02:52 2010 +++ src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h Sun Dec 11 14:05:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_linux.h,v 1.5 2010/12/26 09:02:52 nonaka Exp $ */ +/* $NetBSD: compat_linux.h,v 1.6 2011/12/11 14:05:39 nonaka Exp $ */ /* $OpenBSD: compat_linux.h,v 1.5 2006/01/15 17:58:27 deraadt Exp $ */ /* @@ -31,12 +31,6 @@ struct file; struct inode; -#include -#define ELFSIZE 32 -#include -#include -#include - typedef long loff_t; struct file_operations { @@ -71,12 +65,6 @@ extern int unregister_chrdev(unsigned in extern void printk(const char *, ...) __printflike(1, 2); extern void *memcpy(void *, const void *, size_t); -/* Linux LKM support */ -static const char __module_kernel_version[] __attribute__((section(".modinfo"))) = -"kernel_version=" UTS_RELEASE; -static const char __module_using_checksums[] __attribute__((section(".modinfo"))) = -"using_checksums=1"; - /* procfs support */ struct proc_dir_entry { unsigned short low_ino; Index: src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c diff -u src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.6 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.7 --- src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.6 Thu May 5 09:07:59 2011 +++ src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c Sun Dec 11 14:05:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: zbsdmod.c,v 1.6 2011/05/05 09:07:59 nonaka Exp $ */ +/* $NetBSD: zbsdmod.c,v 1.7 2011/12/11 14:05:39 nonaka Exp $ */ /* $OpenBSD: zbsdmod.c,v 1.7 2005/05/02 02:45:29 uwe Exp $ */ /* @@ -21,10 +21,22 @@ * Zaurus NetBSD bootstrap loader. */ -#include "compat_linux.h" +#include +#define ELFSIZE 32 +#include +#include +#include #include +#include "compat_linux.h" + +/* Linux LKM support */ +const char __module_kernel_version[] __attribute__((section(".modinfo"))) = +"kernel_version=" UTS_RELEASE; +const char __module_using_checksums[] __attribute__((section(".modinfo"))) = +"using_checksums=1"; + #define ZBOOTDEV_MAJOR 99 #define ZBOOTDEV_MODE 0222 #define ZBOOTDEV_NAME "zboot" @@ -57,6 +69,11 @@ static struct file_operations fops = { 0, /* check media change */ 0, /* revalidate */ 0, /* lock */ + 0, /* sendpage */ + 0, /* get_unmapped_area */ +#ifdef MAGIC_ROM_PTR + 0, /* romptr */ +#endif /* MAGIC_ROM_PTR */ }; static int isopen; @@ -108,7 +125,7 @@ elf32bsdboot(void) continue; #define IS_TEXT(p) (p.p_flags & PF_X) -#define IS_DATA(p) ((p.p_flags & PF_X) == 0) +#define IS_DATA(p) (p.p_flags & PF_W) #define IS_BSS(p) (p.p_filesz < p.p_memsz) /* * XXX: Assume first address is lowest @@ -249,16 +266,16 @@ elf32bsdboot(void) addr = (int *)(elf->e_entry); __asm volatile ( "mov r0, %0;" - "mov r2, #0;" - "mcr p15, 0, r2, c7, c7, 0;" - "mov r2, r2;" + "mcr p15, 0, r1, c7, c7, 0;" + "mrc p15, 0, r1, c2, c0, 0;" + "mov r1, r1;" "sub pc, pc, #4;" "mov r1, #(0x0010 | 0x0020);" "mcr p15, 0, r1, c1, c0, 0;" - "mcr p15, 0, r2, c8, c7, 0;" - "mov r2, r2;" - "sub pc, pc, #4;" - "mov pc, r0" :: "r"(addr) : "r0","r1","r2"); + "mcr p15, 0, r1, c8, c7, 0;" + "mrc p15, 0, r1, c2, c0, 0;" + "sub pc, r0, r1, lsr #32;" + :: "r" (addr) : "r0", "r1"); } /* @@ -346,10 +363,8 @@ zbsdmo
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: nonaka Date: Mon Jun 20 12:39:21 UTC 2011 Modified Files: src/sys/arch/zaurus/stand/zboot: boot.c compat_linux.h diskprobe.c pathnames.h unixdev.h unixsys.S version Log Message: support SL-C1000. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/zaurus/stand/zboot/boot.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/zaurus/stand/zboot/compat_linux.h \ src/sys/arch/zaurus/stand/zboot/diskprobe.c \ src/sys/arch/zaurus/stand/zboot/pathnames.h \ src/sys/arch/zaurus/stand/zboot/unixdev.h \ src/sys/arch/zaurus/stand/zboot/unixsys.S \ src/sys/arch/zaurus/stand/zboot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/boot.c diff -u src/sys/arch/zaurus/stand/zboot/boot.c:1.2 src/sys/arch/zaurus/stand/zboot/boot.c:1.3 --- src/sys/arch/zaurus/stand/zboot/boot.c:1.2 Sat Jan 22 19:19:25 2011 +++ src/sys/arch/zaurus/stand/zboot/boot.c Mon Jun 20 12:39:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.2 2011/01/22 19:19:25 joerg Exp $ */ +/* $NetBSD: boot.c,v 1.3 2011/06/20 12:39:21 nonaka Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro @@ -128,7 +128,7 @@ } while (isnum(fname[i])); } -#define isvalidpart(c) ((c) >= 'a' && (c) <= 'a' + MAXPARTITIONS) +#define isvalidpart(c) ((c) >= 'a' && (c) < 'a' + MAXPARTITIONS) if (i < devlen) { if (!isvalidpart(fname[i])) return (EPART); Index: src/sys/arch/zaurus/stand/zboot/compat_linux.h diff -u src/sys/arch/zaurus/stand/zboot/compat_linux.h:1.1 src/sys/arch/zaurus/stand/zboot/compat_linux.h:1.2 --- src/sys/arch/zaurus/stand/zboot/compat_linux.h:1.1 Mon Mar 2 09:33:02 2009 +++ src/sys/arch/zaurus/stand/zboot/compat_linux.h Mon Jun 20 12:39:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_linux.h,v 1.1 2009/03/02 09:33:02 nonaka Exp $ */ +/* $NetBSD: compat_linux.h,v 1.2 2011/06/20 12:39:21 nonaka Exp $ */ /* $OpenBSD: compat_linux.h,v 1.8 2007/06/16 00:26:33 deraadt Exp $ */ /* @@ -60,6 +60,7 @@ #define __NR_ioctl (__NR_SYSCALL_BASE + LINUX_SYS_ioctl) #define __NR_select (__NR_SYSCALL_BASE + LINUX_SYS_select) #define __NR_stat (__NR_SYSCALL_BASE + LINUX_SYS_stat) +#define __NR_fstat (__NR_SYSCALL_BASE + LINUX_SYS_fstat) #define __NR_syscall (__NR_SYSCALL_BASE + 113) #undef SYS_select Index: src/sys/arch/zaurus/stand/zboot/diskprobe.c diff -u src/sys/arch/zaurus/stand/zboot/diskprobe.c:1.1 src/sys/arch/zaurus/stand/zboot/diskprobe.c:1.2 --- src/sys/arch/zaurus/stand/zboot/diskprobe.c:1.1 Mon Mar 2 09:33:02 2009 +++ src/sys/arch/zaurus/stand/zboot/diskprobe.c Mon Jun 20 12:39:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: diskprobe.c,v 1.1 2009/03/02 09:33:02 nonaka Exp $ */ +/* $NetBSD: diskprobe.c,v 1.2 2011/06/20 12:39:21 nonaka Exp $ */ /* $OpenBSD: diskprobe.c,v 1.3 2006/10/13 00:00:55 krw Exp $ */ /* @@ -40,14 +40,20 @@ #include "boot.h" #include "disk.h" #include "unixdev.h" +#include "pathnames.h" #include "compat_linux.h" +/* All the info on /proc/partitions */ +struct partinfo { + char devname[MAXDEVNAME]; + TAILQ_ENTRY(partinfo) list; +}; +TAILQ_HEAD(partlist_lh, partinfo); +struct partlist_lh partlist; + /* Disk spin-up wait timeout. */ static u_int timeout = 10; -/* Local Prototypes */ -static void hardprobe(char *buf, size_t bufsiz); - /* List of disk devices we found/probed */ struct disklist_lh disklist; @@ -129,11 +135,130 @@ strlcat(buf, "none...", bufsiz); } +static void +getpartitions(void) +{ + struct linux_stat sb; + struct partinfo *pip; + char *bc, *top, *next, *p, *q; + int fd, off, len; + + fd = uopen(_PATH_PARTITIONS, LINUX_O_RDONLY); + if (fd == -1) + return; + + if (ufstat(fd, &sb) < 0) { + uclose(fd); + return; + } + + bc = alloc(sb.lst_size + 1); + if (bc == NULL) { + printf("Could not allocate memory for %s\n", _PATH_PARTITIONS); + uclose(fd); + return; + } + + off = 0; + do { + len = uread(fd, bc + off, 1024); + if (len <= 0) + break; + off += len; + } while (len > 0); + bc[off] = '\0'; + + uclose(fd); + + /* bc now contains the whole /proc/partitions */ + for (p = bc; *p != '\0'; p = next) { + top = p; + + /* readline */ + for (; *p != '\0' && *p != '\r' && *p != '\n'; p++) + continue; + if (*p == '\r') { + *p++ = '\0'; + if (*p == '\n') +*p++ = '\0'; + } else if (*p == '\n') + *p++ = '\0'; + next = p; + + /* + * /proc/partitions format: + * major minor #blocks name + * + * %d%d %d %s + * + * e.g.: + * major minor #blocks name + * + * 22 07962192 hdc + * 22 1 10079 hdc1 + * 60 0 965120 mmcda + * 60 1 43312 mmcda1 + */ + + /* trailing space */ + for (p = top; *p == ' ' || *p == '\t'; p++) + continue; + + /* major */ + for (; isdigit(*p); p++) + continue; + if (*p != ' ' && *p != '\t') + continue; /* next line */ + for (; *p == ' ' || *p == '\t'
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: joerg Date: Sun Jan 23 13:17:02 UTC 2011 Modified Files: src/sys/arch/zaurus/stand/zboot: Makefile Log Message: Defer bsd.own.mk include after NOMAN. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/zaurus/stand/zboot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.5 src/sys/arch/zaurus/stand/zboot/Makefile:1.6 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.5 Sat Jan 22 19:19:25 2011 +++ src/sys/arch/zaurus/stand/zboot/Makefile Sun Jan 23 13:17:02 2011 @@ -1,6 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2011/01/22 19:19:25 joerg Exp $ - -.include +# $NetBSD: Makefile,v 1.6 2011/01/23 13:17:02 joerg Exp $ PROG= zboot @@ -13,6 +11,8 @@ NOMAN= # defined +.include + CFLAGS+= -Wall -Wno-main CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith CFLAGS+= -fno-stack-protector -fno-builtin -ffreestanding
CVS commit: src/sys/arch/zaurus/stand/zbsdmod
Module Name:src Committed By: nonaka Date: Sun Dec 26 09:03:56 UTC 2010 Modified Files: src/sys/arch/zaurus/stand/zbsdmod: zbsdmod.c Log Message: Add missing argument to printk(). (from OpenBSD) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c diff -u src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.4 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.5 --- src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.4 Mon Mar 2 09:33:02 2009 +++ src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c Sun Dec 26 09:03:56 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: zbsdmod.c,v 1.4 2009/03/02 09:33:02 nonaka Exp $ */ +/* $NetBSD: zbsdmod.c,v 1.5 2010/12/26 09:03:56 nonaka Exp $ */ /* $OpenBSD: zbsdmod.c,v 1.7 2005/05/02 02:45:29 uwe Exp $ */ /* @@ -273,7 +273,7 @@ rc = register_chrdev(ZBOOTDEV_MAJOR, ZBOOTDEV_NAME, &fops); if (rc != 0) { printk("%s: register_chrdev(%d, ...): error %d\n", - ZBOOTMOD_NAME, -rc); + ZBOOTMOD_NAME, ZBOOTDEV_MAJOR, -rc); return 1; } @@ -346,7 +346,7 @@ return -EBUSY; if (position > 0) { - printk("%s: loaded %d bytes\n", ZBOOTDEV_NAME, + printk("%s: loaded %ld bytes\n", ZBOOTDEV_NAME, position); if (position < BOOTINFO_MAXSIZE) {
CVS commit: src/sys/arch/zaurus/stand/zbsdmod
Module Name:src Committed By: nonaka Date: Sun Dec 26 09:02:52 UTC 2010 Modified Files: src/sys/arch/zaurus/stand/zbsdmod: compat_linux.h Log Message: Advertise printk() as a printf-like function. (from OpenBSD) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h diff -u src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h:1.4 src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h:1.5 --- src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h:1.4 Wed Oct 17 19:58:41 2007 +++ src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h Sun Dec 26 09:02:52 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_linux.h,v 1.4 2007/10/17 19:58:41 garbled Exp $ */ +/* $NetBSD: compat_linux.h,v 1.5 2010/12/26 09:02:52 nonaka Exp $ */ /* $OpenBSD: compat_linux.h,v 1.5 2006/01/15 17:58:27 deraadt Exp $ */ /* @@ -31,6 +31,7 @@ struct file; struct inode; +#include #define ELFSIZE 32 #include #include @@ -67,7 +68,7 @@ extern int memcmp(const void *, const void *, size_t); extern int register_chrdev(unsigned int, const char *, struct file_operations *); extern int unregister_chrdev(unsigned int, const char *); -extern void printk(const char *, ...); +extern void printk(const char *, ...) __printflike(1, 2); extern void *memcpy(void *, const void *, size_t); /* Linux LKM support */
CVS commit: src/sys/arch/zaurus/stand
Module Name:src Committed By: nonaka Date: Mon Apr 13 12:25:36 UTC 2009 Modified Files: src/sys/arch/zaurus/stand/zboot: Makefile src/sys/arch/zaurus/stand/zbsdmod: Makefile Log Message: Use to create ${MACHINE} and ${MACHINE_ARCH} symlinks. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/zaurus/stand/zboot/Makefile cvs rdiff -u -r1.4 -r1.5 src/sys/arch/zaurus/stand/zbsdmod/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.2 src/sys/arch/zaurus/stand/zboot/Makefile:1.3 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.2 Tue Mar 3 09:20:55 2009 +++ src/sys/arch/zaurus/stand/zboot/Makefile Mon Apr 13 12:25:36 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2009/03/03 09:20:55 nonaka Exp $ +# $NetBSD: Makefile,v 1.3 2009/04/13 12:25:36 nonaka Exp $ PROG= zboot @@ -29,20 +29,6 @@ NEWVERSWHAT?= "Boot" VERSIONFILE?= ${.CURDIR}/version -.if !make(obj) && !make(clean) && !make(cleandir) && !make(release) -.BEGIN: machine arm -.NOPATH: machine arm - -machine:: - -rm -f $@ - ln -s ${S}/arch/${MACHINE}/include $@ - -arm:: - -rm -f $@ - ln -s ${S}/arch/arm/include $@ -.endif -CLEANFILES+= machine arm - ### find out what to use for libkern KERN_AS= library .include "${S}/lib/libkern/Makefile.inc" @@ -64,6 +50,7 @@ ${CC} -c vers.c ${LD} ${LDFLAGS} -o ${PROG} ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN} +.include .include cleandir distclean: cleanlibdir Index: src/sys/arch/zaurus/stand/zbsdmod/Makefile diff -u src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.4 src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.5 --- src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.4 Wed Oct 17 19:58:41 2007 +++ src/sys/arch/zaurus/stand/zbsdmod/Makefile Mon Apr 13 12:25:36 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2007/10/17 19:58:41 garbled Exp $ +# $NetBSD: Makefile,v 1.5 2009/04/13 12:25:36 nonaka Exp $ S= ${.CURDIR}/../../../.. @@ -8,9 +8,7 @@ realall: ${OBJS} -cleandir: - rm -f machine arm - +.include .include afterinstall: @@ -22,19 +20,6 @@ CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -I${.OBJDIR} -I${S} -.if !make(obj) && !make(clean) && !make(cleandir) && !make(release) -.BEGIN: machine arm -.NOPATH: machine arm - -machine:: - -rm -f $@ - ln -s ${S}/arch/${MACHINE}/include $@ - -arm:: - -rm -f $@ - ln -s ${S}/arch/arm/include $@ -.endif - release: check_RELEASEDIR ${HOST_INSTALL_FILE} -m ${NONBINMODE} ${OBJS} \ ${RELEASEDIR}/${MACHINE}/installation