Full switch to clang/ELF. Drop ack. Simplify.

There is important information about booting non-ack images in
docs/UPDATING. ack/aout-format images can't be built any more, and
booting clang/ELF-format ones is a little different. Updating to the
new boot monitor is recommended.

Changes in this commit:

	. drop boot monitor -> allowing dropping ack support
	. facility to copy ELF boot files to /boot so that old boot monitor
	  can still boot fairly easily, see UPDATING
	. no more ack-format libraries -> single-case libraries
	. some cleanup of OBJECT_FMT, COMPILER_TYPE, etc cases
	. drop several ack toolchain commands, but not all support
	  commands (e.g. aal is gone but acksize is not yet).
	. a few libc files moved to netbsd libc dir
	. new /bin/date as minix date used code in libc/
	. test compile fix
	. harmonize includes
	. /usr/lib is no longer special: without ack, /usr/lib plays no
	  kind of special bootstrapping role any more and bootstrapping
	  is done exclusively through packages, so releases depend even
	  less on the state of the machine making them now.
	. rename nbsd_lib* to lib*
	. reduce mtree
This commit is contained in:
Ben Gras
2012-02-11 19:31:25 +01:00
parent 2487445f5f
commit 2fe8fb192f
5056 changed files with 16216 additions and 133169 deletions

View File

@@ -0,0 +1,10 @@
# $NetBSD: Makefile.inc,v 1.3 2009/07/30 20:57:16 dsl Exp $
# $OpenBSD: Makefile.inc,v 1.4 1999/09/14 00:46:18 mickey Exp $
SRCS+= bcmp.S bzero.S ffs.S
# NetBSD doesn't currently let archs supply a strlcpy.S.
# plus, the one that fredette made is untested.
#SRCS+= strlcpy.S

View File

@@ -0,0 +1,84 @@
/* $NetBSD: bcmp.S,v 1.2 2003/10/06 05:30:21 matt Exp $ */
/* $OpenBSD: bcmp.S,v 1.3 2001/06/04 23:14:02 mickey Exp $ */
/*
* Copyright 1996 1995 by Open Software Foundation, Inc.
* All Rights Reserved
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appears in all copies and
* that both the copyright notice and this permission notice appear in
* supporting documentation.
*
* OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
* NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* (c) Copyright 1988 HEWLETT-PACKARD COMPANY
*
* To anyone who acknowledges that this file is provided "AS IS"
* without any express or implied warranty:
* permission to use, copy, modify, and distribute this file
* for any purpose is hereby granted without fee, provided that
* the above copyright notice and this notice appears in all
* copies, and that the name of Hewlett-Packard Company not be
* used in advertising or publicity pertaining to distribution
* of the software without specific, written prior permission.
* Hewlett-Packard Company makes no representations about the
* suitability of this software for any purpose.
*/
/*
* Copyright (c) 1990,1991,1994 The University of Utah and
* the Computer Systems Laboratory (CSL). All rights reserved.
*
* THE UNIVERSITY OF UTAH AND CSL PROVIDE THIS SOFTWARE IN ITS "AS IS"
* CONDITION, AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
* WHATSOEVER RESULTING FROM ITS USE.
*
* CSL requests users of this software to return to csl-dist@cs.utah.edu any
* improvements that they make and grant CSL redistribution rights.
*
* Utah Hdr: movc.s 1.26 94/12/14
*/
#include <machine/asm.h>
#ifdef SYSLIBC_SCCS
.text
.asciz "$OpenBSD: bcmp.S,v 1.3 2001/06/04 23:14:02 mickey Exp $"
.align 4
#endif
/*
* int
* bcmp(src, dst, count)
* vaddr_t src;
* vaddr_t dst;
* size_t count;
*/
LEAF_ENTRY(bcmp)
comb,>= %r0,%arg2,$bcmp_exit
copy %t1,%t2
$bcmp_loop:
ldbs,ma 1(%arg0),%t1
ldbs,ma 1(%arg1),%t2
comb,<>,n %t1,%t2,$bcmp_exit
addib,<> -1,%arg2,$bcmp_loop
nop
$bcmp_exit:
bv 0(%r2)
sub %t1,%t2,%ret0
EXIT(bcmp)

View File

@@ -0,0 +1,119 @@
/* $NetBSD: bzero.S,v 1.2 2003/10/06 05:30:21 matt Exp $ */
/* $OpenBSD: bzero.S,v 1.3 2001/06/04 23:14:02 mickey Exp $ */
/*
* (c) Copyright 1988 HEWLETT-PACKARD COMPANY
*
* To anyone who acknowledges that this file is provided "AS IS"
* without any express or implied warranty:
* permission to use, copy, modify, and distribute this file
* for any purpose is hereby granted without fee, provided that
* the above copyright notice and this notice appears in all
* copies, and that the name of Hewlett-Packard Company not be
* used in advertising or publicity pertaining to distribution
* of the software without specific, written prior permission.
* Hewlett-Packard Company makes no representations about the
* suitability of this software for any purpose.
*/
/*
* Copyright (c) 1990,1994 The University of Utah and
* the Computer Systems Laboratory (CSL). All rights reserved.
*
* THE UNIVERSITY OF UTAH AND CSL PROVIDE THIS SOFTWARE IN ITS "AS IS"
* CONDITION, AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
* WHATSOEVER RESULTING FROM ITS USE.
*
* CSL requests users of this software to return to csl-dist@cs.utah.edu any
* improvements that they make and grant CSL redistribution rights.
*
* Utah $Hdr: bzero.s 1.9 94/12/14$
* Author: Bob Wheeler, University of Utah CSL
*/
#include <machine/asm.h>
#ifdef SYSLIBC_SCCS
.text
.asciz "$OpenBSD: bzero.S,v 1.3 2001/06/04 23:14:02 mickey Exp $"
.align 4
#endif
/*
* void
* bzero(dst, count)
* void *dst;
* size_t count;
*/
LEAF_ENTRY(bzero)
comb,>=,n %r0,%arg1,$bzero_exit
/*
* If we need to clear less than a word do it a byte at a time
*/
comib,>>,n 4,%arg1,$bzero_bytes
/*
* Since we are only clearing memory the alignment restrictions
* are simplified. Figure out how many "extra" bytes we need to
* store with stbys.
*/
extru %arg0,31,2,%t1
add %arg1,%t1,%arg1
/*
* We will zero the destination in blocks of 16 bytes as long as we
* can and then we'll go to the 4 byte moves.
*/
comib,>>= 15, %arg1, $bzero_word
addi -16, %arg1, %arg1
$bzero_loop_16:
stbys,b,m %r0,4(%arg0)
stwm %r0,4(%arg0)
stwm %r0,4(%arg0)
stwm %r0,4(%arg0)
comib,<< 15, %arg1, $bzero_loop_16
addi -16, %arg1, %arg1
/*
* see if there is anything left that needs to be zeroed in a word
* move. Since the count was decremented by 16, add 12 to test if
* there are any full word moves left to do.
*/
$bzero_word:
addib,<,n 12,%arg1,$bzero_cleanup
$bzero_loop_4:
addib,>= -4,%arg1,$bzero_loop_4
stbys,b,m %r0,4(%arg0)
/*
* zero the last bytes that may be unaligned on a word boundary
*/
$bzero_cleanup:
addib,=,n 4,%arg1,$bzero_exit
add %arg0,%arg1,%arg0
b $bzero_exit
stbys,e %r0,0(%arg0)
b,n $bzero_exit
/*
* zero by bytes
*/
$bzero_bytes:
addib,> -1,%arg1,$bzero_bytes
stbs,ma %r0,1(%arg0)
$bzero_exit:
bv,n %r0(%rp)
EXIT(bzero)
.end

View File

@@ -0,0 +1,63 @@
/* $NetBSD: ffs.S,v 1.3 2004/07/18 20:30:04 chs Exp $ */
/* $OpenBSD: ffs.S,v 1.3 2001/06/04 23:14:02 mickey Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1994, The University of Utah and
* the Computer Systems Laboratory at the University of Utah (CSL).
* All rights reserved.
*
* 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.
*
* THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
* IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
* ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* CSL requests users of this software to return to csl-dist@cs.utah.edu any
* improvements that they make and grant CSL redistribution rights.
*
*/
#include <machine/asm.h>
#ifdef SYSLIBC_SCCS
.text
.asciz "$OpenBSD: ffs.S,v 1.3 2001/06/04 23:14:02 mickey Exp $"
.align 4
#endif
/*
* ffs(bitmask)
*
* Return the position of the "most significant" bit in `bitmask'.
* Since this is similar to the VAX ffs instruction, bits in a word
* are numbered as "32, 31, ... 1", 0 is returned if no bits are set.
*/
LEAF_ENTRY(ffs)
comb,= %arg0,%r0,ffsdone ; If arg0 is 0
or %r0,%r0,%ret0 ; return 0
ldi 32,%ret0 ; Set return to high bit
extru,= %arg0,31,16,%r0 ; If low 16 bits are non-zero
addi,tr -16,%ret0,%ret0 ; subtract 16 from bitpos
shd %r0,%arg0,16,%arg0 ; else shift right 16 bits
extru,= %arg0,31,8,%r0 ; If low 8 bits are non-zero
addi,tr -8,%ret0,%ret0 ; subtract 8 from bitpos
shd %r0,%arg0,8,%arg0 ; else shift right 8 bits
extru,= %arg0,31,4,%r0 ; If low 4 bits are non-zero
addi,tr -4,%ret0,%ret0 ; subtract 4 from bitpos
shd %r0,%arg0,4,%arg0 ; else shift right 4 bits
extru,= %arg0,31,2,%r0 ; If low 2 bits are non-zero
addi,tr -2,%ret0,%ret0 ; subtract 2 from bitpos
shd %r0,%arg0,2,%arg0 ; else shift right 2 bits
extru,= %arg0,31,1,%r0 ; If low bit is non-zero
addi -1,%ret0,%ret0 ; subtract 1 from bitpos
ffsdone:
bv,n %r0(%rp)
EXIT(ffs)
.end

View File

@@ -0,0 +1,84 @@
/* $NetBSD: strlcpy.S,v 1.3 2008/04/28 20:22:56 martin Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matthew Fredette.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: strlcpy.S,v 1.3 2008/04/28 20:22:56 martin Exp $")
#endif /* LIBC_SCCS and not lint */
/*
* size_t strlcpy(char *dst, const char *src, size_t size);
*/
LEAF_ENTRY(_strlcpy)
.weak strlcpy
strlcpy = _strlcpy
/* Always load the first byte of the source string. */
ldbs,ma 1(%arg1), %r1
/*
* If our dst buffer is zero bytes, branch immediately
* to the code that counts the (remaining) length
* of the src string.
*/
comb,= %r0, %arg2, $strlcpy_dst_done
copy %arg1, %ret0
/*
* If our dst buffer is one byte, branch immediately
* to the code that NUL-terminates the dst buffer and
* counts the (remaining) length of the src string.
*/
addib,=,n -1, %arg2, $strlcpy_dst_full
/*
* Loop copying bytes. At the top of this loop,
* %arg2 is always the number of bytes we can still
* store, and %r1 holds the next byte to store.
*/
$strlcpy_loop:
comb,= %r0, %r1, $strlcpy_exit
stbs,ma %r1, 1(%arg0)
addib,<> -1, %arg2, $strlcpy_loop
ldbs,ma 1(%arg1), %r1
$strlcpy_dst_full:
stbs,ma %r0, 1(%arg0)
$strlcpy_dst_done:
comb,<>,n %r0, %r1, $strlcpy_dst_done
ldbs,ma 1(%arg1), %r1
$strlcpy_exit:
bv %r0(%rp)
sub %arg1, %ret0, %ret0
EXIT(strlcpy)