David Schultz [Sun, 2 May 2004 10:55:06 +0000 (10:55 +0000)]
- To make it easier to compile *printf() and *scanf() without
floating-point support, remove default definition of FLOATING_POINT
from the source, and change the compile-time option to
NO_FLOATING_POINT.
- Remove the HEXFLOAT option. It saves an insignificant amount of
space (<0.1% of the size of libc on i386) and complicates vfprintf()
and checkfmt().
David Schultz [Sun, 2 May 2004 10:55:05 +0000 (10:55 +0000)]
When *printf() and *scanf() are compiled without floating-point
support, fmtcheck() should not accept format strings that contain
floating-point formats.
Sean Kelly [Sun, 2 May 2004 07:07:54 +0000 (07:07 +0000)]
- style(9) improvements courtesy of bde.
- Revise the former commit to behave nicer on filenames containing
multiple '.' characters.
- Prevent the generation of macros starting with "__".
Darren Reed [Sun, 2 May 2004 06:36:30 +0000 (06:36 +0000)]
Rename ip_claim_next_hop() to m_claim_next_hop(), give it an extra arg
(the type of tag to claim) and push it out of ip_var.h into mbuf.h alongside
all of the other macros that work ok mbuf's and tag's.
Bruce Evans [Sun, 2 May 2004 05:21:29 +0000 (05:21 +0000)]
Switch to using the moved cy driver (adjust pathnames and remove "count"
parameter).
Keep using it only in the i386 NOTES for now. It is fairly MI, but it
doesn't use bus-space and has a couple of i386 i/o instructions in pci
intitialization.
Scott Long [Sun, 2 May 2004 03:33:18 +0000 (03:33 +0000)]
Remove the defAlignLong and getAlignLong macros. I guess that the original
intent was to make sure that message structs allocated off of the stack were
4-byte aligned. However, the macros as defined did absolutely nothing.
And since I2O forces you to manually copy messages down to the hardware, there
really is no point of enforced alignment anyways.
Tim Kientzle [Sun, 2 May 2004 00:43:02 +0000 (00:43 +0000)]
A security issue: An archive containing a symlink to another
directory, then a file with that symlink as a prefix can drop a file
outside of the current directory, which can be a security hole.
Plug this hole by refusing to extract files if a prefix of the
pathname is a symlink. The -P option disables this check.
Scott Long [Sun, 2 May 2004 00:27:54 +0000 (00:27 +0000)]
Remove the bogus printing of the asr control device major number. Also
rename the control device from rasr%d to asr%d. This starts us down the
path of divorcing ourselves from a very bogus design in the management
apps. Since the apps are open source now, they will likely be updated
and fixed before 5.3.
Build gpt(8) on all platforms, except sparc64. Currently gpt(8) is
not endian agnostic and thus will create big-endian GPTs on sparc64.
This we don't support. So, before gpt(8) can be used on a big-endian
machine, it has to deal with the endianness.
Bruce Evans [Sat, 1 May 2004 18:09:16 +0000 (18:09 +0000)]
Adjust pathnames for the move from i386/isa to dev/cy.
Adjust staticness and a variable name for the split of cy.c into cy.c and
cy_isa.c. Use the new header required for the split to avoid repeating
declarations in cy_pci.c.
Bruce Evans [Sat, 1 May 2004 17:44:03 +0000 (17:44 +0000)]
New header for exporting declarations of things not closely related to
hardware. A couple of the declarations were misplaced in cy_pci.c, and
cy_isa.c needs a couple more. The exported interfaces should be cleaner.
Bruce Evans [Sat, 1 May 2004 17:21:07 +0000 (17:21 +0000)]
Removed bits related to isa configuration. These have been moved to
cy_isa.c via a repo-copy of this file (except for some static declarations
which will become non-static in a new header).
Scott Long [Sat, 1 May 2004 05:56:57 +0000 (05:56 +0000)]
Remove ASR_get_sc() and reference the softc in the dev_t. For some nefarious
reason, the I2O protocol requires knowledge of all I2O devices in the system,
so we can't get rid of the evil linked-list of softc's yet.
Scott Long [Sat, 1 May 2004 02:27:06 +0000 (02:27 +0000)]
Many more style cleanups. Switch complex macros to being inline functions.
Put @includes in a better spot. Fix many cases of 2 space indents and spaces
between a function name and the parens. Use KASSERT instead of a home-rolled
ASSERT. Remove some undeeded caddr casts.
Scott Long [Sat, 1 May 2004 01:25:05 +0000 (01:25 +0000)]
Get rid of a bunch of useless macros. STATIC becomes static, INLINE becomes
__inline where appropriate and gets nuked elsewhere, IN/OUT/INOUT go away.
Reformat code affected by this.
For both ifconfig and route if we didn't get enough memory from the
prior sysctl due to the structure growing between calls try again.
Also try again for deleting routes if things fail. We've seen
route -f fail this way which does not actually flush all routes.
This fixes it. It will whine but it will do the work.
Some enhancements and bug fix.
- Define option FORCECONSPEED to force the serial console to
be CONSPEED. I've run into a lot of boards in which
the detect for prior speed doesn't work and ends up with
broken console since it is at the wrong speed.
- If a serial port is marked as a console, but console=vidconsole
and if the serial ports doesn't exist it will be probed and
attached at a 8250 chip. Then writes to that will freeze the
system.
- Add an option flags 0x400000 to mark this as a potential
comconsole in-case the one flaged with 0x10 does not exist
in the system.
This makes it easier to deploy on systems with one or two serial ports.
Bill Paul [Fri, 30 Apr 2004 20:51:55 +0000 (20:51 +0000)]
Small timer cleanups:
- Use the dh_inserted member of the dispatch header in the Windows
timer structure to indicate that the timer has been "inserted into
the timer queue" (i.e. armed via timeout()). Use this as the value
to return to the caller in KeCancelTimer(). Previously, I was using
callout_pending(), but you can't use that with timeout()/untimeout()
without creating a potential race condition.
- Make ntoskrnl_init_timer() just a wrapper around ntoskrnl_init_timer_ex()
(reduces some code duplication).
- Drop Giant when entering if_ndis.c:ndis_tick() and
subr_ntorkrnl.c:ntoskrnl_timercall(). At the moment, I'm forced to
use system callwheel via timeout()/untimeout() to handle timers rather
than the callout API (struct callout is too big to fit inside the
Windows struct KTIMER, so I'm kind of hosed). Unfortunately, all
the callouts in the callwhere are not marked as MPSAFE, so when
one of them fires, it implicitly acquires Giant before invoking the
callback routine (and releases it when it returns). I don't need to
hold Giant, but there's no way to stop the callout code from acquiring
it as long as I'm using timeout()/untimeout(), so for now we cheat
by just dropping Giant right away (and re-acquiring it right before
the routine returns so keep the callout code happy). At some point,
I will need to solve this better, but for now this should be a suitable
workaround.
Thomas Moestl [Fri, 30 Apr 2004 19:50:51 +0000 (19:50 +0000)]
Some cleanups to the nexus code:
- Remove second license, the first was not that different and should be
fine.
- Add nexus_attach(), and do not perform its task in nexus_probe() any
more.
- Remove nexus_write_ivar(), since it was quite pointless.
- Remove superfluous devinfo members.
- Clean up some comments, minor style issues and prototypes.
Tim Kientzle [Fri, 30 Apr 2004 18:17:51 +0000 (18:17 +0000)]
Speed up hardlink detection by using a self-sizing hash
table rather than the old linear list search.
On my "hardlink detection torture test", this reduced
user time from 4700 seconds down to 4.2 seconds
and wallclock time from 1:24:48 down to 1:08.
(Yes, that's over one THOUSAND times reduction in user time. ;-)
In the worst case, the new code doubles peak memory usage,
though it could actually reduce memory usage in many cases.
Thomas Moestl [Fri, 30 Apr 2004 17:25:47 +0000 (17:25 +0000)]
Remove the sio EBus attachment, which never worked with an unpatched
driver because sio(4) uses ISA-specific functions. uart(4) has full
support for the respective hardware and should be used instead.
Peter Wemm [Fri, 30 Apr 2004 16:32:40 +0000 (16:32 +0000)]
Checkpoint commit for an alternative WIP kernel module loader that isn't
as dependent on binutils features/quirks as the current one. This one
loads plain .o files without having to mess with shared object mode.
This happens to be essential on amd64, because binutils hasn't implemented
all the quirks/features that we need for producing the hack non-PIC shared
objects. As it turned out, .o format isn't all that inconvenient after
all. It looks like the ability to use the same .o files for linking
directly into a static kernel or loading as a module might be worth it.
It is still very much a work-in-progress, but it is almost usable. Other
changes are still needed in order to use it though, these have not been
committed yet. There is still a memory corruption/overrun bug somewhere.
For example, test modules load and work, but the machine explodes a few
minutes later in vm_forkproc() or the like. Notable missing things
include kldxref support, and loader(8) support. I wanted to figure out
a working baseline set of code first.
Ken Smith [Fri, 30 Apr 2004 13:52:09 +0000 (13:52 +0000)]
Sorry for doing this backwards, but as with most release related stuff
we only pay attention to it during release time and at the moment it's
a -stable release in progress.
This is a MFS I guess, moving rev 1.536.2.113 to HEAD. I ran out of
time to follow through with doing this last night. Sorry for the delay.
Adding a couple of variables to make tweaking the CD-ROM label and .iso
filenames easier.
Allow disks with a GPT to be used on big-endian machines. The GPT is
little-endian by definition and needs byte-swap operations for any
multi-byte field. While here fix indentation.
Ruslan Ermilov [Thu, 29 Apr 2004 18:58:38 +0000 (18:58 +0000)]
Convert block comments into C-style that is understood by cpp(1).
Keep line comments in assembler style. A few lines that match
the '^[[:space:]]+#' regexp still need to be fixed, somehow.
Revert previous change to this file because it breaks some
things which compare /etc/fstab entries to results from
getfsstat(). The real way to fix this is to make 'ufs2'
a recognized filesystem (for real, no beating around the
bush).
This should fix things like 'umount -a -t ufs' now.
Appologies for the previous breakage.
Tim Kientzle [Thu, 29 Apr 2004 05:19:42 +0000 (05:19 +0000)]
Implement ARCHIVE_EXTRACT_UNLINK for regular files. This supports the
-U flag to bsdtar. Essentially, this option breaks existing hard
links. According to SUSv2, tar is supposed to overwrite existing
files on extract by default which, in particular, preserves
existing hard links. Note that this is yet another bug in gtar; it
appears to always break existing links. (Maybe gtar's -U is broken?)
I'm unsure about how to handle this for other file types; the current
code always unlinks first unless the NO_OVERWRITE flag is specified.
I've commented this issue liberally and will come back to it later.
Daniel Eischen [Wed, 28 Apr 2004 20:36:53 +0000 (20:36 +0000)]
Keep track of threads waiting in kse_release() to avoid a race
condition where kse_wakeup() doesn't yet see them in (interruptible)
sleep queues. Also add an upcall check to sleepqueue_catch_signals()
suggested by jhb.
This commit should fix recent mysql hangs.
Reviewed by: jhb, davidxu
Mysql'd by: Robin P. Blanchard <robin.blanchard at gactr uga edu>
Ruslan Ermilov [Wed, 28 Apr 2004 14:31:44 +0000 (14:31 +0000)]
After talking to Bruce Evans and reading more standards specs,
switch to using C99-style comments everywhere in preprocessed
assembler. The reason is that lines starting with the regexp
'^[[:space:]]#' are treated as preprocessing directives, and
while it seems to work now with GCC, it's not necessarily has
to work. Use C99 comments `//' for the trailing comments to
save whitespace.
Protect som cross-script invocations by checks to see that the target
script exists. This allows pruning of rc.d scripts without getting
too many ugly boottime error message
Initdiskless must run before ipfw, or people will not be able to
use the conf/* stuff for their firewall configuration.
Running ipfw before could seem to make sense in that it would allow
one to setup access to the NFS server on a "default-deny" kernel,
but it is pretty obvious to the casual observer that such a configuration
never makes it far enough to mount the NFS-root in the first place.
Thomas Moestl [Wed, 28 Apr 2004 13:06:46 +0000 (13:06 +0000)]
Fix the EBus driver to work with the new PCI code. Unlike other PCI
bridges, the EBus bridge has resource ranges it claims exclusively to
map its children into in its BARs. Hence, we need to allocate these
completely and manage them for the children, instead of just passing
allocations through to the PCI layer as we did before.
While being there, split ebus_probe(), which did also contain code
normally belonging into the attach method, into ebus_probe() and
ebus_attach(), and perform some minor cleanups.