Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/arch/x68k/stand Pull up following revision(s) (reques...



details:   https://anonhg.NetBSD.org/src/rev/b571674b9a30
branches:  netbsd-6
changeset: 773995:b571674b9a30
user:      riz <riz%NetBSD.org@localhost>
date:      Mon Apr 09 18:08:31 2012 +0000

description:
Pull up following revision(s) (requested by isaki in ticket #171):
        sys/arch/x68k/stand/mboot/mboot.c: revision 1.10
        sys/arch/x68k/stand/mboot/Makefile: revision 1.16
        sys/arch/x68k/stand/Makefile: revision 1.9
Use common library libiocs.a.  suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
  its expansion corrupted (from somewhere after branching netbsd-5).
  This solves PR#46293 by using the common library.
  This problem was reported by Y.Sugahara at NetBSD booth at
  Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
  IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.
mboot now depends on libiocs. noticed by tsutsui@.

diffstat:

 sys/arch/x68k/stand/Makefile       |   6 +-
 sys/arch/x68k/stand/mboot/Makefile |  12 +++-
 sys/arch/x68k/stand/mboot/mboot.c  |  97 +------------------------------------
 3 files changed, 14 insertions(+), 101 deletions(-)

diffs (172 lines):

diff -r 5ace6e64bcc5 -r b571674b9a30 sys/arch/x68k/stand/Makefile
--- a/sys/arch/x68k/stand/Makefile      Mon Apr 09 18:05:28 2012 +0000
+++ b/sys/arch/x68k/stand/Makefile      Mon Apr 09 18:08:31 2012 +0000
@@ -1,6 +1,6 @@
-#      $NetBSD: Makefile,v 1.8 2002/01/27 01:07:00 minoura Exp $
+#      $NetBSD: Makefile,v 1.8.162.1 2012/04/09 18:08:32 riz Exp $
 
-SUBDIR= mboot newdisk aout2hux libdos libiocs .WAIT loadbsd # common
-SUBDIR+= libsa .WAIT boot boot_ufs boot_ustar installboot
+SUBDIR= newdisk aout2hux libdos libiocs .WAIT loadbsd # common
+SUBDIR+= libsa .WAIT mboot boot boot_ufs boot_ustar installboot
 
 .include <bsd.subdir.mk>
diff -r 5ace6e64bcc5 -r b571674b9a30 sys/arch/x68k/stand/mboot/Makefile
--- a/sys/arch/x68k/stand/mboot/Makefile        Mon Apr 09 18:05:28 2012 +0000
+++ b/sys/arch/x68k/stand/mboot/Makefile        Mon Apr 09 18:08:31 2012 +0000
@@ -1,4 +1,7 @@
-#      $NetBSD: Makefile,v 1.15 2009/01/12 07:56:31 tsutsui Exp $
+#      $NetBSD: Makefile,v 1.15.20.1 2012/04/09 18:08:31 riz Exp $
+
+NOMAN=         # defined
+.include <bsd.own.mk>
 
 BOOT=          mboot
 VERSION=       0.1
@@ -10,7 +13,6 @@
 PROG=          ${BOOT}
 BINDIR=                /usr/mdec
 BINMODE=       444
-NOMAN=         # defined
 STRIPFLAG=
 
 STRIP?=                /usr/bin/strip
@@ -20,17 +22,19 @@
 
 CPPFLAGS+=     -D_STANDALONE
 CPPFLAGS+=     -nostdinc -I${KERN} -I${.CURDIR} -I.
-#CPPFLAGS+=    -I${.CURDIR}/../libiocs
+CPPFLAGS+=     -I${.CURDIR}/../libiocs
 CPPFLAGS+=     -DTEXTADDR="0x${TEXT}" 
 CPPFLAGS+=     -DBOOT=\"${BOOT}\" -DBOOT_VERS=\"${VERSION}\"
 CFLAGS=                -Wno-main -Os -m68000
 
 LINKFLAGS=     -N -static -Ttext ${TEXT}
+LIBIOCS!=      cd ${.CURDIR}/../libiocs && ${PRINTOBJDIR}
+LDLIBS+=       ${LIBIOCS}/libiocs.a
 
 .include "../Makefile.booters"
 
 realall: ${PROG}
-${BOOT}:       ${OBJS}
+${BOOT}:       ${OBJS} ${LDLIBS}
        ${_MKTARGET_LINK}
        ${LD} ${LINKFLAGS} -o ${BOOT}.x ${OBJS} ${LDLIBS}
 #      ${STRIP} ${BOOT}.x
diff -r 5ace6e64bcc5 -r b571674b9a30 sys/arch/x68k/stand/mboot/mboot.c
--- a/sys/arch/x68k/stand/mboot/mboot.c Mon Apr 09 18:05:28 2012 +0000
+++ b/sys/arch/x68k/stand/mboot/mboot.c Mon Apr 09 18:08:31 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mboot.c,v 1.9 2011/10/01 15:59:01 chs Exp $    */
+/*     $NetBSD: mboot.c,v 1.9.8.1 2012/04/09 18:08:31 riz Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -32,105 +32,14 @@
 #include <sys/types.h>
 #include <machine/disklabel.h>
 
-int bootmain(int);
-
-struct iocs_readcap {
-       unsigned long   block;
-       unsigned long   size;
-};
-static inline int
-IOCS_BITSNS (int row)
-{
-       register unsigned int reg_d0 __asm ("%d0");
-
-       __asm volatile ("movel %1,%%d1\n\t"
-                         "movel #0x04,%0\n\t"
-                         "trap #15"
-                         : "=d" (reg_d0)
-                         : "ri" ((int) row)
-                         : "%d1");
-
-       return reg_d0;
-}
-static inline void
-IOCS_B_PRINT (const char *str)
-{
-       __asm volatile ("moval %0,%%a1\n\t"
-                         "movel #0x21,%%d0\n\t"
-                         "trap #15\n\t"
-                         :
-                         : "a" ((int) str)
-                         : "%a1", "%d0");
-       return;
-}
-static inline int
-IOCS_S_READCAP (int id, struct iocs_readcap *cap)
-{
-       register int reg_d0 __asm ("%d0");
+#include "iocs.h"
 
-       __asm volatile ("moveml %%d4,%%sp@-\n\t"
-                         "movel %2,%%d4\n\t"
-                         "moval %3,%%a1\n\t"
-                         "movel #0x25,%%d1\n\t"
-                         "movel #0xf5,%%d0\n\t"
-                         "trap #15\n\t"
-                         "moveml %%sp@+,%%d4"
-                         : "=d" (reg_d0), "=m" (*cap)
-                         : "ri" (id), "g" ((int) cap)
-                         : "%d1", "%a1");
-
-       return reg_d0;
-}
-static inline int
-IOCS_S_READ (int pos, int blk, int id, int size, void *buf)
-{
-       register int reg_d0 __asm ("%d0");
-
-       __asm volatile ("moveml %%d3-%%d5,%%sp@-\n\t"
-                         "movel %2,%%d2\n\t"
-                         "movel %3,%%d3\n\t"
-                         "movel %4,%%d4\n\t"
-                         "movel %5,%%d5\n\t"
-                         "moval %6,%%a1\n\t"
-                         "movel #0x26,%%d1\n\t"
-                         "movel #0xf5,%%d0\n\t"
-                         "trap #15\n\t"
-                         "moveml %%sp@+,%%d3-%%d5"
-                         : "=d" (reg_d0), "=m" (*(char*) buf)
-                         : "ri" (pos), "ri" (blk), "ri" (id), "ri" (size), "g" ((int) buf)
-                         : "%d1", "%d2", "%a1");
-
-       return reg_d0;
-}
-
-static inline int
-IOCS_S_READEXT (int pos, int blk, int id, int size, void *buf)
-{
-       register int reg_d0 __asm ("%d0");
-
-       __asm volatile ("moveml %%d3-%%d5,%%sp@-\n\t"
-                         "movel %2,%%d2\n\t"
-                         "movel %3,%%d3\n\t"
-                         "movel %4,%%d4\n\t"
-                         "movel %5,%%d5\n\t"
-                         "moval %6,%%a1\n\t"
-                         "movel #0x26,%%d1\n\t"
-                         "movel #0xf5,%%d0\n\t"
-                         "trap #15\n\t"
-                         "moveml %%sp@+,%%d3-%%d5"
-                         : "=d" (reg_d0), "=m" (*(char*) buf)
-                         : "ri" (pos), "ri" (blk), "ri" (id), "ri" (size), "g" ((int) buf)
-                         : "%d1", "%d2", "%a1");
-
-       return reg_d0;
-}
+int bootmain(int);
 
 #define PART_BOOTABLE  0
 #define PART_UNUSED    1
 #define PART_INUSE     2
 
-
-
 int
 bootmain(int scsiid)
 {



Home | Main Index | Thread Index | Old Index