cognet [Thu, 30 Nov 2006 23:30:40 +0000 (23:30 +0000)]
Introduce CPU_XSCALE_CORE3, as XScale Core 3 is significally different than
regular Xscale (it has no mini data cache, has armv6-style 16MB
supersections, and can address 36bits).
Define it for i81342.
mlaier [Thu, 30 Nov 2006 18:55:36 +0000 (18:55 +0000)]
From OpenBSD, rev. 1.91:
fix servicecurve check; no point in checking the same sc three times, it
was obviously intended to check all three. has been wrong since the
beginning, 4 years... noticed by Earl Lapus <earl.lapus@gmail.com>, Vasil
Dimov <vd@FreeBSD.org> mailed me then, ok mcbride
kib [Thu, 30 Nov 2006 10:50:29 +0000 (10:50 +0000)]
Linker set support depends on the magic __start_<section> and
__stop_<section> symbols generated by the static linker for elf
sections. This is done only for the final link, and not for ld -r.
Augment elf_obj in-kernel linker by recognizing such special symbols,
and resolving them to the start and end of the section automatically.
As result, linker sets on amd64 could be used in the same way as on
other architectures, without explicit calls to linker_file_lookup_set().
Requested by: rdivacky
No objections from: peter, jhb
jb [Thu, 30 Nov 2006 04:17:05 +0000 (04:17 +0000)]
Turn console printf buffering into a kernel option and only on
by default for sun4v where it is absolutely required.
This change moves the buffer from struct pcpu to the stack to avoid
using the critical section which created a LOR in a couple of cases
due to interaction with the tty code and kqueue. The LOR can't be
fixed with the critical section and the pcpu buffer can't be used
without the critical section.
Putting the buffer on the stack was my initial solution, but it was
pointed out that the stress on the stack might cause problems
depending on the call path. We don't have a way of creating tests
for those possible cases, so it's best to leave this as an option
for the time being. In time we may get enough data to enable this
option more generally.
kmacy [Wed, 29 Nov 2006 19:31:23 +0000 (19:31 +0000)]
- add separate variable for enabling printing of ranges
- simplify handling of rounding phys_avail ranges to 4M boundaries (needed for all
memory to be in the direct mapped area)
alfred [Wed, 29 Nov 2006 19:19:44 +0000 (19:19 +0000)]
Stop INVARIANTS panics in if_aue with a stopgap.
aue_tick calls several synchronous usb functions from a timeout(9),
this is very broken since a timeout(9) is run as an interrupt
and the usb functions tsleep.
A stopgap fix is to schedule a taskqueue task from the timeout
and defer work to that taskqueue task.
imp [Wed, 29 Nov 2006 08:15:59 +0000 (08:15 +0000)]
Make this work a lot better:
Remove a lot of older cruft not needed.
Improve ISR support, but it is still unused since polling is faster
Properly initalize the speed register to get 90kb/s, not 400b/s.
Try to catch NACK
Allow 0 length read transfers to generate start/top pairs.
imp [Wed, 29 Nov 2006 08:05:55 +0000 (08:05 +0000)]
MFp4:
Preliminary support for Atmel AT45D series of DataFlash on the
SPI bus (ok, not really a hardware bus, but a logical
connection). This works only for the 8MB version of the part
due to hard coding. Both read and write are supported.
kmacy [Wed, 29 Nov 2006 05:18:19 +0000 (05:18 +0000)]
- Explicitly name the fields in pcb that we use to store trap state for later
retrieval, rather than using pad
- save the fault address in sfar for use by the alignment fixup handler
- mask off the trap number, so the context id doesn't confuse the UT_MAX
comparison
This change fixes alignment fixup handling which is needed for traceroute
to work in spite of its copious unaligned accesses
mohans [Wed, 29 Nov 2006 02:21:40 +0000 (02:21 +0000)]
In nfs_nget(), we must initialize the fh in the nfsnode before inserting the
vnode into the vfs hash. Otherwise, another thread walking the hash can trip
on an nfsnode with an uninitialized or partially initialized fh.
Thanks to ups@ for spotting this race.
rodrigc [Wed, 29 Nov 2006 00:46:30 +0000 (00:46 +0000)]
Pass a string buffer named "errmsg" to nmount().
This will allow the NFS mount code to return a string error message
in addition to returning an error integer value.
rodrigc [Wed, 29 Nov 2006 00:41:44 +0000 (00:41 +0000)]
Deduce the "fstype" parameter to pass to nmount() by looking at
the "_nfs" part of argv[0]. This should facilitate unifying mount_nfs
and mount_nfs4 into one binary.
ru [Tue, 28 Nov 2006 12:46:02 +0000 (12:46 +0000)]
- Revert signedness type changes to "struct vmtotal"; by making
them unsigned I made the possible overflows hard to detect,
and it only saved 1 bit which isn't principal, even less now
that the underlying issue with the total of virtual memory has
been fixed. (For the record, it will overflow with >=2T of
VM total, with 32-bit ints used to keep counters in pages.)
- While here, fix printing of other "struct vmtotal" members
such as t_rq, t_dw, t_pw, and t_sw as they are also signed.
rwatson [Tue, 28 Nov 2006 11:19:36 +0000 (11:19 +0000)]
Change net.isr.direct from defaulting to 0 to 1 in 7-CURRENT. This
enables direct dispatch of the network stack from the device driver
ithread, enabling input path parallelism by default when multiple
interfaces are present.
The strategy for network stack parallelism is something being actively
discussed, and this is just one of several possible (and perfectly
reasonable) strategies, but has the distinct advantage of reducing the
number of context switches and preemptions significantly, resulting in
higher efficiency in many cases. In some caes, this may reduce
network stack parallelism due to work not being deferred from the
ithread to the netisr. Therefore, the strategy may change in the
future, but this offers a reasonable first pass and enabling
parallelism while maintaining strong ordering.
Hopefully this will trigger lots of nice new bugs.
davidxu [Tue, 28 Nov 2006 11:05:31 +0000 (11:05 +0000)]
If a thread was detached, return EINVAL instead, the error code
is also returned by pthread_detach() if a thread was already
detached, the error code was already documented:
> [EINVAL] The implementation has detected that the value speci-
> fied by thread does not refer to a joinable thread.
davidxu [Tue, 28 Nov 2006 03:24:34 +0000 (03:24 +0000)]
- Remove third parameter of itimer_find, the parameter is always zero.
- Call callout_drain on deleting POSIX timer.
- Use kern_timer_delete in exiting hook.
marius [Tue, 28 Nov 2006 01:33:17 +0000 (01:33 +0000)]
- Clear the PCN_MISC_ASEL bit so the media port can be actually set
via the PCN_CSR_MODE register. Along with sys/dev/mii/nsphy.c 1.26
this fixes the case of certain Am79c971-based HP cards and on-board
ones in IBM machines reporting link but not actually passing any
traffic. [1]
- Add support for the internal 10baseT PHY, which actually is used on
at least said HP cards (together with an external DP83840A in a
multiple PHYs configuration). With cards that don't make use of this
internal PHY it'll also show up in FreeBSD but not cause any harm.
This is still missing support for multiple PHYs configuration using
the internal 100baseTX and/or HomePNA PHYs together with external
PHYs or multiple external PHYs though.
- In pcn_ifmedia_upd() call pcn_reset() as otherwise the Am79C971 of
at least said HP cards can wedge when switching from the internal
10baseT PHY to the external PHY. This means that we need to also
initialize and possibly start the chip again in pcn_ifmedia_upd(),
which isn't that bad though as for setting the media port the chip
has to be powered down or stopped anyway and unlike documented
doesn't take effect until the next initialization.
marius [Tue, 28 Nov 2006 01:14:09 +0000 (01:14 +0000)]
- In rlphy_service() for the MII_TICK case don't bother to check whether
the currently selected media is of type IFM_AUTO as auto-negotiation
doesn't need to be kicked anyway.
- In rlphy_status() just use if_dname instead of determining the name
of the parent NIC via device_get_name(device_get_parent(sc->mii_dev)).
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix some whitespace nits and remove commented out code that just can't
be used with RealTek PHYs.
marius [Tue, 28 Nov 2006 01:08:45 +0000 (01:08 +0000)]
- In qsphy_service() for the MII_TICK case don't bother to check whether
the currently selected media is of type IFM_AUTO as auto-negotiation
doesn't need to be kicked anyway.
- Don't set MIIF_NOISOLATE so qsphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
QS6612 per se nor in combination with the NICs they're used with.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
Obtained from: NetBSD (except for the first item)
MFC after: 2 weeks
marius [Tue, 28 Nov 2006 01:01:02 +0000 (01:01 +0000)]
- Don't add IFM_NONE when used in combination with pcn(4) as for MII
loopback to work PCnet chips additionally need to be placed into
external loopback mode which pcn(4) doesn't do so far.
- In nsphy_service() just use if_dname instead of determining the name
of the parent NIC via device_get_name(device_get_parent(sc->mii_dev)).
- Don't set MIIF_NOISOLATE, except for when used in combination with a
NIC that wedges when isolating the PHYs, so nsphy(4) can be used in
configurations with multiple PHYs.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia() (requires the MIIF_FORCEANEG
added in sys/dev/mii/mii_physubr.c 1.26, sys/dev/mii/miivar.h 1.19).
- Implement a separate nsphy_reset(). There are two reasons for this:
1) This PHY can take an inordinate amount of time to reset if media
is attached; under fairly normal circumstances up to nearly one
second. This is because it appears to go through an implicit auto-
negotiation cycle as part of the reset.
2) During reset and auto-negotiation, the BMCR will clear the reset
bit before the process is complete. It will return 0 until the
process is complete and it's safe to access the PHY again.
This is the first of two changes required to make the combination of
Am79c971 and DP83840A found on certain HP cards and on-board in IBM
machines work.
- Fix some whitespace nits.
Based on: NetBSD (except for the first and second item)
MFC after: 2 weeks
marius [Tue, 28 Nov 2006 00:45:48 +0000 (00:45 +0000)]
- Don't set MIIF_NOISOLATE so lxtphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
LXT970 per se nor in combination with the NICs they're used with and
lxtphy(4) was already adding IFM_NONE anyway.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix some whitespace nits.
marius [Mon, 27 Nov 2006 23:50:19 +0000 (23:50 +0000)]
Analogous to mii_add_media(), factor out the code for checking whether
the BMSR contains any media at all to mii_phy_add_media(). The majority
of the drivers currently using mii_phy_add_media() were missing such a
check anyway though.
marius [Mon, 27 Nov 2006 23:37:59 +0000 (23:37 +0000)]
- Add a MIIF_FORCEANEG flag which forces an auto-negotiation to always
take place if IFM_AUTO is selected. This allows drivers like nsphy(4),
which need to force writing the ANAR according to the BMSR, to take
advantage of mii_phy_setmedia(). [1]
- In mii_phy_reset() once the current media is set don't isolate the PHY
corresponding to the instance of the currently selected media rather
than unconditionally not isolating the PHY corresponding to instance 0.
This saves a isolation-unisolation-cycle of the PHY corresponding to
the currently selected media for the case were it isn't instance 0.
- Fix some whitespace nits. [1]
mohans [Mon, 27 Nov 2006 23:26:06 +0000 (23:26 +0000)]
bde@ pointed out that tprintf() acquires Giant so callers of tprintf() don't
have to explicitly acquire Giant (although they need to be aware of this and
not hold any locks at that point). Remove the acquisitions of Giant in the
NFS client wrapping tprintf().
emax [Mon, 27 Nov 2006 22:52:11 +0000 (22:52 +0000)]
Do not mark Bluetooth HID device as a "potential keyboard" if its descriptor
has items with CONSUMER page. For now only check for items with KEYBOARD page.
This should prevent bthidd(8) from allocating vkbd(4) keyboard for Microsoft
Bluetooth Explorer mouse.
yar [Mon, 27 Nov 2006 21:30:38 +0000 (21:30 +0000)]
Back out rev. 1.17: arch-dependent WARNS level.
The policy is that the WARNS level should characterize the
quality of a piece of code irrespective of any conditions.
Otherwise the code doesn't deserve the WARNS level assigned.
This fixes msgget03 and semget05 from Linux Test Project (LTP) test suite.
msgctl08 and msgctl09 also use /proc/sys/kernel/msgmni but another fix is
required from p4 (Change 110179).
mohans [Mon, 27 Nov 2006 19:06:43 +0000 (19:06 +0000)]
Fix for a bug caused by a race when 2 threads lookup the same
file. Leave the loser's lock(s) initialized, so the reclaim logic can
unconditionally destroy them when that race occurs (or if the vfs hash
insert happened to fail for some other reason). Thanks to ups@ for a
careful review of the code.
Reported by : Kris Kennaway
marius [Mon, 27 Nov 2006 18:39:02 +0000 (18:39 +0000)]
Refine the previous change to only call bus_dmamap_sync() in case of
an URQ_REQUEST when DMA segments are passed to usbd_start_transfer();
when the request doesn't include the optional data buffer the size of
the transfer (xfer->length) is 0, in which case usbd_transfer() won't
create a DMA map but call usbd_start_transfer() with no DMA segments.
With the previous change this could result in the bus_dmamap_sync()
implementation dereferencing the NULL-pointer passed as the DMA map
argument.
While at it fix what appears to be a typo in usbd_start_transfer();
in order to determine wheter usbd_start_transfer() was called with
DMA segments check whether the number of segments is > 0 rather than
the pointer to them being > 0.
brueffer [Mon, 27 Nov 2006 18:37:45 +0000 (18:37 +0000)]
Overhaul this manpage somewhat:
- Move mentionings of required drivers to the SYNOPSIS where they belong
- Remove cruft (XiG, sheesh) from the EXAMPLES section and re-arrange things to make
somewhat more sense
- Fix an Xref to manpage from ports to mention the corresponsing port
- Remove commented out HISTORY section header
yar [Mon, 27 Nov 2006 17:54:28 +0000 (17:54 +0000)]
systat(1) reaches WARNS=6 on i386 and amd64. This is good
for catching general regressions in future. Unfortunately,
it still displays some problems at WARNS=6 on architectures
with stricter alignment requirements, e.g., ia64.
yar [Mon, 27 Nov 2006 17:34:40 +0000 (17:34 +0000)]
The logic of fetchnetstat_sysctl() isn't too complex: if idx is 0,
we set and use xtp; if idx is 1, we set and use xip; the other cases
are impossible. However, GCC cannot see that xip and xtp are always
initialized before use because they are initialized and used in
different if/else blocks. So setting them to NULL at the very
beginning won't hurt.
yar [Mon, 27 Nov 2006 17:24:36 +0000 (17:24 +0000)]
+ WARNS=4 reminds that nlist.n_name isn't const.
+ Use C99 initializers to be WARNS-clean.
+ The last element in a namelist should have its n_name set to NULL,
not to an empty string.
ru [Mon, 27 Nov 2006 16:55:14 +0000 (16:55 +0000)]
Push the detection of threading libs support down to ngctl/Makefile
as the latter can be built without threading (with the loss of line
editing functionality).
kientzle [Mon, 27 Nov 2006 16:30:32 +0000 (16:30 +0000)]
Improve support for large ISOs:
* Correct a signed/unsigned problem that broke handling of files >2G.
* Implement "skip" support for much faster "tar -t".
Thanks to: Robert Sciuk for sending me a DVD that illustrated the first problem
yar [Mon, 27 Nov 2006 15:26:26 +0000 (15:26 +0000)]
Allow for large scale factors. C99 warrants that
ULLONG_MAX is not less than 2^64-1; and uintmax_t
cannot be more narrow than unsigned long long.
This allows for scale factors up to Exa inclusively.
Use plain int for the scale index to be consistent
with ifcmds.c and enum.
jb [Mon, 27 Nov 2006 01:35:11 +0000 (01:35 +0000)]
Back out half of my previous change to support parallel makes.
The generated Makefile clashes with the src/bin/sh/Makefile, causing
it to try to use a rule to build something it doesn't need to.