Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/pmax/stand Build the full MI libsa for the first st...
details: https://anonhg.NetBSD.org/src/rev/1c4c058e58c9
branches: trunk
changeset: 467977:1c4c058e58c9
user: simonb <simonb%NetBSD.org@localhost>
date: Thu Apr 01 06:05:04 1999 +0000
description:
Build the full MI libsa for the first stage bootblocks rather than
picking the bits we wanted explicitly, taking advantage of some of the
recent code-size trimming from cgd. There's now no duplication if libsa
code in sys/arch/pmax/stand.
As a bonus, we now have 416 bytes free in stage one (up from 80), and
will all of Chris' space saving options enabled (these are commented out
in scsiboot/Makefile), theres over a 1kB free.
diffstat:
sys/arch/pmax/stand/Makefile.booters | 12 ++-
sys/arch/pmax/stand/scsiboot/Makefile | 32 ++++++---
sys/arch/pmax/stand/scsiboot/alloc.c | 111 ----------------------------------
sys/arch/pmax/stand/scsiboot/memcpy.c | 58 -----------------
sys/arch/pmax/stand/scsiboot/memset.c | 59 ------------------
5 files changed, 27 insertions(+), 245 deletions(-)
diffs (truncated from 323 to 300 lines):
diff -r e38cf317ee17 -r 1c4c058e58c9 sys/arch/pmax/stand/Makefile.booters
--- a/sys/arch/pmax/stand/Makefile.booters Thu Apr 01 05:52:38 1999 +0000
+++ b/sys/arch/pmax/stand/Makefile.booters Thu Apr 01 06:05:04 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.booters,v 1.20 1999/03/31 03:10:56 simonb Exp $
+# $NetBSD: Makefile.booters,v 1.21 1999/04/01 06:05:04 simonb Exp $
#
# NOTE: $S must correspond to the top of the 'sys' tree
@@ -32,19 +32,21 @@
LDBUG= -T $S/arch/mips/conf/stand.ldscript
-# We don't need libkern/libsa for the first stage bootblocks
-.if ${PROG} != "bootxx"
-
### find out what to use for libsa
SA_AS= library
.include "${S}/lib/libsa/Makefile.inc"
LIBSA= ${SALIB}
-SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_INCLUDE_NET=no
+SAMISCMAKEFLAGS= SA_INCLUDE_NET=yes
+
+# We don't need libkern/libz for the first stage bootblocks
+.if ${PROG} != "bootxx"
### find out what to use for libz
Z_AS= library
.include "${S}/lib/libz/Makefile.inc"
LIBZ= ${ZLIB}
+# and use compressed read in libsa
+SAMISCMAKEFLAGS= SA_USE_CREAD=yes
### find out what to use for libkern
KERN_AS= library
diff -r e38cf317ee17 -r 1c4c058e58c9 sys/arch/pmax/stand/scsiboot/Makefile
--- a/sys/arch/pmax/stand/scsiboot/Makefile Thu Apr 01 05:52:38 1999 +0000
+++ b/sys/arch/pmax/stand/scsiboot/Makefile Thu Apr 01 06:05:04 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 1999/03/31 07:43:39 simonb Exp $
+# $NetBSD: Makefile,v 1.13 1999/04/01 06:05:05 simonb Exp $
# @(#)Makefile 8.3 (Berkeley) 2/16/94
S= ${.CURDIR}/../../../..
@@ -8,19 +8,27 @@
VERS_O= # no version info in first stage
MKMAN= no
-SRCS= start.S alloc.c bootxx.c clear_cache.S memcpy.c memset.c printf.S \
- strcmp.S strcpy.S strlen.S
+SRCS= start.S bootxx.c clear_cache.S printf.S strcmp.S strcpy.S \
+ strlen.S
+
+CLEANFILES+=${PROG}.aout ${PROG}.map mkboot ${ALL}
+.PATH: ${.CURDIR}/../lib
+
+# Don't compile in sanity checks for old file systems.
+SAMISCCPPFLAGS= -DLIBSA_NO_COMPAT_UFS
-# from sys/lib/libsa:
-SRCS+= disklabel.c dkcksum.c errno.c lseek.c open.c read.c ufs.c
-# from sys/lib/libkern:
-SRCS+= bcmp.c
-CLEANFILES+=${PROG}.aout ${PROG}.map mkboot ${ALL}
-.PATH: ${.CURDIR}/../lib $S/lib/libsa $S/lib/libkern
+BOOTDEFADD+= -DBOOTXX -DRELOC=0x${RELOC} \
+ -DLIBSA_NO_FS_CLOSE -DLIBSA_NO_FS_SYMLINK -DLIBSA_NO_FS_WRITE \
+ -DLIBSA_NO_DEV_CLOSE -DLIBSA_NO_RAW_ACCESS -DLIBSA_NO_TWIDDLE \
+ -DALLOC_FIRST_FIT \
+ -DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET
+# The following will gain more space if needed (in rough order of
+# preference):
+# -DLIBSA_SINGLE_FILESYSTEM=ufs
+# -DLIBSA_SINGLE_DEVICE=rz -D"rzioctl(x,y,z)=EINVAL" -D"rzclose(f)=0"
+# -DLIBSA_FS_SINGLECOMPONENT
+# -DLIBSA_NO_DISKLABEL_MSGS
-BOOTDEFADD+=-DBOOTXX -DRELOC=0x${RELOC} \
- -DLIBSA_NO_FS_CLOSE -DLIBSA_NO_FS_SYMLINK \
- -DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET -DLIBSA_NO_TWIDDLE
ALL= rzboot bootrz
diff -r e38cf317ee17 -r 1c4c058e58c9 sys/arch/pmax/stand/scsiboot/alloc.c
--- a/sys/arch/pmax/stand/scsiboot/alloc.c Thu Apr 01 05:52:38 1999 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/* $NetBSD: alloc.c,v 1.2 1999/01/22 14:27:31 simonb Exp $ */
-
-/*-
- * Copyright (c) 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * The Mach Operating System project at Carnegie-Mellon University.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)alloc.c 8.1 (Berkeley) 6/11/93
- *
- *
- * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Author: Alessandro Forin
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution%CS.CMU.EDU@localhost
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- * $Id: alloc.c,v 1.2 1999/01/22 14:27:31 simonb Exp $
- */
-
-#include <sys/param.h>
-
-/*
- * Dynamic memory allocator
- */
-struct fl {
- struct fl *next;
- unsigned size;
-} *freelist = (struct fl *)0;
-
-extern char end[];
-static char *top = end;
-
-void *
-alloc(size)
- unsigned size;
-{
- register struct fl *f = freelist, **prev;
-
- prev = &freelist;
- while (f && f->size < size) {
- prev = &f->next;
- f = f->next;
- }
- if (f == (struct fl *)0) {
- f = (struct fl *)top;
- top += ALIGN(size);
- } else
- *prev = f->next;
- return ((void *)f);
-}
-
-void
-free(ptr, size)
- void *ptr;
- unsigned size;
-{
- register struct fl *f = (struct fl *)ptr;
-
- f->size = ALIGN(size);
- f->next = freelist;
- freelist = f;
-}
diff -r e38cf317ee17 -r 1c4c058e58c9 sys/arch/pmax/stand/scsiboot/memcpy.c
--- a/sys/arch/pmax/stand/scsiboot/memcpy.c Thu Apr 01 05:52:38 1999 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/* $NetBSD: memcpy.c,v 1.2 1999/02/22 08:22:21 simonb Exp $ */
-
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)strcat.c 8.1 (Berkeley) 6/10/93
- */
-
-#include <sys/types.h>
-
-void *
-memcpy(dst, src, len)
- void *dst;
- const void *src;
- size_t len;
-{
- char *d;
- const char *s;
-
- d = dst;
- s = src;
- while (len--) {
- *d++ = *s++;
- }
- return(dst);
-}
diff -r e38cf317ee17 -r 1c4c058e58c9 sys/arch/pmax/stand/scsiboot/memset.c
--- a/sys/arch/pmax/stand/scsiboot/memset.c Thu Apr 01 05:52:38 1999 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/* $NetBSD: memset.c,v 1.1 1999/02/22 11:26:15 simonb Exp $ */
-
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Mike Hibler and Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
Home |
Main Index |
Thread Index |
Old Index