fanf [Wed, 9 Oct 2002 19:55:04 +0000 (19:55 +0000)]
Factorize bignums using the Pollard Rho algorithm. The code comes
from NetBSD, altered to retain the FreeBSD -h feature and various
stylistic improvements and avoid regressions. In the absence of
OpenSSL (and therefore bignums) the old code is used.
fanf [Wed, 9 Oct 2002 19:38:55 +0000 (19:38 +0000)]
Style fixes to: #include ordering; use const and static; ANSI functions;
various usage synopses; bogus and/or unnecessary casting; exit values;
use LINE_MAX instead of magic numbers; declare extern variables in a
header; add $FreeBSD$ where missing.
jhb [Wed, 9 Oct 2002 17:17:24 +0000 (17:17 +0000)]
- Move p_cpulimit to struct proc from struct plimit and protect it with
sched_lock. This means that we no longer access p_limit in mi_switch()
and the p_limit pointer can be protected by the proc lock.
- Remove PRS_ZOMBIE check from CPU limit test in mi_switch(). PRS_ZOMBIE
processes don't call mi_switch(), and even if they did there is no longer
the danger of p_limit being NULL (which is what the original zombie check
was added for).
- When we bump the current processes soft CPU limit in ast(), just bump the
private p_cpulimit instead of the shared rlimit. This fixes an XXX for
some value of fix. There is still a (probably benign) bug in that this
code doesn't check that the new soft limit exceeds the hard limit.
jhb [Wed, 9 Oct 2002 17:00:46 +0000 (17:00 +0000)]
Remove 'at' hints for npx and apm as both drivers have identify routines
that add an instance of themselves. The npx(4) driver doesn't even check
the npx 'port' hint but hardcodes IO_NPX instead. The npx(4) driver also
will use isa IRQ 13 (on x86, 8 on pc98) by default if no 'irq' hint is
specified, so we don't need that hint either.
nyan [Wed, 9 Oct 2002 12:01:14 +0000 (12:01 +0000)]
- Remove the splash, ppc, ppbus, plip and em devices from small boot floppy.
- Remove the splash, ch and sa devices from normal boot floppy.
- The agp device does not exist.
peter [Wed, 9 Oct 2002 09:30:57 +0000 (09:30 +0000)]
Fix build on alpha. It used to case an int to a pointer in order to do
pointer arithmetic. Detour via uintptr_t, since we're generating an
offset not dereferencing them.
tjr [Wed, 9 Oct 2002 09:19:28 +0000 (09:19 +0000)]
Add support for the 6 new C99 struct lconv members dealing with formatting
international monetary values: int_p_cs_precedes, int_n_cs_precedes,
int_p_sep_by_space, int_n_sep_by_space, int_p_sign_posn, int_n_sign_posn.
This should not break existing binaries or LC_MONETARY data files.
peter [Wed, 9 Oct 2002 08:54:32 +0000 (08:54 +0000)]
Change BUS_SPACE_UNRESTRICTED (~0ul) to plain ~0 when used in the
'int nsegments' argument to bus_dma_tag_create(). ~0ul does not fit in
an int on machines with 64 bit longs.
mckusick [Wed, 9 Oct 2002 07:28:35 +0000 (07:28 +0000)]
When creating a snapshot, create a list of initially allocated blocks.
Whenever doing a copy-on-write check, first look in the list of
initially allocated blocks to see if it is there. If so, no further
check is needed. If not, fall through and do the full check. This
change eliminates one of two known deadlocks caused by snapshots.
Handling the second deadlock will be the subject of another check-in.
This change also reduces the cost of the copy-on-write check by
speeding up the verification of frequently checked blocks.
mckusick [Wed, 9 Oct 2002 06:13:48 +0000 (06:13 +0000)]
When creating a snapshot, create a list of initially allocated blocks.
Whenever doing a copy-on-write check, first look in the list of
initially allocated blocks to see if it is there. If so, no further
check is needed. If not, fall through and do the full check. This
change eliminates one of two known deadlocks caused by snapshots.
Handling the second deadlock will be the subject of another check-in.
This change also reduces the cost of the copy-on-write check by
speeding up the verification of frequently checked blocks.
mckusick [Wed, 9 Oct 2002 04:01:23 +0000 (04:01 +0000)]
The appropriate units for disk block addresses are always DEV_BSIZE,
even when the underlying device has a larger sector size. Therefore,
the filesystem code should not (and with this patch does not) try to
use the underlying sector size when doing disk block address calculations.
This patch fixes problems in -current when using the swap-based
memory-disk device (mdconfig -a -t swap ...). This bugfix is not
relevant to -stable as -stable does not have the memory-disk device.
jmallett [Wed, 9 Oct 2002 03:42:10 +0000 (03:42 +0000)]
Convert make(1) to use ANSI style function declarations. Variable
documentation already adequatedly existed in the description in most
cases. Where it did not, it was added. If no documentation existed
beforehand, then none was added. Some unused dummies for use in the
traversal functions were marked as __unused during the conversion.
Occasionally, local style fixes were applied to lines already being
modified or influenced.
julian [Wed, 9 Oct 2002 02:33:36 +0000 (02:33 +0000)]
Round out the facilty for a 'bound' thread to loan out its KSE
in specific situations. The owner thread must be blocked, and the
borrower can not proceed back to user space with the borrowed KSE.
The borrower will return the KSE on the next context switch where
teh owner wants it back. This removes a lot of possible
race conditions and deadlocks. It is consceivable that the
borrower should inherit the priority of the owner too.
that's another discussion and would be simple to do.
Also, as part of this, the "preallocatd spare thread" is attached to the
thread doing a syscall rather than the KSE. This removes the need to lock
the scheduler when we want to access it, as it's now "at hand".
DDB now shows a lot mor info for threaded proceses though it may need
some optimisation to squeeze it all back into 80 chars again.
(possible JKH project)
Upcalls are now "bound" threads, but "KSE Lending" now means that
other completing syscalls can be completed using that KSE before the upcall
finally makes it back to the UTS. (getting threads OUT OF THE KERNEL is
one of the highest priorities in the KSE system.) The upcall when it happens
will present all the completed syscalls to the KSE for selection.
jmallett [Wed, 9 Oct 2002 02:00:22 +0000 (02:00 +0000)]
Use __FBSDID in the lst.lib files, to match to main make(1) files. It is
defined to __RCSID when bootstrapping, by the Makefile, but this change is
for consistency
jmallett [Tue, 8 Oct 2002 20:19:26 +0000 (20:19 +0000)]
Remove the wargames(6) novelty [and not the fun kind]:
1) It never was very funny.
2) It was a N line shell script where N is less than
X, where X is the number of lines of the Berkeley
copyright and license.
3) I rewrote it in C with the intention of making it
more interactive, ala the movie, but never did.
4) Because it really is possible for at least some
parts of a distribution to shrink between releases.
X-No-MFC: This game will remain in RELENG_4 and previous.
X-Bikesheds-To: markm@
Approved by: The #bsdcode cabal.
Obtained from: Professor Falken
sos [Tue, 8 Oct 2002 18:25:10 +0000 (18:25 +0000)]
Fix for the panic when using a Promise TX2.
The problem is that the code does a check for the granparent of
the Promise chip, if this is a bridge of the right type, we have
a TX4 on our hands, and need to handle that ones "issues".
Now the grandparent check cause subtle bugs in the newbus system,
mainly that pci_get_devid doesn't return an error value.
This patch works around the issue by using BUS_READ_IVAR() instead.
ken [Tue, 8 Oct 2002 17:12:44 +0000 (17:12 +0000)]
Fix the location of the length bytes in the 12-byte read/write CDB
structure. This has been broken since 1998, but probably hasn't been
noticed because it takes a read/write of 64K blocks (32MB with 512 byte
blocks) to trigger using the 12 byte read/write CDB in scsi_read_write().
Submitted by: "Moore, Eric Dean" <emoore@lsil.com>
MFC after: 3 days
phk [Tue, 8 Oct 2002 15:46:45 +0000 (15:46 +0000)]
It seems that the only problem with UFS2 booting on i386 is the 64bit
divide/remainder calls. For reasons not resolved, compiling the
relevant routines from libkern into boot2 results in stack corruption.
Do the simple thing: Don't use 64bit divide/remainder operations.
green [Tue, 8 Oct 2002 12:09:16 +0000 (12:09 +0000)]
Reinstate rev 1.36 with an important line that got missed. Note this
also improves the "random undocumented offsets into various memory
spaces" a little bit.
tjr [Tue, 8 Oct 2002 11:22:49 +0000 (11:22 +0000)]
Do not strip CTL* escapes from redirection filenames in argstr(); they
are later stripped with rmescapes() in expandarg(). If the filename has
already been unescaped, doing it again in rmescapes() can walk off the
end of the string, leading to memory corruption and eventually SIGSEGV.
bmah [Tue, 8 Oct 2002 05:15:21 +0000 (05:15 +0000)]
Teach pkg_add -r how to find 4.7-RELEASE packages with an appropriate
osreldate.
(Actually, due to differences in package compression formats, I'm
not sure that a -CURRENT pkg_add -r will do the right thing in
this case, once it finds them.)
Import the libc fnmatch() into the kernel. This will be used by,
among other things, the DEVFS rule subsystem to match nodes against a
path pattern supplied by the user.
fnmatch.c was repo-copied from src/lib/libc/gen/fnmatch.c, and the
only changes to it are those necessary to make it compile in the
kernel. The relevant parts of fnmatch.h were imported into libkern.h.
imp [Tue, 8 Oct 2002 03:53:52 +0000 (03:53 +0000)]
Make kldunload cbb work:
o Implement the thread killing interlock as described by jhb in arch@
while talking to markm.
o Hold Giant around cbb_insert()/cbb_remove(). Deep in the belly of
the vm code we panic if we don't hold this when we activate the memory
for reading the CIS.
o If we had to do the kludge alloc, then do a kludge free.
imp [Mon, 7 Oct 2002 23:17:44 +0000 (23:17 +0000)]
Introducing /dev/devctl. This device reports events in the
configuration device hierarchy. Device arrival, departure and not
matched are presently reported. This will be the basis for devd, which
I still need to polish a little more before I commit it. If you don't
use /dev/devctl, it will be a noop.
imp [Mon, 7 Oct 2002 23:15:40 +0000 (23:15 +0000)]
Two minor bugfixes:
o Allow the bus_debug variable to be set via the bus.debug tunable.
o Return pnpinfo and location info via the devinfo interface to userland.
devinfo(8) needs to be updated to print it.
imp [Mon, 7 Oct 2002 23:11:29 +0000 (23:11 +0000)]
MFp4:
o Better resume code. Move the comments around. Force the socket state to
be querried. Ack the interrupts properly.
o Intercept the interrupt requests and keep a list of interrupts to service
ourselves. When the card attaches, set its OK bit. When we get a card
status change interrupt for that card, clear the OK bit. Don't call the
ISR if the OK bit is cleared. Iwasaki-san and yamamoto-san have both
sent me patches that fix the same problem this fixes, but at the pccard
level.
o Try to get the signalling of the thread to actually die. This might not be
100% right, but it is less wrong than before.
o Add a SIC next to a TI type that looks like it could be wrong, but isn't.
imp [Mon, 7 Oct 2002 23:05:33 +0000 (23:05 +0000)]
o Add a nomatch routine so we whine when we don't know what to attach to
the card.
o Add comments about how we're doing the CIS activation.
o Add location and pnp info functions.
o Add better code to hopefully deal with ata cards better (and other drivers
that allocate resources that we didn't preallocate from the CIS). OLDCARD
used to allow it, but NEWCARD was pickier. I'm not 100% sure this works,
but it doesn't break anything.
imp [Mon, 7 Oct 2002 23:03:17 +0000 (23:03 +0000)]
Merge changes from NetBSD through version 1.17 of this file. These
give us slightly better error checking than before and interpret what
default bits mean better. See the NetBSD CVS tree for the authors of
these changes (revs 1.10 .. 1.17).
imp [Mon, 7 Oct 2002 23:00:51 +0000 (23:00 +0000)]
o Add routines to return the location and pnpinfo for this card.
Note, we return the PCI pnp info, but in fact that's wrong to do
since that data is not defined for CardBus cards. CardBus says that
these registers are undefined and one should use the CIS to do
device matching. To date, all CardBus cards have had these
registered defined, no doubt because they are using common silicon
to produce both the PCI cards and the CardBus cards. However, it isn't
any worse than the rest of the system, so just note it in passing and
move on.
o Also sort prototypes while I'm here.
imp [Mon, 7 Oct 2002 22:58:24 +0000 (22:58 +0000)]
Don't abuse the fact that -a == ~a + 1. Signed vs unsigned checkers
complain when a is a unsigned type. So instead use the latter here
and be on our way.
thomas [Mon, 7 Oct 2002 21:18:20 +0000 (21:18 +0000)]
Document behaviour change in reboot(8) introduced in reboot.c rev. 1.17:
when using '-p' with reboot, and the power down action failds, reboot
the system normally. The behaviour of 'halt -p' and of shutdown(8) is
unchanged.
iedowse [Mon, 7 Oct 2002 20:49:22 +0000 (20:49 +0000)]
Add back a fdrop() call at the end of kern_open() that got lost in
revision 1.218. This bug caused a "struct file" reference to be
leaked if VOP_ADVLOCK(), vn_start_write(), or mac_check_vnode_write()
failed during the open operation.
PR: kern/43739
Reported by: Arne Woerner <woerner@mediabase-gmbh.de>
sam [Mon, 7 Oct 2002 20:02:34 +0000 (20:02 +0000)]
Track openbsd changes that don't affect us yet (PK supoprt is
currently disabled):
o Don't use constants for the output parameter, use the iparam count as a
pointer to the first result location.
o Fix bits vs bytes counting problems.
o Split out the hardware and software normalization versions of modexp.
o Enable hardware normalization for chips that support it.
o On reset, disable hardware normalization for 582x and make sure the
chip is in little endian mode.
o Since sw normalization is now the only option, simplify normalization
handling.
Also fix RNG harvesting: disabling PK support (for the moment) had disabled
the MCR2 interrupt; consider both KEY support and RNG support when deciding
whether or not to enable it.
phk [Mon, 7 Oct 2002 19:12:36 +0000 (19:12 +0000)]
Correctly adjust for moved start address.
It seems that the existence of a "depend" target in src/sys/boot is not
to be taken as an indication that it actually does what one would expect,
at least it clearly threw my testing off.
sam [Mon, 7 Oct 2002 18:46:38 +0000 (18:46 +0000)]
o split crypto_proc into two threads: one for processing requests and one
for processing callbacks. This closes race conditions caused by locking
too many things with a single mutex.
o reclaim crypto requests under certain (impossible) failure conditions