Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x68k/stand Make x68k bootloader to use MI libsa, li...



details:   https://anonhg.NetBSD.org/src/rev/182c6b9959ff
branches:  trunk
changeset: 764146:182c6b9959ff
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Tue Apr 12 14:07:35 2011 +0000

description:
Make x68k bootloader to use MI libsa, libkern, and libz Makefiles in
src/sys/lib dirs for maintainability.  Tested on X68030, ok from isaki@.

diffstat:

 sys/arch/x68k/stand/boot/Makefile      |   8 ++-
 sys/arch/x68k/stand/boot/srt0.S        |   4 +-
 sys/arch/x68k/stand/libsa/Makefile     |  68 ++++++++++++++-------------------
 sys/arch/x68k/stand/libsa/Makefile.inc |  11 +++++
 sys/arch/x68k/stand/libsa/consio.c     |  16 +-------
 5 files changed, 48 insertions(+), 59 deletions(-)

diffs (177 lines):

diff -r 5ed07c53bc5d -r 182c6b9959ff sys/arch/x68k/stand/boot/Makefile
--- a/sys/arch/x68k/stand/boot/Makefile Tue Apr 12 13:48:29 2011 +0000
+++ b/sys/arch/x68k/stand/boot/Makefile Tue Apr 12 14:07:35 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.19 2011/01/22 19:19:24 joerg Exp $
+#      $NetBSD: Makefile,v 1.20 2011/04/12 14:07:35 tsutsui Exp $
 
 NOMAN=         # defined
 
@@ -44,12 +44,14 @@
 LINKFLAGS=     -N -static -T ${.CURDIR}/boot.ldscript
 LIBIOCS!=      cd $M/stand/libiocs && ${PRINTOBJDIR}
 LIBSA!=                cd $M/stand/libsa && ${PRINTOBJDIR}
-LDLIBS=                -L${LIBSA} -lsa -L${LIBIOCS} -liocs
+L=             ${LIBSA}/lib
+LDLIBS=        ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a
+LDLIBS+=       ${LIBIOCS}/libiocs.a
 
 .include "../Makefile.booters"
 
 realall: ${PROG}
-${PROG}:       ${OBJS} ${LIBSA}/libsa.a ${LIBIOCS}/libiocs.a
+${PROG}:       ${OBJS} ${LDLIBS}
        ${_MKTARGET_LINK}
        ${LD} ${LINKFLAGS} -o ${PROG}.sym ${OBJS} ${LDLIBS}
        ${STRIP} -F ${BFDNAME} -o ${PROG} ${PROG}.sym
diff -r 5ed07c53bc5d -r 182c6b9959ff sys/arch/x68k/stand/boot/srt0.S
--- a/sys/arch/x68k/stand/boot/srt0.S   Tue Apr 12 13:48:29 2011 +0000
+++ b/sys/arch/x68k/stand/boot/srt0.S   Tue Apr 12 14:07:35 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: srt0.S,v 1.1 2001/09/27 10:14:49 minoura Exp $ */
+/*     $NetBSD: srt0.S,v 1.2 2011/04/12 14:07:35 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2001 Minoura Makoto
@@ -48,7 +48,7 @@
        movl            %d6,%sp@-
        jbsr            _C_LABEL(bootmain)
 
-ENTRY_NOPROFILE(exit)
+ENTRY_NOPROFILE(_rtt)
        pea             %pc@(reboot_msg)
        jbsr            _C_LABEL(printf)
        jbsr            _C_LABEL(getchar)
diff -r 5ed07c53bc5d -r 182c6b9959ff sys/arch/x68k/stand/libsa/Makefile
--- a/sys/arch/x68k/stand/libsa/Makefile        Tue Apr 12 13:48:29 2011 +0000
+++ b/sys/arch/x68k/stand/libsa/Makefile        Tue Apr 12 14:07:35 2011 +0000
@@ -1,43 +1,11 @@
-#      $NetBSD: Makefile,v 1.25 2009/03/19 10:19:33 tsutsui Exp $
+#      $NetBSD: Makefile,v 1.26 2011/04/12 14:07:35 tsutsui Exp $
 
 S=             ${.CURDIR}/../../../..
-LIBSADIR=      $S/lib/libsa
-LIBKERNDIR=    $S/lib/libkern
-LIBZDIR=       $S/lib/libz
-LIBZDIST=      $S/../common/dist/zlib
 
-LIB=           sa
-
-SRCS+=         alloc.c bcopy.c bzero.c errno.c getfile.c gets.c
-SRCS+=         memcmp.c memcpy.c memmove.c memset.c panic.c
-SRCS+=         printf.c snprintf.c sprintf.c subr_prf.c twiddle.c vsprintf.c
-
-SRCS+=         close.c closeall.c cread.c dev.c fstat.c ioctl.c lseek.c
-SRCS+=         open.c read.c stat.c
-SRCS+=         loadfile.c loadfile_aout.c loadfile_elf32.c
-SRCS+=         cd9660.c lfsv1.c lfsv2.c nfs.c ufs.c ufs_ls.c ustarfs.c
-SRCS+=         globals.c
-#SRCS+=                arp.c ether.c in_cksum.c net.c netif.c rpc.c udp.c
-#SRCS+=                bootp.c
-
-SRCS+=         ashldi3.c ashrdi3.c divdi3.c moddi3.c qdivrem.c
-SRCS+=         strcat.c strchr.c strcmp.c strcpy.c strerror.c strlen.c
-SRCS+=         strncmp.c strrchr.c
-
-SRCS+=         adler32.c crc32.c inffast.c
-SRCS+=         inflate.c inftrees.c uncompr.c
-
-SRCS+=         consio.c devopen.c parseutils.c sdcd.c fd.c fdsub.S chdsk.c
-SRCS+=         putimage.S
-
-NOPROFILE=     # defined
-NOPIC=         # defined
-NOLINT=                # defined
-
-CPPFLAGS+=     -I${.OBJDIR} -I${LIBSADIR} -I$S -I${LIBZDIR} -I${LIBZDIST}
+CPPFLAGS+=     -nostdinc -I${.OBJDIR} -I. -I${S}
 CPPFLAGS+=     -I${.CURDIR}/../libiocs -I${.CURDIR}/../common
 CPPFLAGS+=     -D_STANDALONE
-CPPFLAGS+=     -DHEAP_VARIABLE -D__INTERNAL_LIBSA_CREAD
+CPPFLAGS+=     -DHEAP_VARIABLE
 CPPFLAGS+=     -DHAVE_CHANGEDISK_HOOK
 CPPFLAGS+=     -DUSTAR_SECT_PER_CYL=16
 #CPPFLAGS+=    -DDEBUG
@@ -45,11 +13,33 @@
 .PATH: ${LIBSADIR} ${LIBKERNDIR} ${LIBZDIR} ${LIBZDIST}
 
 .include "../Makefile.booters"
-.include "${S}/../common/lib/libc/Makefile.inc"
 
 # only needed during build
 libinstall::
 
-.include <bsd.own.mk>
-.undef DESTDIR
-.include <bsd.lib.mk>
+.include <bsd.prog.mk>
+
+### find out what to use for libkern
+KERN_AS= library
+.include "${S}/lib/libkern/Makefile.inc"
+LIBKERN= ${KERNLIB}
+
+### find out what to use for libz
+Z_AS= library
+.include "${S}/lib/libz/Makefile.inc"
+LIBZ= ${ZLIB}
+
+### find out what to use for libsa
+SA_AS= library
+SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes SA_EXTRADIR=${.CURDIR}
+.include "${S}/lib/libsa/Makefile.inc"
+LIBSA= ${SALIB}
+
+LIBS= ${LIBKERN} ${LIBZ} ${LIBSA}
+
+all realall: ${LIBS}
+
+cleandir distclean: .WAIT cleanlibdir
+
+cleanlibdir:
+       -rm -rf lib
diff -r 5ed07c53bc5d -r 182c6b9959ff sys/arch/x68k/stand/libsa/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/x68k/stand/libsa/Makefile.inc    Tue Apr 12 14:07:35 2011 +0000
@@ -0,0 +1,11 @@
+#      $NetBSD: Makefile.inc,v 1.1 2011/04/12 14:07:35 tsutsui Exp $
+
+# MD libsa files
+
+.PATH.c: ${SA_EXTRADIR}
+.PATH.S: ${SA_EXTRADIR}
+
+SRCS+=         consio.c devopen.c parseutils.c sdcd.c fd.c fdsub.S chdsk.c
+SRCS+=         putimage.S
+
+#SRCS+=                dev_net.c
diff -r 5ed07c53bc5d -r 182c6b9959ff sys/arch/x68k/stand/libsa/consio.c
--- a/sys/arch/x68k/stand/libsa/consio.c        Tue Apr 12 13:48:29 2011 +0000
+++ b/sys/arch/x68k/stand/libsa/consio.c        Tue Apr 12 14:07:35 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: consio.c,v 1.7 2011/04/11 14:00:02 tsutsui Exp $       */
+/*     $NetBSD: consio.c,v 1.8 2011/04/12 14:07:35 tsutsui Exp $       */
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -136,20 +136,6 @@
        return c;
 }
 
-__dead void
-panic(const char *fmt,...)
-{
-       va_list ap;
-
-       va_start(ap, fmt);
-
-       printf(fmt, ap);
-       printf("\n");
-       va_end(ap);
-
-       exit(1);
-}
-
 extern void put_image(int, int);
 
 void



Home | Main Index | Thread Index | Old Index