Maxime Henrion [Sun, 6 Apr 2003 23:09:57 +0000 (23:09 +0000)]
Because alpha can't access memory in 16-bit granularity,
we're using an atomic operation to clear the suspend flag
in fxp_start(). Since other architectures may need the
same thing, we want to do it all the time and not only
in the __alpha__ case. However, we don't want to use
atomic operations on 16-bit integers, because those may
not be available on any architecture. We're thus faking
a 32-bit atomic operation here. This patch also deals
with endianness here.
Remove the 32KB VHPT section from the kernel image. We don't really
use it because we allocate a VHPT based on the size of the physical
memory and even if the allocated VHPT is 32KB, we don't use the in-
image section for it. Since the VHPT must be naturally aligned, we
save 48K on average (due to alignment).
Consequently, we start off with the VHPT disabled (it is assumed
the VHPT is disabled because the EFI loader runs without memory
address translation and thus has no need to setup the VHPT). It's
probably a good idea to explicitly disable the VHPT if we make the
use of the VHPT optional.
Warner Losh [Sun, 6 Apr 2003 19:11:33 +0000 (19:11 +0000)]
o Tone down the obsolete messages since we actually do something, for
the moment, with the deprecated flags.
o Better error reporting on getting values from the driver. When we can't
get one for the default dumpinfo output. The old driver would succeed
for invalid RIDs, while the new driver reports errors. Since the info
we're getting from the card/driver doesn't exist for all cards, we just
don't report them. Improve error reporting elsewhere now that wi_getval
doesn't exit. Also fix a file descriptor leak as a side effect.
Initialize the PIIX timecounter in piix_attach(), which is called only
once, instead of doing it in piix_probe(), which is called every time
the PCI bus is rescanned.
Use the vis block copy/zero functions for pmap_copy_page and pmap_zero_page.
These are called through function pointers so that different implementations
can be provided for cheetah, where the block load instructions may or may
not be a win, and so they can be disabled with the machdep.use_vis tunable.
In terms of raw bandwidth the integer versions are faster, but not allocating
lines in the L2 cache for useless data gives a measurable improvement in user
time for the benchmarks I tested (mostly buildworld with -j8).
As far as I can tell the instructions used are implemented on everything
back to UltraSPARC I, so there should not be a problem with different cpu
types.
Also set the access bit in the PTE when we get a data dirty bit fault.
This avoids an immediate access bit fault when we serviced the dirty
bit fault in case the access bit is unset. This typically happens for
newly allocated memory that's being zeroed and thus very common.
Peter Wemm [Sun, 6 Apr 2003 05:20:00 +0000 (05:20 +0000)]
Search for "elf32 kernel" (and elf64) and "elf32 module" (and elf64)
as well as "elf kernel" and "elf module". This is a precursor to
x86-64 support in the i386 loader so it can load an elf64 x86-64 kernel.
Warner Losh [Sun, 6 Apr 2003 03:50:28 +0000 (03:50 +0000)]
We can't use ${WORLDTMP}/usr/{include,lib} for the compat layer. This
is because we populate these directories later, and a subsequent
-DNOCLEAN build may fail. So, we put them in
${WORLDTMP}/build/usr/{include,lib} instead and adjust Makefile.boot.
Again, this works on -stable and -current, but might break older
versions.
Maxime Henrion [Sun, 6 Apr 2003 01:04:17 +0000 (01:04 +0000)]
- Instead of rolling our own alignment-safe function, use le32enc()
which deals with both endianness and alignment issues.
- Collect low-hanging fruits for endianness safety.
- Use 0xffffffff instead of -1 where appropriate.
Maxime Henrion [Sat, 5 Apr 2003 23:46:58 +0000 (23:46 +0000)]
- Use __FXP_BITFIELDX macros to make the configuration bitfield
endian safe.
- Change some u_int to u_int8_t which make more sense here since
we're really defining bytes. That produces the same code due to
how bitfields work.
- Add the definition of the vlan_drop_en bit (not used yet).
- Add some useful comments.
Maxime Henrion [Sat, 5 Apr 2003 23:24:23 +0000 (23:24 +0000)]
Use bus_dmamap_load_mbuf() instead of bus_dmamap_load() for the
RX part of this driver too. It's better since the code wasn't
dealing with bus_dmamap_load() returning EINPROGRESS, and this
can't happen with bus_dmamap_load_mbuf().
David Schultz [Sat, 5 Apr 2003 22:11:42 +0000 (22:11 +0000)]
Rework the floating point code in printf(). Significant changes:
- We used to round long double arguments to double. Now we print
them properly.
- Bugs involving '%F', corner cases of '#' and 'g' format
specifiers, and the '.*' precision specifier have been
fixed.
- Added support for the "'" specifier to print thousands' grouping
characters in a locale-dependent manner.
- Implement the __vfprintf() side of hexadecimal floating point
support. All that is still needed is a routine to convert the
mantissa to hex digits one nibble at a time in the style of ultoa().
David Schultz [Sat, 5 Apr 2003 22:10:13 +0000 (22:10 +0000)]
Add __ldtoa(), a wrapper around gdtoa() to make it look like dtoa().
In support of this, add some MD macros to assist in converting long
doubles to the format expected by gdtoa().
David Schultz [Sat, 5 Apr 2003 22:03:43 +0000 (22:03 +0000)]
Correct some buffer sizes.
- __vfprintf()'s 'buf' has never been used for floating point, so
don't define it in terms of (incorrect) constants describing
floating point numbers. The actual size needed depends on
sizeof(uintmax_t) and locale details, so I slightly overestimated.
- We don't need a 308-character buffer to store the string "308".
With long doubles and %a we need more than three characters, though.
Warner Losh [Sat, 5 Apr 2003 20:30:30 +0000 (20:30 +0000)]
Migrate to a new way of dealing with building from old revisions of
FreeBSD. This method attempts to centralize all the necessary hacks
or work arounds in one of two places in the tree (src/Makefile.inc1
and src/tools/build). We build a small compatibility library
(libbuild.a) as well as selectively installing necessary include
files. We then include this directory when building host binaries.
This removes all the past release compatibilty hacks from various
places in the tree. We still build on tip of stable and current. I
will work with those that want to support more, although I anticipate
it will just work.
Many thanks to ru@, obrien@ and jhb@ for providing valuable input at
various stage of implementation, as well as for working together to
positively effect a change for the better.
David Malone [Sat, 5 Apr 2003 15:27:27 +0000 (15:27 +0000)]
More warns cleanups and misc cleanups:
1) Make fetch_mode a pointer 'cos we can just use the optarg.
2) Constness.
3) Add/complete prototypes.
4) Change an int to a socklen_t.
5) Don't use C++ style comments.
6) Check return values from read and fork a little more carefully.
7) Avoid closing an uninitialised int.
8) Get rid of unneeded extern declarations.
Mike Makonnen [Sat, 5 Apr 2003 05:46:43 +0000 (05:46 +0000)]
Zero out the struct tm supplied by the caller. Otherwise,
strange things might happen when garbage values in the struct
get passed in to localtime_r() and family.
Noticed by: marcus
Approved by: markm (mentor)(implicit)
Maxime Henrion [Sat, 5 Apr 2003 01:27:17 +0000 (01:27 +0000)]
Setup our interrupt only at the end of fxp_attach(), when all
other allocations/initializations have been successful. I kinda
doubt it will fix the recent breakage that some people are seeing,
but this could have caused problems for sure.
Define ovbcopy() as a macro which expands to the equivalent bcopy() call,
to take care of the KAME IPv6 code which needs ovbcopy() because NetBSD's
bcopy() doesn't handle overlap like ours.
Remove all implementations of ovbcopy().
Previously, bzero was a function pointer on i386, to save a jmp to
bzero_vector. Get rid of this microoptimization as it only confuses
things, adds machine-dependent code to an MD header, and doesn't really
save all that much.
This commit does not add my pagezero() / pagecopy() code.
Robert Drehmel [Fri, 4 Apr 2003 14:40:49 +0000 (14:40 +0000)]
- Print out an error message instead of dereferencing a NULL pointer
if matchinstalled() found no packages, which happens to be the
case after fresh installations.
- Instead of using strstr(3) to match the package name, depend on
matchinstalled()'s MATCH_REGEX package matching.
Fix mismatch between bus address stored for buffer descriptors and
actual address of buffer descriptor. This should fix the reported
calibration failures and subsequent speed problems with ich chipsets.