summaryrefslogtreecommitdiff
path: root/sys/arch/sparc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-11-25 18:25:37 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-11-25 18:25:37 +0000
commitfd3cd56c5876d53b6c02e5b0821c0039831c6b6d (patch)
tree3d877f0b245dd0e07d6c535cd77daf7b8459efe5 /sys/arch/sparc
parent98824d13d14295a8c20e3c51cd80ca8e90e5c383 (diff)
libkern, begone. Move to a new mechanism where config(8)'s "file"
directive can select between MI and MD versions of these files. At the same time, adjust the boot programs to pick exactly what they need, instead of the 7 or 8 mechanisms previously used. There will be some fallout from this, but testing it all by myself is a ridiculously slow process; it will be finished in-tree. Various developers were very nice and avoided making fun of me when I was gibbering in the corner..
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r--sys/arch/sparc/conf/Makefile.sparc16
-rw-r--r--sys/arch/sparc/conf/files.sparc31
-rw-r--r--sys/arch/sparc/stand/Makefile4
-rw-r--r--sys/arch/sparc/stand/Makefile.inc15
-rw-r--r--sys/arch/sparc/stand/boot/Makefile8
-rw-r--r--sys/arch/sparc/stand/bootxx/Makefile11
-rw-r--r--sys/arch/sparc/stand/libkern/Makefile32
7 files changed, 50 insertions, 67 deletions
diff --git a/sys/arch/sparc/conf/Makefile.sparc b/sys/arch/sparc/conf/Makefile.sparc
index bc1a6f1a357..485386d9782 100644
--- a/sys/arch/sparc/conf/Makefile.sparc
+++ b/sys/arch/sparc/conf/Makefile.sparc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.sparc,v 1.40 2007/11/25 11:23:33 deraadt Exp $
+# $OpenBSD: Makefile.sparc,v 1.41 2007/11/25 18:25:29 deraadt Exp $
# $NetBSD: Makefile.sparc,v 1.32.4.1 1996/06/12 20:26:32 pk Exp $
# Makefile for OpenBSD
@@ -62,14 +62,6 @@ HOSTCC= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS= ${CFLAGS}
-### find out what to use for libkern
-.include "$S/lib/libkern/Makefile.inc"
-.ifndef PROF
-LIBKERN= ${KERNLIB}
-.else
-LIBKERN= ${KERNLIB_PROF}
-.endif
-
# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
@@ -97,7 +89,7 @@ HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
# ${SYSTEM_LD_HEAD}
# ${SYSTEM_LD} swapxxx.o
# ${SYSTEM_LD_TAIL}
-SYSTEM_OBJ= locore.o param.o ioconf.o ${OBJS} ${LIBKERN}
+SYSTEM_OBJ= locore.o param.o ioconf.o ${OBJS}
SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
SYSTEM_LD_HEAD= @rm -f $@
SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
@@ -129,6 +121,9 @@ param.c: $S/conf/param.c
param.o: param.c Makefile
${NORMAL_C_C}
+mcount.o: $S/lib/libkern/mcount.c Makefile
+ ${NORMAL_C_NOP}
+
ioconf.o: ioconf.c
${NORMAL_C}
@@ -186,7 +181,6 @@ bwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile
ms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o locore.o: Makefile
machdep.o mem.o openprom.o pmap.o vm_machdep.o: Makefile
-
locore.o: ${SPARC}/sparc/locore.s assym.h
${NORMAL_S}
diff --git a/sys/arch/sparc/conf/files.sparc b/sys/arch/sparc/conf/files.sparc
index 1e4de8736a5..b438c4f483b 100644
--- a/sys/arch/sparc/conf/files.sparc
+++ b/sys/arch/sparc/conf/files.sparc
@@ -1,4 +1,4 @@
-# $OpenBSD: files.sparc,v 1.79 2007/10/10 15:53:52 art Exp $
+# $OpenBSD: files.sparc,v 1.80 2007/11/25 18:25:29 deraadt Exp $
# $NetBSD: files.sparc,v 1.44 1997/08/31 21:29:16 pk Exp $
# @(#)files.sparc 8.1 (Berkeley) 7/19/93
@@ -387,3 +387,32 @@ include "dev/pcmcia/files.pcmcia"
# built-in modem on Tadpole SPARCbook
attach com at obio with com_obio
file arch/sparc/dev/com_obio.c com_obio
+
+# machine-dependent libkern component
+file lib/libkern/arch/sparc/saveregs.S
+
+# quad support is neccessary for 32 bit architectures
+file lib/libkern/adddi3.c
+file lib/libkern/anddi3.c
+file lib/libkern/ashldi3.c
+file lib/libkern/ashrdi3.c
+file lib/libkern/cmpdi2.c
+file lib/libkern/divdi3.c
+file lib/libkern/iordi3.c
+file lib/libkern/lshldi3.c
+file lib/libkern/lshrdi3.c
+file lib/libkern/moddi3.c
+file lib/libkern/muldi3.c
+file lib/libkern/negdi2.c
+file lib/libkern/notdi2.c
+file lib/libkern/qdivrem.c
+file lib/libkern/subdi3.c
+file lib/libkern/ucmpdi2.c
+file lib/libkern/udivdi3.c
+file lib/libkern/umoddi3.c
+file lib/libkern/xordi3.c
+
+file lib/libkern/arch/sparc/sdiv.S
+file lib/libkern/arch/sparc/udiv.S
+file lib/libkern/arch/sparc/urem.S
+file lib/libkern/arch/sparc/rem.S
diff --git a/sys/arch/sparc/stand/Makefile b/sys/arch/sparc/stand/Makefile
index 168ffeb97ff..e81d8408851 100644
--- a/sys/arch/sparc/stand/Makefile
+++ b/sys/arch/sparc/stand/Makefile
@@ -1,8 +1,8 @@
-# $OpenBSD: Makefile,v 1.8 2000/05/27 05:52:31 deraadt Exp $
+# $OpenBSD: Makefile,v 1.9 2007/11/25 18:25:33 deraadt Exp $
# $NetBSD: Makefile,v 1.15 1997/06/01 03:39:03 mrg Exp $
.if ${MACHINE} == "sparc"
-SUBDIR= libsa libkern libz boot bootxx binstall
+SUBDIR= libsa libz boot bootxx binstall
.endif
SUBDIR+= installboot
diff --git a/sys/arch/sparc/stand/Makefile.inc b/sys/arch/sparc/stand/Makefile.inc
index fb22cad1653..4a57998d9c8 100644
--- a/sys/arch/sparc/stand/Makefile.inc
+++ b/sys/arch/sparc/stand/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.13 2005/12/30 02:03:49 millert Exp $
+# $OpenBSD: Makefile.inc,v 1.14 2007/11/25 18:25:33 deraadt Exp $
# $NetBSD: Makefile.inc,v 1.5 1996/02/01 22:33:01 mycroft Exp $
BINDIR= /usr/mdec
@@ -16,19 +16,6 @@ CFLAGS+= -fno-stack-protector
DEFS= -DSTANDALONE -DRELOC=${RELOC} -DSUN4 -DSUN4C -DSUN_BOOTPARAMS
-### Figure out what to use for libkern
-LIBKERNDIR= ${.CURDIR}/../libkern
-
-.if exists(${LIBKERNDIR}/obj.${MACHINE})
-LIBKERNOBJDIR= ${LIBKERNDIR}/obj.${MACHINE}
-.elif exists(${LIBKERNDIR}/obj)
-LIBKERNOBJDIR= ${LIBKERNDIR}/obj
-.else
-LIBKERNOBJDIR= ${LIBKERNDIR}
-.endif
-
-LIBKERN= ${LIBKERNOBJDIR}/libkern.a
-
### Figure out what to use for libsa
LIBSADIR= ${.CURDIR}/../libsa
diff --git a/sys/arch/sparc/stand/boot/Makefile b/sys/arch/sparc/stand/boot/Makefile
index 2846ebf7df5..8f8cef36591 100644
--- a/sys/arch/sparc/stand/boot/Makefile
+++ b/sys/arch/sparc/stand/boot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.13 2007/10/30 06:03:16 deraadt Exp $
+# $OpenBSD: Makefile,v 1.14 2007/11/25 18:25:33 deraadt Exp $
# $NetBSD: Makefile,v 1.2 1995/09/30 21:43:38 pk Exp $
.PATH: ${.CURDIR}/../common
@@ -7,16 +7,20 @@ PROG= boot
NOMAN= noman
INSTALL_STRIP=
+S= ${.CURDIR}/../../../..
SRCS= srt0.S boot.c conf.c dvma.c net.c netif_sun.c promdev.c version.c
SRCS+= loadfile.c
+.PATH: ${S}/lib/libkern/arch/sparc ${S}/lib/libkern
+SRCS+= bzero.S strlen.c mul.S umul.S strcmp.S sdiv.S urem.S udiv.S rem.S
+
CFLAGS= -O2 -I${.CURDIR}/../common -I${.CURDIR}/../../../../arch \
-I${.CURDIR}/../../../.. -I${.CURDIR}/../../../../lib/libsa ${DEFS} \
-DSPARC_BOOT_AOUT -DSPARC_BOOT_ELF
CLEANFILES+=${PROG}.aout ${PROG}.elf elfclean
-LIBS=${LIBSA} ${LIBKERN} ${LIBZ}
+LIBS=${LIBSA} ${LIBZ}
elfclean: clean-elf.c
${HOSTCC} -o elfclean ${.ALLSRC}
diff --git a/sys/arch/sparc/stand/bootxx/Makefile b/sys/arch/sparc/stand/bootxx/Makefile
index 161973642b3..359504f3d16 100644
--- a/sys/arch/sparc/stand/bootxx/Makefile
+++ b/sys/arch/sparc/stand/bootxx/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.8 2007/10/30 06:03:16 deraadt Exp $
+# $OpenBSD: Makefile,v 1.9 2007/11/25 18:25:33 deraadt Exp $
# $NetBSD: Makefile,v 1.2 1995/09/30 21:43:38 pk Exp $
.PATH: ${.CURDIR}/../common
@@ -7,13 +7,14 @@ PROG= bootxx
NOMAN= noman
INSTALL_STRIP=
+S= ${.CURDIR}/../../../..
SRCS= srt0.S bootxx.c closeall.c dvma.c promdev.c
CLEANFILES+=${PROG}.aout ${PROG}.elf elfclean
-# pre-built bits of libkern
-KOBJS= __main.o bzero.o urem.o udiv.o
-_KOBJS=${KOBJS:S,^,${LIBKERNOBJDIR}/,g}
+.PATH: ${S}/lib/libkern/arch/sparc ${S}/lib/libkern
+SRCS+= __main.o bzero.o urem.o udiv.o
+
# pre-built bits of libsa
SOBJS= alloc.o exit.o printf.o memcpy.o memset.o
_SOBJS=${SOBJS:S,^,${LIBSAOBJDIR}/,g}
@@ -26,7 +27,7 @@ elfclean: clean-elf.c
${HOSTCC} -o elfclean ${.ALLSRC}
${PROG}: ${OBJS} elfclean
- ${LD} -N -Ttext ${RELOC} -e start ${OBJS} ${_SOBJS} ${_KOBJS} -o ${.TARGET}.elf
+ ${LD} -N -Ttext ${RELOC} -e start ${OBJS} ${_SOBJS} -o ${.TARGET}.elf
./elfclean ${.TARGET}.elf
objcopy -j .text -j .data -j .bss -O a.out-sparc-netbsd \
${.TARGET}.elf ${.TARGET}.aout
diff --git a/sys/arch/sparc/stand/libkern/Makefile b/sys/arch/sparc/stand/libkern/Makefile
deleted file mode 100644
index d739830daef..00000000000
--- a/sys/arch/sparc/stand/libkern/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-# $OpenBSD: Makefile,v 1.3 2003/06/01 17:00:39 deraadt Exp $
-
-LIB= kern
-
-.PATH: ${.CURDIR}/../../../../lib/libkern
-.PATH: ${.CURDIR}/../../../../lib/libkern/arch/sparc
-
-.include "${.CURDIR}/../../../../lib/libkern/arch/sparc/Makefile.inc"
-
-CFLAGS= -O2 -I${.CURDIR}/../include -I${.CURDIR}/../../../.. \
- -I${.CURDIR}/../../../../lib/libkern \
- -I${.CURDIR}/../../../../lib/libkern/arch/sparc
-
-AFLAGS= -x assembler-with-cpp -traditional-cpp -I${.CURDIR}/../include \
- -I${.CURDIR}/../../../.. -I${.CURDIR}/../../../../lib/libkern \
- -I${.CURDIR}/../../../../lib/libkern/arch/sparc
-
-# kern routines
-SRCS= __main.c ashrdi3.c bzero.S divdi3.c qdivrem.c strlen.S \
- strcmp.c strncmp.c umoddi3.c
-
-SRCS+= umul.S mul.S rem.S sdiv.S udiv.S urem.S
-SRCS+= saveregs.S
-
-${OBJS}: ${.CURDIR}/../Makefile.inc
-
-NOPROFILE=
-NOPIC=
-
-install:
-
-.include <bsd.lib.mk>