freebsd kernel with SKQ
Go to file
obrien d047bea9fd Gcc 3.1 (-O) now generates broken inline code for memset in some cases.
This broke newfs (newfs left some garbage in a bitmap).

The ASM for:

	#include <string.h>
	int x, foo[100];
	main()
	{
		memset(&foo[0], 0, x);
	}

is (at least if you have fixed function alignment):

	.file	"z.c"
	.text
	.p2align 2,,3
.globl main
	.type	main,@function
main:
	pushl	%ebp
	movl	%esp, %ebp
	pushl	%edi
	pushl	%eax
	movl	x, %ecx
	xorl	%eax, %eax
	shrl	$2, %ecx
	movl	$foo, %edi
	cld
	rep
	stosl
	andl	$-16, %esp
				<-- the lower bits of `len' should be loaded
				    near here
	testl	$2, %edi	<-- this seems to be meant to test the 2^1
				    bit in `len' (not alignment of the pointer
				    like it actually does).  %edi is the wrong
				    register for holding the bits, since it is
				    still needed for the pointer.
	je	.L2
	stosw
.L2:
	testl	$1, %edi	<-- similarly for the 2^0 bit.
	je	.L3
	stosb
.L3:
	movl	-4(%ebp), %edi
	leave
	ret
.Lfe1:
	.size	main,.Lfe1-main
	.comm	foo,400,32
	.comm	x,4,4
	.ident	"GCC: (GNU) 3.1 [FreeBSD] 20020509 (prerelease)"

This seems to only result in (len % 3) bytes not being cleared, since gcc
doesn't seem to use the builtin memset unless it knows that the pointer is
aligned.  If %edi could be misaligned, then too many bytes would be set.

Submitted by:	BDE
2002-06-04 18:04:27 +00:00
bin Display job status correctly when a pipeline is suspended. 2002-06-04 15:26:00 +00:00
contrib Gcc 3.1 (-O) now generates broken inline code for memset in some cases. 2002-06-04 18:04:27 +00:00
crypto Don't risk catching a signal while handling a signal for a dying child, as we 2002-05-27 08:10:24 +00:00
etc Add new entry PLANEX GW-NS11H(PRISM3.0). 2002-05-29 21:16:51 +00:00
games Use POSIX macros for wait(2)-style status information instead of the 2002-06-03 23:13:11 +00:00
gnu Don't forget to include ../Makefile.inc. 2002-06-04 11:28:09 +00:00
include Const poison. 2002-05-30 21:59:16 +00:00
kerberos5 Make this -j safe. 2002-05-14 15:27:13 +00:00
kerberosIV This code is no longer WARNS level 2 OK. 2002-05-15 06:32:29 +00:00
lib Implement _Qp_sqrt. I've been unable to find a C program that gcc generates 2002-06-04 17:02:27 +00:00
libexec Add used include of <string.h>. 2002-05-30 21:35:39 +00:00
release Install MD documentations in ${TARGET} directory instead of ${TARGET_ARCH}. 2002-06-04 12:05:29 +00:00
sbin Fix breakage caused by allocating the I/O buffer. There was a 2002-06-02 19:20:37 +00:00
secure for OpenSSL 0.9.5a 2002-05-15 09:17:27 +00:00
share Recognize 0xbe as an uppercase character. 2002-06-03 21:30:28 +00:00
sys Add REPORT LUNS basic infrastructure. 2002-06-04 17:41:47 +00:00
tools Fix typo in the BSD copyright: s/withough/without/ 2002-06-02 20:05:59 +00:00
usr.bin Don't build perl if NO_PERL is defined. 2002-06-04 15:20:11 +00:00
usr.sbin Change some "process id" variables from 'int' to 'pid_t', renaming some 2002-06-04 03:40:24 +00:00
COPYRIGHT
MAINTAINERS indent tdfx line similarly to rest of the file 2002-05-30 16:50:27 +00:00
Makefile Reimplement FILES support using bsd.files.mk with the 2002-06-03 14:49:34 +00:00
Makefile.inc1 On behalf of lib/compat/compat4x.i386/libusb.so.0.bz2.uu,v 1.1, 2002-05-31 13:04:09 +00:00
Makefile.upgrade
README
UPDATING Remove comment about NO_WERROR, since it no longer applies. 2002-06-03 00:21:13 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The
``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.FreeBSD.org/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

kerberosIV	KerberosIV (eBones) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.FreeBSD.org/handbook/synching.html