Module Name: src Committed By: riz Date: Mon Sep 23 14:20:42 UTC 2013
Modified Files: src/sys/arch/mvme68k/include [netbsd-6]: prom.h src/sys/arch/mvme68k/stand [netbsd-6]: Makefile.booters src/sys/arch/mvme68k/stand/libbug [netbsd-6]: outln.c outstr.c src/sys/arch/mvme68k/stand/libsa [netbsd-6]: Makefile Makefile.inc Log Message: Pull up following revision(s) (requested by tsutsui in ticket #954): sys/arch/mvme68k/stand/libbug/outln.c: revision 1.4 sys/arch/mvme68k/stand/libsa/Makefile.inc: revision 1.6 sys/arch/mvme68k/stand/Makefile.booters: revision 1.24 sys/arch/mvme68k/include/prom.h: revision 1.18 sys/arch/mvme68k/stand/libsa/Makefile: revision 1.34 sys/arch/mvme68k/stand/libbug/outstr.c: revision 1.4 Explicitly link SRT0.o (Standalone RunTime startup code) first. This is my fault on changes to make mvme68k bootloaders use MI libsa: http://mail-index.netbsd.org/source-changes/2011/01/02/msg016539.html MVME PROM requires raw binaries (by objcopy -O binary) so we have to make sure the entry point is located at the first address of the binaries. The problem (6.1 netboot fails with an illegal instruction message) is reported by Andrew Gillham on port-mvme68k@: http://mail-index.netbsd.org/port-mvme68k/2013/09/17/msg000082.html Note mvme68k bootloadres in netbsd-6 still have another bug triggered by gcc-4.5. Should be pulled up to netbsd-6 branches. Make MVMEPROM_ARG2() macro take two args in a single asm statement. Fixes a problem that a wrong address is passed to the MVMEPROM outstr function (then caused garbages on screen) after we switched to gcc-4.5. Reported and confirmed by Andrew Gillham on port-mvme68k@: http://mail-index.NetBSD.org/port-mvme68k/2013/09/17/msg000084.html http://mail-index.NetBSD.org/port-mvme68k/2013/09/19/msg000085.html http://mail-index.NetBSD.org/port-mvme68k/2013/09/22/msg000095.html http://mail-index.NetBSD.org/port-mvme68k/2013/09/22/msg000097.html No error on "build.sh -m mvme68k build" builds. Should be pulled up to netbsd-6 branches. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.17.118.1 src/sys/arch/mvme68k/include/prom.h cvs rdiff -u -r1.22 -r1.22.10.1 src/sys/arch/mvme68k/stand/Makefile.booters cvs rdiff -u -r1.3 -r1.3.50.1 src/sys/arch/mvme68k/stand/libbug/outln.c \ src/sys/arch/mvme68k/stand/libbug/outstr.c cvs rdiff -u -r1.33 -r1.33.14.1 src/sys/arch/mvme68k/stand/libsa/Makefile cvs rdiff -u -r1.5 -r1.5.14.1 src/sys/arch/mvme68k/stand/libsa/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/mvme68k/include/prom.h diff -u src/sys/arch/mvme68k/include/prom.h:1.17 src/sys/arch/mvme68k/include/prom.h:1.17.118.1 --- src/sys/arch/mvme68k/include/prom.h:1.17 Sat Dec 24 23:24:01 2005 +++ src/sys/arch/mvme68k/include/prom.h Mon Sep 23 14:20:42 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: prom.h,v 1.17 2005/12/24 23:24:01 perry Exp $ */ +/* $NetBSD: prom.h,v 1.17.118.1 2013/09/23 14:20:42 riz Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -155,8 +155,10 @@ struct mvmeprom_args { __asm volatile ("clrl %sp@-") #define MVMEPROM_ARG1(arg) \ __asm volatile ("movel %0, %%sp@-"::"d" (arg)) -#define MVMEPROM_ARG2(arg) \ - __asm volatile ("movel %0, %%sp@-"::"d" (arg)) +#define MVMEPROM_ARG2(arg0, arg1) \ + __asm volatile ("movel %0, %%sp@-;" \ + "movel %1, %%sp@-;" \ + :: "d" (arg0), "d" (arg1):) #define MVMEPROM_GETRES(ret) \ __asm volatile ("movel %%sp@+,%0": "=d" (ret):) #define MVMEPROM_GETSR(ret) \ Index: src/sys/arch/mvme68k/stand/Makefile.booters diff -u src/sys/arch/mvme68k/stand/Makefile.booters:1.22 src/sys/arch/mvme68k/stand/Makefile.booters:1.22.10.1 --- src/sys/arch/mvme68k/stand/Makefile.booters:1.22 Sat Jan 22 19:19:20 2011 +++ src/sys/arch/mvme68k/stand/Makefile.booters Mon Sep 23 14:20:42 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.booters,v 1.22 2011/01/22 19:19:20 joerg Exp $ +# $NetBSD: Makefile.booters,v 1.22.10.1 2013/09/23 14:20:42 riz Exp $ S?= ${.CURDIR}/../../../.. MDEC_DIR?= /usr/mdec @@ -59,6 +59,8 @@ LIBSA_DIR!= cd ${LIB_SA_DIR} && ${PRINTO LIBSA= ${LIBSA_DIR}/lib/sa/libsa.a LIBKERN= ${LIBSA_DIR}/lib/kern/libkern.a +SRTOBJ?= ${LIBSA_DIR}/SRT0.o + LIB_BUG_DIR= ${.CURDIR}/../libbug LIBBUG_DIR!= cd ${LIB_BUG_DIR} && ${PRINTOBJDIR} LIBBUG=${LIBBUG_DIR}/libbug.a Index: src/sys/arch/mvme68k/stand/libbug/outln.c diff -u src/sys/arch/mvme68k/stand/libbug/outln.c:1.3 src/sys/arch/mvme68k/stand/libbug/outln.c:1.3.50.1 --- src/sys/arch/mvme68k/stand/libbug/outln.c:1.3 Sat Jan 12 09:54:31 2008 +++ src/sys/arch/mvme68k/stand/libbug/outln.c Mon Sep 23 14:20:42 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: outln.c,v 1.3 2008/01/12 09:54:31 tsutsui Exp $ */ +/* $NetBSD: outln.c,v 1.3.50.1 2013/09/23 14:20:42 riz Exp $ */ /* * bug routines -- assumes that the necessary sections of memory @@ -13,7 +13,6 @@ void mvmeprom_outln(char *start, char *end) { - MVMEPROM_ARG1(end); - MVMEPROM_ARG2(start); + MVMEPROM_ARG2(end, start); MVMEPROM_CALL(MVMEPROM_OUTSTRCRLF); } Index: src/sys/arch/mvme68k/stand/libbug/outstr.c diff -u src/sys/arch/mvme68k/stand/libbug/outstr.c:1.3 src/sys/arch/mvme68k/stand/libbug/outstr.c:1.3.50.1 --- src/sys/arch/mvme68k/stand/libbug/outstr.c:1.3 Sat Jan 12 09:54:31 2008 +++ src/sys/arch/mvme68k/stand/libbug/outstr.c Mon Sep 23 14:20:42 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: outstr.c,v 1.3 2008/01/12 09:54:31 tsutsui Exp $ */ +/* $NetBSD: outstr.c,v 1.3.50.1 2013/09/23 14:20:42 riz Exp $ */ /* * bug routines -- assumes that the necessary sections of memory @@ -13,7 +13,6 @@ void mvmeprom_outstr(char *start, char *end) { - MVMEPROM_ARG1(end); - MVMEPROM_ARG2(start); + MVMEPROM_ARG2(end, start); MVMEPROM_CALL(MVMEPROM_OUTSTR); } Index: src/sys/arch/mvme68k/stand/libsa/Makefile diff -u src/sys/arch/mvme68k/stand/libsa/Makefile:1.33 src/sys/arch/mvme68k/stand/libsa/Makefile:1.33.14.1 --- src/sys/arch/mvme68k/stand/libsa/Makefile:1.33 Sun Jan 2 05:30:12 2011 +++ src/sys/arch/mvme68k/stand/libsa/Makefile Mon Sep 23 14:20:42 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.33 2011/01/02 05:30:12 tsutsui Exp $ +# $NetBSD: Makefile,v 1.33.14.1 2013/09/23 14:20:42 riz Exp $ S!= cd ${.CURDIR}/../../../..; pwd @@ -31,7 +31,9 @@ LIBKERN= ${KERNLIB} LIBS= ${LIBSA} ${LIBKERN} -all realall: ${LIBS} +CLEANFILES+= SRT0.o + +all realall: ${LIBS} SRT0.o cleandir distclean: .WAIT cleanlibdir Index: src/sys/arch/mvme68k/stand/libsa/Makefile.inc diff -u src/sys/arch/mvme68k/stand/libsa/Makefile.inc:1.5 src/sys/arch/mvme68k/stand/libsa/Makefile.inc:1.5.14.1 --- src/sys/arch/mvme68k/stand/libsa/Makefile.inc:1.5 Sun Jan 2 05:30:12 2011 +++ src/sys/arch/mvme68k/stand/libsa/Makefile.inc Mon Sep 23 14:20:42 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.5 2011/01/02 05:30:12 tsutsui Exp $ +# $NetBSD: Makefile.inc,v 1.5.14.1 2013/09/23 14:20:42 riz Exp $ S!= cd ${SA_EXTRADIR}/../../../..; pwd @@ -9,8 +9,7 @@ SRC_sa= dev_net.c SRC_mvme= exec_mvme.c -SRC_here= SRT0.S \ - bugdev.c \ +SRC_here= bugdev.c \ chiptotime.c clock.c \ parse_args.c