Bruce Evans [Sun, 15 Sep 2002 20:48:08 +0000 (20:48 +0000)]
Made this compile (but not work). This involved mainly const poisoning
and renaming ALIGNED_POINTER() to _ALIGNED_POINTER() plus the following
hacks for i386's:
- define _ALIGNED_POINTER() if it is not already defined. Most non-i386
arches define it <machine/param.h> define it in <machine/param.h>,
although none actually used it in the kernel.
- define ksym_start and ksym_end. Most non-i386 arches still define and
initialize these in machdep.c although they didn't used them. Here is
a better place to define them but not to initialize them.
Allocate 64K recieve buffer for DNS responses.
KAME did the modification only to _dns_getaddrinfo(). However,
it is not sufficient, and res_queryN() should be modified, too.
So, I did same modification to res_queryN().
Bruce Evans [Sun, 15 Sep 2002 17:45:10 +0000 (17:45 +0000)]
Removed unused includes. Sorted includes. This is part of removing
includes of <sys/user.h> for its pollution only. <sys/user.h> wasn't
even used for its pollution here.
Bruce Evans [Sun, 15 Sep 2002 16:48:25 +0000 (16:48 +0000)]
Removed most namespace pollution in this header: don't include <vm/uma.h>;
include <sys/_mutex.h> and its prerequisites instead of <sys/mutex.h> and
its prerequisite.
David Malone [Sun, 15 Sep 2002 15:07:55 +0000 (15:07 +0000)]
Some BIOSs are using MTRR values that are only documented under NDA
to control the mapping of things like the ACPI and APM into memory.
The problem is that starting X changes these values, so if something
was using the bits of BIOS mapped into memory (say ACPI or APM),
then next time they access this memory the machine would hang.
This patch refuse to change MTRR values it doesn't understand,
unless a new "force" option is given. This means X doesn't change
them by accident but someone can override that if they really want
to.
PR: 28418
Tested by: Christopher Masto <chris@netmonger.net>,
David Bushong <david@bushong.net>,
Santos <casd@myrealbox.com>
MFC after: 1 week
Bruce Evans [Sun, 15 Sep 2002 14:17:29 +0000 (14:17 +0000)]
Define __LONG_LONG_SUPPORTED if the compiler claims to support C99.
Don't set __LONG_LONG_SUPPORTED for gcc-1. I didn't check exactly
when gcc started to support long long, but it was in the version
of gcc in FreeBSD-1.0 (gcc-2.4.5).
Other C99 features should be ifdefed similarly, but the ifdefs for
old versions of gcc will be more complicated since the features
weren't in all versions of gcc-2.
Tim J. Robbins [Sun, 15 Sep 2002 08:38:51 +0000 (08:38 +0000)]
Add wcstod() as a wrapper around strtod(). It does not handle any characters
that strtod() does not (alternate digit characters, etc. are not handled).
Bruce Evans [Sun, 15 Sep 2002 08:21:14 +0000 (08:21 +0000)]
Fixed breakage from removing the used include of <sys/buf.h> in the
previous commit:
Include <sys/mutex.h> and its prerequisite <sys/lock.h> instead of
depending on namespace pollution in <sys/buf.h>. Only do this in the
__FreeBSD_version > 500000 case although the __FreeBSD_version < 500000
case has already rotted.
Tim J. Robbins [Sun, 15 Sep 2002 08:06:17 +0000 (08:06 +0000)]
Use the heap instead of the stack to store temporary multibyte string
buffers; this is slower but safer for threaded programs where threads
often have relatively low stack size limits.
Juli Mallett [Sun, 15 Sep 2002 04:45:56 +0000 (04:45 +0000)]
Make a comment reflect less of a lie, NOCPU is used to generally mean that we
are not on a specific CPU in a distributed system, certainly not just for
<struct proc>.p_oncpu, which is of course now <struct kse>.ke_oncpu.
Warner Losh [Sat, 14 Sep 2002 19:15:12 +0000 (19:15 +0000)]
Add additional information returned to userland by the device querying
functions. We add pnpinfo, locationinfo, devflags (the newbus flags
on the device), flags (the flags that device_get_flags returns) and
state to the list of things we return.
pnpinfo and locationinfo are place holders at the moment that will be
filled in by the device's parent (optionally). Userland programs will
likely use this information from time to time and take appropriate
actions.
Move setugidsafety() call outside of process lock. This prevents a lock
recursion when closef() calls pfind() which also wants the proc lock.
This case only occurred when setugidsafety() needed to close unsafe files.
Thomas Moestl [Sat, 14 Sep 2002 18:06:21 +0000 (18:06 +0000)]
Add implementations of fpgetmask(), fpgetround(), fpgetsticky(),
fpsetround(), fpsetsticky(), obtained from NetBSD and tweaked a little
to use definitions from machine/fsr.h instead of magic numbers.
Thomas Moestl [Sat, 14 Sep 2002 18:00:44 +0000 (18:00 +0000)]
Use the definitions in machine/fsr.h instead of duplicating these magic
numbers here (the values need to correspond to the %fsr ones for some
libc functions to work right).
Remove all use of vnode->v_tag, replacing with appropriate substitutes.
v_tag is now const char * and should only be used for debugging.
Additionally:
1. All users of VT_NTS now check vfsconf->vf_type VFCF_NETWORK
2. The user of VT_PROCFS now checks for the new flag VV_PROCDEP, which
is propagated by pseudofs to all child vnodes if the fs sets PFS_PROCDEP.
Relax checking of incoming PPTP GRE packets a bit: ignore a bogus payload
length field when there's no payload indicated by the header 'S' bit.
This works around semi-brokenness in the Mac OS X PPTP client.
Jacques Vidrine [Fri, 13 Sep 2002 20:31:29 +0000 (20:31 +0000)]
When using res_send/res_query/res_search, the caller must either
insure enough space is available for the response, or be prepared
to resize the buffer and retry as necessary.
Do the conservative thing and make sure enough space is available.
Peter Wemm [Fri, 13 Sep 2002 16:33:35 +0000 (16:33 +0000)]
Use a crowbar to move the a.out code out of gcore.c and into its own
file so that we have a chance of using gcore on non-i386 platforms. Use
linker sets to reduce the registration glue. Remove md-sparc.c, we do not
have an a.out sparc32 port. aoutcore.c was repocopied from gcore.c.
Thomas Moestl [Fri, 13 Sep 2002 16:01:26 +0000 (16:01 +0000)]
Add an implementation of fabs() (which is quite trivial).
When it is called directly, gcc is smart enough to generate inline
code for it, which is why it wasn't noticed before that it was missing.
fabs() would probably better fit into libm, but it has traditionally been
in libc on FreeBSD, so there is probably software around that makes
assumptions about this by now.
Thomas Moestl [Fri, 13 Sep 2002 15:15:16 +0000 (15:15 +0000)]
Fix fcntl(..., F_GETOWN, ...) and fcntl(..., F_SETOWN, ...) on sparc64
by not passing a pointer to a register_t or intptr_t when the code in
the lower layers expects one to an int.
Oops, broke the build there. Uninline biodone() now that it is non-trivial.
Introduce biowait() function. Currently there is a race condition and the
mitigation is a timeout/retry. It is not obvious what kind of locking (if any)
is suitable for BIO_DONE, since the majority of users take are of this
themselves, and only a few places actually rely on the wakeup.
Add a couple more of the big/little-endian conversion routines and make
them visible from userland, if need be.
I wish that the C language contained this as part of struct definintions,
but failing that, I would settle for an agreed upon set of functions for
packing/unpacking integers in various sizes from byte-streams which may
have unfriendly alignment.
Bruce A. Mah [Fri, 13 Sep 2002 03:55:31 +0000 (03:55 +0000)]
New release notes: sendfile(2) bugfix + MFC.
Modified release notes: newsyslog(8) now uses bzip2(1) by default.
Move two TCP-related release notes from the general kernel section to
the networking protocols section. Minor wording adjustment in one
item, note MFC of the other.
David E. O'Brien [Thu, 12 Sep 2002 16:05:56 +0000 (16:05 +0000)]
Try to detect support for the `long long' type so that ANSI-C[89] clean
code will know not to try to use `long long'.
Unfortunately the GCC spec parser will not allow us to properly detect the
"iso9899:1990" and "iso9899:199409" forms of the acceptable -std= arguments,
because of the ':' in the -std argument. :-( I have left them in the spec
as a place holder in hopes someone knows a way to make the detection of
them work.
Thomas Quinot [Thu, 12 Sep 2002 15:15:33 +0000 (15:15 +0000)]
Change a couple of splcam() calls that do not make sense in atapi-cam
(what we want to mask is the ATA interrupts, which run at level splbio),
and add interrupt masking around the statement that modifies the
request queue for a SIM.
This resolves problems reported by users under heavy ATAPI load.
Andrew R. Reiter [Thu, 12 Sep 2002 05:00:32 +0000 (05:00 +0000)]
- Fix two obvious locking bugs; 1) returning with lock held when it needed
to be dropped, 2) attempting to lock acct_mtx while already holding it.
Sorry to those who experienced pain.
- Added two comments referring to two areas in which acct_mtx is held over
vnode operations that might sleep. Patch in the works for this.
Luigi Rizzo [Thu, 12 Sep 2002 01:05:46 +0000 (01:05 +0000)]
Make bridging and layer2-ipfw obey net.inet.ip.fw.one_pass.
I should have committed this ages ago.
The MFC for if_ethersubr.c could be done in the usual few days (only
ipfw2 uses it), the one for bridge.c should probably wait until
after 4.7 because it changes an existing though mostly undocumented
behaviour (on which i hope nobody relies). All in all, i'll wait for
both things unless there is demand.
Luigi Rizzo [Thu, 12 Sep 2002 00:45:32 +0000 (00:45 +0000)]
Store the port number in "fwd" rules in host format, same as ipfw1
has always done.
Technically, this is the wrong format, but it reduces the diffs in
-stable. Someday, when we get rid of ipfw1, I will put the port number
in the proper format both in kernel and userland.