Mitsuru IWASAKI [Tue, 1 Oct 2002 19:31:09 +0000 (19:31 +0000)]
Don't call INT 12H anymore in boot program.
Many recent machine have a broken INT 12H (Get base memory size)
implementation and boot program stops if INT 12H is called.
This commit should solve the problem at very first step of FreeBSD
installation occurred on newer some machines.
John Baldwin [Tue, 1 Oct 2002 14:10:08 +0000 (14:10 +0000)]
- Adjust comment noting that handling of CPU limit exhaustion is done in
ast().
- Actually set KEF_ASTPENDING so ast() is called. I think this is buggy
for a process with multiple KSE's in that PS_XCPU is not a KSE event,
it's a process-wide event. IMO there really should probably be two
ASTPENDING flags, one for per-process, and one for per-KSE.
Bruce Evans [Tue, 1 Oct 2002 13:44:15 +0000 (13:44 +0000)]
Changed "file system" back to "filesystem" in the usage message. English
rules don't apply to tokens that are supposed to represent single args.
This was only fixed in the man page.
Fixed other differences between the man page and the usage message (1
formatting bug and 1 syntax bug).
Bruce Evans [Tue, 1 Oct 2002 13:28:24 +0000 (13:28 +0000)]
Removed the only PCI_DEBUG ifdef in the kernel. PCI_DEBUG was not a
supported option and it disabled a whole 2 lines of bootverbose messages.
I wanted to see 1 of the messages (about the latency timers). This
is a wrong place to decode pci configurations, but the code is already
here and handles more details than pciconf(8).
Tim J. Robbins [Tue, 1 Oct 2002 13:22:12 +0000 (13:22 +0000)]
Replace a home-grown printf() clone with a fwopen() wrapper around
libc's vfprintf() that writes to a `struct output' instead of a file.
Inspired by NetBSD's similar changes (they used asprintf() instead).
Bruce Evans [Tue, 1 Oct 2002 11:44:35 +0000 (11:44 +0000)]
Fixed a last-minute editing error in previous commit. nfs and/or cvs
replaced a 14-byte change in the middle of the file with 14 NULs at EOF
despite or because of aborting the initial commit to pick up the change.
Bruce Evans [Tue, 1 Oct 2002 11:34:42 +0000 (11:34 +0000)]
Merged all interesting difference between the old math.h and the current
one into the latter and removed the former.
This works around the bug that some broken Makefiles add -I.../src/include
to CFLAGS, resulting in the old math.h being preferred and differences
between the headers possibly being fatal.
The merge mainly involves declaring some functions as __pure2 although
they are not yet all strictly free of side effects.
Maxime Henrion [Tue, 1 Oct 2002 08:40:07 +0000 (08:40 +0000)]
Use the %t format modifier to print differences between
pointers. This fixes two format warnings on 64 bits
archs which are fatal now that WFORMAT=0 has been removed.
It doesn't fully fix the sh(1) build on 64 bits platforms
though, there is still some quad_t issues that need to be
fixed.
Tim J. Robbins [Tue, 1 Oct 2002 07:26:35 +0000 (07:26 +0000)]
Remove WARNS=0 and WFORMAT=0. The shell compiles cleanly at WARNS=2
on at least i386. If there are warnings on other archs, I'd rather hear
about them than pretend they didn't exist.
Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:
Peter had repocopied sys/disklabel.h to sys/diskpc98.h and sys/diskmbr.h.
These two new copies are still intact copies of disklabel.h and
therefore protected by #ifndef _SYS_DISKLABEL_H_ so #including them
in programs which already include <sys.disklabel.h> is currently a
no-op.
This commit adds a number of such #includes.
Once I have verified that I have fixed all the places which need fixing,
I will commit the updated versions of the three #include files.
Jake Burkholder [Tue, 1 Oct 2002 06:34:21 +0000 (06:34 +0000)]
Get rid of the TODO macro in the few places that still need work; either
comment it out or change to explicit panics. It conflicts with things
like #if TODO in drivers.
Robert Watson [Tue, 1 Oct 2002 04:30:19 +0000 (04:30 +0000)]
Improve locking of pipe mutexes in the context of MAC:
(1) Where previously the pipe mutex was selectively grabbed during
pipe_ioctl(), now always grab it and then release if if not
needed. This protects the call to mac_check_pipe_ioctl() to
make sure the label remains consistent. (Note: it looks
like sigio locking may be incorrect for fgetown() since we
call it not-by-reference and sigio locking assumes call by
reference).
(2) In pipe_stat(), lock the pipe if MAC is compiled in so that
the call to mac_check_pipe_stat() gets a locked pipe to
protect label consistency. We still release the lock before
returning actual stat() data, risking inconsistency, but
apparently our pipe locking model accepts that risk.
(3) In various pipe MAC authorization checks, assert that the pipe
lock is held.
(4) Grab the lock when performing a pipe relabel operation, and
assert it a little deeper in the stack.
Juli Mallett [Tue, 1 Oct 2002 03:19:49 +0000 (03:19 +0000)]
Until I find a way to release arbitrary locks held when sending signals (there
really should not be some), use the M_NOWAIT flag to malloc(9), and panic(9)
if malloc(9) fails.
Juli Mallett [Tue, 1 Oct 2002 02:49:28 +0000 (02:49 +0000)]
When working with sigset_t's, and needing to perform masking operations based
on a process's pending signals, use the signal queue flattener,
ksiginfo_to_sigset_t, on the process, and on a local sigset_t, and then work
with that as needed.
Robert Watson [Tue, 1 Oct 2002 02:35:59 +0000 (02:35 +0000)]
Reserve system call numbers for the following system calls:
__mac_get_pid Retrieve MAC label of a process by pid
Similar to __mac_get_proc() except that the target process of
the operation is explicitly specified rather than assuming
curthread.
__mac_get_link Retrieve MAC label of a path with NOFOLLOW
__mac_set_link Set MAC label of a path with NOFOLLOW
extattr_set_link Set EAs on a path with NOFOLLOW
extattr_get_link Retrieve EAs on a path with NOFOLLOW
extattr_delete_link Delete EAs on a path with NOFOLLOW
These calls are similar to __mac_get_file(), __mac_set_file(),
extattr_set_file(), extattr_get_file(), and extattr_delete_file(),
except that they do not follow symlinks. The distinction between
these calls is similar to lchown() vs chown().
Tim J. Robbins [Tue, 1 Oct 2002 00:54:14 +0000 (00:54 +0000)]
Remove bits and pieces of support for atty, which was made obsolete by
adding history and vi/emacs-style line editing to the shell itself.
Atty was a user-mode terminal emulator (like screen and window) that did
line editing and history.
Brooks Davis [Tue, 1 Oct 2002 00:52:58 +0000 (00:52 +0000)]
Use if_printf(ifp, "blah") instead of printf("fe%d: blah", ifp->if_unit).
A number of functions in this driver still use the unit number in their
printouts because they pass the unit directly as a function argument
instead of passing a softc or struct ifnet pointer. This should be
resolved at a future date.
Juli Mallett [Tue, 1 Oct 2002 00:07:28 +0000 (00:07 +0000)]
(Forced commit, to clarify previous commit of ksiginfo/signal queue code.)
I've added a structure, kernel-private, to represent a pending or in-delivery
signal, called `ksiginfo'. It is roughly analogous to the basic information
that is exported by the POSIX interface 'siginfo_t', but more basic. I've
added functions to allocate these structures, and further to wrap all signal
operations using them.
Once the operations are wrapped, I've added a TailQ (see queue(3)) of these
structures to 'struct proc', and all pending signals are in that TailQ. When
a signal is being delivered, it is dequeued from the list. Once I finish
the spreading of ksiginfo throughout the tree, the dequeued structure will be
delivered to the process in question, whereas currently and normally, the
signal number is what is used.
Juli Mallett [Mon, 30 Sep 2002 21:40:33 +0000 (21:40 +0000)]
The list of queued signals is not, can not, and will not be exported to the
userland. If someone wants to implement a backup p_siglist in the kernel
for compatability and to export one could. For now, just tell KVM to hand
an empty signal set off to the userland.
John Baldwin [Mon, 30 Sep 2002 21:13:54 +0000 (21:13 +0000)]
- Add a new per-process flag PS_XCPU to indicate that at least one thread
has exceeded its CPU time limit.
- In mi_switch(), set PS_XCPU when the CPU time limit is exceeded.
- Perform actual CPU time limit exceeded work in ast() when PS_XCPU is set.
John Baldwin [Mon, 30 Sep 2002 21:08:38 +0000 (21:08 +0000)]
Change p_cpulimit to be in seconds instead of microseconds. Since
p_runtime now is a bintime, it is no longer an optimization to store
p_cpulimit as microseconds.
Robert Watson [Mon, 30 Sep 2002 20:51:48 +0000 (20:51 +0000)]
Move vnode MAC label initialization to after the release of the vnode
interlock in getnewvnode() to avoid possible sleeps while holding
the mutex. Note that the warning from Witness is a slight false
positive since we know there will be no contention on the interlock
since we haven't made the vnode available for use yet, but the theory
is not a bad one.
Juli Mallett [Mon, 30 Sep 2002 20:48:29 +0000 (20:48 +0000)]
Convert use of p_siglist and old SIG*() macros to use <sys/ksiginfo.h>
prototyped functions to get a sigset_t, and further to check for any
queued signals, rather than an empty signal set, to go with the move
to signal queues rather than signal sets.
Juli Mallett [Mon, 30 Sep 2002 20:20:22 +0000 (20:20 +0000)]
First half of implementation of ksiginfo, signal queues, and such. This
gets signals operating based on a TailQ, and is good enough to run X11,
GNOME, and do job control. There are some intricate parts which could be
more refined to match the sigset_t versions, but those require further
evaluation of directions in which our signal system can expand and contract
to fit our needs.
After this has been in the tree for a while, I will make in kernel API
changes, most notably to trapsignal(9) and sendsig(9), to use ksiginfo
more robustly, such that we can actually pass information with our
(queued) signals to the userland. That will also result in using a
struct ksiginfo pointer, rather than a signal number, in a lot of
kern_sig.c, to refer to an individual pending signal queue member, but
right now there is no defined behaviour for such.
CODAFS is unfinished in this regard because the logic is unclear in
some places.
Matthew Dillon [Mon, 30 Sep 2002 18:55:45 +0000 (18:55 +0000)]
Guido found another bug. There is a situation with
timestamped TCP packets where FreeBSD will send DATA+FIN and
A W2K box will ack just the DATA portion. If this occurs
after FreeBSD has done a (NewReno) fast-retransmit and is
recovering it (dupacks > threshold) it triggers a case in
tcp_newreno_partial_ack() (tcp_newreno() in stable) where
tcp_output() is called with the expectation that the retransmit
timer will be reloaded. But tcp_output() falls through and
returns without doing anything, causing the persist timer to be
loaded instead. This causes the connection to hang until W2K gives up.
This occurs because in the case where only the FIN must be acked, the
'len' calculation in tcp_output() will be 0, a lot of checks will be
skipped, and the FIN check will also be skipped because it is designed
to handle FIN retransmits, not forced transmits from tcp_newreno().
The solution is to simply set TF_ACKNOW before calling tcp_output()
to absolute guarentee that it will run the send code and reset the
retransmit timer. TF_ACKNOW is already used for this purpose in other
cases.
For some unknown reason this patch also seems to greatly reduce
the number of duplicate acks received when Guido runs his tests over
a lossy network. It is quite possible that there are other
tcp_newreno{_partial_ack()} cases which were not generating the expected
output which this patch also fixes.
X-MFC after: Will be MFC'd after the freeze is over
John Baldwin [Mon, 30 Sep 2002 18:47:11 +0000 (18:47 +0000)]
- Give legacy an identify routine that always adds 'legacy0' at an order
of 1 so that it is not probed until after acpi0 is probed and attached.
- In legacy_probe(), return ENXIO if acpi0 is around and alive.
- nexus_attach() is now much simpler and just lets its child drivers do
all the work.
John Baldwin [Mon, 30 Sep 2002 18:45:20 +0000 (18:45 +0000)]
Trash the PnPBIOStable pointer later on when we know that the acpi probe
and attach routines have succeeded so that if they fail we can still use
the PnP BIOS to find ISA on-board devices. The fact that we do this here
is gross but fixing it properly involves a lot more work.
Josef Karthauser [Mon, 30 Sep 2002 17:50:18 +0000 (17:50 +0000)]
In rev 1.51 of usb_port.h I switched over to using the USB_USE_SOFTINTR
code path to fix a bug in the non USB_USE_SOFTINTR path that caused
the usb bus to hang and generally misbehave when devices were unplugged.
In the process though it also reduced the throughput of usb devices because
of a less than optimal implementation under FreeBSD.
This commit fixes the non USB_USE_SOFTINTR code in uhci and ohci
so that it works again, and switches back to using this code path.
The uhci code has been tested, but the ohci code hasn't. It's
essentially the same anyway and so I don't envisage any difficulties.
Code for uhci submitted by: Maksim Yevmenkin <myevmenk@exodus.net>