CVS commit: src/sys/arch/x68k/stand/libsa

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 04:12:10 UTC 2016

Modified Files:
src/sys/arch/x68k/stand/libsa: parseutils.c

Log Message:
PR 51194 David Binderman: simplify redundant conditional


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x68k/stand/libsa/parseutils.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/x68k/stand/libsa/parseutils.c
diff -u src/sys/arch/x68k/stand/libsa/parseutils.c:1.2 src/sys/arch/x68k/stand/libsa/parseutils.c:1.3
--- src/sys/arch/x68k/stand/libsa/parseutils.c:1.2	Sun Nov 11 05:20:27 2007
+++ src/sys/arch/x68k/stand/libsa/parseutils.c	Tue May 31 04:12:10 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: parseutils.c,v 1.2 2007/11/11 05:20:27 isaki Exp $	*/
+/*	$NetBSD: parseutils.c,v 1.3 2016/05/31 04:12:10 dholland Exp $	*/
 
 /*
  *	from /sys/arch/i386/lib/parseutils.c
@@ -64,7 +64,7 @@ gettrailer(char *arg)
 		*options++ = '\0';
 
 	/* trim leading blanks */
-	while (*options && *options == ' ')
+	while (*options == ' ')
 		options++;
 
 	return options;



CVS commit: src/sys/arch/x68k/stand/libsa

2015-07-25 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jul 25 06:58:37 UTC 2015

Modified Files:
src/sys/arch/x68k/stand/libsa: Makefile

Log Message:
sysinst is 15*2 sect/cyl (fdXc), not 8*2 sect/cyl (it's fdXa,
DOS compatible).  It makes the loading of sysinst a bit faster.
Pointed out by Yosuke Sugahara.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/x68k/stand/libsa/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/x68k/stand/libsa/Makefile
diff -u src/sys/arch/x68k/stand/libsa/Makefile:1.29 src/sys/arch/x68k/stand/libsa/Makefile:1.30
--- src/sys/arch/x68k/stand/libsa/Makefile:1.29	Fri Oct 12 20:15:52 2012
+++ src/sys/arch/x68k/stand/libsa/Makefile	Sat Jul 25 06:58:37 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.29 2012/10/12 20:15:52 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.30 2015/07/25 06:58:37 isaki Exp $
 
 S=		${.CURDIR}/../../../..
 
@@ -9,7 +9,7 @@ CPPFLAGS+=	-I${.CURDIR}/../libiocs -I${.
 CPPFLAGS+=	-D_STANDALONE
 CPPFLAGS+=	-DHEAP_VARIABLE
 CPPFLAGS+=	-DHAVE_CHANGEDISK_HOOK
-CPPFLAGS+=	-DUSTAR_SECT_PER_CYL=16
+CPPFLAGS+=	-DUSTAR_SECT_PER_CYL=30
 CPPFLAGS+=	-DLIBSA_ENABLE_LS_OP
 CPPFLAGS+=	-DSUPPORT_BOOTP -DSUPPORT_DHCP
 #CPPFLAGS+=	-DDEBUG



CVS commit: src/sys/arch/x68k/stand/libsa

2014-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov 20 15:48:05 UTC 2014

Modified Files:
src/sys/arch/x68k/stand/libsa: clock.c

Log Message:
This now needs clock.h


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x68k/stand/libsa/clock.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/x68k/stand/libsa/clock.c
diff -u src/sys/arch/x68k/stand/libsa/clock.c:1.3 src/sys/arch/x68k/stand/libsa/clock.c:1.4
--- src/sys/arch/x68k/stand/libsa/clock.c:1.3	Sun Nov 16 21:15:49 2014
+++ src/sys/arch/x68k/stand/libsa/clock.c	Thu Nov 20 10:48:05 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.3 2014/11/17 02:15:49 christos Exp $ */
+/* $NetBSD: clock.c,v 1.4 2014/11/20 15:48:05 christos Exp $ */
 
 /*
  * Copyright (c) 2003 Tetsuya Isaki. All rights reserved.
@@ -26,6 +26,7 @@
  */
  
 #include sys/types.h
+#include sys/clock.h
 #include lib/libsa/stand.h
 #include lib/libsa/net.h
 #include iocs.h



CVS commit: src/sys/arch/x68k/stand/libsa

2014-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 21 01:18:39 UTC 2014

Modified Files:
src/sys/arch/x68k/stand/libsa: clock.c

Log Message:
put back missing paren.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x68k/stand/libsa/clock.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/x68k/stand/libsa/clock.c
diff -u src/sys/arch/x68k/stand/libsa/clock.c:1.4 src/sys/arch/x68k/stand/libsa/clock.c:1.5
--- src/sys/arch/x68k/stand/libsa/clock.c:1.4	Thu Nov 20 10:48:05 2014
+++ src/sys/arch/x68k/stand/libsa/clock.c	Thu Nov 20 20:18:39 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.4 2014/11/20 15:48:05 christos Exp $ */
+/* $NetBSD: clock.c,v 1.5 2014/11/21 01:18:39 christos Exp $ */
 
 /*
  * Copyright (c) 2003 Tetsuya Isaki. All rights reserved.
@@ -73,9 +73,8 @@ getsecs(void)
 		days++;
 
 	/* now we have days since Jan 1, 1970. the rest is easy... */
-	return days * SECS_PER_DAY) + (hour * SECS_PER_HOUR)
-	+ (min * SECS_PER_MINUTE) + sec
-	+ (rtc_offset * 60);
+	return (days * SECS_PER_DAY) + (hour * SECS_PER_HOUR)
+	+ (min * SECS_PER_MINUTE) + sec + (rtc_offset * 60);
 }
 
 void



CVS commit: src/sys/arch/x68k/stand/libsa

2014-03-07 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Mar  8 03:20:24 UTC 2014

Modified Files:
src/sys/arch/x68k/stand/libsa: fd.c

Log Message:
Unused variable, for GCC4.8.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x68k/stand/libsa/fd.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/x68k/stand/libsa/fd.c
diff -u src/sys/arch/x68k/stand/libsa/fd.c:1.7 src/sys/arch/x68k/stand/libsa/fd.c:1.8
--- src/sys/arch/x68k/stand/libsa/fd.c:1.7	Sun Jul 17 20:54:49 2011
+++ src/sys/arch/x68k/stand/libsa/fd.c	Sat Mar  8 03:20:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd.c,v 1.7 2011/07/17 20:54:49 joerg Exp $	*/
+/*	$NetBSD: fd.c,v 1.8 2014/03/08 03:20:24 isaki Exp $	*/
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -40,7 +40,8 @@ fdopen(struct open_file *f, ...)
 	int error;
 	struct fd_softc *sc;
 	struct fdfmt fdfmt;
-	int id, part;
+	int id;
+	int part __unused;
 	va_list ap;
 
 	va_start(ap, f);



CVS commit: src/sys/arch/x68k/stand/libsa

2012-11-24 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Nov 25 04:07:00 UTC 2012

Modified Files:
src/sys/arch/x68k/stand/libsa: putimage.S

Log Message:
Make the end of image address absolute-long.
It allows to locate the end of image higher than 0x1.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x68k/stand/libsa/putimage.S

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/x68k/stand/libsa/putimage.S
diff -u src/sys/arch/x68k/stand/libsa/putimage.S:1.4 src/sys/arch/x68k/stand/libsa/putimage.S:1.5
--- src/sys/arch/x68k/stand/libsa/putimage.S:1.4	Mon Feb 21 02:31:59 2011
+++ src/sys/arch/x68k/stand/libsa/putimage.S	Sun Nov 25 04:06:59 2012
@@ -1,7 +1,7 @@
 | file: putimage.S
 | author: ITOH Yasufumi
 |
-| $NetBSD: putimage.S,v 1.4 2011/02/21 02:31:59 itohy Exp $
+| $NetBSD: putimage.S,v 1.5 2012/11/25 04:06:59 isaki Exp $
 
 #include machine/asm.h
 #include iocscall.h
@@ -21,7 +21,7 @@ ENTRY_NOPROFILE(put_image)
 		movel	%a1@+,%a4@+
 
 		lea	%pc@(img_title),%a2
-		moveaw	%a2@+,%a3		| only the lower word is valid
+		moveal	%a2@+,%a3
 
 1:		tstb	%a2@+			| skip human readable comment
 		jne	1b
@@ -98,7 +98,7 @@ Lrxabort:	moveml	%sp@+,%d2-%d7/%a2-%a4
 		rts
 
 img_title:
-	.word	imgend1
+	.long	imgend1
 	| compressed image data
 
 	| BSD Daemon Image, used for NetBSD boot by permission.



CVS commit: src/sys/arch/x68k/stand/libsa

2012-11-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Nov 22 20:15:50 UTC 2012

Modified Files:
src/sys/arch/x68k/stand/libsa: sdcd.c

Log Message:
Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x68k/stand/libsa/sdcd.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/x68k/stand/libsa/sdcd.c
diff -u src/sys/arch/x68k/stand/libsa/sdcd.c:1.13 src/sys/arch/x68k/stand/libsa/sdcd.c:1.14
--- src/sys/arch/x68k/stand/libsa/sdcd.c:1.13	Tue Jun 19 12:59:17 2012
+++ src/sys/arch/x68k/stand/libsa/sdcd.c	Thu Nov 22 20:15:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdcd.c,v 1.13 2012/06/19 12:59:17 minoura Exp $	*/
+/*	$NetBSD: sdcd.c,v 1.14 2012/11/22 20:15:49 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -339,6 +339,7 @@ cdopen(struct open_file *f, ...)
 	sc = alloc(sizeof(struct sdcd_softc));
 	current_npart = 3;
 	sc-sc_part = 0;
+	sc-sc_partinfo.start = 0;
 	sc-sc_partinfo.size = current_devsize;
 	sc-sc_blocksize = current_blklen  9;
 	f-f_devdata = sc;



CVS commit: src/sys/arch/x68k/stand/libsa

2012-10-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Oct 12 18:01:53 UTC 2012

Modified Files:
src/sys/arch/x68k/stand/libsa: consio.c

Log Message:
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
any other key for boot menu interrupt during boot didn't work
in that case.

The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x68k/stand/libsa/consio.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/x68k/stand/libsa/consio.c
diff -u src/sys/arch/x68k/stand/libsa/consio.c:1.9 src/sys/arch/x68k/stand/libsa/consio.c:1.10
--- src/sys/arch/x68k/stand/libsa/consio.c:1.9	Sun Jul 17 20:54:49 2011
+++ src/sys/arch/x68k/stand/libsa/consio.c	Fri Oct 12 18:01:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: consio.c,v 1.9 2011/07/17 20:54:49 joerg Exp $	*/
+/*	$NetBSD: consio.c,v 1.10 2012/10/12 18:01:53 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -103,10 +103,21 @@ putchar(int c)
 int
 check_getchar(void)
 {
+	int keycode;
 
 	switch (x68k_console_device) {
 	case ITE:
-		return IOCS_B_KEYSNS()  0xff;
+		while ((keycode = IOCS_B_KEYSNS()) != 0) {
+			keycode = 0xff;
+			if (keycode != 0) {
+/* valid ASCII code */
+return keycode;
+			}
+			/* discard non ASCII keys (CTRL, OPT.1 etc) */
+			(void)IOCS_B_KEYINP();
+		} 
+		/* no input */
+		return 0;
 	case SERIAL:
 		return IOCS_ISNS232C()  0xff;
 	}



CVS commit: src/sys/arch/x68k/stand/libsa

2012-06-19 Thread Minoura Makoto
Module Name:src
Committed By:   minoura
Date:   Tue Jun 19 12:59:17 UTC 2012

Modified Files:
src/sys/arch/x68k/stand/libsa: sdcd.c

Log Message:
Fix CD support (again!).


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/x68k/stand/libsa/sdcd.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/x68k/stand/libsa/sdcd.c
diff -u src/sys/arch/x68k/stand/libsa/sdcd.c:1.12 src/sys/arch/x68k/stand/libsa/sdcd.c:1.13
--- src/sys/arch/x68k/stand/libsa/sdcd.c:1.12	Tue Mar 20 12:38:53 2012
+++ src/sys/arch/x68k/stand/libsa/sdcd.c	Tue Jun 19 12:59:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdcd.c,v 1.12 2012/03/20 12:38:53 minoura Exp $	*/
+/*	$NetBSD: sdcd.c,v 1.13 2012/06/19 12:59:17 minoura Exp $	*/
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -362,6 +362,7 @@ cdstrategy(void *arg, int rw, daddr_t db
 	struct sdcd_softc *sc = arg;
 
 	/* cast dblk to avoid divdi3; 32bit is enough even for BD-ROMs.  */
-	return sdstrategy(arg, rw, (unsigned int) dblk / sc-sc_blocksize,
+	return sdstrategy(arg, rw,
+			  (unsigned int) dblk / (sc-sc_blocksize/DEV_BSIZE),
 	  size, buf, rsize);
 }



CVS commit: src/sys/arch/x68k/stand/libsa

2012-03-20 Thread Minoura Makoto
Module Name:src
Committed By:   minoura
Date:   Tue Mar 20 12:38:53 UTC 2012

Modified Files:
src/sys/arch/x68k/stand/libsa: sdcd.c

Log Message:
Fix CD support.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x68k/stand/libsa/sdcd.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/x68k/stand/libsa/sdcd.c
diff -u src/sys/arch/x68k/stand/libsa/sdcd.c:1.11 src/sys/arch/x68k/stand/libsa/sdcd.c:1.12
--- src/sys/arch/x68k/stand/libsa/sdcd.c:1.11	Sun Jul 17 20:54:49 2011
+++ src/sys/arch/x68k/stand/libsa/sdcd.c	Tue Mar 20 12:38:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdcd.c,v 1.11 2011/07/17 20:54:49 joerg Exp $	*/
+/*	$NetBSD: sdcd.c,v 1.12 2012/03/20 12:38:53 minoura Exp $	*/
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -67,7 +67,7 @@ check_unit(int id)
 	}
 
 	{
-		struct iocs_inquiry *inqdata = buffer;
+		struct iocs_inquiry *inqdata= buffer;
 
 		error = IOCS_S_INQUIRY(100, id, inqdata);
 		if (error  0) {		/* WHY??? */
@@ -75,6 +75,7 @@ check_unit(int id)
 			goto out;
 		}
 		if ((inqdata-unit != 0) 	/* direct */
+		(inqdata-unit != 5) 	/* cdrom */
 		(inqdata-unit != 7)) {	/* optical */
 			error = EUNIT;
 			goto out;
@@ -327,7 +328,7 @@ cdopen(struct open_file *f, ...)
 
 	if (id  0 || id  7)
 		return ENXIO;
-	if (part == 0 || part == 2)
+	if (part != 0  part != 2)
 		return ENXIO;
 	if (current_id != id) {
 		error = check_unit(id);
@@ -341,6 +342,8 @@ cdopen(struct open_file *f, ...)
 	sc-sc_partinfo.size = current_devsize;
 	sc-sc_blocksize = current_blklen  9;
 	f-f_devdata = sc;
+	current_id = id;
+
 	return 0;
 }
 
@@ -358,6 +361,7 @@ cdstrategy(void *arg, int rw, daddr_t db
 {
 	struct sdcd_softc *sc = arg;
 
-	return sdstrategy(arg, rw, dblk * DEV_BSIZE / sc-sc_blocksize,
+	/* cast dblk to avoid divdi3; 32bit is enough even for BD-ROMs.  */
+	return sdstrategy(arg, rw, (unsigned int) dblk / sc-sc_blocksize,
 	  size, buf, rsize);
 }



CVS commit: src/sys/arch/x68k/stand/libsa

2011-07-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jul  9 15:04:35 UTC 2011

Modified Files:
src/sys/arch/x68k/stand/libsa: sdcd.c

Log Message:
don't assign sc-sc_partinfo.size to itself.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x68k/stand/libsa/sdcd.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/x68k/stand/libsa/sdcd.c
diff -u src/sys/arch/x68k/stand/libsa/sdcd.c:1.9 src/sys/arch/x68k/stand/libsa/sdcd.c:1.10
--- src/sys/arch/x68k/stand/libsa/sdcd.c:1.9	Mon Apr 11 14:00:02 2011
+++ src/sys/arch/x68k/stand/libsa/sdcd.c	Sat Jul  9 15:04:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdcd.c,v 1.9 2011/04/11 14:00:02 tsutsui Exp $	*/
+/*	$NetBSD: sdcd.c,v 1.10 2011/07/09 15:04:35 mrg Exp $	*/
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -339,7 +339,7 @@
 	sc = alloc(sizeof(struct sdcd_softc));
 	current_npart = 3;
 	sc-sc_part = 0;
-	sc-sc_partinfo.size = sc-sc_partinfo.size = current_devsize;
+	sc-sc_partinfo.size = current_devsize;
 	sc-sc_blocksize = current_blklen  9;
 	f-f_devdata = sc;
 	return 0;



CVS commit: src/sys/arch/x68k/stand/libsa

2011-04-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Apr 11 13:47:16 UTC 2011

Modified Files:
src/sys/arch/x68k/stand/libsa: consio.h

Log Message:
Fix pasto.  Now serial console output on bootloader works properly
after ~decade.  ok from minoura@


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x68k/stand/libsa/consio.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/x68k/stand/libsa/consio.h
diff -u src/sys/arch/x68k/stand/libsa/consio.h:1.1 src/sys/arch/x68k/stand/libsa/consio.h:1.2
--- src/sys/arch/x68k/stand/libsa/consio.h:1.1	Thu Sep 27 10:03:27 2001
+++ src/sys/arch/x68k/stand/libsa/consio.h	Mon Apr 11 13:47:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: consio.h,v 1.1 2001/09/27 10:03:27 minoura Exp $	*/
+/*	$NetBSD: consio.h,v 1.2 2011/04/11 13:47:16 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -35,4 +35,4 @@
 
 #define SRAM_PHYS	0x00ed
 #define SERPARAM_PHYS	(SRAM_PHYS + 26)
-#define SERPARAM	(*((unsigned short *)KEYCTRL_PHYS))
+#define SERPARAM	(*((unsigned short *)SERPARAM_PHYS))



CVS commit: src/sys/arch/x68k/stand/libsa

2011-04-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Apr 11 13:48:32 UTC 2011

Modified Files:
src/sys/arch/x68k/stand/libsa: consio.c

Log Message:
Add missing breaks.  No need to output to SERIAL on ITE console.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x68k/stand/libsa/consio.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/x68k/stand/libsa/consio.c
diff -u src/sys/arch/x68k/stand/libsa/consio.c:1.5 src/sys/arch/x68k/stand/libsa/consio.c:1.6
--- src/sys/arch/x68k/stand/libsa/consio.c:1.5	Sun Nov 11 05:20:26 2007
+++ src/sys/arch/x68k/stand/libsa/consio.c	Mon Apr 11 13:48:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: consio.c,v 1.5 2007/11/11 05:20:26 isaki Exp $	*/
+/*	$NetBSD: consio.c,v 1.6 2011/04/11 13:48:32 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -92,8 +92,10 @@
 	switch (x68k_console_device) {
 	case ITE:
 		IOCS_B_PUTC (c);
+		break;
 	case SERIAL:
 		IOCS_OUT232C (c);
+		break;
 	}
 }
 



CVS commit: src/sys/arch/x68k/stand/libsa

2011-04-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Apr 11 14:00:02 UTC 2011

Modified Files:
src/sys/arch/x68k/stand/libsa: chdsk.c consio.c consio.h devopen.c fd.c
sdcd.c sdcdvar.h

Log Message:
Some KNF. No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x68k/stand/libsa/chdsk.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x68k/stand/libsa/consio.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x68k/stand/libsa/consio.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x68k/stand/libsa/devopen.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x68k/stand/libsa/fd.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x68k/stand/libsa/sdcd.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x68k/stand/libsa/sdcdvar.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/x68k/stand/libsa/chdsk.c
diff -u src/sys/arch/x68k/stand/libsa/chdsk.c:1.3 src/sys/arch/x68k/stand/libsa/chdsk.c:1.4
--- src/sys/arch/x68k/stand/libsa/chdsk.c:1.3	Thu Apr  7 13:38:21 2011
+++ src/sys/arch/x68k/stand/libsa/chdsk.c	Mon Apr 11 14:00:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: chdsk.c,v 1.3 2011/04/07 13:38:21 isaki Exp $	*/
+/*	$NetBSD: chdsk.c,v 1.4 2011/04/11 14:00:02 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -36,6 +36,7 @@
 int
 changedisk_hook(struct open_file *f)
 {
+
 	if (strcmp(f-f_dev-dv_name, fd) == 0) {
 		struct fd_softc *sc = f-f_devdata;
 		int drive[2];

Index: src/sys/arch/x68k/stand/libsa/consio.c
diff -u src/sys/arch/x68k/stand/libsa/consio.c:1.6 src/sys/arch/x68k/stand/libsa/consio.c:1.7
--- src/sys/arch/x68k/stand/libsa/consio.c:1.6	Mon Apr 11 13:48:32 2011
+++ src/sys/arch/x68k/stand/libsa/consio.c	Mon Apr 11 14:00:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: consio.c,v 1.6 2011/04/11 13:48:32 tsutsui Exp $	*/
+/*	$NetBSD: consio.c,v 1.7 2011/04/11 14:00:02 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -42,12 +42,13 @@
 int
 consio_init(int device)
 {
+
 	if (device  0) {	/* undetemined yet */
 		if (KEYCTRL  8)
 			device = ITE;
 		else {
-			IOCS_B_PRINT (No keyboard; 
-  switching to serial console...);
+			IOCS_B_PRINT(No keyboard; 
+ switching to serial console...);
 			device = SERIAL;
 		}
 	}
@@ -56,12 +57,12 @@
 	case ITE:
 		x68k_console_device = ITE;
 		/* set palette here */
-		IOCS_OS_CURON ();
+		IOCS_OS_CURON();
 		break;
 	case SERIAL:
 		x68k_console_device = SERIAL;
-		IOCS_OS_CUROF ();
-		IOCS_SET232C (SERPARAM);
+		IOCS_OS_CUROF();
+		IOCS_SET232C(SERPARAM);
 	}
 
 	return x68k_console_device;
@@ -74,10 +75,10 @@
 
 	switch (x68k_console_device) {
 	case ITE:
-		while ((r = IOCS_B_KEYINP ()  0xff) == 0);
+		while ((r = IOCS_B_KEYINP()  0xff) == 0);
 		return r;
 	case SERIAL:
-		while ((r = IOCS_INP232C ()  0xff) == 0);
+		while ((r = IOCS_INP232C()  0xff) == 0);
 		return r;
 	}
 
@@ -87,14 +88,15 @@
 void
 putchar(int c)
 {
+
 	if (c == '\n')
 		putchar('\r');
 	switch (x68k_console_device) {
 	case ITE:
-		IOCS_B_PUTC (c);
+		IOCS_B_PUTC(c);
 		break;
 	case SERIAL:
-		IOCS_OUT232C (c);
+		IOCS_OUT232C(c);
 		break;
 	}
 }
@@ -102,11 +104,12 @@
 int
 check_getchar(void)
 {
+
 	switch (x68k_console_device) {
 	case ITE:
-		return IOCS_B_KEYSNS ()  0xff;
+		return IOCS_B_KEYSNS()  0xff;
 	case SERIAL:
-		return IOCS_ISNS232C ()  0xff;
+		return IOCS_ISNS232C()  0xff;
 	}
 
 	return -1;

Index: src/sys/arch/x68k/stand/libsa/consio.h
diff -u src/sys/arch/x68k/stand/libsa/consio.h:1.2 src/sys/arch/x68k/stand/libsa/consio.h:1.3
--- src/sys/arch/x68k/stand/libsa/consio.h:1.2	Mon Apr 11 13:47:16 2011
+++ src/sys/arch/x68k/stand/libsa/consio.h	Mon Apr 11 14:00:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: consio.h,v 1.2 2011/04/11 13:47:16 tsutsui Exp $	*/
+/*	$NetBSD: consio.h,v 1.3 2011/04/11 14:00:02 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -26,13 +26,13 @@
  */
 
 #define KEYCTRL_PHYS	(0x00e8e000+7)
-#define KEYCTRL		(*((volatile unsigned char *)KEYCTRL_PHYS))
+#define KEYCTRL		(*((volatile uint8_t *)KEYCTRL_PHYS))
 
 #define MFP_TIMERC_PHYS	(0x00e88000+0x23)
-#define MFP_TIMERC	(*((volatile unsigned char *)MFP_TIMERC_PHYS))
+#define MFP_TIMERC	(*((volatile uint8_t *)MFP_TIMERC_PHYS))
 #define JOYA_PHYS	(0x00e9a000+1)
-#define JOYA		(*((volatile unsigned char *)JOYA_PHYS))
+#define JOYA		(*((volatile uint8_t *)JOYA_PHYS))
 
 #define SRAM_PHYS	0x00ed
 #define SERPARAM_PHYS	(SRAM_PHYS + 26)
-#define SERPARAM	(*((unsigned short *)SERPARAM_PHYS))
+#define SERPARAM	(*((uint16_t *)SERPARAM_PHYS))

Index: src/sys/arch/x68k/stand/libsa/devopen.c
diff -u src/sys/arch/x68k/stand/libsa/devopen.c:1.4 src/sys/arch/x68k/stand/libsa/devopen.c:1.5
--- src/sys/arch/x68k/stand/libsa/devopen.c:1.4	Sun Nov 11 05:20:27 2007
+++ src/sys/arch/x68k/stand/libsa/devopen.c	Mon Apr 11 14:00:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: devopen.c,v 1.4 2007/11/11 05:20:27 isaki Exp $	*/
+/*	$NetBSD: devopen.c,v 1.5 2011/04/11 14:00:02 tsutsui Exp $	*/
 
 /*
  

CVS commit: src/sys/arch/x68k/stand/libsa

2011-04-07 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Thu Apr  7 13:38:21 UTC 2011

Modified Files:
src/sys/arch/x68k/stand/libsa: chdsk.c

Log Message:
Poll the next medium on both drive of #0 and #1.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x68k/stand/libsa/chdsk.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/x68k/stand/libsa/chdsk.c
diff -u src/sys/arch/x68k/stand/libsa/chdsk.c:1.2 src/sys/arch/x68k/stand/libsa/chdsk.c:1.3
--- src/sys/arch/x68k/stand/libsa/chdsk.c:1.2	Mon Jan 12 07:56:31 2009
+++ src/sys/arch/x68k/stand/libsa/chdsk.c	Thu Apr  7 13:38:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: chdsk.c,v 1.2 2009/01/12 07:56:31 tsutsui Exp $	*/
+/*	$NetBSD: chdsk.c,v 1.3 2011/04/07 13:38:21 isaki Exp $	*/
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -38,20 +38,36 @@
 {
 	if (strcmp(f-f_dev-dv_name, fd) == 0) {
 		struct fd_softc *sc = f-f_devdata;
-		int unit = (0x90 + sc-unit)  8;
+		int drive[2];
 
-		/* unlock */
-		IOCS_B_DRVCHK(unit, 3);
-		/* eject */
-		IOCS_B_DRVCHK(unit, 1);
+		drive[0] = 0x90  8;
+		drive[1] = 0x91  8;
+
+		/* unlock current unit */
+		IOCS_B_DRVCHK(drive[sc-unit], 3);
+		/* eject current */
+		IOCS_B_DRVCHK(drive[sc-unit], 1);
 		awaitkey_1sec();
-		/* prompt */
-		IOCS_B_DRVCHK(unit, 4);
+		/* prompt both */
+		IOCS_B_DRVCHK(drive[0], 4);
+		IOCS_B_DRVCHK(drive[1], 4);
 		/* poll for medium */
-		while ((IOCS_B_DRVCHK(unit, 0)  2) == 0)
+		for (;;) {
+			if ((IOCS_B_DRVCHK(drive[0], 0)  2)) {
+sc-unit = 0;
+break;
+			}
+			if ((IOCS_B_DRVCHK(drive[1], 0)  2)) {
+sc-unit = 1;
+break;
+			}
 			awaitkey_1sec();
-		/* lock */
-		IOCS_B_DRVCHK(unit, 2);
+		}
+		/* prompt off */
+		IOCS_B_DRVCHK(drive[0], 5);
+		IOCS_B_DRVCHK(drive[1], 5);
+		/* lock new unit */
+		IOCS_B_DRVCHK(drive[sc-unit], 2);
 	}
 
 	return 0;