Commit Graph

61522 Commits

Author SHA1 Message Date
Bruce Evans
b73057227b Optimized RTC accesses by avoiding null writes to the index register
and by only delaying when an RTC register is written to.  The delay
after writing to the data register is now not just a workaround.

This reduces the number of ISA accesses in the usual case from 4 to
1.  The usual case is 2 rtcin()'s for each RTC interrupt.  The index
register is almost always RTC_INTR for this.  The 3 extra ISA accesses
were 1 for writing the index and 2 for delays.  Some delays are needed
in theory, but in practice they now just slow down slow accesses some
more since almost eveyone including us does them wrong so modern systems
enforce sufficient delays in hardware.  I used to have the delays ifdefed
out, but with the index register optimization the delays are rarely
executed so the old magic ones can be kept or even implemented non-
magically without significant cost.

Optimizing RTC interrupt handling is more interesting than it used to
be because RTC interrupts are currently needed to fix the more efficient
apic timer interrupts on some systems.  apic_timer_hz is normally 2000
so the RTC interrupt rate needs to be 2048 to keep the apic timer
firing on such systems.  Without these changes, each RTC interrupt
normally took 10 ISA accesses (2 PIC accesses and 2 sets of 4 RTC
accesses).  Each ISA access takes 1-1.5uS so 10 of then at 2048 Hz
takes 2-3% of a CPU.  Now 4 of them take 0.8-1.2% of a CPU.
2006-12-03 03:49:28 +00:00
David Xu
a6abdf322d Introduce userspace condition variable, since we have already POSIX
priority mutex implemented, it is the time to introduce this stuff,
now we can use umutex and ucond together to implement pthread's
condition wait/signal.
2006-12-03 01:49:22 +00:00
Matt Jacob
f2b93482b8 Forced commit: previous revision just correctly reflected that
the number of attached devices is 16 bits wide, not 8 bits wide.
2006-12-03 00:29:51 +00:00
Matt Jacob
a54067cc0e Fix a debug message which didn't quite get it right about data direction.
Fix things to use the LSI-Logic Fusion Library mask and shift names for
offset and sync, no matter how awkward they are, in preference to just
plain numbers.
2006-12-03 00:28:11 +00:00
Craig Rodrigues
3d253c11cf Add missing includes for <sys/buf.h> and <sys/bio.h>. 2006-12-02 22:30:30 +00:00
Marius Strobl
f448ecb4f5 - Probe Davicom DM9102 PHYs.
- Don't set MIIF_NOISOLATE so amphy(4) can be used in configurations
  with multiple PHYs. There doesn't seem to be a problem with isolating
  AM79c873 and workalikes per se nor in combination with the NICs they're
  used with and amphy(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 a whitespace nit.

Obtained from:	NetBSD dmphy(4) (except for the last item)
MFC after:	2 weeks
2006-12-02 21:21:16 +00:00
Marius Strobl
65169ee9c6 - In acphy_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.
- Fix a whitespace nit.
- Probe another Altima PHY, which is a AC101 workalike and integrated
  in at least ADMtek ADM8511 but apparently is not mentioned in any
  publically available data sheet so the actual identifier is unknown.
- Don't set MIIF_NOISOLATE so acphy(4) can be used in configurations
  with multiple PHYs. There doesn't seem to be a problem with isolating
  AC101 and workalikes 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 and second item)
MFC after:	2 weeks
2006-12-02 21:19:54 +00:00
Marius Strobl
18e13cb9aa - Add another Altima PHY, which is a AC101 workalike and integrated
in at least ADMtek ADM8511 but apparently is not mentioned in any
  publically available data sheet so the actual identifier is unknown.
- Add Davicom DM9102 PHY.
- Add DM9101 to the description of AMD 79C873 as at least some Davicom
  DM9101F identify identical to AMD 79C873.

Obtained from:	NetBSD
MFC after:	2 weeks
2006-12-02 21:18:56 +00:00
Marius Strobl
9dd3a16881 - Don't set MIIF_NOISOLATE so tdkphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
  78Q2120 per se nor in combination with the NICs they're used with and
  tdkphy(4) was already adding IFM_NONE anyway.
- Set MIIF_NOLOOP as loopback doesn't work with this PHY. The MIIF_NOLOOP
  flag currently triggers nothing but hopefully will be respected by
  mii_phy_setmedia() later on.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
  be eventually retired.
- Take advantage of mii_phy_setmedia().

Thanks to Hans-Joerg Sirtl for lending me test hardware.

Obtained from:	NetBSD tqphy(4)
MFC after:	2 weeks
2006-12-02 20:16:45 +00:00
Marius Strobl
ba76315fa2 - Don't set MIIF_NOISOLATE so rgephy(4) can be used in configurations
with multiple PHYs and un-comment case IFM_NONE in case MII_MEDIACHG
  rgephy_service(). There doesn't seem to be a problem with isolating
  RTL8169S and their internal PHY.
- Take advantage of mii_phy_add_media(). [1]

Obtained from:	NetBSD [1]
Tested by:	yongari
MFC after:	2 weeks
2006-12-02 19:48:53 +00:00
Marius Strobl
028ccec463 Some style changes to a couple of PHY drivers:
- Fix some whitespace nits.
- Fix some spelling in comments.
- Use MII_ANEGTICKS instead of 5.
- Don't define variables in nested scope.
- Remove superfluous returns at the end of void functions.
- Remove unused static global rgephy_mii_model.
- Remove dupe $Id$ in tdkphy(4).
- Sort brgphys table.

MFC after:	2 weeks
2006-12-02 19:36:25 +00:00
Craig Rodrigues
d00947d83a Many, many thanks to Masanori OZAWA <ozawa@ongs.co.jp>
and Daichi GOTO <daichi@FreeBSD.org> for submitting this
major rewrite of unionfs.  This rewrite was done to
try to solve many of the longstanding crashing and locking
issues in the existing unionfs implementation.  This
implementation also adds a 'MASQUERADE mode', which allows
the user to set different user, group, and file permission
modes in the upper layer.

Submitted by:	daichi, Masanori OZAWA
Reviewed by:	rodrigc (modified for minor style issues)
2006-12-02 19:35:56 +00:00
Ariff Abdullah
2229d0cfa2 Add support for Apple Intel/Mac.
- Playback and headphone/speaker automute works.
 - Recording untested due to me being deaf doing back-and-forth
   remote debugging.

Free Macbook donation is highly appreciated :)

Tested by:	Dennis Pielken <mips128@gmx.net>
2006-12-02 17:12:24 +00:00
Marius Strobl
a35b933378 Add a helper function mii_phy_dev_probe(), which wraps around the
mii_phy_match() API and takes care of the PHY device probe based on
the struct mii_phydesc array and the match return value provided.
Convert PHY drivers to take advantage of mii_phy_dev_probe(),
converting drivers to provide a mii_phydesc table in the first
place where necessary.

Reviewed by:	yongari
MFC after:	2 weeks
2006-12-02 15:32:34 +00:00
Alexander Leidinger
f6018b1434 MFP4 (108673, 110519, 110874):
- Currently LINUX_MAX_COMM_LEN is smaller than MAXCOMLEN, but in case
  this will change we have a buffer overflow. Apply some defensive
  programming to DTRT when this should happen.
- Use copyinstr() instead of copyin where appropriate.
  * Fallback to copyin() in case of ENAMETOOLONG. [1]
  * Use the right source and destination (it was wrong before).
- Use strlcpy instead of strcpy.
- Properly lock the read case (PR_GET_NAME) like the write case.

Reviewed by:	rwatson (except [1])
Suggested by:	rwatson [1]
2006-12-02 14:56:25 +00:00
Alexander Leidinger
f195f6a161 Add the linux module to the amd64 build, all symbols can now be resolved. 2006-12-02 13:58:13 +00:00
Olivier Houchard
7f7ba6ec05 Provide stream operations. 2006-12-02 13:37:29 +00:00
Pawel Jakub Dawidek
9cb9930ea6 Softc may be NULL in g_journal_orphan(), so don't be surprised. 2006-12-02 09:10:29 +00:00
Robert Watson
d95fcd8db7 Remove obfuscating OpenBSD/NetBSD/BSDI/FreeBSD 2.x/FreeBSD 5.x ifdefs
from around printfs and address list iteration.
2006-12-01 22:45:43 +00:00
Ruslan Ermilov
4a67956ec4 if_watchdog -> rl_watchdog 2006-12-01 21:52:07 +00:00
Max Laier
d9cbee0c7d ALTQify ep(4).
Tested and Requested by:	Andy Brook
MFC after:			3 days
2006-12-01 20:29:55 +00:00
Warner Losh
f4fcdb0eb5 Fix packing on the country band descriptor. No real change since this
is unused.

Reviewed by: sam
2006-12-01 18:40:51 +00:00
Warner Losh
850adc0cd7 Make sure that carp_header is 36 bytes long 2006-12-01 18:37:41 +00:00
Warner Losh
48f395a6c2 fix typo in last commit 2006-12-01 18:25:18 +00:00
Warner Losh
a0858e10ac Use FreeBDS standard __packed as opposed to the gcc centric
__attribute__(__packed__).
2006-12-01 18:18:35 +00:00
Sam Leffler
ab96db105f back out use of LLC_SNAPFRAMELEN now that sizeof(struct llc) isn't
padded on arm
2006-12-01 17:58:33 +00:00
Warner Losh
ff4323418b Move the __packed declarations. This makes sizeof(struct llc) 8 again
on the arm.  Add an assert to ensure that the size is 8 to prefent others
from falling into this trap (we should have more of these).

Why the construct:

	struct foo {
		union bar {
			struct {
				...
			} __packed fred;
			...
		} __packed wilma;
	} __packed;

has a different packing than:

	struct foo {
		union bar {
			struct {
				...
			} fred __packed;
			...
		} wilma __packed;
	} __packed;

is beyond my ability to ferret out of the gcc documentation.  Most
likely some subtle binding issue (eg before it says the struct itself
is packed, while after it means that the whole struct is packed into
the thing it is in).  Pointers to relevant documentation would be
appreciated.
2006-12-01 17:50:11 +00:00
Paolo Pisati
5910c1c1b9 Make libalias.conf parsing a bit smarter.
This closes PR kern/106112.

While here, add mbuf's #includes i forgot in the previous commit.

Approved by: gleb
2006-12-01 16:34:53 +00:00
Paolo Pisati
e876228edc Remove m_megapullup from ng_nat and put it under libalias.
Approved by: gleb
2006-12-01 16:27:11 +00:00
Sam Leffler
30e218c0a0 clarify shortcut return
Submitted by:	cognet, kevlo
MFC after:	1 week
2006-12-01 16:03:39 +00:00
Ruslan Ermilov
16f1e614d9 Grammar nit. 2006-12-01 13:07:52 +00:00
Olivier Houchard
5b3e7496e6 We can have no PV entry here if the previous mapping was unmanaged, and the new
one is unmanaged too, so update the KASSERT to reflect this.
2006-12-01 12:29:55 +00:00
Warner Losh
a20538a08a Use CTASSERT to make sure:
sizeof ether_header is 2 * ETHER_ADDR_LEN + 2 (14) bytes long
	sizeof ether_addr is ETHER_ADDR_LEN bytes long

On arm, this shows that struct ether_addr needs to be __packed.

The first condition muts be true for the bridging code to not dump core.
The second one appears to be implicitly relied upon by wi (but many
of the rids it sends down likely need __packed too to be safe) and
maybe others.  It appears to not hurt anything.
2006-12-01 07:06:35 +00:00
Ariff Abdullah
fbf953b58e Add inverted amplifier sense quirk for HP Compaq nx4300.
PR:		kern/106104
Submitted by:	Shun-ichi Kobayashi <koba@mbox.kudpc.kyoto-u.ac.jp>
MFC after:	3 days
2006-12-01 06:53:13 +00:00
Sam Leffler
8c86f43df4 sizeof(struct llc) includes padding on arm; use LLC_SNAPFRAMELEN for now
Submitted by:	jhay
MFC after:	2 weeks
2006-12-01 05:48:35 +00:00
Jung-uk Kim
d2d67b956c Fix white spaces. 2006-12-01 01:37:45 +00:00
Jung-uk Kim
7e6e2507b6 Simplify statistics updates, remove redundant register reads, and add
discarded RX packets to input error for BCM5705 or newer chipset as the others.
Unfortunately we cannot do the same for output errors because ifOutDiscards
equivalent register does not exist.  While I am here, replace misleading and
wrong BGE_RX_STATS/BGE_TX_STATS with BGE_MAC_STATS.  They were reversed but
worked accidently.
2006-12-01 01:08:52 +00:00
Olivier Houchard
92c930f4ec In pmap_ts_referenced(), don't attempt to do anything if the page is
fictitious, and just return 0.
2006-11-30 23:35:34 +00:00
Olivier Houchard
73dcd92598 First bits of Xscale core 3 support (the VM bits are far from being optimal
yet).
2006-11-30 23:34:07 +00:00
Olivier Houchard
2feb83cec2 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.
2006-11-30 23:30:40 +00:00
Ruslan Ermilov
03eab9f7a6 Fix the hardware VLAN tagging. TX was broken on little-endian
machines and both TX and RX were broken on big-endian machines.

The chip design is crazy -- on RX, it puts the 16-bit VLAN tag
in network byte order (big-endian) in the 32-bit little-endian
register!

Thanks to John Baldwin for helping me document this change! ;-)

Tested by:	sat (amd64), test program (sparc64)
PR:		kern/105054
MFC after:	3 days
2006-11-30 21:01:59 +00:00
Maxim Konovalov
91d7721c0b o ciss.ko depends on cam and pci.
PR:		kern/105989
Submitted by:	nork
MFC after:	1 month
2006-11-30 15:14:17 +00:00
Gleb Smirnoff
c18ffdc87d The recent issues with em(4) interface has shown that the old 4.4BSD
if_watchdog/if_timer interface doesn't fit modern SMP network
stack design.

Device drivers that need watchdog to monitor their hardware should
implement it theirselves.

Eventually the if_watchdog/if_timer API will be removed. For now,
warn that driver uses it.

Reviewed by:	scottl
2006-11-30 15:02:01 +00:00
Gleb Smirnoff
df79d5278f - Instead of if_watchdog/if_timer interface use our own timer
that piggybacks on fxp_tick() callout.
2006-11-30 14:58:01 +00:00
Florent Thoumie
8fec56e46e Bump __FreeBSD_version after UQ_KBD_IGNORE was set for Wi-Spy devices. 2006-11-30 14:29:47 +00:00
Gleb Smirnoff
b74e67fbfb - Instead of if_watchdog/if_timer interface use our own timer
that piggybacks on bge_tick() callout.
- Lock bge_tick() using callout_init_mtx().
2006-11-30 13:40:39 +00:00
Robert Watson
e3fd5ffdf1 Consistently use #ifdef INET6 rather than mixing and matching with
#if defined(INET6).

Don't comment the end of short #ifdef blocks.

Comment cleanup.

Line wrap.
2006-11-30 10:54:54 +00:00
Konstantin Belousov
7226306ed5 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
2006-11-30 10:50:29 +00:00
Poul-Henning Kamp
a4dcb4f627 Only grab the sched_lock if we actually need to modify the thread priority.
During a buildworld only 2/3 of the calls to msleep actually changed
the priority.
2006-11-30 08:27:38 +00:00
Peter Grehan
9955cf96f6 Don't use vm_page_flag_set() if installing bootstrap page-table entries
since the vm page mutex's aren't yet initialized. Fixes boot-time panic.

Reported by:	Dario Freni  saturnero at freesbie dot org
2006-11-30 08:13:06 +00:00