CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2023-03-25 Thread David Brownlee
Module Name:src
Committed By:   abs
Date:   Sat Mar 25 20:14:26 UTC 2023

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: console.c libstubs.h
libstubs.s version

Log Message:
Fix NetBSD/amiga bootblocks for Kickstart 3.2 - from Karoly Balogh

Kickstart 3.2 changed to not initialize console.device before
bootstrap, so the previous NetBSD bootblocks would crash when they
tried to initialise console output.

With this change if the call to the OpenDevice() stub fails, the
code now calls FindResident() and InitResident() before retrying
the OpenDevice().

Many thanks to Karoly Balogh for tracking this down (and also for
knowing just who to poke to get insight into the 3.2 changes :)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/amiga/stand/bootblock/boot/console.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/stand/bootblock/boot/libstubs.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amiga/stand/bootblock/boot/libstubs.s
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amiga/stand/bootblock/boot/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/amiga/stand/bootblock/boot/console.c
diff -u src/sys/arch/amiga/stand/bootblock/boot/console.c:1.15 src/sys/arch/amiga/stand/bootblock/boot/console.c:1.16
--- src/sys/arch/amiga/stand/bootblock/boot/console.c:1.15	Sun Dec 18 12:02:37 2016
+++ src/sys/arch/amiga/stand/bootblock/boot/console.c	Sat Mar 25 20:14:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: console.c,v 1.15 2016/12/18 12:02:37 mlelstv Exp $ */
+/* $NetBSD: console.c,v 1.16 2023/03/25 20:14:26 abs Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -138,8 +138,20 @@ consinit(void *consptr) {
 		goto err;
 
 	mc->cnior->buf = (void *)mc->w;
-	if (OpenDevice("console.device", 0, mc->cnior, 0))
-		goto err;
+	mc->cnior->length = 136; /* sizeof(struct Window) */
+	if (OpenDevice("console.device", 0, mc->cnior, 0)) {
+		/* Kickstart 3.2 decided not to initialize console.device
+before bootstrap, so we have to do it ourselves. */
+		void *res = FindResident("console.device");
+		if (!res)
+			goto err;
+
+		if (!InitResident(res, 0))
+			goto err;
+
+		if (OpenDevice("console.device", 0, mc->cnior, 0))
+			goto err;
+	}
 
 	mc->tmior = (struct TimerIO *)CreateIORequest(mc->cnmp, sizeof(struct TimerIO));
 	if (!mc->tmior)

Index: src/sys/arch/amiga/stand/bootblock/boot/libstubs.h
diff -u src/sys/arch/amiga/stand/bootblock/boot/libstubs.h:1.7 src/sys/arch/amiga/stand/bootblock/boot/libstubs.h:1.8
--- src/sys/arch/amiga/stand/bootblock/boot/libstubs.h:1.7	Sat Oct 17 11:18:18 2009
+++ src/sys/arch/amiga/stand/bootblock/boot/libstubs.h	Sat Mar 25 20:14:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: libstubs.h,v 1.7 2009/10/17 11:18:18 mlelstv Exp $ */
+/* $NetBSD: libstubs.h,v 1.8 2023/03/25 20:14:26 abs Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -65,6 +65,7 @@ void CloseDevice(struct AmigaIO *);
 #endif
 
 void *FindResident(const char *);
+void *InitResident(const char *, u_int32_t);
 void *OpenResource(const char *);
 
 u_int32_t CachePreDMA(u_int32_t, u_int32_t *, int);

Index: src/sys/arch/amiga/stand/bootblock/boot/libstubs.s
diff -u src/sys/arch/amiga/stand/bootblock/boot/libstubs.s:1.10 src/sys/arch/amiga/stand/bootblock/boot/libstubs.s:1.11
--- src/sys/arch/amiga/stand/bootblock/boot/libstubs.s:1.10	Sat Oct 17 11:18:18 2009
+++ src/sys/arch/amiga/stand/bootblock/boot/libstubs.s	Sat Mar 25 20:14:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: libstubs.s,v 1.10 2009/10/17 11:18:18 mlelstv Exp $ */
+/* $NetBSD: libstubs.s,v 1.11 2023/03/25 20:14:26 abs Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -208,6 +208,16 @@ ENTRY_NOPROFILE(FindResident)
 	movl	%d0,%a0			| Comply with ELF ABI
 	rts
 
+ENTRY_NOPROFILE(InitResident)
+	movl	%a6,%sp@-
+	movl	%pc@(_C_LABEL(SysBase):w),%a6
+	movl	%sp@(8),%a1
+	movl	%sp@(12),%d1
+	jsr	%a6@(-0x66)
+	movl	%sp@+,%a6
+	movl	%d0,%a0			| Comply with ELF ABI
+	rts
+
 ENTRY_NOPROFILE(OpenResource)
 	movl	%a6,%sp@-
 	movl	%pc@(_C_LABEL(SysBase):w),%a6

Index: src/sys/arch/amiga/stand/bootblock/boot/version
diff -u src/sys/arch/amiga/stand/bootblock/boot/version:1.2 src/sys/arch/amiga/stand/bootblock/boot/version:1.3
--- src/sys/arch/amiga/stand/bootblock/boot/version:1.2	Thu Feb 25 03:42:14 2021
+++ src/sys/arch/amiga/stand/bootblock/boot/version	Sat Mar 25 20:14:26 2023
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.2 2021/02/25 03:42:14 rin Exp $
+$NetBSD: version,v 1.3 2023/03/25 20:14:26 abs Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -12,3 +12,4 @@ is taken as the current.
 2.4:	Moved default command into fixed location for easy patching
 3.0:	Initial 2 stage amiga bootblocks
 3.1:	Add support for FFSv2
+3.2:	Fix booting with some "modern" Kickstart versions



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2023-03-25 Thread David Brownlee
Module Name:src
Committed By:   abs
Date:   Sat Mar 25 20:14:26 UTC 2023

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: console.c libstubs.h
libstubs.s version

Log Message:
Fix NetBSD/amiga bootblocks for Kickstart 3.2 - from Karoly Balogh

Kickstart 3.2 changed to not initialize console.device before
bootstrap, so the previous NetBSD bootblocks would crash when they
tried to initialise console output.

With this change if the call to the OpenDevice() stub fails, the
code now calls FindResident() and InitResident() before retrying
the OpenDevice().

Many thanks to Karoly Balogh for tracking this down (and also for
knowing just who to poke to get insight into the 3.2 changes :)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/amiga/stand/bootblock/boot/console.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/stand/bootblock/boot/libstubs.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amiga/stand/bootblock/boot/libstubs.s
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amiga/stand/bootblock/boot/version

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 07:45:20 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile

Log Message:
Enable SA_HARDCODED_SECSIZE to shrink loaders slightly.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.27 -r1.28 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 07:45:20 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile

Log Message:
Enable SA_HARDCODED_SECSIZE to shrink loaders slightly.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.27 -r1.28 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.61 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.62
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.61	Fri Apr 29 06:56:56 2022
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Fri Apr 29 07:45:20 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.61 2022/04/29 06:56:56 rin Exp $
+#	$NetBSD: Makefile,v 1.62 2022/04/29 07:45:20 rin Exp $
 
 .include 
 .include 		# for HOST_SH
@@ -50,7 +50,7 @@ SOBJS += libstubs.o
 OBJS+=	$(SOBJS) $(COBJS)
 
 #XX#DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -DDYNAMIC_CRC_TABLE -DNOBYFOUR -UBYFOUR 
-DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER 
+DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -DSA_HARDCODED_SECSIZE
 DEFS += -D__INTERNAL_LIBSA_CREAD
 DEFS += -DSERCONSOLE
 SOBJS += cread.o

Index: src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.27 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.28
--- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.27	Fri Apr 29 07:18:17 2022
+++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile	Fri Apr 29 07:45:20 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.27 2022/04/29 07:18:17 rin Exp $
+#	$NetBSD: Makefile,v 1.28 2022/04/29 07:45:20 rin Exp $
 
 .include 
 .include 
@@ -46,7 +46,8 @@ SOBJS += libstubs.o memcmp.o memmove.o m
 
 OBJS+=	$(SOBJS) $(COBJS)
 
-DEFS+= -D_STANDALONE -DSA_EXEC_ANYOWNER -D_PRIMARY_BOOT -DSERCONSOLE
+DEFS+=	-D_STANDALONE -DSA_EXEC_ANYOWNER -DSA_HARDCODED_SECSIZE \
+	-D_PRIMARY_BOOT -DSERCONSOLE
 
 .NOPATH: ${OBJS} x.out f.out libboot.a xxstart.o
 



CVS commit: src/sys/arch/amiga/stand/bootblock/installboot

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 07:19:33 UTC 2022

Removed Files:
src/sys/arch/amiga/stand/bootblock/installboot: Makefile installboot.c

Log Message:
Remove unused; switched to usr.sbin/installboot/arch/amiga.c long ago.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r0 \
src/sys/arch/amiga/stand/bootblock/installboot/Makefile
cvs rdiff -u -r1.6 -r0 \
src/sys/arch/amiga/stand/bootblock/installboot/installboot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/installboot

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 07:19:33 UTC 2022

Removed Files:
src/sys/arch/amiga/stand/bootblock/installboot: Makefile installboot.c

Log Message:
Remove unused; switched to usr.sbin/installboot/arch/amiga.c long ago.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r0 \
src/sys/arch/amiga/stand/bootblock/installboot/Makefile
cvs rdiff -u -r1.6 -r0 \
src/sys/arch/amiga/stand/bootblock/installboot/installboot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/bootxx_ffs

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 07:18:17 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile main.c

Log Message:
Stop twiddling when loading boot.amiga; it is small enough.

Slightly reduce insn's for primary loaders, and stop them to output garbage.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
cvs rdiff -u -r1.9 -r1.10 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/main.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/amiga/stand/bootblock/bootxx_ffs/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.26 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.27
--- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.26	Thu Feb 25 03:42:14 2021
+++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile	Fri Apr 29 07:18:17 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.26 2021/02/25 03:42:14 rin Exp $
+#	$NetBSD: Makefile,v 1.27 2022/04/29 07:18:17 rin Exp $
 
 .include 
 .include 
@@ -36,7 +36,7 @@ DEFS+=		-DBOOTXX_FFS_VERSION=1
 
 BINDIR=/usr/mdec
 
-COBJS = main.o console.o xd.o twiddle.o bzero.o gets.o
+COBJS = main.o console.o xd.o bzero.o gets.o
 COBJS+=  lseek.o open.o vers.o read.o close.o dev.o errno.o
 COBJS+=  ${FSOBJS} panic.o files.o
 

Index: src/sys/arch/amiga/stand/bootblock/bootxx_ffs/main.c
diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/main.c:1.9 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/main.c:1.10
--- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/main.c:1.9	Sun Nov 15 20:38:36 2009
+++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/main.c	Fri Apr 29 07:18:17 2022
@@ -1,5 +1,5 @@
 /*
- * $NetBSD: main.c,v 1.9 2009/11/15 20:38:36 snj Exp $
+ * $NetBSD: main.c,v 1.10 2022/04/29 07:18:17 rin Exp $
  *
  *
  * Copyright (c) 1996,1999 Ignatios Souvatzis
@@ -139,3 +139,10 @@ err:
 	consclose();
 	return 1;
 }
+
+void
+twiddle(void)
+{
+
+	/* Keep silence; boot.amiga should be small enough. */
+}



CVS commit: src/sys/arch/amiga/stand/bootblock/bootxx_ffs

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 07:18:17 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile main.c

Log Message:
Stop twiddling when loading boot.amiga; it is small enough.

Slightly reduce insn's for primary loaders, and stop them to output garbage.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
cvs rdiff -u -r1.9 -r1.10 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 07:12:42 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: bbstart.s
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
Simplify relocation rules.

Now, both single- and triple-byte encodings in relocation table
represent addrdiff (instead of absolute file offset for the latter).

Shave off one insn for boot.amiga. Also, for elf2bb(1), relocation
overflow is mitigated and detectable at least even if inevitable
(it seems unlikely to happen although).


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/amiga/stand/bootblock/boot/bbstart.s
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/boot/bbstart.s
diff -u src/sys/arch/amiga/stand/bootblock/boot/bbstart.s:1.14 src/sys/arch/amiga/stand/bootblock/boot/bbstart.s:1.15
--- src/sys/arch/amiga/stand/bootblock/boot/bbstart.s:1.14	Fri Apr 29 06:42:58 2022
+++ src/sys/arch/amiga/stand/bootblock/boot/bbstart.s	Fri Apr 29 07:12:41 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: bbstart.s,v 1.14 2022/04/29 06:42:58 rin Exp $ */
+/* $NetBSD: bbstart.s,v 1.15 2022/04/29 07:12:41 rin Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -159,7 +159,6 @@ Lrelocate:
 	
 Loopw:
 	clrw	%a2@+
-	movl	%d1,%a0	| for a variant with relative words, erase this line
 Loopb:
 	addl	%d0,%a0
 	addl	%d1,%a0@

Index: src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.29 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.30
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.29	Fri Apr 29 06:59:29 2022
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Fri Apr 29 07:12:42 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.29 2022/04/29 06:59:29 rin Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.30 2022/04/29 07:12:42 rin Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -394,15 +394,16 @@ main(int argc, char *argv[])
 			"oldaddr = 0x%08x, abort.\n", relbuf[i], oldaddr);
 		} else if (addrdiff > 0xff) {
 			*rpo = 0;
+			tmp16 = htobe16(addrdiff);
 			if (delta > 0) {
 ++rpo;
-*rpo++ = (relbuf[i] >> 8) & 0xff;
-*rpo++ = relbuf[i] & 0xff;
+memcpy(rpo, , sizeof(tmp16));
+rpo += sizeof(tmp16);
 dprintf(("%02x%02x%02x\n",
 rpo[-3], rpo[-2], rpo[-1]));
 			} else {
-*--rpo = relbuf[i] & 0xff;
-*--rpo = (relbuf[i] >> 8) & 0xff;
+rpo -= sizeof(tmp16);
+memcpy(rpo, , sizeof(tmp16));
 --rpo;
 dprintf(("%02x%02x%02x\n",
 rpo[0], rpo[1], rpo[2]));



CVS commit: src/sys/arch/amiga/stand/bootblock

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 07:12:42 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: bbstart.s
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
Simplify relocation rules.

Now, both single- and triple-byte encodings in relocation table
represent addrdiff (instead of absolute file offset for the latter).

Shave off one insn for boot.amiga. Also, for elf2bb(1), relocation
overflow is mitigated and detectable at least even if inevitable
(it seems unlikely to happen although).


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/amiga/stand/bootblock/boot/bbstart.s
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 06:59:29 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
Comment that (buffer + 14) stands for reltab in bbstart.s.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.28 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.29
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.28	Mon Apr 25 15:48:57 2022
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Fri Apr 29 06:59:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.28 2022/04/25 15:48:57 rin Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.29 2022/04/29 06:59:29 rin Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -288,7 +288,7 @@ main(int argc, char *argv[])
 	case RELVER_RELATIVE_BYTES_FORWARD:
 		rpo = buffer + tsz + dsz;
 		delta = +1;
-		*(uint16_t *)(buffer + 14) = htobe16(tsz + dsz);
+		*(uint16_t *)(buffer + 14) /* reltab */ = htobe16(tsz + dsz);
 		break;
 	}
 



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 06:59:29 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
Comment that (buffer + 14) stands for reltab in bbstart.s.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 06:56:56 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile

Log Message:
Now, cread.c can be built with -Os.

It was not a compiler bug actually; object code generated with
"-Os -Wa,-l" contains R_68K_16, which is not supported by elf2bb(1).

We should have fixed elf2bb(1), but the problem is gone at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/amiga/stand/bootblock/boot/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 06:56:56 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile

Log Message:
Now, cread.c can be built with -Os.

It was not a compiler bug actually; object code generated with
"-Os -Wa,-l" contains R_68K_16, which is not supported by elf2bb(1).

We should have fixed elf2bb(1), but the problem is gone at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/amiga/stand/bootblock/boot/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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.60 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.61
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.60	Fri Apr 29 06:48:22 2022
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Fri Apr 29 06:56:56 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.60 2022/04/29 06:48:22 rin Exp $
+#	$NetBSD: Makefile,v 1.61 2022/04/29 06:56:56 rin Exp $
 
 .include 
 .include 		# for HOST_SH
@@ -93,9 +93,6 @@ CFLAGS= -ffreestanding ${COPTIM} ${INCPA
 CFLAGS+= -Werror
 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
 
-# XXX work around a gcc 4.5 bug
-COPTS.cread.c = -O1
-
 .c.o:
 	${_MKTARGET_COMPILE}
 	${CC} ${CFLAGS} ${COPTS.${.IMPSRC:T}} -S $< -o $*.s



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 06:48:22 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile

Log Message:
Compile boot.amiga without -l option for gas(1).

Fix build failure due to relocation overflows for R_68K_PC16.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/amiga/stand/bootblock/boot/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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.59 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.60
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.59	Wed Apr 27 14:50:35 2022
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Fri Apr 29 06:48:22 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.59 2022/04/27 14:50:35 rin Exp $
+#	$NetBSD: Makefile,v 1.60 2022/04/29 06:48:22 rin Exp $
 
 .include 
 .include 		# for HOST_SH
@@ -84,11 +84,11 @@ INCPATH += -I${.CURDIR}
 INCPATH += -I${.CURDIR}/../../.. -I${.OBJDIR}
 INCPATH += -I${.CURDIR}/../elf2bb
 
-AFLAGS += -march=68030 -mcpu=68030 -l
-CAFLAGS += -Wa,-l -Wa,-march=68030 -Wa,-mcpu=68030 ${INCPATH}
+AFLAGS += -march=68030 -mcpu=68030
+CAFLAGS += -Wa,-march=68030 -Wa,-mcpu=68030 ${INCPATH}
 
 COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks
-COPTIM+= -Wa,-l -m68060 -Wa,-march=68030 -Wa,-mcpu=68030 -fno-unwind-tables
+COPTIM+= -m68060 -Wa,-march=68030 -Wa,-mcpu=68030 -fno-unwind-tables
 CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS}
 CFLAGS+= -Werror
 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 06:48:22 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile

Log Message:
Compile boot.amiga without -l option for gas(1).

Fix build failure due to relocation overflows for R_68K_PC16.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/amiga/stand/bootblock/boot/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 06:42:58 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: bbstart.s

Log Message:
Fix boot.amiga when relocation table is located beyond 0x8000.

In this case, we cannot load reltab directly into %a2 by movw:

For m68k, movw is actually synonym for different instructions when
its destination is data or address register, respectively.

(1) For data register, it is for move.w, which loads source into lower
half word with upper wharf word being kept untouched.

(2) For address register, it is movea.w, which loads source with
*sign extension*.

XXX
We should really stop using movw, and use move.w or movea.w explicitly.
However, this will end up with BIG diff...

Thanks ryo@ and isaki@ for comments offlist.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/amiga/stand/bootblock/boot/bbstart.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/amiga/stand/bootblock/boot/bbstart.s
diff -u src/sys/arch/amiga/stand/bootblock/boot/bbstart.s:1.13 src/sys/arch/amiga/stand/bootblock/boot/bbstart.s:1.14
--- src/sys/arch/amiga/stand/bootblock/boot/bbstart.s:1.13	Tue Jul  6 05:59:57 2010
+++ src/sys/arch/amiga/stand/bootblock/boot/bbstart.s	Fri Apr 29 06:42:58 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: bbstart.s,v 1.13 2010/07/06 05:59:57 mrg Exp $ */
+/* $NetBSD: bbstart.s,v 1.14 2022/04/29 06:42:58 rin Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -143,7 +143,17 @@ Lioerr:
 Lrelocate:
 	lea	%pc@(Lzero),%a0
 	movl	%a0,%d1
-	movw	%pc@(Lreltab),%a2
+
+	/*
+	 * Here, we cannot use
+	 *	movw	%pc@(Lreltab),%a2
+	 * "movw" against An is synonym for "movea.w", which carries out
+	 * sign extension. This breaks things when reltab >= 0x8000.
+	 */
+	movq	#0,%d0
+	movw	%pc@(Lreltab),%d0
+	movl	%d0,%a2
+
 	addl	%d1,%a2
 	jra	Loopend
 	



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2022-04-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 29 06:42:58 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: bbstart.s

Log Message:
Fix boot.amiga when relocation table is located beyond 0x8000.

In this case, we cannot load reltab directly into %a2 by movw:

For m68k, movw is actually synonym for different instructions when
its destination is data or address register, respectively.

(1) For data register, it is for move.w, which loads source into lower
half word with upper wharf word being kept untouched.

(2) For address register, it is movea.w, which loads source with
*sign extension*.

XXX
We should really stop using movw, and use move.w or movea.w explicitly.
However, this will end up with BIG diff...

Thanks ryo@ and isaki@ for comments offlist.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/amiga/stand/bootblock/boot/bbstart.s

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2022-04-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Apr 27 14:50:35 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile

Log Message:
Revert previous.

On 2022/04/27 21:10, Rin Okuyama wrote:
> Module Name:  src
> Committed By: rin
> Date: Wed Apr 27 12:10:47 UTC 2022
>
> Modified Files:
>   src/sys/arch/amiga/stand/bootblock/boot: Makefile
>
> Log Message:
> Sprinkle SA_HARDCODED_SECSIZE; now everything fits into
> +/-32KB range visible for PC relative addressing mode.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.57 -r1.58 src/sys/arch/amiga/stand/bootblock/boot/Makefile
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/amiga/stand/bootblock/boot/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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.58 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.59
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.58	Wed Apr 27 12:10:47 2022
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Wed Apr 27 14:50:35 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.58 2022/04/27 12:10:47 rin Exp $
+#	$NetBSD: Makefile,v 1.59 2022/04/27 14:50:35 rin Exp $
 
 .include 
 .include 		# for HOST_SH
@@ -50,7 +50,7 @@ SOBJS += libstubs.o
 OBJS+=	$(SOBJS) $(COBJS)
 
 #XX#DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -DDYNAMIC_CRC_TABLE -DNOBYFOUR -UBYFOUR 
-DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -DSA_HARDCODED_SECSIZE
+DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER 
 DEFS += -D__INTERNAL_LIBSA_CREAD
 DEFS += -DSERCONSOLE
 SOBJS += cread.o



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2022-04-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Apr 27 14:50:35 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile

Log Message:
Revert previous.

On 2022/04/27 21:10, Rin Okuyama wrote:
> Module Name:  src
> Committed By: rin
> Date: Wed Apr 27 12:10:47 UTC 2022
>
> Modified Files:
>   src/sys/arch/amiga/stand/bootblock/boot: Makefile
>
> Log Message:
> Sprinkle SA_HARDCODED_SECSIZE; now everything fits into
> +/-32KB range visible for PC relative addressing mode.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.57 -r1.58 src/sys/arch/amiga/stand/bootblock/boot/Makefile
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/amiga/stand/bootblock/boot/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2022-04-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Apr 27 12:10:47 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile

Log Message:
Sprinkle SA_HARDCODED_SECSIZE; now everything fits into
+/-32KB range visible for PC relative addressing mode.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/amiga/stand/bootblock/boot/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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.57 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.58
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.57	Thu Feb 25 03:42:14 2021
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Wed Apr 27 12:10:47 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.57 2021/02/25 03:42:14 rin Exp $
+#	$NetBSD: Makefile,v 1.58 2022/04/27 12:10:47 rin Exp $
 
 .include 
 .include 		# for HOST_SH
@@ -50,7 +50,7 @@ SOBJS += libstubs.o
 OBJS+=	$(SOBJS) $(COBJS)
 
 #XX#DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -DDYNAMIC_CRC_TABLE -DNOBYFOUR -UBYFOUR 
-DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER 
+DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -DSA_HARDCODED_SECSIZE
 DEFS += -D__INTERNAL_LIBSA_CREAD
 DEFS += -DSERCONSOLE
 SOBJS += cread.o



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2022-04-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Apr 27 12:10:47 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile

Log Message:
Sprinkle SA_HARDCODED_SECSIZE; now everything fits into
+/-32KB range visible for PC relative addressing mode.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/amiga/stand/bootblock/boot/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 15:48:57 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
One more style. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.27 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.28
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.27	Mon Apr 25 14:46:38 2022
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Mon Apr 25 15:48:57 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.27 2022/04/25 14:46:38 rin Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.28 2022/04/25 15:48:57 rin Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -431,9 +431,9 @@ main(int argc, char *argv[])
 	*rpo = 0; rpo += delta;
 	*rpo = 0; rpo += delta;
 
-	printf("using %td bytes, %td bytes remaining.\n", delta > 0 ?
-	rpo-buffer-tsz-dsz : buffer+bbsize-rpo, delta > 0 ?
-	buffer + bbsize - rpo : rpo - buffer - tsz - dsz);
+	printf("using %td bytes, %td bytes remaining.\n",
+	delta > 0 ? rpo - buffer - tsz - dsz : buffer + bbsize - rpo,
+	delta > 0 ? buffer + bbsize - rpo : rpo - buffer - tsz - dsz);
 	/*
 	 * RELOCs must fit into the bss area.
 	 */



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 15:48:57 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
One more style. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama

On 2022/04/25 23:03, Rin Okuyama wrote:

Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:03:15 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: chksum.c elf2bb.c

Log Message:
Use htobe{16,32}(9) instead of be{16,32}toh(9) where appropriate.

No binary changes both for little and big endian machines.


Oops, "be{16,32}toh(3) instead of htobe{16,32}(3)", apparently...

Thanks,
rin


CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:46:38 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
static-ify function bodies of usage() and eval().

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.26 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.27
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.26	Mon Apr 25 14:39:30 2022
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Mon Apr 25 14:46:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.26 2022/04/25 14:39:30 rin Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.27 2022/04/25 14:46:38 rin Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -466,7 +466,7 @@ main(int argc, char *argv[])
 	exit(0);
 }
 
-void
+static void
 usage(void)
 {
 	fprintf(stderr, "Usage: %s [-F] bootprog bootprog.bin\n",
@@ -475,7 +475,7 @@ usage(void)
 	/* NOTREACHED */
 }
 
-int
+static int
 eval(Elf32_Sym *s, uint32_t *o)
 {
 	int value;



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:46:38 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
static-ify function bodies of usage() and eval().

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:45:26 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: chksum.c

Log Message:
One more style... No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.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/amiga/stand/bootblock/elf2bb/chksum.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c:1.8 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c:1.9
--- src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c:1.8	Mon Apr 25 14:39:30 2022
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c	Mon Apr 25 14:45:26 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: chksum.c,v 1.8 2022/04/25 14:39:30 rin Exp $ */
+/* $NetBSD: chksum.c,v 1.9 2022/04/25 14:45:26 rin Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ main(int argc, char *argb[]) {
 	uint32_t cks, cks1;
 
 	bbsize = atol(argb[1]);
-	bbsize *= (512 / sizeof (uint32_t));
+	bbsize *= (512 / sizeof(uint32_t));
 
 	if (4 * bbsize != read(0, myblock, sizeof(uint32_t) * bbsize)) {
 		fprintf(stderr, "short read\n");



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:45:26 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: chksum.c

Log Message:
One more style... No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:39:30 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: chksum.c elf2bb.c

Log Message:
Wrap looong lines, and misc style/cosmetic fixes.

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/elf2bb/chksum.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c:1.7 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c:1.8
--- src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c:1.7	Mon Apr 25 14:03:15 2022
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c	Mon Apr 25 14:39:30 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: chksum.c,v 1.7 2022/04/25 14:03:15 rin Exp $ */
+/* $NetBSD: chksum.c,v 1.8 2022/04/25 14:39:30 rin Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -65,17 +65,17 @@ main(int argc, char *argb[]) {
 	int bbsize;
 	uint32_t cks, cks1;
 
-	bbsize=atol(argb[1]);
+	bbsize = atol(argb[1]);
 	bbsize *= (512 / sizeof (uint32_t));
 
-	if (4*bbsize != read(0, myblock, sizeof(uint32_t)*bbsize)) {
+	if (4 * bbsize != read(0, myblock, sizeof(uint32_t) * bbsize)) {
 		fprintf(stderr, "short read\n");
 		exit(1);
 	}
 	fprintf(stderr, "Cksum field = 0x%x, ", myblock[1]);
 	cks = chksum(myblock, bbsize);
 	fprintf(stderr, "cksum = 0x%x\n", cks);
-	myblock[1] += 0x - cks;
+	myblock[1] += 0x - cks;
 	fprintf(stderr, "New cksum field = 0x%x, ", myblock[1]);
 	cks1 = chksum(myblock, bbsize);
 	fprintf(stderr, "cksum = 0x%x\n", cks1);

Index: src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.25 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.26
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.25	Mon Apr 25 14:36:47 2022
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Mon Apr 25 14:39:30 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.25 2022/04/25 14:36:47 rin Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.26 2022/04/25 14:39:30 rin Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@ char *progname;
 int bbsize = BBSIZE;
 uint8_t *buffer;
 uint32_t *relbuf;
-	/* can't have more relocs than that*/
+	/* can't have more relocs than that */
 
 static int
 intcmp(const void *i, const void *j)
@@ -85,7 +85,7 @@ intcmp(const void *i, const void *j)
 
 	r = (*(uint32_t *)i) < (*(uint32_t *)j);
 	
-	return 2*r-1;
+	return 2 * r - 1;
 }
 
 int
@@ -146,7 +146,8 @@ main(int argc, char *argv[])
 
 	eh = (Elf32_Ehdr *)image; /* XXX endianness */
 
-	dprintf(("%04x sections, offset %08x\n", be16toh(eh->e_shnum), be32toh(eh->e_shoff)));
+	dprintf(("%04x sections, offset %08x\n", be16toh(eh->e_shnum),
+	be32toh(eh->e_shoff)));
 	if (be16toh(eh->e_type) != ET_REL)
 		errx(1, "%s isn't a relocatable file, type=%d",
 		argv[0], be16toh(eh->e_type));
@@ -157,22 +158,27 @@ main(int argc, char *argv[])
 	/* Calculate sizes from section headers. */
 	tsz = dsz = bsz = trsz = 0;
 	sh = (Elf32_Shdr *)(image + be32toh(eh->e_shoff));
-	shstrtab = (char *)(image + be32toh(sh[be16toh(eh->e_shstrndx)].sh_offset));
-	symtab = NULL;	/*XXX*/
-	strtab = NULL;	/*XXX*/
-	dprintf(("name  type flagsaddr offset   size align\n"));
+	shstrtab = (char *)(image +
+	be32toh(sh[be16toh(eh->e_shstrndx)].sh_offset));
+	symtab = NULL;	/* XXX */
+	strtab = NULL;	/* XXX */
+	dprintf(("name  type flags"
+		 "addr offset   size align\n"));
 	for (i = 0; i < be16toh(eh->e_shnum); ++i) {
 		uint32_t sh_size;
 
-		dprintf( ("%2d: %08x %-16s %08x %08x %08x %08x %08x %08x\n", i,
+		dprintf(("%2d: %08x %-16s %08x %08x %08x %08x %08x %08x\n", i,
 		be32toh(sh[i].sh_name), shstrtab + be32toh(sh[i].sh_name),
-		be32toh(sh[i].sh_type),
-		be32toh(sh[i].sh_flags), be32toh(sh[i].sh_addr),
-		be32toh(sh[i].sh_offset), be32toh(sh[i].sh_size),
-		be32toh(sh[i].sh_addralign)));
-		sh_size = (be32toh(sh[i].sh_size) + be32toh(sh[i].sh_addralign) - 1) &
-		- be32toh(sh[i].sh_addralign);
-		/* If section allocates memory, add to text, data, or bss size. */
+		be32toh(sh[i].sh_type), be32toh(sh[i].sh_flags),
+		be32toh(sh[i].sh_addr), be32toh(sh[i].sh_offset),
+		be32toh(sh[i].sh_size), be32toh(sh[i].sh_addralign)));
+		sh_size = (be32toh(sh[i].sh_size) +
+		be32toh(sh[i].sh_addralign) - 1) &
+		(- be32toh(sh[i].sh_addralign));
+		/*
+		 * If section allocates memory, add to text, data,
+		 * or bss size.
+		 */
 		if (be32toh(sh[i].sh_flags) & SHF_ALLOC) {
 			if (be32toh(sh[i].sh_type) == SHT_PROGBITS) {
 if (be32toh(sh[i].sh_flags) & SHF_WRITE)
@@ -188,8 +194,10 @@ main(int argc, char 

CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:39:30 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: chksum.c elf2bb.c

Log Message:
Wrap looong lines, and misc style/cosmetic fixes.

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:36:47 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
Do not cast return value from malloc(3).

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.24 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.25
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.24	Mon Apr 25 14:10:15 2022
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Mon Apr 25 14:36:47 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.24 2022/04/25 14:10:15 rin Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.25 2022/04/25 14:36:47 rin Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -243,7 +243,7 @@ retry:
 	memset(buffer, 0, bbsize);
 
 	/* Allocate and load loadable sections */
-	sect_offset = (uint32_t *)malloc(be16toh(eh->e_shnum) * sizeof(uint32_t));
+	sect_offset = malloc(be16toh(eh->e_shnum) * sizeof(uint32_t));
 	for (i = 0, l = 0; i < be16toh(eh->e_shnum); ++i) {
 		if (be32toh(sh[i].sh_flags) & SHF_ALLOC) {
 			dprintf(("vaddr 0x%04x size 0x%04x offset 0x%04x section %s\n",



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:36:47 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
Do not cast return value from malloc(3).

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:10:15 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
- static-ify usage(), intcmp(), and eval()
- remove prototype declaration for main()

NFCI; no binary changes observed for amd64 with -O0.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.23 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.24
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.23	Mon Apr 25 14:03:15 2022
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Mon Apr 25 14:10:15 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.23 2022/04/25 14:03:15 rin Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.24 2022/04/25 14:10:15 rin Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -59,9 +59,9 @@
 #include "elf2bb.h"
 #include "chksum.h"
 
-void usage(void);
-int intcmp(const void *, const void *);
-int main(int argc, char *argv[]);
+static void usage(void);
+static int intcmp(const void *, const void *);
+static int eval(Elf32_Sym *, uint32_t *);
 
 #ifdef DEBUG
 #define dprintf(x) if (debug) printf x
@@ -78,7 +78,7 @@ uint8_t *buffer;
 uint32_t *relbuf;
 	/* can't have more relocs than that*/
 
-int
+static int
 intcmp(const void *i, const void *j)
 {
 	int r;
@@ -98,7 +98,6 @@ main(int argc, char *argv[])
 	char *shstrtab;
 	Elf32_Sym *symtab;
 	char *strtab;
-	int eval(Elf32_Sym *, uint32_t *);
 	uint32_t *lptr;
 	int i, l, delta;
 	uint8_t *rpo;



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:10:15 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
- static-ify usage(), intcmp(), and eval()
- remove prototype declaration for main()

NFCI; no binary changes observed for amd64 with -O0.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:03:15 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: chksum.c elf2bb.c

Log Message:
Use htobe{16,32}(9) instead of be{16,32}toh(9) where appropriate.

No binary changes both for little and big endian machines.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/elf2bb/chksum.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c:1.6 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c:1.7
--- src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c:1.6	Mon Apr 25 13:43:50 2022
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c	Mon Apr 25 14:03:15 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: chksum.c,v 1.6 2022/04/25 13:43:50 rin Exp $ */
+/* $NetBSD: chksum.c,v 1.7 2022/04/25 14:03:15 rin Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@ chksum(uint32_t *block, int size)
 
 	for (i=0; ie_shnum), htobe32(eh->e_shoff)));
-	if (htobe16(eh->e_type) != ET_REL)
+	dprintf(("%04x sections, offset %08x\n", be16toh(eh->e_shnum), be32toh(eh->e_shoff)));
+	if (be16toh(eh->e_type) != ET_REL)
 		errx(1, "%s isn't a relocatable file, type=%d",
-		argv[0], htobe16(eh->e_type));
-	if (htobe16(eh->e_machine) != EM_68K)
+		argv[0], be16toh(eh->e_type));
+	if (be16toh(eh->e_machine) != EM_68K)
 		errx(1, "%s isn't M68K, machine=%d", argv[0],
-		htobe16(eh->e_machine));
+		be16toh(eh->e_machine));
 
 	/* Calculate sizes from section headers. */
 	tsz = dsz = bsz = trsz = 0;
-	sh = (Elf32_Shdr *)(image + htobe32(eh->e_shoff));
-	shstrtab = (char *)(image + htobe32(sh[htobe16(eh->e_shstrndx)].sh_offset));
+	sh = (Elf32_Shdr *)(image + be32toh(eh->e_shoff));
+	shstrtab = (char *)(image + be32toh(sh[be16toh(eh->e_shstrndx)].sh_offset));
 	symtab = NULL;	/*XXX*/
 	strtab = NULL;	/*XXX*/
 	dprintf(("name  type flagsaddr offset   size align\n"));
-	for (i = 0; i < htobe16(eh->e_shnum); ++i) {
+	for (i = 0; i < be16toh(eh->e_shnum); ++i) {
 		uint32_t sh_size;
 
 		dprintf( ("%2d: %08x %-16s %08x %08x %08x %08x %08x %08x\n", i,
-		htobe32(sh[i].sh_name), shstrtab + htobe32(sh[i].sh_name),
-		htobe32(sh[i].sh_type),
-		htobe32(sh[i].sh_flags), htobe32(sh[i].sh_addr),
-		htobe32(sh[i].sh_offset), htobe32(sh[i].sh_size),
-		htobe32(sh[i].sh_addralign)));
-		sh_size = (htobe32(sh[i].sh_size) + htobe32(sh[i].sh_addralign) - 1) &
-		-htobe32(sh[i].sh_addralign);
+		be32toh(sh[i].sh_name), shstrtab + be32toh(sh[i].sh_name),
+		be32toh(sh[i].sh_type),
+		be32toh(sh[i].sh_flags), be32toh(sh[i].sh_addr),
+		be32toh(sh[i].sh_offset), be32toh(sh[i].sh_size),
+		be32toh(sh[i].sh_addralign)));
+		sh_size = (be32toh(sh[i].sh_size) + be32toh(sh[i].sh_addralign) - 1) &
+		- be32toh(sh[i].sh_addralign);
 		/* If section allocates memory, add to text, data, or bss size. */
-		if (htobe32(sh[i].sh_flags) & SHF_ALLOC) {
-			if (htobe32(sh[i].sh_type) == SHT_PROGBITS) {
-if (htobe32(sh[i].sh_flags) & SHF_WRITE)
+		if (be32toh(sh[i].sh_flags) & SHF_ALLOC) {
+			if (be32toh(sh[i].sh_type) == SHT_PROGBITS) {
+if (be32toh(sh[i].sh_flags) & SHF_WRITE)
 	dsz += sh_size;
 else
 	tsz += sh_size;
 			} else
 bsz += sh_size;
 		/* If it's relocations, add to relocation count */
-		} else if (htobe32(sh[i].sh_type) == SHT_RELA) {
-			trsz += htobe32(sh[i].sh_size);
+		} else if (be32toh(sh[i].sh_type) == SHT_RELA) {
+			trsz += be32toh(sh[i].sh_size);
 		}
 		/* Check for SHT_REL? */
 		/* Get symbol table location. */
-		else if (htobe32(sh[i].sh_type) == SHT_SYMTAB) {
-			symtab = (Elf32_Sym *)(image + htobe32(sh[i].sh_offset));
-		} else if (strcmp(".strtab", shstrtab + htobe32(sh[i].sh_name)) == 0) {
-			strtab = image + htobe32(sh[i].sh_offset);
+		else if (be32toh(sh[i].sh_type) == SHT_SYMTAB) {
+			symtab = (Elf32_Sym *)(image + be32toh(sh[i].sh_offset));
+		} else if (strcmp(".strtab", shstrtab + be32toh(sh[i].sh_name)) == 0) {
+			strtab = image + be32toh(sh[i].sh_offset);
 		}
 	}
 	dprintf(("tsz = 0x%x, dsz = 0x%x, bsz = 0x%x, total 0x%x\n",
@@ -244,18 +244,18 @@ retry:
 	memset(buffer, 0, bbsize);
 
 	/* Allocate and load loadable sections */
-	sect_offset = (uint32_t *)malloc(htobe16(eh->e_shnum) * sizeof(uint32_t));
-	for (i = 0, l = 0; i < htobe16(eh->e_shnum); ++i) {
-		if (htobe32(sh[i].sh_flags) & SHF_ALLOC) {
+	sect_offset = (uint32_t *)malloc(be16toh(eh->e_shnum) * sizeof(uint32_t));
+	for (i = 0, l = 0; i < be16toh(eh->e_shnum); ++i) {
+		if (be32toh(sh[i].sh_flags) & SHF_ALLOC) {
 			dprintf(("vaddr 0x%04x size 0x%04x offset 0x%04x section %s\n",
-			l, htobe32(sh[i].sh_size), 

CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 14:03:15 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: chksum.c elf2bb.c

Log Message:
Use htobe{16,32}(9) instead of be{16,32}toh(9) where appropriate.

No binary changes both for little and big endian machines.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 13:43:50 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: chksum.c chksum.h elf2bb.c

Log Message:
u_intN_t --> uintN_t

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/elf2bb/chksum.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c:1.5 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c:1.6
--- src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c:1.5	Sat Mar 14 15:36:01 2009
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c	Mon Apr 25 13:43:50 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: chksum.c,v 1.5 2009/03/14 15:36:01 dsl Exp $ */
+/* $NetBSD: chksum.c,v 1.6 2022/04/25 13:43:50 rin Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -39,10 +39,10 @@
 
 #include "chksum.h"
 
-u_int32_t
-chksum(u_int32_t *block, int size)
+uint32_t
+chksum(uint32_t *block, int size)
 {
-	u_int32_t sum, lastsum;
+	uint32_t sum, lastsum;
 	int i;
 
 	sum = 0;
@@ -58,17 +58,17 @@ chksum(u_int32_t *block, int size)
 }
 
 #ifdef TESTSUM
-u_int32_t myblock[8192];
+uint32_t myblock[8192];
 
 int
 main(int argc, char *argb[]) {
 	int bbsize;
-	u_int32_t cks, cks1;
+	uint32_t cks, cks1;
 
 	bbsize=atol(argb[1]);
-	bbsize *= (512 / sizeof (u_int32_t));
+	bbsize *= (512 / sizeof (uint32_t));
 
-	if (4*bbsize != read(0, myblock, sizeof(u_int32_t)*bbsize)) {
+	if (4*bbsize != read(0, myblock, sizeof(uint32_t)*bbsize)) {
 		fprintf(stderr, "short read\n");
 		exit(1);
 	}

Index: src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.h
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.h:1.3 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.h:1.4
--- src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.h:1.3	Mon Apr 28 20:23:13 2008
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.h	Mon Apr 25 13:43:50 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: chksum.h,v 1.3 2008/04/28 20:23:13 martin Exp $ */
+/* $NetBSD: chksum.h,v 1.4 2022/04/25 13:43:50 rin Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -31,5 +31,5 @@
 
 #define CHKSUMOFFS 1
 
-u_int32_t chksum(u_int32_t *, int);
+uint32_t chksum(uint32_t *, int);
 

Index: src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.21 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.22
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.21	Fri Feb 18 06:42:59 2022
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Mon Apr 25 13:43:50 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.21 2022/02/18 06:42:59 mlelstv Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.22 2022/04/25 13:43:50 rin Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -74,8 +74,8 @@ int debug;
 
 char *progname;
 int bbsize = BBSIZE;
-u_int8_t *buffer;
-u_int32_t *relbuf;
+uint8_t *buffer;
+uint32_t *relbuf;
 	/* can't have more relocs than that*/
 
 int
@@ -83,7 +83,7 @@ intcmp(const void *i, const void *j)
 {
 	int r;
 
-	r = (*(u_int32_t *)i) < (*(u_int32_t *)j);
+	r = (*(uint32_t *)i) < (*(uint32_t *)j);
 	
 	return 2*r-1;
 }
@@ -98,16 +98,16 @@ main(int argc, char *argv[])
 	char *shstrtab;
 	Elf32_Sym *symtab;
 	char *strtab;
-	int eval(Elf32_Sym *, u_int32_t *);
-	u_int32_t *lptr;
+	int eval(Elf32_Sym *, uint32_t *);
+	uint32_t *lptr;
 	int i, l, delta;
-	u_int8_t *rpo;
-	u_int32_t oldaddr, addrdiff;
-	u_int32_t tsz, dsz, bsz, trsz, relver;
-	u_int32_t pcrelsz, r32sz;
+	uint8_t *rpo;
+	uint32_t oldaddr, addrdiff;
+	uint32_t tsz, dsz, bsz, trsz, relver;
+	uint32_t pcrelsz, r32sz;
 	int sumsize = 16;
 	int c;
-	u_int32_t *sect_offset;
+	uint32_t *sect_offset;
 	int undefsyms;
 	uint32_t tmp32;
 	uint16_t tmp16;
@@ -163,7 +163,7 @@ main(int argc, char *argv[])
 	strtab = NULL;	/*XXX*/
 	dprintf(("name  type flagsaddr offset   size align\n"));
 	for (i = 0; i < htobe16(eh->e_shnum); ++i) {
-		u_int32_t sh_size;
+		uint32_t sh_size;
 
 		dprintf( ("%2d: %08x %-16s %08x %08x %08x %08x %08x %08x\n", i,
 		htobe32(sh[i].sh_name), shstrtab + htobe32(sh[i].sh_name),
@@ -244,7 +244,7 @@ retry:
 	memset(buffer, 0, bbsize);
 
 	/* Allocate and load loadable sections */
-	sect_offset = (u_int32_t *)malloc(htobe16(eh->e_shnum) * sizeof(u_int32_t));
+	sect_offset = (uint32_t *)malloc(htobe16(eh->e_shnum) * sizeof(uint32_t));
 	for (i = 0, l = 0; i < htobe16(eh->e_shnum); ++i) {
 		if (htobe32(sh[i].sh_flags) & SHF_ALLOC) {
 			dprintf(("vaddr 0x%04x size 0x%04x offset 0x%04x section %s\n",
@@ -264,7 +264,7 @@ retry:
 	 * relocator version. For now, check that the relocator at
 	 * the image 

CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-04-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr 25 13:43:50 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: chksum.c chksum.h elf2bb.c

Log Message:
u_intN_t --> uintN_t

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/stand/bootblock/elf2bb/chksum.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-02-17 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Feb 18 06:43:00 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
Don't crash when reporting an undefined symbol.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.20 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.21
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.20	Tue May 18 20:34:20 2021
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Fri Feb 18 06:42:59 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.20 2021/05/18 20:34:20 dholland Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.21 2022/02/18 06:42:59 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -325,7 +325,7 @@ retry:
 			s = [ELF32_R_SYM(htobe32(ra->r_info))];
 			if (s->st_shndx == ELF_SYM_UNDEFINED) {
 fprintf(stderr, "Undefined symbol: %s\n",
-strtab + s->st_name);
+strtab + htobe32(s->st_name));
 ++undefsyms;
 			}
 			value = htobe32(ra->r_addend) + eval(s, sect_offset);



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2022-02-17 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Feb 18 06:43:00 UTC 2022

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
Don't crash when reporting an undefined symbol.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2021-05-18 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 18 20:34:20 UTC 2021

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
Remove some unused variables, found by gcc -Wall.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.19 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.20
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.19	Tue May 18 20:32:18 2021
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Tue May 18 20:34:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.19 2021/05/18 20:32:18 dholland Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.20 2021/05/18 20:34:20 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -92,7 +92,6 @@ int
 main(int argc, char *argv[])
 {
 	int ifd, ofd;
-	u_int mid, flags, magic;
 	void *image;
 	Elf32_Ehdr *eh;
 	Elf32_Shdr *sh;
@@ -104,7 +103,7 @@ main(int argc, char *argv[])
 	int i, l, delta;
 	u_int8_t *rpo;
 	u_int32_t oldaddr, addrdiff;
-	u_int32_t tsz, dsz, bsz, trsz, drsz, entry, relver;
+	u_int32_t tsz, dsz, bsz, trsz, relver;
 	u_int32_t pcrelsz, r32sz;
 	int sumsize = 16;
 	int c;



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2021-05-18 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 18 20:34:20 UTC 2021

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
Remove some unused variables, found by gcc -Wall.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2021-05-18 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 18 20:32:18 UTC 2021

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
Print ptrdiff_t with %td, not %d. Appeared in passing in PR 56188.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.18 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.19
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.18	Thu Feb 25 03:40:27 2021
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Tue May 18 20:32:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.18 2021/02/25 03:40:27 rin Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.19 2021/05/18 20:32:18 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -421,7 +421,7 @@ retry:
 	*rpo = 0; rpo += delta;
 	*rpo = 0; rpo += delta;
 
-	printf("using %d bytes, %d bytes remaining.\n", delta > 0 ?
+	printf("using %td bytes, %td bytes remaining.\n", delta > 0 ?
 	rpo-buffer-tsz-dsz : buffer+bbsize-rpo, delta > 0 ?
 	buffer + bbsize - rpo : rpo - buffer - tsz - dsz);
 	/*



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2021-05-18 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 18 20:32:18 UTC 2021

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
Print ptrdiff_t with %td, not %d. Appeared in passing in PR 56188.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2021-05-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu May  6 13:07:00 UTC 2021

Modified Files:
src/sys/arch/amiga/stand/bootblock: Makefile

Log Message:
Unhook elf2bb and txlt as they are built as tools.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/amiga/stand/bootblock/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/amiga/stand/bootblock/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/Makefile:1.5 src/sys/arch/amiga/stand/bootblock/Makefile:1.6
--- src/sys/arch/amiga/stand/bootblock/Makefile:1.5	Thu Feb 25 03:42:14 2021
+++ src/sys/arch/amiga/stand/bootblock/Makefile	Thu May  6 13:07:00 2021
@@ -1,15 +1,7 @@
-#	$NetBSD: Makefile,v 1.5 2021/02/25 03:42:14 rin Exp $
+#	$NetBSD: Makefile,v 1.6 2021/05/06 13:07:00 rin Exp $
 
 .include 
 
-# Don't install these, but make them first:
-.ifnmake install
-SUBDIR=txlt
-SUBDIR+=elf2bb
-.endif
-
-# but these:
 SUBDIR+=boot bootxx_ffs bootxx_ffsv2
 
-
 .include 



CVS commit: src/sys/arch/amiga/stand/bootblock

2021-05-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu May  6 13:07:00 UTC 2021

Modified Files:
src/sys/arch/amiga/stand/bootblock: Makefile

Log Message:
Unhook elf2bb and txlt as they are built as tools.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/amiga/stand/bootblock/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2021-02-24 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 25 03:42:15 UTC 2021

Modified Files:
src/sys/arch/amiga/stand/bootblock: Makefile
src/sys/arch/amiga/stand/bootblock/boot: Makefile version xd.c
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile
Added Files:
src/sys/arch/amiga/stand/bootblock/bootxx_ffsv2: Makefile

Log Message:
Add FFSv2 support for primary- and second-stage boot loaders.

Rename primary-stage boot for FFSv1 (and ustarfs) to bootxx_ffsv1 for clarity.

Bump version to 3.1.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amiga/stand/bootblock/Makefile
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amiga/stand/bootblock/boot/version
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amiga/stand/bootblock/boot/xd.c
cvs rdiff -u -r1.25 -r1.26 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
cvs rdiff -u -r0 -r1.1 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffsv2/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/amiga/stand/bootblock/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/Makefile:1.4 src/sys/arch/amiga/stand/bootblock/Makefile:1.5
--- src/sys/arch/amiga/stand/bootblock/Makefile:1.4	Tue Jul  6 05:59:57 2010
+++ src/sys/arch/amiga/stand/bootblock/Makefile	Thu Feb 25 03:42:14 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2010/07/06 05:59:57 mrg Exp $
+#	$NetBSD: Makefile,v 1.5 2021/02/25 03:42:14 rin Exp $
 
 .include 
 
@@ -9,7 +9,7 @@ SUBDIR+=elf2bb
 .endif
 
 # but these:
-SUBDIR+=boot bootxx_ffs
+SUBDIR+=boot bootxx_ffs bootxx_ffsv2
 
 
 .include 

Index: src/sys/arch/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.56 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.57
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.56	Sun Apr  9 14:51:52 2017
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Thu Feb 25 03:42:14 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.56 2017/04/09 14:51:52 christos Exp $
+#	$NetBSD: Makefile,v 1.57 2021/02/25 03:42:14 rin Exp $
 
 .include 
 .include 		# for HOST_SH
@@ -40,7 +40,7 @@ BINDIR=/usr/mdec
 
 COBJS = main.o console.o xd.o twiddle.o bzero.o gets.o
 COBJS+=  lseek.o open.o read.o close.o dev.o errno.o
-COBJS+=  ufs.o ustarfs.o panic.o vers.o files.o
+COBJS+=  ufs.o ustarfs.o ffsv2.o panic.o vers.o files.o
 COBJS+=  divdi3.o moddi3.o qdivrem.o
 
 SOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o

Index: src/sys/arch/amiga/stand/bootblock/boot/version
diff -u src/sys/arch/amiga/stand/bootblock/boot/version:1.1 src/sys/arch/amiga/stand/bootblock/boot/version:1.2
--- src/sys/arch/amiga/stand/bootblock/boot/version:1.1	Mon Dec 17 05:41:13 2001
+++ src/sys/arch/amiga/stand/bootblock/boot/version	Thu Feb 25 03:42:14 2021
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.1 2001/12/17 05:41:13 mhitch Exp $
+$NetBSD: version,v 1.2 2021/02/25 03:42:14 rin Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -11,3 +11,4 @@ is taken as the current.
 2.3:	???
 2.4:	Moved default command into fixed location for easy patching
 3.0:	Initial 2 stage amiga bootblocks
+3.1:	Add support for FFSv2

Index: src/sys/arch/amiga/stand/bootblock/boot/xd.c
diff -u src/sys/arch/amiga/stand/bootblock/boot/xd.c:1.10 src/sys/arch/amiga/stand/bootblock/boot/xd.c:1.11
--- src/sys/arch/amiga/stand/bootblock/boot/xd.c:1.10	Sat Mar 14 21:04:04 2009
+++ src/sys/arch/amiga/stand/bootblock/boot/xd.c	Thu Feb 25 03:42:14 2021
@@ -1,5 +1,5 @@
 /*
- * $NetBSD: xd.c,v 1.10 2009/03/14 21:04:04 dsl Exp $
+ * $NetBSD: xd.c,v 1.11 2021/02/25 03:42:14 rin Exp $
  *
  * Copyright (c) 1996 Ignatios Souvatzis.
  * Copyright (c) 1995 Waldi Ravens.
@@ -53,8 +53,13 @@ struct devsw devsw[] = {
 };
 
 struct fs_ops file_system[] = {
+#if !defined(_PRIMARY_BOOT) || BOOTXX_FFS_VERSION == 1
 	FS_OPS(ufs),
 	FS_OPS(ustarfs),
+#endif
+#if !defined(_PRIMARY_BOOT) || BOOTXX_FFS_VERSION == 2
+	FS_OPS(ffsv2),
+#endif
 };
 
 int nfsys = sizeof(file_system)/sizeof(struct fs_ops);

Index: src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.25 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.26
--- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.25	Sun Apr  9 14:51:52 2017
+++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile	Thu Feb 25 03:42:14 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.25 2017/04/09 14:51:52 christos Exp $
+#	$NetBSD: Makefile,v 1.26 2021/02/25 03:42:14 rin Exp $
 
 .include 
 .include 
@@ -24,12 +24,21 @@ S=		${DIR_TOP}
 .SUFFIXES:
 .SUFFIXES: .out .o .po .pico .so .s .S .c .cc .C .f .y .l .ln .m4 .sh
 
-FILES= bootxx_ffs bootxx_fd
+.ifdef BOOTXX_FFSV2
+FILES=		bootxx_ffsv2

CVS commit: src/sys/arch/amiga/stand/bootblock

2021-02-24 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 25 03:42:15 UTC 2021

Modified Files:
src/sys/arch/amiga/stand/bootblock: Makefile
src/sys/arch/amiga/stand/bootblock/boot: Makefile version xd.c
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile
Added Files:
src/sys/arch/amiga/stand/bootblock/bootxx_ffsv2: Makefile

Log Message:
Add FFSv2 support for primary- and second-stage boot loaders.

Rename primary-stage boot for FFSv1 (and ustarfs) to bootxx_ffsv1 for clarity.

Bump version to 3.1.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amiga/stand/bootblock/Makefile
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amiga/stand/bootblock/boot/version
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amiga/stand/bootblock/boot/xd.c
cvs rdiff -u -r1.25 -r1.26 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
cvs rdiff -u -r0 -r1.1 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffsv2/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2021-02-24 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 25 03:40:27 UTC 2021

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
For upcoming FFSv2 support for boot.amiga, dynamically scale its size,
instead of fixing to 32KB.

Old 32KB limit comes from

(1) all R_68K_PC16 symbols get relocated, and

(2) all values in our relocation table for R_68K_32 symbols fit within
16-bit integer.

(1) is already checked in the code. Assertion for (2) is added, but this
limit is satisfied with sufficient margin at the moment. If it is not the
case in the future, we may need to change format for relocation table.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/elf2bb

2021-02-24 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 25 03:40:27 UTC 2021

Modified Files:
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
For upcoming FFSv2 support for boot.amiga, dynamically scale its size,
instead of fixing to 32KB.

Old 32KB limit comes from

(1) all R_68K_PC16 symbols get relocated, and

(2) all values in our relocation table for R_68K_32 symbols fit within
16-bit integer.

(1) is already checked in the code. Assertion for (2) is added, but this
limit is satisfied with sufficient margin at the moment. If it is not the
case in the future, we may need to change format for relocation table.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.17 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.18
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.17	Thu Aug 20 15:54:12 2020
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Thu Feb 25 03:40:27 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.17 2020/08/20 15:54:12 riastradh Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.18 2021/02/25 03:40:27 rin Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -33,6 +33,7 @@
 #include "nbtool_config.h"
 #endif
 
+#include 
 #include 
 
 #include 
@@ -111,6 +112,7 @@ main(int argc, char *argv[])
 	int undefsyms;
 	uint32_t tmp32;
 	uint16_t tmp16;
+	int Sflag = 0;
 
 	progname = argv[0];
 
@@ -122,7 +124,7 @@ main(int argc, char *argv[])
 		break;
 	case 'S':
 		/* Dynamically size second-stage boot */
-		sumsize = 0;
+		Sflag = 1;
 		break;
 	case 'd':
 		debug = 1;
@@ -155,7 +157,7 @@ main(int argc, char *argv[])
 		htobe16(eh->e_machine));
 
 	/* Calculate sizes from section headers. */
-	tsz = dsz = bsz = trsz = pcrelsz = r32sz = 0;
+	tsz = dsz = bsz = trsz = 0;
 	sh = (Elf32_Shdr *)(image + htobe32(eh->e_shoff));
 	shstrtab = (char *)(image + htobe32(sh[htobe16(eh->e_shstrndx)].sh_offset));
 	symtab = NULL;	/*XXX*/
@@ -201,31 +203,45 @@ main(int argc, char *argv[])
 
 	dprintf(("%d relocs\n", trsz/12));
 
-	if (sumsize == 0) {
+	if (Sflag) {
 		/*
-		 * XXX overly cautious, but this guarantees that 16bit
-		 * pc offsets and our relocs always work.
+		 * For second-stage boot, there's no limit for binary size,
+		 * and we dynamically scale it. However, it should be small
+		 * enough so that
+		 *
+		 *  (1) all R_68K_PC16 symbols get relocated, and
+		 *
+		 *  (2) all values in our relocation table for R_68K_32
+		 *  symbols fit within 16-bit integer.
+		 *
+		 * Both will be checked by codes below.
+		 *
+		 * At the moment, (2) is satisfied with sufficient margin.
+		 * But if it is not the case in the future, format for
+		 * relocation table should be modified.
 		 */
-		bbsize = 32768;
-		if (bbsize < (tsz + dsz + bsz)) {
-			errx(1, "%s: too big (%d < (%d + %d + %d))",
-			argv[0], bbsize, tsz, dsz, bsz);
-		}
+		bbsize = roundup(tsz + dsz, 512);
 		sumsize = bbsize / 512;
+	} else {
+		/*
+		 * We have one contiguous area allocated by the ROM to us.
+		 */
+		if (tsz + dsz + bsz > bbsize)
+			errx(1, "%s: resulting image too big %d+%d+%d=%d",
+			argv[0], tsz, dsz, bsz, tsz + dsz + bsz);
 	}
 
-	buffer = malloc(bbsize);
-	relbuf = (u_int32_t *)malloc(bbsize);
+	buffer = NULL;
+	relbuf = NULL;
+
+retry:
+	pcrelsz = r32sz = 0;
+
+	buffer = realloc(buffer, bbsize);
+	relbuf = realloc(relbuf, bbsize);
 	if (buffer == NULL || relbuf == NULL)
 		err(1, "Unable to allocate memory\n");
 
-	/*
-	 * We have one contiguous area allocated by the ROM to us.
-	 */
-	if (tsz+dsz+bsz > bbsize)
-		errx(1, "%s: resulting image too big %d+%d+%d=%d", argv[0],
-		tsz, dsz, bsz, tsz + dsz + bsz);
-
 	memset(buffer, 0, bbsize);
 
 	/* Allocate and load loadable sections */
@@ -363,7 +379,10 @@ main(int argc, char *argv[])
 		lptr = (u_int32_t *)[relbuf[i]];
 		addrdiff = relbuf[i] - oldaddr;
 		dprintf(("(0x%04x, 0x%04x): ", *lptr, addrdiff));
-		if (addrdiff > 255) {
+		if (addrdiff > 0x) {
+			errx(1, "addrdiff overflows: relbuf = 0x%08x, "
+			"oldaddr = 0x%08x, abort.\n", relbuf[i], oldaddr);
+		} else if (addrdiff > 0xff) {
 			*rpo = 0;
 			if (delta > 0) {
 ++rpo;
@@ -387,8 +406,16 @@ main(int argc, char *argv[])
 		oldaddr = relbuf[i];
 
 		if (delta < 0 ? rpo <= buffer+tsz+dsz
-		: rpo >= buffer + bbsize)
-			errx(1, "Relocs don't fit.");
+		: rpo >= buffer + bbsize) {
+			printf("relocs don't fit, ");
+			if (Sflag) {
+printf("retry.\n");
+bbsize += 512;
+sumsize++;
+goto retry;
+			} else
+errx(1, "abort.");
+		}
 	}
 	*rpo = 0; rpo += delta;
 	*rpo = 0; rpo += delta;
@@ -401,8 +428,16 @@ main(int argc, char *argv[])
 	 * RELOCs must fit into the bss area.
 	 */
 	if 

CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2020-08-21 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Aug 22 05:09:02 UTC 2020

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: ashldi3.s

Log Message:
Fix register order.  %d0 is higher and %d1 is lower.
This would have rarely affected.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amiga/stand/bootblock/boot/ashldi3.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/amiga/stand/bootblock/boot/ashldi3.s
diff -u src/sys/arch/amiga/stand/bootblock/boot/ashldi3.s:1.2 src/sys/arch/amiga/stand/bootblock/boot/ashldi3.s:1.3
--- src/sys/arch/amiga/stand/bootblock/boot/ashldi3.s:1.2	Mon Apr 28 20:23:13 2008
+++ src/sys/arch/amiga/stand/bootblock/boot/ashldi3.s	Sat Aug 22 05:09:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ashldi3.s,v 1.2 2008/04/28 20:23:13 martin Exp $ */
+/*	$NetBSD: ashldi3.s,v 1.3 2020/08/22 05:09:02 isaki Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -36,8 +36,8 @@ ENTRY_NOPROFILE(__ashldi3)
 	movml %sp@(8),%d0-%d2
 	jra L2
 L1:
-	asll #1,%d0
-	roxll #1,%d1
+	asll #1,%d1
+	roxll #1,%d0
 L2:
 	dbra %d2,L1
 



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2020-08-21 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Aug 22 05:09:02 UTC 2020

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: ashldi3.s

Log Message:
Fix register order.  %d0 is higher and %d1 is lower.
This would have rarely affected.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amiga/stand/bootblock/boot/ashldi3.s

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2017-04-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr  9 14:51:52 UTC 2017

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile

Log Message:
make this work again.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.24 -r1.25 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2017-04-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr  9 14:51:52 UTC 2017

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile

Log Message:
make this work again.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.24 -r1.25 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.55 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.56
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.55	Sat Apr  8 15:53:19 2017
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Sun Apr  9 10:51:52 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.55 2017/04/08 19:53:19 christos Exp $
+#	$NetBSD: Makefile,v 1.56 2017/04/09 14:51:52 christos Exp $
 
 .include 
 .include 		# for HOST_SH
@@ -11,11 +11,11 @@
 #XX#DIR_LIBZ =	${DIR_TOP}/../common/dist/zlib
 
 DIR_TOP=	${.CURDIR}/../../../../..
-DIR_SA = 	${S}/lib/libsa
+DIR_SA = 	${DIR_TOP}/lib/libsa
 DIR_LIBZ=
-DIR_KERN=	${S}/lib/libkern
-DIR_KERN_MD=	${S}/lib/libkern/arch/$(MACHINE_ARCH)
-DIR_LIBC=	${S}/../common/lib/libc
+DIR_KERN=	${DIR_TOP}/lib/libkern
+DIR_KERN_MD=	${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH)
+DIR_LIBC=	${DIR_TOP}/../common/lib/libc
 
 .PATH:  $(DIR_SA) ${DIR_LIBZ} $(DIR_KERN) $(DIR_KERN_MD) \
 	${DIR_LIBC}/gen ${DIR_LIBC}/arch/m68k/gen \
@@ -70,7 +70,7 @@ realall: ${FILES}
 
 CLEANFILES += boot.amiga x.out xxstart.o libboot.a
 
-VERSIONFLAGS+=-N
+VERSIONFLAGS+=-n
 .include "${S}/conf/newvers_stand.mk"
 
 .include 

Index: src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.24 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.25
--- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.24	Sat Apr  8 15:53:20 2017
+++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile	Sun Apr  9 10:51:52 2017
@@ -1,12 +1,15 @@
-#	$NetBSD: Makefile,v 1.24 2017/04/08 19:53:20 christos Exp $
+#	$NetBSD: Makefile,v 1.25 2017/04/09 14:51:52 christos Exp $
+
+.include 
+.include 
 
 ### what we need:
 
-S=	${.CURDIR}/../../../../..
-DIR_SA = 	${S}/lib/libsa
-DIR_KERN=	${S}/lib/libkern
-DIR_KERN_MD=	${S}/lib/libkern/arch/$(MACHINE_ARCH)
-DIR_LIBC=	${S}/../common/lib/libc
+DIR_TOP=	${.CURDIR}/../../../../..
+DIR_SA = 	${DIR_TOP}/lib/libsa
+DIR_KERN=	${DIR_TOP}/lib/libkern
+DIR_KERN_MD=	${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH)
+DIR_LIBC=	${DIR_TOP}/../common/lib/libc
 
 .PATH:  ${.CURDIR}/../boot $(DIR_SA) $(DIR_KERN) $(DIR_KERN_MD) \
 	${DIR_LIBC}/gen ${DIR_LIBC}/arch/m68k/gen \
@@ -14,6 +17,7 @@ DIR_LIBC=	${S}/../common/lib/libc
 	${DIR_LIBC}/quad ${DIR_LIBC}/arch/m68k/quad \
 	${DIR_LIBC}/string ${DIR_LIBC}/arch/m68k/string
 
+S=		${DIR_TOP}
 
 # prefer our assembler versions over assembler, and assembler over C:
 
@@ -24,7 +28,7 @@ FILES= bootxx_ffs bootxx_fd
 BINDIR=/usr/mdec
 
 COBJS = main.o console.o xd.o twiddle.o bzero.o gets.o
-COBJS+=  lseek.o open.o read.o close.o dev.o errno.o
+COBJS+=  lseek.o open.o vers.o read.o close.o dev.o errno.o
 COBJS+=  ufs.o ustarfs.o panic.o files.o
 
 SOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o
@@ -43,6 +47,10 @@ realall: ${FILES}
 
 CLEANFILES += bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a
 
+VERSIONFILE=${.CURDIR}/../boot/version
+VERSIONFLAGS+=-n
+.include "${S}/conf/newvers_stand.mk"
+
 .include 
 .include 
 
@@ -113,10 +121,6 @@ libboot.a: ${OBJS}
 	${_MKTARGET_BUILD}
 	${AR} crs $@ $> && ${RANLIB} $@
 
-VERSIONFILE=${.CURDIR}/../boot/version
-VERSIONFLAGS=-n
-.include "${S}/conf/newvers_stand.mk"
-
 # make sure these are built:
 
 ${COBJS}: ${TXLT}



CVS commit: src/sys/arch/amiga/stand/bootblock/installboot

2017-02-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Feb 12 18:21:50 UTC 2017

Modified Files:
src/sys/arch/amiga/stand/bootblock/installboot: installboot.c

Log Message:
Uninitialized var, found by Mootja; not tested, but obvious enough.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/arch/amiga/stand/bootblock/installboot/installboot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/installboot

2017-02-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Feb 12 18:21:50 UTC 2017

Modified Files:
src/sys/arch/amiga/stand/bootblock/installboot: installboot.c

Log Message:
Uninitialized var, found by Mootja; not tested, but obvious enough.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/arch/amiga/stand/bootblock/installboot/installboot.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/amiga/stand/bootblock/installboot/installboot.c
diff -u src/sys/arch/amiga/stand/bootblock/installboot/installboot.c:1.5 src/sys/arch/amiga/stand/bootblock/installboot/installboot.c:1.6
--- src/sys/arch/amiga/stand/bootblock/installboot/installboot.c:1.5	Tue Jul  6 06:09:57 2010
+++ src/sys/arch/amiga/stand/bootblock/installboot/installboot.c	Sun Feb 12 18:21:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: installboot.c,v 1.5 2010/07/06 06:09:57 mrg Exp $	*/
+/*	$NetBSD: installboot.c,v 1.6 2017/02/12 18:21:50 maxv Exp $	*/
 
 #include 
 #include 
@@ -17,7 +17,7 @@ int main(int argc, char *argv[]);
 
 int main(int argc, char *argv[]){
 
-	char *line;
+	char *line = NULL;
 	char *progname;
 	char *bootnam, *devnam;
 	char *dline;



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2016-12-18 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec 18 12:02:37 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: console.c

Log Message:
check for serial console flag also when re-using console from
primary bootstrap.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/amiga/stand/bootblock/boot/console.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/amiga/stand/bootblock/boot/console.c
diff -u src/sys/arch/amiga/stand/bootblock/boot/console.c:1.14 src/sys/arch/amiga/stand/bootblock/boot/console.c:1.15
--- src/sys/arch/amiga/stand/bootblock/boot/console.c:1.14	Fri Jan 15 08:27:04 2016
+++ src/sys/arch/amiga/stand/bootblock/boot/console.c	Sun Dec 18 12:02:37 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: console.c,v 1.14 2016/01/15 08:27:04 mlelstv Exp $ */
+/* $NetBSD: console.c,v 1.15 2016/12/18 12:02:37 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -110,8 +110,8 @@ consinit(void *consptr) {
 
 	if (consptr != NULL) {
 		/* Check magic? */
-		ConsoleBase = consptr;		/* Use existing console */
-		return (0);
+		mc = consptr;		/* Use existing console */
+		goto done;
 	}
 
 	mc = 
@@ -148,6 +148,8 @@ consinit(void *consptr) {
 	if (OpenDevice("timer.device", 0, (struct AmigaIO*)mc->tmior, 0))
 		goto err;
 
+done:
+
 #ifdef SERCONSOLE
 	conspreinit();
 	if (use_serconsole)



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2016-12-18 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec 18 12:02:37 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: console.c

Log Message:
check for serial console flag also when re-using console from
primary bootstrap.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/amiga/stand/bootblock/boot/console.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2016-09-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 17 18:08:02 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock: Makefile.booters

Log Message:
kill ssp


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/amiga/stand/bootblock/Makefile.booters

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2016-09-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 17 18:08:02 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock: Makefile.booters

Log Message:
kill ssp


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/amiga/stand/bootblock/Makefile.booters

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/amiga/stand/bootblock/Makefile.booters
diff -u src/sys/arch/amiga/stand/bootblock/Makefile.booters:1.8 src/sys/arch/amiga/stand/bootblock/Makefile.booters:1.9
--- src/sys/arch/amiga/stand/bootblock/Makefile.booters:1.8	Sat Sep 17 13:09:10 2016
+++ src/sys/arch/amiga/stand/bootblock/Makefile.booters	Sat Sep 17 14:08:02 2016
@@ -1,5 +1,6 @@
-#	$NetBSD: Makefile.booters,v 1.8 2016/09/17 17:09:10 christos Exp $
+#	$NetBSD: Makefile.booters,v 1.9 2016/09/17 18:08:02 christos Exp $
 
+NOSSP=	# defined
 NOPIE=	# defined
 .include 
 



CVS commit: src/sys/arch/amiga/stand/bootblock

2016-09-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 17 17:09:10 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock: Makefile.booters
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/elf2bb: Makefile
src/sys/arch/amiga/stand/bootblock/installboot: Makefile
src/sys/arch/amiga/stand/bootblock/txlt: Makefile

Log Message:
NOPIE


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/stand/bootblock/Makefile.booters
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/stand/bootblock/elf2bb/Makefile
cvs rdiff -u -r1.7 -r1.8 \
src/sys/arch/amiga/stand/bootblock/installboot/Makefile
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amiga/stand/bootblock/txlt/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/amiga/stand/bootblock/Makefile.booters
diff -u src/sys/arch/amiga/stand/bootblock/Makefile.booters:1.7 src/sys/arch/amiga/stand/bootblock/Makefile.booters:1.8
--- src/sys/arch/amiga/stand/bootblock/Makefile.booters:1.7	Tue Jul  6 01:59:57 2010
+++ src/sys/arch/amiga/stand/bootblock/Makefile.booters	Sat Sep 17 13:09:10 2016
@@ -1,6 +1,7 @@
-#	$NetBSD: Makefile.booters,v 1.7 2010/07/06 05:59:57 mrg Exp $
+#	$NetBSD: Makefile.booters,v 1.8 2016/09/17 17:09:10 christos Exp $
 
-.include 
+NOPIE=	# defined
+.include 
 
 RELOC2BB=	${TOOL_AMIGAELF2BB}
 TXLT=		${TOOL_AMIGATXLT}

Index: src/sys/arch/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.53 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.54
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.53	Fri Jan 15 03:27:04 2016
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Sat Sep 17 13:09:10 2016
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.53 2016/01/15 08:27:04 mlelstv Exp $
+#	$NetBSD: Makefile,v 1.54 2016/09/17 17:09:10 christos Exp $
 
-.include 
+.include 
 .include 		# for HOST_SH
 
 ### what we need:

Index: src/sys/arch/amiga/stand/bootblock/elf2bb/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/Makefile:1.3 src/sys/arch/amiga/stand/bootblock/elf2bb/Makefile:1.4
--- src/sys/arch/amiga/stand/bootblock/elf2bb/Makefile:1.3	Sun Dec 11 07:16:36 2005
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/Makefile	Sat Sep 17 13:09:10 2016
@@ -1,5 +1,8 @@
-#	$NetBSD: Makefile,v 1.3 2005/12/11 12:16:36 christos Exp $
+#	$NetBSD: Makefile,v 1.4 2016/09/17 17:09:10 christos Exp $
 #
+
+.include 
+
 CPPFLAGS+= -I.
 PROG=	elf2bb
 MKMAN=	no

Index: src/sys/arch/amiga/stand/bootblock/installboot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/installboot/Makefile:1.7 src/sys/arch/amiga/stand/bootblock/installboot/Makefile:1.8
--- src/sys/arch/amiga/stand/bootblock/installboot/Makefile:1.7	Tue Jul  6 02:09:57 2010
+++ src/sys/arch/amiga/stand/bootblock/installboot/Makefile	Sat Sep 17 13:09:10 2016
@@ -1,4 +1,7 @@
-#	$NetBSD: Makefile,v 1.7 2010/07/06 06:09:57 mrg Exp $
+#	$NetBSD: Makefile,v 1.8 2016/09/17 17:09:10 christos Exp $
+
+.include 
+
 PROG=installboot
 SRCS=installboot.c chksum.c
 BINDIR=/usr/mdec

Index: src/sys/arch/amiga/stand/bootblock/txlt/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/txlt/Makefile:1.9 src/sys/arch/amiga/stand/bootblock/txlt/Makefile:1.10
--- src/sys/arch/amiga/stand/bootblock/txlt/Makefile:1.9	Tue Feb  3 14:58:41 2015
+++ src/sys/arch/amiga/stand/bootblock/txlt/Makefile	Sat Sep 17 13:09:10 2016
@@ -1,7 +1,10 @@
-#	$NetBSD: Makefile,v 1.9 2015/02/03 19:58:41 aymeric Exp $
+#	$NetBSD: Makefile,v 1.10 2016/09/17 17:09:10 christos Exp $
 #
-PROG=txlt
+
 NOMAN=	# defined
+.include 
+
+PROG=txlt
 CLEANFILES+=	txlt.c
 
 .ifndef HOSTPROG



CVS commit: src/sys/arch/amiga/stand/bootblock

2016-09-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 17 17:09:10 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock: Makefile.booters
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/elf2bb: Makefile
src/sys/arch/amiga/stand/bootblock/installboot: Makefile
src/sys/arch/amiga/stand/bootblock/txlt: Makefile

Log Message:
NOPIE


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/stand/bootblock/Makefile.booters
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/stand/bootblock/elf2bb/Makefile
cvs rdiff -u -r1.7 -r1.8 \
src/sys/arch/amiga/stand/bootblock/installboot/Makefile
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amiga/stand/bootblock/txlt/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2016-06-11 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Jun 11 07:01:25 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: main.c

Log Message:
PR 51200 gets in libsa considered harmful: use kgets


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/amiga/stand/bootblock/boot/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2016-06-11 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Jun 11 07:01:25 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: main.c

Log Message:
PR 51200 gets in libsa considered harmful: use kgets


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/amiga/stand/bootblock/boot/main.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/amiga/stand/bootblock/boot/main.c
diff -u src/sys/arch/amiga/stand/bootblock/boot/main.c:1.30 src/sys/arch/amiga/stand/bootblock/boot/main.c:1.31
--- src/sys/arch/amiga/stand/bootblock/boot/main.c:1.30	Mon Jan  4 14:10:15 2016
+++ src/sys/arch/amiga/stand/bootblock/boot/main.c	Sat Jun 11 07:01:25 2016
@@ -1,5 +1,5 @@
 /*
- * $NetBSD: main.c,v 1.30 2016/01/04 14:10:15 phx Exp $
+ * $NetBSD: main.c,v 1.31 2016/06/11 07:01:25 dholland Exp $
  *
  *
  * Copyright (c) 1996,1999 Ignatios Souvatzis
@@ -164,7 +164,7 @@ again:
 	printf("\n");
 	printf("Boot: [%s] ", kernel_name);
 
-	gets(linebuf);
+	kgets(linebuf, sizeof(linebuf));
 
 	if (*linebuf == 'q')
 		return 1;



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2016-01-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Jan  4 14:10:15 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: amigatypes.h main.c

Log Message:
Make the -p option work, like with loadbsd.
Otherwise the kernel could load into a low-priority 512MB Z3 RAM segment.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amiga/stand/bootblock/boot/main.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/amiga/stand/bootblock/boot/amigatypes.h
diff -u src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h:1.7 src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h:1.8
--- src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h:1.7	Mon Apr 28 20:23:13 2008
+++ src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h	Mon Jan  4 14:10:15 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: amigatypes.h,v 1.7 2008/04/28 20:23:13 martin Exp $ */
+/* $NetBSD: amigatypes.h,v 1.8 2016/01/04 14:10:15 phx Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@ struct Library {
 struct MemHead {
 	struct MemHead *next;
 	u_int8_t Dmy1[  9-  4];
-	u_int8_t Pri;
+	int8_t Pri;
 	u_int8_t Dmy2[ 14- 10];
 	u_int16_t Attribs;
 	u_int32_t First, Lower, Upper, Free;

Index: src/sys/arch/amiga/stand/bootblock/boot/main.c
diff -u src/sys/arch/amiga/stand/bootblock/boot/main.c:1.29 src/sys/arch/amiga/stand/bootblock/boot/main.c:1.30
--- src/sys/arch/amiga/stand/bootblock/boot/main.c:1.29	Sat Mar 29 12:49:15 2014
+++ src/sys/arch/amiga/stand/bootblock/boot/main.c	Mon Jan  4 14:10:15 2016
@@ -1,5 +1,5 @@
 /*
- * $NetBSD: main.c,v 1.29 2014/03/29 12:49:15 mlelstv Exp $
+ * $NetBSD: main.c,v 1.30 2016/01/04 14:10:15 phx Exp $
  *
  *
  * Copyright (c) 1996,1999 Ignatios Souvatzis
@@ -122,6 +122,7 @@ pain(void *aio,	void *cons)
 	struct MemHead *mh;
 	u_int32_t from, size, vfrom, vsize;
 	int contflag, mapped1to1;
+	int8_t mempri;
 
 	int ncd, nseg;
 	char c;
@@ -200,7 +201,7 @@ again:
 	(get_number() & 3) << 1;
 	break;
 case 'p':	/* Select fastmem by priority */
-	p_flag++;
+	p_flag = 1;
 	break;
 case 'q':
 	boothowto |= AB_QUIET;
@@ -274,6 +275,7 @@ again:
 	vfrom = mh->Lower & -__PGSZ;
 	vsize = (mh->Upper & -__PGSZ) - vfrom;
 	contflag = mapped1to1 = 0;
+	mempri = -128;
 
 	do {
 		size = vsize;
@@ -318,9 +320,12 @@ again:
 			size += from;
 			cmemsz = size;
 			from = 0;
-		} else if ((fmemsz < size) && mapped1to1) {
+		} else if (mapped1to1 && ((!p_flag && fmemsz < size) ||
+		(p_flag && (mempri < mh->Pri ||
+		(mempri == mh->Pri && fmemsz < size) {
 			fmem = from;
 			fmemsz = size;
+			mempri = mh->Pri;
 		}
 
 		memseg[nseg].ms_start = from;



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2016-01-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Jan  4 14:10:15 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: amigatypes.h main.c

Log Message:
Make the -p option work, like with loadbsd.
Otherwise the kernel could load into a low-priority 512MB Z3 RAM segment.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amiga/stand/bootblock/boot/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/txlt

2015-02-03 Thread Aymeric Vincent
Module Name:src
Committed By:   aymeric
Date:   Tue Feb  3 19:58:42 UTC 2015

Modified Files:
src/sys/arch/amiga/stand/bootblock/txlt: Makefile txlt.l

Log Message:
. don't depend on -ll to provide a main() function. Lex on ArchLinux doesn't
  provide a libl
. still depend on -ll for the !HOSTPROG case for yywrap()
. ANSIfy


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/amiga/stand/bootblock/txlt/Makefile
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/amiga/stand/bootblock/txlt/txlt.l

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/amiga/stand/bootblock/txlt/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/txlt/Makefile:1.8 src/sys/arch/amiga/stand/bootblock/txlt/Makefile:1.9
--- src/sys/arch/amiga/stand/bootblock/txlt/Makefile:1.8	Sun Dec 11 12:16:36 2005
+++ src/sys/arch/amiga/stand/bootblock/txlt/Makefile	Tue Feb  3 19:58:41 2015
@@ -1,8 +1,12 @@
-#	$NetBSD: Makefile,v 1.8 2005/12/11 12:16:36 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2015/02/03 19:58:41 aymeric Exp $
 #
 PROG=txlt
 NOMAN=	# defined
-LDADD=-ll
 CLEANFILES+=	txlt.c
 
+.ifndef HOSTPROG
+LDADD+=		-ll
+DPADD+=		${LIBL}
+.endif
+
 .include bsd.prog.mk

Index: src/sys/arch/amiga/stand/bootblock/txlt/txlt.l
diff -u src/sys/arch/amiga/stand/bootblock/txlt/txlt.l:1.5 src/sys/arch/amiga/stand/bootblock/txlt/txlt.l:1.6
--- src/sys/arch/amiga/stand/bootblock/txlt/txlt.l:1.5	Mon Jun 20 20:25:47 2011
+++ src/sys/arch/amiga/stand/bootblock/txlt/txlt.l	Tue Feb  3 19:58:41 2015
@@ -7,14 +7,13 @@ pea[ 	][._A-Za-z][A-Za-z0-9_.]*$	{printf
 \ [._A-Za-z][A-Za-z0-9_.]*/\,		munchit(yytext);
 .	putchar(*yytext);
 %%
-/*	$NetBSD: txlt.l,v 1.5 2011/06/20 20:25:47 he Exp $	*/
+/*	$NetBSD: txlt.l,v 1.6 2015/02/03 19:58:41 aymeric Exp $	*/
 
 #include string.h
 
 void
-munchit(s)
-	char *s;
-{
+munchit(char *s) {
+
 	putchar(*s++);
 	if ((!strncmp(s, fp, 2) ||
 	!strncmp(s, sp, 2) ||
@@ -24,3 +23,11 @@ munchit(s)
 	else
 		printf(%%pc@(%s),s);
 }
+
+int
+main(void) {
+	while (yylex() != 0)
+		;
+
+	return 0;
+}



CVS commit: src/sys/arch/amiga/stand/bootblock/txlt

2015-02-03 Thread Aymeric Vincent
Module Name:src
Committed By:   aymeric
Date:   Tue Feb  3 19:58:42 UTC 2015

Modified Files:
src/sys/arch/amiga/stand/bootblock/txlt: Makefile txlt.l

Log Message:
. don't depend on -ll to provide a main() function. Lex on ArchLinux doesn't
  provide a libl
. still depend on -ll for the !HOSTPROG case for yywrap()
. ANSIfy


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/amiga/stand/bootblock/txlt/Makefile
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/amiga/stand/bootblock/txlt/txlt.l

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/bootxx_ffs

2014-04-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 29 08:11:46 UTC 2014

Modified Files:
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile

Log Message:
Specify both -march=68030 and -mcpu=68030 for assembler files here
as well.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/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/amiga/stand/bootblock/bootxx_ffs/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.21 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.22
--- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.21	Sat Mar 29 12:52:56 2014
+++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile	Tue Apr 29 08:11:46 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2014/03/29 12:52:56 mlelstv Exp $
+#	$NetBSD: Makefile,v 1.22 2014/04/29 08:11:46 martin Exp $
 
 ### what we need:
 
@@ -53,7 +53,7 @@ INCPATH += -I${.CURDIR}/../boot -I${.CUR
 INCPATH += -I${.CURDIR}/../elf2bb -I${.OBJDIR}
 
 AFLAGS += -m68030 -l
-CAFLAGS += -Wa,-l -Wa,-mcpu=68030 ${INCPATH} -D_PRIMARY_BOOT
+CAFLAGS += -Wa,-l -Wa,-march=68030 -Wa,-mcpu=68030 ${INCPATH} -D_PRIMARY_BOOT
 
 COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks
 COPTIM+= -Wa,-l -m68060 -Wa,-mcpu=68030 -fno-unwind-tables



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2014-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 19 00:04:12 UTC 2014

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile

Log Message:
unbreak gcc4.5


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/amiga/stand/bootblock/boot/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2014-04-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Apr 19 00:55:37 UTC 2014

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile

Log Message:
No need to use annoying HAVE_GCC to handle gcc48 m68k behavior chnages.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/amiga/stand/bootblock/boot/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2014-03-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar 29 12:49:15 UTC 2014

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: main.c

Log Message:
Test mode is not implemented. Appease compiler.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/amiga/stand/bootblock/boot/main.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/amiga/stand/bootblock/boot/main.c
diff -u src/sys/arch/amiga/stand/bootblock/boot/main.c:1.28 src/sys/arch/amiga/stand/bootblock/boot/main.c:1.29
--- src/sys/arch/amiga/stand/bootblock/boot/main.c:1.28	Sun Jul 10 21:02:38 2011
+++ src/sys/arch/amiga/stand/bootblock/boot/main.c	Sat Mar 29 12:49:15 2014
@@ -1,5 +1,5 @@
 /*
- * $NetBSD: main.c,v 1.28 2011/07/10 21:02:38 mhitch Exp $
+ * $NetBSD: main.c,v 1.29 2014/03/29 12:49:15 mlelstv Exp $
  *
  *
  * Copyright (c) 1996,1999 Ignatios Souvatzis
@@ -100,7 +100,7 @@ pain(void *aio,	void *cons)
 	int	p_flag = 0;
 	int	m_value = 0;
 	int	S_flag = 0;
-	int	t_flag = 0;
+	/* int	t_flag = 0; */
 
 	u_int32_t fmem = 0x0;
 	int	fmemsz = 0x0;
@@ -209,7 +209,7 @@ again:
 	boothowto |= RB_SINGLE;
 	break;
 case 't':	/* test flag */
-	t_flag = 1;
+	/* t_flag = 1; */
 	break;
 case 'v':
 	boothowto |= AB_VERBOSE;



CVS commit: src/sys/arch/amiga/stand/bootblock

2014-03-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar 29 12:52:56 UTC 2014

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile
src/sys/arch/amiga/stand/bootblock/ppcboot: Makefile

Log Message:
Use different option (-mcpu=68030) to select target cpu for the assembler.
The old option (-m68030) causes it to complain about features used that
are not provided by the target cpu.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.20 -r1.21 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
cvs rdiff -u -r1.11 -r1.12 \
src/sys/arch/amiga/stand/bootblock/ppcboot/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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.49 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.50
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.49	Wed Aug 21 08:04:50 2013
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Sat Mar 29 12:52:56 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.49 2013/08/21 08:04:50 matt Exp $
+#	$NetBSD: Makefile,v 1.50 2014/03/29 12:52:56 mlelstv Exp $
 
 .include bsd.own.mk
 .include bsd.sys.mk		# for HOST_SH
@@ -81,11 +81,11 @@ INCPATH += -I${.CURDIR}
 INCPATH += -I${.CURDIR}/../../.. -I${.OBJDIR}
 INCPATH += -I${.CURDIR}/../elf2bb
 
-AFLAGS += -m68030 -l
-CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH}
+AFLAGS += -mcpu=68030 -l
+CAFLAGS += -Wa,-l -Wa,-mcpu=68030 ${INCPATH}
 
 COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks
-COPTIM+= -Wa,-l -m68060 -Wa,-m68030 -fno-unwind-tables
+COPTIM+= -Wa,-l -m68060 -Wa,-mcpu=68030 -fno-unwind-tables
 CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS}
 CFLAGS+= -Werror
 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith

Index: src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.20 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.21
--- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.20	Wed Aug 21 08:04:50 2013
+++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile	Sat Mar 29 12:52:56 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20 2013/08/21 08:04:50 matt Exp $
+#	$NetBSD: Makefile,v 1.21 2014/03/29 12:52:56 mlelstv Exp $
 
 ### what we need:
 
@@ -53,10 +53,10 @@ INCPATH += -I${.CURDIR}/../boot -I${.CUR
 INCPATH += -I${.CURDIR}/../elf2bb -I${.OBJDIR}
 
 AFLAGS += -m68030 -l
-CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} -D_PRIMARY_BOOT
+CAFLAGS += -Wa,-l -Wa,-mcpu=68030 ${INCPATH} -D_PRIMARY_BOOT
 
 COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks
-COPTIM+= -Wa,-l -m68060 -Wa,-m68030 -fno-unwind-tables
+COPTIM+= -Wa,-l -m68060 -Wa,-mcpu=68030 -fno-unwind-tables
 CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes
 
 NETBSD_VERS!=	${HOST_SH} ${.CURDIR}/../../../../../conf/osrelease.sh

Index: src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile:1.11 src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile:1.12
--- src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile:1.11	Tue Mar 18 18:20:40 2014
+++ src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile	Sat Mar 29 12:52:56 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2014/03/18 18:20:40 riastradh Exp $
+#	$NetBSD: Makefile,v 1.12 2014/03/29 12:52:56 mlelstv Exp $
 
 ### what we need:
 
@@ -41,10 +41,10 @@ all: ${FILES}
 INCPATH = -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${DIR_BOOT} -I${.CURDIR} -I${.CURDIR}/../../.. -I${.CURDIR}/../elf2bb -I${.OBJDIR}
 
 AFLAGS += -m68030 -l
-CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH}
+CAFLAGS += -Wa,-l -Wa,-mcpu=68030 ${INCPATH}
 
 COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks
-COPTIM+= -Wa,-l -m68060 -Wa,-m68030 -fno-unwind-tables
+COPTIM+= -Wa,-l -m68060 -Wa,-mcpu=68030 -fno-unwind-tables
 CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes
 
 .c.o:



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2014-03-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar 29 12:49:15 UTC 2014

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: main.c

Log Message:
Test mode is not implemented. Appease compiler.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/amiga/stand/bootblock/boot/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2014-03-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar 29 12:52:56 UTC 2014

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile
src/sys/arch/amiga/stand/bootblock/ppcboot: Makefile

Log Message:
Use different option (-mcpu=68030) to select target cpu for the assembler.
The old option (-m68030) causes it to complain about features used that
are not provided by the target cpu.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.20 -r1.21 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
cvs rdiff -u -r1.11 -r1.12 \
src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:19:45 UTC 2014

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: printf.s

Log Message:
mark unused


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amiga/stand/bootblock/boot/printf.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/amiga/stand/bootblock/boot/printf.s
diff -u src/sys/arch/amiga/stand/bootblock/boot/printf.s:1.9 src/sys/arch/amiga/stand/bootblock/boot/printf.s:1.10
--- src/sys/arch/amiga/stand/bootblock/boot/printf.s:1.9	Fri Mar 21 21:52:44 2014
+++ src/sys/arch/amiga/stand/bootblock/boot/printf.s	Wed Mar 26 04:19:44 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: printf.s,v 1.9 2014/03/22 01:52:44 christos Exp $ */
+/* $NetBSD: printf.s,v 1.10 2014/03/26 08:19:44 christos Exp $ */
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@ Lstorech:
 	rts
 
 #ifdef notdef
-ENTRY_NOPROFILE(sprintf)
+ENTRY_NOPROFILE(unused_sprintf)
 	movml	#0x0032,%sp@-
 	movl	%sp@(16),%a3
 	lea	%pc@(Lstorech:w),%a2



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:19:45 UTC 2014

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: printf.s

Log Message:
mark unused


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amiga/stand/bootblock/boot/printf.s

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2013-08-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug 21 08:04:50 UTC 2013

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile

Log Message:
Use bsd.klinks.mk
Use ${_MKTARGET_*}
Use correct arguments to ${AR}
Fix entry symbol.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.19 -r1.20 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.48 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.49
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.48	Thu Jul 18 12:15:15 2013
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Wed Aug 21 08:04:50 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.48 2013/07/18 12:15:15 joerg Exp $
+#	$NetBSD: Makefile,v 1.49 2013/08/21 08:04:50 matt Exp $
 
 .include bsd.own.mk
 .include bsd.sys.mk		# for HOST_SH
@@ -66,11 +66,12 @@ DEFS+=	-DNETBSD_VERS='${NETBSD_VERS}'
 
 ### main target: ###
 
-realall: machine m68k ${FILES}
+realall: ${FILES}
 
-CLEANFILES += boot.amiga x.out xxstart.o libboot.a vers.c machine m68k
+CLEANFILES += boot.amiga x.out xxstart.o libboot.a vers.c
 
 .include bsd.prog.mk
+.include bsd.klinks.mk
 
 ### special  rules for bootblocks ###
 
@@ -93,47 +94,44 @@ CFLAGS+= -Wall -Wmissing-prototypes -Wst
 COPTS.cread.c = -O1
 
 .c.o:
+	${_MKTARGET_COMPILE}
 	${CC} ${CFLAGS} ${COPTS.${.IMPSRC:T}} -S $ -o $*.s
 	${TXLT}  $*.s | ${AS} ${AFLAGS} -o $@
 	rm $*.s
 
-.s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
-
-.S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
+.s.o:
+	${_MKTARGET_COMPILE}
+	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
+
+.S.o:
+	${_MKTARGET_COMPILE}
+	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
 
 boot.amiga: x.out
+	${_MKTARGET_CREATE}
 	${RELOC2BB} -S x.out $@ || (${NM} -u x.out  false)
 
 x.out: xxstart.o libboot.a ${LIBZ}
+	${_MKTARGET_LINK}
 	${LD} ${LDFLAGS} -r -dc -e start -o $@ $
 	${SIZE} $@
 	${NM} -u $@
 
 xxstart.o: ${.CURDIR}/bbstart.s
+	${_MKTARGET_COMPILE}
 	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
 		-o $@ -c $
 
 libboot.a: ${OBJS}
-	${AR} r $@ $  ${RANLIB} $@
+	${_MKTARGET_BUILD}
+	${AR} crs $@ $  ${RANLIB} $@
 
 vers.o: vers.c
 vers.c:	${.CURDIR}/version
+	${_MKTARGET_CREATE}
 	${HOST_SH} ${DIR_TOP}/conf/newvers_stand.sh \
 	${${MKREPRO} == yes :?:-D} -N ${.CURDIR}/version amiga
 
-.if !make(obj)  !make(clean)  !make(cleandir)
-.NOPATH: machine m68k
-.BEGIN: machine m68k
-
-machine:
-	-rm -f $@
-	ln -s ${DIR_TOP}/arch/amiga/include $@
-
-m68k:
-	-rm -f $@
-	ln -s ${DIR_TOP}/arch/m68k/include $@
-.endif
-
 # make sure these are built:
 
 ${COBJS}: ${TXLT}

Index: src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.19 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.20
--- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.19	Thu Jul 18 12:15:15 2013
+++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile	Wed Aug 21 08:04:50 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.19 2013/07/18 12:15:15 joerg Exp $
+#	$NetBSD: Makefile,v 1.20 2013/08/21 08:04:50 matt Exp $
 
 ### what we need:
 
@@ -39,11 +39,12 @@ DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER 
 
 ### main target: ###
 
-realall: machine m68k ${FILES}
+realall: ${FILES}
 
-CLEANFILES += bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a vers.c machine m68k
+CLEANFILES += bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a vers.c
 
 .include bsd.prog.mk
+.include bsd.klinks.mk
 
 ### special  rules for bootblocks ###
 
@@ -65,58 +66,58 @@ DEFS+=	-DNETBSD_VERS='${NETBSD_VERS}'
 DEFS+=	-D__daddr_t=int32_t
 
 .c.o:
+	${_MKTARGET_COMPILE}
 	${CC} ${CFLAGS} -S $ -o $*.s
 	${TXLT}  $*.s | ${AS} ${AFLAGS} -o $*.o
 	rm $*.s
 
-.s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
-
-.S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
+.s.o:
+	${_MKTARGET_COMPILE}
+	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
+
+.S.o:
+	${_MKTARGET_COMPILE}
+	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
 
 bootxx_ffs: x.out
+	${_MKTARGET_CREATE}
 	${RELOC2BB} x.out $@ || (${NM} -u x.out  false)
 
 bootxx_fd: f.out
+	${_MKTARGET_CREATE}
 	${RELOC2BB} -F f.out $@ || (${NM} -u f.out  false)
 
 x.out: xxstart.o libboot.a
-	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $
+	${_MKTARGET_LINK}
+	${LD} ${LDFLAGS} -r -dc -e start -o $@ $
 	${SIZE} $@
 	${NM} -u $@
 
 f.out: fdstart.o libboot.a
-	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $
+	${_MKTARGET_LINK}
+	${LD} ${LDFLAGS} -r -dc -e start -o $@ $
 	${SIZE} $@
 	${NM} -u $@
 
 xxstart.o: 

CVS commit: src/sys/arch/amiga/stand/bootblock

2013-08-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug 21 08:04:50 UTC 2013

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile

Log Message:
Use bsd.klinks.mk
Use ${_MKTARGET_*}
Use correct arguments to ${AR}
Fix entry symbol.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.19 -r1.20 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2011-10-03 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Tue Oct  4 04:04:15 UTC 2011

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile

Log Message:
build cread.c with -O1 to work around a gcc 4.5 bug.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/amiga/stand/bootblock/boot/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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.46 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.47
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.46	Tue Jul 12 03:09:03 2011
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Tue Oct  4 04:04:15 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.46 2011/07/12 03:09:03 mrg Exp $
+#	$NetBSD: Makefile,v 1.47 2011/10/04 04:04:15 chs Exp $
 
 .include bsd.own.mk
 .include bsd.sys.mk		# for HOST_SH
@@ -88,8 +88,11 @@ CFLAGS= -ffreestanding ${COPTIM} ${INCPA
 CFLAGS+= -Werror
 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
 
+# XXX work around a gcc 4.5 bug
+COPTS.cread.c = -O1
+
 .c.o:
-	${CC} ${CFLAGS} -S $ -o $*.s
+	${CC} ${CFLAGS} ${COPTS.${.IMPSRC:T}} -S $ -o $*.s
 	${TXLT}  $*.s | ${AS} ${AFLAGS} -o $@
 	rm $*.s
 



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2011-10-03 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Tue Oct  4 04:04:15 UTC 2011

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile

Log Message:
build cread.c with -O1 to work around a gcc 4.5 bug.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/amiga/stand/bootblock/boot/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/bootxx_ffs

2011-10-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct  2 18:30:50 UTC 2011

Modified Files:
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile

Log Message:
don't mark vers.c phony.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/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/amiga/stand/bootblock/bootxx_ffs/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.17 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.18
--- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.17	Mon Jul 11 23:09:03 2011
+++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile	Sun Oct  2 14:30:50 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2011/07/12 03:09:03 mrg Exp $
+#	$NetBSD: Makefile,v 1.18 2011/10/02 18:30:50 christos Exp $
 
 ### what we need:
 
@@ -99,7 +99,6 @@ fdstart.o: ${.CURDIR}/../boot//bbstart.s
 libboot.a: ${OBJS}
 	${AR} r $@ $  ${RANLIB} $@
 
-.PHONY:	vers.c
 vers.c:	${.CURDIR}/../boot/version
 	${HOST_SH} ${DIR_TOP}/conf/newvers_stand.sh -N \
 	${.CURDIR}/../boot/version amiga



CVS commit: src/sys/arch/amiga/stand/bootblock/bootxx_ffs

2011-10-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct  2 18:30:50 UTC 2011

Modified Files:
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile

Log Message:
don't mark vers.c phony.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2011-07-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Jul 12 03:09:03 UTC 2011

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile

Log Message:
fix previous and only force the failure if reloc2bb already failed.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.16 -r1.17 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.45 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.46
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.45	Mon Jul 11 01:24:34 2011
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Tue Jul 12 03:09:03 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.45 2011/07/11 01:24:34 mrg Exp $
+#	$NetBSD: Makefile,v 1.46 2011/07/12 03:09:03 mrg Exp $
 
 .include bsd.own.mk
 .include bsd.sys.mk		# for HOST_SH
@@ -98,7 +98,7 @@
 .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
 
 boot.amiga: x.out
-	${RELOC2BB} -S x.out $@ || ${NM} -u x.out  false
+	${RELOC2BB} -S x.out $@ || (${NM} -u x.out  false)
 
 x.out: xxstart.o libboot.a ${LIBZ}
 	${LD} ${LDFLAGS} -r -dc -e start -o $@ $

Index: src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.16 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.17
--- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.16	Mon Jul 11 01:24:34 2011
+++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile	Tue Jul 12 03:09:03 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.16 2011/07/11 01:24:34 mrg Exp $
+#	$NetBSD: Makefile,v 1.17 2011/07/12 03:09:03 mrg Exp $
 
 ### what we need:
 
@@ -73,10 +73,10 @@
 .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
 
 bootxx_ffs: x.out
-	${RELOC2BB} x.out $@ || ${NM} -u x.out  false
+	${RELOC2BB} x.out $@ || (${NM} -u x.out  false)
 
 bootxx_fd: f.out
-	${RELOC2BB} -F f.out $@ || ${NM} -u f.out  false
+	${RELOC2BB} -F f.out $@ || (${NM} -u f.out  false)
 
 x.out: xxstart.o libboot.a
 	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $



CVS commit: src/sys/arch/amiga/stand/bootblock

2011-07-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Jul 12 03:09:03 UTC 2011

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile

Log Message:
fix previous and only force the failure if reloc2bb already failed.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.16 -r1.17 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2011-07-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 11 01:24:34 UTC 2011

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
improve the error message if elf2bb finds we are too large.  if elf2bb
fails, make sure that the following nm -u's success doesn't cause make
to believe the target was built.  now amiga builds with HAVE_GCC=45
actually fail here, rather than fail at sets time due to missing files.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.15 -r1.16 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.44 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.45
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.44	Sat Jan 22 19:19:15 2011
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Mon Jul 11 01:24:34 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.44 2011/01/22 19:19:15 joerg Exp $
+#	$NetBSD: Makefile,v 1.45 2011/07/11 01:24:34 mrg Exp $
 
 .include bsd.own.mk
 .include bsd.sys.mk		# for HOST_SH
@@ -98,10 +98,10 @@
 .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
 
 boot.amiga: x.out
-	${RELOC2BB} -S x.out $@ || ${NM} -u x.out
+	${RELOC2BB} -S x.out $@ || ${NM} -u x.out  false
 
 x.out: xxstart.o libboot.a ${LIBZ}
-	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $
+	${LD} ${LDFLAGS} -r -dc -e start -o $@ $
 	${SIZE} $@
 	${NM} -u $@
 

Index: src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.15 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.16
--- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.15	Sat Jan 22 19:19:16 2011
+++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile	Mon Jul 11 01:24:34 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.15 2011/01/22 19:19:16 joerg Exp $
+#	$NetBSD: Makefile,v 1.16 2011/07/11 01:24:34 mrg Exp $
 
 ### what we need:
 
@@ -73,10 +73,10 @@
 .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
 
 bootxx_ffs: x.out
-	${RELOC2BB} x.out $@ || ${NM} -u x.out
+	${RELOC2BB} x.out $@ || ${NM} -u x.out  false
 
 bootxx_fd: f.out
-	${RELOC2BB} -F f.out $@ || ${NM} -u f.out
+	${RELOC2BB} -F f.out $@ || ${NM} -u f.out  false
 
 x.out: xxstart.o libboot.a
 	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $

Index: src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c
diff -u src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.15 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.16
--- src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c:1.15	Mon Apr 28 20:23:13 2008
+++ src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c	Mon Jul 11 01:24:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2bb.c,v 1.15 2008/04/28 20:23:13 martin Exp $	*/
+/*	$NetBSD: elf2bb.c,v 1.16 2011/07/11 01:24:34 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -208,7 +208,8 @@
 		 */
 		bbsize = 32768;
 		if (bbsize  (tsz + dsz + bsz)) {
-			err(1, %s: too big., argv[0]);
+			errx(1, %s: too big (%d  (%d + %d + %d)),
+			argv[0], bbsize, tsz, dsz, bsz);
 		}
 		sumsize = bbsize / 512;
 	}



CVS commit: src/sys/arch/amiga/stand/bootblock

2011-07-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 11 01:24:34 UTC 2011

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile
src/sys/arch/amiga/stand/bootblock/elf2bb: elf2bb.c

Log Message:
improve the error message if elf2bb finds we are too large.  if elf2bb
fails, make sure that the following nm -u's success doesn't cause make
to believe the target was built.  now amiga builds with HAVE_GCC=45
actually fail here, rather than fail at sets time due to missing files.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.15 -r1.16 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/amiga/stand/bootblock/elf2bb/elf2bb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/txlt

2011-06-20 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Mon Jun 20 20:25:47 UTC 2011

Modified Files:
src/sys/arch/amiga/stand/bootblock/txlt: txlt.l

Log Message:
Include string.h for strncmp() prototype.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amiga/stand/bootblock/txlt/txlt.l

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/amiga/stand/bootblock/txlt/txlt.l
diff -u src/sys/arch/amiga/stand/bootblock/txlt/txlt.l:1.4 src/sys/arch/amiga/stand/bootblock/txlt/txlt.l:1.5
--- src/sys/arch/amiga/stand/bootblock/txlt/txlt.l:1.4	Mon Dec 17 05:45:08 2001
+++ src/sys/arch/amiga/stand/bootblock/txlt/txlt.l	Mon Jun 20 20:25:47 2011
@@ -7,7 +7,9 @@
 \ [._A-Za-z][A-Za-z0-9_.]*/\,		munchit(yytext);
 .	putchar(*yytext);
 %%
-/*	$NetBSD: txlt.l,v 1.4 2001/12/17 05:45:08 mhitch Exp $	*/
+/*	$NetBSD: txlt.l,v 1.5 2011/06/20 20:25:47 he Exp $	*/
+
+#include string.h
 
 void
 munchit(s)



CVS commit: src/sys/arch/amiga/stand/bootblock/txlt

2011-06-20 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Mon Jun 20 20:25:47 UTC 2011

Modified Files:
src/sys/arch/amiga/stand/bootblock/txlt: txlt.l

Log Message:
Include string.h for strncmp() prototype.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amiga/stand/bootblock/txlt/txlt.l

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock

2010-07-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Jul  6 06:09:57 UTC 2010

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile
src/sys/arch/amiga/stand/bootblock/installboot: Makefile installboot.c
src/sys/arch/amiga/stand/bootblock/ppcboot: Makefile

Log Message:
use elf2bb / elf2bb.h instead of the old, now gone aout2bb version.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.13 -r1.14 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
cvs rdiff -u -r1.6 -r1.7 \
src/sys/arch/amiga/stand/bootblock/installboot/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/sys/arch/amiga/stand/bootblock/installboot/installboot.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/amiga/stand/bootblock/ppcboot/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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.42 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.43
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.42	Sun Mar 14 00:26:10 2010
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Tue Jul  6 06:09:56 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.42 2010/03/14 00:26:10 mrg Exp $
+#	$NetBSD: Makefile,v 1.43 2010/07/06 06:09:56 mrg Exp $
 
 .include bsd.sys.mk		# for HOST_SH
 
@@ -77,7 +77,7 @@
 INCPATH += -I${DIR_TOP}/../common/dist/zlib
 INCPATH += -I${.CURDIR}
 INCPATH += -I${.CURDIR}/../../.. -I${.OBJDIR}
-INCPATH += -I${.CURDIR}/../aout2bb
+INCPATH += -I${.CURDIR}/../elf2bb
 
 AFLAGS += -m68030 -l
 CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH}
@@ -89,7 +89,7 @@
 
 .c.o:
 	${CC} ${CFLAGS} -S $ -o $*.s
-	${TXLT}  $*.s | ${AS} ${AFLAGS} -o $*.o
+	${TXLT}  $*.s | ${AS} ${AFLAGS} -o $@
 	rm $*.s
 
 .s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $
@@ -111,7 +111,7 @@
 libboot.a: ${OBJS}
 	${AR} r $@ $  ${RANLIB} $@
 
-.PHONY:	vers.c
+vers.o: vers.c
 vers.c:	${.CURDIR}/version
 	${HOST_SH} ${DIR_TOP}/conf/newvers_stand.sh -N ${.CURDIR}/version amiga
 

Index: src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.13 src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.14
--- src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile:1.13	Sun Mar 14 00:26:10 2010
+++ src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile	Tue Jul  6 06:09:57 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2010/03/14 00:26:10 mrg Exp $
+#	$NetBSD: Makefile,v 1.14 2010/07/06 06:09:57 mrg Exp $
 
 ### what we need:
 
@@ -49,7 +49,7 @@
 
 INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR}
 INCPATH += -I${.CURDIR}/../boot -I${.CURDIR}/../../..
-INCPATH += -I${.CURDIR}/../aout2bb -I${.OBJDIR}
+INCPATH += -I${.CURDIR}/../elf2bb -I${.OBJDIR}
 
 AFLAGS += -m68030 -l
 CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} -D_PRIMARY_BOOT

Index: src/sys/arch/amiga/stand/bootblock/installboot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/installboot/Makefile:1.6 src/sys/arch/amiga/stand/bootblock/installboot/Makefile:1.7
--- src/sys/arch/amiga/stand/bootblock/installboot/Makefile:1.6	Tue Jan 29 18:46:11 2002
+++ src/sys/arch/amiga/stand/bootblock/installboot/Makefile	Tue Jul  6 06:09:57 2010
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.6 2002/01/29 18:46:11 aymeric Exp $
+#	$NetBSD: Makefile,v 1.7 2010/07/06 06:09:57 mrg Exp $
 PROG=installboot
 SRCS=installboot.c chksum.c
 BINDIR=/usr/mdec
 
 NOMAN=	# defined
 
-.PATH:	${.CURDIR}/../aout2bb	# chksum.c
+.PATH:	${.CURDIR}/../elf2bb	# chksum.c
 
 .include bsd.prog.mk

Index: src/sys/arch/amiga/stand/bootblock/installboot/installboot.c
diff -u src/sys/arch/amiga/stand/bootblock/installboot/installboot.c:1.4 src/sys/arch/amiga/stand/bootblock/installboot/installboot.c:1.5
--- src/sys/arch/amiga/stand/bootblock/installboot/installboot.c:1.4	Mon Mar 26 23:08:29 2007
+++ src/sys/arch/amiga/stand/bootblock/installboot/installboot.c	Tue Jul  6 06:09:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: installboot.c,v 1.4 2007/03/26 23:08:29 hubertf Exp $	*/
+/*	$NetBSD: installboot.c,v 1.5 2010/07/06 06:09:57 mrg Exp $	*/
 
 #include err.h
 #include fcntl.h
@@ -7,7 +7,7 @@
 #include string.h
 #include unistd.h
 
-#include ../aout2bb/chksum.h
+#include ../elf2bb/chksum.h
 
 /* XXX Must be kept in sync with bbstart.s! */
 #define CMDLN_LOC 0x10

Index: src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile:1.8 src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile:1.9
--- src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile:1.8	Sun Mar 14 00:26:10 2010
+++ src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile	Tue Jul  6 06:09:57 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2010/03/14 00:26:10 mrg Exp $
+#	$NetBSD: Makefile,v 1.9 2010/07/06 

CVS commit: src/sys/arch/amiga/stand/bootblock

2010-07-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Jul  6 06:09:57 UTC 2010

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile
src/sys/arch/amiga/stand/bootblock/bootxx_ffs: Makefile
src/sys/arch/amiga/stand/bootblock/installboot: Makefile installboot.c
src/sys/arch/amiga/stand/bootblock/ppcboot: Makefile

Log Message:
use elf2bb / elf2bb.h instead of the old, now gone aout2bb version.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.13 -r1.14 \
src/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
cvs rdiff -u -r1.6 -r1.7 \
src/sys/arch/amiga/stand/bootblock/installboot/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/sys/arch/amiga/stand/bootblock/installboot/installboot.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/amiga/stand/bootblock/ppcboot/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2009-10-17 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Oct 17 11:18:18 UTC 2009

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: Makefile console.c libstubs.h
libstubs.s

Log Message:
Add a serial console mode for the bootblock. In this mode all console
output will be echoed to the serial port and input will be accepted
from either keyboard or serial port. The bootblock serial console is
limited to 9600bps 8N1 as it uses the AmigaOS kernel debug routines.

To enable this you have to uncomment the SERCONSOLE define in
boot/Makefile.

Also note that the handling of a serial console in the kernel is
independent of this, you need to a build a kernel with 'options
SERCONSOLE'.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/amiga/stand/bootblock/boot/Makefile
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/amiga/stand/bootblock/boot/console.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amiga/stand/bootblock/boot/libstubs.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amiga/stand/bootblock/boot/libstubs.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/amiga/stand/bootblock/boot/Makefile
diff -u src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.39 src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.40
--- src/sys/arch/amiga/stand/bootblock/boot/Makefile:1.39	Mon Jan 12 07:42:30 2009
+++ src/sys/arch/amiga/stand/bootblock/boot/Makefile	Sat Oct 17 11:18:17 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.39 2009/01/12 07:42:30 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.40 2009/10/17 11:18:17 mlelstv Exp $
 
 .include bsd.sys.mk		# for HOST_SH
 
@@ -51,6 +51,7 @@
 #XX#DEFS = -D_STANDALONE -DINSECURE -DDYNAMIC_CRC_TABLE -DNOBYFOUR -UBYFOUR 
 DEFS = -D_STANDALONE -DINSECURE 
 DEFS += -D__INTERNAL_LIBSA_CREAD
+#DEFS += -DSERCONSOLE
 SOBJS += cread.o
 
 #XX#SOBJS += adler32.o crc32.o inflate.o trees.o \

Index: src/sys/arch/amiga/stand/bootblock/boot/console.c
diff -u src/sys/arch/amiga/stand/bootblock/boot/console.c:1.12 src/sys/arch/amiga/stand/bootblock/boot/console.c:1.13
--- src/sys/arch/amiga/stand/bootblock/boot/console.c:1.12	Sun Oct 11 10:00:10 2009
+++ src/sys/arch/amiga/stand/bootblock/boot/console.c	Sat Oct 17 11:18:18 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: console.c,v 1.12 2009/10/11 10:00:10 mlelstv Exp $ */
+/* $NetBSD: console.c,v 1.13 2009/10/17 11:18:18 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -115,6 +115,10 @@
 	if (OpenDevice(timer.device, 0, (struct AmigaIO*)mc-tmior, 0))
 		goto err;
 
+#ifdef SERCONSOLE
+	RawIOInit();
+#endif
+
 	ConsoleBase = mc;
 	return 0;
 
@@ -183,6 +187,11 @@
 	mc-cnior-length = 1;
 	mc-cnior-buf = buf;
 	mc-cnior-cmd = Cmd_Wr;
+
+#ifdef SERCONSOLE
+	RawPutChar((int32_t)c);
+#endif
+
 	(void)DoIO(mc-cnior);
 }
 
@@ -194,6 +203,12 @@
 	mc-cnior-length = -1;
 	mc-cnior-buf = s;
 	mc-cnior-cmd = Cmd_Wr;
+
+#ifdef SERCONSOLE
+	while (*s)
+		RawPutChar(*s++);
+#endif
+
 	(void)DoIO(mc-cnior);
 }
 
@@ -201,8 +216,12 @@
 getchar(void)
 {
 	struct AmigaIO *ior;
-	char c = -1;
+	char c = '\n';
 	struct Console *mc = ConsoleBase;
+	unsigned long ticks;
+#ifdef SERCONSOLE
+	int32_t r;
+#endif
 
 	mc-cnior-length = 1;
 	mc-cnior-buf = c;
@@ -210,22 +229,37 @@
 
 	SendIO(mc-cnior);
 
-	if (timelimit) {
+	ticks = 10 * timelimit;
+	do {
+		if (timelimit == 0)
+			ticks = 2;
+
 		mc-tmior-cmd = Cmd_Addtimereq;
-		mc-tmior-secs = timelimit;
-		mc-tmior-usec = 2; /* Paranoid */
+		mc-tmior-secs = 0;
+		mc-tmior-usec = 10;
 		SendIO((struct AmigaIO *)mc-tmior);
 
 		ior = WaitPort(mc-cnmp);
-		if (ior == mc-cnior)
+		if (ior == mc-cnior) {
 			AbortIO((struct AmigaIO *)mc-tmior);
-		else /* if (ior == mc-tmior) */ {
-			AbortIO(mc-cnior);
-			c = '\n';
+			ticks = 1;
+		} else /* if (ior == mc-tmior) */ {
+#ifdef SERCONSOLE
+			r = RawMayGetChar();
+			if (r != -1) {
+c = r;
+ticks = 1;
+			}
+#endif
+			if (ticks == 1)
+AbortIO((struct AmigaIO *)mc-cnior);
 		}
 		WaitIO((struct AmigaIO *)mc-tmior);
-		timelimit = 0;
-	}
+
+		--ticks;
+	} while (ticks != 0);
+	timelimit = 0;
+
 	(void)WaitIO(mc-cnior);
 	return c;
 }

Index: src/sys/arch/amiga/stand/bootblock/boot/libstubs.h
diff -u src/sys/arch/amiga/stand/bootblock/boot/libstubs.h:1.6 src/sys/arch/amiga/stand/bootblock/boot/libstubs.h:1.7
--- src/sys/arch/amiga/stand/bootblock/boot/libstubs.h:1.6	Mon Apr 28 20:23:13 2008
+++ src/sys/arch/amiga/stand/bootblock/boot/libstubs.h	Sat Oct 17 11:18:18 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: libstubs.h,v 1.6 2008/04/28 20:23:13 martin Exp $ */
+/* $NetBSD: libstubs.h,v 1.7 2009/10/17 11:18:18 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -55,6 +55,10 @@
 void AbortIO(struct AmigaIO *);
 u_int8_t WaitIO(struct AmigaIO *);
 
+void RawIOInit(void);
+int32_t RawPutChar(int32_t c);
+int32_t RawMayGetChar(void);
+
 int OpenDevice(const char *, u_int32_t, struct AmigaIO *, u_int32_t);
 

CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2009-10-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Oct 11 10:00:10 UTC 2009

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: console.c

Log Message:
AmigaOS console.device expects a character buffer, not a pointer to an int.
This fixes printf() output.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/amiga/stand/bootblock/boot/console.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/amiga/stand/bootblock/boot/console.c
diff -u src/sys/arch/amiga/stand/bootblock/boot/console.c:1.11 src/sys/arch/amiga/stand/bootblock/boot/console.c:1.12
--- src/sys/arch/amiga/stand/bootblock/boot/console.c:1.11	Wed Mar 18 10:22:23 2009
+++ src/sys/arch/amiga/stand/bootblock/boot/console.c	Sun Oct 11 10:00:10 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: console.c,v 1.11 2009/03/18 10:22:23 cegger Exp $ */
+/* $NetBSD: console.c,v 1.12 2009/10/11 10:00:10 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -178,9 +178,10 @@
 putchar(int c)
 {
 	struct Console *mc = ConsoleBase;
+	char buf = c;
 
 	mc-cnior-length = 1;
-	mc-cnior-buf = c;
+	mc-cnior-buf = buf;
 	mc-cnior-cmd = Cmd_Wr;
 	(void)DoIO(mc-cnior);
 }