Compare commits

...
3482 Commits
Author SHA1 Message Date
Colin Percival 5a4327739c Change the current working directory to be inside the jail created by
the jail(8) command. [10:04]

Fix a one-NUL-byte buffer overflow in libopie. [10:05]

Correctly sanity-check a buffer length in nfs mount. [10:06]

Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-10:04.jail
Security:	FreeBSD-SA-10:05.opie
Security:	FreeBSD-SA-10:06.nfsclient
2010-05-27 03:15:04 +00:00
Colin Percival 8d0c6fc226 MFC r197223: Fix a deadlock in the ULE scheduler.
Approved by:	so (cperciva)
Errata:		FreeBSD-EN-10:02.sched_ule
2010-02-27 10:55:43 +00:00
Simon L. B. Nielsen fbcab568df Fix BIND named(8) cache poisoning with DNSSEC validation.
[SA-10:01]

Fix ntpd mode 7 denial of service. [SA-10:02]

Fix ZFS ZIL playback with insecure permissions. [SA-10:03]

Various FreeBSD 8.0-RELEASE improvements. [EN-10:01]

Security:	FreeBSD-SA-10:01.bind
Security:	FreeBSD-SA-10:02.ntpd
Security:	FreeBSD-SA-10:03.zfs
Errata:		FreeBSD-EN-10:01.freebsd
Approved by:	so (simon)
2010-01-06 21:45:30 +00:00
Simon L. B. Nielsen 84a603b232 Bump the patch level in the kernel version number, which was
accidentally left out of main commit for SA-09:15, SA-09:15, and
SA-09:17 in r200054.

Approved by:	so (simon)
2009-12-03 12:59:39 +00:00
Colin Percival 710985d25a Disable SSL renegotiation in order to protect against a serious
protocol flaw. [09:15]

Correctly handle failures from unsetenv resulting from a corrupt
environment in rtld-elf. [09:16]

Fix permissions in freebsd-update in order to prevent leakage of
sensitive files. [09:17]

Approved by:	so (cperciva)
Security:	FreeBSD-SA-09:15.ssl
Security:	FreeBSD-SA-09:16.rtld
Security:	FreeBSD-SA-09:17.freebsd-udpate
2009-12-03 09:18:40 +00:00
Simon L. B. Nielsen 021dc5c364 MFC r197711 (partial) to 6.x and 7.x:
- Add no zero mapping feature, disabled by default. [EN-09:05]

MFC 178913,178914,179242,179243,180336,180340 to 6.x:

- Fix kqueue pipe race conditions. [SA-09:13]

MFC r192301 to 7.x; 6.x has slightly different fix:

- Fix devfs / VFS NULL pointer race condition. [SA-09:14]

Security:	FreeBSD-SA-09:13.pipe
Security:	FreeBSD-SA-09:14.devfs
Errata:		FreeBSD-EN-09:05.null
Submitted by:	kib [SA-09:13] [SA-09:14]
Submitted by:	bz [EN-09:05]
In collaboration with:	jhb, kib, alc [EN-09:05]
Approved by:	so (simon)
2009-10-02 18:09:56 +00:00
Simon L. B. Nielsen 7cc4540e39 Fix BIND named(8) dynamic update message remote DoS.
Obtained from:	ISC
Security:	FreeBSD-SA-09:12.bind
Security:	CVE-2009-0696
Approved by:	so (simon)
2009-07-29 00:14:14 +00:00
Colin Percival 90c934b892 MFS r192477: Fix packet length calculation in bce(4). [EN-09:02]
MFS r191867: Correctly set IP packet length for TSO in fxp(4). [EN-09:03]

MFS r191767: Fix a lock order reversal bug that could cause deadlock during
fork(2). [EN-09:04]

Submitted by:	re (kensmith)
Approved by:	so (cperciva)
Errata:		FreeBSD-SA-09:02.bce
Errata:		FreeBSD-SA-09:03.fxp
Errata:		FreeBSD-SA-09:04.fork
2009-06-24 05:28:09 +00:00
Colin Percival 1baa48a657 Prevent integer overflow in direct pipe write code from circumventing
virtual-to-physical page lookups. [09:09]

Add missing permissions check for SIOCSIFINFO_IN6 ioctl. [09:10]

Fix buffer overflow in "autokey" negotiation in ntpd(8). [09:11]

Approved by:	so (cperciva)
Approved by:	re (not really, but SVN wants this...)
Security:	FreeBSD-SA-09:09.pipe
Security:	FreeBSD-SA-09:10.ipv6
Security:	FreeBSD-SA-09:11.ntpd
2009-06-10 10:31:11 +00:00
Ken Smith 54055718ff Get ready for 7.2-RELEASE builds.
Approved by:	re (implicit)
2009-05-01 02:18:54 +00:00
Ken Smith 1f61e76b51 Predict announcement day for 7.2-RELEASE.
Approved by:	re (implicit)
2009-05-01 02:17:08 +00:00
Hiroki Sato 69a8884af1 Merge r191705 change in the English version.
Submitted by:	delphij
Approved by:	re (implicit)
2009-04-30 21:39:56 +00:00
Hiroki Sato 510c6cf29a Revise entry for superpages.
Suggested by:	rwatson
Approved by:	re (implicit)
2009-04-30 21:20:09 +00:00
Xin LI c998438538 Sync with English revisions.
Approved by:	re (hrs)
2009-04-30 06:17:56 +00:00
Hiroki Sato 3649c5caff Various wording/grammar fixes.
Suggested by:	keramida
Approved by:	re (implicit)
2009-04-29 17:50:48 +00:00
Hiroki Sato 76322dbacd - Update entries for increased KVA on amd64 and superpages on
amd64/i386[1]
- BTX loader improved[2]
- Move sysctl node MPSAFE flag to the kernel section[3]
- u3g(4) added[4]
- Various grammer fixes[5]
- MAKE_JOBS_SAFE added in bsd.port.mk.

Suggested by:	ivoras[1], gavin[2], kib[3], edwin[4], and schweikh[5].
Approved by:	re (implicit)
2009-04-29 15:22:58 +00:00
Hiroki Sato f9a559a82d Fix a typo.
Spotted by:	pluknet at gmail.com
Approved by:	re (implicit)
2009-04-29 08:46:50 +00:00
Hiroki Sato 9070dd1518 Fix a typo.
Approved by:	re (implicit)
2009-04-29 07:37:07 +00:00
Hiroki Sato a54b5e9264 - Updare release notes:
currently jail+cpuset allows superuser inside the jail to
	change the CPU bindings,
	atkbd(4) + kbdmux(4) duplicated/missing chars issue on MP systems fixed,
	ULE machdep.hyperthreading_enabled support,
	bce(4) update,
	cxgb(4) update,
	ixgbe(4) update,
	a typo fix: s/<varname>/<replaceable>/,
	ata(4) nForce MCP67/MCP73 support improved,
	GEOM label UFS ID support,
	GEOM journal rootfs support,
	hptmv(4) updated,
	twa(4) 64-bit DMA support,
	fsck -C (check clean mode) support,
	getaddrinfo(3) SCTP support,
	make(1) -p, -Q, ${.MAKE.JOB.PREFIX}, ${.MAKE.PID} added, and
	mount(8) -o mountprog=/foo added.

- Various grammer and order fixes.

Approved by:	re (implicit)
2009-04-29 06:52:04 +00:00
Hiroki Sato 38f33e47a0 Updare release notes:
currently jail+cpuset allows superuser inside the jail to
	change the CPU bindings,
	atkbd(4) + kbdmux(4) duplicated/missing chars issue on MP systems fixed,
	ULE machdep.hyperthreading_enabled support,
	bce(4) update,
	cxgb(4) update,
	ixgbe(4) update,
	a typo fix: s/<varname>/<replaceable>/,
	ata(4) nForce MCP67/MCP73 support improved,
	GEOM label UFS ID support,
	GEOM journal rootfs support,
	hptmv(4) updated,
	twa(4) 64-bit DMA support,
	fsck -C (check clean mode) support,
	getaddrinfo(3) SCTP support,
	make(1) -p, -Q, ${.MAKE.JOB.PREFIX}, ${.MAKE.PID} added, and
	mount(8) -o mountprog=/foo added.

Approved by:	re (implicit)
2009-04-29 06:14:12 +00:00
Hiroki Sato e7b58bcd8d Update release notes:
schizo driver on sparc64,
	txp(4) various improvements,
	tap(4) SIOSIFMTU support.

Approved by:	re (implicit)
2009-04-28 04:45:06 +00:00
Hiroki Sato d35c52a536 Update release notes:
DDB show mount added,
	sparc64 US III support,
	DRM r600/r700,
	ae(4) WoL support,
	hardware MAC stats: cxgb(4), msk(4), nfe(4),
	re(4) hw.re.prefer_iomap,
	sis(4) VLAN tagging bugfix,
	txp(4) update,
	TCP MD5 signature option for IPv6,
	gpart(8) updated; APM and EBR scheme support,
	mpt(4) in GENERIC on sparc64,
	vfs.nfs.prime_access_cache for NFSv3,
	ncal(1) multibyte support,
	csup CVSMode support,
	du(1) -A and -B option added,
	makefs(8) added, and
	mergemaster(8) -F option added.

Approved by:	re (implicit)
2009-04-27 21:53:44 +00:00
Christian Brueffer bbee93cbf5 Document an issue of jail(8) in conjunction with cpuset(1).
Problem reported by:	Miroslav Lachman <[email protected]>
Reviewed by:	bz
Approved by:	re (kib)
2009-04-27 20:38:27 +00:00
Xin LI 4679e4f9c4 Add -C back.
Approved by:	re (kensmith)
2009-04-27 19:15:33 +00:00
Marc Fonvieille 5d7d08d44a Add a missing space and remove a superfluous char.
Approved by:	re (implicit)
2009-04-26 19:16:32 +00:00
Hiroki Sato 2b6caead9d Update release note:
type of shm_segsz in struct shmid_ds to size_t from int,
	AltiVec support on powerpc,
	INTx disabled when MSI/MSIX enabled,
	sysctl leaf node now has an MPSAFE flag,
	hw.drm.msi tunable added,
	ale(4) in GENERIC on amd64 and i386,
	ata-raid(4) initial support for DDF metadata,
	cam(4) kern.cam.cd.retry_count sysctl,
	ciss(4) max device openings count fix,
	btpand(8) for NAP, GN, PANU profiles of bluetooth added, and
	improve description of the fetch(1) If-Modified-Since support.

Approved by:	re (implicit)
2009-04-26 18:10:07 +00:00
Hiroki Sato e8fb91fe8b Update release note:
jail improvements: IPv4, IPv6, no address support, SCTP fix,
	cpuset(1) support, ddb show jails, version number bump,
	KTR_CALLOUT new tracepoint added,
	Superpages on amd64 and i386,
	acpu_asus(4) Asus A8Sr support added,
	axe(4) reduced csw for better performance,
	fxp(4) improvements including checksum offload, TSO, WoL, and VLAN,
	msk(4) hang up issue due to misalignment workaround,
	mxge(4) newer hardware support and media types,
	re(4) better miibus interaction support,
	rl(4) better miibus interaction support and fixes for >4GB system,
	IPv4 source address selection,
	tap(4) TAPGIFNAME ioctl added,
	unix(4) MPSAFE,
	sdhci(4) kernel dump support,
	EA semantics of [am]time update changed,
	atacontrol(8) minor nits fixed,
	dirname(1) multiple arguments support,
	dumpfs(8) -f flag added,
	fsck(8) s/-C/-D/,
	ln(1) -w flag added,
	netstat(1) unix sockets stats in -L flag,
	pciconf(8) -b flag added, and
	stat(1) octal s[gu]id in -x flag.

Approved by:	re (implicit)
2009-04-26 16:56:03 +00:00
Hiroki Sato 03a76b348d Update release notes:
FREEBSD32 syscall translation layer now supports
	addition/removal of syscall from kernel module,
	VFS_AIO syscalls added to FREEBSD32,
	ktr(4) new tracepoint for callout added,
	cpufreq(4) hw.est.msr_info added,
	kern.timecounter.invariant_tsc for i386 and amd64 added,
	vfs.lookup_shared improvement and removal of LOOKUP_SHARED option, and
	netstat(1) -ss for icmp6 section fixed.

Approved by:	re (implicit)
2009-04-26 14:03:52 +00:00
Marc Fonvieille 575826f183 s/&os:/&os;/ wrongly added by myself (damn it builded fine even with the
wrong version:( )

Submitted by:	marius
Approved by:	re (implicit)
2009-04-26 09:54:03 +00:00
Hiroki Sato 5b37f4de45 Update release notes:
amd64 KVA space to 6GB,
	variable reference in loader(8) script fixed,
	debug.batt.batt_sleep_ms added,
	snd_au88x0(4) removed,
	typo in igb(4) hw.igb.ave_latency fixed,
	gvinum plex access permission issue fixed,
	du(1) -l flag added,
	"netstat -m -N foo" issue fixed, and
	wc(1) -L flag added.

Approved by:	re (implicit)
2009-04-26 08:29:35 +00:00
Marc Fonvieille 45e294f985 - Add/usr trademarks for Windows;
- Various typo fixes.

Approved by:	re (implicit)
2009-04-26 08:17:14 +00:00
Marc Fonvieille af51f9df3c MFC:
r191509:
Unbreak the build of relnotes.

r191511:
Bump copyright year;
Add missing colon and fix broken entity.

Approved by:	re (implicit)
2009-04-26 08:00:41 +00:00
Hiroki Sato daf0e2ac5e Update release note:
boot0 volume ID and F6 PXE invoke support,
	DHCP options via kenv,
	cpuctl(4) added,
	ciphy(4) VSC8211 support,
	jme(4) newer JMC250/260 support,
	rl(4) improved,
	ata(4) Marvell PATA M88SX6121 support, and
	config(8) multiple makeoption support.

Approved by:	re (implicit)
2009-04-26 00:29:49 +00:00
Hiroki Sato 4304e5eb17 Update release note:
agp(4) Intel G4X support,
	DRM update,
	snd_hda(4) update,
	jail(8) FIB support,
	ng_netflow(4) egress netflow support,
	mmc(4) and mmcsd(4) improved,
	sdhci(4) added,
	mmc(4), mmcsd(4), and sdhci(4) as kernel module,
	fetch(1) -i flag,
	fsck(8) -C flag,
	ipfw(8) -q flag fixed,
	powerd(8) improved,
	rpc.yppasswdd(8) zombie process issue fixed, and
	pkg_create(1) -n fixed.

Approved by:	re (implicit)
2009-04-25 23:09:39 +00:00
Marius Strobl 421bcceeb8 MFC: r191491, r191492
Sync the sparc64 hardware notes with reality, mainly regarding support
of sun4u-machines based on USIII and beyond in 7.2-RELEASE.

Approved by:	re (blackend)
2009-04-25 23:08:59 +00:00
Hiroki Sato c1ff6d05f5 - Use arch="" attr instead of literal [&arch.xxx;].
- Bump copyright year.
- Delete trailing whitespaces.

Approved by:	re (implicit)
2009-04-25 21:32:48 +00:00
Hiroki Sato d550f5d3db Add &release.next;.
Approved by:	re (implicit)
2009-04-25 21:16:06 +00:00
Hiroki Sato 52ab77523b Bump version number for 7.2.
Approved by:	re (implicit)
2009-04-25 21:11:17 +00:00
Hiroki Sato 59fbe89293 Trim errata document for 7.2.
Approved by:	re (implicit)
2009-04-25 21:10:38 +00:00
Marc Fonvieille 2cfb122f55 Small attempt to update a bit relnotes:
ISC BIND 9.4.3-P2
timezone database tzdata2009f
GNOME 2.26
KDE 4.2.2

Approved by:	re (implicit)
2009-04-25 20:42:21 +00:00
Marc Fonvieille c4f7dce098 Add following Security Advisories:
SA-09:01.lukemftpd
SA-09:02.openssl
SA-09:03.ntpd
SA-09:04.bind
SA-09:05.telnetd
SA-09:06.ktimer
SA-09:07.libc
SA-09:08.openssl

Approved by:	re (implicit)
2009-04-25 13:52:47 +00:00
Marc Fonvieille 6df7da0052 Remove footer belonging to -STABLE version
Approved by:	re (implicit)
2009-04-25 12:58:01 +00:00
Marc Fonvieille b329f45a9a Update various entities required by release notes.
Approved by:	re (implicit)
2009-04-25 12:53:52 +00:00
Marc Fonvieille 04260ee25f Remove old (unmaintained) translations.
Approved by:	re (implicit)
2009-04-25 12:32:12 +00:00
Robert Watson 72f50b48c4 Merge r191434 from stable/7 to releng/7.2:
In sysctl_ifdata(), query the ifnet pointer using the index only
  once, rather than querying it, validating it, and then re-querying
  it without validating it.  This may avoid a NULL pointer
  dereference and resulting kernel page fault if an interface is
  being deleted while bsnmp or other tools are querying data on the
  interface.

  The full fix, to properly refcount the interface for the duration
  of the sysctl, is in 8.x, but is considered too high-risk for
  7.2, so instead will appear in 7.3 (if all goes well).

  Reported by:  mdtancsa

Approved by:	re (kensmith)
2009-04-23 18:23:08 +00:00
Christian Brueffer 563a73f034 MFC r191414
Correct the information about when the respective functionality first
appeared in FreeBSD.

Approved by:  re (kensmith)
2009-04-23 17:19:25 +00:00
Ken Smith 79c1c663cb Adjust for the 7.2-RELEASE package set.
Approved by:	re (kib)
2009-04-23 12:05:55 +00:00
Christian Brueffer 8fcffe2145 MFC r190822
Move an "end list" macro to the right place.

Approved by:	re (kensmith)
2009-04-23 08:11:48 +00:00
Ken Smith 6e5c517269 Get ready for 7.2-RC2 builds.
Approved by:	re (implicit)
2009-04-23 02:30:44 +00:00
Robert Noland 34e6868261 Merge 191274.
Don't try to setup interrupts for drivers that don't support them.

This causes sis and probably a couple of other driver to panic and fail.

Tested by:    cpghost <[email protected]>
Approved by:	re (kib)
2009-04-22 21:50:32 +00:00
Colin Percival 62309d46fc Don't leak information via uninitialized space in db(3) records. [09:07]
Sanity-check string lengths in order to stop OpenSSL crashing
when printing corrupt BMPString or UniversalString objects. [09:08]

Security:	FreeBSD-SA-09:07.libc
Security:	FreeBSD-SA-09:08.openssl
Security:	CVE-2009-0590
Approved by:	re (kensmith)
Approved by:	so (cperciva)
2009-04-22 14:07:14 +00:00
Ollivier Robert 9f5a40581d MFH of changeset r191200:
Add an entry for the French macbook keyboard layout.

Approved by:    re (kensmith)
2009-04-22 13:18:13 +00:00
Bjoern A. Zeeb f8cb494d51 MFC r191305:
Back out r186308 (r191014 in stable/7):

 In case of AF_LINK, which the kernel still returns for an RTAX_GATEWAY
 as an empty sockaddr_dl in the classic tun<n> case:
 copying the address into the message payload, but not the RTA_GATEWAY
 flag results in rt_xaddrs() in the kernel tripping over that and parsing
 the next attribute set with a flag, i.e. RTA_NETMASK, with the gateway
 address, resulting in bogus route entry.

Approved by:  re (kensmith)
2009-04-22 08:37:02 +00:00
Colin Percival 4e7ac0d6fc MFH r191302: Fix a buffer overflow.
For reasons of stack alignment, it does not appear that this is exploitable
on any systems FreeBSD runs on, so this will not be getting a security
advisory.

Approved by:	re (kib)
2009-04-21 10:54:47 +00:00
Marc Fonvieille 6e043e1a60 MFC: r191265
Add docs category.

Approved by:  re (kensmith)
2009-04-21 09:55:17 +00:00
Maksim Yevmenkin 23b937f516 MFC r191232
Fix bug in event timeout handling

Submitted by:	mav
Approved by:	re (kib)
2009-04-20 17:11:21 +00:00
Maksim Yevmenkin da2a3ace37 MFC r191164
Prevent atkbd(4) interrupt handler from calling keyboard callback function
when polled mode is enabled. This should help with duplicated/missing
characters problem at mountroot, geli, etc. prompts on multi CPU systems
while kbdmux(4) is enabled.

Tested by:	Tobias Grosser <grosser -at- fim -dot- uni-passau -dot- de>
Tested by:	Fabian Keil <freebsd-listen -at- fabiankeil -dot- de>
Approved by:	re (kib)
2009-04-20 17:09:53 +00:00
Edwin Groothuis 1b5ec3f62e MFC of tzdata2009f
Correct DST information for Pakistan for 2009.

Approved by:	re (kip)
2009-04-18 12:16:33 +00:00
Marius Strobl 516148ef3e MFC: r191076
- Remove the second license as I'm also fine with the first one.
- Remove redundant softc members for RIDs.
- Change some softc members to be unsigned where more appropriate.
- Add some missing const.
- Remove support for mmap(2)'ing VGA I/O as it was broken [1] and
  not required by X.Org anyway.
- Fix some confusion between bus, physical and virtual addresses
  which mostly consisted in using members of struct video_adapter
  inappropriately but wasn't fatal except for the regular framebuffer
  mmap(2)'ing.
- Remove redundant bzero(9)'ing of the softc.
- Don't map the framebuffer twice in case the firmware has already
  mapped it as besides wasting resources this isn't possible with
  all MMUs. This is a bit tricky as a) just because the firmware
  provides a property with a virtual address doesn't mean it's
  actually mapped (but typically is when the framebuffer is the
  console) and b) the firmware doesn't necessarily map it with
  the same byteorder as we do. This makes machfb(4) work on machines
  with cheetah-class MMUs (including X.Org).

Reported by:	Michael Plass [1]
Approved by:	re (kib)
2009-04-17 23:22:06 +00:00
Marius Strobl 6759c92a8d MFC: r191072
Fix whitespace.

Approved by:	re (kib)
2009-04-17 23:11:18 +00:00
Alexander Kabaev 9929416e83 MFC r191218 and related backout r191220.
More fallout from negative dotdot caching. Negative entries should
be removed from and reinserted to proper ncneg list.

Reported by:	pho
Submitted by:	kib
Approved by:	re (kib)
2009-04-17 21:18:17 +00:00
John Baldwin 7ff6b770c6 MFC: Use a disk address instead of an int to hold the starting offset of an
open partition.

Approved by:	re (kib)
2009-04-17 17:13:41 +00:00
Dmitry Chagin fec900bd04 Merge r190708 from HEAD to releng/7.2:
Fix KBI breakage by r190520 which affects older linux.ko binaries:

1) Move the new field (brand_note) to the end of the Brandinfo structure.
2) Add a new flag BI_BRAND_NOTE that indicates that the brand_note pointer
   is valid.
3) Use the brand_note field if the flag BI_BRAND_NOTE is set and as old
   modules won't have the flag set, so the new field brand_note would be
   ignored.

Suggested by:   jhb
Reviewed by:    jhb

Approved by:	re (Ken Smith), kib (mentor)
2009-04-17 17:05:31 +00:00
Alan Cox 1b65664c28 MFC r175055
Defer setting either PG_CACHED or PG_FREE until after the free page
  queues lock is acquired.  Otherwise, the state of a reservation's
  pages' flags and its population count can be inconsistent.  That could
  result in a page being freed twice.

(This change should have been included in the MFC of the superpages
support.)

Thanks to:	pho for an illuminating crash

Approved by:	re (kib)
2009-04-17 16:42:03 +00:00
Alexander Kabaev 6794374441 MFC r191081-191082:
Properly handle negative cache enries found through dotdot lookups.

Submitted by:	tegge
Approved by:	re(kib)
2009-04-15 16:36:13 +00:00
Ken Smith 2487bb6cb1 Add package directory for 7.2-REL. While here add the one for 6.4-REL.
Approved by:	re (implicit)
2009-04-15 04:28:22 +00:00
Ken Smith e175267715 Bump __FreeBSD_version for 7.2-REL plus the shift to show this is a
release branch.

Approved by:	re (implicit)
2009-04-15 04:27:04 +00:00
Ken Smith 98e57db40f Almost ready for 7.2-RC1 builds.
Approved by:	re (implicit)
2009-04-15 04:25:31 +00:00
Ken Smith 2a72044563 Update CVS tag to RELENG_7_2.
Approved by:	re (implicit)
2009-04-15 04:24:24 +00:00
Ken Smith 77bbc16437 Bump version from 7.1 to 7.2.
Approved by:	re (implicit)
2009-04-15 04:23:17 +00:00
Ken Smith 4c1e483f92 Change default version for manual pages to 7.2.
Approved by:	re (implicit)
2009-04-15 04:22:27 +00:00
Ken Smith af333ae2db Update branch to use.
Approved by:	re (implicit)
2009-04-15 04:21:21 +00:00
Scott Long 448152da57 Don't register the CAM passthrough interface until interrupts are running.
This fixes some problems at boot for some that are happening in fairly
rare cases.  It's just a hack, though, which is why it's only going into
stable/7 for now.  Note that this hack has a side effect of possibly not
scanning the AMR buses for /dev/passN devices at boot.  These devices are
not required for access to the RAID arrays, and only a few tools use them.
If this affects you, let me know.

Approved by:	re
2009-04-14 20:10:53 +00:00
George V. Neville-Neil 8af1295409 MFC of a Chelsio bug fix.
Fix a bug in the recent update to the Chelsio driver.
The tick routine was not being restarted in the init_locked routine
which could resulted in loss of carrier when updating the MTU.

Approved by:	re (kensmith)
Obtained from:	Chelsio Inc.
2009-04-14 18:52:39 +00:00
Jack F Vogel ba2b408c2d Change default on RX queues to 1, this has been found
as a more stable config.

Approved by: re
2009-04-14 16:48:49 +00:00
Jack F Vogel 94a6aa47f2 OK, been a long weekend and fingers are getting tired,
missed changing the file name :*(

Approved by: re
2009-04-14 00:38:02 +00:00
Jack F Vogel ead1b571dc Add ixgbe and remove ixgb driver support from GENERIC
in the amd64 architecture.

Approved by: re
2009-04-14 00:35:56 +00:00
Jack F Vogel bfbde85fe0 Update Makefile with new file for ixgbe driver
Approved by: re
2009-04-14 00:27:05 +00:00
Jack F Vogel 293dd2bcd8 Add extra file for the ixgbe driver checkin
Approved by: re
2009-04-14 00:24:59 +00:00
Jack F Vogel 2bb3c3a921 MFC ixgbe version 1.7.4 for FreeBSD 7.2, this is earlier
than planned but coordinated with and approved by RE.

Most important reason for this was so that FreeBSD 7.2
will have native support for the 82599 controller which
is part of the Nehalem launch.

The driver now does pluggable optics, multispeed fiber,
and header split. I am adding this to the GENERIC kernel
only in the amd64 architecture since its where I expect
most use and others were untested.

Enjoy!

Approved by: re
2009-04-14 00:23:13 +00:00
Max Laier 5cc303c24b MFH r190903 & r190895:
Remove interfaces from interface groups on detach.

Reported by:	various
Submitted by:	Mikolaj Golub (r190895)
PR:		kern/130977, kern/131310
Approved by:	re (gnn)
2009-04-13 22:17:03 +00:00
Bjoern A. Zeeb e3982f8e61 MFC r186308 by qingli:
The ppp application relies on the if_tun interface to properly
  install a ptp host route between the end points. The ppp module
  upates this router based on user configuration later on. The
  rt_Update() seems to always set the RTF_GATEWAY flag, which is
  broken.

PR:		bin/130159
Approved by:	re (kensmith)
2009-04-13 20:19:28 +00:00
David Xu 3f7ae6c522 MFC r190987 from head to stable/7:
Make UMTX_OP_WAIT_UINT actually wait for an unsigned integer on 64-bits
    machine.

Approved by:    re (kib)
2009-04-13 14:25:36 +00:00
Nathan Whitehorn 35110afd24 MFC r190946:
Fix recognition of kernel-mode traps that pass through the KDB trap handler
but do not actually invoke KDB. This includes recoverable machine checks
encountered in kernel mode.

This patch causes machines with Grackle host-PCI bridges to be able to
correctly enumerate them again.

Reviewed by:	marcel
Approved by:	re
2009-04-13 14:15:36 +00:00
Robert Watson be2942b5bc Merge r190996 from head to stable/7:
When writing out updated pollfd records when returning from
  poll(), only copy out the revents field, not the whole pollfd
  structure.  Otherwise, if the events field is updated
  concurrently by another thread, that update may be lost.

  This issue apparently causes problems for the JDK on FreeBSD,
  which expects the Linux behavior of not updating all fields
  (somewhat oddly, Solaris does not implement the required
  behavior, but presumably our adaptation of the JDK is based
  on the Linux port?).

  MFC after:      2 weeks
  PR:             kern/130924
  Submitted by:   Kurt Miller <kurt @ intricatesoftware.com>
  Discussed with: kib

Approved by:	re (kib)
2009-04-13 11:54:22 +00:00
Edwin Groothuis d5095261c1 MFC of tzdata2009e
- Jordan went into DST in the last Thursday in March instead of the
  last Friday in March.
- Palestine has extended the DST time with one week before and one
  month after.

Approved by:	re (kip)
2009-04-13 10:41:25 +00:00
Edwin Groothuis 13cbd3c7b6 MFC of tzdata2009d:
- Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00
- Tunisia will not observe DST this year.
- Syria will start DST on 2009-03-27 00:00 this year
- the Province of San Luis will go to utc-04:00

Approved by:	re (kib)
2009-04-13 09:22:03 +00:00
Maxim Sobolev fcb2f8183d MFC: Respect RBX_MUTE flag from boot[012].
Approved by:	re (kib)
2009-04-12 23:10:01 +00:00
Maxim Sobolev e1f6c8d2a9 MFC: Make machdep.hyperthreading_allowed working.
Approved by:    re (kib)
2009-04-12 23:06:23 +00:00
Alexander Kabaev d67003a4d5 MFC change 190756:
Fix logic in MOD_LOAD handler to call dcons_attach after all successful
dcons_drv_init invocations. Testing return value for 0 does not work for
cases where dcons_drv_init was called already as part of low level
onsole initialization.

Approved by:	re(kib)
2009-04-12 19:50:46 +00:00
Alexander Kabaev 99e72b7f3b MFC changes 190533 and 190945:
Replace v_dd vnode pointer with v_cache_dd pointer to struct namecache
in directory vnodes. Allow namecache dotdot entry to be created pointing
from child vnode to parent vnode if no existing links in opposite
direction exist. Use direct link from parent to child for dotdot lookups
otherwise.

This restores more efficient dotdot caching in NFS filesystems which
was lost when vnodes stoppped being type stable.

Majority of backporting work for this was done by jhb.

Reviewed by:	jhb, kib
Approved by:	re (kib)
2009-04-12 19:41:16 +00:00
Hajimu UMEMOTO 2cba174922 MFH r190382,190416,190525:
- getaddrinfo(3) should accept numeric when ai_socktype is not
  specified in hint or hints is NULL.
- Add support for SCTP to getaddrinfo(3).
  Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and
  IPPROTO_SCTP.  It confuses some programs.  If getaddrinfo(3) returns
  IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at
  least Apache doesn't work.  So, I made getaddrinfo(3) to return
  IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified
  explicitly by hints.ai_protocol.
- Query DNS only once per an address family.

Approved by:	re (kib)
2009-04-12 19:06:41 +00:00
Alexander Kabaev 66fc931eec Reimplement r189287 for -stable:
Change vfs_busy to wait until an outcome of pending unmount
operation is known and to retry or fail accordingly to that
outcome. This fixes the problem with namespace traversing
programs failing with random ENOENT errors if someone just
happened to try to unmount that same filesystem at the same
time.

Prodded by:	dhw, obrien
Approved by:	re(kib)
Sponsored by:	Juniper Networks, Inc.
2009-04-12 17:43:41 +00:00
Xin LI a0b7611fb8 MFC r190482: zero out memory before use and free.
Approved by:	re (kib)
Security:	Potential Information Leak
2009-04-11 15:19:26 +00:00
Xin LI fc29423f5f MFC r190809, 190810:
Update driver to vendor 1.16 plus some local changes to maintain our old
tweaks/behavor and to fix a bug with multiple cards.

Approved by:	re (kensmith)
2009-04-11 15:16:11 +00:00
Xin LI 1b41b9cf29 MFC r190832: Mention support of 1000baseSX and 2500baseSX.
Approved by:	re (kensmith)
2009-04-11 15:04:51 +00:00
Xin LI 6efa823956 MFC r190656:
Fix a crash when corrupted data file is found.

PR:		bin/32686
Approved by:	re (kib)
2009-04-11 14:10:42 +00:00
Dmitry Chagin b89025b00e Merge from HEAD to stable/7:
r186211:
Remove obsolete AT_DEBUG stuff.  It never should have been committed
in the first place, let alone migrated to linux emulation.

r189362:
Add AT_PLATFORM, AT_HWCAP and AT_CLKTCK auxiliary vector entries which
are used by glibc. This silents the message "2.4+ kernel w/o ELF notes?"
from some programs at start, among them are top and pkill.

Do the assignment of the vector entries in elf_linux_fixup()
as it is done in glibc.

Fix some minor style issues.

Approved by:	re (Ken Smith), kib(mentor)
2009-04-10 13:45:56 +00:00
Bjoern A. Zeeb 3c3b8f78d0 MFC r190800:
With the right comparison we get a proper wscale value and thus
  more adequate TCP performance with IPv6.

  Changes for IPv4, r166403 and r172795, both ignored the
  IPv6 counterpart and left it in the state of art of year 2000.

  The same logic in syncache already shares code between v4 and v6 so
  things do not need to be adapted there.

  Reported by:  Steinar Haug (sthaug nethelp.no)
  Tested by:    Steinar Haug (sthaug nethelp.no)

Approved by:	re (kib)
2009-04-10 12:32:44 +00:00
Stephen McKay 07a63855b6 MFC r187460: Add a limit on namecache entries.
Approved by: re (kib)
2009-04-08 04:30:16 +00:00
Xin LI 06d892f1fb MFC 190398 + 190405:
Use __packed for ioctl structure to make High Point management tool work.

Approved by:	re (kensmith)
2009-04-08 02:04:07 +00:00
Ivan Voras 4ba1652785 Merge r190424: man page accompanying r190816.
Reviewed by:	pjd
Approved by:	re (kib)
Approved by:	gnn (mentor) (original)
2009-04-07 19:35:41 +00:00
Ivan Voras d0966d8185 Merge r190423: introduce a new UFS-based label called "ufsid" that can
be used to reference UFS-carrying devices by the unique file system id.
An example of this new label is: /dev/ufsid/48e69c8b5c8e1b43.
The benefit of using GEOM labels in general is to avoid problems of
device renaming when shifting drives or controllers.

Reviewed by:	pjd
Approved by:	re (kib)
Approved by:	gnn (mentor) (original)
2009-04-07 19:18:02 +00:00
Maksim Yevmenkin a6cba25b2f MFC r190575
- Add ipfw_nat to the list of required modules if "firewall_nat_enable"
  is set and "natd_enable" is NOT set;

- Accept and pass firewall type to the external firewall script.

Submitted by:		Yuri Kurenkov < y -dot- kurenkov -at- init -dot- ru >
No response from:	freebsd-rc
Approved by:		re (kib)
2009-04-07 16:29:50 +00:00
Ruslan Ermilov 8aac52f036 MFC:
- Add missing include.

- Style: size_t can't be negative.

- Don't exit with a zero status code when no jails are configured
  on a system.

- Style: simplify some code constructs.

- If a single jail cannot be found, let the caller print a proper
  diagnostic message.

Approved by:	re (kib)
2009-04-07 12:49:50 +00:00
Edward Tomasz Napierala 6079807beb MFC r185693:
Make it possible to use gjournal for the root filesystem.  Previously,
an unclean shutdown would make it impossible to mount rootfs at boot.

Approved by:	re (kib)
2009-04-06 17:33:35 +00:00
Colin Percival 2a20045f38 MFC r190679: Set SO_NOSIGPIPE on sockets in order to avoid having
phttpget die when a RST packet arrives.

Approved by:	re (kib)
2009-04-06 15:45:03 +00:00
Christian Brueffer b1ae92fe42 MFC: rev. 190557
Fix memory leak in semunload().

Approved by:	re (kib)
2009-04-06 12:00:51 +00:00
Luigi Rizzo ab642611eb MFC: use shared libraries for the crunched binary,
put together the basic binaries so it is easier to replace them
with busybox.

Approved by:	re (blanket on picobsd)
2009-04-06 11:31:31 +00:00
Luigi Rizzo 059c0952bf bump image size to 4MB and remove references to non-devfs configs
Approved by:	re (blanket on picobsd)
2009-04-06 11:23:20 +00:00
Luigi Rizzo b71fd20b1e diff reduction with the version in head
Approved by:	re (blanket on picobsd)
2009-04-06 11:22:29 +00:00
Luigi Rizzo d5ffafafa0 MFC: remove call to non-existing dev-mkdb
Approved by:	re (blanket on picobsd)
2009-04-06 11:21:58 +00:00
Luigi Rizzo afb8b6ce2f put the absolute path for /etc/rc1
Approved by:	re (blanket on picobsd)
2009-04-06 11:21:14 +00:00
Luigi Rizzo c335c9375d MFC: bring in recent fixes to the picobsd script
Approved by:	re (blanket on picobsd)
2009-04-06 11:15:28 +00:00
Ruslan Ermilov 4c6d9dac8f MFC: Don't put "install-info" to the list of install-tools if we're
installing with -DWITHOUT_INFO.

Approved by:	re (kib)
2009-04-05 00:51:59 +00:00
Ulf Lilleengen 8e432b95a4 MFC r190422:
- Add proper error checking and printing to the CVSMode code when reading and
  writing from/to streams, as leaving them out stops csup from cleaning up on
  SIGINT and friends properly.

Approved by:	re (kib)
2009-04-03 16:02:13 +00:00
Alexander Motin 29a1f1472c MFC rev. 188464.
Check for device_set_devclass() errors and skip driver probe/attach if any.
Attach called without devclass set crashes the system.

On attach/resume some ATA drivers sometimes trying to create duplicate adX
device. It is surely their own problem, but it is not a reason to crash here.

Approved by:	re (kib)
2009-04-03 10:38:24 +00:00
Weongyo Jeong 58e67b4192 MFC r190541:
fix a bug of uses after free.

  Pointed by:	dchagin

MFC r190544:
  handles more exceptional cases when the driver failed to attach.

MFC r190550:
  corrects a error message.

MFC r190590:
  fix a bug that it passed a incorrect flag BUS_DMA_ALLOCNOW to create
  a device specific DMA tag. On amd64 it could exhaust all of bounce
  pages when bus_dma_tag_create(9) is called at malo_pci_attach() then
  as result in next turn it returns ENOMEM. This fix a attach fail on
  amd64.

  Pointed by:   yongari
  Tested by:    dchagin

Approved by:	re (kib)
2009-04-03 03:25:00 +00:00
Warner Losh 5c663b3f65 Merge 190488 from head:
Fix shared memory packet movement.

Approved by:	re@ (kostik)
2009-04-03 03:04:26 +00:00
Pyun YongHyeon c962a4a9fc MFC r190587:
It seems that RTL8168D and RTL8102EL requires additional settle
  time to complete RL_PHYAR register write. Accessing RL_PHYAR
  register right after the write causes errors for subsequent PHY
  register accesses.

  Tested by:    george at luckytele dot com,
                Steve Wills < STEVE at stevenwills dot com >
Approved by:	re (Kostik Belousov)
2009-04-03 00:12:14 +00:00
Tom Rhodes cb639e0af4 nt a warning when blackhole and reject are used together.
Update arp.8 manual page syntax.

PR:		125896
Submitted by:	Marc Olzheim <[email protected]>
Approved by:	re (kib), sam
2009-04-02 22:04:44 +00:00
Robert Noland 84deb9e1d3 Merge 190565
We don't know what these pages are going to be used for, they should be
un-cached.  This got lost somewhere with all the bus_dma fixups.

Approved by:	re (kib)
2009-04-02 18:21:41 +00:00
Robert Noland 55d44b66a6 Merge 190563
Load the right microcode for RS780

Approved by:	re (kib)
2009-04-02 18:20:46 +00:00
Robert Noland 510c37dee9 Merge 190399
The GART allocations are a propery of the gart, not of scatter-gather
memory.  Track them in the appropriate structure.

Approved by:	re (kib)
2009-04-02 17:58:20 +00:00
Robert Noland 5fc5063eaa Merge 190124
Add a couple of radeon pci ids.

Approved by:	re (kib)
2009-04-02 17:57:04 +00:00
Robert Noland 5ad98033dc Merge 190123,190282
Fix up the flags to bus_dmamem again.  The man page incorrectly showed
the BUS_DMA_NOCACHE flags as being a valid flag for load instead of alloc.

Approved by:	re (kib)
2009-04-02 17:53:30 +00:00
Weongyo Jeong 65d8901787 MFC r190437:
bump date.

  Pointed by:	yongari

Approved by:	re (kib)
2009-04-02 02:26:58 +00:00
Tom Rhodes cefcc12d8b MFC r186429:
Document the "-o large" option.

PR:		129792

And r186768:
Add missing qualifier which was missed in the previous commit.

Noticed by:	brooks

Approved by:	re (kib)
2009-04-01 06:03:23 +00:00
Tom Rhodes cbc10e80cc MFC r186431:
Note that when shutdown is run without options, it will place
the system into single user mode at the time specified.

PR:		129765

Approved by:	re (kib)
2009-04-01 06:01:40 +00:00
Xin LI ff1fd1b87d MFC r187318:
Reflect PCI ID changes for bce(4).

Approved by:	re (kensmith)
2009-03-31 16:44:07 +00:00
Weongyo Jeong 6abef001a0 MFC r190434:
The malo(4) device driver first appeared in FreeBSD 7.1 not 8.0.

  Reported by:	John <lists_at_reiteration.net>

Approved by:	re (hrs)
2009-03-31 02:29:42 +00:00
Xin LI 9b8aa08483 Update bce(4) to latest -CURRENT version:
- Add several HP OEM parts' PCI IDs (187133+187317)
 - Remove intermediate variable busaddr and have bus_* operate
   directly on softc members upon initialization. (187204)
 - Only enable split header operation when ZERO_COPY_SOCKETS is
   enabled in the kernel. (189117)
 - Updated firmware to latest 4.6.X release. (189325)
 - Added missing firmware for 5709 A1 controllers. (189325)
 - Changed some debug statistic variable names to be more
   consistent. (189325)

Approved by:	re (kensmith)
2009-03-31 01:01:01 +00:00
Jeff Roberson 22497af641 MFC SVN rev 189787.
- Fix steal_thresh calculation with odd numbers of cpus and sched_affinity()
   for threads on runqueues.
Approved by:	re
2009-03-30 19:20:56 +00:00
John Baldwin 2559cfd2a2 MFC: Reenable 64-bit DMA for twa(4) controllers, but use a boundary of 4GB
to prevent individual transactions from crossing a 4GB address boundary.
Due to bus_size_t type limitations, the driver uses a 2GB boundary in PAE
kernels.

Approved by:	re (kensmith)
2009-03-30 18:43:41 +00:00
John Baldwin 1c5a8f46e9 MFC: Move the code to update cpu_cx_count out of acpi_cpu_generic_cx_probe()
and into acpi_cpu_startup() which is where all the other code to update this
global variable lives.  This fixes a bug where cpu_cx_count was not updated
correctly if acpi_cpu_generic_cx_probe() returned early.

Approved by:	re (kensmith)
2009-03-30 18:33:04 +00:00
Robert Watson fb032f49f0 Merge r189196 from head to stable/7:
Remove unreachable code for generating RST segments from tcp_twcheck();
  this code became stale when T/TCP support was removed.

  Discussed with: bz, sam

Approved by:	re (kensmith)
2009-03-30 14:11:37 +00:00
Alexander Motin afd50dd2df MFC rev. 190519:
Fixup relative pointers after channel realloc. It fixes crash on systems
 with several HDA codecs per controller.

 While I am there, remove some unneeded dereferences.

MFCed earlier than it should be so that it can be part of 7.2-BETA1.

PR:		kern/131785
Submitted by:	Tor Egge <[email protected]>
Approved by:	re (kensmith)
2009-03-30 10:18:43 +00:00
Ulf Lilleengen 2c5cb33508 MFC r190406:
- Remember to set umask before setting attributes of RCS file.

Approved by:	re (kib)
2009-03-30 08:44:29 +00:00
Pyun YongHyeon 67e25ae119 MFC r190407:
Fix typo.

Approved by:	re (Ken Smith)
2009-03-30 04:42:08 +00:00
Robert Watson edba99d0b0 Merge r185858 from head to stable/7:
Remove inconsistent white space from in_pcballoc().

Approved by:	re (kib)
2009-03-29 17:42:30 +00:00
Dmitry Chagin 6363bdcad5 Merge from head to stable/7:
r189771:
Implement new way of branding ELF binaries by looking to a
".note.ABI-tag" section.

The search order of a brand is changed, now first of all the
".note.ABI-tag" is looked through.

Move code which fetch osreldate for ELF binary to check_note() handler.

r189919:
Use the properly sized types for ELF object header and program headers.
This fixes osrel fetching from the FreeBSD branding note for the 64bit
platforms (bug introduced by r189771).

r190264:
Fix several issues with parsing the notes for ELF objects.

Badly formed ELF note may cause the caclulated pointer to the next note
to point both after the note region, that was checked in the code, but
also to point before the region, that was not checked [1]. Remember the
first note location in note0 and leap out if the note is not between
note0 and note_end.

In the similar way, badly formed note may cause infinite loop by
pointing next note into the same or previous note. Guard against this
by
limiting amount of loop iterations by arbitrary choosen big number.

For clarity, check the calculated note alignment in each iteration.

PR:     kern/132886
Approved by:	re(Ken Smith)
2009-03-29 08:07:36 +00:00
Tim Kientzle 86e15b8026 Merge r188343 from -CURRENT: Unbreak writing shar archives.
When copying file data to the archive, don't write more
   than was read.  This seems to have only affected the shar
   writer, since other formats proactively truncate output
   to the originally-advertised size.

PR:		bin/131244
Approved by:	re (Ken Smith)
2009-03-29 01:04:13 +00:00
Tim Kientzle 4c12798996 MFC r187976: Restore timestamps on symlinks
Before this fix, pax would stop the restore sequence for
   symlinks after setting the owner.  As a result, mode
   and timestamp were not restored.  This patch corrects the
   problem by simply removing the short-circuit for symlinks
   and using lchown()/lchmod()/lutimes() always for restoring
   metadata.

PR:		bin/91316
Submitted by:	Jaakko Heinonen
Reviewed by:	Joerg Sonnenberger
Approved by:    re (Ken Smith)
2009-03-29 01:00:48 +00:00
Marius Strobl 35519cdd7b MFC: r190375, r190376
Given that zfs.ko depends on opensolaris.ko also build the latter by
default on sparc64.

Approved by:	re (kib)
2009-03-28 19:47:46 +00:00
Marius Strobl 238ae7b71f MFC: r190374
As with ZFS use real atomic operations for sparc64.

Approved by:	re (kib)
2009-03-28 19:23:10 +00:00
Robert Watson 0159f5607b Enable soreceive_dgram() use by UDP by default in 7.x. This can lead
to a significant performance improvement for multi-threaded UDP socket
receive, such as found in BIND, memcached, VoIP applications, etc.

Requested by:	Florian Smeets <flo at kasimir.com>
Approved by:	re (kib)
2009-03-28 16:12:32 +00:00
Marius Strobl 09b9012bde MFC: r190319
- Ensure that INTx isn't disabled, as these chips apparently have a
  quirk requiring it to be enabled even when using MSI. This makes
  the latter work again after r189568.
- Remove a comment which no longer applies since r190335.

Approved by:	re (kib)
2009-03-27 21:21:22 +00:00
Konstantin Belousov 29f173ca37 MFC r189737:
The non-modifying EA VOPs are executed with only shared vnode lock taken.
Provide a custom lock around initializing and tearing down EA area,
to prevent both memory leaks and double-free of it. Count the number
of EA area accessors.

Put the new field i_ea_refs to the end of the struct inode to keep
structure layout stable on releng branch for the benefit of lsof.

MFC r190469:
Correct typo.

ABI issue pointed out by:	kensmith
Approved by:	re (kensmith)
2009-03-27 15:57:52 +00:00
John Baldwin 95cd2a40ba MFC: Improve the description of a few sysctls.
Approved by:	re (kib)
2009-03-27 15:45:52 +00:00
John Baldwin c8d3b5555f MFC: Release driver lock at the end of the watchdog routine instead of
trying to acquire it again.

Approved by:	re (kib)
2009-03-27 15:19:51 +00:00
Konstantin Belousov 17cbd3654e MFC r190141:
When ktracing namei operations, log a result of the __getcwd().

Approved by:	re (kensmith)
2009-03-27 13:05:29 +00:00
Robert Watson 43f9916d92 r189615:
Remove now-unused INP_UNMAPPABLEOPTS.

  Discussd with: bz

r189637:

  Avoid use of IPv6  macro aliases to inpcb fields and inp_flags; we don't
  remove their defintions as some third-party tools may use them (such as
  net-snmp), unlike in the 8.x change.

  References to in6p_lport and in6_fport in sockstat are also replaced with
  normal inp_lport and inp_fport references.

  Reviewed by:   bz

r189848:

  Correct a number of evolved problems with inp_vflag and inp_flags:
  certain flags that should have been in inp_flags ended up in inp_vflag,
  meaning that they were inconsistently locked, and in one case,
  interpreted.  Move the following flags from inp_vflag to gaps in the
  inp_flags space (and clean up the inp_flags constants to make gaps
  more obvious to future takers):

    INP_TIMEWAIT
    INP_SOCKREF
    INP_ONESBCAST
    INP_DROPPED

  Some aspects of this change have no effect on kernel ABI at all, as these
  are UDP/TCP/IP-internal uses; however, netstat and sockstat detect
  INP_TIMEWAIT when listing TCP sockets, so any MFC will need to take this
  into account.

  MFC after:      1 week (or after dependencies are MFC'd)
  Reviewed by:    bz

Note that this change requires netstat, systat, and sockstat to be
recompiled in order to properly print TIMEWAIT connection state; this
minor API change (documented in UPDATING) is considered worth it in
order to fix the above bugs.  This change fixes the INP_ONESBCAST bug
describted in kern/124282 by disambiguating flag use.

Approved by:    re (kib)
PR:             kern/124282
r189637 discussed with:	pav
2009-03-26 22:54:19 +00:00
Yoshihiro Takahashi d01d028ad9 MFC: r189446
Allow different ABIs to use different initial control words for the FPU.

Approved by:	re (Kostik Belousov)
2009-03-26 17:04:08 +00:00
Robert Watson 7314f96f1e Merge r189657 from head to stable/7:
Add INP_INHASHLIST flag for inpcb->inp_flags to indicate whether
  or not the inpcb is currenty on various hash lookup lists, rather
  than using (lport != 0) to detect this.  This means that the full
  4-tuple of a connection can be retained after close, which should
  lead to more sensible netstat output in the window between TCP
  close and socket close.

Approved by:	re (kib)
2009-03-26 14:20:16 +00:00
Bjoern A. Zeeb 39cfbfd447 MFC r184097:
Update a comment which to my reading had been misplaced in rev. 1.12
  already (but probably had been way above as the code was there twice)
  and describe what was last changed in rev. 1.199 there (which now is
  in sync with in6_src.c r184096(HEAD), r189956(stable/7)).

Approved by:	re (rwatson)
2009-03-26 13:27:26 +00:00
Bjoern A. Zeeb bd9fb47891 MFC r186393:
Correct variable name in comment.

Approved by:	re (rwatson)
2009-03-26 13:22:29 +00:00
Konstantin Belousov 0519e5ad1d Include linux_misc.h to get the definition for __LINUX_NPXCW__.
Approved by:	re (kensmith)
2009-03-26 12:13:19 +00:00
John Baldwin 2b9e37e2b9 Allow different ABIs to use different initial control words for the FPU on
amd64 and i386.  This fixes a bug were 32-bit binaries would run with a
different floating point exception mask under FreeBSD/amd64 vs FreeBSD/i386.
This commit also includes a few other minor changes to keep the code in
sync with 8.

Approved by:	re (kib)
2009-03-25 17:22:15 +00:00
Konstantin Belousov e8c562aaf0 MFC r190266:
7.2 will be the first release where strndup() appears.

Approved by:	re (kensmith)
2009-03-25 15:42:07 +00:00
Alexander Motin 421100b978 MFC rev. 188846:
Handle nForce MCP67 and MCP73 SATA controllers as AHCI. They report
itself as ATA RAID, but generic ATAPCI driver unable to detect drives
there. AHCI driver reported to handle them fine. Linux does the same.

Submitted by:	Andrey V. Elsukov on stable@
PR:		kern/125713
Approved by:	re (kib)
2009-03-25 14:26:38 +00:00
VANHULLEBUS Yvan d3524dbac4 MFC: Added DLT_ENC to map list, so it is now possible
to save dumps on enc0

Approved by:	re (gnn)
Obtained from:	NETASQ
2009-03-25 14:11:29 +00:00
Konstantin Belousov 5da9fe5b5d Mostly synchronize lib/libthr and sys/kern/kern_umtx.c with the code
from HEAD.

Since libkse is still built on RELENG_7, pthread_cleanup_push/pop
are left as the functions, but the support code in libthr is present for
the macro versions.

Malloc in RELENG_7 does not require thread exit hook, but I decided
to add empty handler for it, instead of removing callback from thr_exit().

No mergeinfo since this change is prepared by patching libthr and then
bringing in required missed bits.

Requested by:	bms
Reviewed by:	davidxu
Tested by:	bms, Mykola Dzham <i levsha org ua>
Approved by:	re (kensmith)
2009-03-24 20:57:10 +00:00
Luigi Rizzo bc0cd6411c remove unused entries and stale comments on the size of objects
Approved by:	re (blanket on picobsd)
2009-03-24 18:35:01 +00:00
Luigi Rizzo 8a3504706d make the mfs larger to give room for shared libs.
Build /dev/random so ssh can find it

Approved by:	re (blanket on picobsd)
2009-03-24 18:34:19 +00:00
Doug Barton d018fc5f4e MFC r181113, -c named_flags example and capitalization fix 2009-03-24 02:56:50 +00:00
Doug Barton ea8a418cc7 MFC r181114, make sure services and protocols are in the chroot /etc
MFC r188293, improve handling of chroot inside of a jail
2009-03-24 02:54:15 +00:00
Doug Barton 168e024233 MFC r180564, addition of the SHUTDOWN keyword to those scripts that
start persistent services.
2009-03-24 02:48:54 +00:00
David E. O'Brien bb6b8e5378 Revert r190357, in which I was just trying to get the merge info set at
the src level.
(turns out svn+ssh://[email protected]/base/head and
svn+ssh://svn.freebsd.org/base/stable/7 are seen as two totally different
repositories... Jeez subversion can be dumb...)
2009-03-24 02:28:46 +00:00
David E. O'Brien 8f88d24331 MFC: r187964: Fix the inconsistent tabbing. 2009-03-24 02:09:48 +00:00
David E. O'Brien df246f5f30 MFC: r186234/r186236: Use passed parameter rather than a hard coded value.
Bump WARNS to 3.
2009-03-24 01:56:16 +00:00
David E. O'Brien 5af4d01225 MFC: 186291: Use strlcpy(). 2009-03-24 01:54:17 +00:00
David E. O'Brien ebeb22fe92 MFC: r186581: Sound less scary about errorousous disk geometry. 2009-03-24 01:51:42 +00:00
David E. O'Brien 7ef79bedaf MFC: r186337/r186444/186784: burncd(8) doesn't handle signals and interrupting
burncd during operation.  Add signal handling by doing a CDRIOCFLUSH ioctl
to attempt to leave burner in a sane state when burning is interrupted with
SIGHUP, SIGINT, SIGTERM, or in case an I/O error occurs during write.
2009-03-24 01:35:58 +00:00
David E. O'Brien 70df965f8a MFC:
r189397: Add a -o mountprog parameter to mount which explicitly allows an
	 alternative program to be used for mounting a file system.
r187035/r187093/r187130: Don't overflow buffers when processing -o options.
2009-03-24 01:31:42 +00:00
David E. O'Brien eeafa811e4 MFC: r187102 / r187107: Update fech URL. 2009-03-24 01:18:35 +00:00
David E. O'Brien d5441f8b1b MFC: r187116: If running with "-K" really do not information about symbols
from the a.out argument.
2009-03-24 00:46:44 +00:00
David E. O'Brien e748d17531 MFC: r187907: For files not named on the command line, only the basename is
compared to the exclude pattern.
2009-03-24 00:44:30 +00:00
David E. O'Brien 3fbccc8fd7 MFC: r187931: Add the '-C' "check clean" flag. 2009-03-24 00:43:12 +00:00
David E. O'Brien bde82f7728 MFC:
r173412: Cleanup of userland __P use.
r187943: Run with -B and just .POSIX.
r173067: Include <stdlib.h> for the right prototype for exit(3).
r173065: Set the program name if the crunched program is selected
	 through argv[1] to mimic crt0 behaviour.
2009-03-24 00:34:55 +00:00
David E. O'Brien b10f4fd98c MFC: r187724 / r187969: unsplit _PATH_SYSPATH & _PATH_STDPATH. 2009-03-24 00:30:06 +00:00
David E. O'Brien d7447c402b MFC:
r187475: Remove inlining of functions that are used mostly in different
	 object files.  This lets use to remove NO_WERROR.
r186558: Consistently use Var_SetGlobal().
r186713: Add the -Q be-quiet flag for parallel jobs.
r186279: Exit with error code 2 when run with -k (continue if errors)
	 and build failed.
r186559: Add the ability to tweak the token output before targets in job mode.
r181021: Add POSIX -p flag to make(1).
r186502: Clarify the behaviour of conditionals when dealing with comparisons.
2009-03-24 00:07:17 +00:00
David E. O'Brien 7af4ee8f35 MFC: r189721: don't need to set symbol, default value OK 2009-03-23 23:32:20 +00:00
Luigi Rizzo c7bd2b3dc2 MFC: add support for local config files and non-chroot
copy of files from the host filesystem
2009-03-23 21:32:03 +00:00
Marius Strobl 1f05d27ebf MFC: r190194
- In bge_ifmedia_upd_locked() take advantrage of LIST_FOREACH().
- If boot verbose, print asicrev, chiprev and bus type on attach.
- For PCI Express devices:
  1) Adjust max read request size to 4Kbytes
  2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()
  Though 1) does not seem to have much to do with the poor TX performance
  observed on PCI Express bge(4), 2) does fix the problem. [1]
- Nuke the RX CPU self-diag, which prevents working cards from working
  (Linux tg3 does not have this diag neither does OpenBSD's bge(4)).
  The increasing of the firmware handshaking timeout to 20000 retries
  done as part of the original commit isn't merged as way already have a
  way higher BGE_TIMEOUT of 100000.

PR:		119361 [1]
Obtained from:	tg3 via DragonflyBSD [1], DragonflyBSD
2009-03-23 20:53:38 +00:00
VANHULLEBUS Yvan 9bc0d3095a SAs are valid (but dying) when they reached soft lifetime,
even if they have never been used.

Approved by:	gnn(mentor)
2009-03-23 20:37:37 +00:00
John Baldwin 0cd2926f89 MFC: Export the current values of nbuf, ncallout, and nswbuf via read-only
sysctls that match the tunable names.
2009-03-23 20:29:54 +00:00
John Baldwin f8f82eadf4 MFC: Move the debug.hashstat sysctl tree under DIAGNOSTIC. 2009-03-23 20:23:28 +00:00
Andrew Thompson a9294a04fe MFC r189905
Fix checking of the IGNORE_RESIDUE quirk.

Submitted by:	marius
2009-03-23 18:13:18 +00:00
Doug Barton 3e186a3c58 MFC 190320, don't expand example $FreeBSD strings 2009-03-23 14:53:21 +00:00
Jamie Gritton a08d3cd117 MFC:
r189864:
   Default to AF_LOCAL instead of AF_INET sockets for non-family-specific
   operations.  This allows the query operations to work in non-IPv4 jails,
   and will be necessary in a future of possible non-INET networking.
   (reprise r189970)

 r190151:
   Call the interface's if_ioctl from ifioctl(), if the protocol didn't
   handle the ioctl.  There are other paths that already call it, but this
   allows for a non-interface socket (like AF_LOCAL which ifconfig now
   uses) to use a broader class of interface ioctls.

Approved by:	bz (mentor)
2009-03-23 12:07:29 +00:00
Maxim Konovalov d4fe63a1e2 MFC r175118: when the ms/req fields exceed 1 second, drop the fractions
to fit more digits.
MFC r183665: batch mode.
MFC r189738: fix man page sinopsys; remove BUG section.
MFC r189739: turn the batch mode on if stdout is not tty.
2009-03-23 09:00:33 +00:00
Craig Rodrigues 6eeb699cb5 MFC 183005, 187812:
Add code to parse mount options passed as individual
items of the nmount() iovec.
2009-03-23 08:33:19 +00:00
Gregory Neil Shapiro 7d5a604d53 MFC r190304: Add the URL for RFC2142
PR:		conf/127510
2009-03-23 04:54:52 +00:00
Andrew Thompson d0091636e7 Sync umass quirks to HEAD. 2009-03-23 04:07:46 +00:00
Andrew Thompson 09c6f1428f Sync usbdevs to HEAD, keeping name compat. 2009-03-23 04:06:21 +00:00
Edwin Groothuis 271c74b5fb MFC of ...
r187524:
Latest bulletin C from Daniel GAMBIS: no leap at the end of june 2009.

r188436:
MFV of tzdata2009b.
- Updated leapseconds

r189923:
MFV of tzdata2009c
- Cuba has DST again.
2009-03-23 03:26:01 +00:00
Sean Farley 1c88a1c8ba Merge r189866 from head to stable/7:
Add the SIOCSIFMTU ioctl handling directly to tap(4) permitting it to have
  its MTU set higher than 1500 (ETHERMTU).  Its new limit is now 65535 as
  enforced by ifhwioctl() in if.c

  This allows a tap(4) device to be added to a bridge, which requires all
  interface members to have the same MTU, with an interface configured for
  jumbo frames.  QEMU may now connect to a network via tap(4) without
  requiring the real interface to have its MTU set to 1500 or lower.

  Reviewed by:	rpaulo, bms

Merge r189907 from head to stable/7:

  Remove the splimp()/splx() calls around the setting of the MTU.  They are
  no-op's that I inadvertently added.  Even if locking is needed in general
  for the ioctl's, setting a single long will not need it due to the
  operation being atomic.

  Reported by:	rwatson
2009-03-23 03:03:44 +00:00
Nathan Whitehorn 06b17a2c74 MFC r189675:
Change the PVO zone for fictitious pages to the unmanaged PVO zone, to match
the unmanaged flag set in the PVO attributes. Without doing this,
pmap_remove() could try to remove fictitious pages (like those created
by mmap of physical memory) from the wrong UMA zone, causing a panic.

Reported by:    Justin Hibbits
2009-03-23 00:15:38 +00:00
Colin Percival 75bb89c93a Correctly sanity-check timer IDs. [SA-09:06]
Limit the size of malloced buffer when dumping environment
variables. [EN-09:01]

Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-09:06.ktimer
Errata:		FreeBSD-EN-09:01.kenv
2009-03-23 00:00:50 +00:00
Mike Silbersack 2e2335c75c Fix unp_gc so that it recognizes file descriptors
that are currently in the process of being passed
between processes as alive and does not
try to garbage collect them.

The full description of the problem and a test
program to reproduce it can be found in PR 112554.

This fix was inspired by similar fixes in NetBSD and BSD/OS.
However, it does not apply to FreeBSD 8 and above -
when this code was rewritten and optimized, the bug
was fixed in a different way.  The test program in the
PR passes on 8-current with flying colors.

PR:		112554
Submitted by:	Spencer Minear
Reviewed by:	Mike Silbersack
Obtained from:	Secure Computing Corp
MFC after:	4 weeks
2009-03-22 23:00:00 +00:00
Marius Strobl 59a31fa7fd MFC: r183423, r184428, r185133, r186290, r190108
Add a driver for `Schizo' Fireplane/Safari to PCI 2.1 and `Tomatillo'
JBus to PCI 2.2 bridges including subsequent fixes and improvements
as of r190108.
2009-03-22 22:19:54 +00:00
Marius Strobl 23027986a5 MFC: r190117
- Set MIIF_NOLOOP and don't add IFM_LOOP as loopback apparently isn't
  supported with these pseudo-PHYs. The MIIF_NOLOOP flag currently triggers
  nothing but hopefully will be respected by mii_phy_setmedia() later on.
- Don't add IFM_NONE as isolation isn't supported by these pseudo-PHYs.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
  be eventually retired.
2009-03-22 22:08:30 +00:00
Marius Strobl a80cf8dc69 MFC: r190112
- As suggested by OpenSolaris use up-burst-sizes for determining the
  supported burst sizes.
- Add support for 64-bit burst sizes (required for SBus GEM).
- Register our interrupt filters with the revived INTR_FAST so
  they these interrupts can even interrupt filters of device
  drivers as necessary.
- Failing to register as interrupt controller during attach shouldn't
  be fatal so just inform about this instead of panicing.
- Take advantage of KOBJMETHOD_END.
- Remove some redundant variables.
- Add missing const.
2009-03-22 22:05:22 +00:00
Marius Strobl f99bf7fc5d MFC: r190111
Add device found in B100.
2009-03-22 22:00:19 +00:00
Marius Strobl e4e75e613c MFC: r190109
- Ensure we find no unexpected partner.
- Failing to register as interrupt controller during attach shouldn't
  be fatal so just inform about this instead of panicing.
- Disable rerun of the streaming cache as workaround for a silicon bug
  of certain Psycho versions.
- Remove the comment regarding lack of newbus'ified bus_dma(9) as being
  able to associate a DMA tag with a device would allow to implement
  CDMA flushing/syncing in bus_dmamap_sync(9) but that would totally
  kill performance. Given that for devices not behind a PCI-PCI bridge
  the host-to-PCI bridges also only do CDMA flushing/syncing based on
  interrupts there's no additional disadvantage for polling(4) callbacks
  in the case schizo(4) has to do the CDMA flushing/syncing but rather a
  general problem.
- Don't panic if the power failure, power management or over-temperature
  interrupts doesn't exist as these aren't mandatory and not available
  with all controllers (not even Psychos). [1]
- Take advantage of KOBJMETHOD_END.
- Remove some redundant variables.
- Add missing const.

PR:	131371 [1]
2009-03-22 21:38:24 +00:00
Marius Strobl 5a7b7bed7e MFC: 190107 (partial)
- There's no need to wrap kdb_active and kdb_trap() in #ifdef KDB as
  they're always available.
- Remove unused variable. [1]
- Add a missing const.
- Sort includes.

Submitted by:	Christoph Mallon [1]
2009-03-22 21:31:02 +00:00
Marius Strobl a98790b109 MFC: r190103
Take advantage of KOBJMETHOD_END.
2009-03-22 21:17:20 +00:00
Marius Strobl ec1cfe8e51 MFC: r190101
Take advantage of KOBJMETHOD_END.
2009-03-22 21:16:10 +00:00
Marius Strobl 6a19f0e1f5 MFC: r190099
- Sort device methods.
- Take advantage of KOBJMETHOD_END.
2009-03-22 21:14:33 +00:00
Marius Strobl 1401fd5863 MFC: r190098
- Failing to register as interrupt controller during attach shouldn't
  be fatal so just inform about this instead of panicing.
- Sort device methods.
- Take advantage of KOBJMETHOD_END.
- Remove some redundant variables.
2009-03-22 20:54:22 +00:00
Marius Strobl a448bd1954 MFC: r188475
o Introduce KOBJMETHOD_END for the end of the kobj list.
o Fix a minor indentation problem.
o Put in the extra-strict KOBJMETHOD define, but commented out since
  the tree isn't yet ready.

Reviewed by:	(1) was posted to arch@ without objection (and 1 go for it)
2009-03-22 20:52:43 +00:00
Marius Strobl 857f042077 MFC: 188040
Use NULL in preference to 0 for pointers.
2009-03-22 20:50:45 +00:00
Alan Cox 183283f466 MFC r188932, r189785, r189795, and r190272
Optimize free_pv_entry(); specifically, avoid repeated TAILQ_REMOVE()s.

  Update the pmap's resident page count when a page table page is freed in
  pmap_remove_pde() and pmap_remove_pages().

  Update stale comments.  The alternate address space mapping was eliminated
  when PAE support was added to i386.  The direct mapping exists on amd64.
2009-03-22 20:46:37 +00:00
Marius Strobl 74b818c69a MFC: 190097
- Sprinkle const.
- Remove incorrect __unused.
2009-03-22 20:36:26 +00:00
Nick Hibma 329a410ae8 MFC the (current) u3g driver, a driver for USB based 3G cards and dongles.
This includes changes to ubsa (removing attachment from that device),
and small changes to ucom.

Note: A change to umass reducing the attach priority for it was committed
already.
2009-03-22 16:27:14 +00:00
Nick Hibma 4d271802a2 If the device marked itself quiet, make detachment quiet as well. This
avoids '<dev>XX: detached' messages when the 'attached' message was
suppressed.
2009-03-22 15:46:12 +00:00
Yoshihiro Takahashi 6df3a0da33 MFC: r190146, r190147
Teach the BIOS CD driver to use bounce buffers when the destination
    address is > 1 MB.
2009-03-22 11:03:24 +00:00
Yoshihiro Takahashi c8e88bdc5b MFC: r190029
Use the common PC98_MID_* defines instead of a magic number.
2009-03-22 10:55:07 +00:00
Yoshihiro Takahashi 32a073f111 MFC: r190027
Use the common PC98_SID_ACTIVE define instead of a local define.
2009-03-22 10:51:40 +00:00
Marius Strobl 0c1ba60d22 MFC: r183142, r186395, 190106
- Newer firmware versions no longer provide SUNW,stop-self so just
  disable interrupts and loop forever instead. We still could use
  SUNW,stop-self if implemented but acording to comments in OpenBSD,
  E{2,4}50 tend to have fragile firmware versions which wedge when
  using the OFW test service, so given that we don't really depend
  on SUNW,stop-self just nuke it altogether instead of risking
  problems.
- Hide all MP-related bits in <machine/smp.h> underneath #ifdef SMP.
- Inline ipi_all_but_self(9) and ipi_selected(9). We don't expose any
  additional bits but save a few cycles by doing so.
- Remove ipi_all(9), which actually only called panic(9). It can't be
  implemented natively anyway and having it removed at least causes
  MI users to already fail when linking.
- At least Fire V880 have a small hardware glitch which causes the
  reception of IDR_NACKs for CPUs we actually haven't tried to send
  an IPI to, even not as part of the initial try. According to tests
  this apparently can be safely ignored though, so just return if
  checking for the individual IDR_NACKs indicates no outstanding
  dispatch. Serializing the sending of IPIs between MD and MI code
  by the combined usage of smp_ipi_mtx makes no difference to this
  phenomenon. [1]
- Provide relevant debugging bits already with the initial panic
  in case of problems with the IPI dispatch, which would have
  allowed to diagnose the above problem without a specially built
  kernel.
- In case of cheetah_ipi_selected() base the delay we wait for
  other CPUs which also might want to dispatch IPIs on the total
  amount of CPUs instead of just the number of CPUs we let this
  CPU send IPIs to because in the worst case all CPUs also want
  to IPI us at the same time.
- There's no need to wrap kdb_active in #ifdef KDB as it's always
  available.

Reported and access for extensive tests provided by:    beat [1]
2009-03-22 10:33:10 +00:00
Marius Strobl 8607457664 MFC: r182918
Add drivers for the power management devices found on Fireplane/
Safari- and JBus-based machines. Currently the main purpose of
these drivers is debugging of the resource allocation on nexus(4)
and the register content of these devices though.
2009-03-22 10:08:41 +00:00
Marius Strobl 45a39a13f0 MFC: r181640, r190003
- Add sys_tick and the USIII and beyond sys_tick_cmpr to state_regs[].
- Const'ify and static'ize as appropriate.
- Use __FBSDID().
2009-03-22 09:57:57 +00:00
Ed Schouten 7b3659d011 MFC:
Don't disable CR-to-NL translation when waiting for data to arrive.

  A difference between the old and the new TTY layer is that the new
  implementation does not perform any post-processing before returning
  data back to userspace when calling read().

  sh(1)'s read turns the TTY into a raw mode before calling select(). This
  means that the first character will not receive any ICRNL processing.
  Inherit this flag from the original terminal attributes.

  Even though this issue is not present on RELENG_*, I'm MFCing it to make
  sh(1) in jails behave better.

  PR:		bin/129566
2009-03-22 08:09:16 +00:00
Nick Hibma f55ab73cdb MFC 184941:
Add a reset device command to ugen.c.
   This is needed to make some devices work that require a
   firmware upload and a USB reset afterwards.
2009-03-22 06:37:14 +00:00
Pyun YongHyeon 2e316866f0 MFC r189717:
Xref altq.4 and bump .Dd
2009-03-22 06:31:59 +00:00
Pyun YongHyeon e462e779e2 MFC r189716:
Add txp(4) to the list of drivers supporting ALTQ.
2009-03-22 06:30:54 +00:00
Pyun YongHyeon 3cec1f7540 MFC r189715:
Uncomment txp(4), txp(4) should work on all architectures.
2009-03-22 06:28:53 +00:00
Pyun YongHyeon c90a440138 MFC r189714:
bus_dma(9) conversion and make txp(4) work on all architectures.
  o Header file cleanup.
  o bus_dma(9) conversion.
    - Removed all consumers of vtophys(9) and converted to use
      bus_dma(9).
    - Typhoon2 functional specification says the controller supports
      64bit DMA addressing. However all Typhoon controllers are known
      to lack of DAC support so 64bit DMA support was disabled.
    - The hardware can't handle more 16 fragmented Tx DMA segments so
      teach txp(4) to collapse these segments to be less than 16.
    - Added Rx buffer alignment requirements(4 bytes alignment) and
      implemented fixup code to align receive frame. Previously
      txp(4) always copied Rx frame to align it on 2 byte boundary
      but its copy overhead is much higher than unaligned access on
      i386/amd64. Alignment fixup code is now applied only for
      strict-alignment architectures. With this change i386 and
      amd64 will get instant Rx performance boost. Typhoon2 datasheet
      mentions a command that pads arbitrary bytes in Rx buffer but
      that command does not work.
    - Nuked pointer trick in descriptor ring. This does not work on
      sparc64 and replaced it with bcopy. Alternatively txp(4) can
      embed a 32 bits index value into the descriptor and compute
      real buffer address but it may make code complicated.
    - Added endianness support code in various Tx/Rx/command/response
      descriptor access. With this change txp(4) should work on all
      architectures.
  o Added comments for known firmware bugs(Tx checksum offloading,
    TSO, VLAN stripping and Rx buffer padding control).
  o Prefer faster memory space register access to I/O space access.
    Added fall-back mechanism to use alternative I/O space access.
    The hardware supports both memory and I/O mapped access. Users
    can still force to use old I/O space access by setting
    hw.txp.prefer_iomap tunable to 1 in /boot/loader.conf.
  o Added experimental suspend/resume methods.
  o Nuke error prone Rx buffer handling code and implemented local
    buffer management with TAILQ. Be definition the controller can't
    pass the last received frame to host if no Rx free buffers are
    available to use as head and tail pointer of Rx descriptor ring
    can't have the same value. In that case the Rx buffer pointer in
    Rx buffer ring still holds a valid buffer and txp_rxbuf_reclaim()
    can't fill Rx buffers as the first buffer is still valid. Instead
    of relying on the value of Rx buffer ring, introduce local buffer
    management code to handle empty buffer situation. This should fix
    a long standing bug which completely hangs the controller under
    high network load. I could easily trigger the issue by sending 64
    bytes UDP frames with netperf. I have no idea how this bugs was
    not fixed for a long time.
  o Converted ithread interrupt handler to filter based one.
  o Rearranged txp_detach routine such that it's now used for general
    clean-up routine.
  o Show sleep image version on device attach time. This will help
    to know what action should be taken depending on sleep image
    version. The version information in datasheet was wrong for newer
    NV images so I followed Linux which seems to correctly extract
    version numbers from response descriptors.
  o Firmware image is no longer downloaded in device attach time. Now
    it is reloaded whenever if_init is invoked. This is to ensure
    correct operation of hardware when something goes wrong.
    Previously the controller always run without regard to running
    state of firmware. This change will add additional controller
    initialization time but it give more robust operation as txp(4)
    always start off from a known state. The controller is put into
    sleep state until administrator explicitly up the interface.
  o As firmware is loaded in if_init handler, it's now possible to
    implement real watchdog timeout handler. When watchdog timer is
    expired, full-reset the controller and initialize the hardware
    again as most other drivers do. While I'm here use our own timer
    for watchdog instead of using if_watchdog/if_timer interface.
  o Instead of masking specific interrupts with TXP_IMR register,
    program TXP_IER register with the interrupts to be raised and
    use TXP_IMR to toggle interrupt generation.
  o Implemented txp_wait() to wait a specific state of a controller.
  o Separate boot related code from txp_download_fw() and name it
    txp_boot() to handle boot process.
  o Added bus_barrier(9) to host to ARM communication.
  o Added endianness to all typhoon command processing. The ARM93C
    always expects little-endian format of command/data.
  o Removed __STRICT_ALIGNMENT which is not valid on FreeBSD.
    __NO_STRICT_ALIGNMENT is provided for that purpose on FreeBSD.
    Previously __STRICT_ALIGNMENT was unconditionally defined for
    all architectures.
  o Rewrote SIOCSIFCAP ioctl handler such that each capability can be
    controlled by ifconfig(8). Note, disabling VLAN hardware tagging
    has no effect due to the bug of firmware.
  o Don't send TXP_CMD_CLEAR_STATISTICS to clear MAC statistics in
    txp_tick(). The command is not atomic. Instead, just read the
    statistics and reflect saved statistics to the statistics.
    dev.txp.%d.stats sysctl node provides detailed MAC statistics.
    This also reduces a lot of waste of CPU cycles as processing a
    command ring takes a very long time on ARM93C. Note, Rx
    multicast and broadcast statistics does not seem to right. It
    might be another bug of firmware.
  o Implemented link state change handling in txp_tick(). Now sending
    packets is allowed only after establishing a valid link. Also
    invoke link state change notification whenever its state is
    changed so pseudo drivers like lagg(4) that relies on link state
    can work with failover or link aggregation without hacks.
    if_baudrate is updated to resolved speed so SNMP agents can get
    correct bandwidth parameters.
  o Overhauled Tx routine such that it now honors number of allowable
    DMA segments and checks for 4 free descriptors before trying to
    send a frame. A frame may require  4 descriptors(1 frame
    descriptor, 1 or more frame descriptors, 1 TSO option descriptor,
    one free descriptor to prevent descriptor wrap-around) at least
    so it's necessary to check available free descriptors prior to
    setting up DMA operation.
  o Added a sysctl variable dev.txp.%d.process_limit to control
    how many received frames should be served in Rx handler. Valid
    ranges are 16 to 128(default 64) in unit of frames.
  o Added ALTQ(4) support.
  o Added missing IFCAP_VLAN_HWCSUM as txp(4) can offload checksum
    calculation as well as VLAN tag insertion/stripping.
  o Fixed media header length for VLAN.
  o Don't set if_mtu in device attach, it's already set in
    ether_ifattach().
  o Enabled MWI.
  o Fixed module unload panic when bpf listeners are active.
  o Rearranged ethernet address programming logic such that it works
     on strict-alignment architectures.
  o Removed unused member variables in softc.
  o Added support for WOL.
  o Removed now unused TXP_PCI_LOMEM/TXP_PCI_LOIO.
  o Added wakeup command TXP_BOOTCMD_WAKEUP definition.
  o Added a new firmware version query command, TXP_CMD_READ_VERSION.
  o Removed volatile keyword in softc as bus_dmamap_sync(9) should
    take care of this.
  o Removed embedded union trick of a structure used to to access
    a pointer on LP64 systems.
  o Added a few TSO related definitions for struct txp_tcpseg_desc.
    However TSO is not used at all due to the limitation of hardware.
  o Redefined PKT_MAX_PKTLEN to theoretical maximum size of a frame.
  o Switched from bus_space_{read|write}_4 to bus_{read|write}_4.
  o Added a new macro TXP_DESC_INC to compute next descriptor index.

  Tested by:	don.nasco <> gmail dot com
2009-03-22 06:26:47 +00:00
Pyun YongHyeon 57724e7ccd MFC r189690:
Replace local CRC32 routine with ether_crc32_be(). This should
  have happened long time ago. Also simplify Rx filter logic.
2009-03-22 06:21:35 +00:00
Pyun YongHyeon df2bae7d47 MFC r189689:
s/u_int8_t/uint8_t/g
  s/u_int16_t/uint16_t/g
  s/u_int32_t/uint32_t/g
  s/u_int64_t/uint64_t/g
2009-03-22 06:16:44 +00:00
Pyun YongHyeon 08adbd6752 MFC r189688:
style(9) - space after keywords.
2009-03-22 06:11:35 +00:00
Pyun YongHyeon 089ecc7454 MFC r189687:
Remove return statement at the end of function that returns void.
2009-03-22 06:07:03 +00:00
Pyun YongHyeon 178e22c813 MFC r189686:
Remove extra tab characters.
2009-03-22 06:04:16 +00:00
Pyun YongHyeon 3476d76712 MFC r189685:
K&R -> ANSI C function definitions.
2009-03-22 06:01:33 +00:00
David Schultz f6d1838636 MFC r189804:
Multibyte character support for cal(1).

  PR:		131578
2009-03-22 05:44:56 +00:00
Doug Barton 14c4f1aeac MFC the 9.4.3-P2 update 2009-03-21 23:03:56 +00:00
Doug Barton 78713bed9e MFC r189761, r189763, r189992, r189994:
1. Fix creation and saving of the new mtree file with the -D option
2. Clean up usage() and man page so the options are all listed consistently
3. Add -F option
4. More man page cleanups for CVS -> VCS, punctuation, etc.
2009-03-21 22:32:53 +00:00
Doug Barton 90a948de7b MFC r189902, clarify a few sections and add FreeBSD-specific notes 2009-03-21 22:20:55 +00:00
Craig Rodrigues 7ef515853e MFC r182460:
Add the ability to run /usr/sbin/crashinfo on a new core dump automatically
during boot.  Right now this is disabled by default, but it can be enabled
by setting 'crashinfo_enable=YES' in rc.conf.
2009-03-21 21:16:05 +00:00
Craig Rodrigues a90abeaf52 MFC r180318:
Remove the $DUMPDIR variable. It's redundant and the rest of the
script uses $dumpdir directly.
2009-03-21 21:12:16 +00:00
Bjoern A. Zeeb 147e9be95d MFC r186223:
Another step assimilating IPv[46] PCB code:
  normalize IN6P_* compat flags usage to their equialent
  INP_* counterpart.
2009-03-21 13:37:49 +00:00
Bjoern A. Zeeb 86588ebc31 MFC r186141:
Another step assimilating IPv[46] PCB code - directly use
  the inpcb names rather than the following IPv6 compat macros:
  in6pcb, in6p_sp, in6p_ip6_nxt, in6p_flowinfo, in6p_vflag,
  in6p_flags, in6p_socket, in6p_lport, in6p_fport, in6p_ppcb and
  sotoin6pcb().

  Apart from removing duplicate code in netipsec, this is a pure
  whitespace, not a functional change.
2009-03-21 12:53:42 +00:00
Bjoern A. Zeeb e34b557662 MFC r185371:
Replace most INP_CHECK_SOCKAF() uses checking if it is an
  IPv6 socket by comparing a constant inp vflag.
  This is expected to help to reduce extra locking.
2009-03-21 12:02:11 +00:00
Bjoern A. Zeeb 36f458d7c2 MFC r185370:
Merge in6_pcbfree() into in_pcbfree() which after the previous
  IPsec change in r185366 (r185366 for stable/7) only differed in
  two additonal IPv6 lines.
  Rather than splattering conditional code everywhere add the v6
  check centrally at this single place.
2009-03-21 11:18:59 +00:00
Bjoern A. Zeeb 8cb0ee7764 MFC r185366:
Unify ipsec[46]_delete_pcbpolicy in ipsec_delete_pcbpolicy.
  Ignoring different names because of macros (in6pcb, in6p_sp) and
  inp vs. in6p variable name both functions were entirely identical.
2009-03-20 23:06:16 +00:00
Alexander Motin 1683dbf6aa MFC rev. 188510, 189876, 189879
s/succeded/succeeded/ in comments.

Fix spelling in message.

Remove CD input hack for ALC268 based Acer systems. Latest systems does not
implement CD input in hardware, while unconditional showing it confuse users.
Also it was made in the way that sometimes improper with present driver.

Add patch for ALC268 based Acer TM5320 to make headphones jack sensing work.
Default configuration defines two separate playback associations, which
current driver unable to trace properly due to order they are defined and
limited codec uniformity.
2009-03-20 21:46:28 +00:00
Bjoern A. Zeeb cefb7d3211 MFC r185344:
Remove in6_pcbdetach() as it is exactly the same function
  as in_pcbdetach() and we don't need the code twice.
2009-03-20 21:22:14 +00:00
Alexander Motin 2732494684 MFC rev. 186093
To avoid one doubtless netgraph SMP scalability limitation point, switch
node queues processing from single swi:net thread to several specialized
threads.
2009-03-20 20:55:57 +00:00
Christian S.J. Peron 82b619d06f MFC r189590
- Mark the mac_bsdextended rules sysctl as mpsafe.
2009-03-20 18:04:20 +00:00
Christian S.J. Peron 9e24888850 MFC r189490
- Mark bpf(4) stats sysctl as mpsafe. We do not require Giant here.
2009-03-20 18:00:19 +00:00
John Baldwin ea35732c7b MFC: Add a new vfs.nfs.prime_access_cache sysctl to determine whether or
not nfs_getattr() will use an ACCESS RPC to prime the access cache instead
of a simple GETATTR RPC.  The sysctl defaults to enabled to maintain the
previous behavior.
2009-03-20 15:52:11 +00:00
Jamie Gritton cc5d79ac8d Revert r189970 until its implications get sorted out in CURRENT.
Approved by:	bz(mentor)
2009-03-20 13:46:30 +00:00
Robert Noland 1908194e4b Merge 189915
Add support for matching solely on vendor id.

We will use this method with nouveau
2009-03-20 05:51:54 +00:00
Robert Noland 87a5e98385 Merge 189914,189916
Improve the debugging output of drm_mmap
Cast to (unsigned long) to make printf happy on i386
2009-03-20 05:50:42 +00:00
Robert Noland 43c815edc0 Merge 189913
Add list_for_each_prev to our linux compatibility.

We need this for nouveau
2009-03-20 05:47:49 +00:00
Robert Noland 6d05c314e1 Merge 189912
Minor code cleanup
2009-03-20 05:46:25 +00:00
Robert Noland 49567263be Merge 189911
We can have more than 3 pci resources
2009-03-20 05:45:26 +00:00
Robert Noland 44f25d3933 Merge 189910
Cast register maps and offsets to vm_offset_t
2009-03-20 05:44:31 +00:00
Robert Noland cc95b4c49c Merge 189909
Change the logic around to match ati_pcigart.
2009-03-20 05:43:24 +00:00
Robert Noland a970b36949 Merge 189908
Use flsl() here rather than ffsl()

I discovered that we were computing page_order differently than linux.
2009-03-20 05:42:27 +00:00
Yoshihiro Takahashi 3bf2c85da7 MFC: r189445
Allow syscons to work without any hints.
2009-03-20 03:10:12 +00:00
Christian S.J. Peron 3fa0c8a474 MFC r182120
- Avoid printing warning message for vnodes that have dead fileops
  when MAC is enabled
2009-03-20 01:15:50 +00:00
Christian S.J. Peron 28889ff658 MFC r184660
- Dont hold Giant around vn_fullpath and vn_fullpath_global
2009-03-20 00:55:38 +00:00
Christian S.J. Peron b1a51b0763 MFC r182090
- use sbuf_putc instead of sbuf_cat
2009-03-20 00:38:14 +00:00
Christian S.J. Peron 2f6fc49044 MFC r181060
- Add vn_fullpath_global()
- Fix issues in auditing pathnames within chroot/jail envs
2009-03-20 00:34:50 +00:00
Christian Brueffer 70ed1284c0 MFC: r186715
Call pcn_start_locked() instead of pcn_start() where the softc lock is
already held.
2009-03-19 22:01:19 +00:00
John Baldwin 003b2c31bc Remove empty mergeinfo. 2009-03-19 21:40:12 +00:00
Warner Losh 14743db308 MFC: r181740
Move pcn.
2009-03-19 20:40:11 +00:00
John Baldwin 4c31cba52e MFC: Honor the prefetchable flag in memory BARs. 2009-03-19 18:04:37 +00:00
John Baldwin 6253d466e0 MFC: Allow syscons to work on amd64 and i386 without any hints. 2009-03-19 17:46:51 +00:00
John Baldwin cc6cc7dc17 MFC: Ignore I/O APICs with a starting IRQ > 255. 2009-03-19 17:42:11 +00:00
Roman Divacky 1afb4edc7a Merge r189004.
Requested by:	yongari
Approved by:	ed (mentor)
2009-03-19 17:06:04 +00:00
John Baldwin 5742c5ae38 MFC:
- Make it possible to disable GPT support by setting LOADER_NO_GPT_SUPPORT
  in make.conf or src.conf.
- When GPT is enabled (which it is by default), use memory above 1 MB and
  leave the memory from the end of the bss to the end of the 640k window
  purely for the stack.  The loader has grown and now it is much more
  common for the heap and stack to grow into each other when both are
  located in the 640k window.
2009-03-19 17:02:10 +00:00
John Baldwin 6d3d715258 MFC: Fix uninitialized pointer dereference. 2009-03-19 16:55:26 +00:00
Marius Strobl 6ed9db6eb7 MFC: r188164, r188457
- device_shutdown returns an int.
- Don't reset the PHY probe retry counter within the loop so
  it will eventually terminate as intended. [1]

Submitted by:	Helen Zhang [1]
2009-03-19 16:44:37 +00:00
Marius Strobl 1246d56295 MFC: r186682
- Currently the PMAP code is laid out to let the kernel TSB cover the
  whole KVA space using one locked 4MB dTLB entry per GB of physical
  memory. On Cheetah-class machines only the dt16 can hold locked
  entries though, which would be completely consumed for the kernel
  TSB on machines with >= 16GB. Therefore limit the KVA space to use
  no more than half of the lockable dTLB slots, given that we need
  them also for other things.
- Add sanity checks which ensure that we don't exhaust the (lockable)
  TLB slots.
2009-03-19 16:37:30 +00:00
Marius Strobl 41741f3573 MFC: r186140
Don't try reading the SXP_PINS_DIFF on the 10160 and 12160 SCSI
controllers. Reading this register, for which there are indications
that it doesn't really exist, returns 0 on at least some 12160
and doing so on Sun Fire V880 causes a data access error exception.

Reported and tested by:	Beat Gaetzi
Approved by:		mjacob
Obtained from:		OpenBSD (modulo setting isp_lvdmode)
2009-03-19 16:14:00 +00:00
Marius Strobl 0affa41ff8 MFC: r185109
Use the interrupt level right below PIL_FAST for executing interrupt
filters instead of PIL_FAST and allow special filters and handlers
for interrupts which need to be able to interrupt even filters, f.e.
bus error interrupts, to be registered with the revived INTR_FAST
at PIL_FAST.
2009-03-19 16:11:14 +00:00
Marius Strobl 88a388b086 MFC: r185008, r188456
- Allow the front-end to specify that iommu(4) should disable
  rerun of the streaming cache for silicon bug workarounds.
- Announce the presence of a streaming cache on attach for
  informational purposes.
- For performance reasons don't do unnecessary flushes of the
  streaming cache when coherent mappings are synced.
- Fix some minor style issues.
2009-03-19 16:03:21 +00:00
Andriy Gapon 8303922cee MFC 179060: udf: fix and speedup timestamp calculations
markus and emax are notified

Approved by:	jhb (mentor)
2009-03-19 15:49:30 +00:00
Marius Strobl 0fcb706a92 MFC: r179694
Mark "highaddr" and "lowaddr" appropriately. Change "dma" to "DMA".

Fix spelling mistage found by rodrigc@.

Reviewed by:	rodrigc, danger
2009-03-19 15:45:43 +00:00
John Baldwin 2bd6eae917 MFC: Teach the BIOS CD driver to use bounce buffers when the destination
address is > 1 MB.
2009-03-19 15:40:44 +00:00
John Baldwin 765dd51423 MFC: Add support for the single-port NetMos NM9835 serial adapter. 2009-03-19 15:35:33 +00:00
Marius Strobl 05259b4abf MFC: r185007
Use the spitfire VIS block copy/zero functions also with cheetah-
class CPUs. In theory one could also use versions additionally
taking advantage of the prefetch cache with cheetah-class CPUs,
in my worldstone runs these either didn't provide extra speedup
(USIII+) in comparison to the existing spitfire versions or were
even slightly slower (USIIIi) though, so they aren't committed
for now.
The basic problem leading to the VIS-based copy/zero functions
being initially disabled for cheetah-class CPUs was solved by
letting cheetah_init() clear DCR_IFPOE.
2009-03-19 15:32:16 +00:00
Marius Strobl c9781e86ee MFC: r185006
Micro-optimize spitfire_block_{copy,zero}():
- Predict the loop as taken as it's more likely that there's still
  data to copy and memory to zero respectively.
- Don't waste the delay slot.
2009-03-19 15:30:45 +00:00
Marius Strobl 69da54d9b0 MFC: 183762
Enable mpt(4) as some later models have on-board Fusion-MPT
controllers and it's sufficient endian-clean since r189999.
While at it, remove the commented out ncr(4) as it doesn't
even use bus_dma(9), which isn't worth fixing though as sym(4)
already supports a superset of the controllers driven by ncr(4).
2009-03-19 15:21:04 +00:00
Marius Strobl f6dc6d1b8b MFC: r183505
cosmetic changes and style fixes
2009-03-19 15:16:05 +00:00
Marius Strobl 3833b32de9 MFC: r183202, r183203, r183204
Some of the assembly files depend on v9a/v9b-only instructions so
compile these with -mcpu=ultrasparc (which is the hard-coded default
of our system compiler), which allows the remainder of the kernel to
be compiled with "only" -mcpu=v9 for reference and testing purposes.
2009-03-19 15:08:35 +00:00
Marius Strobl c9f14a928f MFC: r183144
- Add a missing prototype.
- Remove a banal comment.
2009-03-19 15:01:24 +00:00
Marius Strobl a82688caae MFC: r183152
Clear any possibly pending PCI error bits left by the firmware. These
could trigger an error interrupt that we can't actually to do anything
against as soon as enabling the error handlers.
While at it don't bother about writing only to the write-one-to-clear
bits when clearing error bits.
2009-03-19 14:51:56 +00:00
Andriy Gapon 2203016373 MFC 189364: udf: use truly unique directory cookie
Approved by:	jhb (mentor)
2009-03-19 14:32:11 +00:00
Andriy Gapon 3de1c50ec0 MFC 189302: udf_readdir: do not advance offset if entry can not be uio-ed
Approved by:	jhb (mentor)
2009-03-19 14:26:15 +00:00
Andriy Gapon 0cd28c5746 MFC 189111: udf_readatoffset: correctly hanlde data in fentry
Approved by:	jhb (mentor)
2009-03-19 14:20:00 +00:00
Marius Strobl 5d3df2c000 MFC: r182916, r188455 (partial)
Work around Cheetah+ erratum 34 (USIII+ erratum #10) by relocating
the locked entry in it16 slot 0, which typically is occupied by the
PROM, and manually entering locked entries in slots != 0.

Thanks to Hubert Feyrer for donating the Blade 2000 this change was
developed on.
2009-03-19 14:17:34 +00:00
Marius Strobl 54445a6f84 MFC: r182878
For cheetah-class CPUs ensure that the dt512_0 is set to hold 8k pages
for all three contexts and configure the dt512_1 to hold 4MB pages for
them (e.g. for direct mappings).
This might allow for additional optimization by using the faulting
page sizes provided by AA_DMMU_TAG_ACCESS_EXT for bypassing the page
size walker for the dt512 in the superpage support code.

Submitted by:	nwhitehorn (initial patch)
2009-03-19 14:15:11 +00:00
Andriy Gapon afff721199 MFC 189082: udf_readatoffset: read through directory vnode, do not read > MAXBSIZE
Approved by:	jhb (mentor)
2009-03-19 14:12:07 +00:00
Marius Strobl d10d3b3254 MFC: r182877, r188455, r188477
USIII and beyond CPUs have stricter requirements when it comes
to synchronization needed after stores to internal ASIs in order
to make side-effects visible. This mainly requires the MEMBAR #Sync
after such stores to be replaced with a FLUSH. We use KERNBASE in
the kernel and the newly introduced PROMBASE for the loader as the
addresses to FLUSH as these are guaranteed to not trap. Actually,
the USII synchronization rules also already require a FLUSH in
pretty much all of the cases changed.
We're also hitting an additional USIII synchronization rule which
requires stores to AA_IMMU_SFSR to be immediately followed by a DONE,
FLUSH or RETRY. Doing so triggers a RED state exception though so
leave the MEMBAR #Sync. Linux apparently also has gotten away with
doing the same for quite some time now, apart from the fact that
it's not clear to me why we need to clear the valid bit from the
SFSR in the first place.

Reviewed by:	nwhitehorn
2009-03-19 14:11:03 +00:00
Andriy Gapon e029ba641f MFC 189070: udf: add read-ahead support modeled after cd9660
Approved by:	jhb (mentor)
2009-03-19 14:09:20 +00:00
Andriy Gapon 76aacc4c61 MFC 189069: udf_map: return proper error code instead of leaking an internal one
Approved by:	jhb (mentor)
2009-03-19 14:07:27 +00:00
Andriy Gapon 0f110a31b3 MFC 189068: udf_read: correctly read data from files with data embedded into fentry
Approved by:	jhb (mentor)
2009-03-19 14:04:59 +00:00
Andriy Gapon 9d78e09589 MFC 189067,189363: udf_strategy: tiny optimization of logic, calculations; extra diagnostics
Approved by:	jhb (mentor)
2009-03-19 14:00:23 +00:00
Andriy Gapon 1d54c5514e MFC 188815, 188815: fix incorrect error return when reading a large dir
Approved by:	jhb (mentor)
2009-03-19 13:48:43 +00:00
Marius Strobl 8a31ed0a69 MFC: r182774
When determining whether we trapped while in the PROM don't only
check for addresses below the PROM range but also those above.
2009-03-19 13:24:48 +00:00
Christian Brueffer a9d181ff40 MFC: r186965
Recognize et(4), igb(4), ixgbe(4) and nxge(4) devices.
Correct some minor whitespace in the ae(4) entry.

The iwn(4) entry was left out as the driver has not been merged.
2009-03-19 13:18:28 +00:00
Marius Strobl 1495f1bc21 MFC: r182773
Use the PROM provided SUNW,set-trap-table to take over the trap
table. This is required in order to set obp-control-relinquished
within the PROM, allowing to safely read the OFW translations node.
Without this, f.e. a `ofwdump -ap` triggers a fatal reset error or
worse things on machines based on USIII and beyond.
In theory this should allow to remove touching %tba in cpu_setregs(),
in practice we seem to currently face a chicken and egg problem when
doing so however.
2009-03-19 13:17:19 +00:00
Marius Strobl 3030413a91 MFC: r182769 2009-03-19 13:11:02 +00:00
Marius Strobl a3ffb9c443 MFC: r182768
Flesh out MMU and cache handling of cheetah-class CPUs.
2009-03-19 13:09:53 +00:00
Marius Strobl a3d9d43a11 MFC: r182767
The physical address space of cheetah-class CPUs has been extended
to 43 bits so update TD_PA_BITS accordingly. For the most part this
increase is transparent to the existing code except for when reading
the physical address from ASI_{D,I}TLB_DATA_ACCESS_REG, which we
only do in the loader and which was already adjusted in r190002, or
from the OFW translations node.
While at it, ensure we are only taking valid OFW mapping entries
into account.
2009-03-19 13:08:24 +00:00
Yoshihiro Takahashi 6c1209c235 MFC: r186073
Disconnect the efi from pc98.
2009-03-19 13:02:37 +00:00
Yoshihiro Takahashi f8f0b97076 MFC: r182441
Remove unneeded include.
2009-03-19 13:00:21 +00:00
Marius Strobl 26c387beb0 MFC: r182730, r182743, r183201
- USIII-based machines can consist of CPUs running at different
  frequencies (and having different cache sizes) so use the STICK
  (System TICK) timer, which was introduced due to this and is
  driven by the same frequency across all CPUs, instead of the
  TICK timer, whose frequency varies with the CPU clock, to drive
  hardclock. We use the STICK timers only when absolutely necessary
  though as the STICK timers are driven at frequencies as low as
  5MHz, resulting in bad granularity compared to the TICK timers.
  However, don't employ the workaround for the BlackBird erratum #1
  when using the TICK timer on machines with cheetah-class CPUs for
  performance reasons.
  Note that using the STICK counter also causes a hang with USIIIi
  MP machines for reasons unknown, but these can only consist of
  identical CPUs anyway.
- Given that we only (try to) synchronize the (S)TICK timers of APs
  with the BSP during startup, we could end up spinning forever in
  DELAY(9) if that function is migrated to another CPU while we're
  spinning due to clock drift afterwards, so pin to the CPU in order
  to avoid migration. Unfortunately, pinning doesn't work at the
  point DELAY(9) is required by the low-level console drivers, yet,
  so switch to a function pointer, which is updated accordingly, for
  implementing DELAY(9). For USIII and beyond, this would also allow
  to easily use the STICK counter instead of the TICK one here,
  there's no benefit in doing so however.
  While at it, use cpu_spinwait(9) for spinning in the delay-
  functions. This currently is a NOP though.
- Don't set the TICK timer of the BSP to 0 during startup as there's
  no need to do so.
- Implement cpu_est_clockrate().
- Unfortunately, USIIIi-based machines don't provide a timecounter
  device besides the STICK and TICK counters (well, in theory the
  Tomatillo bridges have a performance counter that can be (ab)used
  as timecounter by configuring it to count bus cycles, though unlike
  the performance counter of Schizo bridges, the Tomatillo one is
  broken and counts Sun knows what in this mode). This means that
  we've to use a (S)TICK counter for timecounting, which has the old
  problem of not being in sync across CPUs, so provide an additional
  timecounter function which binds itself to the BSP but has an
  adequate low priority.
2009-03-19 12:55:11 +00:00
Marius Strobl 394b27ae06 MFC: r182729
Switch sun4v to back to using its own clock.c, which was ressurected
in r190005, as the sparc64 version is going to be rototilled and sun4v
currently can't be verified to still work with the new sparc64 one
due to its overall state.
2009-03-19 12:32:13 +00:00
Robert Noland 00e2aa4414 Merge 189899
Use the right MSI_REARM for RS600.
2009-03-19 07:41:58 +00:00
Robert Noland c0cad8adae Merge 189870
Teach psm about O_ASYNC

This makes Xorg happy if you aren't using moused.
2009-03-19 07:40:41 +00:00
Robert Noland 0994515af8 Merge 189869
Get rid of any remaining PZERO flags in mtx_sleep()

Also, clean up some ifdef mess while I'm here.
2009-03-19 07:39:07 +00:00
Robert Noland 9554cd1f29 Merge 189868
Fix R600 writeback across suspend/resume.

This is likely a NOOP for us, since I haven't ported the suspend/resume
code yet.
2009-03-19 07:37:00 +00:00
Marcel Moolenaar 7c190e7d2a MFC r184070,185454,185495-185496,188330 -- gpart(8):
o  Add support for multiple attributes.
o  Parse the error string returned by the kernel.
o  Prefer the start and end attributes over the offset and size attributes.
2009-03-19 06:44:00 +00:00
Pyun YongHyeon 9df85b1b53 MFC r187325:
Add hardware MAC statistics support. Also added some reserved
  statistics register definition. Users can get current MAC
  statistics from dev.msk.%d.stats sysctl node(%d is unit number of
  a device).
2009-03-19 02:13:14 +00:00
Pyun YongHyeon cd64ad5281 MFC r189022:
Update to latest 3Com firmware image. The latest fimware is
  required to make 3CR990 familiy controllers run on NV flash
  firmware version 03.001.008.
  The latest firmware added HMAC digest information so teach txp(4)
  to pass them to sleep image before downloading is started.

  While I'm here restore previous IMR/IER register if firmware
  downloading have failed.

  PR:	kern/89876, kern/132047
2009-03-19 01:07:21 +00:00
Pyun YongHyeon 3a7b0cbf19 MFC r188550:
Receving VLAN oversized frames raise SIS_ISR_RX_ERR interrupt, so
  make sis_rxeof() handle that too. Previously it used to receive the
  frame and reset controller.

  PR:	kern/131414
2009-03-19 00:55:27 +00:00
Pyun YongHyeon d8862b1887 MFC r185784:
Fix a long standing VLAN tagged frame handling bug.
  When VLAN tagged frame is received the hardware sets 'LONG' bit of
  Rx status word. It is always set when the size of received frame
  exceeded 1518 bytes, including CRC. This VLAN tagged frame clears
  'OK' bit of Rx status word such that driver should not rely on 'OK'
  bit of Rx status word to pass the VLAN tagged frame to upper stack.

  To fix the bug, don't use SIS_CMDSTS_PKT_OK for Rx error check and
  introduce SIS_RXSTAT_ERROR macro that checks Rx errors. If we are
  configured to accept VLAN tagged frames and the received frame size
  is less than or equal to maximum allowed length of VLAN tagged
  frame, clear 'LONG' bit of Rx status word before checking Rx
  errors.

  Reported by:	Vladimir Ermako < samflanker <> gmail DOT com >
  Tested by:	Vladimir Ermako < samflanker <> gmail DOT com >
2009-03-19 00:52:30 +00:00
Sam Leffler 67cc07f8f4 MFC makefs: a tool for creating a file system image from a directory tree 2009-03-19 00:28:54 +00:00
Marius Strobl 3453c13e08 MFC: r182691
Resurrect clock.c from r164371.
2009-03-19 00:04:30 +00:00
Marius Strobl 8d46b4dee9 MFC: r182689
- USIII-based machines can consist of CPUs having different cache
  sizes (and running at different frequencies) so move the cacheinfo
  to the PCPU data. While at it, remove some redundant and/or unused
  members from struct cacheinfo.
- In sparc64_init don't assume the first CPU node we find in the OFW
  device tree is the BSP.
2009-03-19 00:02:07 +00:00
Marius Strobl 96b547dea6 MFC: r182478, r182766
- Read ASI_{D,I}TLB_DATA_ACCESS_REG twice in order to work around
  errata of USIII and beyond (USIII erratum #19, USIII+ erratum #1,
  USIIIi erratum #1).
- Use the cheetah PA mask in {d,i}tlb_va_to_pa_sun4u() for USIII
  and beyond. This is done so that these functions will still mask
  the debug bits of spitfire-class CPUs once we increase TD_PA_BITS
  to match the number of bits used for the PA by cheetah-class CPUs.
- Change {d,i}tlb_enter_sun4u() to also set TLB_CTX_KERNEL as the
  context of the mappings entered. This is more or less cosmetic as
  TLB_CTX_KERNEL is 0.
- Now that we have to distinguish between different sun4u CPUs in
  the loader anyway, no longer do trial and error when reading the
  portid property.
2009-03-18 23:50:25 +00:00
Marius Strobl 7e6e34b6db MFC: r181642
Assume OpenSolaris knows better and use their value for VM_MAX_PROM_ADDRESS.
2009-03-18 23:35:40 +00:00
Marius Strobl d3ae751681 MFC: r181398
- Reimplement {d,i}tlb_enter() and {d,i}tlb_va_to_pa() in C. There's
  no particular reason for them to be implemented in assembler and
  having them in C allows easier extension as well as using more C
  macros and {d,i}tlb_slot_max rather than hard-coding magic (and
  actually spitfire-only) values.
- Fix the compilation of pmap_print_tte().
- Change pmap_print_tlb() to use ldxa() rather than re-rolling it
  inline as well as TLB_DAR_SLOT and {d,i}tlb_slot_max rather than
  hardcoding magic (and actually spitfire-only) values.
- While at it, suffix the above mentioned functions with "_sun4u" to
  underline they're architecture-specific.
- Use __FBSDID and macros instead of magic values in locore.S.
- Remove unused includes and smp_stack in locore.S.
2009-03-18 23:25:12 +00:00
Marius Strobl 2122328764 MFC: r186878
Make the whole initiator mode part of mpt(4) endian-clean,
specifically SPI controllers now also work in big-endian
machines and some conversions relevant for FC and SAS
controllers as well as support for ILP32 machines which all
were omitted in previous attempts are now also implemented.
The IOCTL-interface is intentionally left (and where needed
actually changed) to be completely little-endian as otherwise
we would have to add conversion code for every possible
configuration page to mpt(4), which didn't seem the right
thing to do, neither did converting only half of the user-
interface to the native byte order.
This change was tested on amd64 (SAS+SPI), i386 (SAS) and
sparc64 (SAS+SPI). Due to lack of the necessary hardware
the target mode code is still left to be made endian-clean.

Reviewed by:	scottl
2009-03-18 23:13:35 +00:00
Marius Strobl 84a441eba3 MFC: r172842 (partial), r178725
Restore multi-release tradition of the driver.
2009-03-18 22:57:55 +00:00
Marius Strobl 53d73bb639 MFC: r189494
On architectures with strict alignment requirements compensate
the misalignment of the IP header that prepending the EtherIP
header might have caused.

PR:		131921
2009-03-18 22:12:54 +00:00
John Baldwin d582b2391a Remove the empty mergeinfo from these files. 2009-03-18 21:57:35 +00:00
John Baldwin 4682204248 MFC: Remove a comment and expand scope of sysctl sx lock a bit to fully
restore limiting of wired memory by userspace for sysctls.
2009-03-18 21:54:28 +00:00
John Baldwin 3d2672abd1 MFC: Use shared vnode locks when invoking VOP_READDIR(). 2009-03-18 21:51:02 +00:00
Warner Losh dd38f46724 MFC 181524:
Move sis to sys/dev/sis for consistency.
2009-03-18 21:46:55 +00:00
Maksim Yevmenkin da0f845b99 MFC r189462
MFC is ahead of schedule due to request.

Add Bluetooth compatibility shims. Inspired by Linux BlueZ and NetBSD.

Discussed with:	Iain Hibbert plunky -at- rya-online -dot- net of NetBSD
Requested by:	Bruce Simpson bms -at- incunabulum -dot- net
Tested by:	Bruce Simpson bms -at- incunabulum -dot- net
2009-03-18 21:43:16 +00:00
Bjoern A. Zeeb eb64faed65 MFC r179232 by jb:
Add a knob to allow just the kernels to be built during a 'make universe'.

MFC r185250 by des:

  Change the universe target to warn the user for every world or kernel that
  fails.  The error message includes a reference to the relevant log file.
2009-03-18 20:22:21 +00:00
Bjoern A. Zeeb 65e34d9205 MFC r186791:
Switch protosw* structs to C99 initializers.
2009-03-18 20:18:23 +00:00
Luigi Rizzo d318656b75 replace vnconfig with mdconfig and related tools
(mdmfs, newfs) and libraries.

Also add the kld* tools so we can load modules.
2009-03-18 19:51:40 +00:00
John Baldwin d00a00f34b MFC: Add VN_LOCK_ASHARE() and VN_LOCK_AREC() macros to make it easier to
share code with HEAD.
2009-03-18 18:46:50 +00:00
John Baldwin f3854fdead MFC: Consolidate error handling in mount routines and make the mountpoint
hold a reference on the cdev the fs is mounted on.
2009-03-18 18:42:48 +00:00
John Baldwin a361a7bc66 MFC: Keep the vnode for the mountpoint locked on return from namei()
until after g_vfs_open() to match other filesystems.
2009-03-18 18:38:26 +00:00
John Baldwin ab8b73bcce MFC:
- If the g_access() call for the initial root mount fails, then fully
  cleanup.  Before the GEOM consumer would not have been closed.
- Bump the reference on the character device being mounted while the
  associated devfs vnode is locked.
2009-03-18 18:30:00 +00:00
John Baldwin ac2fabc485 MFC: Mark udf(4) MPSAFE and add support for using shared vnode locks for
pathname lookups.
2009-03-18 18:25:56 +00:00
John Baldwin 622fd25d0e MFC: Add rudimentary support for symbolic links on UDF. 2009-03-18 18:20:20 +00:00
John Baldwin 7bd2205e57 MFC: Add support for fifos to UDF. 2009-03-18 18:18:38 +00:00
Jamie Gritton 197cdc841c MFC r189864:
Default to AF_LOCAL instead of AF_INET sockets for non-family-specific
  operations.  This allows the query operations to work in non-IPv4 jails,
  and will be necessary in a future of possible non-INET networking.

Approved by:	bz (mentor)
2009-03-18 18:08:31 +00:00
Bruce M Simpson 7bc9d2e6fb MFC r183567:
Merge Wake-on-Lan (WOL) support for the Attansic/Atheros L2.
 This was left out of the backport to RELENG_7 as the WOL
 infrastructure had not yet been backported to RELENG_7 when
 the ae(4) driver was merged.

Tested OK on an ASUS EeePC 701 using ports/net/wol.

Submitted by:	yongari
2009-03-18 17:14:44 +00:00
Alan Cox c552ce951b MFC revision 1.363
Eliminate redundant code from vm_page_startup().

(In retrospect, this change should have been included in the superpages
MFC.  This change subsumes r189750.)

Discussed with:	jhb
2009-03-18 16:24:39 +00:00
Bjoern A. Zeeb 19618fcba9 MFC r186222:
Use inc_flags instead of the inc_isipv6 alias which so far
  had been the only flag with random usage patterns.
  Switch inc_flags to be used as a real bit field by using
  INC_ISIPV6 with bitops to check for the 'isipv6' condition.

  While here fix a place or two where in case of v4 inc_flags
  were not properly initialized before.[1]

  Found by:     rwatson during review [1]
2009-03-18 16:09:05 +00:00
Bjoern A. Zeeb 7a80e723c3 MFC r185892:
Style changes only. Put the return type on an extra line[1] and
  add an empty line at the beginning as we do not have any local
  variables.

Submitted by: rwatson [1]
2009-03-18 14:43:56 +00:00
Bjoern A. Zeeb 8456f74b60 MFC r185333:
Unify the v4 and v6 versions of pcbdetach and pcbfree as good
  as possible so that they are easily diffable.

  No functional changes.
2009-03-18 14:36:49 +00:00
Bjoern A. Zeeb fb69735e58 MFC r185893:
Make sure nmbclusters are initialized before maxsockets
  by running the tunable_mbinit() SYSINIT at SI_ORDER_MIDDLE
  before the init_maxsockets() SYSINT at SI_ORDER_ANY.
2009-03-18 13:47:44 +00:00
Konstantin Belousov bdcc8446e6 MFC r189693:
Enable advisory file locking for devfs vnodes.
2009-03-18 13:19:46 +00:00
Bjoern A. Zeeb 806dcc369a MFC r185583:
Fix a credential reference leak. [1]

  Close subtle but relatively unlikely race conditions when
  propagating the vnode write error to other active sessions
  tracing to the same vnode, without holding a reference on
  the vnode anymore. [2]

  PR:           kern/126368 [1]
  Submitted by: rwatson [2]
  Reviewed by:  kib, rwatson
2009-03-18 12:25:40 +00:00
Bjoern A. Zeeb 3f6409bdcd MFC r184096:
Bring over the change switching from using sequential to random
  ephemeral port allocation as implemented in netinet/in_pcb.c rev. 1.143
  (initially from OpenBSD) and follow-up commits during the last four and
  a half years including rev. 1.157, 1.162 and 1.199.
  This now is relying on the same infrastructure as has been implemented
  in in_pcb.c since rev. 1.199.

Reviewed by:	rwatson (UPDATING)
2009-03-18 11:30:47 +00:00
Pyun YongHyeon 2975f13b7c MFC r189567:
For IP1001 PHYs, read auto-negotiation advertisement register to
  get default next page configuration. While I'm here explicitly set
  IP1000PHY_ANAR_CSMA bit. This bit is read-only and always set
  by hardware so setting it has no effect but it would clear the
  intention. With this change controllers that couldn't establish
  1000baseT link should work.

  PR:	kern/130846
2009-03-18 03:36:08 +00:00
Pyun YongHyeon b417c784d5 MFC r189566:
Use mii_phy_add_media() and remove setting each media type.
  While I'm here, don't set mii_anegticks as it's set by
  mii_phy_add_media().
2009-03-18 03:33:45 +00:00
Pyun YongHyeon 94602e1e5c MFC r189565:
For unknown speed, explicitly set IFM_NONE.
2009-03-18 03:31:19 +00:00
Pyun YongHyeon c0e41850fd MFC r189564:
Report current link state while auto-negotiation is in progress.
2009-03-18 03:29:05 +00:00
Pyun YongHyeon 5e54b2e886 MFC r188382:
Document loader tunable hw.re.msi_disable.
  Bump .Dd
2009-03-18 02:26:46 +00:00
Pyun YongHyeon 2d7145d2bc MFC r183561, 186346:
r183561:
  Add hardware MAC statistics support. Register information was
  obtained from Linux forcedeth driver.
  While I'm here move creating a sysctl node for process_limit to
  function nfe_sysctl_node().

  Tested by:	"Arno J. Klaassen" < arno <at> heho dot snv dot jussieu dot fr >

r186346:
  Fix a typo.

  Submitted by:	clemens fischer via Shigeaki Tagashira
2009-03-18 02:23:01 +00:00
Pyun YongHyeon 98d30d4674 MFC r189555:
Add a new tunable hw.re.prefer_iomap which disables memory register
  mapping. The tunable is OFF for all controllers except RTL8169SC
  family. RTL8169SC seems to require more magic to use memory
  register mapping. r187483 added a fix for RTL8169SCe controller but
  it does not looke like fix other variants of RTL8169SC.

  Tested by:	Gavin Stone-Tolcher g.stone-tolcher <> its dot uq dot edu dot au
2009-03-18 02:12:33 +00:00
Pyun YongHyeon 8897a770e6 MFC r188474:
Allocating 2 MSI messages do not seem to work on certain controllers
  so use just 1 MSI message. This fixes regression introduced in
  r188381.
2009-03-18 02:10:01 +00:00
Pyun YongHyeon eb0f9eb783 MFC r188381:
Reclaim transmitted frames in re_tick(). This is for PCIe
  controllers that lose Tx completion interrupts under certain
  conditions. With this change it's safe to use MSI on PCIe
  controllers so enable MSI on these controllers.
2009-03-18 02:07:07 +00:00
Pyun YongHyeon 7af9e9a0af MFC r187483:
- Add support for 8110SCe part.  Some magic registers were taken from
  Linux driver.
  - Swap hardware revisions for 8110S and 8169S as Linux driver claims.
2009-03-18 02:03:16 +00:00
Pyun YongHyeon 8811cf3eff MFC r187482:
Retire RL_FLAG_INVMAR bit to match its comment and reality.
2009-03-18 02:00:23 +00:00
Pyun YongHyeon f86b584698 MFC r187481:
- Do not read and write RX configuration register multiple times.
  - Always program RX configuration register from scratch instead of
  doing read/modify/write.
  - Rename re_setmulti() to re_set_rxmode() to be reflect reality.
  - Simplify hash filter logic a little while I am here.
2009-03-18 01:57:26 +00:00
Bjoern A. Zeeb 48b588e95b MFC r183001:
Implement IPv6 support for TCP MD5 Signature Option (RFC 2385)
  the same way it has been implemented for IPv4.
2009-03-17 20:59:45 +00:00
Marcel Moolenaar 3f3e06eb44 Sync gpart with the trunk. This includes:
o  APM scheme supports Tivo Series 1 partitions  (read only).
o  Bootcode support added to BSD scheme.
o  New EBR scheme to support Extended Boot Records (logical partitions).
o  PC98 scheme fixes (credits to nyan@)
o  VTOC8 scheme fixes (credits to marius@)
2009-03-17 19:38:40 +00:00
Rong-En Fan 9233d0196c MFC r189216 (ahead original schedule due to the upcoming 7.2-RELEASE)
- Remove kH (kp_kll) from screen. It has the identical key sequence as
   @7 (kp_end). As ncurses has the limitation that it returns the first
   matched key symbol, you can not use END in ncurses based program under
   screen (like ports/misc/mc).

 We did similar changes to xterm entry last year for exactly the same reason.

 PR:           132199
 Submitted by: Timur I. Bakeyev <timur at FreeBSD.org>
2009-03-17 14:29:25 +00:00
Ken Smith 4c80486cb0 We're a little less than a week from code freeze for the 7.2-REL release
cycle.  Give people a heads-up that there might be higher than usual
developer activity during this period by starting to call it 7.2-PRERELEASE
now.
2009-03-17 14:17:59 +00:00
Robert Watson 9f3c792b08 Merge r188992 from head to stable/7:
In tcp_usr_shutdown() and tcp_usr_send(), I missed converting NULL
  checks for the tcpcb, previously used to detect complete disconnection,
  with INP_DROPPED checks.  Correct that, preventing shutdown() from
  improperly generating a TCP segment with destination IP and port of
  0.0.0.0:0.

  PR:           kern/132050
  Reported by:  david gueluy <david.gueluy at netasq.com>
2009-03-17 10:15:49 +00:00
Ulf Lilleengen 9f5c95c82e MFH:
r186781
Merge support for CVSMode (aka. mirror mode) into csup. This means csup can now
fetch a complete CVS repository. Support for rsync update of regular files are
also included, but are not yet enabled. The change should not have an impact on
existing csup usage, as little of the existing code has changed.

r186871
- Update manpage now that cvs mode is supported.

r188405
- Fix an issue where file attributes were not installed correctly during a Touch
  and SetAttrs operation.
- SetAttrs and Touch were incorrectly switched.

r188644
- Do not free the pattern lists immediately after use, as they might be needed
  again in case the connection is interrupted and csup have to reconnect. The
  lists will be freed after the collection has been completely processed.

r189455
- Try to handle rcsfile write failures in the same way as cvsup, as they are not
  necessarily fatal. If the file was incorrectly written, the checksum will
  detect it and the file will be retransferred.
2009-03-17 06:54:41 +00:00
Robert Watson ba64e4bc4c Merge adding RTF_RNH_LOCKED to the flags argument of rtrequest() in
in6_rtqkill(), making it match in_rtqkill().

This change appeared in 8.x as part of the arpv2 merge (r186119) but
that isn't appropriate to merge.
2009-03-16 18:15:52 +00:00
Robert Watson b326fb4fa4 Merge r189778 from head to stable/7:
Don't suggest mounting procfs in diskless configurations.
2009-03-16 18:07:23 +00:00
Robert Watson cfe3c3138e Merge r188963 from head to stable/7:
Assert the radix head lock in in6_rtqkill().
2009-03-16 18:05:31 +00:00
Robert Watson 2c7ec14916 Merge r188962 from head to stable/7:
In in_rtqkill(), assert the radix head lock, and pass RTF_RNH_LOCKED
  to in_rtrequest(); the radix head lock is already acquired before
  rnh_walktree is called in in_rtqtimo_one().  This avoids a recursive
  acquisition that is no longer permitted in 8.x due to use of an rwlock
  for the radix head lock.

  Reported by:  dikshie <dikshie at gmail.com>

While not strictly required in 7.x, I am merging this to keep locking as
consistent as possible in the routing code between 7.x and 8.x.  Note
that because the rwlock change has not been merged, this becomes
LOCK_ASSERT rather than WLOCK_ASSERT.
2009-03-16 18:02:00 +00:00
Robert Watson 28f8338ad1 Merge r188546 from head to stable/7:
Remove unused ifaddr local variable in ioctl routine.
2009-03-16 17:57:29 +00:00
Robert Watson 30fa82924f Merge r188545 from head to stable/7:
Remove unused ifaddr and ifreq local variables.
2009-03-16 17:55:24 +00:00
Robert Watson 24cd4b279b Merge r189655 from head to stable/7:
Prefer ENETDOWN to ENXIO when returning queuing errors due to a link
  down, interface down, etc, with if_cxgb's if_transmit routine.

  Reviewed by:  kmacy
2009-03-16 17:46:55 +00:00
Robert Watson 16522327ed Merge r189545 from head to stable/7:
By default, don't compile in counters of calls to various time
query functions in the kernel, as these effectively serialize
parallel calls to the gettimeofday(2) system call, as well as
other kernel services that use timestamps.

Use the NetBSD version of the fix (kern_tc.c:1.32 by ad@) as
they have picked up our timecounter code and also ran into the
same problem.

Reported by:    kris
Obtained from:  NetBSD
2009-03-16 17:30:38 +00:00
Robert Watson 49d30688c7 Merge r189570 from head to stable/7:
Add a new thread-private flag, TDP_AUDITREC, to indicate whether or
  not there is an audit record hung off of td_ar on the current thread.
  Test this flag instead of td_ar when auditing syscall arguments or
  checking for an audit record to commit on syscall return.  Under
  these circumstances, td_pflags is much more likely to be in the cache
  (especially if there is no auditing of the current system call), so
  this should help reduce cache misses in the system call return path.

  Reported by:    kris
  Obtained from:  TrustedBSD Project
2009-03-16 17:25:09 +00:00
Robert Watson d70c0e0299 Merge r186822 from head to stable/7:
In AUDIT_SYSCALL_EXIT(), invoke audit_syscall_exit() only if an audit
  record is active on the current thread--historically we may always
  have wanted to enter the audit code if auditing was enabled, but now
  we just commit the audit record so don't need to enter if there isn't
  one.

  Obtained from:	TrustedBSD Project
  Sponsored by:		Apple, Inc.
2009-03-16 17:15:02 +00:00
Robert Watson bf07ddae7e Merge r186662 from head to stable/7:
Fix white space botch: use carriage returns rather than tabs.
2009-03-16 17:08:10 +00:00
Robert Watson 74e8eb600a Merge r182750, r182754 from head to stable/7:
If the process id specified is invalid, the system call returns ESRCH

  Unbreak the build.
2009-03-16 17:03:33 +00:00
Robert Watson 6cfa291acc Merge r174894 from head to stable/7:
Change "audit_pipe_preselect" to "audit_pipe_presel" to make it print
  with proper alignment in ddb(4) and vmstat(8).
2009-03-16 16:57:04 +00:00
Robert Noland dda8dca82b Merge r189563
Consistently use kdev for the kernel device.

Submitted by:   vehemens <[email protected]>
2009-03-15 17:27:06 +00:00
Robert Noland cc4c640c9a Merge r189562
Clean up the printing on amd64.  Should also be consistent on i386.
2009-03-15 17:25:44 +00:00
Robert Noland d8493cadf3 Merge r189561
There is no need to sync these buffers to swap.
2009-03-15 17:24:48 +00:00
Robert Noland fe04c37426 Merge r189560
Change the flags to bus_dmamem around to allow it to sleep waiting for
resources during allocation, but not during map load.  Also, zero the
buffers here.
2009-03-15 17:23:46 +00:00
Robert Noland 9e7cd9f972 Merge 189559
Fix the flags to bus_dmamem_* to allow the allocation to sleep while
waiting for resources.  It is really the load that we can't defer.
BUS_DMA_NOCACHE belongs on bus_dmamap_load() as well.
2009-03-15 17:22:53 +00:00
Robert Noland d8fcee851f Merge 189499,189557,189558
This is the radeon r600+ code with fixes.  A few days early,
but it seems to fix some other vblank related issues as well.

189499:
Import support for ATI Radeon R600 and R700 series chips.

Tested on an HD3850 (RV670) on loan from Warren Block.

Currently, you need one of the following for this to be useful:

        x11-drivers/xf86-video-radeonhd-devel (not tested)
        xf86-video-ati from git (EXA works, xv is too fast)
        xf86-video-radeonhd from git (EXA works, xv works)

There is no 3d support available from dri just yet.

189557:
Call the right function for the right chipset.

189558:
        -Make the PCI(E)/AGP calculations consistent
        -Calculate the scratch address correctly
2009-03-15 17:20:28 +00:00
Konstantin Belousov 8e9b059743 MFC r189534:
Document several notifications.

MFC r189538 (by maxim):
Spell.  Sort .Xrs.
2009-03-15 10:43:48 +00:00
Max Laier ad20609e32 MFC:
- r184733, r184742
  Add -A and -B options
 - r184654, r184656
  style(9) changes
 - r173387, r173431 (by kevlo)
  Check return value for setenv()

In effect sync head and releng/7.
2009-03-14 21:03:03 +00:00
Konstantin Belousov 417579ffd4 MFC r179093 (by pjd):
Be more friendly for DDB pager.
2009-03-14 19:35:13 +00:00
Konstantin Belousov c4b8be9738 MFC r178585 (by pjd):
Implement 'show mount' command in DDB.
2009-03-14 19:03:40 +00:00
David Schultz b046f4c0c7 Partial MFC of r189131:
Make sure %zd treats negative arguments properly on 32-bit platforms.

  PR:		131880
2009-03-14 18:19:50 +00:00
Konstantin Belousov 396eabc3c7 MFC r189706:
Do not double-free the struct inode when insmntque failed. Default
insmntque destructor reclaims the vnode, and ufs_reclaim frees the memory.
2009-03-14 14:02:53 +00:00
Bruce M Simpson fb8b739cd5 Bump __FreeBSD_version to 701106 after the POSIX semaphore
fix was committed.
2009-03-14 08:34:45 +00:00
Bruce M Simpson 01f1eb9d67 MFC rev: 189736
Ensure that the semaphore value is re-checked after sem_lock
  is re-acquired, after the condition variable is signalled.

Early MFC, as the test case in the PR is fairly complete and the
submitter also re-ran test case on -STABLE. It also bites Python
fairly hard, which will otherwise try to use POSIX sems for its
internal thread synchronization; this needs more in-depth testing.

PR:		http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/127545
Reviewed by:	attilio
2009-03-14 01:12:35 +00:00
Konstantin Belousov e621eefda1 MFC r189450:
Extract the no_poll() and vop_nopoll() code into the common routine
poll_no_poll().
Return a poll_no_poll() result from devfs_poll_f() when
filedescriptor does not reference the live cdev, instead of ENXIO.
2009-03-13 10:52:22 +00:00
John Baldwin 6fcaa123e6 Disable the vm_page_startup assertion for now. It always fails on
platforms with superpages currently because the pages used by
vm_reserv_startup() are incorrectly included in the 'npages' count.  I
haven't removed the assertion as I think this is a real bug, but the side
effect is just that some memory is wasted on never-used vm_page structures.

The assertion was removed from HEAD which is why the bug wasn't noticed
there (and thus this is a direct commit to 7).
2009-03-12 22:01:42 +00:00
John Baldwin eee5c3abde MFC: Export hz, maxswzone, maxbcache, maxtsiz, dfldsiz, maxdsiz, dflssiz,
maxssiz, and sgrowsiz via sysctl.
2009-03-12 17:32:04 +00:00
Konstantin Belousov 3112e9d485 MFC r189283:
Correct types of variables used to track amount of allocated SysV shared
memory from int to size_t. Implement a workaround for current ABI not
allowing to properly save size for and report more then 2GB sized segment
of shared memory.

This makes it possible to use > 2 GB shared memory segments on 64bit
architectures. Please note the new BUGS section in shmctl(2) and
UPDATING note for limitations of this temporal solution.

MFC r189398:
Systematically use vm_size_t to specify the size of the segment for VM KPI.
Do not overload the local variable size in kern_shmat() due to vm_size_t
change.
Fix style bug by adding explicit comparision with 0.

MFC r189399:
Improve the grammar and wording in the changes to shmctl(2) manpage.

Put an UPDATING entry and bump __FreeBSD_version for the change.
2009-03-12 13:45:55 +00:00
Bruce M Simpson 0722f1ca8e Merge the open source Atheros HAL from HEAD to STABLE.
This adds support for the AH_SUPPORT_AR5416 kernel
configuration option, and removes the ath_rate*
and ath_hal modules. Their kernel options are not
however removed -- please see UPDATING.

Tested on an IBM/Lenovo T43 and ASUS EeePC 701 in both
STA and HostAP modes.

Submitted by:	sam
2009-03-12 03:09:11 +00:00
John Baldwin 34ceee1f5d MFC: Make cd9660 MPSAFE and able to use shared vnode locks for pathname
lookups.  Also, disable operations on character device nodes.
2009-03-11 22:13:12 +00:00
Robert Noland de36cac2dd Merge 189130
Initialize the vblank structures at load time.  Previously we did this
at irq install/uninstall time, but when we vt switch, we uninstall the
irq handler.  When the irq handler is reinstalled, the modeset ioctl
happens first.  The modeset ioctl is supposed to tell us that we can
disable vblank interrupts if there are no active consumers.  This will
fail after a vt switch until another modeset ioctl is called via dpms
or xrandr.  Leading to cases where either interrupts are on and can't
be disabled, or worse, no interrupts at all.
2009-03-11 02:39:02 +00:00
Robert Noland 56b7b72b0e Merge r189128
Add a tuneable to allow disabling msi on drm at runtime.
2009-03-11 02:37:52 +00:00
Robert Noland 176da55002 Merge r189099
Fix up some ioctl permissions issues long overlooked.

Submitted by:   jkim@
2009-03-11 02:36:20 +00:00
Robert Noland f59e5ff65f Merge r189054
The GM45 handles vblank differently.  Pull the changes from Intel in.
2009-03-11 02:13:46 +00:00
Robert Noland bc8c448b45 Merge r189053
Remove D_NEEDGIANT
2009-03-11 02:00:13 +00:00
Robert Noland 6a6705c6e0 Merge r189052
Turn on MSI if the card supports it.  There is a blacklist for chips
which report that they are capable of MSI, but don't work correctly.
2009-03-11 01:58:37 +00:00
Robert Noland 6c26fdfa0b Merge r189051
Prepare the radeon driver for MSI support.
2009-03-11 01:57:20 +00:00
Robert Noland dc74ce7069 Merge r189050
Add some vblank related debugging and replace the DRM_WAIT_ON macro
with a localized version.
2009-03-11 01:56:17 +00:00
Robert Noland ca5cc672cf Merge r189049
This was part of a sync to the code that Intel is shipping in linux.

        - Remove the old TTM interface
        - Move register definitions to i915_reg.h
        - Overhaul the irq handler
2009-03-11 01:54:41 +00:00
Robert Noland 1d2cbdc1fe Merge 189048
The i915 driver was the only consumer of locked task support.

Now that it doesn't use it anymore, get right of the taskqueue
and locked task support.
2009-03-11 01:53:21 +00:00
Robert Noland a170aee3b3 Merge r189047
The vblank_swap ioctl was fundamentally race prone.  Get rid of it.
2009-03-11 01:50:53 +00:00
Robert Noland a37f2bce76 Merge r189046
There is no reason to hold the lock here.

When I was LOCK_PROFILING this was pretty high up and there is no
reason for it.
2009-03-11 01:49:22 +00:00
Robert Noland 4aebabdd2b Merge r189045
Remove the PZERO priority from mtx_sleep.
2009-03-11 01:47:32 +00:00
Andrew Thompson a4fcae2ada MFC r189360
Add Mobile Action MA-620 Infrared Adapter.

Manually merged due to different codebase.
2009-03-11 01:03:32 +00:00
Andrew Thompson b50c51cd7f MFC r188548
Check the exit flag at the start of the taskqueue loop rather than the end. It
 is possible to tear down the taskqueue before the thread has run and the
 taskqueue loop would sleep forever.
2009-03-11 00:58:22 +00:00
John Baldwin 7f307a7ee8 MFC: Add a flag to tag individual sysctl leaf nodes as MPSAFE. Tag the
following nodes as MPSAFE:
- All standalone INT/LONG sysctls.
- kern.proc.*
- All name-cache related sysctls.
- vm.loadavg
- vm.vmtotal
- vm.stats.(sys|vm).*
- sysctl.name2oid
- kern.ident, kern.osrelease, kern.version, etc.
- kern.arandom
- security.jail.jailed
- kern.devname

Other changes:
- Remove GIANT_REQUIRED from vmtotal().
- Add conditional Giant locking around the vrele() in
  sysctl_kern_proc_pathname().
2009-03-10 19:33:50 +00:00
John Baldwin 772cc2acbf MFC: Expand the scope of the sysctllock sx lock to protect the sysctl tree
itself.  This also includes changes to the ia64 machine check code to
defer adding machine check records to the sysctl tree, removing Giant
from the CAM code that created dynamic sysctls, and tweaking the teardown
of da(4) and cd(4) peripheral devices to not hold locks when freeing the
sysctl tree.
2009-03-10 18:57:10 +00:00
John Baldwin f68d8092dc MFC: Add sysctl_rename_oid() and use it in device_set_unit(). 2009-03-10 18:16:03 +00:00
John Baldwin 57f8742e32 MFC: Push down Giant inside sysctl. 2009-03-10 17:28:23 +00:00
Robert Noland 4c7e461fca Manual merge of r189368 due to different ata layout in stable.
Remove the local management of INTx as this is now taken care of by pci.
2009-03-09 17:42:34 +00:00
Ruslan Ermilov cc4a03f4c1 MFC: Spell 'Yugoslav' correctly. 2009-03-09 17:07:27 +00:00
Christian Brueffer 46ff10aaf8 MFC: r189298
Xref glxsb(4).
2009-03-09 14:04:18 +00:00
Robert Noland 4f5153f64f Merge r189367,189447
Extend the management of PCIM_CMD_INTxDIS.

  We now explicitly enable INTx during bus_setup_intr() if it is needed.
  Several of the ata drivers were managing this bit internally.  This is
  better handled in pci and it should work for all drivers now.

  We also mask INTx during bus_teardown_intr() by setting this bit.
2009-03-09 08:25:05 +00:00
Robert Noland e95e29abd1 Merge r189285
Disable INTx when enabling MSI/MSIX

This addresses interrupt storms that were noticed after enabling MSI
in drm.  I think this is due to a loose interpretation of the PCI 2.3
spec, which states that a function using MSI is prohibitted from using
INTx.  It appears that some vendors interpretted that to mean that they
should handle it in hardware, while others felt it was the drivers
responsibility.

This fix will also likely resolve interrupt storm related issues with
devices other than drm.
2009-03-09 08:18:40 +00:00
Nathan Whitehorn f7b613fd20 Fix a mismerge from head that I somehow missed last night. This caused builds with
KDB enabled to fail.

Pointy hat to: 	me
2009-03-08 16:19:29 +00:00
Robert Watson 6664608a33 Merge missed routing lock fix r186061 from head to stable/7:
Dont leak the rnh lock on error.

Original change was from thompsa.  This may correct routing-related panics
seen by uses of ppp, including the following PRs:

PR:		132215, 132222, 132404
Reported by:	Ethan <hsiao.ethan at gmail.com>
2009-03-08 11:20:54 +00:00
Dmitry Chagin 0004da33d0 MFC r189232, r189313:
Fix range-check error introduced in r182292.
Panic in case the ncpus == 0. it helps to catch bugs in the callers.

Approved by:	kib (mentor)
2009-03-08 11:12:23 +00:00
Luigi Rizzo 9c1d3ca589 MFC rev.188571
Clarify and reimplement the bioq API so that bioq_disksort() has
the correct behaviour (sorting by distance from the current head position
in the scan direction) and bioq_insert_head() and bioq_insert_tail()
have a well defined (and useful) behaviour, especially when intermixed
with calls to bioq_disksort().

See the original commit log for more details.

NO API/ABI changes (except from fixing bugs and defining
unspecified behaviour that no code should rely on).
2009-03-08 00:11:26 +00:00
Nathan Whitehorn 1327215a38 MFC r188860,188879,188923,188951:
Altivec support for PowerPC.
2009-03-07 20:39:42 +00:00
Maksim Yevmenkin 8158a34150 MFC r188130
Clenup code a bit and do not call fork(2) before dameon(3) where not needed.
2009-03-06 01:34:30 +00:00
Maksim Yevmenkin 8390f99f1a MFC r188132
Allow unprivileged users to run l2ping(8).
2009-03-06 01:27:51 +00:00
Maksim Yevmenkin 60196478bb MFC r187938
Add btpand(8) daemon from NetBSD. This daemon provides support for
Bluetooth Network Access Point (NAP), Group Ad-hoc Network (GN) and
Personal Area Network User (PANU) profiles.

MFC r188013
Fix client mode. Pick up service availability changes.

MFC r188014
Hook up btpand(8) to the build

Obtained from:	NetBSD
2009-03-05 18:03:46 +00:00
Maksim Yevmenkin 3624c85118 MFC r183057
Add missing prototypes for uuid_enc,dec_le,be() functions.
Pointy hat goes to me.
2009-03-05 17:54:28 +00:00
John Baldwin 5dfee414c0 MFC: Don't throw away the upper 32-bits of the HT MSI address window. 2009-03-05 15:46:41 +00:00
Luigi Rizzo 49e52141f2 Merge a couple of changes from HEAD, plus fix a potential warning.
In detail:
+ we used SYSCTL_LONG to show a 64-bit variable. For the time being
  just remove the variable from the list of sysctl-exported values.
  Unfortunately our SYSCTL macros do not do proper type checking
  of the arguments so we might have some more bugs of this kind
  across the codebase;

+ fw_debug has not been used for ages, so remove it;

+ gcc 4.2.4 tells me that src_ip.s_addr may be not initialized,
  so make sure it is.
  I need to check what is the status of this field in head.
2009-03-05 07:42:47 +00:00
John Baldwin 62dfbb1992 MFC: Handle an additional layer of nesting for kernel modules to make it
easier to compile 8.x kernels with modules on 7.
2009-03-04 21:38:16 +00:00
Alexander Leidinger 72bbd7fc09 MFC r188572:
Fix an edge-case of the linux readdir: We need the size of a linux dirent
  structure, not the size of a pointer to it.

  PR:		131099
  Submitted by:	Andreas Kies <[email protected]>
2009-03-04 20:26:39 +00:00
Pyun YongHyeon 13891bc63c Enable ale(4) in GENERIC. 2009-03-04 01:50:00 +00:00
John Baldwin 1162b68d9d MFC: Use a clean slate of register state when executing hardware interrupt
handlers to avoid leaking values into the upper 16-bits of general purpose
registers when executing these routines.
2009-03-03 16:56:15 +00:00
Alexander Motin 9e44359d2e MFC rev. 188700, 188731, 188733.
Make core dumping to ad not to freeze even if interrupts, not disabled
for some reason (noticed on SMP), stealing our events.

ata_interrupt() does not need to return anything. It is not it's business
to report request completion, expecially when it is not reliable.

PR:		kern/114370, kern/115801
2009-03-03 08:14:43 +00:00
Alexander Motin 31f9229dee MFC rev. 186079, 188829, 188922, 188959.
Sync with HEAD.
2009-03-03 07:56:42 +00:00
VANHULLEBUS Yvan 379c54f821 MFC: Remove remain <= MHLEN restriction in m_makespace(),
which caused assert with big packets

PR:		kern/124609
Submitted by:	[email protected]
Approved by:	gnn(mentor)
Obtained from:	NetBSD
2009-03-02 16:55:19 +00:00
Robert Watson 06878de762 Merge r188315 from head to stable/7:
Set the lower bound on queue size for an audit pipe to 1 instead of 0,
  as an audit pipe with a queue length of 0 is less useful.

  Obtained from:        TrustedBSD Project
  Sponsored by:         Apple, Inc.
2009-03-01 23:32:27 +00:00
Robert Watson 86146e6be0 Merge r188313 from head to stable/7:
Change various routines that are responsible for transforming audit
  event IDs based on arguments to return au_event_t rather than int.

  Obtained from:        TrustedBSD Project
  Sponsored by: Apple, Inc.
2009-03-01 23:17:51 +00:00
Robert Watson c1f86bce62 Merge r187686 from head to stable/7:
When a statically linked binary is executed (or at least, one without
  an interpreter definition in its program header), set the auxiliary
  ELF argument AT_BASE to 0 rather than to the address that we would
  have mapped the interpreter at if there had been one.

  The ELF ABI specifications appear to be ambiguous as to the desired
  behavior in this situation, as they define AT_BASE as the base address
  of the interpreter, but do not mention what to do if there is none.
  On Solaris, AT_BASE will be set to the base address of the static
  binary if there is no interpreter, and on Linux, AT_BASE is set to 0.
  We go with the Linux semantics as they are of more immediate utility
  and allow the early runtime environment to know that the kernel has
  not mapped an interpreter, but because AT_PHDR points at the ELF
  header for the running binary, it is still possible to retrieve all
  required mapping information when the process starts should it be
  required.  Either approach would be preferable to our current behavior
  of passing a pointer to an unmapped region of user memory as AT_BASE.

  Sponsored by:	Google
2009-03-01 22:48:18 +00:00
Scott Long c907ae0efc Merge 186882: Implement kern.cam.cd.retry_count to aid with disk-
recovery tools.
2009-03-01 22:37:34 +00:00
Scott Long c2b5816f41 Merge 188840: Add DDF metadata support, found commonly on motherboards with
Adaptec branding.  For Entertainment Purposes Only!
2009-03-01 16:50:46 +00:00
Scott Long a2b2a2dec1 Merge 188845: Fix pseudo-scsi parameters so that more than 2 commands
will be queued to the device at once.
2009-03-01 16:43:45 +00:00
Scott Long 76020383fc Merge 188844: Fix pseudo-scsi parameters so that more than one i/o can
be queued at a time.
2009-03-01 16:41:48 +00:00
Scott Long 2390a1b216 Merge 182433: Fix locking mistake in the da driver. 2009-03-01 16:31:35 +00:00
Scott Long a3a749d08a Merge 186371: Fix refcount locking in cd, pass, and sg periphs. 2009-03-01 16:28:17 +00:00
Scott Long d805d73a69 Merge 181791: SCSI_DELAY is specified in milliseconds. 2009-03-01 16:26:38 +00:00
Scott Long 1a2e7f656f Merge 181381: Update SCSI opcodes and ASCs from t10.org. 2009-03-01 16:24:57 +00:00
Luigi Rizzo 920b5bfe86 sync the build script with the version in -current.
The most relevant changes are the building of libraries
in the --init call, and the ability to use /boot/loader
(on by default) which seems to be necessary for large kernels.
2009-03-01 15:03:08 +00:00
Edward Tomasz Napierala 635c255abd MFC r187894. Note that r188501 should be merged too.
Make sure the cdev doesn't go away while the filesystem is still mounted.
Otherwise dev2udev() could return garbage.

Reviewed by:	kib
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-03-01 15:01:00 +00:00
Luigi Rizzo 0f9ec4a5d4 document the possibility of hardwiring kenv/getenv values;
remove duplicate isa and npx entries;
remove DEVICE_POLLING
add tap, bpf devices;
add re and nfe drivers
2009-03-01 14:57:33 +00:00
Edward Tomasz Napierala aa0f2f40fa MFC r188240:
When a device containing mounted UFS filesystem disappears, the type
of devvp becomes VBAD, which UFS incorrectly interprets as snapshot
vnode, which in turns causes panic.  Fix it by replacing '!= VCHR'
with '== VREG'.

With this fix in place, you should no longer be able to panic the system
by removing a device with an UFS filesystem mounted from it - assuming
you don't use softupdates.

Reviewed by:	kib
Tested by:	pho
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-03-01 11:20:35 +00:00
Edward Tomasz Napierala 425d6614f7 MFC r187199:
Turn a "panic: non-decreasing id" into an error printf.  This seems
to be caused by a metadata corruption that occurs quite often after
unplugging a pendrive during write activity.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-03-01 11:17:38 +00:00
Edward Tomasz Napierala ac6732c880 MFC r186911:
Don't panic with "vinvalbuf: dirty bufs" when the mounted device that was
being written to goes away.

Reviewed by:	kib, scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-03-01 11:11:14 +00:00
Edward Tomasz Napierala 7e0c02494c MFC r186194:
According to phk@, VOP_STRATEGY should never, _ever_, return
anything other than 0.  Make it so.  This fixes
"panic: VOP_STRATEGY failed bp=0xc320dd90 vp=0xc3b9f648",
encountered when writing to an orphaned filesystem.  Reason
for the panic was the following assert:
KASSERT(i == 0, ("VOP_STRATEGY failed bp=%p vp=%p", bp, bp->b_vp));
at vfs_bio:bufstrategy().

Reviewed by:	scottl, phk
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-03-01 11:02:37 +00:00
Edward Tomasz Napierala 628cd5194b MFC r174937 by imp.
Reviewed by:	imp
Approved by:	rwatson (mentor)

Original commit log:

A partial solution to some of the 'pull the umass device with a
mounted FS' problems.  These are more along the lines of 'avoiding an
avoidable panic' than a complete solution to removable devices.  We
now close the barn door after the horse has gotten lose and has been
hit by a truck, as it were.  The barn no longer catches fire in this
case, but the horse is still dead :-).

The vfs_bio.c fix causes us not to put a failed write back into the
dirty pool if the error returned was ENXIO.  In that case, the buffer
is treated like any other clean buffer that's being retured.  ENXIO
means the device isn't there anymore and will never be there again in
the future, so retrying is futile.

The vfs_mount.c fix treats 'ENXIO' as success for unmounting a file
system.  If the device is gone, retrying later won't help and we'll
never be able to unmount the device.

These two are part of a larger patch set submitted by the author.  The
other patches will be forth coming.  I added comments to these two
patches.

Submitted by: Henrik Gulbrandsen
Reviewed by: phk@
PR: usb/46176 (partial)
2009-03-01 10:51:34 +00:00
Scott Long 2f1d177899 Merge 188395: Fix "invalid periph name" error condition. 2009-03-01 07:24:26 +00:00
Scott Long a8e0e89d58 Merge 176204: Fix typo 2009-03-01 07:22:46 +00:00
Scott Long b4e71f6e1f Fix mergeinfo for cam_xpt.c 2009-03-01 07:16:50 +00:00
Scott Long 52c617ea3b Merge 186396: Fix comment 2009-03-01 07:06:44 +00:00
Scott Long 3045c7e009 Merge 188671: Fix negotiation for imperfect SCSI and pseudo-SCSI devices. 2009-03-01 07:03:35 +00:00
Scott Long c0d4c3b436 Merge 188688: GCC bogon. 2009-03-01 07:02:16 +00:00
Scott Long 2f51d400d4 Merge 188670: Instrument the probe state machine 2009-03-01 07:00:52 +00:00
Scott Long ced01723f2 Merge 188570: Fix tag negotiation for pseudo-scsi devices and subsystems. 2009-03-01 06:57:25 +00:00
Scott Long 015a6b8090 Merge r186891: Retry TEST UNIT READY if needed. 2009-03-01 06:46:39 +00:00
Edward Tomasz Napierala b9af5a74d4 MFC r188917:
Mention disk_gone() in disk(9).

Approved by:	rwatson (mentor)
2009-02-28 11:22:09 +00:00
Edward Tomasz Napierala f45c565fbc MFC r188916:
Fix a typo and add manpage links to geom(4).

Approved by:	rwatson (mentor)
2009-02-28 11:20:37 +00:00
Edward Tomasz Napierala c57091b282 MFC r187053:
Prevent a panic that happens on SMP machines when removing a disk with
many writes queued up.

Reviewed by:	phk, scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-02-28 11:19:02 +00:00
Edward Tomasz Napierala 647c229de3 MFC r186188:
Implement g_vfs_orphan().  Without it, the filesystem never closes
the device, which means refcount on periph drivers never drops,
which means cam_sim_free() never returns, which results in umass
sleeping there ad infinitum.

Submitted by:	pjd
Reviewed by:	scottl, pjd
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-02-28 11:16:57 +00:00
Edward Tomasz Napierala 854d63facb MFC r188345:
Remove an overzealous check.

Submitted by:	das
Reviewed by:	scottl
Approved by:	rwatson (mentor, implicit)
Sponsored by:	FreeBSD Foundation
2009-02-28 11:11:38 +00:00
Edward Tomasz Napierala 0ae5507690 MFC r187652:
Protect against NULL pointer dereference.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-02-28 11:09:27 +00:00
Edward Tomasz Napierala 5ed22d7cc8 MFC r187651:
Don't leak memory when alloc fails.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
Found with:	Coverity Prevent(tm)
CID:		2908
2009-02-28 11:03:24 +00:00
Edward Tomasz Napierala 9a03cfc538 MFC r187650:
Guard against NULL pointer dereference.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
Found with:	Coverity Prevent(tm)
CID:		1847
2009-02-28 10:59:48 +00:00
Edward Tomasz Napierala cfa22fc265 MFC r187649:
Guard against NULL pointer dereference.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
Found with:	Coverity Prevent(tm)
CID:		130
2009-02-28 10:53:20 +00:00
Edward Tomasz Napierala 5281141ee8 MFC r187247.
Add missing 'break' statement.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
Found with:	Coverity Prevent(tm)
CID:		3667
2009-02-28 10:50:59 +00:00
Edward Tomasz Napierala b7487eeda1 MFC r187245:
Fix use after free.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
Found with:	Coverity Prevent(tm)
CID:		3712
2009-02-28 10:48:11 +00:00
Edward Tomasz Napierala 911a86d19c MFC r187244:
Remove unused variable.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
Found with:	Coverity Prevent(tm)
CID:		3665
2009-02-28 10:45:31 +00:00
Edward Tomasz Napierala 0397da889b MFC r187243:
Add missing 'break' statement.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
Found with:	Coverity Prevent(tm)
CID:		3927
2009-02-28 10:43:10 +00:00
Edward Tomasz Napierala cec362cac5 MFC r187028:
Don't call destroy_dev(9) with a mutex held.  While here, shuffle
things around so the periph destructors look alike.  Based on a patch
by Jaakko Heinonen.

Submitted by:	Jaakko Heinonen
Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-02-28 10:40:52 +00:00
Edward Tomasz Napierala 7997d4ee5e MFC r186905:
Make "kldunload atapicam" return EBUSY instead of deadlocking when a device
created by atapicam is being kept opened or mounted.  This is probably just
a temporary solution until we invent something better.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
Reported by:	Jaakko Heinonen
2009-02-28 10:38:32 +00:00
Edward Tomasz Napierala 7471a82b4b MFC r186320:
Fix cam_sim_free() wakeup condition and add mtx_asserts.

Submitted by:	Christoph Mallon
Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-02-28 10:35:30 +00:00
Edward Tomasz Napierala 2d05d8213c MFC r186319:
Periph driver fixes, second try.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-02-28 10:33:00 +00:00
Edward Tomasz Napierala eee0e4437e MFC r186318:
Move mtx_assert lower, when we can be sure that the pointer
to the mutex is valid.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-02-28 10:29:55 +00:00
Edward Tomasz Napierala 95bee4e2de MFC r186185:
Add SIM refcounting.  This is slightly different from what DragonFly
does - in DragonFly, it's cam_sim_release() what actually frees the
SIM; cam_sim_free does nothing more than calling cam_sim_release().
Here, we drain in cam_sim_free, waiting for refcount to drop to zero.
We cannot do the same think DragonFly does, because after cam_sim_free
returns, client would destroy the sim->mtx, and CAM would trip over
an initialized mutex.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-02-28 10:27:46 +00:00
Edward Tomasz Napierala f28d6314ea MFC r186184:
Get rid of dead_sim.  There is no way to make it work - any attempt
to actually use it would panic on mtx operation, as dead_sim doesn't
have a proper mutex.  Even if it had a properly initialized mutex,
it wouldn't have properly locked and owned one.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-02-28 10:24:57 +00:00
John Baldwin 216940de91 Catch up to the 6GB KVA changes. The original superpages patches on 7
were tested prior to the MFC of the 6GB KVA changes, and I failed to do
an extra sanity check yesterday.  This should fix the pmap_init() panics.

Pointy hat to:	jhb
2009-02-27 15:25:47 +00:00
John Baldwin 00c57557ed MFC: Add a stub for pmap_align_superpage() on machines that don't (yet)
implement pmap-level support for superpages.

Pointy hat to:	jhb
2009-02-26 20:38:37 +00:00
John Baldwin c162d7ede7 MFC: Don't clear the attribute cache of a file when it is closed. 2009-02-26 18:55:55 +00:00
John Baldwin c7ce5f536b MFC: Add a new ioctl to fetch details about an individual BAR of a device
and add support for displaying BAR details via a new pciconf flag.
2009-02-26 18:54:24 +00:00
John Baldwin c6566dff0c MFC: Sort getopt options alphabetically. 2009-02-26 18:46:22 +00:00
John Baldwin 15826f991f MFC: Add support for "superpages" on amd64 and i386. This includes adding the
superpage reservation system to the machine-independent VM system as well as
changes to the pmap code for amd64 and i386 to support superpages.

Reviewed by:	alc
Tested by:	ps
2009-02-26 15:59:22 +00:00
Ed Maste bd9fb6c7de MFC r177490 - diff reduction w/ head.
Use linker set to collection all target operations.
2009-02-25 20:56:27 +00:00
Robert Watson 652778346b Merge r188485 from head to stable/7:
Modify fdcopy() so that, during fork(2), it won't copy file descriptors
  from the parent to the child process if they have an operation vector
  of &badfileops.  This narrows a set of races involving system calls that
  allocate a new file descriptor, potentially block for some extended
  period, and then return the file descriptor, when invoked by a threaded
  program that concurrently invokes fork(2).  Similar approches are used
  in both Solaris and Linux, and the wideness of this race was introduced
  in FreeBSD when we moved to a more optimistic implementation of
  accept(2) in order to simplify locking.

  A small race necessarily remains because the fork(2) might occur after
  the finit() in accept(2) but before the system call has returned, but
  that appears unavoidable using current APIs.  However, this race is
  vastly narrower.

  The fix can be validated using the newfileops_on_fork regression test.

  PR:           kern/130348
  Reported by:  Ivan Shcheklein <shcheklein at gmail dot com>
  Reviewed by:  jhb, kib
2009-02-25 15:04:30 +00:00
Robert Watson 6ebb1a07e7 Merge r188312 from head to stable/7:
Audit AUE_MAC_EXECVE; currently just the standard AUE_EXECVE arguments
  and not the label.

  Obtained from:        TrustedBSD Project
  Sponsored by: Apple, Inc.
2009-02-25 15:01:26 +00:00
Robert Watson 412fab815c Merge 3188124 from head to stable/7:
Remove local variable 'ddp' from DDP's attach and detach routines; they
  were used only for assertions, and rather than ifdef'ing them
  INVARIANTS and using local variables, just directly access so_pcb.

  Submitted by: Christoph Mallon <christoph dot mallon at gmx dot de>
2009-02-25 14:48:13 +00:00
Robert Watson 4c42d066d4 Merge r188123 from head to stable/7:
Remove written-to but never read local variable 'offset' from
  soreceive_dgram().

  Submitted by: Christoph Mallon <christoph dot mallon at gmx dot de>
2009-02-25 14:26:16 +00:00
Robert Watson cb2dbc6249 Merge r183689 from head to stable/7:
Differentiate pr_usrreqs for stream and datagram UNIX domain sockets, and
  employ soreceive_dgram for the datagram case.
2009-02-25 14:08:28 +00:00
Robert Watson b9ecd8aeae Merge r188122 from head to stable/7:
Eliminate the local variable 'ape' in audit_pipe_kqread(), as it's only
  used for an assertion that we don't really need anymore.

  Reported by:  Christoph Mallon <christoph dot mallon at gmx dot de>
2009-02-25 13:47:09 +00:00
Robert Watson 3b2457077a Merge r184825 from head to stable/7:
Wrap sx locking of the audit worker sleep lock in macros, update comments.

  Sponsored by: Apple, Inc.
2009-02-25 13:42:38 +00:00
Robert Watson 61ea39a324 Merge r184544 and r184545 from head to stable/7:
Remove stale comment about filtering in audit pipe ioctl routine: we do
  support filtering now, although we may want to make it more interesting
  in the future.

  Update introductory comment for audit pipes.

  Sponsored by: Apple, Inc.
2009-02-25 13:30:17 +00:00
Robert Watson ce2e6d659c Merge r184540 from head to stable/7:
Add comment for per-pipe stats.

  Sponsored by: Apple, Inc.
2009-02-25 13:26:30 +00:00
Robert Watson bc08e50fe3 Merge r184536 from head to stable/7:
We only allow a partial read of the first record in an audit pipe
  record queue, so move the offset field from the per-record
  audit_pipe_entry structure to the audit_pipe structure.

  Now that we support reading more than one record at a time, add a
  new summary field to audit_pipe, ap_qbyteslen, which tracks the
  total number of bytes present in a pipe, and return that (minus
  the current offset) via FIONREAD and kqueue's data variable for
  the pending byte count rather than the number of bytes remaining
  in only the first record.

  Add a number of asserts to confirm that these counts and offsets
  following the expected rules.

  Sponsored by: Apple, Inc.
2009-02-25 13:21:28 +00:00
Robert Watson 6b477e67ec Merge r184534 from head to stable/7:
Allow a single read(2) system call on an audit pipe to retrieve data from
  more than one audit record at a time in order to improve efficiency.

  Sponsored by: Apple, Inc.
2009-02-25 13:17:46 +00:00
Robert Watson c195cb7a92 Merge 3184510 from head to stable/7:
Since there is no longer the opportunity for record truncation, just
  return 0 if the truncation counter is queried on an audit pipe.

  Sponsored by: Apple, Inc.
2009-02-25 12:32:15 +00:00
Robert Watson 581d883a67 Merge r184508 from head to stable/7:
Historically, /dev/auditpipe has allows only whole records to be read via
  read(2), which meant that records longer than the buffer passed to read(2)
  were dropped.  Instead take the approach of allowing partial reads to be
  continued across multiple system calls more in the style of streaming
  character device.

  This means retaining a record on the per-pipe queue in a partially read
  state, so maintain a current offset into the record.  Keep the record on
  the queue during a read, so add a new lock, ap_sx, to serialize removal
  of records from the queue by either read(2) or ioctl(2) requesting a pipe
  flush.  Modify the kqueue handler to return bytes left in the current
  record rather than simply the size of the current record.

  It is now possible to use praudit, which used the standard FILE * buffer
  sizes, to track much larger record sizes from /dev/auditpipe, such as
  very long command lines to execve(2).

  Sponsored by: Apple, Inc.
2009-02-25 12:00:15 +00:00
Robert Watson 5df39340ec Merge r186825 from head to stable/7:
Do a lockless read of the audit pipe list before grabbing the audit pipe
  lock in order to avoid the lock acquire hit if the pipe list is very
  likely empty.

  Obtained from:        TrustedBSD Project
  Sponsored by: Apple, Inc.
2009-02-25 11:44:03 +00:00
Robert Watson 96dbfa61cf Merge r179458 from head to stable/7:
Import rewritten nve device id's, which brings this more
  inline with if_nfe.

  PR:		110883
  Submitted by:	Claudel <regis at claudel dot ch>
  Approved by:	imp (mentor, implicit)
2009-02-25 11:37:19 +00:00
Robert Watson a768e0ae95 Correct a deadlock and a rtentry leak in rt_check():
- In the event that a gateway route has to be looked up, drop the lock
  on 'rt' before reacquiring it 'rt0' in order to avoid deadlock.

- In the event the original route has evaporated or is no longer up
  after the gateway route lookup, call RTFREE() on the gateway route
  before retrying.

This is a potential errata candidate patch.

PR:		kern/130652
Submitted by:	Dmitrij Tejblum <tejblum at yandex-team.ru>
Reviewed by:	bz
Tested by:	Pete French <petefrench at ticketswitch.com>
2009-02-25 11:18:18 +00:00
Robert Watson 3d81140acd Merge r185747, r185774, r185807, r185849, r185964, r185965, r186051,
r186052 from head to stable/7; note that only the locking fixes and
invariants checking are added from r185747, but not the move to an
rwlock which would modify the kernel binary interface, nor the move
to a non-recursible lock, which is still seeing problem reports in
head.  This corrects, among other things, a deadlock that may occur
when processing incoming ICMP redirects.

r185747:

  - convert radix node head lock from mutex to rwlock
  - make radix node head lock not recursive
  - fix LOR in rtexpunge
  - fix LOR in rtredirect

  Reviewed by:  sam

r185774:

  - avoid recursively locking the radix node head lock
  - assert that it is held if RTF_RNH_LOCKED is not passed

r185807:

  Fix a bug introduced in r185747: rather than dereferencing an
  uninitialized *rt to something undefined, use the fibnum that came in
  as function argument.

  Found with:   Coverity Prevent(tm)
  CID:          4168

r185849:

  fix a reported panic when adding a route and one hit here when deleting
  a route

  - pass RTF_RNH_LOCKED to rtalloc1_fib in 2 cases where the lock is held
  - make sure the rnh lock is held across rt_setgate and rt_getifa_fib

r185964:

  Pass RTF_RNH_LOCKED to rtalloc1 sunce the node head is locked, this
  avoids a recursive lock panic on inet6 detach.

  Reviewed by:  kmacy

r185965:

  RTF_RNH_LOCKED needs to be passed in the flags arg not report,
  apologies to thompsa

r186051:

  in6_addroute is called through rnh_addadr which is always called with
  the radix node head lock held exclusively. Pass RTF_RNH_LOCKED to
  rtalloc so that rtalloc1_fib will not try to re-acquire the lock.

r186052:

  don't acquire lock recursively

Oiginal commits to head were by kmacy, except r185964 by thompsa and
r185807 by bz.

A subset of this is a potential errata patch candidate.

Reviewed by:    bz, kmacy
Tested by:      Pete French <petefrench at ticketswi
2009-02-25 10:59:56 +00:00
Andrew Gallatin ffc02cf3ad MFH r188736 and r188737: Better support for recent Myricom 10GbE NICs 2009-02-24 20:16:34 +00:00
Andrew Gallatin c7d6cc0149 MFH r186260: Additional 10GbE media types (10Gbase-LRM, 10Gbase-Twinax*) 2009-02-24 19:41:23 +00:00
Alexander Motin ca0f0643fa MFC rev. 187876, 188462, 188724
Sync sdhci driver with HEAD:
Add hw.sdhci.debug sysctl to control debug level.
Fix read_ivar prototype.
Add support for interruptless kernel dumping.
2009-02-23 19:58:35 +00:00
Alexander Motin a56dc7b85a MFC rev. 187525 187543 187546 187551 187875 187877 188044 188725
Sync MMC subsystem with HEAD.
2009-02-23 19:52:47 +00:00
Bruce M Simpson 9f6acca92d fix typo! 2009-02-22 19:23:58 +00:00
Bruce M Simpson 48cf390028 MFC:
Fix a typo which caused ifmcstat's sysctl path
  to print the network-layer endpoint address of the
  group membership, rather than its link-layer mapping
  as intended.
  The KVM path is not affected.
2009-02-22 13:34:01 +00:00
Konstantin Belousov dc9ca499f4 MFC r188320:
Do not leak the MAP_ENTRY_IN_TRANSITION flag when copying map entry
on fork. Otherwise, copied entry cannot be removed in the child map.
2009-02-22 10:28:09 +00:00
Konstantin Belousov 21c276f904 MFC r188318:
Lookup up the directory entry for the tmpfs node that are deleted by
both node pointer and name component. This does the right thing for
hardlinks to the same node in the same directory.

PR:   kern/131356
2009-02-22 10:25:07 +00:00
Konstantin Belousov de32bbb167 MFC r187528:
Move the code from ufs_lookup.c used to do dotdot lookup, into
the helper function. It is supposed to be useful for any filesystem
that has to unlock dvp to walk to the ".." entry in lookup routine.
2009-02-22 10:17:10 +00:00
Alan Cox 64b615bb56 MFC r188608
Remove unnecessary page queues locking around vm_page_busy() and
  vm_page_wakeup().
2009-02-22 03:02:46 +00:00
Sam Leffler 1ff4c2bf1f fix cross-refs to wlandebug
PR:		docs/131927
Submitted by:	David Horn <[email protected]>
2009-02-21 19:19:11 +00:00
Maxim Konovalov 1b5ef55d74 MFC r188749,188759: DragonFly 2.2.0. 2009-02-20 07:22:58 +00:00
Maxim Konovalov f6a14ddc64 MFC r188575: don't leak a device unit number. 2009-02-20 07:17:06 +00:00
Maxim Konovalov cfc4ae8078 MFC r188481: print an octal representation of suid, sgid and
sticky bits with -x flag.
2009-02-20 07:10:33 +00:00
Luigi Rizzo 9e650b97c1 MFC: sync the ipfw code with the version in HEAD.
The only new feature is that now one can write
"table all {flush | list}" to act on all tables.

Just for the records, there is one difference which probably
has no practical importance; two "tos" flags are represented
differently now:

@@ -182,8 +182,8 @@ static struct _s_x f_iptos[] = {
 	{ "throughput",	IPTOS_THROUGHPUT},
 	{ "reliability", IPTOS_RELIABILITY},
 	{ "mincost",	IPTOS_MINCOST},
-	{ "congestion",	IPTOS_CE},
-	{ "ecntransport", IPTOS_ECT},
+	{ "congestion",	IPTOS_ECN_CE},
+	{ "ecntransport", IPTOS_ECN_ECT0},
 	{ "ip tos option", 0},
 	{ NULL,	0 }
 };

IPTOS_ECT = IPTOS_ECN_ECT0 = 2 so 'ecntransport' is the same.

IPTOS_CE = 1, IPTOS_ECN_CE = 3 so 'congestion' is represented by a
different codepoint, but this also reflects a different specification
(RFC3168 obsoletes RFC2481) so the change is just adopting the new
spec.
2009-02-20 00:39:39 +00:00
Luigi Rizzo faf51e964f correct the spelling of a log message (missing "All ");
on passing, rename a variable within a macro to reduce the chance
of shadowing other variables with the same name
2009-02-19 21:29:30 +00:00
Konstantin Belousov aacef1f255 Unbreak ZFS after the r188610:
MFC r182781 (by pjd):
Catch up after last insmntque() changes:
- The vnode has to be locked exclusively before calling insmntque().
- Until I find a way to handle insmntque() failures use VV_FORCEINSMQ flag
  to force insmntque() to always succeed.

MFC r182824 (by pjd):
Lock vnode exclusively around insmntque().

MFC r182840 (by pjd):
Initialize vp, so we don't call VOP_UNLOCK() with NULL vnode pointer.

Tested by:	cy, pjd
No objections by:	pjd
2009-02-19 16:01:00 +00:00
Jamie Gritton 5d9b2b21a3 MFC:
r188144:
   Standardize the various prison_foo_ip[46] functions and prison_if to
   return zero on success and an error code otherwise.  The possible errors
   are EADDRNOTAVAIL if an address being checked for doesn't match the
   prison, and EAFNOSUPPORT if the prison doesn't have any addresses in
   that address family.  For most callers of these functions, use the
   returned error code instead of e.g. a hard-coded EADDRNOTAVAIL or
   EINVAL.

   Always include a jailed() check in these functions, where a non-jailed
   cred always returns success (and makes no changes).  Remove the explicit
   jailed() checks that preceded many of the function calls.

 r188146:
   Don't allow creating a socket with a protocol family that the current
   jail doesn't support.  This involves a new function prison_check_af,
   like prison_check_ip[46] but that checks only the family.

   With this change, most of the errors generated by jailed sockets
   shouldn't ever occur, at least until jails are changeable.

 r188148:
   Remove redundant calls of prison_local_ip4 in in_pcbbind_setup, and of
   prison_local_ip6 in in6_pcbbind.

 r188149:
   Call prison_if from rtm_get_jailed, instead of splitting it out into
   prison_check_ip4 and prison_check_ip6.  As prison_if includes a jailed()
   check, remove that check before calling rtm_get_jailed.

 r188151:
   Don't bother null-checking the thread pointer before the prison checks
   in udp6_connect (td is already dereferenced elsewhere without such a
   check).  This makes the conversion from a sockaddr to a sockaddr_in6
   always happen, so convert once at the beginning of the function rather
   than twice in the middle.

Approved by:	bz (mentor)
2009-02-18 20:12:08 +00:00
John Baldwin 24907ae356 The previous MFC only fixed the old kern.proc.vmmap sysctl. Fix the new one
as well to not hold the vnode lock for vn_fullpath() and only use a shared
vnode lock for VOP_GETATTR().
2009-02-17 22:49:58 +00:00
John Baldwin 48fb501ef2 MFC: Remove unnecessary locking around vn_fullpath(). This also includes
closing some races between procfs' <pid>/file and execve(2) and using a
shared vnode lock for the VOP_GETATTR() in the kern.proc.vmmap sysctl
handler.
2009-02-17 22:46:30 +00:00
John Baldwin 33a5fd2709 MFC: Use shared vnode locks for auditing vnode arguments. 2009-02-17 21:59:54 +00:00
John Baldwin efb40e6e5b MFC: Use shared vnode locks instead of exclusive vnode locks for the
access(), chdir(), chroot(), eaccess(), fchdir(), fpathconf(), fstat(),
fstatfs(), lseek() (when figuring out the current size of the file in the
SEEK_END case), pathconf(), readlink(), and statfs() system calls.
2009-02-17 21:35:54 +00:00
John Baldwin 06a0d6a27d MFC: Permit Giant to be passed as the explicit interlock either to
msleep/mtx_sleep or the various cv_*wait*() routines.
2009-02-17 21:02:35 +00:00
John Baldwin 790767dcd5 MFC: Rework the lifetime management of the kernel implementation of POSIX
semaphores.  Specifically, semaphores are now represented as new file
descriptor type that is set to close on exec.  This removes the need for
all of the manual process reference counting (and fork, exec, and exit
event handlers) as the normal file descriptor operations handle all of
that for us nicely.  It is also suggested as one possible implementation
in the spec and at least one other OS (OS X) uses this approach.

Refer to the original commit for more details on specific bug fixes, etc.
A notable difference in this MFC relative to the original commit to HEAD
is that the MAC entry points are unchanged to preserve the ABI for MAC
policy modules.  fstat() on a POSIX semaphore in 7 uses the
mac_check_posix_sem_getvalue() hook to determine access as that is the
closest match to stat() of the available hooks.

Discussed with:	 rwatson (MAC bits (or lack thereof))
2009-02-17 19:57:52 +00:00
John Baldwin ae7221fe88 MFC: Fix a bug in the previous change to the mtab handler: use the path
returned by vn_fullpath() when vn_fullpath() succeeds instead of when it
fails.
2009-02-17 15:58:42 +00:00
John Baldwin 2298434666 MFC: Correct the sense of the "use32" terenary operator so that it uses
'lib32' for 32-bit binaries on amd64 and 'lib' for 64-bit binaries. Remove
an #ifdef __i386__ that defined use32 to the wrong value on i386 to
workaround the bug in the terenary operator.
2009-02-17 15:54:09 +00:00
John Baldwin ed6edae82a MFC 1.39: Include <sys/pcpu.h> in <sys/sx.h> in the kernel so that
curthread is always defined.
2009-02-17 15:41:41 +00:00
Colin Percival 47048831e5 Correctly scrub telnetd's environment.
Approved by:	so (cperciva)
Security:	FreeBSD-SA-09:05.telnetd
2009-02-16 21:56:17 +00:00
Maksim Yevmenkin 9a8a952e01 MFC r188603
Since r188030 the error value for attach is returned, this means if kbdmux
fails to attach (possibly due to disable hints) then we get called back for
unload. Correctly handle the case where the keyboard isnt found rather than
calling panic.

Submitted by:	thompsa
2009-02-16 20:04:57 +00:00
Hajimu UMEMOTO 4d0d4995c5 MFH 188316: Shutup warning for DNAME RR.
PR:		bin/127591
Submitted by:	"Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv>
2009-02-16 18:24:48 +00:00
Luigi Rizzo 9d79a4ee45 various cleanup (mostly MFC, one not applicable to head):
- remove 3 unneeded headers (this is not applicable to head);
- replace netinet/if_ether.h with net/ethernet.h which is really needed;
- add missing #ifdef SYSCTL_NODE / #endif
- use the 'ch' argument instead of &layer3_chain when adding entries to
  a table;
- remove an assigment within a conditional;
- properly initialize a couple of variables
- use a constant format string in a log message
- remove unnecessary braces and simplify the error
  messages in IP_FW_NAT_* handler
2009-02-16 16:48:49 +00:00
Luigi Rizzo 7f6b328a70 make the dependency on lock.h and mutex.h explicit instead of
inheriting them from net/if.h
2009-02-16 16:36:31 +00:00
Konstantin Belousov dd0e4cdc33 Bump __FreeBSD_version after the r188620, that changed
struct mount and struct vfsops.
2009-02-14 23:48:26 +00:00
Konstantin Belousov e2bcdc693e MFC r186897:
If unmount of the ffs mp failed, reinitialize the extended attributes
for the mp, and restart them if autostart is enabled.
2009-02-14 23:45:24 +00:00
Konstantin Belousov 105cf80b16 MFC r183074:
Suspend the write operations on the UFS filesystem being unmounted or
remounted from rw to ro.
2009-02-14 23:22:37 +00:00
Konstantin Belousov 4ddee6018f MFC r183073:
When attempt is made to suspend a filesystem that is already syspended,
wait until the current suspension is lifted instead of silently returning
success immediately. The consequences of calling vfs_write() resume when
not owning the suspension are not well-defined at best.

Add the vfs_susp_clean() mount method to be called from
vfs_write_resume(). Set it to process_deferred_inactive() for ffs, and
stop calling it manually.

Add the thread flag TDP_IGNSUSP that allows to bypass the suspension
point in the vn_start_write. It is intended for use by VFS in the
situations where the suspender want to do some i/o requiring calls to
vn_start_write(), and this i/o cannot be done later.

Note that addition of the mount method and new struct mount field change
the KBI. This was approved by re and no objections on stable@ were
raised.
2009-02-14 23:02:21 +00:00
Konstantin Belousov 45444589ee MFC r183072:
Add the ffs structures introspection functions for ddb.
Show the b_dep value for the buffer in the show buffer command.
Add a comand to dump the dirty/clean buffer list for vnode.
2009-02-14 22:24:04 +00:00
Konstantin Belousov d53f04a4bd MFC r183070:
When downgrading the read-write mount to read-only, do_unmount() sets
MNT_RDONLY flag before the VFS_MOUNT() is called. In ufs_inactive()
and ufs_itimes_locked(), UFS verifies whether the fs is read-only by
checking MNT_RDONLY, but this may cause loss of the IN_MODIFIED flag
for inode on the fs being remounted rw->ro.

Introduce UFS_RDONLY() struct ufsmount' method that reports the value
of the fs_ronly. The later is set to 1 only after the remount is
finished.
2009-02-14 21:12:58 +00:00
Konstantin Belousov 003038583e MFC r182366:
In ffs_valloc(), ffs_vget() may fail because insmntque() refused to
insert new vnode into the mount vnode list. Then, for the SU-enabled
mount, ffs_vfree could create freefile dependency. This dependency can
hang around forever since inode is not marked as IN_MODIFIED and
correspondingly inodeblock may be not marked as dirty.

After ffs_vget() fails, retry with FFSV_FORCEINSMQ, mark the inode as
modified, and vput() it immediately. Take care of the dup alloc.
2009-02-14 21:08:40 +00:00
Konstantin Belousov ba14aa9764 MFC r182365:
Softdep code may need to instantiate vnode when processing
dependencies. In particular, it may need this while syncing filesystem
being unmounted. Since during unmount MNTK_NOINSMNTQUE flag is set,
that could sometimes disallow insertion of the vnode into the vnode
mount list, softdep code needs to overwrite the MNTK_NOINSMNTQUE flag.

Create the ffs_vgetf() function that sets the VV_FORCEINSMQ flag for
new vnode and use it consistently from the softdep code instead of
ffs_vget().

Add the retry logic to the softdep_flushfiles() to flush the vnodes
that could be instantiated while flushing softdep dependencies.
2009-02-14 20:59:50 +00:00
Konstantin Belousov f31d8f3fa3 MFC r182364:
Introduce the VV_FORCEINSMQ vnode flag. It instructs the insmnque() function
to ignore the unmounting and forces insertion of the vnode into the mount
vnode list.

Change insmntque() to fail when forced unmount is in progress and
VV_FORCEINSMQ is not specified.

Add an assertion to the insmntque(), requiring the vnode to be
exclusively locked for mp-safe filesystems.
MFC note: because zfs in stable/7 does not follow the insmntque() protocol,
the assertion is commented out.

Use the VV_FORCEINSMQ for the creation of the syncvnode.
2009-02-14 20:42:54 +00:00
Ulf Lilleengen 2c699bf4ab MFC r188492:
- Use the correct argument when determining the buffer size.

PR:		kern/131575
2009-02-13 19:49:35 +00:00
Alexander Motin e2cd193bc0 MFC rev. 187384
Fix regression introduced at rev. 173124:
0.0.0.0/1 is not the same as 0.0.0.0/0.
2009-02-13 19:16:15 +00:00
Luigi Rizzo ae6404c69e remove some unnecessary #include
Again, this change is not directly applicable to HEAD due
to the presence of vnet.h and vinet.h which bring in almost
every network-related header.
2009-02-13 18:31:35 +00:00
Luigi Rizzo 7594a54823 MFC - replace usage of n_* types with uint*_t , to help removing
unnecessary dependencies on in_systm.h
2009-02-13 18:09:38 +00:00
Luigi Rizzo ba27fba342 document why certain headers are required. 2009-02-13 18:04:55 +00:00
Luigi Rizzo ce2fdaa673 remove some unnecessary #include
The change is not directly applicable to HEAD because there
a lot of headers are already included by vnet.h
2009-02-13 13:35:41 +00:00
Konstantin Belousov 0398f67fec MFC r187223:
Redo the locking of the semaphores lifetime cycle.

MFC r187298:
Lock the semaphore identifier lock during semaphore initialization.
2009-02-13 12:15:45 +00:00
Pyun YongHyeon 23c96afbc4 MFC r186126:
Elaborate on the hardware features fxp(4) supports.
2009-02-13 02:41:15 +00:00
Maksim Yevmenkin 5736860ade MFC r188452
Update comment. soalloc() is no longer performing M_WAITOK memory allocations.

Submitted by:	ru
2009-02-13 01:14:00 +00:00
Randall Stewart 1ae616bdd1 MFC of 185694 - The IETF hack session:
Code from the hack-session known as the IETF (and a
bit of debugging afterwards):
- Fix protection code for notification generation.
- Decouple associd from vtag
- Allow vtags to have less strigent requirements in non-uniqueness.
   o don't pre-hash them when you issue one in a cookie.
   o Allow duplicates and use addresses and ports to
     discriminate amongst the duplicates during lookup.
- Add support for the NAT draft draft-ietf-behave-sctpnat-00, this
  is still experimental and needs more extensive testing with the
  Jason Butt ipfw changes.
- Support for the SENDER_DRY event to get DTLS in OpenSSL working
  with a set of patches from Michael Tuexen (hopefully heading to
  OpenSSL soon).
- Update the support of SCTP-AUTH by Peter Lei.
- Use macros for refcounting.
- Fix MTU for UDP encapsulation.
- Fix reporting back of unsent data.
- Update assoc send counter handling to be consistent with endpoint
  sent counter.
- Fix a bug in PR-SCTP.
- Fix so we only send another FWD-TSN when a SACK arrives IF and only
  if the adv-peer-ack point progressed. However we still make sure
  a timer is running if we do have an adv_peer_ack point.
- Fix PR-SCTP bug where chunks were retransmitted if they are sent
  unreliable but not abandoned yet.

With the help of:       Michael Teuxen and Peter Lei :-)
2009-02-12 18:50:27 +00:00
Randall Stewart e29c5f9fe0 MFC 184883 - a pack of bug fixes and misc adjustments:
-Improvement: Add '\n' on debug output in sctp_lower_sosend().
-Improvement: panic() on INVARIANTS kernels if memory allocation
 fails for a tagblock in sctp_add_vtag_to_timewait().
-Bugfix: Protect code in sctp_is_in_timewait() by
 SCTP_INP_INFO_WLOCK/SCTP_INP_INFO_WUNLOCK.
-Cleanup: Get rid of unused variable now in sctp_init_asoc().
-Bugfix: Reuse the correct vtag in sctp_add_vtag_to_timewait().
-Cleanup: Get rid of unused constant SCTP_TIME_WAIT_SHORT
 in sctp_constants.h.
-Improvement: Use all hash buckets of the vtag hash table.
-Cleanup: Get rid of then unused constant SCTP_STACK_VTAG_HASH_SIZE_A.
-Bugfix: Handle SHUTDOWN;SACK packet correctly.
-Bugfix: Last TSN in a gap ack block was not being "ack'd"
         in the internal scoreboard.
Obtained from:  (with help from Michael Tuexen)
2009-02-12 18:33:26 +00:00
Randall Stewart a1b51746f9 MFC of 184340
More issues with pre-blocking:
 a) Need for EEOR mode to take the min of the socket buffer size and the
    add more threshold, otherwise if you are so silly as to set a send
    buf size less than the add-more you could block forever in eeor mode.

 b) We were incorrectly using the sysctl vs the calculated value. This
    causes us to block forever if the addmore theshold is larger than
    then the socket buffer size.
2009-02-12 18:28:42 +00:00
Randall Stewart a16ea3da35 MFC 184333
Invariants changes that make more sense.
2009-02-12 18:24:54 +00:00
Randall Stewart bd2e61f2d0 MFC of 184031:
The flags value was not always being copied out in the recv routine like it
should be.
Obtained from:  Michael Tuexen
2009-02-12 18:22:11 +00:00
Randall Stewart 9d6e9bc1d5 MFC of 184027:
Reported by Yehuda Weinraub ([email protected]) - CRC32C algorithm
uses incorrect init_bytes value. It SHOULD have the number
of bytes to get to a 4 byte boundary.

PR:		128134
2009-02-12 18:02:46 +00:00
Randall Stewart a1db04b7a6 MFC of 182367 and 182403
- Make strict-sacks be the default.
- Change it so that without INVARIANTs there are
  no panics in SCTP.
- sctp_timer changes so that we have a recovery mechanism
  when the sent list is out of order.

<AND>

Fixes compile error when INVARIANTs is on. Adds an
empty goto to keep the compiler happy.
2009-02-12 17:57:28 +00:00
Randall Stewart b14dcf5dbf MFC of 184336:
Two inter-related bugs.
  - If we send EXACTLY the size left in the send buffer
    and then send again, we end up with exactly 0 bytes and
    don't hit the pre-block code to wait for more space.
  - If we fall into the loop with our max_len == 0 (the bug
    above) we then call in to copy out the data, setup the length
    of the waiting to transmit data to 0 and call the mbuf copy routine
    which 0 indicates copy all the data to the mbuf chain.. which it
    does. This then leaves a "stuck" message on the stream queue with
    its size exactly 0 bytes but all the data there and thus nothing
    left in the uio structure. We then reach a stuck forever state
    never being able to send data.
2009-02-12 17:31:39 +00:00
Randall Stewart 6513931fbf MFC of 184030 - socket accept inherit bug. Basically
accepted sockets were not inheriting the proper
                sock buf size.
2009-02-12 17:26:16 +00:00
Randall Stewart 3577b1f323 Merges in 182268 from head close bug where we
failed to NULL the sctp_socket.
2009-02-12 16:40:48 +00:00
Olivier Houchard f41b8ce9e9 MFC:
r188424 | cognet | 2009-02-09 23:59:22 +0100 (Mon, 09 Feb 2009) | 6 lines

Hmm... "base? base : 0" and "base" should be equivalent.
2009-02-12 15:26:00 +00:00
John Baldwin c452e8f121 MFC: Drop the kernel linker lock while running SYSUNINIT routines and
removing sysctls during a linker file unload.
2009-02-12 14:41:23 +00:00
John Baldwin 508d25517c MFC: Add simple locking for the in-kernel iconv code. 2009-02-12 14:37:58 +00:00
Maxim Konovalov cfc60df778 MFC r186644: show unix sockets listen queues stats with -L flag. 2009-02-11 10:28:55 +00:00
Maksim Yevmenkin 8d74ab9244 MFC r183058
Add uuid_enc,dec_le,be() functions to Symbol.map
Pointy hat goes to me.

MFC r183192

Move uuid_enc_le, uuid_dec_le, uuid_enc_be and uuid_dec_be symbols
into FBSD_1.1 section where they should be (as Pointed out by: kib,
deischen)
2009-02-10 21:09:54 +00:00
Maksim Yevmenkin 4f461a8ecd MFC r185320
Straighten out those pesky SDP records for the Bluetooth
Service Discovery Application Profile.

Discussed with:	Iain Hibbert of NetBSD plunky at rya dash online dot net
2009-02-10 20:08:03 +00:00
Maksim Yevmenkin 52d67d30be MFC r182880$$
Add new TAPGIFNAME tap(4) character device ioctl. This is a
convenient shortcut to obtain network interface name using
file descriptor for character device.

Obtained from:	NetBSD
2009-02-10 20:04:20 +00:00
Maksim Yevmenkin 4a3f185a7b MFC r182881
Document TAPGIFNAME, TAPSIFINFO and TAPGIFINFO tap(4)
character device ioctl's.
2009-02-10 20:03:26 +00:00
Konstantin Belousov 94239e5cba MFC r187470:
Unconditionally reload fsbase when switching to 32bit binary.
2009-02-10 17:50:03 +00:00
Konstantin Belousov e52c70fc5b MFC r187468:
Revert vnode_pager_setsize() back when UFS_BALLOC() failed, for
ffs_truncate() and ffs_write().
2009-02-10 17:47:35 +00:00
Konstantin Belousov f333c5eb54 MFC r187467:
Change vinvalbuf() to not remove any pages from the object when
V_NORMAL or V_ALT are specified. Instead, the only in-tree caller
in ffs_inode.c:ffs_truncate() that specifies V_ALT explicitely
removes the corresponding page range. The V_NORMAL caller
does vnode_pager_setsize(vp, 0) immediately after the call to
vinvalbuf(V_NORMAL) already.

MFC r187490:
The r187467 should remove all pages for V_NORMAL case too, because
indirect block pages are not removed by the mentioned invocation of
the vnode_pager_setsize().

Put a common code into the helper function ffs_pages_remove().
2009-02-10 17:43:47 +00:00
Olivier Houchard 82043ec558 MFC r188112
r188112 | cognet | 2009-02-04 02:14:06 +0100 (Wed, 04 Feb 2009) | 8 lines

Erm... Report the buffer as being bounced even when it's the entire buffer,
or we would end up invalidating the cache line for what we just copied...
2009-02-09 22:21:38 +00:00
Maksim Yevmenkin 4e81567849 MFC r186466
Change message severity level from WARN to INFO. This should reduce
amount of messages sent to syslog
2009-02-09 17:53:45 +00:00
Maksim Yevmenkin 76d736af11 MFC r187454
Properly return error code to the caller. This should fix the following
panic in ng_l2cap(4).

panic: ng_l2cap_l2ca_con_req: ubt0l2cap - could not find connection!

While i'm here get rid of few goto's.
2009-02-09 17:50:19 +00:00
Maksim Yevmenkin cc7a3edd99 MFC r188030
Properly retun error core from kbdmux_modevent()

Reported by:	Christoph Mallon < christoph -dot- mallon -at- gmx -dot- de >
2009-02-09 17:14:49 +00:00
Konstantin Belousov d739e8c0f1 MFC r187715:
The kernel may do unbalanced calls to fifo_close() for fifo vnode,
without corresponding number of fifo_open(). This causes assertion
failure in fifo_close() due to vp->v_fifoinfo being NULL for kernel
with INVARIANTS, or NULL pointer dereference otherwise. In fact, we may
ignore excess calls to fifo_close() without bad consequences.

Turn KASSERT() into the return, and print warning for now.
2009-02-09 12:22:49 +00:00
Maxim Konovalov d7187cc6be MFC r187913: fix typo. 2009-02-09 10:28:16 +00:00
Pyun YongHyeon b913e6653d MFC r186884:
Always check whether dma map is valid before unloading the map.
  When fxp(4) intializes Rx buffers for the first time, there is no
  loaded dma map so attempting to unload it is an invalid operation.
2009-02-09 04:02:53 +00:00
Pyun YongHyeon 7c11bde1a9 MFC r186262:
It seems that we don't need to reserve a TBD to set total TCP
  payload length in TSO case. Leaving unused TBD also seem to cause
  SCB timeouts under certain conditions when TSO/non-TSO traffics
  are active at the same time.
2009-02-09 04:00:54 +00:00
Pyun YongHyeon e6a1a0312a MFC r185758:
mutex.h is needed here. It got it by namespace pollution.
2009-02-09 03:58:29 +00:00
Pyun YongHyeon 4d6623926c MFC r185540:
Add VLAN hardware tag insertion/stripping support. Tx/Rx checksum
  offload for VLAN frames are also supported. The VLAN hardware
  assistance is available only on 82550/82551 based controllers.
  While I'm here change the confusing name of bit1 in byte 22 of
  configuration block to vlan_drop_en. The bit controls whether
  hardware strips VLAN tagged frame or not. Special thanks to wpaul
  who sent valuable VLAN related information to me.
2009-02-09 03:55:51 +00:00
Pyun YongHyeon 731cd2161c MFC r185354,185538:
r185354:
  Add basic WOL support for 82550/82551/82558 and 82559 based
  controllers. ICH based controllers are treated as 82559. 82557,
  earlier revision of 82558 and 82559ER have no WOL capability.
   o WOL support requires help of a firmware so add check whether
     hardware is capable of handling magic frames by reading EEPROM.
   o Enable accepting WOL frames only when hardware is about to
     suspend or shutdown. Previously fxp(4) used to allow receipt of
     magic frame under normal operation mode which could cause
     hardware hang if magic frame is received by hardware. Datasheet
     clearly states driver should not allow WOL frames under normal
     operation mode.
   o Disable WOL frame reception in device attach so have fxp(4)
     immunize against system hang which can be triggered by magic
     packets when the hardware is not in fully initialized state.
   o Don't reset all hardware configuration data in fxp_stop()
     otherwise important configuration data is lost and this would
     reset WOL configuration to default state which in turn cause
     hardware hang on receipt of magic frames. To fix the issue,
     preserve hardware configuration data by issuing a selective
     reset.
   o Explicitly disable interrupts after issuing selective reset as
     reset may unmask interrupts.

 r185538:
  Make sure to clear PMDR register by writing back power management
  events. Just reading PMDR register was not enough to have fxp(4)
  immuninize against received magic packets during system boot.
2009-02-09 03:53:20 +00:00
Pyun YongHyeon eba3ac4cca MFC r185330:
Implement TSO for 82550/82551 controllers.
   o Configure controller to use dynamic TBD as TSO requires that
     operation mode.
   o Add a dummy TBD to tx_cb_u as TSO can access one more TBD in TSO
     operation.
   o Increase a DMA segment size to 4096 to hold a full IP segment
     with link layer header.
   o Unlike other TSO capable controllers, 82550/82551 does not
     modify the first IP packet in TSO operation so driver should
     create an IP packet with proper header. Subsequent IP packets
     are generated from the header information in the first IP packet
     header. Likewise pseudo checksum also should be computed by
     driver for the first packet.
   o TSO requires one more TBD to hold total TCP payload. To make
     code simple for TSO/non-TSO case, increase the index of the
     first available TBD array.
   o Remove KASSERT that checks the size of a DMA segment should be
     less than or equal to MCLBYTES as it's no longer valid in TSO.
   o Tx threshold and number of TBDs field is used to store MSS in
     TSO. So don't set the Tx threshold in TSO case.
2009-02-09 03:48:49 +00:00
Pyun YongHyeon 1ec60a3a0a MFC r185329:
Implement Rx checksum offload for 82559 or later controllers.
  82559 or later controllers added simple checksum calculation logic
  in RU. For backward compatibility the computed checksum is appended
  at the end of the data posted to Rx buffer. This type of simple
  checksum calculation support had been used on several vendors such
  as Sun HME/GEM, SysKonnect GENESIS and Marvell Yukon controllers.
  Because this type of checksum offload support requires parsing of
  received frame and pseudo checksum calculation with software
  routine it still consumes more CPU cycles than that of full-fledged
  checksum offload controller. But it's still better than software
  checksum calculation.
2009-02-09 03:46:15 +00:00
Pyun YongHyeon 6a970e9092 MFC r185328:
o Introduce a new function, fxp_new_rfabuf which allocates a new
     Rx buffer and loads DMA map. Also add a function
     fxp_discard_rfabuf that handles reusing Rx buffer/DMA map. With
     this change fxp_add_rfabuf just handles appending a new RFA to
     existing chain.
   o Initialize mbuf length in fxp_new_rfabuf.
   o Don't reset rnr and have fxp(4) handle received frames even if
     it couldn't allocate new Rx buffer. This will make fxp(4) reload
     updated RFA under rnr case. The rnr would still be reset to 0 if
     polling is active and fxp(4) processed number of allowed Rx
     events.
   o Update if_iqdrops if fxp(4) couldn't allocate Rx buffer.

  Previously fxp(4) used to try to reuse Rx buffer when new buffer
  allocation is failed. But fxp(4) didn't take into account loaded
  DMA map such that the same DMA map was loaded again without
  unloading the map. There is no reason to unload the loaded map and
  reload the same map again, just reusing the map is enough. I
  believe the spare DMA map in softc was introduced to implement this
  behaviour. Also fxp(4) used to stop Rx processing if once Rx buffer
  allocation or DMA map load fails which in turn resulted in losing
  incoming frames under heavy network load. With this change fxp(4)
  should survive from resource shortage condition.
2009-02-09 03:43:46 +00:00
Pyun YongHyeon 39288e9b4e MFC r185286:
Simplify Tx checksum offload configuration. Also clear CSUM_IP if
  we've computed IP checksum with software method.
2009-02-09 03:40:51 +00:00
Pyun YongHyeon e4c5f6ccbc MFC r185285:
- Allow fxp_encap() enqueue failed transmissions and set
    IFF_DRV_OACTIVE to note resource shortage to upper stack.
  - Don't count number of mbuf chains. Default 32 DMA segments for a
    frame is enough for most cases. If bus_dmamap_mbuf_sg fails use
    m_collapse(9) to collapse the mbuf chain instead of relying on
    expensive m_defrag(9).
  - Move bpf handling to fxp_start_body() which is supposed to be
    more appropriate place.
  - Always arm watchdog timer whenever a new Tx request is made.
    Previously fxp(4) used to arm watchdog timer only when
    FXP_CXINT_THRESH-th Tx request is made. Because fxp(4) does not
    rely on Tx interrupt to reclaim transmitted mbufs it's better to
    arm watchdog timer to detect potential lockups.
  - Add more aggresive Tx buffer reclaiming in fxp_start_body to make
    room for new Tx requests. Since fxp(4) does not request Tx
    completion interrupt for every frames it's necessary to clean
    TXCBs in advance to saturate link.
  - Make fxp(4) try to start more packets transmitting regardless of
    interrupt type in fxp_intr_body.
2009-02-09 03:38:01 +00:00
Pyun YongHyeon e918f7d082 MFC r185276
Move unarming watchdog timer and pending multicast configuration
  check to fxp_txeof(). While I'm here unarm watchdog timer only if
  there are no pending queued Tx requests.
  Previously the watchdog timer was unarmed whenever Tx interrupt is
  raised. This could be resulted in hiding root cause of watchdog
  timeouts.
2009-02-09 03:34:35 +00:00
Pyun YongHyeon d26cb19bdd MFC r185273
Fix Tx/Rx checksum offload ioctl handling and make Rx handler honor
  checksum offload configuration. Now checksum offload can be
  controlled by ifconfig(8).
  While I'm here add an additional check for interface capabilities
  before applying user's request.
2009-02-09 03:32:23 +00:00
Tim Kientzle 783491fd8b MFC r187704: Fix ARCHIVE_EXTRACT_SPARSE handling in libarchive.
Add a test to exercise this feature.
This should fix --sparse/-S support in tar.

Thanks to:      Daichi GOTO
2009-02-09 03:31:53 +00:00
Pyun YongHyeon d715c929ad MFC r185269,185271-185272
r185269:
  Whitespace fix.

 r185271:
  Sort head files and removed ununsed header file.

 r185272:
  Make fxp(4) build with FXP_IP_CSUM_WAR.
2009-02-09 03:28:57 +00:00
Pyun YongHyeon 6d915fdb9d MFC r177507(cvs if_fxp.c, 1.267):
Reuse the mbuf that was just retrieved from the receive ring if mbuf
  exhaustion is encountered. There was a fix made previously for this
  problem but the solution (breaking out of the receive loop) does not
  seem to work. mbuf reuse strategy is already adopted by other drivers
  such as if_bge.  The problem was recreated and the patch is also
  verified in the same test environment.
2009-02-09 03:23:00 +00:00
Pyun YongHyeon 51d229a98b MFC r187208:
Remove local jumbo locator and switch to UMA backed page allocator
  for jumbo frame.
    o Nuke unneeded jlist lock which was used to protect jumbo buffer
      management in local allocator.
    o Added a new tunable hw.mskc.jumbo_disable to disable jumbo
      frame support for the driver. The tunable could be set for
      systems that do not need to use jumbo frames and it would
      save (9K * number of Rx descriptors) bytes kernel memory.
    o Jumbo buffer allocation failure is no longer critical error
      for the operation of msk(4). If msk(4) encounter the allocation
      failure it just disables jumbo frame support and continues to
      work without your intervention.

  Using local allocator had several drawbacks such as requirement of
  large amount of continuous kernel memory and fixed (small) number
  of available buffers. The need for large continuous memory resulted
  in failure of loading driver with kldload on running systems.
  Also small number of buffer used in local allocator showed poor
  performance for some applications.
2009-02-09 02:15:25 +00:00
Pyun YongHyeon d9f2dde6f8 MFC r187207:
Correct frame length argument of in_cksum_skip. While I'm here
  remove intermediate variable csum.
2009-02-09 02:06:15 +00:00
Pyun YongHyeon 28a96119ad MFC r185244
Save the value read from TX queue CSR, so we don't test against a
  stale one.
2009-02-09 02:03:49 +00:00
Pyun YongHyeon 8ae0e96c45 MFC r183485-183486
r183485:
  Always pullup mbuf prior to accessing TCP header.
  This should fix occasional Tx checksum corruption issue.

 r183486:
  If mbuf is not writable get a writable copy before invoking
  m_pullup(9).
2009-02-09 02:00:43 +00:00
Pyun YongHyeon a4b011f87d MFC r183346
Add another hardware bug workaround for Yukon II controllers that
  have hardware ram buffer. The silicon bug seem to be triggered by
  pause frames if receive buffer is not aligned on FIFO word(8 bytes).
  To workaround the issue, make sure to align Rx buffers on 8 bytes.
  Unfortunately this workaround requires yet another Rx fixup for
  strict alignment architecture machines to align IP header.

  For newer hardwares that lacks ram buffer may not have this bug so
  check number of available ram buffer size to see the existence of
  ram buffer.
2009-02-09 01:55:30 +00:00
Pyun YongHyeon e115503049 MFC r186214,186389,187417
r186214:
  It seems that RealTek PCIe controllers require an explicit Tx poll
  command whenever Tx completion interrupt is raised. The Tx poll
  bit is cleared when all packets waiting to be transferred have been
  processed. This means the second Tx poll command can be silently
  ignored as the Tx poll bit could be still active while processing
  of previous Tx poll command is in progress.
  To address the issue re(4) used to invoke the Tx poll command in Tx
  completion handler whenever it detects there are pending packets in
  TxQ. However that still does not seem to completely eliminate
  watchdog timeouts seen on RealTek PCIe controllers. To fix the
  issue kick Tx poll command only after Tx completion interrupt is
  raised as this would indicate Tx is now idle state such that it can
  accept new Tx poll command again. While here apply this workaround
  for PCIe based controllers as other controllers does not seem to
  have this limitation.

 r186389:
  Since we don't request reset for rlphy(4), the link state 'UP'
  event from mii(4) may not be delivered if valid link was already
  established. To address the issue, check current link state after
  driving MII_TICK. This should fix a regression introduced in
  r185753 on fast ethernet controllers.

 r187417:
  Sometimes RTL8168B seems to take long time to access GMII registers
  in device attach phase. Double GMII register access timeout value
  to fix the issue.
2009-02-09 01:38:01 +00:00
Pyun YongHyeon d87336ba2b MFC r186210:
For RTL8168C SPIN2 controllers, make sure to take the controller
  out of sleep mode prior to accessing to PHY. This should fix device
  attach failure seen on these controllers. Also enable the sleep
  mode when device is put into sleep state.

  PR:	kern/123123, kern/123053
2009-02-09 01:30:14 +00:00
Pyun YongHyeon 03fbf00159 MFC: r185897,185900-185901,185903
r185897:
  Always put controller into known state before device intialization.
  While here remove re_reset calls invoked in system error case as
  controller reset is always done in device initialization.

 r185900:
  Newer RealTek controllers requires setting stop request bit to
  terminate active Tx/Rx operation.

 r185901:
  Don't access undocumented register 0x82 on controllers that
  have no such register. While here clear undocumented PHY
  register 0x0B for RTL8110S.

 r185903:
  Make WOL work on RTL8168B. This controller seems to require
  explicit command to enable Rx MAC prior to entering D3.
2009-02-09 01:26:31 +00:00
Pyun YongHyeon 42d59d692d MFC: r185752-185753,185756,185896
r185752:
  Make sure to return the result of meida change request.
  Previously it used to return success regardless of the result.

 r185753:
  o Implemented miibus_statchg handler. It detects whether re(4)
    established a valid link or not. In miibus_statchg handler add a
    check for established link is valid one for the controller(e.g.
    1000baseT is not a valid link for fastethernet controllers.)
  o Added a flag RE_FLAG_FASTETHER to mark fastethernet controllers.
  o Added additional check to know whether we've really encountered
    watchdog timeouts or missed Tx completion interrupts. This change
    may help to track down the cause of watchdog timeouts.
  o In interrupt handler, removed a check for link state change
    interrupt. Not all controllers have the bit and re(4) did not
    rely on the event for a long time. In addition, re(4) didn't
    request the interrupt in RL_IMR register.

 r185756:
  Reduce spin wait time consumed in GMII register access routines.
  Waiting for 1ms for each GMII register access looks overkill and it
  may also decrease overall performance of driver because re(4)
  invokes mii_tick for every hz.

 r185896:
  Partly revert r185756. RTL8169SC doesn't like reduced delays in
  GMII access while Tx/Rx is in progress.
2009-02-09 01:16:36 +00:00
Rui Paulo b141d27ca3 MFC 186529 (stas):
- Fix incorrect array declaration that was causing the stack overflow
	  on some (most?) Asus laptops.
2009-02-08 22:13:57 +00:00
Rui Paulo 9ac88aaa17 MFC r180268:
Fix my previous commit. We actually should pass evaluation args in
	AcpiEvaluateObject() calls, otherwise, we are not able to bring devices
	back up (NULL means 0, hence always off).
	While there add missing WLAN on/off support.
2009-02-08 22:09:49 +00:00
Rui Paulo 87073e40b8 Reverse botched r188326. 2009-02-08 22:01:20 +00:00
Rui Paulo d17786061a MFC r186529 (stas):
- Fix incorrect array declaration that was causing the stack overflow
	on some (most?) Asus laptops.
2009-02-08 20:00:36 +00:00
Rui Paulo 6ace2287a7 MFC r184625:
Add support for Asus A8Sr notebooks.

	PR:		128553
	Submitted by:	Eygene Ryabinkin <rea-fbsd at codelabs.ru>
2009-02-08 19:55:13 +00:00
Rui Paulo 0d1513c0c6 MFC r181885: Fix typo in comment. 2009-02-08 19:53:37 +00:00
Bjoern A. Zeeb 34c47cf633 "MFC": sys/conf/kern.pre.mk r180012 (out of the larger commit)
Without including bsd.own.mk KMODOWN/KMODGRP are not defined
  which after r188288 broke installkernel.

Reported by:	kib, Herbert J. Skuhra <[email protected]>
Reviewed by:	kib
Pointy hat to:	bz
2009-02-07 21:07:58 +00:00
Alan Cox fa7f727022 Recent changes to the kernel increasing the size of the kernel and kmem
maps on amd64 machines should trigger ZFS users to reevaluate their
manual tuning of the kmem map.
2009-02-07 15:51:21 +00:00
Bjoern A. Zeeb 3c3d37fdc3 MFC: r187668
Change IP addresses/prefixes to be from "Test-Net" (IPv4 documentation
  prefix 192.0.2.0/24) rather than from private-use networks.
2009-02-07 15:31:23 +00:00
Bjoern A. Zeeb babe5040e9 MFC: r186519
Permit digits in the kernel config file names for `make universe'.
  This catches a few more kernel config for various architectures
  and permits having local configs named like NOINET6.
2009-02-07 15:21:11 +00:00
Bjoern A. Zeeb 7c25b4813c MFC:
r186854
  Using KMODOWN/KMODGRP rather than hard coding root/wheel for
  installing the kernel allows one, like with modules, to override
  the default user/group and install as non-su to a temporary
  directory to test, create images or seed a tftp dir.

 r186894
  Document that we started using KMODOWN/KMODGRP for the kernel
  as well and no longer only for modules.
2009-02-07 14:55:29 +00:00
Bjoern A. Zeeb 29941b15d7 MFC: r187708
Update jail startup script for multi-IPv4/v6/no-IP jails.

  Note: this is only really necessary because of the ifconfig
        logic to add/remove the jail IPs upon start/stop.
        Consensus among simon and I is that the logic should
        really be factored out from the startup script and put
        into a proper management solution.

  - We now support starting of no-IP jails.
  - Implement jail_<jname>_ip options to support both
    address familes with regard to ifconfig logic.
  - Implement _multi<n> support suffix to the jail_<jname>_ip
    option to configure additional addresses to avoid overlong,
    unreadbale jail_<jname>_ip lines with lots of addresses.
2009-02-07 14:04:35 +00:00
Bjoern A. Zeeb e5440f43e6 MFC: r187684
For consistency with prison_{local,remote,check}_ipN rename
  prison_getipN to prison_get_ipN.
2009-02-07 13:55:12 +00:00
Bjoern A. Zeeb 61e3f18f2d MFC: r186948
Make SIOCGIFADDR and related, as well as SIOCGIFADDR_IN6 and related
  jail-aware. Up to now we returned the first address of the interface
  for SIOCGIFADDR w/o an ifr_addr in the query. This caused problems for
  programs querying for an address but running inside a jail, as the
  address returned usually did not belong to the jail.
  Like for v6, if there was an ifr_addr given on v4, you could probe
  for more addresses on the interfaces that you were not allowed to see
  from inside a jail. Return an error (EADDRNOTAVAIL) in that case
  now unless the address is on the given interface and valid for the
  jail.

  PR:		kern/114325
2009-02-07 13:51:15 +00:00
Bjoern A. Zeeb 1cb042f630 MFC:
r186956
  Take the cred from curthread rather than curproc as curproc would need
  locking but the credential from curthread (usually) never changes.

 r186980
  Restrict arp, ndp and theoretically the FIB listing (if not
  read with libkvm) to the addresses of a prison, when inside a
  jail.

  While touching RTM_GET in route_output(), consistently use
  curthread credentials rather than the creds from the socket
  there.

 r186986
  Rather than using the cred from curthread, take it from the thread
  referenced in the sysctl req argument.
2009-02-07 13:46:51 +00:00
Bjoern A. Zeeb cddea4afa2 Regen after jail support was merged in r188281
(--record-only MFC of r185436).
2009-02-07 13:27:01 +00:00
Bjoern A. Zeeb da0bebf915 MFC:
r185435:
  This enhances the current jail implementation to permit multiple
  addresses per jail. In addtion to IPv4, IPv6 is supported as well.
  Due to updated checks it is even possible to have jails without
  an IP address at all, which basically gives one a chroot with
  restricted process view, no networking,..

  SCTP support was updated and supports IPv6 in jails as well.

  Cpuset support permits jails to be bound to specific processor
  sets after creation.

  Jails can have an unrestricted (no duplicate protection, etc.) name
  in addition to the hostname. The jail name cannot be changed from
  within a jail and is considered to be used for management purposes
  or as audit-token in the future.

  DDB 'show jails' command was added to aid debugging.

  Proper compat support permits 32bit jail binaries to be used on 64bit
  systems to manage jails. Also backward compatibility was preserved where
  possible: for jail v1 syscalls, as well as with user space management
  utilities.

  Both jail as well as prison version were updated for the new features.
  A gap was intentionally left as the intermediate versions had been
  used by various patches floating around the last years.

  Bump __FreeBSD_version for the afore mentioned and in kernel changes.

 r185441:
  Unbreak the no-networks (no INET/6) build.

 r185899:
  Correctly check the number of prison states to not access anything
  outside the prison_states array.
  When checking if there is a name configured for the prison, check the
  first character to not be '\0' instead of checking if the char array
  is present, which it always is. Note, that this is different for the
  *jailname in the syscall.

  Found with:	Coverity Prevent(tm)
  CID:		4156, 4155

 r186085:
  Make sure that the direct jls invocations prints something
  reasonable close to and in the same format as it had always.

 r186606:
  Make sure that unused j->ip[46] are cleared.

 r186834:
  Document the special loopback address behaviour of jails.

  PR:		kern/103464

 r186841:
  Put the devfs ruleset next to devfs enable, add a comment about
  the suggested ruleset[1].

  While here use an IP from the 'test-net' prefix for docs.

  PR:		kern/130102

 r187059:
  Add a short section talking about jails and file systems; mention the
  mountand jail-aware file systems as well as quota.

  PR:		kern/68192

 r187092:
  Sort .Xr.

 r187365:
  s,unmount 8,umount 8, it is unmount(2) which I did not mean.

 r187669:
  Update the description of the '-h' option wrt to primary addresses
  per address family and add a reference to the ip-addresses option.

 r187670:
  New sentence starts on a new line.
2009-02-07 13:19:08 +00:00
Robert Watson 75b76418f2 Merge r188006 from head to stable/7:
Alow dirname(1) to accept multiple arguments in the same way that
  basename(1) does.

  (Two different PRs contained identical patches, both cited below)

  PR:           121520, 86148
  Submitted by: Ighighi <ighighi at gmail dot com>
  Submitted by: Leif Neland <leif at neland dot dk>
2009-02-07 11:27:35 +00:00
Robert Watson f5443e972f Merge r187814, r187820 from head to stable/7:
Add a new flag to dumpfs(8), -f, which causes dumpfs to list all free
  fragments in the file system by fragment (block) number.  This new
  mode does the necessary arithmetic to generate absolute fragment
  numbers rather than than the cg-relative numbers printed in the default
  mode.

  If -f is passed once, contiguous fragment ranges are collapsed into
  an X-Y format as free block lists are currently printed in regular
  dumpfs output, but if specified twice, all block numbers are printed
  individually, allowing both compact and more script-friendly
  representation.

  This proves quite handy when attempting to recover deleted data, as it
  allows exclusion of non-deleted data from blocks searched.

  Discussed with:       jeff, Richard Clayton <richard dot clayton at cl.cam.ac.uk>
  Sponsored by: Google, Inc.

  Print disk offets as %jd rather than %lld; I fixed one before committing
  but missed the other, which breaks 64-bit builds.

  Reported by:  bf <bf2006a at yahoo dot com>

Reviewed by:	mckusick
2009-02-07 11:15:53 +00:00
Bjoern A. Zeeb 4597d40963 MFC: r185404
With the permissions of phk@ change the license on kern_jail.c
  to a 2 clause BSD license.
2009-02-07 10:29:07 +00:00
Bjoern A. Zeeb efe13373be MFC:
r183571:
   Implement IPv4 source address selection for unbound sockets.

   This also changes the semantics of selecting the IP for processes within
   a jail as it now uses the same logic as outside the jail (with additional
   checks) but no longer is on a mutually exclusive code path.

 r186086:
   With the special check for FreeBSD before 8 a destination route via
   a loopback interface is treated as a valid and reachable thing for
   IPv4 source address selection, even though nothing of that network
   is ever directly reachable, but it is more like a blackhole route.

   With this the source address will be selected and IPsec can grab the
   packets before we would discard them at a later point, encapsulate them
   and send them out from a different tunnel endpoint IP.

   This is needed to not change the expected behaviour on a stable branch.
2009-02-07 10:17:29 +00:00
Andrew Thompson 6a3d5483b0 MFC r173522, r176910, r178975
-  Add private tx/rx buffer management to support large frame sizes and update
   the rx code to handle multiple frames in a single usb transfer.  AX772 parts
   (at least) exhibit many input errors when operated with a 2K rx buffer and
   no errors w/ a 4K rx buffer (it's unclear what the cause of the errors is
   for 2K so this may just be covering up the real issue).  Larger rx buffer
   sizes show no significant performance improvement for AX772.  Bypassing the
   common buffer management routines also eliminates an extra context switch on
   every packet which noticeably improves performance (TCP netperf rx goes from
   45 Mb/s to 85 MB/s).

-  Apply le*toh() or htole*() to the variables of which we use the address as
   the buffer pointer in the call to axe_cmd(). This is needed to make the code
   work on big-endian machines.

-  Add support for the Apple USB Ethernet adapter.  Work around the "latch in
   at the first working PHY address hack", that fails for this adapter because
   it returns 0xffff when reading from lower PHY addresses. Also add more
   debugging printfs
2009-02-07 01:43:04 +00:00
Robert Watson 2caa01811d Merge r187667 from head to stable/7:
Use __FBSDID() for $FreeBSD$ version strings in .c files.

  Obtained from:        TrustedBSD Project
2009-02-07 00:05:10 +00:00
Robert Watson 39c14fed59 Merge r186684 from head to stable/7:
White space and comment tweaks.
2009-02-06 23:56:02 +00:00
Thomas Abthorpe e4a2c8d197 - MFC the portindex(5) manual page
PR:		docs/70652
Approved by:	trhodes
2009-02-06 17:19:02 +00:00
John Baldwin 9558715865 MFC: Push down Giant in the vlnru kproc main loop so that it is only acquired
around calls to vlrureclaim() on non-MPSAFE filesystems.
2009-02-06 16:05:00 +00:00
John Baldwin a6d1e52c1a MFC: Only start the if_slowtimo timer if it is needed. 2009-02-06 15:28:08 +00:00
Robert Watson 69c92aeacf Merge r187790 from head to stable/7:
Following a fair amount of real world experience with ACLs and
  extended attributes since FreeBSD 5, make the following semantic
  changes:

  - Don't update the inode modification time (mtime) when extended
    attributes (and hence also ACLs) are added, modified, or removed.
  - Don't update the inode access tie (atime) when extended attributes
    (and hence also ACLs) are queried.

  This means that rsync (and related tools) won't improperly think
  that the data in the file has changed when only the ACL has changed.

  Note that ffs_reallocblks() has not been changed to not update on an
  IO_EXT transaction, but currently EAs don't use the cluster write
  routines so this shouldn't be a problem.  If EAs grow support for
  clustering, then VOP_REALLOCBLKS() will need to grow a flag argument
  to carry down IO_EXT to UFS.

  PR:             ports/125739
  Reported by:    Alexander Zagrebin <[email protected]>
  Tested by:      pluknet <[email protected]>,
                  Greg Byshenk <[email protected]>
  Discussed with: kib, kientzle, timur, Alexander Bokovoy <[email protected]>
2009-02-06 12:39:42 +00:00
Robert Watson 59985c941a Merge r187881 from head to stable/7:
If a process is a zombie and we couldn't identify another useful state,
  print out the state as "zombine" in preference to "unknown" when ^T is
  pressed.

  Sponsored by: Google, Inc.

(Note that this change appears in tty.c in 7.x vs tty_info.c in 8.x)
2009-02-06 12:33:39 +00:00
Robert Watson e29d0bcd8f Merge r186603 from head to stabl/7:
Rename mbcnt to mbcnt_delta in uipc_send() -- unlike other local
  variables named mbcnt in uipc_usrreq.c, this instance is a delta
  rather than a cache of sb_mbcnt.
2009-02-06 12:27:25 +00:00
Robert Watson 7e6cf425b6 Merge r184488 from head to stable/7:
Break out single audit_pipe_mtx into two types of locks: a global rwlock
  protecting the list of audit pipes, and a per-pipe mutex protecting the
  queue.

  Likewise, replace the single global condition variable used to signal
  delivery of a record to one or more pipes, and add a per-pipe condition
  variable to avoid spurious wakeups when event subscriptions differ
  across multiple pipes.

  This slightly increases the cost of delivering to audit pipes, but should
  reduce lock contention in the presence of multiple readers as only the
  per-pipe lock is required to read from a pipe, as well as avoid
  overheading when different pipes are used in different ways.

  Sponsored by: Apple, Inc.
2009-02-06 12:24:30 +00:00
Robert Watson 9d02be018d Merge r184489 from head to stable/7:
When we drop an audit record going to and audit pipe because the audit
  pipe has overflowed, drop the newest, rather than oldest, record.  This
  makes overflow drop behavior consistent with memory allocation failure
  leading to drop, avoids touching the consumer end of the queue from a
  producer, and lowers the CPU overhead of dropping a record by dropping
  before memory allocation and copying.

  Obtained from:        Apple, Inc.
2009-02-06 12:22:00 +00:00
Robert Watson 7280c9ddce Merge r185928 from head to stable/7:
Add missing "goto set_head" for SO_IPX_CHECKSUM; otherwise we fall through
  to the SO_HEADERS_ON_OUTPUT case and set that instead.

  Found with:   Coverity Prevent(tm)
  Coverity ID:  3988
2009-02-06 12:20:08 +00:00
Robert Watson bf94566892 Merge r185293 from head to stable/7:
Regularize /* FALLTHROUGH */ comments in the BSM event type switch, and
  add one that was missing.

  Coverity ID:  3960
2009-02-06 12:14:57 +00:00
Robert Watson 14cfdf4369 Merge r184948 from head to stable/7:
When repeatedly accessing a thread credential, cache the credential
  pointer in a local thread.  While this is unlikely to significantly
  improve performance given modern compiler behavior, it makes the code
  more readable and reduces diffs to the Mac OS X version of the same
  code (which stores things in creds in the same way, but where the
  cred for a thread is reached quite differently).

  Discussed with: sson
  Sponsored by:   Apple Inc.
  Obtained from:        TrustedBSD Project
2009-02-06 12:10:28 +00:00
Robert Watson f4a6858ea6 Merge r184482 from head to stable/7:
Protect the event->class lookup database using an rwlock instead of a
  mutex, as it's rarely changed but frequently accessed read-only from
  multiple threads, so a potentially significant source of contention.

  Sponsored by: Apple, Inc.
2009-02-06 12:06:39 +00:00
Robert Watson 8b9e10620e Merge r184904 from head to stable/7:
The audit queue limit variables are size_t, so use size_t for the audit
  queue length variables as well, avoiding storing the limit in a larger
  type than the length.

  Submitted by: sson
  Sponsored by: Apple Inc.
2009-02-06 11:03:51 +00:00
Ulf Lilleengen 0a7090c3cf MFC r188017:
- Use a separate pointer to the allocated memory for freeing, as strsep may
  modify the pointer argument passed to it. This triggered an assert in malloc
  when a geom command being run under the livefs environment.

PR:		bin/130632
Submitted by:	Dimitry Andric <dimitry -at- andric.com>
2009-02-04 17:35:21 +00:00
Alexander Motin 3a5f8d6f9f MFC rev. 187445, 187721, 187944
Add two more nVidia HDMI codec IDs.

Specify analog beep pin widget for several AD codecs.
It gives working speaker control for that systems.

Fix bug in hint.hdac.X.config parsing.
2009-02-04 15:02:57 +00:00
Gabor Kovesdan 0856eca19c MFC:
Reflect adding_user.8 -> adding_user.7 rename
2009-02-03 20:47:58 +00:00
Gabor Kovesdan 522544df8a MFC: r187916
- Rename adding_user(8) to adding_user(7). There's no adding_user utility,
    but the man page describes conceptual information about the process of
    adding a user, thus it should belong to section 7.
  - Remove HISTORY and BUGS sections because of the aforementioned reason.

PR:		docs/130151
Submitted by:	Marian Cerny <[email protected]>
2009-02-03 14:30:59 +00:00
Gabor Kovesdan 5236acf2ef MFC: r187920
- Remove non-existing reference
  - Fix trailing comma

PR:		docs/85118
Submitted by:	vs
2009-02-03 14:25:58 +00:00
Diomidis Spinellis e3f494b7f5 MFC r184342 from head to stable/7
Add fallback when mmap fails on regular files.  Some filesystems,
like smbnetfs, do not support mmap.

Reported by:	Harti Brandt
2009-02-03 13:07:34 +00:00
Diomidis Spinellis 76f8ee0f4c MFC 184854 from head to stable/7
Fix the code to conform to the "or more" part of the following POSIX
specification and regression test regress:25.

    "A function can be preceded by one or more '!' characters, in which
    case the function shall be applied if the addresses do not select
    the pattern space."
2009-02-03 12:56:05 +00:00
Giorgos Keramidas 8eeab2c0ab MFC 187935 from /head
Sometimes, depending on the bpf filter rules used in $PATTERN,
the example script of the manpage feeds awk(1) with values larger
than UINT32_MAX.  Then awk prints a negative value, and this
messes up $BPFPROG.  Trying to load the resulting bpf byte codes
with ngctl then fails.

For example, the output for PATTERN="udp and dst net 255.255.0.0/16"
should be (all in one line):

    bpf_prog_len=10
    bpf_prog=[
      { code=40 jt=0 jf=0 k=12 }
      { code=21 jt=7 jf=0 k=34525 }
      { code=21 jt=0 jf=6 k=2048 }
      { code=48 jt=0 jf=0 k=23 }
      { code=21 jt=0 jf=4 k=17 }
      { code=32 jt=0 jf=0 k=30 }
      { code=84 jt=0 jf=0 k=4294901760 }
      { code=21 jt=0 jf=1 k=4294901760 }
      { code=6 jt=0 jf=0 k=8192 }
      { code=6 jt=0 jf=0 k=0 }
    ]

The two k=4294901760 values are displayed as k=-2147483648 by awk.

Replace the awk script of the manpage example with a slower but
safer version, that doesn't really attempt to convert the byte
code printed by tcpdump from string to number and back.

PR:           docs/123255
Submitted by: Eugenio Maffione, eugenio.maffione at telecomitalia.it
2009-02-02 04:57:36 +00:00
Giorgos Keramidas c1a7f5b779 MFC 187375 from /head
Add support for CMedia CMI120.

PR:           kern/123640
Approved by:  ariff
2009-02-02 04:48:32 +00:00
Robert Watson 19729fe208 Merge r186717 from head to stable/7:
Allow the IP_MINTTL socket option to be set to 0 so that it can be
   disabled entirely, which is its default state before set to a
   non-zero value.

   PR:          128790
   Submitted by:        Nick Hilliard <nick at foobar dot org>
2009-02-01 19:20:45 +00:00
Alexander Motin 44db51a683 MFC rev. 187387
Remove strict limitation on minimal multilink MRRU. RFC claims that MRRU
  of 1500 must be supported, but allows smaller values to be negotiated.
  Enforce specified MRRU for outgoing frames.
2009-02-01 10:13:18 +00:00
Alexander Motin 38d34b673a MFC rev. 187495
Check for infinite recursion possible on some broken PPTP/L2TP/... VPN setups.
Mark packets with mbuf_tag on first interface passage and drop on second.

PR:		ports/129625, ports/125303
2009-01-31 12:48:09 +00:00
Alexander Motin 915c2a84f8 MFC rev. 187410
If source mbuf chain consists of only one mbuf, use it directly as source
buffer to avoid extra copying.
2009-01-31 12:44:20 +00:00
Alexander Motin 6105cc44b2 MFC rev. 187405
Use m_unshare()+m_copyback() instead of m_freem()+m_devget() to keep
original mbuf chain headers. It can be less efficient in some cases, but it
looks better then mess of copying headers into the nonempty chain.
2009-01-31 12:41:44 +00:00
Alexander Motin 0fd20ef5d2 MFC rev. 187409
Teach m_copyback() to use trailing space of the last mbuf in chain.
2009-01-31 12:32:18 +00:00
Alexander Motin 41f8c3d10f MFC rev. 187368
Convert battery capacity/rate from mA to mW only when summary is requested.
  Unconditional conversion causes incorrect rate units reported by acpiconf.
2009-01-31 12:26:06 +00:00
Weongyo Jeong 2817a14990 MFC r186919:
fix a typo to set the 48Mbps data rate.

  PR:		kern/130189
  Submitted by:	Paul B. Mahol <onemda_at_gmail.com>
  Reviewed by:	sam
  MFC after:	3 weeks
2009-01-31 05:22:11 +00:00
Giorgos Keramidas 9b6321ea38 MFC 175288 and 180208 from /head
: r175288 | keramida | 2008-01-13 10:33:20 +0200 (Sun, 13 Jan 2008) | 4 lines
:
: Add a new set of regression tests, for the tr(1) utility.
:
: Approved by:    das, dds

: r180208 | peter | 2008-07-03 06:50:17 +0300 (Thu, 03 Jul 2008) | 3 lines
:
: Set magic fbsd:nokeywords property that allows files to bypass
: keyword expansion. (file-specific replacement for CVSROOT/exclude)
2009-01-30 17:26:15 +00:00
Giorgos Keramidas a0d037bc73 MFC 187922,187609 from /head
Add an example of using bs=2048 to duplicate data CD-ROMs.

  This should be a bit useful for users who look at the manpage and
  then try to copy data CD-ROM disks using dd.  A lot of us know
  that bs=2048 is required, but it still manages to cause a bit of
  grief to those who haven't heard about it.

  PR:             bin/130857
  Submitted by:   Tri Brotoharsono < mail at tribrotoharsono.net >
2009-01-30 16:28:32 +00:00
John Baldwin 80a5b409d2 Merge all the changes in HEAD prior to the generic tracing changes. 2009-01-29 18:33:46 +00:00
Konstantin Belousov e8b10b2a05 MFC r183071:
Garbage-collect vn_write_suspend_wait().
2009-01-29 11:38:28 +00:00
Konstantin Belousov 9f1678c2ec MFC r183067:
The struct inode *ip supplied to softdep_freefile is not neccessary the
inode having number ino. In r170991, the ip was marked IN_MODIFIED, that
is not quite correct.

Mark only the right inode modified by checking inode number.
2009-01-29 11:21:15 +00:00
Konstantin Belousov 6658896f69 MFC r186565:
When the insmntque() in the pfs_vncache_alloc() fails, vop_reclaim calls
pfs_vncache_free() that removes pvd from the list, while it is not yet
put on the list.

Prevent the invalid removal from the list by clearing pvd_next and
pvd_prev for the newly allocated pvd, and only move pfs_vncache list
head when the pvd was at the head.
2009-01-29 11:17:11 +00:00
Konstantin Belousov 37a087edb5 MFC r186563:
vm_map_lock_read() does not increment map->timestamp, so we should
compare map->timestamp with saved timestamp after map read lock is
reacquired, not with saved timestamp + 1. The only consequence of the +1
was unconditional lookup of the next map entry, though.
2009-01-29 11:13:03 +00:00
Konstantin Belousov 64299e82d8 MFC r186561:
Drop the pseudofs vnode lock around call to pfs_read handler.
2009-01-29 11:08:56 +00:00
Konstantin Belousov 31dc962410 MFC r186560:
After the pfs_vncache_mutex is dropped, another thread may attempt to
do pfs_vncache_alloc() for the same pfs_node and pid. In this case, we
could end up with two vnodes for the pair. Recheck the cache under the
locked pfs_vncache_mutex after all sleeping operations are done.

Do not call free() on the struct pfs_vdata after insmntque() failure,
because vp->v_data points to the structure, and pseudofs_reclaim()
frees it by the call to pfs_vncache_free().

MFC r186981 (by marcus):
vput the vnode.
2009-01-29 11:03:57 +00:00
Konstantin Belousov eb972e790c MFC r186898:
Lock the uepm_lock around the autostart of extattrs.
2009-01-29 10:49:21 +00:00
Edwin Groothuis 957522820e MFC of tzdata2009a
- Asia/Katmandu -> Asia/Kathmandu
- Fix historical references to DST in Switzerland
- Correct rules for America/Resolute (Nunavut)
- Cuba didn't have DST in 2005.
2009-01-29 10:46:50 +00:00
Konstantin Belousov edc2e9a6f1 MFC r186896:
Do not call namei() while having another user-controlled vnode
locked. Lookup could attempt to recursively lock that vnode.

Do not call vn_start_write(V_WAIT) while vnode is locked, this may
result in a deadlock with suspension.

vfs_busy() the mountpoint before dropping vnode lock for vnode
that was used to look up the mountpoint, to prevent unmount in
between.
2009-01-29 10:40:47 +00:00
Konstantin Belousov 290d36800c MFC r186601:
Clear the pointers to the file in the struct filedesc before file is closed
in fdfree. Otherwise, sysctl_kern_proc_filedesc may dereference stale
struct file * values.
2009-01-29 10:33:32 +00:00
David Schultz 8509795fce MFC r186886:
Fix the types of INFINITY and NAN, which were broken in r131851. They
  should both be floats, not doubles.

  PR:		127795
2009-01-28 05:18:21 +00:00
David Schultz 5c1840ee05 MFC r186887:
Set the error indicator on an attempt to write to a read-only stream.

  PR:		127335
2009-01-28 05:07:16 +00:00
John Baldwin 718e976150 MFC: Add a comment explaining why the "bufwait" / "dirhash" LOR reported by
WITNESS will not actually result in a deadlock.
2009-01-27 16:25:45 +00:00
Xin LI 01b3764e29 MFC r187501 + r187748:
Rename option 'C' to 'D' (damaged).
2009-01-27 00:31:25 +00:00
Doug White d76d73aa5f Fix hostap power-save station support by always initializing the TIM
bitmaps. Prior to this change, hostap would queue packets for power-saved
stations but not indicate in the beacon that the station should wake up
and poll for those queued packets.

Reviewed by:	sam
2009-01-26 20:24:04 +00:00
John Baldwin d6b8184070 MFC: Use the correct type for the timeout parameter to the 32-bit
compat version aio_waitcomplete().
2009-01-26 15:39:42 +00:00
Thomas Abthorpe 2d788fb2a0 MFC of r187573:
Document targets run-depends-list and build-depends-list

Approved by:	keramida
2009-01-26 13:56:23 +00:00
Antoine Brodin 85d166b776 MFC r181349 to stable/7:
Make atacontrol(8) rebuild work when /usr is not mounted or from /rescue

  PR:             bin/125680
  MFC after:      1 month
  Tested by:      Stef Walter
2009-01-25 19:35:23 +00:00
Ed Schouten 92705bfa4c MFC r186747 to releng/7:
Remove Giant locking from domains list.

  During boot, the domain list is locked with Giant. It is not possible to
  register any protocols after the system has booted, so the lock is only
  used to protect insertion of entries.

  There is already a mutex in uipc_domain.c called dom_mtx. Use this mutex
  to lock the list, instead of using Giant. It won't matter anything with
  respect to performance, but we'll never get rid of Giant if we don't
  remove from places where we don't need it.

  Approved by:  rwatson
  MFC after:    3 weeks
2009-01-25 16:59:29 +00:00
Antoine Brodin b35369967e MFC r182047 to stable/7:
Remove unused variable nosleepwithlocks.

  PR:             126609
  Submitted by:   Mateusz Guzik
  MFC after:      1 month
  X-MFC:          to stable/7 only, this variable is still used in stable/6
Reviewed by:	rwatson
2009-01-24 19:22:05 +00:00
Antoine Brodin 68d900a33d MFC r181137 to stable/7:
Remove trailing ';' in BPFD_LOCK_ASSERT macro.

  MFC after:      1 month
  X-MFC-to:       stable/7, stable/6 has it right
2009-01-24 18:57:22 +00:00
Giorgos Keramidas dac44f009b MFC 187148 from /head
Clean up a bit of confusing language and improve .Nd.

PR:	47818
2009-01-23 12:01:24 +00:00
Giorgos Keramidas c01fa532b6 MFC 179603 and 179636 from /head
Add a -w warning flag to ln(1).  When the -w option is enabled,
  ln(1) checks to see if the source of a symlink, i.e. the file it
  should point to actually exists.  The default is the old ln
  behavior, that does not check, to avoid surprising people who may
  be using ln(1) in scripts or other non-interactive places.

  PR:             bin/7265
  Submitted by:   Joel Ray Holveck, detlev!joelh at mail.camalott.com
2009-01-23 11:58:24 +00:00
Giorgos Keramidas f861ba3fbc MFC 173702 from /head
Express in the usage() and SYNOPSIS that -F depends on -s, and
  that -f and -i are exclusive.

This reduces diffs of stable/7 from /head, in preparation for more MFCs.
2009-01-23 11:54:31 +00:00
Maxim Konovalov 298c574add MFC r183616 manually: fix typoes. Fix one more typo there is no
in HEAD.
2009-01-23 08:33:15 +00:00
Maxim Konovalov 76fc8ad224 MFC r177259: add missing .El. 2009-01-23 08:12:50 +00:00
Bjoern A. Zeeb 1538b2102a MFC: r185898
Add 32-bit compat support for AIO.

  As I had comitted this as a fix for r185878 in HEAD, it seems
  this was missed with the MFC at r187559. Unbreak the build.
2009-01-22 23:34:55 +00:00
Jens Schweikhardt 3057c71ee9 MFC: Correct typo.
PR:		docs/129820
Submitted by:	Marius Korsmo <marius AT korsmo DOT org>
2009-01-22 18:43:46 +00:00
Nick Hibma 55bf782ef3 MFC the IDs for the u3g MFC across.
This fixes the build breakage introduced by me yesterday evening.
2009-01-22 15:52:13 +00:00
Maxim Konovalov bbfd143894 MFC r187134: respect -ss flags for icmp6 "histogram of error messages"
section.
2009-01-22 09:39:11 +00:00
Nick Hibma deda24696a Sync this file with HEAD r183874.
- Remove a redundant MOD_LOAD function
- Reduce the attach priority for the attach function to give other
  drivers, like the to be committed u3g driver a better chance at
  attaching to the 3G devices with a ZeroCD / TruInstall mass storage
  device.
2009-01-21 23:10:43 +00:00
Jung-uk Kim 9729829e97 MFC: Make sure legacy replacement route is turned off when enbling HPET. 2009-01-21 21:31:44 +00:00
Jung-uk Kim af6896e026 MFC: Set tsc_is_invariant for some known AMD CPUs even if BIOS does not
advertise it.
2009-01-21 21:28:21 +00:00
Jung-uk Kim df5a606879 MFC: Do not use PowerNow! if FID or VID is missing. 2009-01-21 21:01:02 +00:00
Jung-uk Kim dc2688757a MFC: Use power management information for AMD CPUs from identcpu.c. 2009-01-21 20:57:54 +00:00
Jung-uk Kim f976241d35 MFC: Turn off CPU frequency change notifiers when the TSC is P-state
invariant or it is forced by setting 'kern.timecounter.invariant_tsc'
tunable to non-zero.
2009-01-21 20:53:36 +00:00
Jung-uk Kim 5a9c4ac408 MFC: Detect Advanced Power Management Information for AMD CPUs. 2009-01-21 20:16:11 +00:00
John Baldwin c254fd1e8e Regen. 2009-01-21 20:05:12 +00:00
John Baldwin 84beda8417 MFC: Add a new KTR tracepoint in the KTR_CALLOUT class to note when a
callout routine finishes executing.
2009-01-21 18:54:35 +00:00
John Baldwin 5a9e039eb9 MFC: Add 32-bit compat system calls for VFS_AIO. 2009-01-21 18:52:33 +00:00
John Baldwin 642207874a MFC: Use ints and a pointer to represent the spare fields used by the old
sigevent structure rather than using a char array with explicit knowledge
about padding.
2009-01-21 18:38:12 +00:00
John Baldwin e8e18e707e MFC: Reorder modules during initialization to ensure that MOD_QUIESCE
and MOD_UNLOAD events are posted to kernel modules in the reverse order
of MOD_LOAD events.
2009-01-21 18:35:48 +00:00
John Baldwin 5a220951f2 MFC: Invoke MOD_QUIESCE on all modules in a linker file (kld) before
unloading any modules.
2009-01-21 18:32:43 +00:00
John Baldwin 13067dd73e MFC: Don't leak a reference on the /compat/linux vnode everytime
the linprocfs 'mtab' file is read.
2009-01-21 18:26:10 +00:00
Jung-uk Kim 89a85b44c7 MFC: r184976
- Revive fdc(4) per-device flag 0x10, which was removed in r1.284[1].
- If the flag is set and auto-select fails, assume disk is not present.
- Set disk empty flag only when the floppy controller reset is needed.
It fixes regression introduced in r1.311, which prevented it from ignoring
errors.  Now fdformat(1) and dd(1) with conv=noerror option can continue
when read/write errors occur as they should.
- Do not retry disk probing as it is extremely slow and pointless.
- Move the disk probing code into a separate function.
- Do not reset disk empty flag if write-protect check fails somehow.

PR:		kern/116538[1]
2009-01-21 17:32:26 +00:00
Nick Hibma 281fd86d44 Couple of pointy hats to me, please. Not only did I make an unnecessary
commit, I actually managed to screw up the revert as well.

Submitted by:	quite a few people...
2009-01-21 17:23:06 +00:00
John Baldwin 28b046b608 MFC: Fix the maximum transfer size for mfi(4) disk devices to not exceed
the maximum number of scatter/gather elements supported in the bus dma tag.
2009-01-21 17:13:31 +00:00
Jung-uk Kim e4aa96e89b MFC: Add support for AMD64 Family 10h processors.
PR:		kern/128331
2009-01-21 17:07:46 +00:00
John Baldwin 1f1acca3c7 MFC: Add support for installing 32-bit system calls from kernel modules. 2009-01-21 16:14:43 +00:00
Konstantin Belousov 1a037be619 MFC r183211:
Initialize birthtime fields in vn_stat() to prevent stat(2) from
returning uninitialized birthtime. Most file systems don't initialize
birthtime properly in their VOP_GETTATTR().

MFC r183212:
Initialize va_flags and va_filerev properly in VOP_GETATTR(). Don't
initialize va_vaflags and va_spare because they are not part of the
VOP_GETATTR() API. Also don't initialize birthtime to ctime or zero.

MFC rr183213:
Initialize va_rdev to NODEV and va_fsid to VNOVAL before the
VOP_GETATTR() call in vn_stat(). Thus if a file system doesn't
initialize those fields in VOP_GETATTR() they will have a sane default
value.

MFC r183214:
Initialize va_rdev to NODEV instead of 0 or VNOVAL in VOP_GETATTR().
NODEV is more appropriate when va_rdev doesn't have a meaningful value.

MFC r183215:
fdescfs, devfs, mqueuefs, nfs, portalfs, pseudofs, tmpfs and xfs
initialize the vattr structure in VOP_GETATTR() with VATTR_NULL(),
vattr_null() or by zeroing it. Remove these to allow preinitialization
of fields work in vn_stat(). This is needed to get birthtime initialized
correctly.
2009-01-21 15:51:15 +00:00
John Baldwin 4c1a6dc1be MFC: Use existing GDB routines for parsing the section table of klds in
the 'add-kld' command.
2009-01-21 15:19:38 +00:00
Konstantin Belousov b775ba46ca MFC r185170. r185556:
Busy ufs filesystem around block of code that does ".." lookup.
Do not lock vnode interlock around reading of v_iflag to check VI_DOOMED.
2009-01-21 15:06:53 +00:00
John Baldwin 5c7f0d6a9c MFC: If we are unable to obtain a frequency list from either ACPI or the
static tables, then attempt to build a simple list containing just the high
and low frequencies if the hw.est.msr_info tunable is set to 1.  By default
this is disabled.
2009-01-21 15:01:36 +00:00
Alan Cox bd35057de5 MFC rev 175325
Make pmap_is_prefaultable() more TLB friendly.  Specifically, make it use
  the kernel's direct map instead of the pmap's recursive mapping to access
  the lowest level in the page table.
2009-01-21 07:41:24 +00:00
Alan Cox 4e2075ce7e MFC rev 180846
Style fixes to several function definitions.
2009-01-21 07:33:18 +00:00
Alan Cox 0d27c46dea MFC rev 177851
Optimize pmap_pml4e() and pmap_pdpe() based upon two observations: The
  given pmap is never NULL, and therefore pmap_pml4e() can never return
  NULL.  The pervasive use of these inline functions throughout the pmap
  makes these simple changes worthwhile.
2009-01-21 06:32:32 +00:00
Xin LI bd8c83643c MFC r185036:
Obey signedness flag in %z case.
2009-01-21 00:26:45 +00:00
Xin LI ddca57d97e MFC r185037:
Obey signedness flag in %z case.
2009-01-20 22:37:56 +00:00
Ed Maste 3c75ae41e2 MFC r181693:
Fix REDZONE(9) on amd64 and perhaps other 64 bit targets -- ensure the
  space that redzone adds to the allocation for storing its metadata is at
  least as large as the metadata that it will store there.

PR:     kern/128744
2009-01-20 22:34:38 +00:00
Alan Cox 64cbb4bc48 MFC rev 180600
Simplify pmap_extract()'s control flow, making it more like the related
  functions pmap_extract_and_hold() and pmap_kextract().
2009-01-20 20:41:41 +00:00
Nick Hibma fefa229e3d revert my previous commit. It was in error. I got primed by a few other
similar typos in man-pages.

Submitted by:	jhb
2009-01-20 20:32:48 +00:00
John Baldwin 9e657a6586 MFC: Stop maintaining pv_list_count for i386 and amd64 since it was
obsoleted by Peter's rewrite of the pv entry allocator.  To avoid ABI
breakage, the field in 'struct mdpage' has not been removed, but it has
been renamed to 'pv_unused'.
2009-01-20 19:41:18 +00:00
John Baldwin 5884081241 MFC: Close several races with using shared vnode locks for pathname lookups
with UFS and enable shared lookups for UFS.
- Change the name cache to fail lookups with EBADF if a directory vnode
  is recycled while it waits for a lock upgrade.
- Rework the locking of the dirhash to use an sx lock and reference count
  on each hash structure.  Using an sx lock instead of a mutex allows the
  lock to be held across disk I/O closing a number of races when using
  shared vnode locks that were previously handled by exclusive vnode
  locks.
- Remove the 'i_ino' and 'i_reclen' fields from the i-node.  i_ino is now
  a local variable in ufs_lookup(), and i_reclen is not needed since
  ufs_dirremove() always has the entire block holding the directory
  entry in memory when it updates the directory.
- 'i_diroff' and 'i_offset' are now local variables in ufs_lookup().
  'i_diroff' is updated after a successful lookup.
- Only set i_offset in the parent directory's i-node during a lookup for
  non-LOOKUP operations.
- Remove the LOOKUP_SHARED option.  One can set vfs.lookup_shared to 1
  in either loader.conf or sysctl.conf instead.  The default setting for
  vfs.lookup_shared is not changed and remains off by default.
2009-01-20 19:01:59 +00:00
Alan Cox 28f21bea0b MFC
Increase the size of the kernel virtual address space to 6GB.

  Increase the ceiling on the kmem map's size to 3.6GB.  Also, define the
  ceiling as a fraction of the kernel map's size rather than an absolute
  quantity.  Thus, scaling of the kmem map's size will be automatic with
  changes to the kernel map's size.
2009-01-20 08:13:45 +00:00
Alan Cox c770c55ddb MFC r179917,180333,180373,180378
Prepare for a larger kernel virtual address space.  Specifically, once
  KERNBASE and VM_MIN_KERNEL_ADDRESS are no longer the same, the physical
  memory allocated during bootstrap will be offset from the low-end of the
  kernel's page table.

  Change create_pagetables() and pmap_init() so that many fewer page table
  pages have to be preallocated by create_pagetables().

  Eliminate pmap_growkernel()'s dependence on create_pagetables() preallocating
  page directory pages from VM_MIN_KERNEL_ADDRESS through the end of the
  kernel's bss.  Specifically, the dependence was in pmap_growkernel()'s one-
  time initialization of kernel_vm_end, not in its main body.  (I could not,
  however, resist the urge to optimize the main body.)

  Reduce the number of preallocated page directory pages to just those needed
  to support NKPT page table pages.  (In fact, this allows me to revert a
  couple of my earlier changes to create_pagetables().)

  Fix lines that are too long in pmap_growkernel() by substituting shorter
  but equivalent expressions.
2009-01-20 07:24:28 +00:00
Alan Cox beacba26f0 MFC rev 180170
Eliminate an unnecessary static variable: nkpt.
2009-01-20 05:51:16 +00:00
Alan Cox b8a433fa92 MFC rev 175056
Provide a legitimate pindex to vm_page_alloc() in pmap_growkernel()
  instead of writing apologetic comments.

  Correct a nearby style error: Pointers should be compared to NULL.
2009-01-20 01:54:05 +00:00
Marius Strobl 1e9cafd881 MFC: r187341
Update URL.
2009-01-19 21:49:22 +00:00
Marius Strobl 0079fa6a17 MFC: r187316
Don't cross-reference gem(4) and hme(4); maybe this made some sense
back when these two were the only two NIC drivers working on sparc64
but it no longer does nowadays.
2009-01-19 21:47:01 +00:00
Marius Strobl e220062726 - MFC: 174903
Mention support for the 5722 driver in bge.4 as well.
- MFC: 187315
  Sync the description of jumbo frame support with reality as of r187309;
  it's also supported with BCM5702 (matched by BGE_ASICREV_BCM5703) but
  bge(4) currently doesn't with neither BCM5714 nor BCM5780.
2009-01-19 21:10:04 +00:00
Maxim Sobolev ee37db9234 MFC: mention removal of NTFS from GENERIC/amd64. 2009-01-19 17:14:03 +00:00
Maxim Sobolev b94b4802fd MFC: take NTFS option out to match i386 GENERIC. 2009-01-19 15:36:25 +00:00
Ruslan Ermilov c2202bfdfa MFC:
- Fix crash with "netstat -m -N foo".
PR:             bin/124724

- Sync usage() with SYNOPSIS.
2009-01-19 10:44:16 +00:00
Alan Cox 1dd157d04e MFC rev 180108
Compute NKPDPE from NKPT.  This reduces the number of knobs that must be
  turned in order to change the size of the kernel virtual address space.
2009-01-19 07:44:18 +00:00
Alan Cox af02042def MFC rev 180101
Strictly speaking, the definition of VM_MAX_KERNEL_ADDRESS is wrong.
  However, in practice, the error (currently) makes no difference because
  the computation performed by KVADDR() hides the error.  This revision
  fixes the error.

  Also, eliminate a (now) unused definition.
2009-01-19 06:55:29 +00:00
Alan Cox c3be900484 MFC partial merge of rev 179886
Make preparations for increasing the size of the kernel virtual
  address space on the amd64 architecture.
2009-01-19 05:20:52 +00:00
Alan Cox 4161191480 MFC rev 180255
Eliminate an unused declaration.  (In fact, the declaration is bogus
  because the variable is defined static to pmap.c.)
2009-01-19 04:31:18 +00:00
Alan Cox f465e78f19 MFC rev 180262
Correct an error in the comments for init_param3().
2009-01-19 01:03:42 +00:00
Alan Cox 1856d2bc42 MFC rev 180362
Make preparations for increasing the size of the kernel virtual
  address space on the amd64 architecture:

  Rev 180333, ``Change create_pagetables() and pmap_init() so that many
  fewer page table pages have to be preallocated ...'', violates an
  assumption made by minidumpsys(): kernel_vm_end is the highest virtual
  address that has ever been used by the kernel.  Now, however, the kernel
  code, data, and bss may reside at addresses beyond kernel_vm_end.  This
  revision modifies the upper bound on minidumpsys()'s two page table
  traversals to account for this possibility.
2009-01-18 23:34:17 +00:00
Ulf Lilleengen d4568ebad6 MFC r186517:
- Fix an issue with access permissions to underlying disks used by a gvinum
  plex. If the plex is a raid5 plex, and is being written to, parity data might
  have to be read from the underlying disks, requiring them to be opened for
  reading as well as writing.
2009-01-18 21:52:01 +00:00
Daniel Gerzo 60bf5896b4 MFC r187098:
- add missing include [2]
- fix struct memeber's name [1]

PR:		docs/130413 [1]
Submitted by:	Thomas Mueller <[email protected]> [1], rink@ [2]
2009-01-18 21:40:15 +00:00
Alan Cox ce15e67e4d MFC rev 179898
Make preparations for increasing the size of the kernel virtual
  address space on the amd64 architecture.
2009-01-18 19:56:13 +00:00
Alan Cox dbee6c408f MFC rev 180598
Eliminate stale comments from kmem_malloc().
2009-01-18 19:37:36 +00:00
Alan Cox dc7531a33a MFC rev 179923
Make preparations for increasing the size of the kernel virtual address
  space on the amd64 architecture.
2009-01-18 19:33:55 +00:00
Alan Cox e1c1072eeb MFC rev 179921
KERNBASE is not necessarily an address within the kernel map, e.g.,
  PowerPC/AIM.  Consequently, it should not be used to determine the maximum
  number of kernel map entries.  Instead, use VM_MIN_KERNEL_ADDRESS, which
  marks the start of the kernel map on all architectures.
2009-01-18 19:20:10 +00:00
Nick Hibma 3b8661f0ae Remark on the fact that a phone is supported by this driver. Just to
give people a hint.
2009-01-18 18:54:41 +00:00
Nick Hibma a2a60282d9 Speling mistake. 2009-01-18 18:53:27 +00:00
Nick Hibma 01dad805ec Speling mistake. 2009-01-18 18:50:18 +00:00
Alan Cox 35d2e19872 MFC rev 179887
Enforce the mapping of kernel loadable modules in the uppermost 2GB of the
  kernel virtual address space on amd64.
2009-01-18 18:26:52 +00:00
Stanislav Sedov 1491ba525b - MFC r182524 and r182555:
- Set U/L bit in generate MAC address.
  - Use our specific OUI instead of Atmel one.
2009-01-18 17:07:48 +00:00
Stanislav Sedov 6311c1dbd1 - MFC r182476:
style fix.
2009-01-18 12:35:11 +00:00
Stanislav Sedov 472bf95e57 - Merge r182477:
Try to look for MAC address in all SA registers, not only in the
  first one. U-boot, for example, uses the second register to store
  MAC.[1]
  Use random MAC address if none configured instead of failing.

Submitted by:	Bjorn Konig <[email protected]> [1]
2009-01-18 12:28:45 +00:00
Stanislav Sedov 47756916b1 - Merge r183151:
Recognize SAVE and OSXSAVE extended processor features.
2009-01-18 12:16:45 +00:00
Stanislav Sedov b88917659a - Merge r184309:
Add a missing NULL-pointer check.
2009-01-18 12:12:38 +00:00
Stanislav Sedov 366806cb60 - Merge r184310:
Add stream bus_space operations.
2009-01-18 12:09:24 +00:00
Konstantin Belousov a46abf212d MFC r186740:
Do not incorrectly add the low 5 bits of the offset to the resulting
position of the found zero bit.
2009-01-18 11:47:39 +00:00
Stanislav Sedov fcee9bc232 - Merge r185494:
Get rid of unused variable in KTR checks. This allows ktr(4) enabled
  ARM kernel to compile.

PR:		rm/128897
Submitted by:	Pankov Pavel <[email protected]>
2009-01-18 11:43:23 +00:00
Stanislav Sedov 9a235a3a8b - MFC r185707:
- Eliminate unused variable. [1]
  - Check for runt frames entering the stack. [2]

Suggested by:	ganbold[1], yongari[2]
2009-01-18 11:17:46 +00:00
Stanislav Sedov c9ab0e37d6 - Bump __FreeBSD_version after cpuctl MFC. 2009-01-17 19:52:09 +00:00
Konstantin Belousov 87ca5889ba MFC r186719:
Extend the struct vm_page wire_count to u_int to avoid the overflow of
the counter, that may happen when too many sendfile(2) calls are being
executed with this vnode.

To keep the size of the struct vm_page and offsets of the fields
accessed by out-of-tree modules, swap the types and locations of the
wire_count and cow fields. Add safety checks to detect cow overflow and
force fallback to the normal copy code for zero-copy sockets.
2009-01-17 14:45:07 +00:00
Konstantin Belousov 07d8e2e93d MFC r186278:
Do not busy twice the mount point where a quota operation is performed.
2009-01-17 14:37:54 +00:00
Konstantin Belousov 7fc4c90743 MFC r186276:
Do not return success and doomed vnode from lookup. LK_UPGRADE allows
the vnode to be reclaimed.
2009-01-17 14:31:41 +00:00
Mike Silbersack dbf6a351b1 Merge r186031 - quick change to r186026 2009-01-17 06:55:28 +00:00
Mike Silbersack f7a800c178 Merge r186026 - add the debug.batt.batt_sleep_ms sysctl. 2009-01-17 06:53:57 +00:00
Alexander Motin f7469558eb MFC rev. 187154, 187196, 187202
Change configuration order to enable output only after codec is configured.
Mute all mixer controllable amplifiers initially to let mixer to unmute
only some of them later. This should reduce clicks and noises during boot.

Improve AD1983 codec support:
 - force playback via mixer to get PCM volume control,
 - make cleanup on recoring source selection.
2009-01-16 18:00:25 +00:00
Konstantin Belousov 37d8e38cef MFC r187147:
Document that ffsll(3) and flsll(3) functions first appeared in
FreeBSD 7.1.
2009-01-16 11:14:29 +00:00
Marius Strobl 665036232a MFC: r183337
- Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9) etc
  and take advantage of rman_get_rid(9) in order to save some softc
  members.
- Provide and consume module dependency information for lebuffer(4).
2009-01-15 20:49:17 +00:00
Marius Strobl ea646d8b8f MFC: r183895
Use xpt_register_async() in order to remove code duplication.
2009-01-15 20:30:38 +00:00
Marius Strobl 1bd3511804 MFC: r184380
Do as the Linux tg3 driver does and enable MSI support also
for the BCM5714 revision A0 when in a multi-port configuration
and unconditionally for the remainder of the class of BCM575X
and beyond chips.
2009-01-15 20:23:38 +00:00
Marius Strobl 267d6dc000 MFC: r183896
Use bus_{read,write}_4(9) instead of bus_space_{read,write}_4(9)
in order to get rid of the bus space handle and tag in the softc.
2009-01-15 20:19:53 +00:00
Marius Strobl 2cff0c0960 MFC: r183281
- Don't read the identifier string from the VPD if there's no chip
  containing an Ethernet address fitted as this is yet another thing
  that fails in that case in order to avoid the one second delay
  until pci_read_vpd_reg() times out.
- Const'ify the bge_devs array.
2009-01-15 20:13:22 +00:00
David E. O'Brien 138c12d19a Don't claim to be FreeBSD 8.0 when installed on FreeBSD 7.1. 2009-01-15 17:15:03 +00:00
Giorgos Keramidas a5deb62db7 The description of the various securelevels has moved to the
security.7 manpage a while ago.

Noticed by:   simon
2009-01-15 05:04:31 +00:00
Giorgos Keramidas 39669f91b6 MFC 186916 from /head/etc
The description of the various securelevels has moved to the
security.7 manpage a while ago.
2009-01-15 05:01:29 +00:00
Giorgos Keramidas 3056f75209 MFC 185714 from /head
Add a -L option to wc(1), for finger compatibility with the GNU
wc utility.  The -L option can be used to report the length of
the longest line wc has seen in one or more files.  It is
disabled by default, and wc uses the standard `-lwc'.

Submitted by:   Sheldon Givens, sheldon at sigsegv.ca
2009-01-15 04:54:43 +00:00
Giorgos Keramidas 8c4b6fa3a9 MFC 184645 from /head
Repeat vmstat header after window.rows instead of a hardcoded 20.

Use ioctl() to get the window size in vmstat(8), and force a new
header to be prepended to the output every time the current window
size changes.  Change the number of lines before each header to the
current lines of the terminal when the terminal is resized, so that
the full terminal length can be used for output lines.
2009-01-15 04:48:06 +00:00
Giorgos Keramidas 54e8f35cab MFC 184057 from /head 2009-01-15 04:39:44 +00:00
Giorgos Keramidas 1ab54194a2 MFC 182795 from /head
Add two example regexps: (1) one for matching all the characters
that belong in a character class, and (2) one for matching all
the characters *not* in a character class.

Submitted by:   Mark B, mkbucc at gmail.com
2009-01-15 04:31:55 +00:00
Giorgos Keramidas fc87185d17 176561 | keramida | 2008-02-25 21:06:43 +0200 (Mon, 25 Feb 2008) | 11 lines
Implement from scratch a -l option for du(1), to match the same option
of the GNU utility.  The default behavior of our original `du' is to
count hardlinked files only once for each invocation of the utility.
With the new -l option they count towards the final size every time
they are found.
2009-01-15 03:48:49 +00:00
Giorgos Keramidas 4d146c8df2 MFC 175562 from /head
Repeat iostat header after rows-3 instead of a hardcoded 20.

Use ioctl() to get the window size in iostat(8), and force a new
header to be prepended to the output every time the current
window size changes.  Change the number of lines before each
header to `rows - 3' when the terminal is resized, so that the
full terminal length can be used for output lines.
2009-01-15 03:12:45 +00:00
Giorgos Keramidas f909c3677b MFC 173539 from /head
* Expand the example descriptions, fix mdoc-bugs in "(-a and -t
  vnode are implied)" and reuse it near the cd9660 example.
* Spell 'backing store' as two words.
2009-01-15 02:57:07 +00:00
Giorgos Keramidas 61abaf4713 MFC 173507 from /head.
Instead of hardcoding md10 as the device node in the cd9660
example, use a trick submitted by Ruslan.
2009-01-15 02:54:40 +00:00
Xin LI df369b9a9a MFC r187079:
Fix typo.

Submitted by:	Ben Kaduk <minimarmot gmail com>
2009-01-15 00:33:17 +00:00
Marius Strobl 2e374a65b6 MFC: r186876
Check the return values of contigmalloc(9) as well as bus_dma(9)
functions and stop attaching of dcons(4) and dcons_crom(4) if
they indicate failure. This fixes a panic seen on sparc64 machines
with no free physical memory in the requested 32-bit region but
still doesn't make dcons(4)/dcons_crom(4) these work.
2009-01-14 22:10:51 +00:00
Marius Strobl a1d7c4409e MFC: r185108
Given that the buffer dcons_crom(4) exposes is used for both input
and output, set BUS_DMA_COHERENT when creating the DMA map used for
loading the buffer. As a side-effect this solves locking issues on
sparc64 when dcons(4) calls bus_dmamap_sync(9) while in an interrupt
filter, which are executed in a critical section, and iommu(4) has
to use a sleep lock when taking advantage of the streaming buffer.

Reported and tested by:	kensmith
Approved by:		simokawa
2009-01-14 21:04:23 +00:00
Sam Leffler 98ec9a258e bring in bits missed in r187106: sync build infrastructure changes with HEAD
Noticed by:	attilio
2009-01-14 18:23:13 +00:00
Ken Smith 6b3b8371e3 Oops, forgot to mention 7.1-RELEASE in stable/7...
Submitted by:	Florian Smeets <flo at kasimir dot com>
2009-01-14 16:27:04 +00:00
Luigi Rizzo 6524c30b7d forced commit to remind that the previous commit also merged
the change in rev.185132 to reduce the amount of memory
used when loading a script.
2009-01-14 16:13:51 +00:00
Luigi Rizzo 6b9a0e75ee MFC: 185746 186789 187143
misc fixes and cleanup of the Forth scripts used by the loader,
see the original commits for details.
The only visible change is that now setting

	loader_conf_files="foo bar ${some.var}"

works as expected, and expands variables correctly.
Also, ${variables} can be used consistently in all assignments
in *.conf files managed by the loader.

NOTE: this commit has nothing to do with the pxeboot and /boot/loader
problems that people are seeing on 6.4 and 7.2 -- those are related
to issues with the loader code, not with the scripts that the
loader processes.
2009-01-14 14:55:10 +00:00
Daniel Gerzo f47f0585e7 MFC r187067:
Reviewed by:	trhodes, keramida
2009-01-14 10:02:47 +00:00
Hajimu UMEMOTO e81d7deb48 MFC r187210: Fix typo to install 400.status-pkg, again. 2009-01-14 09:11:13 +00:00
Rong-En Fan 43724c09fd MFC r186851
- Remove snd_au88x0 which seems never got compiled into kernel nor as a kernel
   module. These files cause manual interaction when building
   ports/audio/aureal-kmod which provides a usable i386-only driver (it requires
   linking against some linux object files distributed by vendor which bankrupted
   back in 2000).

 MFC after:    1 week

PR:		124343
2009-01-14 06:50:28 +00:00
Luigi Rizzo 84844704fa MFC: rev. 185475, 186824, 186826, 186827
various cleanups including:
+ check a possible buffer overflow when creating a temp file,
  submitted by Christoph Mallon
+ remove stale struct definitions
+ clarify the use of dflag and remove useless checks
+ Make the linker.hints file have mode 644 instead of 600.
+ fix a couple of innocuous compiler warnings
+ correct description of how a string is stored, fix a few
  typos and reference the kernel file which processes this info.
2009-01-13 23:02:54 +00:00
Luigi Rizzo 693c93243b MFC from rev.185643 and 186799
Some libstand/bootp.c extension (written by Danny Braniss, slightly
revised/modified by me) to store dhcp options into kenv variables,
so the information is available to the boot loader and can be used
to customize the boot process.
2009-01-13 22:46:24 +00:00
Luigi Rizzo 95dde68418 MFC: a number of small fixes and enhancements to the boot0 code,
and matching modifications to boot0cfg.

The most noticeable features are preserving the 4-byte volume ID
that certain Windows versions put in the MBR, and an option (F6)
to boot through INT18 that on some modern BIOSes invokes PXE.
2009-01-13 22:28:48 +00:00
Simon L. B. Nielsen a2790c53e6 Correct ntpd(8) cryptographic signature bypass [SA-09:04].
Correct BIND DNSSEC incorrect checks for malformed signatures
[SA-09:04].

Security:	FreeBSD-SA-09:03.ntpd
Security:	FreeBSD-SA-09:04.bind
Obtained from:	ISC [SA-09:04]
Approved by:	so (simon)
2009-01-13 21:19:27 +00:00
George V. Neville-Neil 4dff01d2f9 MFC of average latency bug fix
Fix a cut/paste bug which prevents us from setting the average
latency tunable.
2009-01-13 21:19:02 +00:00
George V. Neville-Neil bf348aab52 MFC of code to fix debug builds with CTF/DTrace
Fix CTF based builds to that if the debug build is being used we get
debug symbols.
2009-01-13 21:13:35 +00:00
Alexander Motin f1cacd0fb8 MRC rev. 186912, 187020, 187052:
Add external connector jack color into widget names.
It should help users to identify them while reading verbose messages.

Add one more bunch of controller and codec IDs.

Fix unwanted crosschannel mixing, possible on some codecs like
VIA VT1708B and Realtek ALC268.
2009-01-13 16:17:22 +00:00
Christian Brueffer 8937cdbe59 MFC: r186953
DEBUG_REDZONE needs DDB which needs KDB.
2009-01-13 09:24:55 +00:00
Xin LI f8f7f8c370 Fix build: MV_61XX is spelled as MV61XX in 7-STABLE. 2009-01-13 01:39:17 +00:00
Rui Paulo 67f5be182d MFC r185268:
Add support for Marvell PATA M88SX6121.

PR:		129154
Submitted by:	João Barros <joao.barros at gmail.com>
2009-01-12 22:37:05 +00:00
Sam Leffler 5a792aee4e MFC r185478: enable use of modules but disable them by adding MODULES_OVERRIDE="" 2009-01-12 19:16:00 +00:00
Sam Leffler e23b0a2ed6 sync build infrastructure changes with HEAD
Reviewed by:	imp
2009-01-12 17:19:17 +00:00
Stanislav Sedov 68d12a7f7b - MFC cpuctl and related commits into RELENG_7.
First revision of usr.sbin/cpucontrol was
  merged directly into usr.sbin since there're
  no such directory in stable/7 yet. Subsequient
  changes went into usr.sbin/cpucontrol.

Approved by:	kib (mentor)
2009-01-12 15:48:22 +00:00
Pyun YongHyeon aa116fa4ef MFC r183137:
Add ASUS P5KPL-C to the list of supported motherboard.

  Reported by:	< nikola.lecic <at> anthesphoria dot net >
2009-01-12 04:30:27 +00:00
Pyun YongHyeon 2afd7f5e45 MFC r184743:
Remove informational messages left. These messages were intended to
  show up in verbose boot mode.

  Reported by:	pluknet ( pluknet<> gmail DOT com )
2009-01-12 04:23:47 +00:00
Pyun YongHyeon 188811078f MFC r184107:
Remove unused age_txdq
2009-01-12 04:20:46 +00:00
Pyun YongHyeon 98128f1992 MFC r184106:
No need to sync descriptors twice in age_rxintr()
2009-01-12 04:18:22 +00:00
Pyun YongHyeon a214356fcb MFC r181717:
Fix a typo: jme -> age
2009-01-12 04:15:05 +00:00
Pyun YongHyeon f4347a8711 MFC r186390:
Since we don't request reset for rlphy(4), the link state 'UP'
  event from mii(4) may not be delivered if valid link was already
  established. To address the issue, check current link state after
  driving MII_TICK. This should fix a regression introduced in
  r184245.
2009-01-12 04:10:40 +00:00
Pyun YongHyeon 7cbfcd31b2 MFC r184245,185575:
r184245:
  Implement miibus_statchg handler. It detects whether rl(4)
  established a valid link or not.
  In rl_start_locked, don't try to send packets unless we have valid
  link. While I'm here add a check that verifies whether driver can
  accept Tx requests by inspecting IFF_DRV_OACTIVE/IFF_DRV_RUNNING
  flag.

r185575:
  Update if_iqdrops instead of if_ierrors when m_devget(9) fails.
2009-01-12 04:03:25 +00:00
Pyun YongHyeon c6cafa018f MFC r184241-184243:
r184241:
  Don't rearm watchdog timer in rl_txeof(). The watchdog timer was
  already set in rl_start_locked(). Touching the watchdog timer in
  other places will hide the root cause of watchdog timeouts.

r184282:
  Make rl_init_locked() call rl_reset. This will put hardware into
  sane state after resume/watchdog timeouts.

r184283:
  After sending stop command to MAC, give hardware chance to drain
  active DMA operation.
2009-01-12 03:54:33 +00:00
Pyun YongHyeon c4c94cb654 MFC r184240:
Various bus_dma(9) fixes.
   - The hardware does not support DAC so limit DMA address space to
     4GB.
   - Removed BUS_DMA_ALLOC_NOW flag.
   - Created separated Tx buffer and Rx buffer DMA tags. Previously
     it used to single DMA tag and it was not possible to specify
     different DMA restrictions.
   - Apply 4 bytes alignment limitation of Tx buffer.
   - Apply 8 bytes alignment limitation of Rx buffer.
   - Tx side bus_dmamap_load_mbuf_sg(9) support.
   - Preallocate Tx DMA maps as creating DMA maps take very long time
     on architectures that require real DMA maps.
   - Adjust guard buffer size to 1522 + 8 as it should include VLAN
     and additional reserved bytes in Rx buffer.
   - Plug memory leak in device detach. Previously wrong buffer
     address was used to free allocated memory.
   - Added rl_list_rx_init() to clear Rx buffer and cleared the
     buffer.
   - Don't destroy DMA maps in rl_txeof() as the DMA map should be
     reused. There is no reason to destroy/recreate the DMA maps in
     this driver.
   - Removed rl_dma_map_rxbuf()/rl_dma_map_txbuf() callbacks.
   - The hardware does not support descriptor based DMA on Tx side
     and the Tx buffer address should be aligned on 4 bytes boundary
     as well as manual padding for short frames. Because of this
     hardware limitation rl(4) always used to invoke m_defrag(9) to
     get a 4 bytes aligned single buffer. However m_defrag(9) takes
     a lot of CPU cycles on slow machines and not all packets need
     the help of m_defrag(9). Armed with the information, don't
     invoke m_defrag(9) if the following conditions are true.
        1. Buffer is not fragmented.
        2. Buffer is aligned on 4 bytes boundary.
        3. Manual padding is not necessary.
        4. Or padding is necessary but upper stack passed a writable
           buffer and the space needed for padding is satisfied.
     This change combined with preallocated DMA maps greatly
     increased Tx performance of driver on sparc64.
   - Moved bus_dmamap_sync(9) in rl_start_locked() to rl_encap() and
     corrected memory synchronization operation specifier of
     bus_dmamap_sync(9).
   - Removed bus_dmamap_unload(9) in rl_stop(). There is no need to
     reload/unload Rx buffer as rl(4) always have to copy from the
     buffer. It just needs proper bus_dmamap_sync(9) calls before
     copying the received frame.

  With this change rl(4) should work on systems with more than 4GB
  memory.

  PR:	kern/128143
2009-01-12 03:48:25 +00:00
Pyun YongHyeon c235b1b9e0 MFC r184908:
Fix Rx/Tx checksum offload ioctl handling. Now checksum offload
  can be controlled by ifconfig(8). Note, VLAN hardware tagging
  controls still lacks required handler but it requires more driver
  cleanups so I didn't touch that part.

  PR:   kern/128766
2009-01-12 03:32:54 +00:00
Pyun YongHyeon a6d8fd35bf MFC r185597:
Add HW MAC counter support for newer JMC250/JMC260 revisions.
2009-01-12 03:26:52 +00:00
Pyun YongHyeon 681c67176f MFC r185596:
Add support for newer JMC250/JMC260 revisions.
   o Chip full mask revision 2 or later controllers have to
     set correct Tx MAC and Tx offload clock depending on negotiated
     link speed.
   o JMC260 chip full mask revision 2 has a silicon bug that can't
     handle 64bit DMA addressing. Add workaround to the bug by
     limiting DMA address space to be within 32bit.
   o Valid FIFO space of receive control and status register was
     changed on chip full mask revision 2 or later controllers. For
     these controllers, use default 16QW as it's supposed to be the
     safest value for maximum PCIe compatibility. JMicron confirmed
     performance will not be reduced even if the FIFO space is set
     to 16QW.
   o When interface is put into suspend/shutdown state, remove Tx MAC
     and Tx offload clock to save more power. We don't need Tx clock
     at all in this state.
   o Added new register definition for chip full mask revision 2 or
     later controllers.
2009-01-12 02:51:29 +00:00
Andrew Thompson 7cc52612d2 MFC r185186
Allow multiple makeoption lines to be used with the += operator, this permits
 the following syntax in the kernel config.

  makeoptions MODULES_OVERRIDE=foo
  makeoptions MODULES_OVERRIDE+=bar
  makeoptions MODULES_OVERRIDE+=baz

 Bump config minor version to 600007.
2009-01-12 02:45:00 +00:00
Pyun YongHyeon 213ec12e65 MFC r183493:
Save extended address register prior to switching to 1000BASE-X
  only mode and restore original value of extended address register
  instead of overwriting it with page 1. There are still instance
  information passing issue(e.g configured media type: fiber or
  copper) from driver to PHY layer but this change make the selected
  PHY work with 88E1112 PHY.

  Reported by:  Krzysztof Jedruczyk < beaker <at> hot dot pl >
  Tested by:    Krzysztof Jedruczyk < beaker <at> hot dot pl >
2009-01-12 02:44:23 +00:00
Pyun YongHyeon 3ad37aa5be MFC r183492,r184192
r183492:
  Add Vitesse VSC8211 PHY which is found on Planex GU-1000T.

  HW donated by:	nork

r184192:
  Correct PHY description and OUI of VSC8211. Previously VSC8211 was
  not recognized by ciphy(4) due to the incorrect OUI.

  Reported by:	nork
  Tested by:	nork
2009-01-12 02:31:22 +00:00
Pyun YongHyeon 01dab6c3d3 MFC r183488-r183491:
r183488:
  Announce link loss right after it happens.

r183489:
  Use mii_anegticks instead of hardcoded MII_ANEGTICKS.

r183490:
  Report current link state while auto-negotiation is in progress.

r183491:
  Explicitly mark IFM_HDX for half-duplex media.
2009-01-12 02:07:57 +00:00
Xin LI 596d220308 MFC revisions 178088 and 179656: Catastrophic recovery mode. 2009-01-12 00:39:22 +00:00
Sam Leffler 400a33a4a6 MFC r181463: add sbuf_new_auto 2009-01-11 21:45:23 +00:00
Wilko Bulte 8c800123cb MFC: r186142
By default assume a 8139 chip if the EEPROM contents prove inconclusive.
The same LOM hardware with goofed-up EEPROM programming also needed reading
the Ethernet address from the chips registers as the EEPROM did not have a
sensible address programmed.

Patch developed by: pyun@
Funky hardware on loan:  www.id-it.nl
2009-01-11 16:21:33 +00:00
Chin-San Huang be126788c2 Use full name (noticed by: ru@ 2009-01-11 13:56:08 +00:00
Alexander Motin 6f8bb5add9 MFC rev. 186907:
Mark ng_vjc node as FORCE_WRITER to protect slcompress state.
I think it can be the reason of livelock in netgraph reported by some
mpd users.
2009-01-11 11:51:18 +00:00
Maxim Konovalov e08e9ce6a0 Manually merge r183889:183890: do nothing in show_nat() for a test mode (-n). 2009-01-11 10:50:13 +00:00
Maxim Konovalov f1fc59b270 MFC r186274: sync comment and example. 2009-01-11 08:40:26 +00:00
Maxim Konovalov c3b42e4024 MFC r186498: fix typo. 2009-01-11 08:34:51 +00:00
Maxim Konovalov e0c7464863 MFC r186394: correct a database name. 2009-01-11 08:31:01 +00:00
Chin-San Huang 9dbc91f5f2 Synchronize pkg_install(1) with HEAD: fix typo 2009-01-11 05:59:39 +00:00
Antoine Brodin 47a54f59de MFC r181531 to stable/7:
Improve periodic/security/550.ipfwlimit a bit:
  - don't run it if net.inet.ip.fw.verbose = 0 as it is pointless
  - handle rules without logging limit correctly [1]
  (those rules show up without logamount in "ipfw -a list")

  PR:		conf/126060 [1]
  MFC after:	1 month
2009-01-10 19:00:17 +00:00
Antoine Brodin 3d72dda81d MFC r183590 to stable/7:
- Spell cam correctly (scbus), this makes it possible to compile hptiop
  in GENERIC and LINT. [1]
  - Rename hpt_dbg_level to hpt_iop_dbg_level to avoid multiple definition
  of hpt_dbg_level (hptmv also has hpt_dbg_level).

  PR:		127551 [1]
  Reviewed by:	scottl@
  MFC after:	1 month
2009-01-10 17:56:50 +00:00
Robert Noland a4d8f3d262 MFC - Sync drm to HEAD
Merged /head/sys:r186295,186299-186300,186386,186465

	This brings 7 up to date with HEAD.

	- Use bus_dma to allocate scatter/gather pages for pci GART.
	  This fixes "garbled" screen issues on pci based radeons.
	- Prevent drm from attaching to secondary devices even if they
	  have the the same pci id.
	- Attempt at making DRM_DEBUG c99 compliant (needs more work)

Approved by:	kib
2009-01-10 16:42:13 +00:00
Konstantin Belousov afad7066f9 Bump __FreeBSD_version after the strndup() merge to stable/7.
Requested by:	Florian Smeets <flo kasimir com>
2009-01-10 16:19:38 +00:00
Daniel Gerzo c93b6376fc MFC r186843 - r186849
- rename the RETURN VALUES section to EXIT STATUS
- convert to .Ex macro
2009-01-10 16:01:20 +00:00
Robert Noland 77e9cff983 MFC most all of drm from HEAD.
This brings in the following:
   Merged /head/sys:r182080,182467-182469,182883-182884,183573,
	183603-183605,183828,183830-183834,184212-184213,184263,
	184373-184375

	- Support for latest Intel chips
	- Support and fixes for many AMD/ATI chips r500 and below
	- Support AMD/ATI IGP based chips (rs690/rs485)
	- Lots of code cleanups
	- Lots of other fixes and changes since the existing drm
	  is 2+ years old

Approved by:	kib
2009-01-10 14:53:47 +00:00
Antoine Brodin 7ea3329d5f MFC r183004 to stable/7:
Fix TELOPT(opt) when opt > TELOPT_TN3270E.

  PR:		127194
  Submitted by:	Joost Bekkers
  MFC after:	1 month
2009-01-10 11:45:47 +00:00
Antoine Brodin 558218ce09 MFC r183002 to stable/7:
Add files to remove when WITHOUT_HESIOD is set.
  This fixes "make check-old" when WITH_HESIOD is set.

  PR:		122406
  MFC after:	1 month
2009-01-10 10:25:25 +00:00
Doug Barton 35adfd7eeb MFC the BIND 9.4.3 and 9.4.3-P1 updates 2009-01-10 03:01:18 +00:00
Doug Barton f26303fa34 MFC the BIND 9.4.3 and 9.4.3-P1 updates 2009-01-10 03:00:21 +00:00
Alexander Motin 04696a3fec powerd(8) was updated to get better SMP support.
Meanings of the -i and -r command line options were changed.
2009-01-09 22:19:48 +00:00
Alexander Motin 37f19a0959 Sync powerd with CURRENT.
1. Make it more SMP polite. Previous version uses average CPU load that
often leads to load underestimation. It make powerd with default
configuration unusable on systems with more then 2 CPUs. I propose to use
summary load instead of average one. IMO this is the best we can do without
specially tuned scheduler. Also as soon as measuring total load on SMP
systems is more useful then total idle, I have switched to it.

2. Make powerd's operation independent from number and size of frequency
levels. I have added internal frequency counter which translated into real
frequencies only on a last stage and only as good as gone. Some systems may
have only several power levels, while others - many of them, so adaptation
time with previous approach was completely different.

3. As part of previous I have changed adaptive mode to rise frequency on
demand up to 2 times and fall on 1/8 per time internal.

4. For desktop (AC-powered) systems I have added one more mode - "hiadaptive".
It rises frequency twice faster, drops it 4 times slower, prefers twice
lower CPU load and has additional delay before leaving the highest frequency
after the period of maximum load. This mode was specially made to improve
interactivity of the systems where operation capabilities are more
significant then power consumption, but keeping maximum frequency all the
time is not needed.

5. I have reduced default polling interval from 1/2 to 1/4 of second.
It is not so important for algorithm math now, but gives better system
interactivity.

6. Restore original frequency on exit.

7. getopt(3) returns -1, not EOF.

Discussed on:	mobile@
2009-01-09 22:10:07 +00:00
Alexander Motin dca4357a7a MFC rev. 182995
We can't implicitly trust the hook on NGQF_FN/NGQF_FN2 processing in
ng_apply_item(). There are possible (and I have got one) use-after-free
class panics because of it.

If hook is specified, require it to be valid at the apply time. The only
exceptions are the internal ng_con_part2(), ng_con_part3() and
ng_rmhook_part2() functions which are specially made to work with invalid
hooks.
2009-01-09 21:02:54 +00:00
Alexander Motin f7e68080a6 MFC rev. 183695
Document new NGM_NETFLOW_SETCONFIG control message.
2009-01-09 20:57:01 +00:00
Alexander Motin 269cf59b6b MFC rev. 183693
Add ability to generate egress netflow instead or in addition to ingress.
Use mbuf tagging for accounted packets to not account packets twice when
both ingress and egress netflow enabled.
To keep compatibility new "setconfig" message added to control new
functionality. By default node works as before, doing only ingress
accounting without using mbuf tags.

Reviewed by:	glebius
2009-01-09 20:55:26 +00:00
George V. Neville-Neil f849c77fe4 Revert the last checkin as it's supposed to go against HEAD first. 2009-01-09 20:43:06 +00:00
Alexander Motin ffc5033537 MFC rev. 185183
Remove unused variable.

Found with:     Coverity Prevent(tm)
CID:            3682
2009-01-09 20:41:58 +00:00
Alexander Motin 7a827e526c MFC rev. 185182
Fix typo. Clear session stats instead of config and part of stats.

Found with:	Coverity Prevent(tm)
CID:		2472
2009-01-09 20:40:19 +00:00
Alexander Motin 81b0f8181b MFC rev. 185179
Remove unneeded NULL check. At first msg can't be null here and and at second
NG_FREE_MSG() also checks it.

Found with:	Coverity Prevent(tm)
2009-01-09 20:38:21 +00:00
Alexander Motin 05d396603d MFC rev. 184140, 184142, 184936
Add "SD host controller" subclass.
Add HDA multimedia subclass.
Add ADMA, SATA and SAS mass storage subclasses.
2009-01-09 20:34:32 +00:00
Alexander Motin d138c93ce1 MFC rev. 184139, 184141, 184937
Add "SD host controller" subclass.
Add HDA multimedia subclass.
Add ADMA, SATA and SAS mass storage subclasses.
2009-01-09 20:33:07 +00:00
George V. Neville-Neil d4e1379901 Make it so that debug builds with CTF (i.e. DTrace) have proper debugging
symbols in the kernel.

Reviewed by:	jhb
2009-01-09 20:28:43 +00:00
Sam Leffler ca86c5d78b sync with HEAD
OK'd by:	phk
2009-01-09 18:08:50 +00:00
Ruslan Ermilov 7826e2d963 MFC: Instead of using .POSIX:, use the cool looking "@:" rule. 2009-01-09 16:37:29 +00:00
Ruslan Ermilov 6be5bd3c30 Sort MLINKS. 2009-01-09 16:24:10 +00:00
Peter Holm 1806515524 MFC r186510:
Prevent overflow of uio_resid.

Approved by:	kib
2009-01-09 13:53:44 +00:00
Alexander Motin 4cab068f3a MFC rev. 186154
If possible, try to obtain max_mhz on cpufreq attach instead of first request.

On HyperThreading CPUs logical cores have same frequency, so setting it
on any core will change the other's one. In most cases first request
to the second core will be the "set" request, done after setting frequency
of the first core. In such case second CPU will obtain throttled frequency
of the first core as it's max_mhz making cpufreq broken due to different
frequency sets.
2009-01-09 11:36:30 +00:00
Doug Barton 803b09ecd5 MFC the changes from r179725, documentation of the AUTO_UPGRADE knob,
and 186677:186749:

o Removal of 184781, 184804, and 184832 (automatic installation of files
that differ only by VCS Id)
o Fix cross-platform builds
o Various improvements to the mtree (-U) feature
o Remove the last of the MAKEDEV stuff
o Switch to using the top level (e.g., /usr/src) Makefile, and specify
that we should use the *.mk files from the source directory instead of
the installed versions.
o Check for the deprecated 'nodev' option in /etc/fstab
o Add support for the IGNORE_FILES variable
o Before installing a file check to make sure that the target does not
already exist as a directory
o Check to be sure that the file installed and error out if not
o We only need to check for the presence of the target of $PAGER
if that variable is actually set
2009-01-09 11:20:51 +00:00
Konstantin Belousov c9c6800708 MFC r183322:
Change the static struct sysentvec and struct Elf_Brandinfo initializers
to the C99 style.

Explicitely initialize sysentvec.sv_maxssiz that was missed in most
sysvecs.
2009-01-09 11:09:57 +00:00
Murray Stokely 6ae463b6f7 MFC r186043, 186124, 186241
Add support for If-Modified-Since to fetch with new -i option.
Consistently return 1 on error.
Improve usage and SYNOPSIS.
2009-01-09 03:42:41 +00:00
Paolo Pisati 55e2d46c54 MFC r186297 and r186298:
Honor the quiet (-q) option while adding a nat rule.
2009-01-08 22:32:35 +00:00
Sam Leffler a42301da49 mfc ath hal source code 2009-01-08 18:34:19 +00:00
Konstantin Belousov fec8ca6f19 MFC r185689:
Order the str*.c files mostly alphabetical.

MFC r185690:
Import the strndup(3) function.

MFC r185777:
Add strndup(3) prototype to string.h. Manually change
#undef HAVE_STRNDUP to #define HAVE_STRNDUP 1 for the configure.h
files that need it.
2009-01-08 09:50:20 +00:00
Sean Farley a814225919 MFC r184831,185237:
style(9) fixes.

Fixed style issues with variable ordering and naming, spacing and
parentheses.

Fixed alignment issue in gr_dup() in its assignment of gr_mem using a
struct to force alignment without performing alignment mathematics.
This
was noticed recently with libutil was built with WARNS=6 on platform
such
as sparc64.

Added checks to gr_dup(), gr_equal() and gr_make() to prevent segfaults
when examining struct group's with the struct members pointing to
NULL's.

Unlike r185237, did not enable WARNS?=6 since other changes would need
to be MFC'd first.

Reviewed by:	des
2009-01-08 02:41:40 +00:00
Simon L. B. Nielsen e33b799b23 Prevent cross-site forgery attacks on lukemftpd(8) due to splitting
long commands into multiple requests. [09:01]

Fix incorrect OpenSSL checks for malformed signatures due to invalid
check of return value from EVP_VerifyFinal(), DSA_verify, and
DSA_do_verify. [09:02]

Security:	FreeBSD-SA-09:01.lukemftpd
Security:	FreeBSD-SA-09:02.openssl
Obtained from:	NetBSD [SA-09:01]
Obtained from:	OpenSSL Project [SA-09:02]
Approved by:	so (simon)
2009-01-07 20:17:55 +00:00
Maxim Konovalov 87f61678ee MFC r176637,178706,180757,184517,185405,186785: Mac OS X 10.5,
DragonFly 1.12.0, FreeBSD 7.0, OpenBSD 4.3, DragonFly 2.0.0,
OpenBSD 4.4, FreeBSD 6.4, FreeBSD 7.1.
2009-01-07 18:02:36 +00:00
Alexander Motin fdc9e6c161 snd_hda(4) driver was updated to version 20081226_0122. 2009-01-07 16:35:59 +00:00
Alexander Motin 7f35f18c68 MFC rev. 186828
Add small hint that snd_ich is the AC'97 controller driver.
2009-01-07 16:21:04 +00:00
Alexander Motin 0c3771e5b6 Sync snd_hda and snd_ich man pages with CURRENT. 2009-01-07 16:15:17 +00:00
Bjoern A. Zeeb 7848e60158 MFC: r183100
Allow a jail to be started with a specific route fib.
2009-01-07 15:31:46 +00:00
Alexander Motin 1500fd8ce2 Merge updated snd_hda driver version 20081226_0122 from CURRENT.
This update gives:
 - multiple codec per HDA bus support;
 - multiple functional groups per codec support;
 - multiple audio devices per functional group support;
 - digital (SPDIF/HDMI) audio input/output support;
 - better UAA specification compliance with wide configureability;
 - headphones redirection controlled by UAA configuration instead of quirks;
 - improved codec parser, that gives working playback and recording with all
   of the long list of tested codecs and systems;
 - suspend/resume support;
 - part of multichannel audio support (requires OSS improvement to be used);

Note, that due to added HDMI audio and logical audio devices support, updated
driver often provides several PCM devices. In some cases it can make system
default audio device no longer corresponding to the users's habbitual audio
connectors. In such cases wanted device can be specified in audio application
setup or defined globally via hw.snd.default_unit sysctl according to
sound(4) man page.

Additional information information about driver operation can be obtained
from the updated man page and verbose boot messages.

PR:		kern/119181, kern/120144, kern/117599, kern/117729,
		kern/119671, kern/124645, kern/125822, kern/126217,
		kern/127105
2009-01-07 15:28:47 +00:00
Konstantin Belousov f224d7f8e0 MFC r186600:
In r185557, the check for existing negative entry for the given name
did not compared nc_dvp with supplied parent directory vnode pointer.
Add the check and note that now branches for vp != NULL and vp == NULL
are the same, thus can be merged.

Tested by:	kensmith
2009-01-07 12:44:03 +00:00
Alexander Motin 13f1fb21d8 MFC rev. 185723, 186189:
Carefully handle memory errors to keep peers compression/encryption state
consistent. There are some cases reported where peers fatally getting out
of sync without any visible reason. I hope this solve the problem.

Unroll two loops of SHA1Update(). 60 bytes of static memory is not a price.
2009-01-07 12:38:31 +00:00
Alexander Motin d2a65e08dd MFC rev. 186179:
Avoid 256 integer divisions per rc4_init() call. Replace it with using
separate index variable.

It gives more then double rc4_init() performance increase on tested i386 P4.
It also gives about 15% speedup to PPTP VPN with stateless MPPE encryption
(by ng_mppc) which calls rc4_init() for every packet.
2009-01-07 11:44:03 +00:00
Alexander Motin dc95926582 MFC rev. 186855
Hook up sdhci man page to the build.
2009-01-07 11:19:18 +00:00
Alexander Motin e3cb2f16d6 Partially MFC rev. 172658 to reduce diff.
Sort.
2009-01-07 11:04:57 +00:00
Bjoern A. Zeeb 43e79dca14 Move mergeinfo for r186587 from sys/sys/copyright.h to sys/. 2009-01-06 23:05:28 +00:00
Craig Rodrigues 05e1d64f80 MFC 184700:
Add DTrace probes for process execution.  This covers cases tested
  by the DTrace test suite.

Approved by:	jb
2009-01-06 21:34:53 +00:00
Robert Noland a1286f005d MFC r186434
Fix up handling of Intel G4X chips some more.

Note that you need at least xf86-video-intel 2.4.3 for this to work.
The G4X doesn't put the GATT into the same area of stolen memory
as all the other chips and older versions of the driver didn't
handle that properly.

Approved by:	kib
2009-01-06 17:05:44 +00:00
Konstantin Belousov cff8b6295f MFC r186433:
Clear busy state on the pages which are after the one that failed the bind
attempt.
2009-01-06 15:18:14 +00:00
Daniel Gerzo 0b3a76da5b MFC r180162:
- AI_ALL and AI_V4MAPPED flags are currently not supported

PR:		docs/120248
Submitted by:	Heiko Wundram <wundram (a) beenic.net>
2009-01-06 13:09:19 +00:00
Daniel Gerzo 8d7531d51a MFC r180534:
- Update the definition of modspecific structure

PR:		docs/125630
Submitted by:	Mateusz Guzik <[email protected]>
2009-01-06 12:10:23 +00:00
Daniel Gerzo e8ddd3826c MFC r185072:
- fix typo

PR:		docs/128973
Submitted by:	tabthorpe
Approved by:	roberto
2009-01-06 00:20:11 +00:00
Alexander Motin ed23452f6d MFC mmc, mmcsd and sdhci man pages. 2009-01-05 20:55:56 +00:00
Alexander Motin 148eb107ea MFC rev. 184138.
Add mmc, mmcsd and sdhci modules to the build.
2009-01-05 20:37:07 +00:00
Alexander Motin 569db371ab MFC sdhci driver. 2009-01-05 20:23:01 +00:00
Alexander Motin 350559b471 MFC rev. 183479, 184452.
Keep in sync with latest MMC stack:
- limit transfers with single block,
- properly implement read-only.
2009-01-05 19:53:58 +00:00
Alexander Motin 599cae90e1 Sync MMC/SD subsystem with HEAD.
Add support for MMC and SDHC cards, high speed timing, wide bus, multiblock
transfers and many other features.
2009-01-05 19:40:09 +00:00
Hiroki Sato 1842d3cf07 Add more missing bits: procstat(1). 2009-01-05 15:38:45 +00:00
Florent Thoumie 126d894694 Synchronize pkg_install with HEAD (20080708):
r180361: actually enable '-n' for pkg_create(1)
    r181376: use humanize_number to report pen-sizes
2009-01-05 13:10:06 +00:00
Hiroki Sato b834d3fb23 Add explanation of FIB. 2009-01-05 08:56:45 +00:00
Hiroki Sato ae2ba8f2cb Add missing items in relnotes as Errata items:
- jme(4), age(4), malo(4), bm(4), et(4), and glxsb(4).
- multiple routing table support.

Spotted by:	weongyo and yongari
2009-01-05 08:33:56 +00:00
Hiroki Sato 44d530bf05 Clean up a DSSSL file for release documents:
Remove {,no.}include.historic,
	Fix arch="" support, and
	Update platform list in README.
2009-01-05 05:56:19 +00:00
Hiroki Sato 4ea723482c Update &release.manpath.*;. 2009-01-05 05:54:13 +00:00
Hiroki Sato 3b0e5a8acf - Trim old items.
- Fix indent.
2009-01-05 05:53:14 +00:00
Ken Smith 70fad59c46 Release is done, bump stable/7 to -STABLE. 2009-01-05 04:45:17 +00:00
Rong-En Fan 99246d0d7e MFC r184459
- Whenever a password/shell is changed via rpc.yppasswdd, the daemon leaves
   one zombie process because it does not do the cleanup. For a long running
   NIS/YP server, it will have lots of zombie processes on it. Fix that by
   ignoring the SIGCHLD signal since we don't really care about the exit
   status in this case.

PR:           bin/91980
Reported by:  Arjan van der Velde <dj_noresult at hotmail.com>
Submitted by: Jui-Nan Lin" <jnlin at csie.nctu.edu.tw>
Reviewed by:  delphij
2009-01-05 04:26:24 +00:00
Hiroki Sato df86541c10 - Trim old Errata.
- Bump version numbers.
- Document Errata items for 7.1R:
	em(4) -> igb(4) change,
	ae(4) missing in 7.1R relnotes, and
	s/get_setaffinity()/sched_setaffinity()/ in 7.1R relnotes.

Approved by:	re (implicit)
2009-01-05 03:50:04 +00:00
Warner Losh b04ce6e067 Merge copyright bump.
Approved by:	re@ (kensmith)
2008-12-30 05:08:05 +00:00
Warner Losh 5cccffe6c4 MFC: Merge copyright bump.
Approved by:	re@ (kensmith)
2008-12-30 05:04:06 +00:00
Daniel Gerzo f60a41ffc3 MFC r185692:
- correct variable name

PR:		docs/129448
Submitted by:	Kenyon Ralph <[email protected]>
Approved by:	re@ (kensmith)
2008-12-28 23:47:32 +00:00
Hiroki Sato 1531802a23 Document SA-08:07, 08, 09, 10, 11, 12, and 13.
Approved by:	re (implicit)
2008-12-23 17:55:07 +00:00
Yoshihiro Takahashi f0c6bd0d1e MFH: part of 186372
Disable the pccard, parallel, GbE and wireless lan related devices
to decrease a kernel size.

Approved by:	re (kensmith)
2008-12-23 02:14:42 +00:00
Colin Percival 905bd0f61c Prevent cross-site forgery attacks on ftpd(8) due to splitting
long commands into multiple requests. [08:12]

Avoid calling uninitialized function pointers in protocol switch
code. [08:13]

Merry Christmas everybody...

Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-08:12.ftpd, FreeBSD-SA-08:13.protosw
2008-12-23 01:23:09 +00:00
Sean Bruno c0dba52b14 MFC 182911,182948,185996 from HEAD to syncronize fwcontrol between all branches
of FreeBSD.

These changes provide the following features:
  Allow users of more than one Firewire board to execute commands
  Allow users to pass more than one command line argument at a time
  Provide NetBSD code support
  Cleanup Mergeinfo and mark the branch in sync

Reviewed by:	slong ([email protected]) Mentor
Approved by:	re Ken ([email protected])
2008-12-22 00:38:52 +00:00
VANHULLEBUS Yvan 72a5edf8de Fix to bug kern/126850. Only dispatch event hander if the interface had a parent...
PR:		kern/126850
Reviewed by:	EvilSam
Approved by:	re
2008-12-21 19:13:30 +00:00
Peter Wemm 6e13a02933 MFC: 185728: initialize 'dummy' argument to _umtx_op(2) syscall
Approved by:	re (kib)
2008-12-21 04:32:57 +00:00
Christian S.J. Peron 7a8ea2bdb7 MFC revision 185713 from head.
Make sure we are maintaining the reference count on the route eliminating
another:

rtfree: 0xc841ee88 has 1 refs

Reviewed by:	bz
Approved by:	re@ (gnn)
2008-12-20 19:39:09 +00:00
Joe Marcus Clarke c09e04ecc4 MFC r186315:
Do not segfault when procstat -f or procstat -v is called on a process not
owned by the current user.  If kinfo_getfile() or kinfo_getvmmap() return
NULL, simply exit, and do not try and derefernce the memory.

Approved by:	re (kib)
2008-12-19 20:20:50 +00:00
Joe Marcus Clarke 8651a83628 MFC r186314:
Initialize the cntp pointer to 0 prior to doing any work so that callers
don't try to iterate through garbage or NULL memory.  Additionally, return
NULL instead of 0 on error.

Approved by:	re (kib)
2008-12-19 20:19:59 +00:00
Konstantin Belousov 6e512d84ee MFC r185984:
Reference the vmspace of the process being inspected by procfs, linprocfs
and sysctl kern_proc_vmmap handlers.

Approved by:	re (kensmith)
2008-12-19 15:32:48 +00:00
Konstantin Belousov 077c619d9d MFC r185983:
The userland_sysctl() function retries sysctl_root() until returned
error is not EAGAIN. Several sysctls that inspect another process use
p_candebug() for checking access right for the curproc. p_candebug()
returns EAGAIN for some reasons, in particular, for the process doing
exec() now. If execing process tries to lock Giant, we get a livelock,
because sysctl handlers are covered by Giant, and often do not sleep.

Break the livelock by dropping Giant and allowing other threads to
execute in the EAGAIN loop.

This commit does not merge the following change, as was discussed with jhb:
[Also, do not return EAGAIN from p_candebug() when process is executing,
use more appropriate EBUSY error.]

MFC r185987:
Uio_yield() already does DROP_GIANT/PICKUP_GIANT, no need to repeat this
around the call.

Approved by:	re (kensmith)
2008-12-19 15:24:18 +00:00
Konstantin Belousov ee39d14a17 MFC r185765, r185766:
Make two style changes to create new commit and document proper commit
message for r185765.
Commit message for r185765 should be:
In procfs map handler, and in linprocfs maps handler, do not call
vn_fullpath() while having vm map locked. This is done in anticipation
of the vop_vptocnp commit, that would make vn_fullpath sometime
acquire vnode lock.

Also, in linprocfs, maps handler already acquires vnode lock.

MFC r185864:
Relock user map earlier, to have the lock held when break leaves the
loop earlier due to sbuf error.

Approved by:	re (kensmith)
2008-12-19 15:04:26 +00:00
Konstantin Belousov fde57f1aff MFC r185764:
Do drop vm map lock earlier in the sysctl_kern_proc_vmmap(), to avoid
locking a vnode while having vm map locked.

Approved by:	re (kensmith)
2008-12-19 14:47:38 +00:00
Kip Macy 17d5644b34 MFC 185970
fix support and capabilities

Approved by:	re
2008-12-19 06:33:18 +00:00
Ken Smith 922b558bd9 MFC r186165:
> Handle VFS_VGET() failing with an error other than EOPNOTSUPP in addition
> to failing with that error.
>
> PR:           125149
> Submitted by: Jaakko Heinonen (jh <at> saunalahti <dot> fi)
> Reviewed by:  mohans, kan

Approved by:	re (kib)
2008-12-19 03:59:20 +00:00
Xin LI 8f4695b260 MFC r186169:
Don't count InFramesL2FilterDiscards into Ierr.  This value does not represent
a real packet error but simply indicate that an unexpected unicast or multicast
error was received by the NIC, which was not counted in the past as well.

Reported by:	many (on -stable@)
Reviewed by:	davidch
Approved by:	re (kensmith)
2008-12-19 00:17:09 +00:00
Xin LI 2a34c9b7c1 MFC r186168:
Test whether sc->tx_mbuf_map[i], not whether sc->tx_mbuf_map is NULL before
doing bus_dmamap_sync() since it operates on the former, not the latter.

Approved by:	re (kensmith)
2008-12-19 00:14:45 +00:00
Doug Ambrisko b8fdc9892b MFC: r185584,185994,185999,186132 which updates the strings that identifies
the new supported HW and bump the driver version number.

Submitted by:	LSI
Approved by:	re (kib)
2008-12-17 17:37:54 +00:00
Hajimu UMEMOTO 98ac5ca334 MFC 186090
Update our resolver to BIND 9.4.3.

Merge the resolver part of BIND 9.4.3 into HEAD.
It includes the following fix:

  2426.   [bug]           libbind: inet_net_pton() can sometimes return the
                          wrong value if excessively large netmasks are
                          supplied. [RT #18512]

Reported by:	Maksymilian Arciemowicz <cxib__at__securityreason.com>
Approved by:	re (kib)
2008-12-17 12:31:04 +00:00
Murray Stokely 2aa155ddbe MFC: r186204
Update the list of Intel chips with EM64T for FreeBSD/amd64 and
increase the known maximum memory configuration from 8gb to 32gb.

Approved by:	re (hrs)
2008-12-17 03:48:35 +00:00
Ruslan Ermilov edc45e7588 MFC: Fix printing of shared memory limits.
Approved by:	re (kib)
2008-12-16 20:48:38 +00:00
Marius Strobl 26456d4f9c MFC: 185750
- According to the corresponding Linux, NetBSD and OpenSolaris
  drivers, there should be a 1us delay after every write when
  bit-banging the MII. Also insert barriers in order to ensure
  the intended ordering. These changes hopefully will solve the
  bus wedging occasionally experienced with DM9102A since r182461.
- Deobfuscate dc_mii_readreg() a bit.

Approved by:	re (kib)
2008-12-15 21:36:14 +00:00
Marius Strobl ace9ec4570 - Limit BCM5701 B5 to 32-bit mode as a workaround for a bug which
causes data corruption in combination with certain bridges.
  Information about this problem was kindly provided by davidch. [1]
- As BGE_FLAG_PCIX is meant to indicate that the controller is in
  PCI-X mode, revert to the pre __FreeBSD_version 602101 method of
  reading the bus mode register rather than checking the mere
  existence of a PCI-X capability, which is also there when the
  NIC f.e. is put into a 32-bit slot causing it not to be in PCI-X
  mode. Setting BGE_FLAG_PCIX inappropriately could cause the NIC
  to be tuned incorrectly.

PR:		128833 [1]
Reviewed by:	jhb
Approved by:	re (kib)
2008-12-15 20:32:16 +00:00
Pyun YongHyeon ad8bf55e51 MFC r185962:
It seems there are still issues on multicast perfect filtering.
  Disable it until I find spare time to analyze the issue.

Approved by:	re (kensmith)
2008-12-15 05:54:27 +00:00
Daichi GOTO c7ff91059c MFC r185284, r185283
PR:		118346
Submitted by:	Masanori OZAWA <[email protected]>, trasz
Discussed at:	devsummit Strassburg, EuroBSDCon2008
Discussed with:	rwatson, gnn, hrs
Approved by:	re (gnn)
2008-12-15 03:56:54 +00:00
Ken Smith fee07557ce Due to a mis-understanding on my part with Ruslan I haven't been updating
this like I should have been.  Mis-understanding is cleared up I think.

Change default operating system for upcoming release.  Add release names
not in contrib/groff/tmac/doc-common yet.

Submitted by:	ru
Approved by:	re (implicit)
2008-12-13 18:29:48 +00:00
Ruslan Ermilov 333e2d8794 MFC: Fix fread() to return a correct value on platforms where sizeof(int) !=
sizeof(size_t), i.e. on all 64-bit platforms.

Approved by:	re (kib)
2008-12-13 16:53:35 +00:00
Konstantin Belousov b5b814d07c MFC r185634:
Improve db_backtrace() for compat ia32 on amd64. 32bit image enters
the kernel via Xint0x80_syscall().

Approved by:	re (kensmith)
2008-12-12 13:09:52 +00:00
Robert Watson ff6b1c43cf Merge r185857 from head to stable/7:
Move syncache flag definitions below data structure, compress some
  vertical whitespace.

Approved by:	re (gnn)
2008-12-11 22:28:29 +00:00
Robert Watson 7dc58312f7 Merge r185855 from head to stable/7:
Move flag definitions for t_flags and t_oobflags below the definition of
  struct tcpcb so that the structure definition is a bit more vertically
  compact.  Can't yet fit it on one printed page, though.

Approved by:	re (gnn)
2008-12-11 13:30:29 +00:00
Robert Watson c585e3e765 Merge r185813 from head to stable/7:
Update comment on INP_TIMEWAIT to say what it's about, as we caution
  regarding the misplacement of flags in inp_vflag in an earlier comment.

Approved by:	re (gnn)
2008-12-11 12:44:28 +00:00
Tim Kientzle 487e01f271 MFC r183009, r184807, r184808: Fix --strip-components, plus
a handful of test suite improvements.

PR:		bin/128562
Submitted by:	Jaakko Heinonen
Approved by:	re
2008-12-11 05:56:47 +00:00
Konstantin Belousov 12d9ee609f MFC r185739:
Improve usefulness of the panic by printing the pointer to the problematic
dquot.

Approved by:	re (kensmith)
2008-12-10 17:07:13 +00:00
Konstantin Belousov 9af0d5f43e MFC r185335:
In null_lookup(), do the needed cleanup instead of panicing saying
the cleanup is needed.

Approved by:	re (kensmith)
2008-12-10 17:00:14 +00:00
Robert Watson 05ea4d5e94 Merge r185791 from head to stable/7:
Move macros defining flags and shortcuts to nested structure fields in
  inpcbinfo below the structure definition in order to make inpcbinfo
  fit on a single printed page; related style tweaks.

Approved by:	re (kib)
2008-12-10 00:08:25 +00:00
George V. Neville-Neil 4481d2bbc9 MFC of 3 separate commits.
Bug fix from Chelsio which addresses the issue of the device resetting
when it sees only received packets.  In some cases where a device only
recieves data it mistakenly thinks that its transmitting side is broken
and resets the device.

Fix a bug with the ael1006 PHY.  The bug shows up as persistent but incomplete
packet loss, of between 10-30%. The fix is to put the PHY into
and take it out of local loopback mode when resetting the interface.

Bug fix to support N310 version of Chelsio cards (board ID 1088).

Obtained from:	Chelsio Inc.
Approved by: re@
2008-12-09 19:36:04 +00:00
Konstantin Belousov b0651c0916 MFC r185761:
Recheck the DQ_MOD after the dqh lock is relocked. Repeat dqsync() if
the dq is dirty. This ensures that up to date dq is written in the quota
file and fixes assertion in dqget().

Approved by:	re (kensmith)
2008-12-09 16:30:41 +00:00
Konstantin Belousov acd5242cdf MFC r185557:
Prevent creation of the duplicated negative namecache entries.

Approved by:	re (kensmith)
Requested by:	jhb
2008-12-09 16:20:58 +00:00
Pyun YongHyeon 28342cfcd9 MFC r185542:
Add 8168D support.

  Submitted by: Andrew < andrewwtulloch <> gmail DOT com >
Approved by:	re (kib)
2008-12-09 11:01:17 +00:00
Tim Kientzle ead453ae78 MFC r185667,r185680,r185681: Overhaul the Rockridge option
parsing and beef up the ISO9660 bidder.  This makes the
ISO reader a lot more robust when reading malformed input.

Approved by:	re
2008-12-08 17:18:37 +00:00
Peter Wemm b9974351b2 MFC: 184996: use the correct syscall names in END() for three asm stubs.
Approved by:	re (kib)
2008-12-06 23:55:29 +00:00
Peter Wemm c20d140b23 MFC: 185548 and followups.
Add new KERN_PROC_* handlers with 32/64 bit stable interfaces.  Pack
records from sysctl to reduce copyout size.  Add helper to unpack and
provide a more stable interface.

Approved by:	re (kensmith)
2008-12-06 19:54:50 +00:00
Giorgos Keramidas 3ca97ccf5f MFC: r185519
The times(3) function returns the number of CLK_TCKs since the
startup time of FreeBSD, not since the UNIX Epoch.

PR:           docs/122359
Submitted by: Viktor &#352;tujber
Approved by:  re (kib)
2008-12-06 13:48:11 +00:00
Giorgos Keramidas 495178e220 MFC: r172623, r175681, r176182, r176184, and r185217
* Document quotachecks use of the passno field.
* Explain how the passno field in /etc/fstab works with fsck and
  quotacheck in some more detail.
* Explain in more detail how the pass number field works.
* Remove information about block devices; we don't have this sort
  of separation between character and block devices anymore.
* Enhance the explanation of using filesystem-specific mount
  options, and add a mount_msdosfs example.

Approved by:    re (kib)
2008-12-06 13:45:37 +00:00
Giorgos Keramidas f851c1058d MFC: r173282
Use getcwd() instead of getwd().  The former includes buffer length
checks, so it's probably "safer" to use in mtree.

Approved by:    re (kib)
2008-12-06 13:41:04 +00:00
Giorgos Keramidas 48c3bb8688 MFC: r175379, r175380
Document that loader(8) stops reading `loader.conf' when it
encounters a syntax error, and add a tip about adding first
the `vital' options and then experimental ones.

PR:             docs/119658
Submitted by:   Julian Stacey, jhs at berklix.org
Approved by:    re (kib)
2008-12-06 13:38:53 +00:00
Giorgos Keramidas c9f782154f MFC: r175680, r175728.
Document the no-op -r option of BSD xargs(1).

PR:		docs/106416
Submitted by:	Pete Slagle, freebsd-stable at voidcaptain.com
Approved by:	re (kib)
2008-12-06 13:32:51 +00:00
Pyun YongHyeon 9dfb4f4b54 MFC r185576:
Add some PHY magic to enable PHY hibernation and 1000baseT/10baseT
  power adjustment. This change is required to guarantee correct
  operation on certain switches.

MFC r185577:
  AR8113 also need to set DMA read burst value. This should fix
  occasional DMA read error seen on AR8113.

Approved by:	re (kensmith)
2008-12-06 01:01:17 +00:00
Xin LI d436c3d1fb MFC revisions 183648 and 185574:
183648 (simon): Document that the bce(4) driver works with Dell PowerEdge
1950/2950 NIC's.

185574 (delphij): Update bce(4)'s hardware list to reflect the recent
update to driver.

Approved by:	re (kib)
2008-12-05 22:35:44 +00:00
Xin LI addf8ba26b MFC r185593:
Don't attempt to clear status updates if we did not do a link state
change.  As a side effect, this makes the excessive interrupts to
disappear which has been observed as a regression in recent stable/7.

Reported by:	many (on -stable@)
Reviewed by:	davidch
Approved by:	re (kensmith, kib)
2008-12-05 21:30:13 +00:00
Ken Smith 9de4f928a6 MFC r185517:
> Catch up with the disappearance of sys/dev/hfa.

Approved by:	re (kib)
2008-12-04 13:37:18 +00:00
Ken Smith 31d02f4f59 MFC r185515:
> Adjustments to make a tags file a bit more suitable to amd64.

Reviewed by:	peter
Approved by:	re (kib)
2008-12-04 13:31:38 +00:00
Daniel Gerzo 16368a160b - MFC the nullfs(5) manual page
Approved by:	re@ (blackend)
2008-12-04 12:22:11 +00:00
Konstantin Belousov d4fe5d4e44 MFC r185474:
Clarify the reason to not use the volatile string as an argument to CTR
macros. Note the logging of file and line.

Approved by:	re (hrs)
2008-12-03 15:07:17 +00:00
Konstantin Belousov 47a2ea55fb MFC r185451:
Third argument to the vi_mmap_t function is vm_paddr_t *.

Approved by:	re (kensmith)
2008-12-02 13:29:35 +00:00
Marcel Moolenaar c8b8aaa5e3 MFC rev 179382:
Work-around a compiler optimization bug, that broke libthr. Massive
inlining resulted in constant propagation to the extend that cmpval
was known to the compiler to be URWLOCK_WRITE_OWNER (= 0x80000000U).
Unfortunately, instead of zero-extending the unsigned constant, it
was sign-extended. As such, the cmpxchg instruction was comparing
0x0000000080000000LU to 0xffffffff80000000LU and obviously didn't
perform the exchange.
But, since the value returned by cmpxhg equalled cmpval (when zero-
extended), the _thr_rtld_lock_release() function thought the exchange
did happen and as such returned as if having released the lock. This
was not the case. Subsequent locking requests found rw_state non-zero
and the thread in question entered the kernel and block indefinitely.

The work-around is to zero-extend by casting to uint64_t.

Approved by:	re (kensmith)
2008-12-01 17:40:57 +00:00
Ken Smith 9c49ba52a0 Make adjustments to the package set for 7.1-RELEASE.
Approved by:	re (kib)
2008-12-01 17:26:28 +00:00
Jack F Vogel 04d6069890 MFC of a critical fix for the ESB2 adapters in the em
driver, however the fix required a shared code change that
involves both em and igb, requiring some compatibility
changes throughout.

Also, the igb driver now has header split. This is a hardware
assist that is able to seperate the payload and header into
seperate buffers. Using jumbo frames and 4K mbuf clusters, this
should allow the use of ZERO COPY, but that has yet to be
implemented.

Approved by:re
2008-12-01 07:13:52 +00:00
Jack F Vogel 91795f235c MFC of version 1.6.2 of the ixgbe driver, contains
header split, new adapter support, and general code
improvement/cleanup.

Approved by:re
2008-12-01 04:03:17 +00:00
Kip Macy 7ed37e977f MFC 183967, 184861, 185157
183967:
Track number of packets transmitted and number of packets received
PR:   125806

184861:
Update firmware version check
 make ddp a tunable

 Obtained from:        Chelsio Inc.

185157:
 Several small additions to the Chelsio 10G driver.

 1) Fix a bug in dealing with the Alerus 1006 PHY which prevented the
 device from ever coming back up once it had been set to down.

 2) Add a kernel tunable (hw.cxgb.snd_queue_len) which makes it possible
 to give the device more than IFQ_MAXLEN entries in its send queue.  The
 default remains 50.

 3) Add code to place the card'd identification and serial number into
 its description (%desc) so that users can tell which card they have
 installed.

Approved by:	re
2008-12-01 00:23:12 +00:00
Christian S.J. Peron f8a7386770 MFC revision 185484
- fixup ABI issues with ip6/audit

Approved by:	re@ (kib)
2008-11-30 21:00:22 +00:00
Luigi Rizzo aa7163445e MFC: pass the correct value in %si to the next stage boot
Approved by:	re@
2008-11-30 00:00:02 +00:00
Robert Noland 7d74b599bb MFC r183555: Correctly handle Intel g33 chips and add support for g45
chips.

g33 based chips use a different method of identifying the gtt size.
g45 based chips gtt is located in a different area of stolen memory.

Approved by:	re@ (kensmith)
2008-11-29 17:33:38 +00:00
Robert Watson 2a284a9ec5 Merge r184367 from head to stable/7:
When the mac_bsdextended policy is unloaded, free rule memory.

  Obtained from:       TrustedBSD Project

Approved by:	re (kensmith)
2008-11-29 14:58:58 +00:00
Robert Watson 6a0f64d394 Merge r184567 from head to stable/7:
When encoding an smb name, truncate one byte earlier in order than we did
  previously in order to ensure it fit properly in the bufer when encoded.
  This prevents a debugging printf from firing if a source or destination
  host name for an smb mount exceeds 15 characters.

  Obtained from:       Apple, Inc.

Approved by:	re (kensmith)
2008-11-29 14:49:56 +00:00
Tim Kientzle eea4e70ea0 MFC r185334: Recognize Rockridge extensions even when the
IEEE-standard extension name (as standardized in 1994) is used.

PR:		kern/128942
Submitted by:	J.R. Oldroyd
Approved by:	re
2008-11-29 05:10:30 +00:00
Tim Kientzle 342d4a71e8 MFC r185361: timezone value is signed
PR:		kern/128934
Submitted by:	J.R. Oldroyd
Approved by:	re
2008-11-29 03:17:29 +00:00
Tim Kientzle df0cc8b04d MFC r185359: Return a non-zero exit code when directories
disappear during the filesystem traversal.

Tested by:	David Wolfskill
Approved by:	re
2008-11-28 20:13:23 +00:00
Tim Kientzle 13be3254b9 MFC 182590,182778,182779,184109: Support for certain
archive_entry attributes to be explicitly "unset".
This fixes a number of issues:
 * Zip archives with "length at end" can now be
   extracted correctly, since the Zip extractor
   can simply mark the size as "unknown."
 * Extract-to-disk can now accurately handle
   cases with partial time information (e.g.,
   mtime is known but not atime)
 * We get more accurate handling of different
   hardlink extraction cases; sometimes a hardlink
   entry has definitive size information and sometimes
   not.

Approved by:	re
2008-11-28 20:08:47 +00:00
Bjoern A. Zeeb 667eaf7da4 MFC: r185332
Plug a credential leak in case the inpcb is freed by
  in6_pcbfree() instead of in_pcbfree(); missed in r183606.

Approved by:	re (gnn)
2008-11-26 22:36:35 +00:00
Julian Elischer fdc85e3bd0 MFC @ 185101
Fix a scope problem in the multiple routing table code that
stopped the SO_SETFIB socket option from working correctly.

Approved by:	 re (kensmith, kostik)
Obtained from:	Ironport
2008-11-25 19:26:36 +00:00
Ken Smith d51080505e Add FreeBSD_version and package directory for 7.1.
Approved by:	re (implicit)
2008-11-25 17:34:36 +00:00
Ken Smith 45bc18d25a Bump __FreeBSD_version for 7.1.
Approved by:	re (implicit)
2008-11-25 17:31:45 +00:00
Ken Smith e0687daeb1 With the branch for 7.1 done start bumping misc. version numbers
from 7.0 to 7.1.

Approved by:	re (implicit)
2008-11-25 17:27:11 +00:00
Xin LI 51b557ebfa MFen rev 185258:
Document ale(4).

Approved by:	re (blackend)
2008-11-24 21:09:05 +00:00
Xin LI d5d713bafe MFC: Document ale(4), mention that it is not present in GENERIC kernel
for this release.

Approved by:	re (blackend)
2008-11-24 20:05:14 +00:00
Christian Brueffer b77c0ea0e5 MFC r184523
- Add one more supported adapter
- Fix a couple of typos

Approved by:	re (kensmith)
2008-11-24 19:52:19 +00:00
Colin Percival b90855b2fe Make sure arc4random(9) is properly seeded when /etc/rc.d/initrandom returns.
Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-08:11.arc4random
2008-11-24 17:39:39 +00:00
Pyun YongHyeon 4896d97a4e MFC r185014:
Fix typo. It restuled in activating unwanted Rx filtering as well
  as resetting Rx threshold configuration.

  Submitted by:	Joost Mulders < Joost.Mulders <> Sun DOT COM >
  Approved by:  re (kib)
2008-11-24 11:22:25 +00:00
Pyun YongHyeon f61d6474f7 MFC r184872-184873:
Add ale(4) man page and hook up ale(4) to the build.
  Also add Xr to appropriate man pages.

  Approved by:	re (kib)
2008-11-24 01:00:36 +00:00
Pyun YongHyeon 326bfb7ba0 MFC r184871:
Add ale(4) to the list of supported network interface.
  Approved by:	re (kib)
2008-11-24 00:56:19 +00:00
Pyun YongHyeon 9576e8842f MFC r184870:
Add ale(4), a driver for Atheros AR8121/AR8113/AR8114 PCIe ethernet
  controller. The controller is also known as L1E(AR8121) and
  L2E(AR8113/AR8114). Unlike its predecessor Attansic L1,
  AR8121/AR8113/AR8114 uses completely different Rx logic such that
  it requires separate driver. Datasheet for AR81xx is not available
  to open source driver writers but it shares large part of Tx and
  PHY logic of L1. I still don't understand some part of register
  meaning and some MAC statistics counters but the driver seems to
  have no critical issues for performance and stability.

  The AR81xx requires copy operation to pass received frames to upper
  stack such that ale(4) consumes a lot of CPU cycles than that of
  other controller. A couple of silicon bugs also adds more CPU
  cycles to address the known hardware bug. However, if you have fast
  CPU you can still saturate the link.
  Currently ale(4) supports the following hardware features.
    - MSI.
    - TCP Segmentation offload.
    - Hardware VLAN tag insertion/stripping with checksum offload.
    - Tx TCP/UDP checksum offload and Rx IP/TCP/UDP checksum offload.
    - Tx/Rx interrupt moderation.
    - Hardware statistics counters.
    - Jumbo frame.
    - WOL.

  AR81xx PCIe ethernet controllers are mainly found on ASUS EeePC or
  P5Q series of ASUS motherboards. Special thanks to Jeremy Chadwick
  who sent the hardware to me. Without his donation writing a driver
  for AR81xx would never have been possible. Big thanks to all people
  who reported feedback or tested patches.

  HW donated by:	koitsu
  Tested by:	bsam, Joao Barros <joao.barros <> gmail DOT com >
		Jan Henrik Sylvester <me <> janh DOT de >
		Ivan Brawley < ivan <> brawley DOT id DOT au >,
		CURRENT ML
  Approved by:	re (kib)

  Note, GENERIC kernel does NOT include ale(4) but users can still
  kldload it. It was requested by re.
2008-11-24 00:52:26 +00:00
Marius Strobl 19e9104a5d MFC: r185004
- For maximum flexibility, sparc64 supports BUS_DMA_COHERENT also
  with bus_dmamap_create() and not only bus_dmamem_alloc() so move
  the description of this flag up accordingly in order to document
  this fact. While at it, refine this description with an application
  example.
- Reword the description of BUS_DMA_NOCACHE as this flag is also
  implemented on sparc64.

Approved by:	re (kib)
2008-11-23 17:10:04 +00:00
Konstantin Belousov 7aa162ab4b MFC r185012:
Instead of forcing vn_start_write() to reset mp back to NULL for the
failed calls with non-NULL vp, explicitely clear mp after failure.

Approved by:	re (kensmith)
PR:	123768
2008-11-23 16:08:36 +00:00
Xin LI 795ec13bed MFC r185038,185044,185046:
Automatically pad gptboot, style for include files,
use humanize_number() for consistency and reduce
code duplication.

Approved by:	re (kib)
2008-11-23 00:16:10 +00:00
Sam Leffler 3ab89b581f change private mbuf flags to use M_PROTO* so they don't conflict with public
definitions; note this constitutes an ABI change so drivers that use M_TXCB
or M_FF must be recompiled

Approved by:	re (kib)
2008-11-22 23:48:33 +00:00
Konstantin Belousov 0afe327322 MFC r184860 (by obrien):
Add the kerberos5 libs to the install32 target.

Approved by:	re (kensmith)
2008-11-22 21:08:25 +00:00
Marcel Moolenaar cce1f470a7 MFC 184734:
Fix a panic caused by a corrupted table when the header is
still valid.

PR:		119868
Approved by:	re (kib)
2008-11-22 17:54:30 +00:00
Xin LI 1fae0ec83a MFC r185082:
Correct a logic error when testing BCE_PHY_SERDES_FLAG.

PR:		kern/128801
Pointed out by:	Adam Morrison
Ok'ed by:	davidch
Approved by:	re (kensmith)
2008-11-22 01:48:20 +00:00
Xin LI aa9c7944ca MFen r185110: document igb(4)
Approved by:	re (kensmith)
2008-11-21 00:48:57 +00:00
Xin LI 5f5fd4c441 MFC: Document igb(4).
Approved by:	re (hrs)
2008-11-20 00:43:41 +00:00
Hiroki Sato 62033514d4 MFC: Add workaround for a back reference when no corresponding
parenthesized subexpression is defined.  For example, the
following command line caused unexpected behavior like
segmentation fault:

 % echo test | sed -e 's/test/\1/'

Approved by:	re (kib)
PR:		bin/126682
2008-11-19 18:06:29 +00:00
Xin LI b38d142529 MFC revisions 183653 183654 183714 (simon),
all recent em(4) and add igb(4).

Approved by:	re (hrs)
2008-11-19 06:58:52 +00:00
Xin LI 3cabfa5c10 MFC r183718 and r185057:
Add some examples to demostrate gpart(8).

Approved by:	re (kib)
2008-11-18 20:41:14 +00:00
Doug Ambrisko 5a66c649d6 MFC 184934:
For now on every 10 cyclinder groups flush the buffer cache to free
up space.  If the buffer cache fills up then the disk systems can
grind to a halt.

PR:		128832
Approved by:	re (kensmith)
2008-11-18 18:21:36 +00:00
Doug Ambrisko f340ef0175 MFC 182085, 184897, 184933, 184974, 184975
This addresses:
     1) New HW support from LSI (they want to get the HW support
        into a FreeBSD release before the HW comes out!).
     2) Bug fix in the ioctl path with zero length command.
     3) Adds functional support so that SCSI sense will work
        when requested from user-land.  This is a little strange,
        since they store a user-land pointer in the "data" space
        of the ioctl packet.  So copy the data out into another
        structure that is a union of the data and pointer (mfi_sense_ptr
        union).  This way we can cleanly use the pointer, as pointer on
        both 64bit and 32bit machines (i386/amd64).

Submitted by:	LSI
Approved by:	re (kib)
2008-11-17 23:07:18 +00:00
Konstantin Belousov 8b6a7cc241 MFC r184587:
Add the ffsll and flsll functions. These are ffs and fls operating
on long long arguments.

Approved by:	re (kensmith)
2008-11-17 18:45:07 +00:00
Marius Strobl ff91686afd MFC: r182876
Adapt the locking of esp(4) to MPSAFE cam(4) (so that ncr53c9x_intr()
actually is INTR_MPSAFE now) and fix a couple of bugs which lead to
panics, amongst other improvements.

Approved by:	re (kib)
2008-11-16 14:55:58 +00:00
Marius Strobl f95d493324 MFC: r180692
o Fix style(9) bugs and similar nits.
o Merge ncr53c9x.c from NetBSD:
  1.115: fix variable shadowing
  1.118: __inline -> inline
  1.121: fix empty if

Approved by:	re (kib)
2008-11-16 13:19:47 +00:00
Warner Losh 5bac849092 Merge r183539 and r183558: Do match on class to avoid false positives,
return BUS_GENERIC_PROBE for a generic match.

Approved by:	re@
2008-11-14 18:09:19 +00:00
Doug Barton f7baf26b90 MFC the BIND 9.4.2-P2 update
Approved by:	re (kib)
2008-11-14 11:00:34 +00:00
John Baldwin 7ebc0514cb MFC: Adjust the license statement to more closely match a standard
3-clause BSD license.

Approved by:	re (kib)
2008-11-13 22:34:33 +00:00
Peter Wemm b829929f8e MFC: 184547,184548: add END() macros for Assembler code in libc. This
causes the symbol table to include the size of the function.

Approved by:	re (kib)
2008-11-13 20:46:07 +00:00
Rui Paulo c894080f34 MFC r176428:
Add AS lookup functionality. On each hop we query a whois server to
	find the corresponding AS for that IP (-a switch).
	We can also choose a different whois server with the -A switch. The
	default is whois.radb.net.

	Obtained from:	       NetBSD

Approved by:	       re
2008-11-13 15:27:48 +00:00
Konstantin Belousov 351c97541f MFC r184501:
The code in linux_proc_exit() contains a race when multiple linux based
processes exits at the same time. The linux_emuldata structure is freed
but p->p_emuldata is left as a dangling pointer to the just freed
memory.

The check for W_EXIT in the loop scanning the child processes isn't safe
since the state of the child process can change right afterwards. Lock
the process and check the W_EXIT before delivering signal.

Approved by:	re (kensmith)
2008-11-13 15:00:40 +00:00
Pyun YongHyeon c062353d46 MFC r184253:
Use auto-negotiation for manual media type selection. This fixes
  establishment of 10/100Mbps link on Atheros AR8121(L1E).
Approved by:	re (kib)
2008-11-13 11:00:15 +00:00
Peter Wemm a20d2581d4 MFC 184828,184829: Fix si_addr in 32 bit signals.
Approved by:	re (kib)
2008-11-13 02:35:29 +00:00
Joerg Wunsch 103cbfc443 (MFC r184484)
When running a "chio return" operation using a physical source unit
rather than a voltag name, do not set the CESR_VOLTAGS flags in the
CHIOGSTATUS command requesting the current status.  As voltags are an
optional feature that must be handled as "reserved" by media changers
not implementing the feature, always setting CESR_VOLTAGS resulted in
the command being aborted with an `Invalid field in CDB', and
consequently the "chio return" failed, for media changers that do not
support voltags.

Approved by:	re (kib)
2008-11-12 09:35:57 +00:00
Xin LI 6b5fbf1fd2 MFC revision 1801453: Don't leak DMA map if not freed.
Submitted by:	kevlo
Approved by:	re (kensmith)
2008-11-12 07:07:27 +00:00
Robert Watson caa1e4c8c9 Merge r184304 from head to stable/7:
In both dropwithreset paths in tcp_input.c, drop the tcbinfo lock
sooner to decomplicate locking and eliminate the need for a rather
chatty comment about why we have to handle the global lock in a
special way for the benefit of ipfw and pf cred rules.

Approved by:	re (kib)
2008-11-11 17:12:26 +00:00
Xin LI b7df299f01 Merge the following bce(4) changes:
r176448,178132,178853,179436,179695,179771,182293

r176448 (davidch)

 - Added loose RX MTU functionality to allow frames larger than 1500
   bytes to be accepted even though the interface MTU is set to 1500.
 - Implemented new TCP header splitting/jumbo frame support which uses
   two chains for receive traffic rather than the original single
   receive chain.
 - Added additional debug support code.

r178132 (davidch)

 - Fixed a problem with the send chain consumer index which would cause
   TX traffic to sit in the send chain until a received packet kick
   started the interrupt handler.  This would cause extremely slow
   performance when used with NFS over UDP.
 - Removed untested polling code.
 - Updated copyright year in the file header.
 - Removed inadvertent ^M's created by DOS text editor.

r178853 (scottl)

The BCE chips appear to have an undocumented requirement that RX frames
be aligned on an 8 byte boundary.  Prior to rev 1.36 (now r176448) this
wasn't a problem because mbuf clusters tend be naturally aligned.  The
switch to using split buffers with the first buffer being the embedded
data area of the mbuf has broken this assumption, at least on i386,
causing a complete failure of RX functionality.  Fix this for now by
using a full cluster for the first RX buffer.  A more sophisticated
approach could be done with the old buffer scheme to realign the m_data
pointer with m_adj(), but I'm also not clear on performance benefits of
this old scheme or the performance implications of adding an m_adj()
call to every allocation.

r179436 (jhb)

Trim an extra semi-colon.

r179695 (davidch)

 - Fixed kern/123696 by increasing firmware timeout value from 100 to
   1000.
 - Fixed a problem on i386 architecture when using split header/jumbo
   frame firmware caused by hardware alignment requirements.
 - Added #define BCE_USE_SPLIT_HEADER to allow the feature to be
   enabled/disabled.  Enabled by default.

PR:             kern/123696

r179771 (davidch)

 - Added support for BCM5709 and BCM5716 controllers.

r182293 (davidch)

 - Updated support for 5716.
 - Added some additional code for debug builds.
 - Fixed a problem printing physical memory on 64bit system during
   debugging.
 - Modified some of the context memory and mailbox register names to
   more clearly distinguish their use.
 - Added memory barriers for Intel CPUs when accessing host memory data
   structures which are written by hardware.

Approved by:	re (kib)
2008-11-10 22:40:16 +00:00
Robert Watson 08875da965 Merge r184298 from head to stable/7:
Remove endearing but syntactically unnecessary "return;" statements
  directly before the final closeing brackets of some TCP functions.

Approved by:	re (gnn)
2008-11-10 18:24:11 +00:00
Jason Evans d05be0bb64 MFC:
Revert to preferring mmap(2) over sbrk(2) when mapping memory, due
	to potential extreme contention in the kernel for multi-threaded
	applications on SMP systems.

Approved by:	re (kib)
2008-11-10 17:30:49 +00:00
David Xu daa5cc82de MFC:
Add POSIX clock id CLOCK_THREAD_CPUTIME_ID support.

Approved by:	re (kib)
2008-11-10 01:42:46 +00:00
Marc Fonvieille 0b373be02b MFC: r184753
Update ports number and size of Ports Collection.

Approved by:  re (kib)
2008-11-07 22:06:04 +00:00
Bjoern A. Zeeb 93df33adea MFC: r183014
(which was missed with r184739: r183013,r183017,r183032,r183034)

  Original commit message from HEAD:
	Julian: "oops commit the version that compiles"

  Unbreak RELENG_7 including the missing sys/proc.h header file.

Approved by:	re (kib)
2008-11-07 11:42:02 +00:00
Konstantin Belousov 0856cd0ab8 This is direct commit to stable/7 to accomodate KPI difference between
HEAD and the branch. Provide struct thread * argument to VOP_GETATTR.

Approved by:	re (rwatson)
2008-11-07 11:07:57 +00:00
Peter Wemm 82579b59ad MFC: r184492 - add offset / fileid / fsid to KERN_PROC_VMMAP sysctl
for the benefit of valgrind.

Approved by:	re (kib)
2008-11-06 22:32:19 +00:00
Julian Elischer 09b34600f2 MFC a rewrite of rt_check(). also revert the addition of
rt_check_fib() which we discovered is not needed.

fixes some hangs people have seen

Approved by:	re (ken)
2008-11-06 22:11:57 +00:00
Ken Smith 6517c49b81 Oops. Correct a mis-merge. This piece of r183860 didn't make it
through while doing the merge.

PR:		misc/128610
Submitted by:	veron <dot> x503 <at> hotmail <dot> com
Approved by:	re (blackend, kib)
2008-11-06 13:28:50 +00:00
Daniel Gerzo 167c274412 MFC rev. 183041:
- remove superfluous word

PR:		docs/127401
Submitted by:	Mick Charles Beaver <[email protected]>
Approved by:	re@ (blackend)
2008-11-05 14:14:31 +00:00
Konstantin Belousov be65c35a7e MFC r182698 (by kan):
Make sure internal rtld malloc routines are not called from unlocked
contexts as rtld's malloc is not thread safe and is only supposed to be
called with exclusive bind lock already held.

Approved by:	re (kensmith), kan
2008-11-05 12:32:42 +00:00
Konstantin Belousov d558f5be79 MFC r183737 (by kan):
Allow strong symbols to override weak ones for lookups done through
dlsym with RTLD_NEXT/RTLD_SELF handles.
Allow symbols from ld-elf.so to be located this way too.

Approved by:	re (kensmith), kan
2008-11-05 12:28:44 +00:00
Marius Strobl 1b9a617c7c MFC: r184379
Supply a valid Connect ID when issuing XPT_DEV_MATCH, which
according to my reading of the CAM draft is mandatory for
all CCB function calls and enforced by xptioctl() since at
least r168752. Previously we happened to use 0 as the Path
ID, causing the XPT_DEV_MATCH call to fail if there's no
SCSI bus 0. Basically the same bug was also fixed the same
way for camcontrol(8) as part of r126514.

PR:		127605
Approved by:	re (kib)
2008-11-04 22:51:56 +00:00
Konstantin Belousov 96fd89843f MFC r184409:
Protect check for v_pollinfo == NULL and assignment of the newly allocated
vpollinfo with vnode interlock. Fully initialize vpollinfo before putting
pointer to it into vp->v_pollinfo.

Approved by:	re (kensmith)
2008-11-04 15:56:44 +00:00
Marius Strobl a2ebbe4355 MFC: r184376
- In GCC 4.2 __builtin_frame_address() was fixed to include the
  V9 stack bias so we no longer need to add it in db_backtrace()
  and stack_capture() respectively. This also reverts r182168,
  which kludged around the resulting unaligned access.
- Sync the sun4v versions of db_trace.c and stack_machdep.c with
  the sparc64 ones and fix some style bugs.

Approved by:	re (kib)
2008-11-03 21:41:35 +00:00
Konstantin Belousov 32e64bd237 MFC r184408:
Provide an explanation for getinoquota() call in the ufs_access vop.

Approved by:	re (kensmith)
2008-11-03 14:35:43 +00:00
Konstantin Belousov ab8ce5ccf2 In vfs_busy(), lockmgr() cannot legitimately sleep, because code checked
MNTK_UNMOUNT before, and mnt_mtx is used as interlock. vfs_busy() always
tries to obtain a shared lock on mnt_lock, the other user is unmount who
tries to drain it, setting MNTK_UNMOUNT before.

Approved by:	re (kensmith)
2008-11-03 14:11:06 +00:00
Konstantin Belousov d8b39c96fc MFC r184074:
Assert that v_holdcnt is non-zero before entering lockmgr in vn_lock and
ffs_lock. This cannot catch situations where holdcnt is incremented not
by curthread, but I think it is useful.

Approved by:	re (kensmith)
2008-11-03 14:08:08 +00:00
Xin LI 6d0a080dc9 MFC revisions 180072 and 182967 by emaste:
Add explicit PCI IDs for the following Adaptec RAID Series 2 adapters:

  Adaptec RAID 2045
  Adaptec RAID 2405
  Adaptec RAID 2445
  Adaptec RAID 2805

Without this change these devices are supported by the driver's family
support, but they then appear as "Adaptec RAID Controller" in boot
messages and the dev.aac.0.%desc sysctl.

Approved by:	re (kib)
2008-11-02 22:43:37 +00:00
Bjoern A. Zeeb 2072c92f63 MFC: r183982
Add cr_canseeinpcb() doing checks using the cached socket
  credentials from inp_cred which is also available after the
  socket is gone.
  Switch cr_canseesocket consumers to cr_canseeinpcb.
  This removes an extra acquisition of the socket lock.

Approved by:	re (rwatson)
2008-10-31 14:30:33 +00:00
Oleg Bulyzhin af4df68ff8 Direct commit (r184414 is not applicable to stable due to ABI change):
Workaround possible q_time overflow (will happen after 2^32/(86400*hz)
days of uptime (~50days for hz = 1000)), which may lead to:
- broken shaping in 'fast' io mode.
- incorrect average queue length calculation in RED/GRED algorithm.

PR:		kern/128401
Approved by:	re (kensmith)
2008-10-31 12:58:12 +00:00
Bjoern A. Zeeb abf583b533 MFC: r183980
Add a mac_check_inpcb_visible implementation to all MAC policies
  that handle mac_check_socket_visible.

Approved by:	re (rwatson)
2008-10-31 11:27:54 +00:00
Bjoern A. Zeeb b313916215 MFC: r183973
Add mac_check_inpcb_visible MAC Framework entry point, which is similar
  to mac_check_socket_visible but operates on the inpcb.

Approved by:	re (rwatson)
2008-10-31 09:41:06 +00:00
David Xu 5599f96ea0 Merge revision 183061 from head to stable/7.
> Allow multiple locks to be acquired by detecting corresponding
> bit flag, otherwise if a thread acquired a lock, another thread
> or the current thread itself can no longer acquire another lock
> because thread_mask_set() return whole flag word, this results
> bit leaking in the word and misbehavior in later locking and
> unlocking.

Approved by:	re (kib)
2008-10-31 09:09:22 +00:00
KATO Takenori 0ba3b67d31 MFC of r184327.
Improved IDE HDD geometry adjustment.  Previous code didn't work with
certain ATA-6 drives including CF cards.

Approved by:	re (kib)
2008-10-31 08:42:34 +00:00
Bjoern A. Zeeb bcea896973 MFC: r183606, r183610
Cache so_cred as inp_cred in the inpcb.
  This means that inp_cred is always there, even after the socket
  has gone away. It also means that it is constant for the lifetime
  of the inp.
  Both facts lead to simpler code and possibly less locking.

Approved by:	re (gnn)
2008-10-30 16:29:04 +00:00
Bjoern A. Zeeb 1fa1466fa0 MFC: r182112
Make lmc(4) compile without INET6 defined. While here make it
  compile if there is no INET defined.

Approved by:	re (gnn)
2008-10-30 16:20:42 +00:00
Bjoern A. Zeeb a6ebe669ee MFC: r183611
Style changes: compare pointer to NULL and move a }.

Approved by:	re (gnn)
2008-10-30 16:15:12 +00:00
Bjoern A. Zeeb 2b68bc2896 MFC: r182915
mld_timerresid() returns ms so instead of doing the maths in usec
  and then dividing down to ms, do the maths in ms.

Obtained from:	NetBSD mld6.c rev. 1.47
Approved by:	re (gnn)
2008-10-30 16:09:08 +00:00
Bjoern A. Zeeb 28b390e65c MFC: r182106
Make the checks for ptp interfaces in ifa_ifwithdstaddr() and
ifa_ifwithnet() look more similar by comparing the pointer to NULL
in both cases.

Approved by:	re (gnn)
2008-10-30 15:56:04 +00:00
Bjoern A. Zeeb 5bf4831509 MFC: r182855
There is no real consumer of ip6_plen (IPv6 payload length)
  as set in tcpip_fillheaders().
  ip6_output() will calculate it based of the length from the
  mbuf packet header itself.
  Initialize the value in tcpip_fillheaders() in correct
  (network) byte order.

  With the above change, all places calling tcp_trace() pass in
  the ip6 header serialized in the mbuf as ipgen and with
  ip6_plen in network byte order.  Thus convert the IPv6 payload
  length to host byte order before printing.

Approved by:	re (gnn)
2008-10-30 15:48:55 +00:00
John Baldwin 35fc006bf8 Regen for freebsd32_getdirentries().
Approved by:	re (kib)
2008-10-30 14:30:49 +00:00
John Baldwin 77b85a6dd9 MFC: Split most of getdirentries() out into a kern_getdirentries() and add
a freebsd32 frontend to fix a data corruption bug with 32-bit binaries.

Approved by:	re (kib)
2008-10-30 13:14:45 +00:00
Xin LI 4922f8fc13 Sync with English revisions.
Approved by:	re (hrs)
2008-10-30 04:55:12 +00:00
Nathan Whitehorn dde77cd76b MFC r183288,183411,183827,184382:
Expand DBDMA API to allow setting device-dependent control bits and allow
DBDMA registers to lie in a subregion of a resource.

Also import changes to the BMAC driver to handle these changes and
change the way we enable the BMAC cell in macio. Instead of calling the
macio's enable-enet word, which apparently does nothing on some machines,
open an OF instance of the ethernet controller. This fixes cold booting
from disk on my Blue & White G3.

Approved by:	re (gnn)
2008-10-30 04:01:11 +00:00
Andrew Thompson 212a6f8281 MFC r183733
Prefix the static shl function with '__' like its parent function __qdivrem to
 avoid being picked up by the DTrace fbt provider.

 This is called by __udivdi3() for doing 64bit division on a 32bit arch and may
 be called from within the dtrace context causing a double fault.

Approved by:	re (kib)
2008-10-29 21:43:14 +00:00
Maxim Sobolev b120fe3a11 MFC: don't panic when HZ value is below 32. This change may need a bit
of refinement later, as bde says that 4BSD expects stathz of 128, while
in this case stathz would be in the range 40-128.

Approved by:	re (kib, kensmith)
2008-10-29 21:08:34 +00:00
Xin LI aab00a081b MFC recent ata(4) manual page updates:
- r183613 by delphij
   Note recently added ICH10 support

 - r183570 by brueffer
   ITE IT8213F support.

 - r181826 by simon
   Fix mdoc markup in r181825.

Approved by:	re (kib)
2008-10-29 19:52:24 +00:00
Xin LI c6243679f3 Partial MFC of recent ATA driver in order to support more new hardware.
- r183380 (sos)

Add support for the ITE 8213 controller.
Thanks goes to ITE who provided docs and feedback and made this possible.

Minor fixups to the Intel ICH code for bugs found while doing this.
(ITE8213 is very semilar to an Intel ICH)

 - r183552 (sos)

Add ICH10 PCI id's.

Fix the number of PATA ports on newer ICHX chips, they have just 1 port
not 2.

Approved by:	re (kib)
2008-10-29 17:27:23 +00:00
Edwin Groothuis 622f478ce5 MFV of r184404 - tzdata2008i
MFC of r184406

- United States zone reordering and recommenting
- Argentina DST changes update.

Approved by:	re (kib)
2008-10-28 19:50:33 +00:00
Christian S.J. Peron 32f7020942 MFC SVN rev 181647
- Reduce the scope of the vnode lock such that it does not
  cover the various copyouts associated with initializing
  the process's argv/env data in userspace.  It is possible
  that these copyout operations can fault under memory
  pressure, possibly resulting in dead locks.

Approved by:	re@ (kib)
2008-10-28 17:01:16 +00:00
Dag-Erling Smørgrav 3d3c396d6b MFC: (r184258) Add support for the SIIG Cyber 4-port serial card.
Approved by:	re (kib)
2008-10-28 15:17:59 +00:00
Dag-Erling Smørgrav 16ecbbb5ed MFC (r184122): fix UseDNS option.
Approved by:	re (kib)
2008-10-28 14:55:41 +00:00
Andrew Gallatin b97f07e7c7 Merge r184211 (mxge firmware update) into stable/7
Approved by:	re (kensmith)
Sponsored by:	Myricom Inc
2008-10-27 14:22:34 +00:00
Konstantin Belousov 00a63108a5 MFC r175105 (by peter):
Fall back to the binary-specified interpreter (ld-elf.so.1) if the
ABI override binary isn't found.

MFC r183694:
If the ABI-overriden interpreter was not loaded, do not set have_interp
to TRUE.

Approved by:	re (kensmith)
2008-10-27 13:56:27 +00:00
Dmitry Morozovsky abeeffb7cc MFH: r184200
Correct a typo in Nocona core name

Approved by:	re (hrs, kib)
2008-10-26 22:56:17 +00:00
Ed Schouten 279ae1cd52 MFC r183565:
Small cleanups to openpty().

  - Pass O_NOCTTY to posix_openpt(2). This makes the implementation work
    consistently on implementations that make the PTY the controlling TTY
    by default.

  - Call unlockpt() before opening the slave device. POSIX mentions that
    de slave device should only be opened after grantpt() and unlockpt()
    have been called.

  - Replace some redundant code by a label.

As a safety net, add a call to revoke() to unlockpt(). All applications
out there use openpty(), explicitly call revoke() or implement their own
PTY allocation routines. Adding the call to unlockpt() won't hurt, but
will prevent foot-shooting.

Reviewed by:	jhb, kib
Approved by:	re
2008-10-26 21:55:19 +00:00
Brooks Davis 3b920bc762 MFC r183974:
Support the remaining options listed in dhcp-options(5) and RFC 2132.

PR:		bin/127076
Submitted by:	jkim
Approved by:	re (kensmith)
2008-10-26 19:28:04 +00:00
Brooks Davis c944d58fd0 MFC r183979:
Display usage when pkg_add is called with no arguments.

PR:		bin/121093
Submitted by:	volker
Approved by:	re (kensmith)
2008-10-26 19:22:10 +00:00
Brooks Davis f7b423ae49 MFC r183976:
Wireless Mouse device of Sony VGP-WRC1 mouse/keyboard receiver has the
 same program interface as Microsoft Wireless Notebook Optical Mouse and
 needs a quirk.

PR:		usb/122712
Approved by:	re (kensmith)
2008-10-26 19:14:50 +00:00
Konstantin Belousov 780aef228f MFC r184060:
Ktr(9) stores format string and arguments in the event circular buffer,
not the string formatted at the time of CTRX() call. Stack_ktr(9) uses
an on-stack buffer for the symbol name, that is supplied as an argument
to ktr. As result, stack_ktr() traces show garbage or cause page faults.

Fix stack_ktr() by using pointer to module symbol table that is supposed
to have a longer lifetime.

Approved by:	re (kensmith)
2008-10-26 15:41:23 +00:00
Xin LI 7aa018acb9 MFC: Sync code with -CURRENT state.
Merged r183755,183770,184186-184189

Approved by:	re (kib)
2008-10-26 09:35:08 +00:00
Stanislav Sedov 9d39b9fb6e - MFC ae(4) Attansic FastEthernet controller driver.
Approved by:	re (kensmith), kib (mentor)
2008-10-25 21:42:43 +00:00
Doug Rabson 6e6e9c631f MFC: r184227 - don't use *statep without holding the vnode interlock
This change is being merged earlier than originally planned at the request
of the release engineers.

Approved by:	re (kib)
2008-10-25 14:00:37 +00:00
David Xu c4eb9e5749 Merge revision 184067 from head to stable/7:
In realtimer_delete(), clear timer's value and interval to tell
	realtimer_expire() to not rearm the timer, otherwise there is a
	chance that a callout will be left there and be tiggered in future
	unexpectly.

Approved by:	re (kib)
2008-10-25 11:37:42 +00:00
Ken Smith 2d5700db59 MFC r183921 and r184180
When we notice the INDEX had volume numbers (so the media the packages
are coming from has multiple volumes) walk through the dependency tree
for the packages selected by the user once for each volume, only
installing packages on the current volume.  If we can't install the
package because its on a higher volume just note that we have looked
at it during the pass for this volume to cut down on time spent checking
dependencies.  This stops the excessive disc swapping that users have
complained (a lot...) about.

Approved by:    re (kib)
2008-10-24 20:10:22 +00:00
Ruslan Ermilov 65ac91542d Don't fail mistakenly with -r when we already have the whole file.
Approved by:	re (kib)
2008-10-24 13:23:54 +00:00
Marcel Moolenaar f6050b602c MFC rev 183455:
Return G_PART_PROBE_PRI_HIGH instead of G_PART_PROBE_PRI_NORM
if the probe succeeds. This guarantees that the BSD scheme
wins over the MBR scheme when MBR gets to probe first.

Approved by:	re (kib@)
2008-10-23 15:44:00 +00:00
Tim Kientzle 47483e36aa MFC r184038: Restore mtime *after* restoring ACLs. Otherwise,
setting the ACL changes the mtime.  (Plus a new test to exercise
basic ACL restore logic.)

PR:		kern/128203
Submitted by:	Udo Schweigert
Approved by:	re (Kostik Belousov)
2008-10-23 04:48:48 +00:00
Pyun YongHyeon 6a3a75ea60 MFC r183966:
Some 88E1149 PHY's page select is initialized to point to other
  bank instead of copper/fiber bank which in turn resulted in
  wrong registers were accessed during PHY operation. It is
  believed that page 0 should be used for copper PHY so reinitialize
  E1000_EADR to select default copper PHY.
  This fixes link establishment issue of nfe(4) on Sun Fire X4140.

  OpenBSD also has similimar patch but they just reset the E1000_EADR
  register to page 0. However some Marvell PHYs((88E3082, 88E1000)
  don't have the extended address register and the meaning of the
  register is quite different for each PHY model. So selecting copper
  PHY is limited to 88E1149 PHY which seems to be the only one that
  exhibits link establishment problem. If parent device know the type
  of PHY(either copper or fiber) that information should be notified
  to PHY driver but there is no good way to pass this information yet.

  Reported by:	thompsa
  Reviewed by:	thompsa
  Approved by:	re (gnn)
2008-10-23 00:54:07 +00:00
Philip Paeps 7086227a55 MFC r183977: Adjust default keymaps for Ireland and Channel Islands.
PR:		conf/124411
Submitted by:	Doctor Modiford <freebsd -at- modiford.com>
Approved by:	re (gnn)
2008-10-22 19:27:40 +00:00
Ken Smith 8fb69313aa MFC r184144 and r184145. Replace an @ that went missing and move an
echo that accidentally got wrapped in the MAKE_DVD knob.

Approved by:	re (kib)
2008-10-22 15:39:28 +00:00
Bjoern A. Zeeb 59486fb091 MFC: r183970
Use the label from the socket credential rather than the
  solabel which was not set by the mac_partition policy.

Approved by:	re (rwatson)
2008-10-22 08:52:45 +00:00
Ken Smith 9dc42d6f63 MFC r183771 and r183860:
r183771:
  Add a build knob MAKE_DVD to control on a per-architecture basis whether
  or not to build a tree used for the creation of a DVD image.  If that is
  enabled set up a DVD tree by installing everything we normally install
  to the individual CDROM trees into the one DVD tree.  The result is one
  image with all the install bits, livefs bits, and doc bits suitable for
  burning to a DVD instead of CDROM.

  Enable building the DVD for amd64 and i386.

r183860:
  The thought of making more than one DVD image for a release really
  freaks me out.  But it turns out we might be able to generalize
  a few of the other things RE uses to assemble the package trees
  for releases if the DVDs use a naming theme close to what is used
  for the CDROMS (disc1, disc2, etc).  So change the name to dvd1.
  Hopefully this way src/release/scripts/{package-split.py,package-trees.sh}
  can be generalized instead of copied-and-hacked.

Approved by:	re (kib)
2008-10-21 19:42:56 +00:00
Konstantin Belousov 8f46d2d13d MFC r184026:
Set PCB_32BIT and clear PCB_GS32BIT for linux32 binaries.

Approved by:	re (kensmith)
2008-10-21 18:50:52 +00:00
John Baldwin 8460ea5740 MFC: Use 32k transfers rather than 63k transfers for chipsets that can't do
64k transfers and use the MIO method to talk to the Serverworks HT1000_S1
SATA controller.

Approved by:	re (kib)
2008-10-21 18:35:04 +00:00
Robert Watson 28ec7ea639 Merge r183809 from head to stable/7:
Turn XXX's for unlocked writes of NFS server statistics to simple notes,
  as we consider it a feature to exchange performance for consistency.

Approved by:	re (kib)
2008-10-21 14:11:00 +00:00
Dag-Erling Smørgrav f75702903f MFH (r183817): revert OX16PCI954 breakage
Approved by:	re (kensmith)
2008-10-21 12:19:08 +00:00
Robert Watson c9203d17ea Merge r183803 from head to stable/7:
Downgrade XXX to a Note for fgetsock() and fputsock().

Approved by:	re (kib)
2008-10-21 10:17:51 +00:00
Robert Watson e34347bebd Merge r183807 from head to stable/7:
When disconnecting a UDPv6 socket, acquire the socket lock around the
  changing of the so_state field, as is done in UDPv4.  Remove XXX
  locking comment.

Approved by:	re (kib)
2008-10-21 09:56:23 +00:00
Bjoern A. Zeeb 420ab20a40 MFC: r183923
Check that the mbuf len is positive (like we do in the v4 case)
  to avoid possible panics.

PR:		kern/119123
Approved by:	re (kib)
2008-10-21 09:45:02 +00:00
Robert Watson 950471ad34 Merge r183806 from head to stable/7:
The locking in portalfs's socket connect code is no less correct than
  identical code in connect(2), so remove XXX that it might be incorrect.

Approved by:	re (kib)
2008-10-21 09:30:42 +00:00
Konstantin Belousov b077e355e7 MFC r183822:
Sync up summary information for cylinder groups while data is already
in memory during snapshot creation.

Approved by:	re (kensmith)
2008-10-20 16:44:59 +00:00
Konstantin Belousov 32f9bb6adc MFC r183821:
Use old summary data for cg when bgfsck is performed.

Approved by:	re (kensmith)
2008-10-20 16:36:32 +00:00
Konstantin Belousov 25fd0e405e MFC r183820:
Use ufs2_daddr_t for block numbers.

Approved by:	re (kensmith)
2008-10-20 16:33:45 +00:00
Konstantin Belousov e815ad4a05 Regenerate.
Approved by:	re (kensmith)
2008-10-20 11:19:48 +00:00
Konstantin Belousov 63b28679f3 Regenerate.
Approved by:	re (kensmith)
2008-10-20 11:17:20 +00:00
Konstantin Belousov 4996c2a321 MFC r177257 (by rdivacky):
Implement sched_setaffinity and get_setaffinity using real cpu affinity
setting primitives.

MFC r177604 (by ru):
Fix build.

MFC r183612:
Use FreeBSD size of cpuset_t for bitmap size parameter and return EINVAL
if length of user space bitmap less than our size of cpuset_t.

Approved by: re (kensmith)
2008-10-20 11:15:57 +00:00
Pyun YongHyeon 66c3173529 MFC r183814:
Read PCI device id instead of PCI revision id. Also checks the read
  device id is JMC260 family. Previously it just verified the deivce
  is JMC260 Rev A0. This will make it easy for newer JMC2xx support.

  Pointed out by:	bouyer at NetBSD

MFC r183859:
  Make sure to read the last byte of EEPROM descriptor. Previously
  the last byte of the ethernet address was not read which in turn
  resulted in getting 5 out of the 6 bytes of ethernet address and
  always returned ENOENT. I did not notice the bug on FPGA version
  because of additional configuration data in EEPROM.

  Pointed out by:	bouyer at NetBSD

Approved by:	re (gnn)
2008-10-19 06:38:34 +00:00
Weongyo Jeong 1bbe6634b0 MFC r182799:
Sort products numerically.

Approved by:	re (gnn)
2008-10-18 04:13:51 +00:00
Weongyo Jeong 63b04ac10b MFC r182783:
Add ZyXEL G-202

  Obtained from:	OpenBSD

Approved by:	re (kib)
2008-10-18 04:11:25 +00:00
John Baldwin b1b191ba2f MFC: More CPUID feature flags: SSE4, X2APIC, POPCNT, DTES64, and 1GB
large pages.

Approved by:	re (kib)
2008-10-17 19:52:35 +00:00
Weongyo Jeong 0380eba5f7 MFC r183587:
sc->ndis_txidx should be cycle between 0 and sc->ndis_maxpkts, not
  NDIS_TXPKTS and don't allocate unused extra spaces for
  sc->ndis_txarray and sc->ndis_txpool.

  PR:		kern/127644
  Submitted by:	Antoine Pelisse <apelisse_at_gmail.com>

Approved by:	re (gnn)
2008-10-16 08:24:02 +00:00
Robert Watson c77b58d5a2 Merge r183675 from head to stable/7:
In soreceive_dgram, when a 0-length buffer is passed into recv(2) and
  no data is ready, return 0 rather than blocking or returning EAGAIN.
  This is consistent with the behavior of soreceive_generic (soreceive)
  in earlier versions of FreeBSD, and restores this behavior for UDP.

  Discussed with: jhb, sam

Approved by:	re (kib)
2008-10-14 22:48:38 +00:00
David Malone 9656ab7dcd Some people's 6to4 routers seem to have been blowing up because of
the unlocked route caching in if_stf. Add a mutex that protects
access to cached route. Various versions of this patch were tested
by Pekka Savola, Nick Sayer and Wouter Snels.

Approved by:    re (gnn)
2008-10-14 19:48:58 +00:00
Xin LI db5a9adcaf MFC r183660: Limit DMA memory to lower addressable 4GB, without
this patch, we can reliably provoke data corruption on systems
equipped with a plenty of memory during high load.

Approved by:	re (kib)
2008-10-14 19:02:47 +00:00
Edwin Groothuis f465d306a4 Vendor import of tzdata2008h
MFV of r183861
MFC of r183864

- Minor update for Mauritius (which I don't understand)
- Syria goes to DST at 1 November instead of 1 October.
- Niue is now located at the right side of the equator.

Approved by:	re (blackend)
2008-10-14 10:09:32 +00:00
Robert Watson e3e4c170d3 Merge r183664 from head to stable/7:
Remove temporary debugging KASSERT's introduced to detect protocols
  improperly invoking sosend(), soreceive(), and sopoll() instead of
  attach either specialized or _generic() versions of those functions
  to their pru_sosend, pru_soreceive, and pru_sopoll protosw methods.

Approved by:	re (kib)
2008-10-14 08:44:27 +00:00
Robert Watson 1af0602a55 Merge r183744 from head to stable/7:
Fix content and spelling of comment on _ipfw_insn.len -- a count of
  32-bit words, not 32-byte words.

Approved by:	re (kib)
2008-10-14 08:03:58 +00:00
Robert Watson 8f636a1898 Merge r183662 and r183663 from head to stable/7:
Don't pass curthread to sbreserve_locked() in tcp_do_segment(), as the
  netisr or ithread's socket buffer size limit is not the right limit to
  use.  Instead, pass NULL as the other two calls to sbreserve_locked()
  in the TCP input path (tcp_mss()) do.

  In practice, this is a no-op, as ithreads and the netisr run without a
  process limit on socket buffer use, and a NULL thread pointer leads to
  not using the process's limit, if any.  However, if tcp_input() is
  called in other contexts that do have limits, this may prevent the
  incorrect limit from being used.

  Rewrite sbreserve_locked()'s comment on NULL thread pointers, eliminating
  an XXXRW about the comment being stale.

Approved by:	re (gnn)
2008-10-14 07:58:18 +00:00
Christian S.J. Peron d2e77830e7 MFC change 182311
Fix panics with MAC kernels when a labeled security policy is used
and IP options are present on an mbuf.

Approved by:	re (kib)
2008-10-13 17:33:44 +00:00
Christian S.J. Peron d90cca3b78 MFC change 181604
Fix preselection on auditpipes if they have a different selection mask

Approved by:	re (kib)
2008-10-13 16:46:24 +00:00
John Baldwin eab6e09e48 MFC: Fail requests to boot an amd64 kernel on an i386-only CPU.
Approved by:	re (kib)
2008-10-13 16:14:21 +00:00
Konstantin Belousov a575dbb9ca MFC r183600:
Change the linprocfs <pid>/maps and procfs <pid>/map handlers to use
sbuf instead of doing uiomove.

Approved by:	re (kensmith)
2008-10-13 13:00:21 +00:00
Konstantin Belousov 0b67cc80cc MFC r180756 (by luoqi):
Unbreak cc -pg support on i386 by changing mcount() to always preserve %ecx.

Approved by:	re (kensmith)
2008-10-13 12:45:18 +00:00
Christian S.J. Peron c4d6075d30 MFC revision 183744
Improve entropy in source port generation for libalias consumers.

Approved by:	re (kib)
2008-10-12 23:19:23 +00:00
Robert Watson baf05edda4 Merge r183661 from head to stable/7:
Lock receive socket buffer in soo_stat() rather than commenting that
  we should lock it, which may marginally improve the consistency of
  the results.  Remove comment.

Approved by:	re (gnn)
2008-10-12 18:49:07 +00:00
Robert Watson b9ae615249 Merge r183572, r173649, r183650, r183690, and r183764 from head to
stable/7:

  Further minor cleanups to UNIX domain sockets:

  - Staticize and locally prototype functions uipc_ctloutput(),
    unp_dispose(), unp_init(), and unp_externalize(), none of which have
    been required outside of uipc_usrreq.c since uipc_proto.c was removed.
  - Remove stale prototype for uipc_usrreq(), which has not existed in the
    code since 1997
  - Forward declare and staticize uipc_usrreqs structure in uipc_usrreq.c
    and not un.h.
  - Comment on why uipc_connect2() is still non-static -- it is used
    directly by fifofs.
  - Remove stale comments, tidy up whitespace.

  Use soconnect2() rather than directly invoking uipc_connect2() to
  interconnect two UNIX domain sockets.

  Now that portalfs doesn't directly invoke uipc_connect2(), make it a
  static symbol.

  Remove stale comment (and XXX saying so) about why we zero the file
  descriptor pointer in unp_freerights: we can no longer recurse into
  unp_gc due to unp_gc being invoked in a deferred way, but it's still
  a good idea.

  Remove stale comment: while uipc_connect2() was, until recently, not
  static so it could be used by fifofs (actually portalfs), it is now
  static.

  Submitted by:   kensmith

Approved by:	re (kensmith)
2008-10-12 10:03:11 +00:00
Robert Watson 811274c5ce Test the soreceive_dgram tunable and set up the pr_usrreqs structure
during UDP initialization, not during UDP inpcb initialization.

Reported by:	Vlad GALU <dudu at dudu dot ro>
Approved by:	re (kib)
2008-10-10 21:18:12 +00:00
Robert Watson 9a264619a6 Merge r183563 from head to stable/7:
Remove or update several stale comments.

  A bit of whitespace/style cleanup.

Approved by:	re (kensmith)
2008-10-10 11:39:59 +00:00
John Baldwin 19ec437091 MFC: Check for duplicate attempts to add the same positive entry to the
name cache.  If a duplicate attempt is made, just do nothing.  This fixes
a race with shared locking in pathname lockups.

Approved by:	re (kib)
2008-10-09 20:40:11 +00:00
John Baldwin 796c7b4c40 MFC: Wait until after dropping the receive socket buffer lock to allocate
space to store the socket address stored in the first mbuf in a packet
chain in soreceive_dgram().

Approved by:	re (kensmith)
2008-10-09 17:52:47 +00:00
Marius Strobl e86041ade8 MFC: r183628
Disable ATAPI DMA as it's once again broken in that it causes data
corruption with the on-board AcerLabs M5229 controllers. While at
it, remove the pointless "nothing to autoload yet." message.

Approved by:	re (blackend)
2008-10-08 21:45:56 +00:00
Hiroki Sato 118c39a2fb OpenSSH has been upgraded to 5.1p1.
Approved by:	re (implicit)
2008-10-08 16:44:35 +00:00
Edwin Groothuis 7f43a04367 MFC of r183536
MFV of r183657
Vendor import of tzdata2008g

- Fix DST changes in Brazil which are clashing with Carnaval.

Approved by:	re (kib)
2008-10-06 22:25:26 +00:00
David E. O'Brien 4f8674dc9b Regenerate after r183644.
Approved by: re(kostikbel)
2008-10-06 16:12:28 +00:00
David E. O'Brien 3a77f588e0 MFC: revs 183042,183044,183188,183189,183270,183271,183273.
Add freebsd32 compat shim for nmount(2).  Also 32-bit ioctl shims
for MDIO, CDIOREADTOCHEADER and CDIOREADTOCENTRYS requests.
Fix bug which removed the 32-bit swapon(2) interface.  style(9).

Approved by: re(kostikbel)
2008-10-06 16:11:08 +00:00
Andrew Gallatin e4da97ecda MFC: 183515
Update to Myri10GE firmware version 1.4.33 from 1.4.29.
Approved by: re (kensmith)
2008-10-06 12:58:03 +00:00
Kip Macy 31e1009136 MFC fixes to mbufq interface
Approved by:	re
2008-10-06 06:43:20 +00:00
Kip Macy ae6d581d3d Fix bug in LRO on T304 whereby a packet could be sent to the wrong interface's ifp.
Submitted by:	Chelsio Inc.
Approved by:	re
2008-10-06 06:26:00 +00:00
Pyun YongHyeon 6e625a1af7 MFC: r183530
Mention support for nForce MCP77 and MCP79.
  Touch Dd.

Approved by:	re (hrs)
2008-10-06 03:40:06 +00:00
Pyun YongHyeon af7d40e3f8 MFC r183509:
Add device ids for MCP77/79 and set appropriate support flags.

  Obtained from:  OpenBSD
  PR:		  kern/127529
Approved by:	re (kensmith)
2008-10-06 00:28:34 +00:00
Robert Watson 7fbb3853a2 Merge r183512 from head to stable/7:
Various cleanups for soreceive_dgram():

  - Update or remove comments that were left over from the original
    soreceive_generic() implementation.  Quite a few were misleading in the
    context of the new code.
  - Since soreceive_dgram() has a simpler structure, replace several gotos
    with a while loop making the invariants more clear.
  - In the blocking while loop, don't try to handle cases incompatible with
    the loop invariant (since m is always NULL, don't check for and handle
    non-NULL).
  - Don't drop and re-acquire the socket buffer lock unnecessarily after
    sbwait() returns, which may help reduce lock contention (etc).
  - Assume PR_ATOMIC since we assert it at the top of the function.

Approved by:	re (gnn)
2008-10-05 21:05:20 +00:00
Bjoern A. Zeeb 76e656c841 MFC:
rev. 1.7 net/if_enc.c
   rev. 1.14 netipsec/ipsec.h, 1.20 netipsec/ipsec_input.c
   rev. 1.17 netipsec/ipsec_output.c
   rev. 1.4 netipsec/xform.h, 1.16 netipsec/xform_ipip.c
   SVN r174054, 174055

  Add sysctls to if_enc(4) to control whether the firewalls or
  bpf will see inner and outer headers or just inner or outer
  headers for incoming and outgoing IPsec packets.

  This is useful in bpf to not have over long lines for debugging
  or selcting packets based on the inner headers.
  It also properly defines the behavior of what the firewalls see.

  Last but not least it gives you if_enc(4) for IPv6 as well.

  [ As some auxiliary state was not available in the later
    input path we save it in the tdbi. That way tcpdump can give a
    consistent view of either of (authentic,confidential) for both
    before and after states. ]

  Note: The defaults were not changed but you may want to do that.
        See the the man page for more details.

PR:		kern/127785
Approved by:	re (gnn)
2008-10-05 17:41:46 +00:00
Konstantin Belousov 7244155be9 MFC r183414:
Differentiate between interrupt frames, trap interrupt frames and timer
frame in the kgdb, to allow it to properly backtrace over the interrupt
stacks.

Approved by:	re (kensmith)
2008-10-05 10:04:02 +00:00
Konstantin Belousov 28a3ed45b0 MFC r183413:
Frames created by the Xcpustop, Xrendezvous, Xipi_intr_bitmap_handler
and Xlazypmap differ from the frame for Xtimerint. The Xtimerint puts
pointer to the frame between return address and frame body, while rest
of the functions listed above do not. Correct offset calculation to
allow the ddb backtrace to step over such frames.

Approved by:	re (kensmith)
2008-10-05 09:56:14 +00:00
Konstantin Belousov 3aea3203ef MFC r183412:
If the panic thread is preempted after setting panicstr but before
setting TDF_INPANIC then it will never be rescheduled again. Wrap
setting the panic condition with the critical section.

Approved by:	re (kensmith)
2008-10-05 09:13:27 +00:00
Marius Strobl f638ac8f79 MFC: r183504
Use bus_get_dma_tag() so fatm(4) works on platforms requiring it.

Reported and tested by:	Sean Thomas Caron
Approved by:		re (gnn)
2008-10-04 08:55:30 +00:00
John Baldwin 46a4fea4e7 MFC: Update the function name in several assertions in soreceive_dgram().
Approved by:	re (kib)
2008-10-03 21:33:58 +00:00
Dag-Erling Smørgrav a50d5b3d38 MFH (r183458): replace $Mdocdate$ with bare dates.
Approved by:	re (kib)
2008-10-03 10:43:17 +00:00
Dag-Erling Smørgrav e8567963f1 MFH (r183336): "xmalloc: zero size" fix.
Approved by:	re (kib)
2008-10-03 10:40:26 +00:00
Kip Macy 030133b26c Fix a potential infinite loop in the TOE zero copy receive path.
Approved by:	re
2008-10-03 01:02:00 +00:00
John Baldwin 09d51ebe12 MFC: Note that support for CPU sets will first appear in 7.1.
Approved by:	re (kib)
2008-10-02 19:32:20 +00:00
Robert Watson e782fe2430 Merge r183460 and r183461 from head to stable/7:
Fix typo in comment.

  Expand comments relating various detach/free/drop inpcb routines.

Approved by:	re (kib)
2008-10-02 09:12:52 +00:00
Colin Percival 433e07015d Default to ignoring potentially evil IPv6 Neighbor Solicitation
messages.

Approved by:    so (cperciva)
Approved by:	re (kensmith)
Security:       FreeBSD-SA-08:10.nd6
Thanks to:      jinmei, bz
2008-10-02 00:32:59 +00:00
Kip Macy b1a4bcca59 MFC 183286
- Fix flag check
 - Fix adaptive thread sleep
 - set oactive when queue is full

Approved by:	re
2008-10-01 21:48:42 +00:00
Kip Macy 41343ff846 MFC 183285
- Track number of times that the transmit queue overflowed
 - Trivial whitespace cleanup

Approved by:	re
2008-10-01 21:46:52 +00:00
Kip Macy 919281174d fix optical PHY handling
Submitted by:	Chelsio Inc.
Approved by:	re
2008-10-01 21:44:39 +00:00
Kip Macy 3d3d2a8159 MFC 183163
fix two panics:
1. panic: rtalloc1_fib: bad fibnum

2. panic: Lock tcpinp not exclusively locked
@ /usr/src/sys/netinet/in_pcb.c:1284

Submitted by:	Chelsio Inc.
Approved by:	re
2008-10-01 21:37:39 +00:00
Dag-Erling Smørgrav 69291cbea1 Left-over files - should have been removed with 5.1p1 import.
Approved by:	re (kib)
2008-10-01 14:08:08 +00:00
Ruslan Ermilov c172a437b4 MFC: fix the build when MODULES_WITH_WORLD is defined.
Approved by:	re (kib)
2008-10-01 06:17:15 +00:00
John Baldwin 5b95c799ce Sync with head: When copying out the kld_stat structure to userland, only
copy out the size of the user's buffer.  In the case of a program using
the older (smaller) structure, the previous code would trash memory after
the end of the user's kld_stat struct.  This was missed in the DTrace
MFC.

Submitted by:	Jaakko Heinonen  jh saunalahti.fi
Approved by:	re (kib)
2008-09-30 15:49:59 +00:00
Konstantin Belousov 991586bf35 MFC r183383:
Save previous content of the td_fpop before storing the current
filedescriptor into it. Make sure that td_fpop is NULL when calling
d_mmap from dev_pager_getpages().

Approved by:	re (kensmith)
2008-09-29 20:20:13 +00:00
Konstantin Belousov 5f5983c91f MFC r183216:
Allow the d_mmap driver methods to use cdevpriv KPI during verification
phase of establishing mapping.

Approved by:	re (rwatson)
2008-09-29 20:06:57 +00:00
Konstantin Belousov ae951d7f38 MFC of the r179312 by sos:
Do not call ata_start() when ata_reinit fails in the ioctl path.

Approved by:	re (kensmith), sos
Prodded by:	Andrey V. Elsukov <[email protected]>
2008-09-29 19:54:38 +00:00
Robert Watson 556598a737 Merge r183418 from head to stable/7:
When an inpcb doesn't have a socket but the inpcb is passed to ipfw
  in the transmit path, such as TCPS_TIMEWAIT, fail the credential
  extraction immediately rather than acquiring locks and looking up
  the inpcb on the global lists in order to reach the conclusion that
  the credential extraction has failed.

  This is more efficient, but more importantly, it avoids lock
  recursion on the inpcbinfo, which is no longer allowed with rwlocks.
  This appears to have been responsible for at least two reported
  panics.

  Reported by:        ganbold

Approved by:	re (kib)
2008-09-29 19:19:27 +00:00
Robert Watson 0531004fc0 Merge r183398 from head to stable/7:
Rather than shadowing global variable 'lookup' in check_uidgid(), rename
  it to ugid_lookupp.  This should make debugging issues with ipfw uid
  rules easier.

Approved by:	re (kib)
2008-09-29 19:10:30 +00:00
Robert Watson a860a10af6 Merge r183356 from head to stable/7:
As a follow-on to r183323, correct another case where ip_output() was
  called without an inpcb pointer despite holding the tcbinfo global
  lock, which lead to a deadlock or panic when ipfw tried to further
  acquire it recursively.

  Reported by:    Stefan Ehmann <shoesoft at gmx dot net>

Approved by:	re (kib)
2008-09-29 18:23:08 +00:00
Robert Watson 066dd375a1 Merge r183323 from head to stable/7:
When dropping a packet and issuing a reset during TCP segment handling,
  unconditionally drop the tcbinfo lock (after all, we assert it lines
  before), but call tcp_dropwithreset() under both inpcb and inpcbinfo
  locks only if we pass in an tcpcb.  Otherwise, if the pointer is NULL,
  firewall code may later recurse the global tcbinfo lock trying to look
  up an inpcb.

  This is an instance where a layering violation leads not only
  potentially to code reentrace and recursion, but also to lock
  recursion, and was revealed by the conversion to rwlocks because
  acquiring a read lock on an rwlock already held with a write lock is
  forbidden.  When these locks were mutexes, they simply recursed.

  Reported by:        Stefan Ehmann <shoesoft at gmx dot net>

Approved by:	re (kib)
2008-09-29 15:19:37 +00:00
Konstantin Belousov 99ac0de72f MFC r179005 (by phk):
Don't terminate if we are listing devices, a controller might
legitimately not be there.

Submitted by:	Andrey V. Elsukov <[email protected]>
Approved by:	re (gnn), phk
2008-09-29 14:33:04 +00:00
Kip Macy 6e36256f08 MFC 183339
insta-panic fix

tested by: gnn

Submitted by:	Chelsio Inc.
Approved by:	re
2008-09-26 05:09:03 +00:00
Pyun YongHyeon 1cb1a10c9e MFC r183264:
Add workaround for occasional packet loss issue of JMC250 A2
  when it runs on half-duplex media.
  While I'm here add register definition for GPREG1. ATM the GPREG1
  register is only valid for JMC250 A1/A2.

  Submitted by:	Ethan at JMicron

Approved by:	re (kensmith)
2008-09-26 00:52:51 +00:00
John Baldwin af82b7bd5b MFC: 178280
- Clean up the code that checks the types of address so that it is
  done by understandable macros.
- Fix the bug that prevented the system from responding on interfaces with
  link local addresses assigned.

Approved by:	re (gnn)
2008-09-25 18:37:08 +00:00
David Malone bb1527c61c MFC:
Lockf was exiting with status 1 if the command did not exit normally.
This is easy to confuse with the actual exit status of the program.
Instead exit with EX_SOFTWARE if the command doesn't exit normally.

Approved by:	re (kib)
2008-09-25 14:24:07 +00:00
Alan Cox f18196f8e0 MFC r183236
Prevent an integer overflow in vm_pageout_page_stats() on machines with a
  large number of physical pages.

PR:		126158
Approved by:	re (kib)
2008-09-25 06:11:58 +00:00
John Baldwin 74b9991ad2 MFC: 176526,176596
- Correct a long-standing error in vm_object_deallocate().  Specifically,
  only anonymous default (OBJT_DEFAULT) and swap (OBJT_SWAP) objects should
  ever have OBJ_ONEMAPPING set.  However, vm_object_deallocate() was
  setting it on device (OBJT_DEVICE) objects.  As a result,
  vm_object_page_remove() could be called on a device object and if that
  occurred pmap_remove_all() would be called on the device object's pages.
  However, a device object's pages are fictitious, and fictitious pages do
  not have an initialized pv list (struct md_page).
- Correct a long-standing error in vm_object_page_remove().  Specifically,
  pmap_remove_all() must not be called on fictitious pages.  To date,
  fictitious pages have been allocated from zeroed memory, effectively
  hiding this problem because the fictitious pages appear to have an empty
  pv list.
- Rewrite the comments describing vm_object_page_remove() to better
  describe what it does.  Add an assertion.

Approved by:	re (kib), alc
2008-09-24 17:49:26 +00:00
Robert Watson 9d82f5f7e2 Merge r183265 from head to stable/7:
When invoking the udp_send() from udp6_send() due to use of a v6-mapped
  IPv4 address, first drop the udbinfo and inpcb locks, which will otherwise
  be recursed.  This leads to a potential minor race, but is preferable to a
  deadlock when acquiring a read lock after a write lock on the inpcb.

  MFC after:    3 days
  Reported by:  Norbert Papke <[email protected]>, lioux

Approved by:	re (kib)
Tested by:	Norbert Papke <[email protected]>, lioux
2008-09-23 21:29:22 +00:00
John Baldwin b3c7f80bc1 MFC: Add a CTASSERT() that KERNBASE is valid and update the KVA_PAGES
comments to cover PAE.

Approved by:	re (kib)
2008-09-23 18:33:11 +00:00
Konstantin Belousov d3e2898dac MFC r182961:
When doing rfork(0), i.e. separating curproc VM from any other user of
the same vmspace, decrement the reference count of the shared LDT instead
of a newly-made copy. Code factually removed LDT from the process that
did rfork(0).

Introduce user_ldt_deref() function that does decrement of refcount for
the struct proc_ldt, and call it in the rfork(0) case on the shared LDT.

Approved by:	re (kensmith)
2008-09-23 17:41:15 +00:00
Konstantin Belousov ec96f54270 MFC r182960 (with XEN-related chunks removed):
The user_ldt_alloc() function shall return with dt_lock locked.
The user_ldt_free() function shall return with dt_lock unlocked.
Error handling code in both functions do not handle this, fix it by
doing necessary lock/unlock.

While there, fix minor style nits.

Approved by:	re (kensmith)
2008-09-23 17:23:59 +00:00
Konstantin Belousov 996ec991cf MFC r182959:
Remove warning about static LDT segment allocation. Applications
continue using it after ~7 years since warning was introduced, and there
is no reason to discourage them.

Approved by:	re (kensmith)
2008-09-23 17:16:24 +00:00
John Baldwin 561d33e415 MFC: 179296
To date, our implementation of munmap(2) has required that the
entirety of the specified range be mapped.  Specifically, it has
returned EINVAL if the entire range is not mapped.  There is not,
however, any basis for this in either SuSv2 or our own man page.
Moreover, neither Linux nor Solaris impose this requirement.  This
revision removes this requirement.

Approved by:	re (kib)
2008-09-23 16:03:32 +00:00
John Baldwin 975d9e5f41 MFC: 179623
Essentially, neither madvise(..., MADV_DONTNEED) nor madvise(..., MADV_FREE)
work.  (Moreover, I don't believe that they have ever worked as intended.)
The explanation is fairly simple.  Both MADV_DONTNEED and MADV_FREE perform
vm_page_dontneed() on each page within the range given to madvise().  This
function moves the page to the inactive queue.  Specifically, if the page is
clean, it is moved to the head of the inactive queue where it is first in
line for processing by the page daemon.  On the other hand, if it is dirty,
it is placed at the tail.  Let's further examine the case in which the page
is clean.  Recall that the page is at the head of the line for processing by
the page daemon.  The expectation of vm_page_dontneed()'s author was that
the page would be transferred from the inactive queue to the cache queue by
the page daemon.  (Once the page is in the cache queue, it is, in effect,
free, that is, it can be reallocated to a new vm object by vm_page_alloc()
if it isn't reactivated quickly enough by a user of the old vm object.)  The
trouble is that nowhere in the execution of either MADV_DONTNEED or
MADV_FREE is either the machine-independent reference flag (PG_REFERENCED)
or the reference bit in any page table entry (PTE) mapping the page cleared.
Consequently, the immediate reaction of the page daemon is to reactivate the
page because it is referenced.  In effect, the madvise() was for naught.
The case in which the page was dirty is not too different.  Instead of being
laundered, the page is reactivated.

Note: The essential difference between MADV_DONTNEED and MADV_FREE is
that MADV_FREE clears a page's dirty field.  So, MADV_FREE is always
executing the clean case above.

This revision changes vm_page_dontneed() to clear both the machine-
independent reference flag (PG_REFERENCED) and the reference bit in all PTEs
mapping the page.

Approved by:	re (kib), alc
2008-09-23 15:59:38 +00:00
John Baldwin 9539d16116 MFC: Fix vnode interlocking in QUOTA lock upgrade case in ufs_access().
Approved by:	re (kib)
2008-09-23 15:57:39 +00:00
Matteo Riondato 14e82858ea MFC rev 1.5 (r182853)
Use %d to print numfibs

Approved by:	re
2008-09-23 12:17:20 +00:00
Konstantin Belousov 0e41de08a4 MFC r180607 (by jeff):
Check whether we've recorded this tick in ts_ticks on another cpu in
sched_tick() to prevent multiple increments for one tick. This pushes
the value out of range and breaks priority calculation.

Approved by:	re (rwatson)
2008-09-23 11:56:07 +00:00
Roman Kurakin ba24f0da42 MFH: 182818, 182823, 182825, 183012 - IPFW_DEFAULT_RULE related fixes.
New Revision: 182818
 URL: http://svn.freebsd.org/changeset/base/182818

 Log:
  Export the IPFW_DEFAULT_RULE outside ip_fw2.c.  This number in not only
  the default rule number but also the maximum rule number.  User space
  software such as ipfw and natd should be aware of its value.  The
  software that already includes ip_fw.h should use the defined value.  All
  other a expected to use sysctl (as discussed on net@).

  MFC after: 5 days.
  Discussed on: net@

 Modified:
  head/sys/netinet/ip_fw.h
  head/sys/netinet/ip_fw2.c

 New Revision: 182823
 URL: http://svn.freebsd.org/changeset/base/182823

 Log:
  Use IPFW_DEFAULT_RULE instead of hardcoded value since now it is
  available.

  MFC after:    5 days.

 Modified:
  head/sbin/ipfw/ipfw2.c

 New Revision: 182825
 URL: http://svn.freebsd.org/changeset/base/182825

 Log:
  Check rule numbers against maximum value to avoid rules cleanup due
  to overflow.

  MFC after:    5 days.

 Modified:
  head/sbin/natd/natd.c

 New Revision: 183012
 URL: http://svn.freebsd.org/changeset/base/183012

 Log:
  Make the commet for the default rule number more clear.

  Submitted by:    yar@

 Modified:
  head/sys/netinet/ip_fw.h

Approved by:	re (kensmith)
2008-09-23 10:36:37 +00:00
Roman Divacky 32b487bbae Merge r182892 from head to stable/7, I had to manually
change the code to include "thread" argument to the vn_lock()
which got removed in HEAD:

	Getdents requires padding with 2 bytes instead of 1 byte
	as with getdents64. The last byte is used for storing
	the d_type, add this to plain getdents case where it was
	missing before. Also change the code to use strlcpy instead
	of plain strcpy. This changes fix the getdents crash we
	had reports about (hl2 server etc.)

	PR:		kern/117010
	MFC after:	1 week
	Submitted by:	Dmitry Chagin (dchagin@)
	Tested by:	MITA Yoshio <mita ee.t.u-tokyo.ac jp>
	Approved by:	kib (mentor)
	Approved by:	re (kensmith)
2008-09-22 20:19:54 +00:00
Jung-uk Kim e32322e6a7 MFC: r183190
Clean up DSDT and XSDT correctly instead of FADT when the tables are bad.

Submitted by:	jhb
Approved by:	re (kib)
2008-09-22 15:57:58 +00:00
Andrew Thompson 5030a0a0bf MFC r183135
Make sure there is at least one port to avoid divide by zero when choosing the
 tx port.

Approved by:	re (kensmith)
2008-09-21 06:01:03 +00:00
David E. O'Brien d011cf5539 Cast bd_rcount, bd_dcount, and bd_fcount to intmax_t for printing
until the base types for these are synced with 8-CURRENT.

Approved by:	re(kensmith)
2008-09-19 15:09:44 +00:00
Konstantin Belousov e0d05e664d MFC r182193 (libc part):
Document WNOWAIT.

Approved by:	re (kensmith)
2008-09-19 13:32:17 +00:00
Konstantin Belousov 82f529165d MFC r182193:
Implement WNOWAIT flag for wait4(2). It specifies that process whose status
is returned shall be kept in the waitable state.
Add WSTOPPED as an alias for WUNTRACED.

MFC r182424 (by davidxu):
Don't remove queued SIGCHLD if options contain WNOWAIT, so other
threads still can be notified by the signal.

Approved by:	re (kensmith)
2008-09-19 09:48:25 +00:00
Doug Rabson 1c4d63e491 MFC: r178692 - make sure we initialise delegated creds properly.
This fixes a crash in sshd when a user authenticates using GSS-API.

Approved by:	re (kensmith)
2008-09-19 07:59:20 +00:00
Pyun YongHyeon 72425a12c2 MFC r182808:
Read ethernet address from ID registers for RTL8102E/RTL8102EL as
  reading from EEPROM doesn't seem to work on these controllers.

  Reported by:	Milan Obuch ( freebsd-net at dino dot sk )
  Tested by:	Milan Obuch ( freebsd-net at dino dot sk )
  Approved by:	re (kensmith)
2008-09-19 03:36:53 +00:00
Andrew Thompson 9a569c8045 MFC r182777
Remove the alignment of the align parameter. This is up to the caller to pass
 in and it breaks tap(4) on strict alignment machines as m_uiotombuf is called
 with ETHER_ALIGN.

Approved by:	re (kensmith)
2008-09-19 01:10:19 +00:00
Oleg Bulyzhin bbb97baad7 MFC: 182874
bge_tick(): do not touch PHY if link is up. This should solve problem with
extra input errors for some BCM57XX chips.

PR:		kern/122295
Approved by:	re (kensmith)
2008-09-18 22:24:49 +00:00
John Baldwin 243f47c7ce MFC: Update comments about the 0xcf9 register reset method.
Approved by:	re (kensmith, kib)
2008-09-18 20:20:00 +00:00
John Baldwin 7c7c60dfe3 MFC: 180352
In FreeBSD 7.0 and beyond, pmap_growkernel() should pass VM_ALLOC_INTERRUPT
to vm_page_alloc() instead of VM_ALLOC_SYSTEM.  VM_ALLOC_SYSTEM was the
logical choice before FreeBSD 7.0 because VM_ALLOC_INTERRUPT could not
reclaim a cached page.  Simply put, there was no ordering between
VM_ALLOC_INTERRUPT and VM_ALLOC_SYSTEM as to which "dug deeper" into the
cache and free queues.  Now, there is; VM_ALLOC_INTERRUPT dominates
VM_ALLOC_SYSTEM.

While I'm here, teach pmap_growkernel() to request a prezeroed page.

Approved by:	re (kib), alc
2008-09-17 21:05:31 +00:00
John Baldwin be4e555358 MFC: Recognize architectural support for 1GB virtual pages.
Approved by:	re (kib), alc
2008-09-17 20:49:42 +00:00
John Baldwin 157d0a7deb MFC: 174104
Improve get_pv_entry()'s handling of low-memory conditions.  After page
allocation fails and pv entries are reclaimed, there may be an unused pv
entry in a pv chunk that survived the reclamation.  However, previously,
after reclamation, get_pv_entry() did not look for an unused pv entry in
a surviving pv chunk; it simply retried the page allocation.  Now, it
does look for an unused pv entry before retrying the page allocation.

Note: This only applies to RELENG_7.  Earlier branches use a different
pv entry allocator.

Approved by:	re (kib), alc
2008-09-17 20:38:18 +00:00
John Baldwin 767bab2e7c MFC: Account for pv entry pages in the total number of wired pages.
(Note: pv entry pages have always been included in the total number of
wired pages on i386 just not amd64.)

Approved by:	re (kib), alc
2008-09-17 20:34:02 +00:00
John Baldwin b0422907f4 MFC: 173901,173918
- Tidy up: Add comments.  Eliminate the pointless
  malloc_type_allocated(..., 0) calls that occur when contigmalloc() has
  failed.  Eliminate the acquisition and release of the page queues lock
  from vm_page_release_contig().  Rename contigmalloc2() to
  contigmapping(), reflecting what it does.
- Make contigmalloc(9)'s page laundering more robust.  Specifically, use
  vm_pageout_fallback_object_lock() in vm_contig_launder_page() to better
  handle a lock-ordering problem.  Consequently, trylock's failure on the
  page's containing object no longer implies that the page cannot be
  laundered.

Approved by:	re (kib), alc
2008-09-17 20:30:42 +00:00
John Baldwin 5626b9574a MFC: Disable the inline assembly crc32 routine and use the C version
instead.

Approved by:	re (kib)
2008-09-17 20:14:19 +00:00
John Baldwin f32aa01ffb MFC: Add a proper detach method to est(4).
Approved by:	re (kib)
2008-09-17 20:12:24 +00:00
Xin LI 69b53ea9c2 Merge English revisions as of 182972.
Approved by:	re (hrs)
2008-09-17 19:04:03 +00:00
John Baldwin 5b653f0003 MFC: Add the dpms(4) driver to use the VESA BIOS for DPMS during suspend and
resume.

Approved by:	re (kensmith)
2008-09-17 18:13:16 +00:00
Konstantin Belousov 2688db3b3d MFC r182890:
Remove superfluous copyin() of args, structures are already in kernel space.

Approved by:	re (kensmith)
2008-09-17 08:05:39 +00:00
Gregory Neil Shapiro 1556e9dff0 Note sendmail 8.14.3 upgrade
Approved by:	re (kib)
2008-09-17 04:51:10 +00:00
Pyun YongHyeon 5a710461e8 MFC r182887-182888:
r182887:
  Fix typo which resulted in invalid configuration for JMC260.

 r182888:
  Add workaround for CRC errors seen at 100Mbps on JMC250 A2.
  While here update chip revision number of JMC250/JMC260 from the
  latest datasheet.

Approved by:	re (kensmith)
2008-09-17 03:51:32 +00:00
John Baldwin 5b9fe6fb5c MFC: Adjust the probe order further so that Host-PCI bridges are probed
in the same order that they used to be probed.  Now we just give CPUs a
rediculously high order to ensure they are last.

Approved by:	re (kib)
2008-09-16 20:07:08 +00:00
John Baldwin dea8b454a5 MFC: Set UMA_ZONE_NOFREE for turnstiles so that the per-turnstile spin
locks are type stable.

Approved by:	re (kib)
2008-09-16 20:04:37 +00:00
John Baldwin 160dd072bb MFC: Close a race in sleepq_broadcast() where the sleepq could be reused
after it had been assigned to the last sleeping thread.

Approved by:	re (kib)
2008-09-16 20:01:57 +00:00
Robert Watson a7d670c4b6 Conditionalize setting udp6_usrreqs.pru_soreceive to soreceive_dgram
on #ifdef INET, as we don't define udp6_usrreqs when IPv6 isn't
compiled into the kernel.

Reported  by:	bf <bf2006a at yahoo dot com>,
		Kovacs Robert <robi at datanet.hu>
Approved by:	re (kib)
2008-09-16 18:52:51 +00:00
Edwin Groothuis 9403a19a21 MFC of tzdata2008f - SVN rev 183066:
Changes for Mauritius, Morocco, Pakistan, Palestine, Argentina and Brazil.

Approved by:	re (kib@)
2008-09-16 10:53:50 +00:00
Robert Watson 2af76becb0 Merge r180198, r180211, r180365, r182682 from head to stable/7:
Add soreceive_dgram(9), an optimized socket receive function for use by
  datagram-only protocols, such as UDP.  This version removes use of
  sblock(), which is not required due to an inability to interlace data
  improperly with datagrams, as well as avoiding some of the larger loops
  and state management that don't apply on datagram sockets.

  This is experimental code, so hook it up only for UDPv4 for testing; if
  there are problems we may need to revise it or turn it off by default,
  but it offers *significant* performance improvements for threaded UDP
  applications such as BIND9, nsd, and memcached using UDP.

  Tested by:      kris, ps

  Update copyright date in light of soreceive_dgram(9).

  Use soreceive_dgram() and sosend_dgram() with UDPv6, as we do with UDPv4.

  Tested by:      ps

  Remove XXXRW in soreceive_dgram that proves unnecessary.

  Remove unused orig_resid variable in soreceive_dgram.

  Submitted by:   alfred

Note: in the MFC, we do enable sosend_dgram for UDPv6 by default (it was
already used for UDPv4), but use of soreceive_dgram for both UDPv4 and
UDPv6 is controlled by a new loader tunable,
net.inet.udp.soreceive_dgram_enabled as soreceive_dgram has less testing
exposure than sosend_dgram.  We may wish to change the default (and
eliminate the tunable) in 7.2.

MFC requested by:	gnn, kris, ps
Approved by:		re (kib)
2008-09-15 20:46:32 +00:00
Michael Reifenberger ea341e943e Add missing hooks for DTRACE so that dtraceall.ko could be loaded.
Approved by:	re (kosticbel)
2008-09-15 20:11:06 +00:00
Konstantin Belousov d496324834 MFC r182868:
The pcb_gs32p should be per-cpu, not per-thread pointer. This is
location in GDT where the segment descriptor from pcb_gs32sd is
copied, and the location is in GDT local to CPU.

Approved by:	re (kensmith)
2008-09-15 19:51:32 +00:00
Konstantin Belousov 4ea46f8478 MFC r182867:
Provide private per-CPU GDTs on amd64.

Approved by:	re (kensmith)
2008-09-15 19:47:59 +00:00
Konstantin Belousov 176752bd3f MFC r182866:
In linux_set_thread_area(), mark pcb as PCB_GS32BIT.

Approved by:	re (kensmith)
2008-09-15 19:44:39 +00:00
Konstantin Belousov 2feda37ff0 MFC r182849:
Segment registers are stored in the uc_mcontext member of the struct
l_ucontext. To restore the registers content, trampoline needs to
dereference uc_mcontext instead of taking some undefined values from
l_ucontext.

Approved by:	re (kensmith)
2008-09-15 19:40:49 +00:00
Konstantin Belousov 880a184c29 MFC r182865:
Fix inconsistencies in the comments.

Approved by:	re (blackend)
2008-09-15 09:35:29 +00:00
Marius Strobl 76920dbfba MFC: r182688
Bypass isa_probe_children(9) and directly call bus_generic_attach(9)
in order to avoid the invasive probes done by identify-routines of
ISA drivers, which may access unassigned addresses or those of
unrelated devices and thus in turn can trigger master/target aborts
as revealed by r182108 and ahc(4). I think that this is also the
cause of the hang previously seen on B100 blades during boot.
Bypassing isa_probe_children(9) also avoids adding ISA hints, which
just can be wrong for sparc64.

Approved by:	re (kib)
2008-09-13 15:17:21 +00:00
Alexander Motin 1860d3b630 MFC r182749
Add one more SII3132 chip PCI ID found on Adaptec Serial ATA II RAID 1220SA.

Submitted by:	Dmitry S. Luhtionov <[email protected]>

Approved by:	re (kib)
2008-09-13 07:36:16 +00:00
Robert Watson d4b17d864c Extend global UNIX domain socket rwlock coverage to include incrementing
and decrementing unp_rights, which may otherwise be corrupted.  Be
slightly more conversative in where we read unp_rights.

This relates to one of the symptoms reported in the noted PR, but may not
correct the actual high system time problem.  The reporter has confirmed
stability but not that the problem is eliminated.  However, this is a
useful fix to a clear locking bug.

Note that this is not an MFC as the UNIX domain socket garbage collector
has been replaced in 8.x.

PR:		127024
Reported by:	Anton Yuzhaninov <citrin at citrin dot ru>
Reviewed by:	kib
Approved by:	re (kib)
2008-09-13 00:16:20 +00:00
Ollivier Robert bc9a4ca7fc MFH r182857:
Apply updated patch from bin/92839 to avoid two possible buffer overflows.
PR:		bin/92839
Submitted by:	Helge Oldach <[email protected]>
Approved by:	re (gnn)
2008-09-12 22:18:35 +00:00
Ollivier Robert c1124c3fc6 MFH r182944:
Makefile.inc already defines OPENSSL if crypto is available/wanted.

PR:		bin/127296
Submitted by:	olivier
Approved by:	re (gnn)
2008-09-12 22:15:43 +00:00
John Baldwin a22b1b27f3 MFC: Use kvm_getcptime() to fetch the equivalent of the kern.cp_time sysctl
from a crash dump.

Approved by:	re (kib)
2008-09-12 21:50:42 +00:00
John Baldwin 19f23ba034 MFC: Fail detach if cpufreq_unregister() fails.
Approved by:	re (kensmith)
2008-09-12 21:46:23 +00:00
John Baldwin 556b6361f8 MFC: Remove the never-enabled attempt at using device cloning to provide
per-file descriptor storage and replace it with cdevpriv (and enable it)
instead.

Approved by:	re (kib)
2008-09-12 21:44:31 +00:00
John Baldwin 452dd69769 MFC: Adjust the handling of the various timer frequencies when using the
lapic timer to use dynamic divisors and try to keep stathz around 128.

Approved by:	re (kib)
2008-09-12 21:40:57 +00:00
John Baldwin 759cf963c4 MFC: Fix two places that used && instead of & to test if OBF was set.
Approved by:	re (kib)
2008-09-12 21:36:48 +00:00
John Baldwin 16dda669b9 MFC: Add a script to perform simple analysis of a crash dump.
Approved by:	re (kib)
2008-09-12 21:30:54 +00:00
John Baldwin 36618d6bfb MFC: Only count the number of CPUs in the rendezvous map once, use
CPU_ABSENT(), and count up to mp_maxid.

Approved by:	re (kib)
2008-09-12 21:07:22 +00:00
John Baldwin c0b37a7029 MFC: Fix a spin lock LOR when waking up a thread from a process that is
swapped out by deferring the wakeup of the swapper kernel process until
after releasing sleepq chain locks.

Approved by:	re (kib)
2008-09-12 21:00:11 +00:00
Xin LI 53cdcac04c MFC r182739: license change from NetBSD.
Approved by:	re (kib)
2008-09-12 20:35:17 +00:00
John Baldwin bfbe1bdfe1 MFC: Don't disable USB in the PAE kernel config.
Approved by:	re (kib)
2008-09-12 20:09:05 +00:00
Bjoern A. Zeeb a9721f3f59 MFC: svn r182885, cvs rev. 1.381 tcp_input.c
Work around an integer division resulting in 0 and thus the
  congestion window not being incremented, if cwnd > maxseg^2.
  As suggested in RFC2581 increment the cwnd by 1 in this case.

  See http://caia.swin.edu.au/reports/080829A/CAIA-TR-080829A.pdf
  for more details.

Submitted by:	Alana Huebner, Lawrence Stewart,
		Grenville Armitage (caia.swin.edu.au)
Reviewed by:	dwmalone, gnn, rpaulo, silby
Approved by:	re (gnn)
2008-09-12 19:28:57 +00:00
Remko Lodder ccd590a8f4 MFC r182854
Fix deactivation of speakers while plugging in headphones on Fujitsu
  U1010, Lenovo 3k N200 and Acer Aspire 4715Z.

  Reviewed by:    attilio
  PR:             126216, 126244, 127034
  Submitted by:   Anton E. Kartashev <[email protected]>,
                  Ganael Laplanche <[email protected]>,
                  Dennis Generaloff <[email protected]>

Requested by:	joel
Approved by:	re (kib, via joel), imp (mentor, implicit)
Obtained from:	joel
2008-09-12 18:37:52 +00:00
Rui Paulo 515b461ae3 MFC r182722:
Fix the sysctl function parameters. We were only querying Sensor 0.
   Noticed by:     des

Approved by:	re
2008-09-12 18:26:09 +00:00
Konstantin Belousov 36de44abed MFC r182816:
Document BUS_DMA_NOCACHE.

MFC r182962:
Remove unneeded comma.

Approved by:	re (kensmith)
2008-09-12 13:08:12 +00:00
Tim Kientzle 46a0d1255b MFC r182838: Correct tar -xP so that it will follow symlinks to
existing dirs.

Approved by:	re (Kostik Belousov)
2008-09-12 04:34:56 +00:00
Kip Macy 66aed32b39 MFC 182899
- Fix regression with GETMEM
  - Remove gratuitous bswap macros
  - check for rev 3 with t3b

Approved by:	re
Obtained from:	Chelsio Inc.
2008-09-11 23:58:46 +00:00
Kip Macy a5ef47a36b MFC 181614
Vendor fix for PHY problem.

Approved by:	re
Obtained from:	Chelsio Inc
2008-09-11 23:53:08 +00:00
Kip Macy ac2ff7ad3e MFC 182591
Don't check if an interface can do tcp offload if there are no offload devices registered on the system.

Approved by:	re
2008-09-11 23:49:36 +00:00
John Baldwin 5243efd391 MFC: Use single byte read and write operations to toggle the BIOS and OS
semaphores rather than 4 byte operations.

Approved by:	re (kensmith)
2008-09-11 19:36:03 +00:00
John Baldwin 2cc2ce9656 MFC: Several changes (181759-181762) to allow the "simple" and "client"
firewall configurations to be configured (interfaces and attached networks)
from rc.conf rather than requiring users to edit /etc/rc.firewall directly.

Approved by:	re (kensmith)
2008-09-11 19:08:51 +00:00
John Baldwin 8ce6aaf0ef MFC: Use default CPU compiler flags that work on all amd64-capable CPUs
when building 32-bit compat libs.

Approved by:	re (kensmith)
2008-09-11 18:59:53 +00:00
Kip Macy 66ac8afb6e MFC: r182594, r182679, r182694, r182899
Bring cxgbtool and corresponding ioctl interfaces up to version 1.5

Approved by:	re
Obtained from:	Chelsio Inc.
2008-09-11 04:21:05 +00:00
Kip Macy 29073a03bc MFC 182882:
Fix issue with recovering from transient jumbo mbuf shortage.

Submitted by:	Chelsio Inc
Approved by:	re
2008-09-10 23:41:49 +00:00
Kip Macy 7137ab542c MFC 182089:
Don't calculate checksum if it has already been validated
lro_opt.diff

Approved by:	re
Obtained from:	Chelsio Inc.
2008-09-10 23:37:06 +00:00
John Baldwin 653c7b1f4b MFC: Use ppc_detach() for device_detach instead of ppc_attach().
Approved by:	re (kensmith)
2008-09-10 22:46:02 +00:00
John Baldwin a7ba5d73f9 MFC: Add more PCI IDs including those for ICH10.
Approved by:	re (kensmith)
2008-09-10 21:53:15 +00:00
Andrew Thompson dc6b1d8b27 Revert r180140 for 6.4 and 7.1 where the bridge mac address is taken from the
first member, there were problems reported in edge cases and using pppoe.

Reviewed by:	philip
Approved by:	re (kensmith)
2008-09-08 03:18:00 +00:00
Tim Kientzle 3e779741a8 MFC r182587: If atime is missing, use time at which program started
instead of substituting mtime

Approved by:	re (Ken Smith)
2008-09-06 06:01:45 +00:00
Florent Thoumie a9845a8611 MFC r180507: enhance volume handling.
PR:		bin/125054
Submitted by:	gahr
Approved by:	re (gnn)
2008-09-05 14:08:26 +00:00
Jung-uk Kim b088d533e1 MFC: r182380
Validate scratch memory addresses for BPF_STX and BPF_LDX|BPF_MEM.
A badly written filter was able to reference invalid addresses,
even cause kernel crash.

Approved by:	re (kensmith)
2008-09-04 15:18:32 +00:00
Jung-uk Kim 83af9b8899 MFC: Sync. BPF JIT compiler with HEAD.
- r182172:
Embed scratch memory in the filter structure.

- r182173:
Fix a typo in copyrights.

- r182220:
Move empty filter handling to MI source.

- r182376:
Initialize scratch memory for JIT-compiled filter when it is allocated.
Previously it may have contained unnecessary (even sensitive) data from
the previous allocation.
As a (good) side effect, scratch memory may be used to store the previous
filter state(s) safely because it is allocated and freed with filter itself.
However, use it carefully because bpf_filter(9) does not have this behavior.

Approved by:	re (kensmith)
2008-09-04 15:15:39 +00:00
Nathan Whitehorn 2a8ac4f89a MFC r182670, which fixes a multiple locking bug that would panic WITNESS-enabled kernels.
Approved by:	re, marcel (mentor)
2008-09-04 14:37:53 +00:00
Konstantin Belousov 2c62769025 MFC r182600:
In rev. 1.17 (r33548) of msdosfs_fat.c, relative cluster numbers were
replaced by file relative sector numbers as the buffer block number
when zero-padding a file during extension. Revert the change, it causes
wrong blocks filled with zeroes on seeking beyond end of file.

PR:	kern/47628
Approved by:	re (kensmith)
2008-09-04 14:25:10 +00:00
Konstantin Belousov b5dc661b5f MFC r182684:
- When executing FreeBSD/amd64 binaries from FreeBSD/i386 or Linux/i386
  processes, clear PCB_32BIT and PCB_GS32BIT bits.

- Reread the fs and gs bases from the msr unconditionally, not believing
  the values in pcb_fsbase and pcb_gsbase, since usermode may reload
  segment registers, invalidating the cache.

Approved by:	re (kensmith)
2008-09-04 13:51:08 +00:00
George V. Neville-Neil 6fbc3ece65 MFC of change 182463. Fix a bug in the multicast loopback code that
causes packets that are looped back to have the wrong checksum when
transmitted on the wire.

PR:		kern/119635
Reviewed by:	rwatson
Approved by:	re (rwatson)
2008-09-03 22:40:38 +00:00
Simon L. B. Nielsen 86892f34ae - Fix amd64 local privilege escalation. [08:07]
- Fix nmount(2) local privilege escalation. [08:08]
- Fix IPv6 remote kernel panics. [08:09]

Fix for [08:07] is merge of r181823.

Submitted by:	kib [08:07], csjp [08:08], bz [08:09]
Reviewed by:	peter [08:07], jhb [08:07]
Reviewed by:	jinmei [08:09], rwatson [08:09]
Approved by:	re (SA blanket)
Approved by:	so (simon)
Security:	FreeBSD-SA-08:07.amd64
Security:	FreeBSD-SA-08:08.nmount
Security:	FreeBSD-SA-08:09.icmp6
2008-09-03 19:09:47 +00:00
Robert Watson ea162ac5b0 Merge r182537 from head to stable/7:
In UDPv6, reduce scope of global udbinfo lock during append to last
  matching socket by dropping it before udp6_append(), and remove
  duplicate unlocks of udbinfo and inpcb in sysctl return path.

Approved by:	re (kensmith)
2008-09-03 18:49:42 +00:00
Bjoern A. Zeeb 67bc00ba26 MFC: svn 182713, cvs rev. 1.35 mld6.c
Fix a bug, when a specially crafted ICMPV6 MLD packet could lead
  to an integer divide by zero panic in the kernel, if the kernel was
  run with hz<1000.
  Neither i386, pc98, amd64 or sparc64 are affected in the currently
  supported branches and default configuration.

Submitted by:	Miikka Saukko, Ossi Herrala and Jukka Taimisto from
		the CROSS project at Codenomicon Ltd. via CERT-FI.
Reviewed by:	bz, rwatson
Approved by:	re (SA blanket)
Approved by:	so (simon)
Security:	CVE-2008-2464
2008-09-03 17:11:39 +00:00
Dag-Erling Smørgrav 4f82001a9c Revert to previous behaviour re host keys. I inadvertently merged a little
too much from head.

Approved by:	re (kensmith)
2008-09-03 12:45:31 +00:00
Edward Tomasz Napierala af6e16500e MFC: Fix ACL preservation.
Approved by:	re (kensmith), rwatson (mentor)
2008-09-03 10:09:31 +00:00
Ollivier Robert 39f3a5eafe Note the ntpd upgrade.
Approved by:	re (kensmith)
2008-09-03 08:50:30 +00:00
Ollivier Robert 5cccd1d649 MFH ntpd 4.2.4p5.
Approved by:	re (kensmith)
2008-09-03 08:49:07 +00:00
Doug Rabson dd8997457e MFC: r182153 - fix interoperability issues with Mac OS X.
PR:		126561
Submitted by:	Richard.Conto sy gmail.com
Approved by:	re (kensmith)
2008-09-03 07:49:49 +00:00
Julian Elischer 017fd80e25 Allow users to add new p2p links that have routes on only the required FIB.
Approved by:	 re (kensmith)
2008-09-02 19:54:07 +00:00
VANHULLEBUS Yvan c00f71fd3b MFC: Add lifetime informations to generated SPD entries when SPDDUMP
Approved by:	re
2008-09-02 19:36:47 +00:00
Gregory Neil Shapiro ec13c5658a MFC r182675: Fix an ABI breakage found after the import that will
be part of the next version of sendmail.  Putting it in now for the
upcoming 7-BETA and 6-BETA test releases.

Submitted by:	Mike Tancsa
Approved by:	re (kensmith)
2008-09-02 05:08:26 +00:00
Dag-Erling Smørgrav 088e4a0aa1 Note the OpenSSH upgrade. 2008-09-01 23:53:55 +00:00
Dag-Erling Smørgrav a20ce35d83 Document the correct algorithm preference. 2008-09-01 23:49:34 +00:00
Marius Strobl b3aee8da21 Revert the part of r182385 which sets PCIB_BCR_MASTER_ABORT_MODE
in order to detect misbehaving drivers. While this should be fine
in generally, it's probably no good idea to do so shortly before
a new release.
2008-09-01 20:19:14 +00:00
Dag-Erling Smørgrav 6f81ab27c9 MFH OpenSSH 5.1p1 2008-09-01 20:03:13 +00:00
David E. O'Brien 8cab8b2d23 MFC: r174510: Clean up VCS Ids. 2008-09-01 19:23:04 +00:00
David E. O'Brien 2c79d21760 MFC: r174596: style.Makefile(5) 2008-09-01 19:02:27 +00:00
David E. O'Brien eaa89954e7 MFC: r174598: Complete merge of "add comment to pc_cp_time" to -CURRENT. 2008-09-01 19:01:18 +00:00
David E. O'Brien 0d368f620e MFC: r174756: Be more exact with sigaction SA_SIGINFO handling. 2008-09-01 18:59:20 +00:00
David E. O'Brien 0b63ebb7ab MFC: r175053: style(9) 2008-09-01 18:38:29 +00:00
David E. O'Brien 037763d0e6 MFC: r175058: Note what is too {short,long}. 2008-09-01 18:31:43 +00:00
David E. O'Brien eda90c85db MFC: r175162: un-__P() 2008-09-01 18:29:39 +00:00
David E. O'Brien 68ab9cdf0a MFC: r179164: "options " spelling (vs. "options<TAB>") so that commented
lines line up nicely.
2008-09-01 18:11:22 +00:00
David E. O'Brien 7c4360a5cd MFC: r180447: Improve readability and cscope searches a little bit. 2008-09-01 18:06:44 +00:00
Yaroslav Tykhiy 1bd9870c7b MFC r182616:
Correct a silly typo I introduced: withing -> within.
2008-09-01 17:52:01 +00:00
David E. O'Brien d8e7f1a146 MFC: 182391: Protect _IOC's 'len' and 'inout' parameters. 2008-09-01 17:50:33 +00:00
David E. O'Brien 094117de4f MFC: r178986: Add -8 switch to syslogd to prevent it from mangling 8-bit data. 2008-09-01 16:10:47 +00:00
David E. O'Brien abe489c470 MFC: r176427: Two no-op fixes to improve corretness of syslogd code:
1) Use [AP]F_LOCAL rather than [AP]F_UNIX.
2) When copying a pipe's name, use f->f_un.f_pipe.f_pname, not f->f_un.f_fname.
2008-09-01 16:10:09 +00:00
David E. O'Brien 696c3200cd MFC: r174533, r182605:
+ Open ctty in non-blocking mode to avoid hangs during open and close(waiting
  for the port to drain).
+ Handle "*" as a priority properly.
+ Test what is free'ed.
+ Dynamically determine length vs. hardcoding it.
+ Free the previous message buffer (f_prevline) only after logging all the
  messages and just before the process exit.  Also check f_prevline for NULL
  before using it.
+ The time displayed is not synchornized with the other log destinations.
+ Fix a comment.
+ Remove extraneous NULL pointer check - the pointer is guaranteed to be
  non-NULL.
2008-09-01 16:09:07 +00:00
David E. O'Brien 411b13172c MFC: r182602: Minimize changes CURRENT<->releng7. 2008-09-01 15:05:19 +00:00
Matteo Riondato 29d5633758 Don't return always 0. Return what we get from exec_mountprog or
mount_fs.

PR:             bin/125154
2008-09-01 08:37:13 +00:00
Kip Macy dd5d64dbc4 fix LINT build 2008-09-01 07:37:41 +00:00
Kip Macy 43b241f085 MFC 177530:
Insulate inpcb consumers outside the stack from the lock type and offset within the pcb by adding accessor functions.
2008-09-01 04:48:59 +00:00
Andrew Thompson e644c161b4 MFC r181824
Fix ARP in bridging scenarios where the bridge shares its
 MAC address with one of its members.
2008-09-01 02:17:31 +00:00
John Birrell 3ee217e2ed Disable debug mode.
This is the likely cause of the performance degradation noticed by ZFS
users after the DTrace merge.
2008-09-01 02:00:23 +00:00
Marius Strobl 12302036a9 MFC: r182461
For chips with a broken DC_ISR_RX_STATE which f.e. never signals
stopped nor the waiting state and also no other means to check
whether the receiver is idle (see also r163774), we have no choice
than to call mii_tick(9) unconditionally even in the case of the
DC_REDUCED_MII_POLL handling as far as the RX side is concerned.
This isn't necessarily worse than checking whether RX is idle
though because unlike as with TX we're racing with the hardware,
which might receive packets any time while we poll the MII, anyway.

Reported and tested by:	Jacob Owens
Reviewed by:		yongari
2008-09-01 00:42:00 +00:00
Robert Watson d53263797e Merge r182059, r182118 from head to stable/7:
When getaudit(2) is unable to fit the terminal IPv6 address into the
  space provided by its argument structure, return EOVERFLOW instead of
  E2BIG.  The latter is documented in Solaris's man page, but the
  former is implemented.  In either case, the caller should use
  getaudit_addr(2) to return the IPv6 address.

  Submitted by:   sson
  Obtained from:  Apple, Inc.

  Use ERANGE instead of EOVERFLOW selected in r182059, this seems more
  appropriate even if Solaris doesn't document it (E2BIG) or use it
  (EOVERFLOW).

  Submitted by:   nectar at apple dot com
  Sponsored by:   Apple, Inc.
2008-08-31 22:07:53 +00:00
Robert Watson 7620ebfe09 Merge r181966 from head to stable/7:
Remove comments and #ifdef notyet'd code relating to directly dispatching
  the IP multicast input code from the output path; we don't allow
  reentrance of the input path from the IP output path, it must use the
  netisr due to potential lock recursion.
2008-08-31 22:05:31 +00:00
Robert Watson 5ff476d8da Merge r180968 from head to stable/7:
When copying in and out current ICMPv6 filters on a raw IPv6 socket,
  lock the inpcb and use a local stack variable to copy to/from userspace
  so that sooptcopyin()/sooptcopyout() aren't called while holding an
  rwlock.

  While here, fix a bug in which a failed sooptcopyin() might lead to
  partially consistent ICMPv6 filters on the socket by not ignoring the
  error returned by sooptcopyin().
2008-08-31 21:54:24 +00:00
Robert Watson 102fbbbbfb Merge r181254 from head to stable/7:
Remove broken code to replace st_mode value with ACCESSPERMS when
  lstat(2) is called on symlinks -- this code appears never to have
  worked.  The PR this addresses suggests that the intended
  original behavior is the right one, but as bde points out in the
  PR comments, we do actually support storing a mode on symlinks,
  so returning it seems reasonable.

  This is consistent with Mac OS X, which despite documentation to
  the contrary does return the mode set on a symlink, but not some
  other platforms.  The Single Unix Spec requires only that the
  returned bits be "meaningful", which seems at best unhelpful as
  advice goes.

  PR:             25018
2008-08-31 21:27:05 +00:00
Robert Watson 32fe9d85b5 Merge r181240 from head to stable/7:
DDB scripting, textdumps, output capture, etc, all will appear in
  FreeBSD 7.1 before 8.0 ships.

  Spotted by:     Ulrich Spoerlein <uspoerlein at gmail dot com>
2008-08-31 20:40:47 +00:00
Robert Watson 5a3397aa46 Merge r181238 from head to stable/7:
DDB scripting, textdumps, output capture, etc, all will appear in
  FreeBSD 7.1 before 8.0 ships.

  Spotted by:     Ulrich Spoerlein <uspoerlein at gmail dot com>
2008-08-31 20:08:00 +00:00
Robert Watson a94ca26a31 Merge r180990 from head to stable/7:
Adopt the slightly weaker consistency locking approach used in IPv4 raw
  sockets for IPv6 raw sockets: separately lock the inpcb for determining
  the destination address for a connect()'d raw socket at the rip6_send()
  layer, and then re-acquire the inpcb lock in the rip6_output() layer to
  query other options on the socket.  Previously, the global raw IP socket
  lock was used, which while correct and marginally more consistent, could
  add significantly to global raw IP socket lock contention.
2008-08-31 20:06:20 +00:00
Robert Watson 54d8fba9a9 Merge r180965 from head to stable/7:
Since we fail IPv6 raw socket allocation if inp->in6p_icmp6filt can't
  be allocated, there's no need to conditionize use and freeing of it
  later.
2008-08-31 19:48:10 +00:00
Matteo Riondato b8027ff0f6 MFC r176549
Decrease ping6's minimum allowed interval
	from .01 to .000001.

	Note that due to the architecture of ping6,
	you are still limited to kern.hz pings per
	second.
2008-08-31 19:03:12 +00:00
Matteo Riondato 146aaca14f MFC r173765
Add -o option to match ping(8)
2008-08-31 19:01:02 +00:00
Dmitry Morozovsky 08e3170f20 MFC r181825: hw.ata.ata_dma_check_80pin tunable.
Approved by:	philip
2008-08-31 18:44:00 +00:00
Gregory Neil Shapiro e3a50a2182 MFC r182556: A no-op commit to simulate the effect of a forced commit so
the file has a new timestamp as needed for mergemaster.
2008-08-31 18:29:06 +00:00
Gregory Neil Shapiro 97d1db3046 MFC r182361: Google changed the location of the blacklists again. 2008-08-31 18:26:27 +00:00
Robert Watson 53ded87cae Merge r181069 from head to stable/7:
In mac_bsdextended's auditctl and acct policy access control checks,
  return success if the passed vnode pointer is NULL (rather than
  panicking).  This can occur if either audit or accounting are
  disabled while the policy is running.

  Since the swapoff control has no real relevance to this policy,
  which is concerned about intent to write rather than water under the
  bridge, remove it.

  PR:             kern/126100
  Reported by:    Alan Amesbury <amesbury at umn dot edu>
2008-08-31 18:23:42 +00:00
Matteo Riondato 635d57f211 MFC r182195, r182269, r182276
Implement -R support, similar to ping(8)'s -A and -r support, similar
to ping(8)'s -a.

PR:		bin/123752 (inspired by)
2008-08-31 18:07:15 +00:00
Andrew Thompson f5c195215e MFC r179409, r181973, r181974, r181975
- Fix baud on the Oxford OX16PCI954
 - Add the Avlab Technology PCI IO 4S-850 4 port serial card.
 - Add the VScom PCI-100L card.
 - Add the Decision Computer Inc, PCCOM 8-port serial card.

PR:		kern/110797, kern/72352, kern/69730
2008-08-31 18:04:16 +00:00
Nathan Whitehorn 437de1e19e Back out r182439 to move device bm to PowerPC-specific NOTES, and replace it by an MFC of r179646, which does the same thing.
Suggested by:	rwatson
Approved by:	marcel (mentor)
2008-08-31 17:23:45 +00:00
Robert Watson bd32ddeb06 Merge r181053 from head to stable/7:
Further synchronization of copyrights, licenses, white space, etc from
  Apple and from the OpenBSM vendor tree.

  Obtained from:  Apple Inc., TrustedBSD Project
2008-08-31 17:04:44 +00:00
Robert Watson 9b050e6faa Merge r180957 from head to stable/7:
Marginally decomplicate set/getsockopt code in ip6_output.c by simply
  using the passed arguments explicitly and unconditionally rather than
  testing them and calling panic().  The result is the same but easier
  to read.
2008-08-31 16:27:37 +00:00
Robert Watson 4c164f8a9a Merge r180391 from head to stable/7:
Rather than checking for a NULL so_pcb in raw_attach(), assert that
  it's non-NULL, as all callers can and should already do the required
  checking.  Update comments a bit more to talk about rawcb allocation
  for consumers.

  Reviewed by:    bz
2008-08-31 16:14:41 +00:00
Robert Watson 2eb8aaabf9 Merge r180390 from head to stable/7:
Add sysctl subtree net.raw for generic raw socket infrastructure;
  expose default send and receive socket buffer sizes using sysctls
  so that they can be administered centrally.

  Reviewed by:    bz
2008-08-31 16:02:54 +00:00
Robert Watson 6f53ede329 Merge r180385 from head to stable/7:
Remove unused support for local and foreign addresses in generic raw
  socket support.  These utility routines are used only for routing and
  pfkey sockets, neither of which have a notion of address, so were
  required to mock up fake socket addresses to avoid connection
  requirements for applications that did not specify their own fake
  addresses (most of them).

  Quite a bit of the removed code is #ifdef notdef, since raw sockets
  don't support bind() or connect() in practice.  Removing this
  simplifies the raw socket implementation, and removes two (commented
  out) uses of dtom(9).

  Fake addresses passed to sendto(2) by applications are ignored for
  compatibility reasons, but this is now done in a more consistent way
  (and with a comment).  Possibly, EINVAL could be returned here in
  the future if it is determined that no applications depend on the
  semantic inconsistency of specifying a destination address for a
  protocol without address support, but this will require some amount
  of careful surveying.

  NB: This does not affect netinet, netinet6, or other wire protocol
  raw sockets, which provide their own independent infrastructure with
  control block address support specific to the protocol.

  Reviewed by:    bz
2008-08-31 15:55:59 +00:00
Robert Watson f687a9aae7 Merge r180305 from head to stable/7:
Improve approximation of style(9) in raw socket code.
2008-08-31 15:39:06 +00:00
Robert Watson b30de35cfe Merge r180735 from head to stable/7:
Minor white space tweak.

  Obtained from:  Apple Inc.
2008-08-31 14:40:48 +00:00
Robert Watson 4958a36160 Merge r180716 from head to stable/7:
If an AUE_SYSCTL_NONADMIN audit event is selected, generate a record
  with equivilent content to AUE_SYSCTL.

  Obtained from:  Apple Inc.
2008-08-31 14:04:35 +00:00
Robert Watson f3ea4f7a60 Merge r180703, r180704, r180706, r180708, r180709, r180711, r180712,
and r180715 from head to stable/7:

  Minor white space synchronization to Apple version of security audit.

  Comment typo fix.

  Comment fix.

  Use #define<tab> rather than #define<space>.

  Generally avoid <space><tab> as a white space anomoly.

  Further minor white space tweaks.

  Remove unneeded \ at the end of a macro.

  Further minor style fixes to audit.

  Obtained from:  Apple, Inc.
2008-08-31 13:35:49 +00:00
Robert Watson 1e7c919137 Merge r180701 from head to stable/7:
In preparation to sync Apple and FreeBSD versions of security audit,
  pick up the Apple Computer -> Apple change in their copyright and
  license templates.

  Obtained from:  Apple Inc.
2008-08-31 13:24:32 +00:00
Robert Watson 173897923a Merge r180699 from head to stable/7:
Use unsigned int when iterating over groupsets in audit_arg_groupset().

  Obtained from:  Apple Inc.
2008-08-31 13:17:54 +00:00
Yaroslav Tykhiy 948de9a81c MFC r182107:
Explicitly tell that one needs to start a context address with a
  backslash if he/she wants to use a non-traditional delimiter, i.e.,
  anything other than a slash.  That is, /abc/ works as is, but xabcx
  needs to be spelled as \xabcx.

  Add appropriate markup.

  Bump Dd.
2008-08-31 12:59:45 +00:00
Olivier Houchard 76247694a7 Spell fake_preload_metadata correctly, to fix build. 2008-08-31 12:59:44 +00:00
Robert Watson 9e5b287596 Merge r180493 from head to stable/7:
The libc acl_valid(3) function validates the contents of a POSIX.1e ACL.
  This change removes the requirement that an ACL contain no ACL_USER
  entries with a uid the same as those of a file, or ACL_GROUP entries
  with a gid the same as those of a file.  This requirement is not in the
  specification, and not enforced by the kernel's ACL implementation.

  Reported by:    Iustin Pop <iusty at k1024 dot org>
2008-08-31 12:56:03 +00:00
Robert Watson 2b29b6068a Merge r180537 from head to stable/7:
Invoke err() with a format string rather than directly with a passed
  command line argument.

  Submitted by:   Alfredo Ortega <alfredo at coresecurity dot com>
  Thanks to:      Core Security Technologies
2008-08-31 12:50:01 +00:00
Robert Watson 93ab5bb044 Merge r180307 from head to stable/7:
Clarify comments and prototypes in raw_cb.h:

  - the protosw entries are used directly
  - the usrreq functions are library routines, generally wrapped by
    consumers rather than being used directly
  - the usrreq structure entries are likewise typically wrapped

  Remove the rather incorrect #if 0'd pr_input_t prototype for raw_input.
2008-08-31 12:42:39 +00:00
Robert Watson c0dbaa34e6 Merge r179331 from head to stable/7:
Remove two netatm-specific test parts.

  Spotted by:     bz

For reasons not entirely clear to me, svn merge didn't merge the deletions,
so I had to do that manually and apply mergeinfo using --record-only.
2008-08-31 11:39:56 +00:00
Robert Watson 6b15160a9e Merge r179330 from head to stable/7:
Remove now-obsolete Xref to ng_atmpif.4 from netgraph.4.

  Spotted by:     antoine
2008-08-31 10:53:23 +00:00
Robert Watson be90528ca2 Merge r179308 from head to stable/7:
Remove netatm from HEAD as it is not MPSAFE and relies on the now removed
  NET_NEEDS_GIANT.  netatm has been disconnected from the build for ten
  months in HEAD/RELENG_7.  Specifics:

  - netatm include files
  - netatm command line management tools
  - libatm
  - ATM parts in rescue and sysinstall
  - sample configuration files and documents
  - kernel support as a module or in NOTES
  - netgraph wrapper nodes for netatm
  - ctags data for netatm.
  - netatm-specific device drivers.

  Reviewed by:    bz
  Discussed with: bms, bz, harti

MFC discussed with:	des, peter
2008-08-31 10:15:43 +00:00
Konstantin Belousov 39f63c1c80 MFC r182111:
Revert the r167541: "Remove unneeded getinoquota() call in the
ufs_access()." The call to getinoquota in ufs_access() serves the
purpose of instantiating inode dquot from the vn_open(). Since quotas
are accounted only for the inodes with already attached dquot, removal
of the call prevented opened inodes from participation in the quota
calculations.

Since ufs_access() may be called with the vnode being only shared
locked, upgrade (and then downgrade) vnode lock if calling
getinoquota().

MFC r182115:
Put the relocked variable from  the r182111 into the #ifdef QUOTA braces
to prevent warning about unused var on the !QUOTA kernels.
2008-08-31 09:45:04 +00:00
Stefan Farfeleder 5937b4e56a MFC r182300: Correction to r177497's getopts fix. 2008-08-31 09:14:52 +00:00
Stefan Farfeleder d3b9238fd1 MFC r181017: Fix a crash with invalid redirections. 2008-08-31 09:11:41 +00:00
Stefan Farfeleder bee6da186d MFC r178625 and r178631: Usage of intmax_t and type fixes for arithmetic
expansion.
2008-08-31 09:08:11 +00:00
Stefan Farfeleder 3ee86032a1 MFC r179022 and r179387: Expansion of $LINENO. 2008-08-31 08:59:10 +00:00
Tim Kientzle 80af3e165e MFC r182360,r182470: If atime isn't specified, restore atime == mtime.
PR:		bin/124915
2008-08-31 04:45:21 +00:00
Craig Rodrigues ea771aab5d MFC: 182025
In nmount(), when we see the "force" option,
set the MNT_FORCE flag, but do not persist "force"
in the options list, since it is a command, not a persistent property
of a mount.

Similarly, when we see "reload", set MNT_RELOAD,
but delete "reload" from the options list.
2008-08-30 23:43:56 +00:00
Colin Percival 7db84cf35b MFC r181281: Make swprintf("%s", "") not fail randomly depending on
uninitialized variables.
2008-08-30 23:10:29 +00:00
Colin Percival b320dac264 MFC r181280: Avoid printing bogus error messages if BLOCKSIZE is garbage. 2008-08-30 23:08:31 +00:00
Colin Percival 00da648f59 MFC r178234: Fix one-byte buffer overflow in configuration file parsing. 2008-08-30 23:06:02 +00:00
Colin Percival 10c1f68087 MFC r181279: Don't close file descriptor <whatever random gargage was on the
stack>.
2008-08-30 22:57:30 +00:00
Colin Percival 577ae9e7c0 MFC r179073: Specify which INDEX files to build via portsnap.conf. 2008-08-30 22:53:55 +00:00
Colin Percival 2a68f48a82 MFC r181142, r181145, r181146, r181425, r181427: Add support for
"freebsd-update IDS".
2008-08-30 22:50:08 +00:00
Bjoern A. Zeeb 157d538ec9 MFC: svn r182056, cvs 1.154 tcp_syncache.c
Cache the cred locally in _syncache_add() while holding the locks, so
  we can be sure that it's valid.
  In case we abort early free it again else put it into the syncache.

  We need the cred in the syncache to be able to restrict what will be
  exportet by the sysctl helper function syncache_pcblist() (to netstat)
  within jails.

PR:	kern/126493
2008-08-30 16:49:36 +00:00
Bjoern A. Zeeb 8dde91743a MFC: svn r182045, cvs 1.153 tcp_syncache.c
Add an explicit comment why we NULLify the two variables.
2008-08-30 13:26:17 +00:00
VANHULLEBUS Yvan 5559e9c010 MFC: Increase statistic counters for enc0 interface when enabled
and processing IPSec traffic.

Approved by:	gnn (mentor)
2008-08-30 10:25:57 +00:00
Gregory Neil Shapiro 42e1fd22c5 MFC: sendmail 8.14.3
Approved by:	re
2008-08-30 00:20:49 +00:00
John Baldwin 89caa60525 Don't build the dtrace tools during bootstrap tools for now and don't build
the kernel with CTF symbols by default.  This fixes builds of 7.x on 6.x
machines.  The build of dtrace tools can be re-enabled when it is fixed to
not break 6.x upgrades.  I'm not sure if we need to bootstrap the library
bits differently (perhaps the libegacy needs to include libelf and
libdwarf?).
2008-08-29 20:18:56 +00:00
John Baldwin 2e39a10f0d Disable the KDTRACE options in GENERIC for now. They have not yet been
enabled in HEAD, and they really need to be enabled in HEAD first and
have some soak time there before they are turned on by default in 7.
2008-08-29 18:54:35 +00:00
David E. O'Brien a5e0460e65 MFC: r180986: style(9) specifies that case statements are not indented. 2008-08-29 16:22:22 +00:00
David E. O'Brien 8d38846bb7 MFC: r178940,r178941,r178946: Clean up several instances of SADE calling
itself sysinstall.  (do so generically so the same set of changes can be
applied to sysinstall)
2008-08-29 16:05:04 +00:00
Robert Watson af84c7bfc6 As "device bm" appears to be specific to powerpc, move it from the global
NOTES to powerpc-specific NOTES.
2008-08-29 09:27:40 +00:00
Konstantin Belousov 1ecee6f486 MFC r181997:
Add -fno-omit-frame-pointer to CFLAGS used to compile crt1.c on amd64.
2008-08-29 09:02:53 +00:00
Scott Long 8d75e62c3f Fix mismerges in ZFS from the Dtrace merge.
Submitted by:	jhb
Reviewed by:	pjd
Approved by:	jb
2008-08-29 07:49:48 +00:00
Scott Long 6c9c4767a8 Ensure that the padding calcualtion doesn't return a negative value.
Submitted by:	kib
Approved by:	jb
2008-08-29 07:47:30 +00:00
Pyun YongHyeon 9efe9b0ac1 MFC r181992:
Because bfe(4) knows interrupt mask value there is no need to read
  interrupt mask register again. This saves one register access per
  each interrupt.
  Also don't try to process frames when driver is not running.
2008-08-29 04:00:43 +00:00
Pyun YongHyeon c94416b3be MFC r181976:
Remove bfe_link in softc and introduce two new flags to mark
  link state and detach request.
  While I'm here make sure established link is IFM_10_T or
  IFM_100_TX as bfe(4) just supports 10/100Mbps media.
2008-08-29 03:42:27 +00:00
Pyun YongHyeon c8979f2ae0 MFC r181953:
o Sort includes and add <endian.h> to support endianness.
   o Removed unneeded header files.
   o bus_dma(9) fix:
     - created parent tag with 1GB dma address limit with no
       alignment restrictions.
     - set 4096 alignment limit for Tx/Rx descriptor rings.
     - separate Rx buffer tag from Tx buffer tag such that Tx tag
       allows up-to 16 segments while Rx buffer tag only allows
       single segment.
     - it seems the controller has no alignment restrictions on Tx/Rx
       buffers. Remove ETHER_ALIGN alignment restriction in Tx/Rx
       buffers.
     - created a spare Rx dma map which would be used to cope with
       failure of loading a dma map.
     - make sure to load full Tx/Rx descriptor size for Tx/Rx
       descriptor dma maps, previously bfe(4) used to load single
       descriptor size for each descriptor rings. I have no idea how
       it could be run without problems.
     - don't blindly cast bus_addr_t type to 32bits in bfe_dma_map().
     - created bfe_dma_free() to free allocated dma memory/tags.
     - make sure to invoke bus_dmamap_sync(9) before/after processing
       descriptor rings/buffers. Because the hardware has severe dma
       address space limitation, bounce-buffers would be always used
       on systems with more than 1GB memory during
       descriptors/buffers access.
     - added Tx descriptor ring initialization function,
       bfe_list_tx_init().
     - moved producer/consumer index initialization to
       bfe_list_tx_init() and bfe_list_rx_init() from
       bfe_chip_reset().
     - added bfe_discard_buf() which will update loaded descriptors
       without unloading/reloading the dma map to speed up error
       recovery.
     - implemented Tx side bus_dmamap_load_mbuf_sg(9). The number of
       segments allowed was chosen to be 16 which should be enough for
       non-TSO capable hardwares. Setting SOF bit of Tx descriptor is
       done in the last to avoid potential race.
     - don't give up sending frames in bfe_start() until the hardware
       lacks free descriptors.
     - added XXX comment to second kick command and possible workaround.
     - implemented Rx side bus_dmamap_load_mbuf_sg(9).
     - removed bfe_dma_map_desc() as it's not needed anymore after
       the conversion to bus_dmamap_load_mbuf_sg(9).
     - added endianness support. With this change bfe(4) should work
       on any architectures that can create bounce buffers within 1GB
       address range.
     - add missing bus_dmamap_sync() in bfe_tx_eof()/bfe_rx_eof().
   o Use PCI_BAR instead of hardcoded value to set BARs.
     Simplified register access with bus_write_4(9)/bus_read_4(9) and
     removed bfe_btag, bfe_bhandle, bfe_vhandle in softc as it's not
     used anymore.
   o Reorder device detach logic such that bfe_detach() is also used
     for handling driver attach failure case.
   o Remove unnecessary KASSERT in bfe_detach().
   o Remove bfe_rx_cnt, bfe_up, bfe_vpd_prodname, bfe_vpd_readonly in
     softc.  It's not used at all.
   o Remove BFE_RX_RING_SIZE/BFE_RX_RING_SIZE/BFE_LINK_DOWN.
2008-08-29 01:30:26 +00:00
Tom Rhodes 55c0e52f9a MFC r181312:
Add EPERM to the ERRORS section.

PR: 125746
2008-08-29 00:20:05 +00:00
Maksim Yevmenkin 5e1dd46603 MFC SVN rev 181743
Import the uuid_enc_le(), uuid_dec_le(), uuid_enc_be() and
uuid_dec_be() functions. These routines are not part of the
DCE RPC API. They are provided for convenience.

Reviewed by:	marcel
Obtained from:	NetBSD
2008-08-28 21:32:07 +00:00
Maksim Yevmenkin ee6756da8f MFC SVN rev 181698
Import handy shorthand Bluetooth address (BD_ADDR) utility functions
from NetBSD and document them.

Obtained from:	NetBSD
2008-08-28 21:23:50 +00:00
John Baldwin dda108c49e These files all had duplicate copies of the same content, trim them back
down to only 1 copy.
2008-08-28 21:11:24 +00:00
David E. O'Brien a519be8170 MFC: r179174 (rev 1.47): Cscope enhancement's. 2008-08-28 20:09:01 +00:00
David E. O'Brien cd642b4e32 MFC: r179932: Add an abbreviation for adaptive mode. 2008-08-28 19:36:28 +00:00
David E. O'Brien 89d2ada028 MFC: r180065: Note that the .POSIX special target disables the
"Remaking Makefiles" feature.
2008-08-28 19:30:10 +00:00
David E. O'Brien 192ecd1e35 MFC: r180078: Reduce diff to vendor. 2008-08-28 19:28:39 +00:00
David E. O'Brien 43c26c2a25 MFC: r180079: white space cleanup 2008-08-28 19:24:48 +00:00
Marius Strobl 9b6abf8483 MFC: r179665
Revert this part of r182231 so the kernel is compiled with at least
"-O" on sparc64 in order to avoid unaligned accesses of struct ip
and other bits.
2008-08-28 19:14:47 +00:00
Marius Strobl 09d259c55e MFC: r182122
There's a race in kmem(4) between checking whether a page is resident
in the kernel and copying it out, causing a panic when faulting on a
nofault entry. Handle this case gracefully by letting the kernel copy
functions return EFAULT instead. As such this change addresses the
same problem as r154721 does for i386.
2008-08-28 18:34:56 +00:00
Marius Strobl 05fa518003 MFC: r182119
MFamd64: r133413

In syscall, always make a copy of parameters from trapframe, this
becauses some syscalls using set_mcontext can sneakily change
parameters and later when those syscalls references parameters,
they will wrongly use register values in mcontext_t.

PR:		72998
2008-08-28 18:24:24 +00:00
Marius Strobl d28768a3f6 MFC: r182110
Announce the speed of the PCI bus for informational purpose.
2008-08-28 18:17:28 +00:00
Marius Strobl 32c3ff69e0 MFC: r182108
The PCI specifications don't explain the details on how to calculate
the latency based on the Min_Gnt register so use the algorithm found
in OpenSolaris as they probably know how to interpret the value Sun
puts into these registers (previously, the latency calculated for
66MHz was most likely wrong) and for bridges additionally set up the
secondary latency register. Also set up the bridge control register
the way it's done in OpenSolaris. As the latency register don't apply
to PCI-Express and the bridge control setup wasn't tested on sun4v
(besides most likely not being needed), expand the #ifndef SUN4V
accordingly.
2008-08-28 18:05:18 +00:00
David E. O'Brien 66e75f2bad MFC: r180428: Use 'CSCOPE_ARCHDIR' to change the default architecture
directories to cscope.  After the addition of sys/modules/dtrace/dtrace,
setting 'ARCHDIR' in /etc/src.conf breaks the build.
2008-08-28 18:02:16 +00:00
David E. O'Brien 2006cfc20d MFC: r180514: libkern.h. 2008-08-28 17:58:01 +00:00
Nathan Whitehorn 5c08f829a9 MFC of r178599,178600,179644,179645,180254,180233
Support for Apple BMAC ethernet controller and associated DBDMA support and required changes to macio and scc(4) to support multiple interrupts on macio children.

Approved by:	grehan (mentor)
2008-08-28 17:06:24 +00:00
David E. O'Brien bbdb664b39 MFC: r181036: Add a -q[uiet] flag for scripts. 2008-08-28 16:07:39 +00:00
David E. O'Brien 01fc2984e3 MFC r181962: Use the SCHEME_ knobs rather than knowing what they expand to. 2008-08-28 16:05:45 +00:00
David E. O'Brien 5d9570aa88 MFC r181972: Add comments on NOARGS, NODEF, and NOPROTO. 2008-08-28 15:56:22 +00:00
Remko Lodder 0ae7d0ac30 MFC r181970
Add support for the Alcor Card Reader (9361)

  PR:             124656
  Submitted by:   Vincent Francois <vincentfrancois dot pro at gmail dot com>
  Approved by:    imp (mentor, implicit)
  MFC after:      1 week

Approved by:	imp (mentor, implicit)
2008-08-28 14:20:58 +00:00
Maxim Konovalov 8b80dd4736 MFC r181685: a quirk for Sony Handycam DCR-HC32E. 2008-08-28 13:34:13 +00:00
Roman Kurakin 63bdb67b2d MFC: r180132 and 176407
------------------------------------------------------------------------
  r180132 | rik | 2008-07-01 01:18:27 +0400 (Tue, 01 Jul 2008) | 4 lines

  Do not set IFF_DEBUG directly from the driver.

  MFC after:      1 month.

  ------------------------------------------------------------------------
  r176407 | ru | 2008-02-19 10:09:19 +0300 (Tue, 19 Feb 2008) | 2 lines

  getopt(3) returns -1, not EOF.
2008-08-28 08:30:19 +00:00
Peter Wemm b6b8c5e366 Consolidate mergeinfo 2008-08-28 00:50:21 +00:00
Peter Wemm 8797ce6a53 Remove bogus mergeinfo for /head/sys/sys:r179967 (wrong path in merge) 2008-08-28 00:34:26 +00:00
Konstantin Belousov 1b53d0edb2 Move the smp_no_rendevous_barrier() from #ifdef SMP to fix UP kernel
build. This is the part of the MFC of r179230 that seems to be missed
in r182286.
2008-08-27 21:40:27 +00:00
Konstantin Belousov 6238810593 Do not build CFT information during buildworld. The resulted stripped
static binaries are not executable.

Approved by:	jhb
2008-08-27 19:37:19 +00:00
John Baldwin 290984576d Bump __FreeBSD_version to note DTrace MFC. 2008-08-27 19:24:18 +00:00
John Baldwin 8a84248299 Include libdwarf and libproc in _prebuild_libs to match HEAD. 2008-08-27 18:08:41 +00:00
John Baldwin dec0c99607 Restore SI_SUB_MOUNT_ROOT. It was removed in an unrelated change on HEAD
that has not been MFC'd.
2008-08-27 17:42:44 +00:00
John Baldwin 986ff4e053 Reduce diffs with HEAD:
- Don't IPI the current CPU.
- Don't remove the current CPU from the rendezvous mask.  Otherwise the
  smp_rendezvous_action routine will get an incorrect count of CPUs and
  won't wait for all CPUs at each barrier (it will wait for N-1).
2008-08-27 17:31:56 +00:00
John Baldwin c28fe84f40 MFC: Move smp_no_rendevous_barrier() to the bottom of this file to fix
UP kernels.
2008-08-27 17:14:22 +00:00
John Baldwin fca86920d5 Revert non-DTrace related changes from previous commit. 2008-08-27 17:08:40 +00:00
John Baldwin ff6e907727 Revert previous change. LO_ENROLLPEND is still used in 7.x. 2008-08-27 17:03:33 +00:00
John Baldwin 4326652de2 Don't enable PRINTF_BUFR_SIZE or DDB_CTF by default as these are not
enabled by default in HEAD, and kernels on stable branches do not
include DDB by default either.
2008-08-27 17:02:11 +00:00
John Baldwin 8b44056953 Revert some hwpmc and p_comm vs td_name changes from HEAD that snuck in with
the DTrace commit.
2008-08-27 16:59:42 +00:00
John Baldwin 44793b65f0 Revert unrelated changes from the kerberos5 upgrade in HEAD that snuck into
the DTrace MFC.

Approved by:	scottl
2008-08-27 16:49:13 +00:00
John Baldwin 037180f2e5 Restore build of libkse and disabled libatm.
Approved by:	scottl
2008-08-27 16:46:14 +00:00
John Baldwin a6f2182525 Trim some duplicate lines.
Approved by:	scottl
2008-08-27 16:40:30 +00:00
Dag-Erling Smørgrav 8a17cd0ed3 Move mergeinfo around. 2008-08-27 14:13:55 +00:00
Christian S.J. Peron a161992c53 Un-break the build for MAC. The renaming of these entry points have
not been MFC'ed yet.
2008-08-27 14:12:58 +00:00
John Baldwin 6c74ea7ef1 MFC: Properly handle a 32-bit prefetchable memory range in a PCI-PCI bridge. 2008-08-27 14:06:50 +00:00
John Baldwin b0920fd4c8 MFC: Don't attempt authentication at all if it has been disabled via
'-a off'.
2008-08-27 13:57:18 +00:00
Randall Stewart b61bbe71fc ***MFC of r182114
Make the kernel compile with SCTP and SCTP_DEBUG but
no INET6 defined.
2008-08-27 13:08:43 +00:00
Randall Stewart 82f14e8687 Pull over other macro changes from 181803. Even if
we won't put vimage in 7 this will keep the trees
in sync.
2008-08-27 13:05:40 +00:00
Randall Stewart 994415cbc9 - Fix DES's nit as in r181464 2008-08-27 12:57:59 +00:00
Randall Stewart 130bd9a61d ****MFC of r181054
Adds support for the SCTP_PORT_REUSE option
Fixes a refcount bug found in the process

Obtained from:	With the help of Michael Tuexen
2008-08-27 12:54:42 +00:00
Randall Stewart b4698d0ddf ***svn 180955 and 180956
r180955
- Out with some printfs.
- Fix a initialization of last_tsn_used
- Fix handling of mapped IPv4 addresses
r180956
Fix build breakage - kthread_exit() in 8 now has no arguments
<AND>
- Add back 0 argument for 7.
2008-08-27 12:49:55 +00:00
Randall Stewart 81415627e7 *****MFC of r180387
1) Adds the rest of the VIMAGE change macros
2) Adds some __UserSpace__ on some of the common defines that
   the user space code needs
3) Fixes a bug when we send up data to a user that failed. We
   need to a) trim off the data chunk headers, if present, and
   b) make sure the frag bit is communicated properly for the
   msgs coming off the stream queues... i.e. we see if some
   of the msg has been taken.

Obtained from:	jeli contributed the VIMAGE changes on this pass Thanks Julain!
2008-08-27 12:39:51 +00:00
Randall Stewart f53f7e86d1 ****MFC r179783, r179786 and r179803
From:r179783
- Macro-izes the packed declaration in all headers.
- Vimage prep - these are major restructures to move
  all global variables to be accessed via a macro or two.
  The variables all go into a single structure.
- Asconf address addition tweaks (add_or_del Interfaces)
- Fix rwnd calcualtion to be more conservative.
- Support SACK_IMMEDIATE flag to skip delayed sack
  by demand of peer.
- Comment updates in the sack mapping calculations
- Invarients panic added.
- Pre-support for UDP tunneling (we can do this on
  MAC but will need added support from UDP to
  get a "pipe" of UDP packets in.
- clear trace buffer sysctl added when local tracing on.
From:r179786
- Fixes foobar on my part. Some missing virtualization macros from
  specific logging cases.
From r179803
 - only one functino to destroy an SCTP stack sctp_finish()
 - Make it so this function also arranges for any threads
   created by the image to do a kthread_exit()
2008-08-27 12:30:09 +00:00
Randall Stewart ea160e0238 **** MFC r179180
- sctputil.c - If debug is on, the INPKILL timer can deref a freed value.
               Change so that we save off a type field for display and
               NULL inp just for good measure.

- sctp_output.c - Fix it so in sending to the loopback we use the
                  src address of the inbound INIT. We don't want
                  to do this for non local addresses since otherwise
                  we might be ingressed filtered so we need to use
                  the best src address and list the address sent to.

Obtained from:	time bug - Neil Wilson
2008-08-27 12:19:16 +00:00
Randall Stewart 161a6719dd *****MFC of r179157
- Adds support for the multi-asconf (From Kozuka-san)
- Adds some prepwork (Not all yet) for vimage in particular
  support the delete the sctppcbinfo.xx structs. There is
  still a leak in here if it were to be called plus we stil
  need the regrouping (From Me and Michael Tuexen)
- Adds support for UDP tunneling. For BSD there is no
  socket yet setup so its disabled, but major argument
  changes are in here to emcompass the passing of the port
  number (zero when you don't have a udp tunnel, the default
  for BSD). Will add some hooks in UDP here shortly (discussed
  with Robert) that will allow easy tunneling. (Mainly from
  Peter Lei and Michael Tuexen with some BSD work from me :-D)
- Some ease for windows, evidently leave is reserved by their
  compile move label leave: -> out:
2008-08-27 12:10:16 +00:00
Randall Stewart 5e388774ec **********MFC in of r179141***
- Define changes in sctp.h
- Bug in CA that does not get us incrementing the PBA properly which
  made us more conservative.
- comment updated in sctp_input.c
- memsets added before we log
- added arg to hmac id's
2008-08-27 11:31:00 +00:00
Rui Paulo b5430e4201 MFC r181924:
Install k8temp(4) man page only on amd64 and i386.
2008-08-27 10:33:15 +00:00
Doug Rabson a5781ae661 MFC: r181683 - add a missing call to mtx_destroy(). 2008-08-27 09:43:52 +00:00
Doug Rabson 96b2556f3e MFC: r181683 - fix linux interop issues 2008-08-27 09:39:35 +00:00
Remko Lodder 75c4755324 MFC r181925
Bring in support for the MC8755 Sierra UMTS card.

  Submitted by:   Robert Blacquiere <robert at blacquiere dot nl>
  Approved by:    imp (mentor, implicit)
  MFC after:      1 week

Approved by:		imp (mentor, implicit)
With MFC help from:	des (thanks!)
2008-08-27 09:32:18 +00:00
John Birrell 75bc2d1536 Add a mention of DTrace and the dog that are the commit message. 2008-08-27 06:59:01 +00:00
Tim Kientzle fbc977a91a MFC r181801,181904,181958,181959,181971: Many improvements to
pattern-matching tests.  Two bug fixes:
 * Don't remove leading '/' from patterns to be matched.
   This aligns the pattern-matching with GNU tar and with earlier
   versions of bsdtar.
 * Write unedited paths for -t.  This makes the pattern-matching
   behavior, in particular, a lot more transparent.  The cost is
   that you have no good way to preview the effects of pathname
   substitutions.

PR:		bin/117909
2008-08-27 04:59:00 +00:00
Tim Kientzle 364a286985 MFC r182149: Alphabetize the list of tests. 2008-08-27 04:46:47 +00:00
Tim Kientzle bd5dba3072 MFC r182102: Update the total archive bytes written when writing entries
to disk.  (Used by cpio to generate proper block counts in -p mode.)
2008-08-27 04:45:26 +00:00
John Birrell 144cd58d16 MFC
DTrace support.

Note that this defaults the 'make buildkernel' to build with CTF data so
that the release kernel and modules are DTrace-able.
2008-08-27 04:41:15 +00:00
Tim Kientzle acb7c381e4 MFC r182097: Permit restoring of path/.. if SECURE_NODOTDOT was not specified.
With SECURE_NODOTDOT, this isn't needed because we refuse to restore
anything with '..' in the path.  Without, we used to refuse path/..
as a special case (on the grounds that it was silly), but "cpio -p .."
is a common and perfectly valid idiom that incidentally copies "."
to "..".
2008-08-27 04:40:38 +00:00
Tim Kientzle 749140a448 MFC r182093: Ignore NO_OVERWRITE_NEWER if the current object is a directory.
Before this, the often-recommended incantation
   find -d . | cpio -p <target>
fails to properly carry through dir metadata because each
file copy implicitly creates the parent dir, which cpio subsequently
refuses to overwrite.  With this patch, the incantation works
with or without the -d option to find because without it, there
is no implicit dir creation, and with it, the subsequent dir
restore will update the metadata on the dir.
2008-08-27 04:36:07 +00:00
Marius Strobl fcd2d2ab26 MFC: r182079
- Use m_collapse(9) instead of m_defrag(9) if possible. This results
  in a noticeable reduction in system time spent.
- If bus_dmamap_load_mbuf_sg(9) fails with EFBIG and we already have
  defragmented the mbuf chain, don't bother to defragment and load it
  a second time just yet as it's likely to fail again anyway.
2008-08-26 19:14:55 +00:00
Marius Strobl eb915ea610 MFC: r182078
Update the comment regarding the workaround for the BlackBird
TICK_COMPARE bug and the instruction alignment used for it based
on information found in the OpenSolaris source.
2008-08-26 18:50:50 +00:00
Marius Strobl 2cf871fa48 MFC: r182070
- Provide and consume module dependency information.
- Fix whitespace bugs.
2008-08-26 18:45:56 +00:00
Marius Strobl 7fb12d3dc7 MFC: r182066
- Removed unused sc_node.
- Provide module dependency information.
- Static'ize ebus_release_resource() in order to match prototype.
- Remove outdated and/or obsolete comments.
- Fix whitespace bugs.
2008-08-26 18:22:16 +00:00
Marius Strobl 4bebd6fa0d MFC: r182062
Provide and consume module dependency information.
2008-08-26 18:17:28 +00:00
Marius Strobl 1b711ca7f3 - Restore the behavior of enabling the MII buffer for an internal
PHY only and not also in the case of an external PHY currently
  doing full duplex, which accidentally got broken in r172334.
  It's still not clear to me why we need to enable the buffer for
  an internal PHY though.
- Count excess and late collisions as output errors. [1]
- Count receive errors as input errors. [1]

Obtained from:	NetBSD [1]
2008-08-26 18:11:25 +00:00
Marius Strobl 79df76ec80 MFC: r182055
- Add kbdmux(4); since sunkbd(4) was tought to emulate atkbd(4) like
  ukbd(4) does and that emulation was enabled by default, all three of
  them work together with kbdmux(4) out of the box just fine.
- Fix some whitespace bugs.
2008-08-26 18:06:17 +00:00
John Baldwin b3d7effa69 MFC: Add 'CACHING' section to kvm_getpcpu.3. 2008-08-26 18:00:53 +00:00
John Baldwin 25c6fdad22 MFC: Add kvm_getcptime(3). 2008-08-26 18:00:06 +00:00
John Baldwin 5883d1664b MFC: Add kvm_getmaxcpu() and kvm_getpcpu(). 2008-08-26 17:57:38 +00:00
John Baldwin 8fa62068c2 MFC: Export 'struct pcpu' to userland w/o requiring _KERNEL. 2008-08-26 17:48:10 +00:00
John Baldwin a78d8a9fe1 MFC: Build a /usr/bin/ldd32 binary on amd64 and use it for 32-bit objects
passed to ldd.  This enables tracing of 32-bit shared libraries.
2008-08-26 17:36:38 +00:00
Dmitry Morozovsky 20cf32bae6 Announce cron(8) -m switch.
Approved by:	blackend
2008-08-26 10:20:07 +00:00
Alexander Motin d345bb368b MFC r180943
Don't use memcpy() to copy several bytes.
Store IDs is host order. It is not so important to bloat code for it.
Combine m_adj() and M_PREPEND() into single M_PREPEND().
2008-08-25 22:26:46 +00:00
Alexander Motin 761a99c91b MFC r180850, r180932
According to in_pcb.h protocol binding information has double locking.
It allows access it while list travercing holding only global pcbinfo lock.
2008-08-25 22:12:38 +00:00
Alexander Motin ff778c677c MFC r180305
Improve approximation of style(9) in raw socket code.
2008-08-25 22:09:19 +00:00
Alexander Motin 7c1af69904 MFC r180851
According to in_pcb.h protocol binding information has double locking.
It allows access it while list travercing holding only global pcbinfo lock.
2008-08-25 21:59:00 +00:00
Alexander Motin f9479c0e14 MFC r180828
Add hash table lookup for a fully connected raw sockets.

This gives significant performance improvements when many raw sockets used.
Benchmarks of mpd handeling 1000 simultaneous PPTP connections show up to 50%
performance boost. With higher number of connections benefit becomes even
bigger. PopTop snd others should also get some benefits.

MFC r180833, r180874

According to in_pcb.h protocol binding information has double locking.
It allows access it while list travercing holding only global pcbinfo lock.
This relaxed locking noticably increses receive socket lookup performance.
2008-08-25 21:46:45 +00:00
Alexander Motin bb81e68af8 MFC r180305
Improve approximation of style(9) in raw socket code.
2008-08-25 21:42:41 +00:00
Alexander Motin 460a2100aa MFC r180836
Increase UDBHASHSIZE from 16 to 128 items.
Previous value was chosen 10 years ago and not very effective now.
This change gives several percents speedup on 1000 L2TP mpd links.
2008-08-25 21:19:36 +00:00
Craig Rodrigues a592958e4f MFC r176819:
Remove hacks to filter out MNT_ROOTFS, since r173252 of vfs_mount.c
filters out MNT_ROOTFS if it is passed from userspace -> kernel.
2008-08-25 20:09:27 +00:00
Jung-uk Kim 00947b7e22 MFC: Sync. BPF JIT compiler with HEAD.
- r179967, r179968, r179977, r179978:
Rehash and clean up BPF JIT compiler macros to emit opcodes closer
to GNU as(1) generated codes and micro-optimize.

- r181644, r181645:
Replace number of stack usages with registers.  Note amd64 version
does not use stack any more because it has more registers.

- r181697:
Remove unnecessary jump instructions of zero offsets.

- r181700, r181848, r181853:
Correctly check unsignedness of all registers used for load instructions
with (in)direct offsets and sync. with sys/net/bpf_filter.c

- r181648, r181649, 181846:
Update copyrights, fix style(9) nits, remove unused macros, and make
JIT compilers compilable on user land.
2008-08-25 19:06:02 +00:00
Marius Strobl 4822d3b149 MFC: r182018
Avoid misaligned access of struct frame.
2008-08-25 18:36:19 +00:00
Andrew Gallatin 5ae5f2f0fe MFC r181964
Adapt mxge shims to detect phys contig jumbo frames
in RELENG_7
2008-08-25 17:58:15 +00:00
Ken Smith bd184c9ea7 We're less than a week from code freeze for the 7.1-REL release cycle.
Start calling RELENG_7 "7.1-PRERELEASE" now to warn people that we're
nearing code freeze so things might get a bit bumpy.
2008-08-25 17:33:43 +00:00
Dag-Erling Smørgrav 09780ce1dc MFH: make obrien happy 2008-08-25 16:37:58 +00:00
Rafal Jaworowski 98d4ec6a89 MFC r181965: Increase cryptotest tool initialization vector (IV) size. 2008-08-25 12:11:07 +00:00
Tim Kientzle b13116d93d MFC r181984: Don't clean before testing, since clean also removes
results from previous tests.
2008-08-25 02:18:12 +00:00
Tim Kientzle 8084fc647c MFC r181979, r181981, r181985: Test -q option and make it actually work. 2008-08-25 02:14:52 +00:00
Tim Kientzle fe9614626e MFC r181821, r181845: "./foo" now matches "foo" 2008-08-25 02:06:56 +00:00
Tim Kientzle 14ee5ea0e7 MFC r181750: various minor test updates 2008-08-25 02:01:47 +00:00
Tim Kientzle 8db00b7d5d MFC r181542,r181555: Minor test suite fixup so that the test suite
works against the libarchive 1.x API.  Not needed by 7-STABLE, but
it's nice to minimize the differences between 7-STABLE and CURRENT.
2008-08-25 01:55:40 +00:00
Marius Strobl f4157c3283 MFC: r181701, r182020
cosmetic changes and style fixes
2008-08-24 18:28:13 +00:00
Craig Rodrigues 5580fed32b MFC: r180484
Delete "update" from the mount options after we have set
MNT_UPDATE in fsflags.

Requested by:	yar
2008-08-23 22:40:29 +00:00
Kai Wang 6a409dafab MFC r181843:
Fix a typo: According to the hid spec, Global item #3
is Physical Minimum.
2008-08-23 17:40:35 +00:00
Kai Wang de503cca9b MFC r181841:
In the hid parser, if a INPUT/OUTPUT/FEATURE item is skipped, its
corresponding USAGE should be skipped as well.

Tested by:        Grzegorz Blach
PR:               usb/125941
2008-08-23 17:38:24 +00:00
Kai Wang 6828eb7b68 MFC r181844:
sc->sc_ibuf should be malloc'ed after quirks applied, as
sc->sc_isize might have changed.
2008-08-23 17:35:15 +00:00
Kai Wang 16684dfda2 MFC r181839:
Re-add Microsoft Intellimouse 2.0 TWHEEL quirk.

Tested by:      Merritt Draney, Brian Cox
PR:             kern/123224
PR:             kern/123510
2008-08-23 17:32:43 +00:00
Dag-Erling Smørgrav 4d31dc4420 MFH colldef and timedef for nb_NO, nn_NO.
PR:		conf/51920
2008-08-23 13:25:56 +00:00
Max Laier 41b1bf0373 MFC r180753 by luoqi@:
Only enable MSI mappings for devices that use MSI.  Fixes interrupt loss
  on some nForce based boards.

PR:             kern/118842
2008-08-23 03:40:49 +00:00
Yoshihiro Takahashi 5c41fbb14d MFC: Back FreeBSD(98)'s copyright to 2003. 2008-08-22 12:40:59 +00:00
Luigi Rizzo 71a507c695 MFC: sync with HEAD.
BTW, the change in rev.1.42 in head is totally unrelated to the
commit message: it only adds .svn to the exclude list when copying
files using tar.
2008-08-22 10:18:18 +00:00
Konstantin Belousov 40d9b5a43a MFC r180758:
Prevent the bdflush() activity when several buffers are locked at once
by setting the TDP_INBDFUSH for the problematic code blocks.
2008-08-22 09:54:56 +00:00
Konstantin Belousov bfafe50b4a MFC r181868:
In brelse, put the B_NEEDSGIANT buffer on the QUEUE_DIRTY_GIANT queue,
instead of QUEUE_DIRTY.
2008-08-22 09:47:01 +00:00
Philip Paeps 9eec7d8e72 MFC r181753:
Introduce a new loader tunable "hw.ata.ata_dma_check_80pin", defaulting
  to 1.  This can be used to disable the 80pin cable check on systems which
  forget to set the bit -- such as certain laptops and Soekris boards.
2008-08-22 08:09:13 +00:00
Andrew Thompson 57ceb517b2 MFC r179894, r181224
Add support for the optional key in the GRE header.

 PR:		kern/114714
 Submitted by:	Cristian KLEIN
2008-08-22 03:55:37 +00:00
Andrew Thompson 3499713377 MFC r178214
If the .inf file did not have a Default entry for the registry key then write
 out a blank value and close the brackets on the ndis_regvals array.
2008-08-22 03:15:50 +00:00
Andrew Thompson ce12ab7798 MFC r174150, r174240, r179009, r179720
Sync sys/compat/ndis to HEAD.

 - Correct the calculation for the number of 100ns intervals since January 1,
   1601. The 1601 - 1970 period was in seconds rather than 100ns units.
 - Remove duplication by having NdisGetCurrentSystemTime call ntoskrnl_time.
 - Implement functions required by some ndis drivers.
 - Fix a panic when it occurred during initializing the ndis driver because it
   try to read network address through ifnet structure which is NULL until the
   ndis driver's initialization is finished.
 - fix a page fault that it occurred during ifp is NULL.  This bug happens when
   NDIS driver's initialization is failed and NDIS driver's trying to call
   NdisWriteErrorLogEntry().
2008-08-22 03:08:31 +00:00
Kip Macy 1f8213bf95 MFC 181653:
Fix runt TSO packet issue.

Obtained from:	Chelsio Inc.
2008-08-22 01:30:39 +00:00
Kip Macy 084a0488c5 MFC 181652:
Add LRO and MAC statistics to exported sysctls.

Obtained from:	Chelsio Inc.
2008-08-22 01:28:57 +00:00
Kip Macy 008329d938 MFC 181616:
Remove cxgb private lro implementation and switch to using system implementation.

Obtained from:	Chelsio Inc.
2008-08-22 01:23:39 +00:00
Konstantin Belousov 10ae99db32 MFC r181823:
Remove the check for mode and conditional swapgs in doreti_iret_fault,
we already have right gs base in the MSR.
2008-08-21 09:58:18 +00:00
Weongyo Jeong f99d11d105 MFC r180754
when NDIS framework try to query/set informations NDIS drivers can
return NDIS_STATUS_PENDING.  In this case, it's waiting for 5 secs to
get the response from drivers now.  However, some NDIS drivers can send
the response before NDIS framework gets ready to receive it so we might
always be blocked for 5 secs in current implementation.  NDIS framework
should reset the event before calling NDIS driver's callback not after.
2008-08-21 05:40:38 +00:00
Weongyo Jeong 9839c50287 MFC r180730
remove reference for unexisting ndisapi(9)
2008-08-21 05:34:37 +00:00
Weongyo Jeong 527fe5f1ff MFC r179855
handle .INF files for PCMCIA correctly that specify multiple entries in
their [Manufacturer] sections and prevent a case that NDIS_PCI_DEV_TABLE
definition was always emitted that it's only emitted once if a .INF file
is for PCI.
2008-08-21 05:30:26 +00:00
Weongyo Jeong 1ecfc495a8 MFC r179423
Fix a panic that a priority value which is passed to cv_broadcastpri(9)
can be < 0.  We don't ignore a `increment' argument but at least we keep
a priority value of NDIS threads over PRI_MIN_KERN.

Reviewed by:	thompsa
2008-08-21 05:13:55 +00:00
Pyun YongHyeon bd4fc1b81f MFC r181557:
Use device_set_desc() instead of device_set_desc_copy() as we don't
  manipulate the verbose description of a device.
2008-08-21 03:45:50 +00:00
Pyun YongHyeon f353143591 MFC r180954:
style(9) - space after keywords, don't indent case.
2008-08-21 03:34:14 +00:00
Pyun YongHyeon bb3ed41cd2 MFC r180952, r181556:
Nuke referencing softc in device probe.
2008-08-21 03:25:44 +00:00
Pyun YongHyeon bc347bce1f MFC r180950:
s/printf/device_printf/g
  Don't hard code function name in device_printf() and use __func__.
  While I'm here nuke bfe_unit in softc as it's not needed anymore.
2008-08-21 02:03:01 +00:00
Kip Macy 9809652217 Bump _FreeBSD_version for physically contiguous jumbo frame support
Requested by: Andrew Gallatin (gallatin@)
2008-08-20 22:42:20 +00:00
Guy Helmer b12787c679 MFC r179374
Similar to changes previously made to src/usr.bin/uniq/uniq.c,
fix truncation of lines at LINE_MAX characters by dynamically
extending line buffers.
2008-08-20 19:57:58 +00:00
John Baldwin d8481c9911 MFC: Attach the cpufreq child devices with specific orders to enforce
relative priority of some of the drivers that manage the same state (e.g.
ichss0 vs est0).
2008-08-20 18:33:09 +00:00
John Baldwin 00009eb45c MFC: Decode "exotic" instructions such as pause as well as "cmov*" on i386. 2008-08-20 17:44:02 +00:00
Philip Paeps c84b869a0c MFC r181468-181469,181594:
Add the glxsb(4) manual page.
2008-08-20 14:16:07 +00:00
Philip Paeps 72c1c9c2f3 MFC r181467, r181593:
Add glxsb(4) driver for the Security Block in AMD Geode LX processors (as
  found in Soekris hardware, for instance).  The hardware supports
  acceleration of AES-128-CBC accessible through crypto(4) and supplies
  entropy to random(4).
2008-08-20 11:33:13 +00:00
Pyun YongHyeon 2dbc84b6ac MFC r176265:
Prefer NULL over integer 0 for pointer type.
2008-08-20 05:23:31 +00:00
Pyun YongHyeon 9eb03dcab0 MFC r176264:
Nuke local jumbo allocator and switch to use of UMA backed page
  allocator for jumbo frame.
   o Removed unneeded jlist lock which was used to manage jumbo
     buffers.
   o Don't reinitialize hardware if MTU was not changed.
   o Added additional check for minimal MTU size.
   o Added a new tunable hw.skc.jumbo_disable to disable jumbo frame
     support for the driver. The tunable could be set for systems that
     do not need to use jumbo frames and it would save
     (9K * number of Rx descriptors) bytes kernel memory.
   o Jumbo buffer allocation failure is no longer critical error for
     the operation of sk(4). If sk(4) encounter the allocation failure
     it just disables jumbo frame support and continues to work without
     user intervention.

  With these changes jumbo frame performance of sk(4) was slightly
  increased and users should not encounter jumbo buffer allocation
  failure. Previously sk(4) tried to allocate physically contiguous
  memory, 3388KB for 256 Rx descriptors. Sometimes that amount of
  contiguous memory region could not be available for running systems
  which in turn resulted in failure of loading the driver.
2008-08-20 05:19:41 +00:00
Pyun YongHyeon 2a87f1cd22 MFC r176859:
Nuke local jumbo allocator and switch to use of UMA backed page
  allocator for jumbo frame. Also remove unneeded jlist lock which
  is no longer required to protect jumbo buffers.
  With these changes jumbo frame performance of nfe(4) was slightly
  increased and users should not encounter jumbo buffer allocation
  failure anymore.
2008-08-20 05:12:30 +00:00
Pyun YongHyeon 869ea39aa7 MFC r181655:
Fix VLAN hardware tag insertion/stripping on big-endian
  architectures.

  Reported by:  naddy
  Tested on:    sparc64
2008-08-20 04:55:40 +00:00
Pyun YongHyeon b701ee20ab MFC r181619:
Restore link state handling which was broken in rev 1.69.
  Also report current link state while auto-negotiation is in
  progress.
  With this change link loss should be reported within a second
  and drivers that rely on link state should work.
2008-08-20 04:46:46 +00:00
Pyun YongHyeon cc91baecdd MFC r181617-r181618:
r181617: Remove whitespace at the end of line.
 r181618: Remove 'cr' at the end of line.
2008-08-20 04:19:28 +00:00
Julian Elischer 45ff20c70f MFC teh ability to use tablearg with a skipto.
This was already supported in userland.
2008-08-19 19:58:42 +00:00
Ed Maste 77761feab5 Update locking table, based on changes in r173444:
- Have SPIN / want SPIN adds the "Recursion is defined per lock" footnote.
 - Have sx / want Slp & have sx / want rw changed from no to ok.
2008-08-19 19:31:58 +00:00
Ken Smith d0f6482bcc MFC r181731:
> Catch up on removal of /usr/src/compat.
2008-08-19 13:40:54 +00:00
Konstantin Belousov e1dd38ee7a MFC r179175:
Implement the per-open file data for the cdev.
The td_fpop member of the struct thread is appended to the end, and cleared
in the thread allocator to keep struct thread KBI-compatible on RELENG_7.

MFC r181635:
Remove unnecessary locking around pointer fetch.
2008-08-19 12:36:40 +00:00
Kevin Lo 5d4c5f890d MFC: r179773, r181862
- Add the D-Link DWA-110
Tested by: Jonathan Lee <spamtrap at tczyhatczsche dot eu>

- Add the D-Link DWA-111
2008-08-19 01:51:37 +00:00
Kip Macy 1e3997fd4a MFC 174247:
Introduce an UMA backend page allocator for the jumbo frame zones that
allocates physically contiguous memory.

MFC after: 3 months
Requested and reviewed by: Kip Macy
Tested by: Andrew Gallatin and Pyun YongHyeon

Approved by:	alc
2008-08-19 01:36:45 +00:00
Kip Macy 1a5fe1acd7 Avoid possible namespace collision between function scope sin and locally sub-expression scoped sin
by moving sin declaration to point of use.
2008-08-19 01:25:08 +00:00
Kip Macy 65ef1b2be0 In anticipation of MFCing physically contiguous jumbo frames MFC r177921:
Reintroduce UMA_SLAB_KMAP; however, change its spelling to
 UMA_SLAB_KERNEL for consistency with its sibling UMA_SLAB_KMEM.
 (UMA_SLAB_KMAP met its original demise in revision 1.30 of
 vm/uma_core.c.)  UMA_SLAB_KERNEL is now required by the jumbo frame
 allocators.  Without it, UMA cannot correctly return pages from the
 jumbo frame zones to the VM system because it resets the pages' object
 field to NULL instead of the kernel object.  In more detail, the jumbo
 frame zones are created with the option UMA_ZONE_REFCNT.  This causes
 UMA to overwrite the pages' object field with the address of the slab.
 However, when UMA wants to release these pages, it doesn't know how to
 restore the object field, so it sets it to NULL.  This change teaches
 UMA how to reset the object field to the kernel object.

Crashes reported by: kris
Fix tested by: kris

Approved by:	alc
2008-08-19 01:16:12 +00:00
Bjoern A. Zeeb 660c4615a8 MFC: r181782, cvs 1.235 udp_usrreq.c, 1.102 ip6_input.c, 1.44 ip6_var.h
Fix a regression introduced in r179289 splitting up ip6_savecontrol()
  into v4-only vs. v6-only inp_flags processing.
  When ip6_savecontrol_v4() is called from ip6_savecontrol() we
  were not passing back the **mp thus the information will be missing
  in userland.
  Istead of going with a *** as suggested in the PR we are returning
  **mp now and passing in the v4only flag as a pointer argument.

PR:	kern/126349
2008-08-18 23:00:41 +00:00
Maxim Sobolev a77a44f054 MFC: Allow comment to be placed at the end of a configuration line. 2008-08-18 20:35:02 +00:00
Maxim Sobolev 061cc6407b MFC: Fix 6-year old cut&paste error. The # could be escaped with '\', not
with '\\'.
2008-08-18 20:31:50 +00:00
Robert Watson 18b605474e Merge r178285, r178318, r178319, r178320, r178321, r178322, r178325,
r178376, r178377, r178378, r178419, r179412, r179414, r180127, r180338,
r180343, r180344, r180346, r180348, r180368, r180422, r180429, r180536,
r180558, r180589, r181364, r181365 from head to stable/7:

Introduce and use rwlocks throughout the inpcbinfo and inpcb infrastructure,
and protocols that depend on that infrastructure, including UDP, TCP, and
IP raw sockets.  Significant parts of this work were reviewed by Bjoern Zeeb,
and tested by Paul Saab, Kris Keneway, and George Neville-Neil, whose
contributions to this work are greatly appreciated.

Tested by:      ps, kris, gnn, Mike Tancsa <mike at sentex dot net>
Reviewed by:    bz, des
2008-08-18 08:11:48 +00:00
Sam Leffler 61556d9b61 MFC r179467
5416 and similar chips grew another region in the pci clock domain
where register accesses do not pass through the byte-lane hardware;
extend the register op macros to deal with this
2008-08-18 01:20:39 +00:00
Sam Leffler e5d2ef086a MFC r179640: correct code returned in AsssocResp 2008-08-18 01:16:04 +00:00
Sam Leffler 6256f19bc2 MFC r180837: don't deauth a station because it sends a ps-poll w/ a bogus aid 2008-08-18 01:05:46 +00:00
Sam Leffler 78f76e6bc8 MFC r181083
unset TARGET_CPUTYPE and TARGET_BIG_ENDIAN when building the kernel
to silence compiler complaints when cross-building
2008-08-18 00:59:07 +00:00
Sam Leffler 190efb9ebf MFC r181454: recognize WPS ie's 2008-08-18 00:51:19 +00:00
Sam Leffler 773bd07f0b MFC r181347: add WPS oui 2008-08-18 00:16:57 +00:00
Sam Leffler 1a05c305bf MFC support to return all received information elements in scan results
and station information
2008-08-17 23:00:47 +00:00
Bruce A. Mah b0d1b227bf Somewhat belatedly, update for SA-08:06.bind and EN-08:02.tcp. 2008-08-17 12:58:32 +00:00
Jason Evans b6a33e87c0 MFC allocator improvements and fixes:
* Enhance the chunk map to support run coalescing, and substantially reduce
  the number of red-black tree operations performed.

* Remove unused code.

* Fix arena_run_reg_dalloc() to use the entire precomputed division table.

* Improve lock preemption performance for hyperthreaded CPUs.
2008-08-16 20:14:21 +00:00
Yaroslav Tykhiy 1337e6a993 MFC r173217,176789,176792-176793,176839,176842
Don't forget to set MAKEFLAGS in the childs' environment
from the .MAKEFLAGS global variable even if it's empty or
unset.  This means setting MAKEFLAGS to just an empty string
in the latter case.

The non-POSIX environment variable MAKE was superseded
by MAKEFLAGS ages ago, so don't mention it in comments.

Update the manpage accordingly and make the whole description of
MAKEFLAGS and .MAKEFLAGS more consistent as this change indeed
brings more consistency into the reliable behaviour of make(1).

Give more details in the manpage on the following topics:
o How global, command-line, and environment variables relate.
o What peculiarities the -f option has WRT ${MAKEFLAGS}.

(.Dd in the manpage is already beyond the date of those changes
in HEAD.)
2008-08-16 19:17:36 +00:00
David Malone ffd531344d MFC: Update man page for addition of BIOCSETFNR. 2008-08-16 11:48:44 +00:00
David Malone 46bd42190c MFC:
Add a new ioctl for changing the read filter (BIOCSETFNR). This is
just like BIOCSETF but it doesn't drop all the packets buffered on
the discriptor and reset the statistics.

Also, when setting the write filter, don't drop packets waiting to
be read or reset the statistics.
2008-08-16 11:48:10 +00:00
John Baldwin 68acc0b24a MFC: Use an explicit path to pw(8) so /usr/sbin does not have to be in
the user's path.
2008-08-15 20:20:23 +00:00
John Baldwin e328ccb0bc MFC: If the kernel fails to allocate resources for the initial value of a
PCI BAR, then zero the BAR and clear the resource list entry so that a
new resource will be allocated by the device driver.
2008-08-15 20:16:21 +00:00
John Baldwin b7667b871c MFC: Fix some of the hangs reported with the real mode BTX by disabling
interrupts for software interrupts.
2008-08-15 19:51:23 +00:00
John Baldwin bffe377e19 MFC: Initialize the vm86 structure to a known-good state, specifically
eflags.
2008-08-15 19:31:12 +00:00
John Baldwin 5710398669 MFC: Close two different races with concurrent opens of pty master devices. 2008-08-15 19:25:40 +00:00
John Baldwin a3eef8cceb MFC: Close a race with concurrent open's of a pts master device which
could result in leaked tty structures.
2008-08-15 19:22:33 +00:00
Antoine Brodin 41b44d120d MFC r180495 to stable/7:
Staticize M_STACK.

  Approved by:    rwatson (mentor)
  MFC after:      1 month
2008-08-15 16:42:07 +00:00
Marius Strobl d5b8b00bb9 MFC: r177373
Oops. Use atomic_add_long() for atomic_fetchadd_long() (not atomic_add_int())
for sparc64 and sun4v.
2008-08-15 11:37:29 +00:00
Konstantin Belousov e8544b6881 MFC r177535 by peter:
(Micro)optimization of cpu_switch for amd64.
Because r173004 (pure kernel threads) is not MFCed to stable/7, I use
P_KTHREAD flag from curthread->td_proc->p_flag instead of TDP_KTHREAD
flag from curthread->td_pflags to test whether the fs/gs bases need to
be restored [1].

No objections for MFC from:	peter
Suggested by:	jhb [1]

MFC r180992:
Bring back the save/restore of the %ds, %es, %fs and %gs registers for
the 32bit images on amd64.

The end result is almost complete syncronization of the
amd64/amd64/cpu_switch.S between head and stable/7, besides TDP_KTHREAD
difference.
2008-08-15 09:08:35 +00:00
Edwin Groothuis fcbde02018 MFC of r180208, r181413, r181418, r181421, r181424
Set magic fbsd:nokeywords property

  Remove Theory, which isn't part of the zoneinfo module but came out
  of /head/usr.sbin/zic (and isn't installed from there neither).

  MFC of tzdata2008c

  - Africa/Morocco will have DST in 2008.
  - Asia/Choibalsan should be GMT+08:00.
  - Asia/Pakistan will have DST in 2008.

  MFC of tzdata2008d

  - Mauritius will have a DST experiment between 2008-11-01 and 2009-03-31.
  - Add/Fix historical data for C-Eur, the SovietZone, Germany,
    Bahamas, San Luis.
  - Add information about West Para (America/Santarem)
  - America/Eirunepe and America/Rio_Branco go to UTC-4

  MFC on tzdata2008e:

  - Fix dates in 2008/2009 for Africa/Mauritius.
  - Leap second notification for the end of 2008.
2008-08-15 01:12:28 +00:00
John Baldwin dfbbdd145b MFC: Add support for cpusets to the 4BSD scheduler.
Committed from:	my iPhone
2008-08-14 22:04:52 +00:00
John Baldwin 5a6997a9e4 MFC: Various and sundry whitespace fixes. 2008-08-14 19:27:47 +00:00
John Baldwin dc480b1877 MFC: Retire the odd ts_flags #define that caused us to often go from the
thread to the td_sched back to the thread to find flags.
2008-08-14 18:51:19 +00:00
John Baldwin 161c5a79ba MFC: Use an sx lock to serialize writes and remove D_NEEDGIANT. 2008-08-14 18:00:37 +00:00
Peter Wemm ca38cbbb47 Remove mergeinfo on these files now that it's been taken care of in parent. 2008-08-14 04:34:47 +00:00
Peter Wemm dd3a0f67de Checkpoint; remove et mergeinfo, it should never have come back to life. 2008-08-14 04:32:53 +00:00
Peter Wemm 9e7cbc45c1 Checkpoint more mergeinfo repairs. Some of these might have been from
people reverting merges they thought weren't relevant prior to commits.
2008-08-14 04:11:49 +00:00
Peter Wemm 4cf1f50dad Fix a bunch of missing merge records for changes that have been mfc'ed,
but somehow got removed from sys mergeinfo.
2008-08-14 03:46:18 +00:00
Peter Wemm e04a627433 Restore some missing merge records from sys that somebody deleted.
Restore some missing records from forth/support.4th that I trashed.
2008-08-14 03:29:50 +00:00
Peter Wemm f1d9bcef6d Rev r179864 was recorded as a blanket merge of 44604-178817, but actually
merged just 174777.
2008-08-14 03:05:30 +00:00
Peter Wemm 4469d48751 Hoist mergeinfo for sys/cam/scsi to sys. This elides separate copy of
mergeinfo for cam/scsi now.
2008-08-14 02:47:46 +00:00
Peter Wemm f2443e9664 Hoist mergeinfo for sys/dev/usb up to sys 2008-08-14 02:23:26 +00:00
Peter Wemm 9559bca911 Hoist mergeinfo for sys/dev/gem up to sys 2008-08-14 02:21:17 +00:00
Edwin Groothuis 9b720c9905 MFC of r181352
Update the units library file.

- Merge changes from NetBSD and OpenBSD.
- Add the Euro as a primitive unit, add old converted currency and
  pegged currency (Obtained from Wikipedia)
- Rename "dollar" to "usdollar" as primitive unit, remove non-pegged
  currency and add pegged currency (Obtained from Wikipedia)
- Updated the accuracy of a lot of constants (Obtained from Wikipedia)

PR:             bin/106545 bin/88252
Submitted by:   trasz<[email protected]>, J Vinopal <[email protected]>
2008-08-14 01:47:39 +00:00
Peter Wemm d01fc04b35 Hoist boot/forth/support.4th mergeinfo to sys 2008-08-14 01:46:35 +00:00
Peter Wemm bb8dd85061 Hoist mergeinfo for sys/powerpc/include/atomic.h up to sys.
Note that some of the changes that were mfc'ed to powerpc actually affect
other platforms.  This hoisting brings those changes to the others.
This adds atomic_fetchadd_long to the rest, and adds
atomic_readandclear_ptr to ia64.  While I have not compile tested this, it
looks harmless.
2008-08-14 01:40:12 +00:00
Dag-Erling Smørgrav 7384219d3f MFH r179051 (support for tracing 32-bit binaries on amd64)
MFH r179059 (retire alpha support)
MFH r181061 (code cleanup)
2008-08-14 01:36:47 +00:00
Dag-Erling Smørgrav 74f53aa63e MFH r175062 (break takes a pointer, not an int) 2008-08-14 01:20:59 +00:00
Jack F Vogel cb41daec19 Document the E1000 driver changes for the 7.1 RELEASE 2008-08-14 00:58:54 +00:00
Peter Wemm d3060e3a02 Promote all sys/kern mergeinfo to sys 2008-08-14 00:48:59 +00:00
Peter Wemm 4e6ad6d904 Revert the well meaning, but broken rev 181692. For example, sys/nlm has
had several "all revs" merges.  If this is exported up to the root of sys
as-is, then it records that 'all revs' of head have been merged for the
entire sys tree, which they have not.

Work is in progress to sanitize the current state and prevent it from
happening again.
2008-08-13 19:46:51 +00:00
Dag-Erling Smørgrav 250b09366a Forcibly move all mergeinfo up to sys. 2008-08-13 16:49:00 +00:00
David E. O'Brien 563cde9b07 MFC: r180922: allow kernel config files to include files other than those
in the CWD, using unquoted paths.
2008-08-13 14:23:26 +00:00
Konstantin Belousov dd36f6c163 MFC r181345:
User may do "mount -o snapshot ...", that causes new FFS mount to be
performed with snapshot option, while the mp->mnt_opt is NULL.
Protect against NULL pointer dereference.

MFC r181528:
Revert r181345.
Move the NULL pointer check to the vfs_deleteopt() function.
2008-08-13 12:40:23 +00:00
Henrik Brix Andersen 5ac2a9c050 MFC of SVN rev 181482:
Add quirks for making uhid(4) ignore the Apple iPhone and iPhone 3G.

Approved by:	sam
2008-08-12 19:40:18 +00:00
John Baldwin aa7139ba49 Move mergeinfo for sys/net/if_gre.c up to sys/. 2008-08-12 19:22:43 +00:00
Dag-Erling Smørgrav 522dc162f8 MFH r176471 (KTR_STRUCT, support for struct stat and struct sockaddr) 2008-08-12 17:22:51 +00:00
Stanislav Sedov ff4bbc67a4 - MFC r180693. Whitespace fixes.
Approved by:	kib
2008-08-12 10:08:25 +00:00
Ed Schouten c001665038 MFC of SVN r181466:
Delete unused files in the window(1) directory that contain a colon.

During the import of the 4.4BSD Lite sources, four files got added to
the repository called :tt, :tty, :var and :ww. They seem to contain some
kind of debug information. These files aren't used/installed anywhere.

Unfortunately the colons in the filenames prevents us from checking out
the source tree on file systems that don't support colons (such as FAT).
Just remove these unneeded files to keep SVN happy.

Reported by:    Rohit Tripathi <rohit trip gmail com>
2008-08-12 08:54:43 +00:00
Edwin Groothuis 04cc662a51 MFC of r181322
style(9)ify usr.bin/calendar

PR:		bin/11864
2008-08-12 04:55:54 +00:00
Kevin Lo e86c0cd521 MFC: r181620
Add et(4) to the list of drivers use the miibus interface
2008-08-12 01:21:43 +00:00
Jack F Vogel c11061b666 MFC of the 1.4.7 ixgbe driver 2008-08-11 21:02:22 +00:00
Jack F Vogel 0fde2155e9 Add LRO code into kernel build. 2008-08-11 20:43:01 +00:00
Jack F Vogel 8f798ae07a MFC of the e1000 driver reorg - add igb driver to GENERIC 2008-08-11 20:31:14 +00:00
Jack F Vogel 78950a18a2 MFC of the e1000 driver reorg - add igb to the default kernel. 2008-08-11 20:30:31 +00:00
Marius Strobl 48ae4667c6 MFC: 181399
Allow 53C1010 without NVRAM to negotiate Ultra-3.
2008-08-11 20:24:08 +00:00
Jack F Vogel 8f99e487dd MFC of vlan attach notification support. 2008-08-11 20:20:13 +00:00
Jack F Vogel 19b8d689e4 MFC of vlan attach event support 2008-08-11 20:19:38 +00:00
Jack F Vogel 4174a93f66 MFC of the generic LRO facility 2008-08-11 18:53:36 +00:00
Jack F Vogel 97c4b69a3d MFC of the new em/igb driver reorg, sources for both drivers
now reside in dev/e1000 so static kernel build works correctly
but loadable modules still build in independent directories as
before.
2008-08-11 18:45:51 +00:00
Jack F Vogel ad4a8524e1 MFC of the em/igb driver reorg 2008-08-11 18:37:51 +00:00
Jack F Vogel 5273b033ed MFC of the em/igb driver reorg 2008-08-11 18:33:10 +00:00
Max Laier 1cbe9dd40f MFC r181295: tcp state reuse
PR:		kern/125261
2008-08-11 17:59:47 +00:00
Konstantin Belousov 585d6f6775 MFC r177431:
Improve VT_WAITACTIVE semantics.
- Wait for requested vty activation regardless its open state.
- Remove redundant console cleanup.

MFC r181286:
Lower the priority of the sleep in the syscons for "waitvt" wchan to
PZERO + 1.
2008-08-11 10:30:23 +00:00
Kevin Lo 168e9e6238 MFC: r181343
Fix a copy/paste error
2008-08-11 04:52:22 +00:00
Andrew Thompson 864ce1d910 MFC r172615 (cognet)
Do not use __XSCALE__ to detect if clz is available, use _ARM_ARCH_5 instead.
2008-08-10 21:31:39 +00:00
Konstantin Belousov 948a2910a6 MFC r181235:
Calling linker_load_dependencies() while holding the module'
vnode lock may cause a LOR between kld_sx lock and vnode lock.
linker_load_dependencies() drops kld_sx, and another thread may attempt
to load the same kld.
2008-08-10 13:18:07 +00:00
Philip Paeps f428b23100 MFC r181432:
Add a "glimpse" target to the kernel Makefile.
2008-08-10 10:15:20 +00:00
Tim Kientzle 1e2316bbd1 MFC r181269: Colin's __dead2 markers 2008-08-10 07:48:41 +00:00
Tim Kientzle e11b7f5dcc Actually MFC r180827 | simon | 2008-07-26 10:22:40 -0700 (Sat, 26 Jul 2008)
- Fix mtree example so it works.
- Document --version.
2008-08-10 07:47:34 +00:00
Tim Kientzle 98b8bdaeef MFC r180283, r180284: Allocate 64k copy buffer on heap, not stack.
Refactor duplicated tar_mode_[cru] code down into archive_write.
2008-08-10 07:45:38 +00:00
Tim Kientzle 2ba143e592 MFC r180281: Clean up fd handling. 2008-08-10 07:43:19 +00:00
Tim Kientzle 0d99670078 MFC r180277: Restore an unnecessary NULL check, for stylistic reasons. 2008-08-10 07:41:00 +00:00
Tim Kientzle 74eaa99899 MFC r179988: Include the filename when reporting file truncation. 2008-08-10 07:38:25 +00:00
Tim Kientzle f75424ddc3 Big MFC of bsdtar 2.5.5. 2008-08-10 07:35:55 +00:00
Tim Kientzle e2a958fca0 MFC r179236: Remove an unnecessary check for NULL 2008-08-10 07:15:33 +00:00
Tim Kientzle c27df3b6fe MFC r179131 | cperciva | 2008-05-19 11:38:01 -0700 (Mon, 19 May 2008)
Avoid a call to malloc(0) when invoked as 'tar ""'.  This avoids a bizarre
error message when malloc() is set to System V mode (malloc(0) == NULL).
2008-08-10 07:14:38 +00:00
Tim Kientzle 22476830fc MFC r179083, r179213: When we receive SIGINFO (or SIGUSR1), print out some
basic progress information.
2008-08-10 07:07:00 +00:00
Tim Kientzle d35e3b2d17 MFC r179072 | cperciva | 2008-05-17 08:55:29 -0700 (Sat, 17 May 2008)
> Add --keep-newer-files option (as in GNU tar: When in -x mode, ignore
> files if the existing file is newer than the archive entry).
2008-08-10 07:02:48 +00:00
Tim Kientzle 96458d8b2e MFC r178717: --format is permitted with -r or -u,
document that -o is a synonym for --format=ustar when used with -c, -r, or -u
2008-08-10 07:00:12 +00:00
Tim Kientzle 50bd603dde MFC r178716: --version succeeds 2008-08-10 06:58:09 +00:00
Tim Kientzle b22c8fe3ce MFC r178715, r175052: New bsdtar test harness, modeled after
libarchive test harness.
2008-08-10 06:53:28 +00:00
Tim Kientzle c01fd9828c MFC r178714: allow -r and -T together even when there are no files on
the command line.

PR:		bin/123246
2008-08-10 06:44:39 +00:00
Tim Kientzle 1287d42639 MFC r177214: style fix and a comment. 2008-08-10 06:43:20 +00:00
Tim Kientzle 3f714ad8a5 MFC r177211 | kientzle | 2008-03-14 20:28:39 -0700 (Fri, 14 Mar 2008)
Support NetBSD's --insecure as a synonym for -P.
2008-08-10 06:36:43 +00:00
Tim Kientzle 8ce73b1582 MFC -q as synonym for --fast-read 2008-08-10 06:32:34 +00:00
Tim Kientzle f1ac77321b MFC --chroot option and documentation 2008-08-10 06:30:40 +00:00
Tim Kientzle 30d7e7ee96 MFC --compress and --uncompress as synonyms for -Z 2008-08-10 06:28:39 +00:00
Tim Kientzle 42f50b516f MFC r177204 | kientzle | 2008-03-14 19:41:44 -0700 (Fri, 14 Mar 2008)
> Enable and document the -Z option for selecting "compress" compression,
> now that libarchive supports it.
2008-08-10 06:26:29 +00:00
Tim Kientzle cd0ec038c0 MFC r176395 | kientzle | 2008-02-18 21:27:17 -0800 (Mon, 18 Feb 2008)
> Allow appending to archives on block devices as well as
> archives in regular files, since both are seekable.
2008-08-10 06:24:31 +00:00
Tim Kientzle 24e55e7ba6 MFC r181485 | kientzle | 2008-08-09 19:06:28 -0700 (Sat, 09 Aug 2008)
> MfP4: Joerg Sonnenberger's fixes to make 'ar' and 'pax' writers
> robust against multiple calls to their destroy() functions.
2008-08-10 06:09:25 +00:00
Andrew Thompson 1a9be635b4 MFC r174141
Correct the nwbx_ies field type in struct ndis_wlan_bssid_ex.

 PR:		kern/118369
2008-08-10 05:57:10 +00:00
Tim Kientzle e8e6383434 MFC __dead2 marker 2008-08-10 05:40:16 +00:00
Tim Kientzle 7e9cf5b189 MFC removal of an unused variable. 2008-08-10 05:39:25 +00:00
Tim Kientzle 8ba4417711 MFC missing $FreeBSD$ markers. 2008-08-10 05:38:07 +00:00
Tim Kientzle 954a32fc8d MFC various corrections to the test suite Makefile. 2008-08-10 05:30:28 +00:00
Tim Kientzle fb8056b49a MFC r180027, r180028, r180122, r180123, r181489
Cumulatively, these implement CRC32 validation when reading Zip
archives and the test suite updates to ensure that CRC32
checking really will fail on a damaged entry and succeed on
a valid one.
2008-08-10 05:00:14 +00:00
Tim Kientzle 87ec343af7 Big MFC of libarchive 2.5.5. 2008-08-10 04:32:47 +00:00
Tim Kientzle 13908cf8c8 MFC r179235 | cperciva | 2008-05-22 22:01:29 -0700 (Thu, 22 May 2008)
> Check that lseek(2) succeeds and puts us where we expect. [1]
>
> While we're here, fix a long-standing bug in the handling of write(2)
> errors: The API changed from "return # of bytes written" to "return
> status code" almost 4 years ago, so instead of returning (-1) we need
> to return ARCHIVE_FATAL.
>
> Found by:       Coverity Prevent [1]
2008-08-10 02:19:17 +00:00
Tim Kientzle 49e5544565 MFC r179234 | cperciva | 2008-05-22 21:57:28 -0700 (Thu, 22 May 2008)
> We only use the string "?rwxrwxrwx " once, so inline it rather than
> declaring a variable which points to it.  Aside from eliminating a
> line of code and one level of unnecessary indirection, this eliminates
> a false positive in Coverity.
2008-08-10 02:17:23 +00:00
Tim Kientzle dd0363b3ec MFC r179125
> r179125 | cperciva | 2008-05-19 11:06:48 -0700 (Mon, 19 May 2008) | 5 lines
> Return ARCHIVE_FATAL if we can't allocate memory instead of going ahead and
> dereferencing NULL.
> Found by:       Coverity Prevent
2008-08-10 02:13:52 +00:00
Tim Kientzle f0a452186e Fix up mergeinfo to reflect the current status of this branch.
stable/7/lib/libarchive was already almost identical to
head/lib/libarchive@177777.  This matches it up exactly
(except that I declined to resurrect the .cvsignore file)
and records that alignment in svn:mergeinfo.
2008-08-09 23:14:37 +00:00
Andrew Thompson ea79483b07 MFC r179780
Fix spelling.
2008-08-09 20:55:52 +00:00
Pyun YongHyeon b356183619 MFC r181272-r181275.
r181272:
   Use ANSI C declarations for all functions.
  r181273:
   Remove register keyword.
  r181274:
   Remove return keyword at the end of functions that return void.
  r181275:
   Rearrange conditional compilation directives. This makes syntax
   highlighting work in vim.
2008-08-09 02:26:07 +00:00
Pyun YongHyeon b47aac19b8 MFC r181271.
Don't enable TSO by default. Users of RTL8169/8110 reported
  watchdog timeout issues and the root cause seems to stem from
  silicon bug of controller. Personally I couldn't reproduce it on
  RTL8169 controller but it seems it's dependent on usage pattern.
  For newer PCIe based controllers I have no TSO complaints but
  turning off TSO would be more safe. Users who are sure that
  their controller works with TSO can still reenable the TSO with
  ifconfig(8).
2008-08-09 02:11:59 +00:00
Pyun YongHyeon 1575b32343 MFC r181270.
The number of bits reserved for MSS in RealTek controllers is
  11bits. This limits the maximum interface MTU size in TSO case
  as upper stack should not generate TCP segments with MSS greater
  than the limit. Armed with this information, disable TSO if
  interface MTU is greater than the limit.
2008-08-09 02:07:30 +00:00
Pyun YongHyeon df5b87a8a7 MFC r180946, r180981.
Add missing jme(4), msk(4), re(4) and stge(4) in NOTES and
  ensure that LINT builds include these devices.
2008-08-09 01:42:51 +00:00
Rui Paulo e341bf4c2c MFC r181297:
Add coretemp(4) and k8temp(4).
2008-08-09 00:30:46 +00:00
Marcel Moolenaar 13ba6b4806 MFC r177991:
Increase the size of the EFI system partition from 16M to 20M.
2008-08-08 23:54:46 +00:00
Maksim Yevmenkin eb31d5b061 MFC SVN rev 181093
Implement ratelimiting for debug messages. For now, allow at most
one message per second. In the future might add a sysctl knob for
each socket family to fine tune this.
2008-08-08 23:19:48 +00:00
John Baldwin d3dec0eae2 MFC: Fix PCI ID for 945GME and enable Q35/G33/Q33. 2008-08-08 20:40:35 +00:00
Peter Wemm 70c6239068 Move mergeinfo for 175615 up one level. 2008-08-08 19:41:14 +00:00
Robert Watson 28b8612084 Merge r177846 from head to stable/7:
Add manpages for rw_try_rlock() and rw_try_wlock() functions.

Discussed with:	attilio, jhb
2008-08-08 19:41:11 +00:00
Rafal Jaworowski fc0cb9f37a MFC 181296
Fix ARM nocache allocator.
2008-08-08 17:31:47 +00:00
Robert Watson 2138b41690 Merge r177843,178147 from head to stable/7:
Add rw_try_rlock() and rw_try_wlock() to rwlocks.
  These functions try the specified operation (rlocking and wlocking) and
  true is returned if the operation completes, false otherwise.

  The KPI is enriched by this commit, so __FreeBSD_version bumping and
  manpage updating will happen soon.

  Requested by:   jeff, kris

  Trylocks were implemented, remove stale comment

Discussed with:	attilio, jhb
2008-08-08 14:36:21 +00:00
Sean Farley a18bcf9339 MFC: r181150, r181266
Detect if the application has cleared the environ variable by setting
the first value (environ[0]) to NULL.  This is in addition to the
current detection of environ being replaced, which includes being set to
NULL.  Without this fix, the environment is not truly wiped, but appears
to be by getenv() until an *env() call is made to alter the enviroment.

This change is necessary to support those applications that use this
method for clearing environ such as Dovecot and Postfix.  Applications
such as Sendmail and the base system's env replace environ (already
detected).  While neither of these methods are defined by SUSv3, it is
best to support them due to historic reasons and in lieu of a clean,
defined method.

Add extra units tests for clearing environ using four different methods:
1. Set environ to NULL pointer.
2. Set environ[0] to NULL pointer.
3. Set environ to calloc()'d NULL-terminated array.
4. Set environ to static NULL-terminated array.

Noticed by:	Timo Sirainen
Reviewed by:	ache
2008-08-08 00:49:28 +00:00
Peter Wemm a52f73e342 Revert bogus mergeinfo that says that 178243 and 178247 were merged from
stable/7/sys to stable/7/sys.  (byte range locking)
2008-08-08 00:33:35 +00:00
Jung-uk Kim 49177e9ad6 MFC: r180515
Allow injecting big packets via bpf(4) up to min(MTU, 16K-byte).
2008-08-07 20:06:09 +00:00
Ivan Voras 80074eef25 MFC 180791: Tweak for AMD GEODE USB/EHCI chip to support EHCI
PR:		usb/120017
Approved by:	gnn (mentor)
2008-08-07 19:32:37 +00:00
John Baldwin 3f63762ffc MFC: Add support for /etc/sysctl.conf.local. 2008-08-07 18:45:04 +00:00
John Baldwin b4b97b0523 Consolidate mergeinfo. 2008-08-07 13:30:31 +00:00
John Baldwin 2540be53bd Fix mergeinfo for 178818. 2008-08-07 13:28:15 +00:00
Marius Strobl 388dffc71c MFC: r180664
- Remove redundant inclusion of opt_global.h.
- Use __FBSDID in autoconf.c.
2008-08-07 12:15:47 +00:00
Marius Strobl 9c0c63ed57 MFC: r180686, r180781
For sun4v ensure there is an opt_global.h with SUN4V defined included,
even for the stand-alone build.
2008-08-07 11:22:24 +00:00
Konstantin Belousov 81f2850431 Record the merge of the r178243, r178247 against the correct merge base.
Pointed by:	jhb
2008-08-07 10:26:49 +00:00
John Baldwin 3e6358e122 MFC: Trim some noise from some #ifdef's. 2008-08-07 07:25:48 +00:00
Christian Brueffer e1f084e46d current -> STABLE here, as in all other STABLE branches.
Submitted by:	joel
2008-08-07 07:16:07 +00:00
John Baldwin d0b0fba741 Checkpoint cleaning up some merge info. 2008-08-07 04:46:24 +00:00
John Baldwin cd65f199bd MFC: Tweaks to short cable changes:
- SIS_SETBIT already does a read-modify-write.
- Set all of the "optimum performance" PHY registers for the 15D parts.
2008-08-07 03:27:10 +00:00
John Baldwin 48d492e0fa MFC: Change incorrect stale cookie detection in syncookie_lookup() that
prematurely declared a cookie as expired.
2008-08-05 22:22:47 +00:00
John Baldwin f77747ee5d MFC: Fix a check in the SYN cache expansion to accept packets that arrive
in the receive window instead of just on the left edge of the receive
window.
2008-08-05 22:08:04 +00:00
Christian S.J. Peron 5eb90a55ec MFC r172995,176935,174267
- Bring in auditing support of coredumps
- Merge supporting tweaks which initialized some variables and
  fixed a proc lock leak in certain error conditions.
2008-08-05 22:01:39 +00:00
Christian S.J. Peron d40fd7f636 Merge revision r175763
Initialize termid.at_type
2008-08-05 17:11:20 +00:00
Doug Rabson 822c10db3d MFC: r180025,180064,180069,180217,180743,180779-180780
Implement support for NFS advisory locking in the kernel including correct
semantics for flock(2) style locks.

Sponsored by:	Isilon Systems
PR:		94256
2008-08-05 10:35:51 +00:00
Remko Lodder b20ce307a0 MFC r179762
Document more tmpfs mount options that are already
  available.

  PR: 124488
  Submitted by: gahr
2008-08-05 07:28:06 +00:00
Remko Lodder edd769259c MFC r181163
Add support for the ASUS P535 PDA

  PR:             kern/126097
  Submitted by:   Anton Kartashev <[email protected]>
  Approved by:    imp (mentor, implicit)
  MFC after:      3 days

Approved by:	imp (mentor, implicit)
2008-08-05 06:37:49 +00:00
Andrew Thompson b921902cd0 MFC r176203 (raj)
Eliminate BUS_DMA <-> cache incoherencies in USB transfers.
2008-08-05 02:16:54 +00:00
David Xu ff0cf32d6b MFC SVN rev 181099:
Correctly return result in pthread_condattr_getpshared.
2008-08-05 01:29:51 +00:00
Edwin Groothuis 8a56d50f0f MFC of r173169, r175002, r175003:
- Never use getenv("HOME") without checking for NULL and non-zero (kevlo)
- If we can't open a calendar file, don't guess why.  Check the error
  return and print a useful message (grog)
2008-08-04 23:39:30 +00:00
Maksim Yevmenkin cd523c6725 MFC: SVN rev 181089
Increase maximum input queue size limit for raw Bluetooth HCI sockets.
2008-08-04 22:07:06 +00:00
John Baldwin f2e249a4d2 Consolidate merge info. 2008-08-04 21:50:31 +00:00
John Baldwin 4e3d1f8338 MFC: Fix a few bugs with the _gettemp() routine which implements mkstemp(),
mkstemps(), and mkdtemp().
2008-08-04 21:20:22 +00:00
Robert Watson c6235f1154 Merge r179781 from head to stable/7:
The TrustedBSD MAC Framework named struct ipq instances 'ipq', which is the
  same as the global variable defined in ip_input.c.  Instead, adopt the name
  'q' as found in about 1/2 of uses in ip_input.c, preventing a collision on
  the name.  This is non-harmful, but means that search and replace on the
  global works less well (as in the virtualization work), as well as indexing
  tools.

  Reported by:    julian
2008-08-04 08:50:16 +00:00
Scott Long b594663602 Merge rev 1.48: Don't force a reset at driver attach time. 2008-08-04 05:52:58 +00:00
Scott Long e55390ee7a Merge rev 1.47: Fix probe and attach so that the raid personality gets
properly initialized.
2008-08-04 05:38:02 +00:00
Pyun YongHyeon 84c7f2c1c3 taskqueue_block(9)/taskqueue_unblock(9) was merged, remove
conditional compilation directive.
2008-08-04 01:13:53 +00:00
Robert Watson 9e5f2c34a6 Merge r180042 from head to stable/7:
Introduce locking around use of ifindex_table, whose use was previously
  unsynchronized.  While races were extremely rare, we've now had a
  couple of reports of panics in environments involving large numbers of
  IPSEC tunnels being added very quickly on an active system.

  - Add accessor functions ifnet_byindex(), ifaddr_byindex(),
    ifdev_byindex() to replace existing accessor macros.  These functions
    now acquire the ifnet lock before derefencing the table.
  - Add IFNET_WLOCK_ASSERT().
  - Add static accessor functions ifnet_setbyindex(), ifdev_setbyindex(),
    which set values in the table either asserting of acquiring the ifnet
    lock.
  - Use accessor functions throughout if.c to modify and read
    ifindex_table.
  - Rework ifnet attach/detach to lock around ifindex_table modification.

  Note that these changes simply close races around use of ifindex_table,
  and make no attempt to solve the probem of disappearing ifnets.  Further
  refinement of this work, including with respect to ifindex_table
  resizing, is still required.

  In a future change, the ifnet lock should be converted from a mutex to an
  rwlock in order to reduce contention.

  Reviewed and tested by: brooks
2008-08-03 21:40:34 +00:00
Tom Rhodes 239be491dc MFC r175798:
Update this manual page to describe the extattr_list_file() and the
extattr_list_fd() functions.

PR:		108142
Submitted by:	Richard Dawe <[email protected]>
Reviewed by:	kientzle
2008-08-03 18:59:56 +00:00
Simon L. B. Nielsen f87222e2d0 MFC r179715:
When the file-system containing the audit log file is running low on
  disk space a warning is printed.  Make this warning a bit more
  informative.
2008-08-03 17:19:18 +00:00
Scott Long 16bde5d2ec Merge rev 1.11: remove AMR_SCSI_PASSTHROUGH conditional 2008-08-03 15:34:21 +00:00
Scott Long e5f3bb3cd9 Merge rev 180633: Flush the PCI bus while spin-waiting for an update to come
over the bus
2008-08-03 15:25:22 +00:00
Scott Long 1e64d72a2d Merge rev 1.12: Remove an errant definition. 2008-08-03 15:22:45 +00:00
Scott Long 60179afe90 Merge rev 1.85, 1.11, 1.35: Improve error handling, eliminate memory
corruption when using linux MegaRAID apps, eliminate OOM deadlock.
2008-08-03 15:20:03 +00:00
Scott Long e34a6f20dc Merge rev 1.84, 1.27, 1.40, 1.34: Rewrite DMA codepaths 2008-08-03 15:17:14 +00:00
Scott Long e1244785fd Merge rev 1.83, 1.26: Provide unique malloc types. 2008-08-03 15:14:15 +00:00
Scott Long 609ae2ac9d Merge rev 1.25: Refactor code and fix locking 2008-08-03 15:10:55 +00:00
Scott Long 0237a5409f Merge rev 1.24: style.9 compliance 2008-08-03 15:07:40 +00:00
Scott Long cf669b0d60 Merge rev 1.39: Fix typo hidden by AMR_DEBUG 2008-08-03 15:05:06 +00:00
Scott Long 4c33765f92 Merge rev 1.82: Fix printf format errors 2008-08-03 15:01:02 +00:00
Scott Long 7a675ba36f Merge rev 1.81, 1.23: Add locking for AMR SCSI passthrough. 2008-08-03 14:58:18 +00:00
Scott Long 99544c155a Merge rev 1.41, 1.18: Implement taskqueue_block, taskqueue_unblock. 2008-08-03 14:28:26 +00:00
Scott Long a42c3f860b Merge rev 1.37: Further fixes to locking in scsi_ses 2008-08-03 14:11:15 +00:00
Robert Watson 52c9bf4e5f When r177253 and r177255 were merged from head to stable/7, the
addition of a ';' after a SYSINIT declaration was missed in
powerpc/machdep.c because the file had moved in head.  This
commit adds the missing ';'.
2008-08-03 12:18:17 +00:00
Edwin Groothuis 984e605ef0 MFC of r181230
calendar.holiday:  Buinea-bissau should be Guinea-Bissau

PR:		conf/126199
Submitted by:	comet--berkeley (aka Pablo Picasso) <[email protected]>
Approved by:	bde@
2008-08-03 09:25:12 +00:00
Andrew Thompson 8de4340590 MFC r180249
port % count will never be greater than LAGG_MAX_PORTS so nuke the test.
2008-08-03 03:50:39 +00:00
Andrew Thompson e799626cce MFC r180220
Be smarter about disabling interface capabilities. TOE/TSO/TXCSUM will only be
 disabled if one (or more) of the member interfaces does not support it. Always
 turn off LRO since we can not bridge a combined frame.
2008-08-03 03:46:58 +00:00
Robert Watson 2e2a8061de Modify MAC policy function names and local variables in a manner similar
to those in r172955, only don't rename any externally accessible symbols.
This moves the policy modules in stable/7 to being closer to those in
head without disrupting the KBI.  While here, also synchronize some
amount of white space.

Obtained from:	TrustedBSD Project
2008-08-02 22:35:39 +00:00
Scott Long e792bb6161 Merge rev 1.192: fix a missing mutex unlock in the cam_high_power case. 2008-08-02 21:24:33 +00:00
Scott Long bc01ee549d Merge rev 1.198 2008-08-02 21:01:10 +00:00
Scott Long c8f3e50d9b Merge rev 1.197: Check to see if the device supports querying for its serial
number before actually trying to query for it.
2008-08-02 20:54:10 +00:00
Scott Long 0061b26cee Merge rev 1.196: fix a missing unlock to an error path in XPT_DEBUG. 2008-08-02 20:50:45 +00:00
Robert Watson b72446640b Merge r180306 from head to stable/7:
Rename raw_append() to rip_append(): the raw_ prefix is generally used
  for functions in the generic raw socket library (raw_cb.c, raw_usrreq.c),
  and they are not used for IPv4 raw sockets.
2008-08-02 19:21:25 +00:00
Robert Watson c6d16d31f6 Merge r180304 from head to stable/7:
Rename several functions in if_lmc with potential name collisions with
  global symbols, such as raw_input and raw_output, to have lmc_ prefixes.
  This doesn't affect actual functionality since the functions are static,
  but will limit the opportunities for current confusion and future
  difficulty.
2008-08-02 19:05:27 +00:00
Bjoern A. Zeeb f9238175e5 MFC: r180005, cvs rev. 1.31 atacontrol.8
Document spindown constraints as given in the original commit
  message[1] and later clarification provided by phk.

  [1] http://docs.freebsd.org/cgi/mid.cgi?200803171033.m2HAXOeN055116
2008-08-02 18:49:47 +00:00
Bjoern A. Zeeb 12a37d39bc MFC: r180629, cvs rev. 1.210 in_pcb.c
ia is a pointer thus use NULL rather then 0 for initialization and
  in comparisons to make this more obvious.
2008-08-02 18:39:44 +00:00
Bjoern A. Zeeb b4b08c816a MFC: r180427,
cvs rev. 1.209 in_pcb.c, 1.109 in_pcb.h
     cvs rev. 1.93 in6_pcb.c, 1.22 in6_pcb.h, 1.54 in6_src.c

  Pass the ucred along into in{,6}_pcblookup_local for upcoming
  prison checks.
2008-08-02 18:32:22 +00:00
Bjoern A. Zeeb c957693085 MFC: r180357, cvs rev. 1.80 kern_jail.c
Plug a memory leak with jail services.

PR:		125257
Submitted by:	Mateusz Guzik <mjguzik gmail.com>
2008-08-02 16:53:45 +00:00
Bjoern A. Zeeb 572889d8c3 MFC: r180425,
cvs rev. 1.208 in_pcb.c, 1.108 in_pcb.h, 1.92 in6_pcb.c, 1.21 in6_pcb.h

  For consistency take lport as u_short in in{,6}_pcblookup_local.
  All callers either pass in an u_short or u_int16_t.
2008-08-02 16:46:42 +00:00
Robert Watson 8b84918937 Merge r180139 from head to stable/7:
Remove unused 'td' arguments from smbfs_hash_lock() and
  smbfs_hash_unlock().
2008-08-02 16:33:44 +00:00
Scott Long 68b3120050 In the interest of reducing diffs and doing future merges, merge in the
silly changes of rev 1.193.
2008-08-02 15:55:16 +00:00
Bjoern A. Zeeb d37f956086 MFC: r180392, cvs rev. 1.207 in_pcb.c
For consistency with the rest of the function use the locally cached
  pointer pcbinfo rather than inp->inp_pcbinfo.
2008-08-02 15:02:20 +00:00
Bjoern A. Zeeb 0bee74b863 MFC: r180371,180386
cvs rev. 1.91 in6_pcb.c, 1.52,1.53 in6_src.c, 1.43 ip6_var.h
      rev. 1.80 raw_ip6.c, 1.91 udp6_usrreq.c

  Change the parameters to in6_selectsrc():
  - pass in the inp instead of both in6p_moptions and laddr.
  - pass in cred for upcoming prison checks.

  Document required locking in in6_sleectsrc() in case an inp is
  passed in by adding an assert.
  Requested by:   rwatson
2008-08-02 14:55:58 +00:00
Bjoern A. Zeeb 83ea558e37 MFC: r180085,180090, cvs rev. 1.10, 1.11 ip6_ipsec.c
Update the correct stats (v6 instead of v4).
2008-08-02 13:59:13 +00:00
Remko Lodder 3de94b3fde Fix whitespace bug (8spaces into tab).
Submitted by:	ed
2008-08-02 13:48:22 +00:00
Remko Lodder 276a7710e8 MFC r180492
More explicitly mention that we support the 2920C with the ahc driver.

  PR:             125535
  Submitted by:   Bob Bishop <rb at gid dot co dot uk>
  MFC after:      3 days
2008-08-02 13:42:28 +00:00
Remko Lodder c3a13af37a MFC r180491
Update the ktr_header structure, which changed over time.

  PR:             125546
  Submitted by:   Mateusz Guzik <mjguzik at gmail dot com>
  MFC after:      3 days
2008-08-02 13:40:14 +00:00
Bjoern A. Zeeb 38ae41901b MFC: r179356, rev. 1.25 ping6.8, 1.34 ping6.c
Change the exit status for 0 and 2 to be the same as with ping(1)
  and be usable in scripts, etc.

  This also changes the semantics in case when we lose one of n packets.
  In that case, before we exited by SIG, now we exit with return(0).

  Submitted by:   Gert Doering (gert space.net)
2008-08-02 13:14:35 +00:00
Remko Lodder 4e0b2f18a7 MFC r179880
Document the _arg versions of the uma_zalloc and uma_zfree functions.

  PR:             docs/120357
  Submitted by:   gahr
  MFC after:      3 days
2008-08-02 12:49:56 +00:00
Remko Lodder 6c4c6f5d41 MFC r180389 (which includes another scsi id as well).
Add quirk for the Samsung YP-U3

  PR:             125398
  Submitted by:   Tino Engel <goaengel at gmx dot net>
  Approved by:    imp (mentor, implicit)
  MFC after:      1 week

Approved by:	imp (mentor)
2008-08-02 12:46:22 +00:00
Remko Lodder d81b1df82b MFC r180437
Detect ATA controllers in the Macbook3.

  PR:		118135
  Submitted by:	ed
  Approved by:	imp (mentor, implicit)
  MFC after:	1 week

Approved by:	imp (mentor, implicit)
2008-08-02 12:34:49 +00:00
Remko Lodder 0e94fd8e6d MFC r180384
Driver failed to allocate MMIO resources. Attached patch adds a fallback path.
  It uses generic IDE facilities if sii-specific allocations failed

  PR:		125421
  Submitted by:	Andrey V. Elsukov <bu7cher at yandex dot ru>
  Approved by:	imp (mentor, implicit)
  MFC after:	1 week

Approved by:	imp (mentor, implicit)
2008-08-02 12:33:28 +00:00
Remko Lodder a6b4d15850 MFC r180383
Add new device id for ICH8M, which supports greater than UDMA33 mode
  when it worked as generic IDE.

  PR:			125422
  Submitted by:		Andrey V. Elsukov <bu7cher at yandex dot ru>
  Approved by:		imp (mentor, implicit)
  MFC after:		1 week

Approved by:	imp (mentor, implicit)
2008-08-02 12:31:15 +00:00
Remko Lodder 7e7cc9ff30 MFC r180382:
Add support for the ICH9 in non AHCI mode (RAID mode).

  Submitted by:	Andrey V. Elsukov <bu7cher at yandex dot ru>
  Tested by:	Vitalij L. Fadeev <fvl at mail dot ru>
  Approved by:	imp (mentor, implicit)
  MFC after:	1 week

Approved by:	imp (mentor, implicit)
2008-08-02 12:29:43 +00:00
Yoshihiro Takahashi d3d987a499 MFi386:
Drastically simplify the i386 pcpu backend by merging parts of the
  amd64 mechanism over.
2008-08-02 10:31:48 +00:00
John Baldwin b2c702eb77 MFC: Drastically simplify the i386 pcpu backend by merging parts of the
amd64 mechanism over.
2008-08-01 20:17:21 +00:00
Robert Watson 452e6f1028 Merge r180131 from head to stable/7:
Remove spls from NFS server setup call; expand receive socket buffer
  locking to cover full setup of socket upcalls; remove XXX about
  locking.
2008-08-01 11:11:12 +00:00
Robert Watson d69af6ceba Merge r179517 from head to stable/7:
Add an XXX comment regarding a bug I introduced when modifying the behavior
  of audit log vnode rotation: on shutdown, we may not properly drain all
  pending records, which could lead to lost records during system shutdown.
2008-08-01 11:00:14 +00:00
Robert Watson d9c1cb5439 Merge r179487 from head to stable/7:
When allocating temporary storage to hold a TCP/IP packet header
  template, use an M_TEMP malloc(9) allocation rather than an mbuf
  with mtod(9) and dtom(9).  This eliminates the last use of
  dtom(9) in TCP.
2008-08-01 10:32:11 +00:00
Konstantin Belousov 9708160352 MFC r180799:
Call pargs_drop() unconditionally in do_execve(), the function correctly
handles the NULL argument.
Make pargs_free() static.
2008-08-01 10:07:40 +00:00
Konstantin Belousov cb917b839b MFC r178243:
Move the head of byte-level advisory lock list from the
filesystem-specific vnode data to the struct vnode. Provide the
default implementation for the vop_advlock and vop_advlockasync.
Purge the locks on the vnode reclaim by using the lf_purgelocks().
The default implementation is augmented for the nfs and smbfs.
In the nfs_advlock, push the Giant inside the nfs_dolock.

Before the change, the vop_advlock and vop_advlockasync have taken the
unlocked vnode and dereferenced the fs-private inode data, racing with
with the vnode reclamation due to forced unmount. Now, the vop_getattr
under the shared vnode lock is used to obtain the inode size, and
later, in the lf_advlockasync, after locking the vnode interlock, the
VI_DOOMED flag is checked to prevent an operation on the doomed vnode.

MFC r178247:
Fix compilation with LOCKF_DEBUG.

As was announced on the stable@, the MFC changes the VFS KBI on RELENG_7.

Approved by:	re (kensmith)
2008-08-01 09:46:19 +00:00
Dmitry Morozovsky 5e38927c8c MFC r181115:
Fix empty mailto (-m "") handling: somehow I missed all checks but the first,
  hence output would be written to the wrong filehandle.

Submitted by:	reg
Approved by:	yar (implicit)
MFC after:	ASAP
Pointy hat to:	marck
2008-08-01 08:13:01 +00:00
Kip Macy 24cdc8bc7a enable iwarp driver in the build 2008-07-31 23:19:30 +00:00
Kip Macy 9c5f533270 MFC addition of malloc flag to blist so that it can be used in ithread context 2008-07-31 23:18:09 +00:00
Kip Macy 0f05025c98 add kernel rdma support to the build 2008-07-31 23:15:18 +00:00
Kip Macy d2a1880ac5 add TOE to the build 2008-07-31 22:57:52 +00:00
Kip Macy d6db122ab6 remove unused define 2008-07-31 22:55:18 +00:00
Kip Macy 00865fa11d update tom to reflect sockbuf refactoring 2008-07-31 22:48:43 +00:00
Kip Macy ac8b9dafdb make tcp_var.h independent of sockopt.h 2008-07-31 22:47:36 +00:00
Kip Macy 577ce98540 MFC ARP update hooks and change to arpresolve to do arp resolution without a pending mbuf to transmit 2008-07-31 22:42:27 +00:00
Robert Watson fd9e4a89bc Merge r178461 from head to stable/7:
Use logic or, not binary or, when deciding whether or not a system call
  exit requires entering the audit code.  The result is much the same,
  but they mean different things.

  Submitted by:   Diego Giagio <dgiagio at gmail dot com>
2008-07-31 22:33:01 +00:00
Kip Macy 2b0d9ba3da MFC removal of extraneous debug statements. 2008-07-31 22:25:51 +00:00
Kip Macy 1066637bdd MFC sockbuf refactoring and fixes to cxgb TOE 2008-07-31 20:35:44 +00:00
Florent Thoumie e35c0657be MFC r180566: Don't set PACKAGE_BUILDING while installing packages. 2008-07-31 15:58:22 +00:00
Konstantin Belousov b867bac2bf MFC r180570:
Pair the VOP_OPEN call from do_execve() with the reciprocal VOP_CLOSE.

Note: the change needed small adaptation to RELENG_7 because fexecve(2)
is not merged into the branch.
2008-07-31 11:43:07 +00:00
Ed Schouten dbbca1974e MFC r180875:
Fix a small typo in the procstat(1) manpage: messsage queue.
2008-07-31 08:50:07 +00:00
Ollivier Robert f06584b840 MFC r180949
Macbook [Pro] keyboards in AZERTY don't need shift to get to '~'.
2008-07-31 08:18:03 +00:00
Kip Macy 4e2bd80a08 fix TOE build errors & warnings 2008-07-31 06:17:39 +00:00
Kip Macy c9315d890e MFC:
- Add socket option for setting and retrieving the congestion control algorithm.
  The name used is to allow compatibility with Linux.

- add rcv_nxt, snd_nxt, and toe offload id to FreeBSD-specific
  extension fields for tcp_info
2008-07-31 06:10:25 +00:00
Kip Macy fff2bef161 make tom_info field naming consistent 2008-07-31 05:53:56 +00:00
Kip Macy c8a3595c9c MFC accessor functions for socket fields. 2008-07-31 05:48:51 +00:00
Kip Macy 740af042e4 MFC inp accessor functions 2008-07-31 05:40:59 +00:00
Pyun YongHyeon 208762a771 MFC r180869
Fix buffer discard index.
  While I'm here dicard all buffers if errored frame is part of
  multi-segmented frames.
2008-07-31 01:13:19 +00:00
John Baldwin c75c5d740e yyMFC: Allow VM object creation in ufs_lookup(). 2008-07-30 21:43:42 +00:00
Bjoern A. Zeeb d1c06f2027 MFC r179289, rev. 1.221 udp_usrreq.c, 1.98 ip6_input.c, 1.42 ip6_var.h
Factor out the v4-only vs. the v6-only inp_flags processing in
  ip6_savecontrol in preparation for udp_append() to no longer
  need an WLOCK as we will no longer be modifying socket options.

  Requested by:         rwatson
  Reviewed by:          gnn
2008-07-30 21:23:21 +00:00
Kip Macy e72c010297 MFC interface for external consumers to syncache_expand 2008-07-30 20:51:20 +00:00
Kip Macy 14079cdbee MFC TCP hooks for conditionally tying TCP offload devices in to the TCP stack. 2008-07-30 20:35:41 +00:00
John Baldwin 64838394bf MFC: Use VM_FAULT_DIRTY to fault in pages for write access in
proc_rwmem().
2008-07-30 19:49:10 +00:00
Kip Macy cfd49b993e add socket options for disabling TOE 2008-07-30 19:35:40 +00:00
Robert Watson 6eeeb42a72 Merge r177272 from head to stable/7:
Consistently use ANSI C declarations for all functions in kern_synch.c.
2008-07-30 18:28:09 +00:00
Robert Watson fa8317a2b5 Merge r176906 from head to stable/7:
Move IFF_NEEDSGIANT warning from if_ethersubr.c to if.c so it is displayed
  for all network interfaces, not just ethernet-like ones.

  Upgrade it to a louder WARNING and be explicit that the flag is obsolete.
  Support for IFF_NEEDSGIANT will be removed in a few months (see arch@ for
  details) and will not appear in 8.0.

  Upgrade if_watchdog to a WARNING.
2008-07-30 17:27:10 +00:00
Robert Watson f1bf907c77 Merge r175903 from head to stable/7:
Add comment that bpfread() has multi-threading issues.

  Fix minor white space nit.
2008-07-30 14:04:01 +00:00
Robert Watson b4693957a0 Merge r175870 from head to stable/7:
Use FEATURE() macro to advertise aio availability.
2008-07-30 13:19:50 +00:00
Konstantin Belousov 4c848ce77d MFC r180738:
Do the pargs_hold() on the copy of the pointer to the p_args of the
child process immediately after bulk bcopy() without dropping the
process lock.
2008-07-30 09:44:40 +00:00
Edwin Groothuis 8af4a7101c MFC of 180646, 180877:
After the commit of SVN rev 180236, wilko@ noticed that the approach
doesn't work on the Alpha platform: machine/elf.h doesn't include
sys/elf32.h there.

PR:             related to bin/124906
Approved by:    bde@
2008-07-30 03:33:49 +00:00
Kip Macy ee492e11a6 MFC basic common and iwarp kernel RDMA infrastructure. 2008-07-30 00:27:48 +00:00
Kip Macy 2015f1ecbe MFC TOE defines 2008-07-30 00:20:04 +00:00
Kip Macy 814d01c1f8 add INP_W(UN)LOCK forward compat macros 2008-07-30 00:18:32 +00:00
Kip Macy 0ba54c08f5 MFC IFCAP_TOE 2008-07-30 00:17:40 +00:00
Kip Macy 19ca6a0988 MFC toe device interface 2008-07-30 00:16:37 +00:00
Kip Macy c876426fb8 MFC core TCP offload infrastructure bits without hooking them
up to the build.
2008-07-30 00:09:15 +00:00
Konstantin Belousov 008aae729f MFC r180446:
Use the VM_ALLOC_INTERRUPT for the page requests when allocating memory
for the bio for swapout write.
2008-07-29 12:10:15 +00:00
Konstantin Belousov 8d7f6515b2 MFC r180822: Note that snapshots may cause a panic on the full UFS filesystem. 2008-07-29 11:34:32 +00:00
Konstantin Belousov a41937a73d Correct CSCOPEDIRS definition 2008-07-29 11:31:08 +00:00
Maxim Konovalov 295aaeb263 MFC r180694: fix attribution, correct surname. 2008-07-29 09:01:15 +00:00
Maxim Konovalov 6dd69d0401 Partially MFC r180627: add cddl, nlm and xdr to CSCOPEDIRS. 2008-07-29 08:44:44 +00:00
Kip Macy 6971fe8ddf MFC the following:
- vendor bug fixes
  - driver side of iwarp support
  - driver side of TOE support
  - Makefile cleanup
2008-07-28 23:37:33 +00:00
Antoine Brodin 3ccd11b631 MFC r179365 to stable/7:
- Increase the size of the salt in pw(8) from 8 to 32 (same as in pam_unix(8)).
   This makes blowfish password hashes look normal when set using
  pw(8)/adduser(8). [1]
  - Make it possible to have a '/' in the salt.

  PR:             121146 [1]
  Submitted by:   Jaakko Heinonen [1]
  Approved by:    rwatson (mentor)
  MFC after:      1 month
2008-07-28 20:04:39 +00:00
Antoine Brodin c9db621d8f MFC r178921 to stable/7:
Remove useless call to getdtablesize(2) in fdopen(3) and its useless
  variable nofile.

  PR:             123109
  Submitted by:   Christoph Mallon
  Approved by:    rwatson (mentor)
  MFC after:      1 month
2008-07-28 19:35:26 +00:00
Antoine Brodin 306c2eb1f9 MFC r178920 to stable/7:
Add missing braces in #if 0ed code.

  Approved by:    rwatson (mentor)
  MFC after:      1 month
2008-07-28 18:17:23 +00:00
John Baldwin 6e6d9b04ad MFC: Allocate a single CCB at the start of the main loop of the RAID
monitoring kthread of the mpt(4) driver.
2008-07-28 17:05:09 +00:00
David E. O'Brien 7cd98dc674 MFC: CVS version 1.11.22.1 (almost 1.11.23). 2008-07-28 16:52:28 +00:00
Andrew Thompson c7ca105239 MFC r172734
Merge definitions for ARM9E, ARM10 and ARM11 processors from p4 (which
 got them from NetBSD).
2008-07-28 16:47:58 +00:00
Andrew Thompson 2d68506962 MFC r180584
Eliminate unused global variables.  (These global variables became fields of
 struct kva_md_info many years ago.)
2008-07-28 16:24:35 +00:00
Andrew Thompson 73bd3d869c MFC r180486
fix multicast hash register definition
2008-07-28 16:23:39 +00:00
Andrew Thompson 17b21e7a23 MFC r179745
Fix a typo: i80321_pci_probe -> i81342_pci_probe
2008-07-28 16:22:46 +00:00
Andrew Thompson d5e60d1d0d MFC r179693
Since we create a DMA tag "mtag" for TX map with bus_dmamap_create(),
 we must synchronize such a map against "mtag" with bus_dmamap_sync(),
 not the tag designated for RX map.
2008-07-28 16:21:56 +00:00
Andrew Thompson daaeda2411 MFC r179664
Remove sa1_cache_clean_addr
2008-07-28 16:21:01 +00:00
Andrew Thompson 48e101b547 MFC r179375
Release the resources for the registers for the TWI device with
 SYS_RES_MEMORY to match how we allocate them...
2008-07-28 16:20:08 +00:00
Andrew Thompson 03348c831b MFC r178978
Don't let hacksync() call bus_dmamap_sync(9) on DMA maps which
 are not initialized. This fixes a panic on sparc64 where calling
 bus_dmamap_sync(9) on NULL DMA maps is fatal.
2008-07-28 16:19:16 +00:00
Andrew Thompson 23e63a1310 MFC r178001
Remove some long-dead code
2008-07-28 16:18:28 +00:00
Andrew Thompson 391297b847 MFC r177944
Remove bus_space_generic.c from the per-plarform files. Having it in the
 per-cpu files should be enough.
2008-07-28 16:17:33 +00:00
Andrew Thompson ba310fa3a9 MFC r177943
Add bus_space_generic.c for the i81342 as well.
2008-07-28 16:16:38 +00:00
Andrew Thompson 6fd5cec937 MFC r177916
Make kernel.tramp build properly on ARM9E.
2008-07-28 16:15:42 +00:00
Andrew Thompson 6b6d76d906 MFC r177888
Now really add the bus_space_generic.c file...
2008-07-28 16:14:49 +00:00
Andrew Thompson 15fc7c3775 MFC r177887
Refactor certain ARM bus space methods: instead of having multiple copies of
 the same code introduce sys/arm/arm/bus_space_generic.c for a shared set of
 routines.
2008-07-28 16:13:55 +00:00
Andrew Thompson b29d32a4a9 MFC r177886
Fix AVILA build.
2008-07-28 16:12:56 +00:00
Andrew Thompson 384663c0a9 MFC r177883
Take the first baby step towards unifying and cleaning up arminit():
 	- Pull all the code to deal with the trampoline stuff into one
 	  centeralized place and use it from everywhere.
 	- Some minor style tidiness
2008-07-28 16:12:00 +00:00
Andrew Thompson 2ee8ed8472 MFC r177874
KERNBASE + 0x00200000 is the same thing as KERNVIRTADDR on this
 platform, so use the latter in preference to the former.  This makes
 the fake_preload setup be the same between kb920x_machdep.c and
 avila_machdep.c....
2008-07-28 16:11:11 +00:00
Andrew Thompson a3b1ef7c0e MFC r177505
Improve mac+phy configuration so that hints can be used to describe
 layouts different than the defaults:
 o hint.npe.0.mac="A", "B", etc. specifies the window for MAC register accesses
 o hint.npe.0.mii="A", "B", etc. specifies PHY registers
 o hint.npe.1.phy=%d specifies the PHY to map to a port
2008-07-28 16:10:18 +00:00
Andrew Thompson d23193ac91 MFC r177459
Workaround design botch in usb: blindly mixing bus_dma with PIO does not
 work on architectures with a write-back cache as the PIO writes end up
 in the cache which the sync(BUS_DMASYNC_POSTREAD) in usb_transfer_complete
 then discards; compensate in the xfer methods that do PIO by pushing the
 writes out of the cache before usb_transfer_complete is called.
2008-07-28 16:09:22 +00:00
Andrew Thompson 74885a7fd3 MFC r177457
Correct cache handling for xfer requests marked URQ_REQUEST: many (if not
 all uses) involve a read but usbd_start_transfer only does a PREWRITE; change
 this to BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE as I'm not sure if any
 users do write+read.
2008-07-28 16:08:26 +00:00
Andrew Thompson 9dfad3814e MFC r177105
Respect RF_SHAREABLE flag in ARM nexus_setup_intr()
2008-07-28 16:07:30 +00:00
Andrew Thompson 3225224e68 MFC r177103
Improve ARM bus_dmamap_load_buffer() error handling.
2008-07-28 16:06:34 +00:00
Andrew Thompson a149a1f52d MFC r176759
Convert to be a 2-clause bsd-only license.
2008-07-28 16:05:48 +00:00
Andrew Thompson 0d8172e079 MFC r175120
Add a missing \n.
2008-07-28 16:04:53 +00:00
Andrew Thompson 5b182c5207 MFC r174781
Actually program the interrupt controller for priorities.  As we
 support more AT91 platforms, we'll need to move this into some
 platform init routine.
2008-07-28 16:03:59 +00:00
Andrew Thompson 5a751cc85d MFC r174700
Use M_NOWAIT instead of M_WAITOK to cause malloc() to return NULL
2008-07-28 16:03:06 +00:00
Andrew Thompson 042baf38cc MFC r174176
Move the strongarm-specific files from conf/files.arm to sa11x0/files.sa11xO.
2008-07-28 16:02:10 +00:00
Andrew Thompson fee47704d7 MFC r174058
Fixes for ARM9/ARM10 :
 Call uma_sel_align() there at well.
 Set CPU_CONTROL_VECRELOC if we're using the high vectors page.
2008-07-28 16:01:18 +00:00
Andrew Thompson dcb5008ed2 MFC r174051
Correct the logic : we can just invalidate the cache lines, and not
 write-back them, only if PREWRITE is not set, and if the buffer is
 cache-line aligned.
2008-07-28 16:00:19 +00:00
Andrew Thompson 405e477ee5 MFC r173442
Add entries for the L2 cache-related functions for armv5.
2008-07-28 15:59:24 +00:00
Andrew Thompson 72464a53ba MFC r173336
Remove a staled comment, NPE-C should work fine.
2008-07-28 15:58:24 +00:00
Andrew Thompson 20ed6638f7 MFC r173249
__CPU_XSCALE_PXA2XX -> CPU_XSCALE_PXA2X0
2008-07-28 15:57:31 +00:00
Andrew Thompson 852fb45f63 MFC r173215
Don't define get_cachetype() for CPU_ARM9E unless it's going to be used.
2008-07-28 15:56:33 +00:00
Andrew Thompson 53e85b094c MFC r173155
kill commented out line of code.
2008-07-28 15:55:41 +00:00
Andrew Thompson 3ef9a057cb MFC r172739
correct guard variable names.
2008-07-28 15:54:48 +00:00
Andrew Thompson a499a1416c MFC r172738
Merge support from p4 (from NetBSD) for arm9e and arm10, arm11 cores.  Not
 yet connected to the build, but reduces diffs to p4 repo.
2008-07-28 15:53:53 +00:00
Andrew Thompson cd021f8183 MFC r172614
Do not use __XSCALE__ to detect if pld/strd/ldrd is available, use
 _ARM_ARCH_5E instead.
2008-07-28 15:52:53 +00:00
Andrew Thompson 8d5db4f7c0 MFC r172613
Define _ARM_ARCH_5E too, so that we know if pld/strd/ldrd are available.
2008-07-28 15:52:07 +00:00
Andrew Thompson 788c6e2e0d MFC r172568
Spelling fix for interupt -> interrupt
2008-07-28 15:49:26 +00:00
Robert Watson 3f981b77fa Merge r180610, r180616, r180673 from head to stable/7:
Add DDB "show conifhk" command, which lists hooks currently waiting
  for completion in run_interrupt_driven_config_hooks().  This is
  helpful when trying to figure out which device drivers have gone
  into la-la land during boot-time autoconfiguration.

  Rather than simply waiting silently and indefinitely for all
  interrupt-driven configuration handlers to complete, print out a
  diagnostic message every 60 second indicating which handlers are
  still running.  Do this at most 5 times per run so as to avoid
  scrolling out any useful information from the kernel message
  buffer.

  The interval of 60 seconds was selected based on a best guess as
  to the nature of "long enough" and may want to be tuned higher
  or lower depending on real-world tolerances.

  If run_interrupt_driven_config_hooks() waits 360 seconds and INVARIANTS
  is compiled into the kernel, then panic.

  Discussed with: scottl
2008-07-27 23:28:29 +00:00
Xin LI 1409696616 MFC r179881:
Revert rev. 178124 as requested by kris@.  Having jail id not being
reused too frequently is useful for script controlled environment.
2008-07-27 18:55:03 +00:00
Dmitry Morozovsky 9ee83bab5e MFC r180096:
Add -m option to cron(8), overriding default mail recipient for cron
	mails, unless explicitly provided by MAILTO= line in crontab.  This
	feature can be useful in massive hosting environment, where most users
	do not care about autogenerated mails.

	Setting recipient to null string disables default mails at all.

Approved by:	yar
2008-07-27 07:19:30 +00:00
Julian Elischer d6761ba972 MFC the ability to send WCCP style GRE packets as well as just receive them. 2008-07-27 00:44:30 +00:00
Julian Elischer 3eea56b2e5 MFC of a local variable change to not shadow a global config var. 2008-07-27 00:42:05 +00:00
Marcel Moolenaar 43cab646b6 MFC 179854
Implement the set and unset verbs.
2008-07-26 22:55:15 +00:00
Marcel Moolenaar ee5040596c MFC 178451
Add support for gpart
2008-07-26 22:52:12 +00:00
Marcel Moolenaar 0c7367d929 MFC r179853
Add the set and unset verbs used to set and clear attributes for
partition entries.
2008-07-26 19:32:10 +00:00
Konstantin Belousov 40f9e78a3a Although being recorded as MFC of the r177369, this change was
introduced for the KSE case in the r177083. Both were done by jeff,
MFC is needed due to recent cpuset(2) commit to RELENG_7.

r177083:
KSE may free a thread that was never actually forked. This will leave
td_cpuset NULL. Check for this condition before dereferencing the
cpuset.

r177369:
Restore the NULL check for td_cpuset. This can happen if a partially
constructed thread was torn down as is the case when we fail to allocate
a kernel stack.
2008-07-26 18:58:50 +00:00
Marcel Moolenaar b78e7dc7de MFC r179763
Finish the support for partition labels and add it to the XML.
2008-07-26 01:08:20 +00:00
Marcel Moolenaar 9681822bc0 MFC r179747-179748,179750-179752,179755-179756
Add the raw partition type to the XML.
2008-07-26 00:01:25 +00:00
John Baldwin da3a055fb2 Regen after cpuset changes.
Prodded by:	kib
2008-07-25 19:54:10 +00:00
John Baldwin db6f0b4752 MFC: Missed in earlier MFC, connect cpuset(1) to the build. 2008-07-25 19:41:51 +00:00
John Baldwin caed757f4b MFC: Properly report failure for update operations if "pwd_mkdb -C" fails. 2008-07-25 17:50:43 +00:00
John Baldwin 8020f2586b MFC: Add cpuset, an api for thread to cpu binding and cpu resource grouping
and assignment.  This is mostly synched up with what is in HEAD with the
following exceptions:
- I didn't MFC any of the interrupt binding stuff as it requires other
  changes and I figured this change was large enough as it is.
- The sched_affinity() implementation for ULE in HEAD depends on the newer
  CPU topology stuff as well as other changes in ULE.  Rather than
  backport all of that, I implemented sched_affinity() using the existing
  CPU topology and ULE code in 7.x.  Thus, any bugs in the ULE affinity
  stuff in 7 are purely my fault and not Jeff's.

Note that, just as in HEAD, cpusets currently don't work on SCHED_4BSD (the
syscalls will succeed, but they don't have any effect).

Tested by:	brooks, ps
2008-07-25 17:46:01 +00:00
Andrew Gallatin a1a3402751 Sync mxge with head and perform 2 forgotten MFCs:
MFC r177104: Remove dead code which makes a call to mem_range_attr_set()

MFC r177862: Initialize if_baudrate using IF_Gbps() macro.
2008-07-25 15:57:18 +00:00
Andrew Gallatin 6be815675b MFC r180567: Clean up mxge's use of callouts as pointed out by jhb,
and handle NIC hardware watchdog resets.
2008-07-25 15:16:21 +00:00
Konstantin Belousov 05090376cf MFC r180445:
Make it atomic for the devfs_populate_loop() to see the setting of
SI_ALIAS flag and initialization of the si_parent when alias is created.
Assert that supplied parent device is not NULL.
2008-07-25 09:41:59 +00:00
Julian Elischer 526222e0cb fix leftover reference to kill(2) (which was used as a template for
this page).

Submitted by:	Kostik Belousov
2008-07-25 01:11:07 +00:00
Julian Elischer d95d71bee7 Now that libc exports the symbol we can now use the setfib
libc entrypoint instead of using syscall(175,...)
2008-07-24 19:27:25 +00:00
Julian Elischer 3edef1d8e9 Add the appropriate entry to the Symbol map for the new setfib syscall 2008-07-24 19:21:45 +00:00
Julian Elischer 43494e6c94 Fix spellign error in comment 2008-07-24 19:05:32 +00:00
Julian Elischer 2464d70d48 MFC the fact that the setfib rule is not a terminal rule 2008-07-24 18:58:39 +00:00
Julian Elischer e0249e19ef Commit ancillary parts of the MFC that I couldn't do last night because
the SVN server went strange (repoman. crashed I believe).

Obtained from:	 Cisco IronPort
2008-07-24 17:39:51 +00:00
Julian Elischer 174cbff88a MFC a fix for corrected comparisons.
MFC change 179570
2008-07-24 15:11:43 +00:00
Julian Elischer e2b0ddb016 Add setfib to build 2008-07-24 01:17:16 +00:00
Julian Elischer b6f21d05a2 MFC an ABI compatible implementation of Multiple routing tables.
See the commit message for
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/net/route.c
version 1.129 (svn change # 178888) for more info.

Obtained from:	 Ironport (Cisco Systems)
2008-07-24 01:13:22 +00:00
Xin LI 8992267704 MFC r180727: Sync with NetBSD's license changes. 2008-07-24 00:47:44 +00:00
Pyun YongHyeon 60028f0470 MFC r180580.
Use DELAY() instead of pause if waiting time is less than 1ms.
  This will fix driver hang if hz < 1000.

  Pointed out by:	thompsa
2008-07-24 00:35:50 +00:00
Pyun YongHyeon 2b14c882c4 MFC r180582.
Correct 1000Mbps link handling logic for JMC250. This should make
  jme(4) run on 1000Mbps link.
2008-07-24 00:30:35 +00:00
Pyun YongHyeon 6cf3d45898 MFC r180552.
Fix a multicast handling regression on VT6105M introduced in
  vr(4) overhauling(r177050).

  It seems that filtering multicast addresses with multicast CAM
  entries require accessing 'CAM enable bit' for each CAM entry.
  Subsequent accessing multicast CAM control register without
  toggling the 'CAM enable bit' seem to no effects.
  In order to fix that separate CAM setup from CAM mask configuration
  and CAM entry modification. While I'm here add VLAN CAM filtering
  feature which will be enabled in future(FreeBSD now can receive
  VLAN id insertion/removal event from vlan(4) on the fly).

  For VT6105M hardware, explicitly disable VLAN hardware tag
  insertion/stripping and enable VLAN CAM filtering for VLAN id 0.
  This shall make non-VLAN frames set VR_RXSTAT_VIDHIT bit in Rx
  status word.

  Added multicast/VLAN CAM address definition to header file.

  PR:	kern/125010, kern/125024
2008-07-23 08:18:42 +00:00
Pyun YongHyeon eab038dbaa MFC r180551.
Fix VR_RXSTAT_RX_OK bit definition which lasted for more than 9
  years. All datasheet I have indicates the bit 15 is the
  VR_RXSTAT_RX_OK. The bit 14 is reserved for all Rhine family
  except VT6105M. VT6105M uses that bit to indicate a VLAN frame
  with matching CAM VLAN id.
  Use the VR_RXSTAT_RX_OK instead of VR_RXSTAT_RXERR when vr(4)
  checks the validity of received frame.
  This should fix occasional dropping frames on VT6105M.
2008-07-23 08:14:33 +00:00
Xin LI a5ccb8dd75 Sync with -HEAD:
* Fix typos in znew(1) script (yar, r176133 + r180136);
 * Make it clear that gzcat expects each argument to be
   separate files. (r180126).
 * License change in unbzip2.c (r180135)
2008-07-22 23:22:03 +00:00
Xin LI 263ec636f5 MFC sound(4) subsystem changes r178155,178250,178324,179205,180110,180532,
this includes support for Sigmatel STAC9205, correct SB600 AC97 as well
as newer Dell hardware.
2008-07-22 19:52:23 +00:00
Ulf Lilleengen adcd2ede1d MFC r180612:
- When renaming a drive, also set the drive name in the gvinum header.

PR:		kern/125632
Approved by:	pjd (mentor)
2008-07-22 19:50:34 +00:00
Peter Wemm a220833045 Move mergeinfo for 173081 from root to sys
Move mergeinfo for 178818 from root to etc and include
2008-07-22 19:00:21 +00:00
Giorgos Keramidas 7df405060c MFC change 180637 - tcsh abort in xgetpass()
PR:             bin/124191
2008-07-22 15:14:33 +00:00
Robert Watson 555297ffdc Merge r177253, r177255 from head to stable/7:
In keeping with style(9)'s recommendations on macros, use a ';'
  after each SYSINIT() macro invocation.  This makes a number of
  lightweight C parsers much happier with the FreeBSD kernel
  source, including cflow's prcc and lxr.

  Discussed with: imp, rink

The requirement to place a ; after each SYSINIT definition has not been
MFC'd, as this might break the compile third-party modules, but merging
the actual ; additions reduces diffs against 8.x making it easier to
merge other changes.
2008-07-22 14:27:47 +00:00
Julian Elischer c3878c2382 MFC code cleanup. 177416
Replace really convoluted code that simplifies to "a ^= 0x01;"
2008-07-21 22:15:21 +00:00
Ermal Luçi 6fef9b090c MFC r180513:
Fix carp(4) panics that can occur during carp interface configuration.

Approved by:	mlaier (mentor)
Reported by:    Scott Ullrich
2008-07-21 19:51:01 +00:00
John Baldwin 74038651ff MFC: Use dedicated buffers for user requests rather than reusing the space
in the request buffer.
2008-07-21 19:11:20 +00:00
John Baldwin 4c8392920c MFC: During shutdown, deregister the shutdown hook from the correct event
handler.
2008-07-21 18:13:41 +00:00
Marius Strobl 081e88c57c - Fix spelling and style.
- Use __FBSDID.
- Merge macros depending on the flags being preserved between calls
  into a single "__asm"-statement as GCC doesn't guarantee their
  consecutive output even when using consecutive "__asm __volatile"-
  statement for them. Remove the otherwise unnecessary "__volatile". [1]
- The inline assembler instructions used here alter the condition
  codes so add them to the clobber list accordingly.
- The inline assembler instructions used here uses output operands
  before all input operands are consumed so add appropriate modifiers.

Pointed out by:	bde [1]
2008-07-21 16:56:15 +00:00
Konstantin Belousov 9d1d1f5b6e MFC r180340:
The kqueue_register() function assumes that it is called from the top of
the syscall code and acquires various event subsystem locks as needed.
The handling of the NOTE_TRACK for EVFILT_PROC is currently done by
calling the kqueue_register() from filt_proc() filter, causing recursive
entrance of the kqueue code. This results in the LORs and recursive
acquisition of the locks.

Implement the variant of the knote() function designed to only handle
the fork() event. It mostly copies the knote() body, but also handles
the NOTE_TRACK, removing the handling from the filt_proc(), where it
causes problems described above. The function is called from the fork1()
instead of knote().

When encountering NOTE_TRACK knote, it marks the knote as influx
and drops the knlist and kqueue lock. In this context call to
kqueue_register is safe from the problems.

An error from the kqueue_register() is reported to the observer as
NOTE_TRACKERR fflag.

PR:     108201
2008-07-21 09:59:40 +00:00
Kevin Lo 69c72dbcc4 MFC: r180597
Fix a longstanding bug, from Otto Moerbeck:
if we're reducing a rule that has an empty
right hand side and the yacc stackpointer is pointing at the very
end of the allocated stack, we end up accessing the stack out of
bounds by the implicit $$ = $1 action

Obtained from:	OpenBSD
2008-07-21 01:13:33 +00:00
Tom Rhodes 9a6b087279 MFC r175615:
Add a diagnostic note about "transmission error ... tx underrun, increasing
tx start threshold ..." Looking around on the mailing lists, and even having
one of these cards I agree the messages should be documented.

Bump doc date.

PR: 88477
2008-07-20 15:59:44 +00:00
Oleksandr Tymoshenko e303908c73 MFC r179971:
In case of interface initialization failure remove struct in_ifaddr* from
in_ifaddrhashtbl in in_ifinit because error handler in in_control removes
entries only for AF_INET addresses. If in_ifinit is called for the cloned
inteface that has just been created its address family is not AF_INET and
therefor LIST_REMOVE is not called for respective LIST_INSERT_HEAD and
freed entries remain in in_ifaddrhashtbl and lead to memory corruption.

PR:		kern/124384
MFC after:	3 weeks
2008-07-19 12:12:17 +00:00
Joseph Koshy b7f58f25b2 MFC: r180148: Fix a regression. 2008-07-19 04:31:47 +00:00
Oleksandr Tymoshenko 59b5cdedc2 MFC r179716:
Keep proper track of nsegs counter: sem_free is called for all
allocated semaphores, so it's wrong to increase it conditionally,
in this case for every over-the-limit semaphore nsegs is decreased
without being previously increased.

PR:		kern/123685
MFC after:	more then 1 month
2008-07-18 14:20:16 +00:00
Oleksandr Tymoshenko d31ff8fbee MFC r179879:
Renew semaphore's pointer after wakeup since during msleep
sem_base may have been modified by destroying one of semaphores
and semptr would not be valid in this case.

PR:		kern/123731
MFC after:	1 month
2008-07-18 13:24:56 +00:00
John Baldwin ccef89cf5f MFC: Tweak the output of controller event log messages to reduce verbosity
and add some simple formatting of timestamps and event classes.
2008-07-17 19:02:38 +00:00
John Baldwin 225322fe26 MFC: Improve the handling of pending events in the controller's event log
during boot.
2008-07-17 18:54:08 +00:00
John Baldwin 4bb8b8fb61 MFC: Change SEM_VALUE_MAX (maximum value of a POSIX semaphore) from UINT_MAX
to INT_MAX.
2008-07-17 17:54:11 +00:00
John Baldwin 3f1924bc38 MFC: Don't set the _file member of the FILE when opening a FTP connection. 2008-07-17 16:04:41 +00:00
Coleman Kane 30d0e588b5 MFC of r179806 to 7-STABLE:
Silence warning about missing IoGetDeviceObjectPointer by implementing
a simple stub that always returns STATUS_SUCCESS.

Submitted by:	Paul B. Mahol <[email protected]>
Reviewed by:	thompsa
2008-07-16 16:28:12 +00:00
Doug Barton 4e1542f020 MFC r179637, r179655, and r180503, the inclusion of the svnversion info
for uname.
2008-07-16 10:27:26 +00:00
Doug Barton 0dbf600325 MFC r180478, stronger wording to warn users about not using the
query-source option, and a better example.
2008-07-16 10:02:15 +00:00
Doug Barton 84ebaf27bd Hopefully get the moving of mergeinfo from etc/rc.d/initrandom to etc
right this time
2008-07-16 09:54:21 +00:00
Doug Barton 679b8b11fe Move mergeinfo off of initrandom and onto etc/ 2008-07-16 09:38:02 +00:00
Pyun YongHyeon 6dfc6f1b81 MFC r179347.
Add jme(4) to the list of drivers supported by GENERIC kernel.
2008-07-16 02:05:40 +00:00
Pyun YongHyeon 453ab95012 MFC r179346.
Hook up jme(4) to the build.
2008-07-16 02:01:49 +00:00
Pyun YongHyeon 167f8dc9dc MFC r179344.
Add jme(4) to the list of supported network interface.
2008-07-16 01:59:08 +00:00
Pyun YongHyeon 93380e3ee1 MFC r179343.
Add an entry for the jme(4) module.
2008-07-16 01:56:00 +00:00
Pyun YongHyeon d5ea077967 MFC r179342.
Add jme(4) to the list of drivers use the miibus interface.
2008-07-16 01:28:01 +00:00
Pyun YongHyeon 3743c905ae MFC r179341.
Add jme(4) to the list of drivers supporting ALTQ.
2008-07-16 01:27:04 +00:00
Pyun YongHyeon 5ef0f57603 MFC r179340.
Add jme(4) to the list of devices supporting full VLAN processing
  in hardware.
2008-07-16 01:25:50 +00:00
Pyun YongHyeon c517608e84 MFC r179339.
Add man page for jme(4).
2008-07-16 01:24:27 +00:00
Pyun YongHyeon 3152e49f91 MFC r179338.
Hook up jme(4) to the build.
2008-07-16 01:12:02 +00:00
Pyun YongHyeon 0f0bf30afd taskqueue_block(9)/taskqueue_unblock(9) is not available in RELENG_7.
Add '#ifdef notyet' to exclude them.
2008-07-16 01:02:44 +00:00
Pyun YongHyeon d121726323 MFC r179337.
Add driver support for PCIe adapters based on JMicron JMC250
  gigabit ethernet and JMC260 fast ethernet controllers. ATM jme(4)
  supports all hardware features except RSS and multiple Tx/Rx queue.

  In these days most ethernet controller vendors take a ply of
  concealing hardware detailes from open source developers. As
  contrasted with these vendors JMicron provided all necessary
  information needed to write a stable driver during driver writing
  and answered many questions I had. They even helped fixing driver
  bugs with protocol analyzer. Many thanks to JMicron for their
  support of FreeBSD.

  H/W donated by:	JMicron
2008-07-16 00:52:33 +00:00
Pyun YongHyeon 039bba5161 MFC r179336.
Connect jmphy(4) to the build.
2008-07-16 00:49:22 +00:00
Pyun YongHyeon e9d21b2d91 MFC r179335.
Add JMicron JMP202/JMP211 PHY driver.
2008-07-16 00:44:49 +00:00
Pyun YongHyeon edf7ab63cf MFC r180377.
Add driver support for RTL8102E and RTL8102EL which is the second
  generation of RTL810x PCIe fast ethernet controller. Note, Tx/Rx
  descriptor format is different from that of first generation of
  RTL8101E series. Jumbo frame is not supported for RTL810x
  family.
2008-07-15 02:10:23 +00:00
Pyun YongHyeon 9d8644def4 MFC r180376.
Disable jumbo frame support for RTL810x fast ethernet controllers.
2008-07-15 02:07:17 +00:00
Pyun YongHyeon ebf6fda67f MFC r180178.
Add RTL8211C(L) support.
  Disable advanced link-down power saving in phy reset.
2008-07-15 02:04:31 +00:00
Pyun YongHyeon e203516411 MFC r180177.
Add a new RTL8169 variant, 8169SB(L)/8110SB(L).
2008-07-15 02:01:03 +00:00
Pyun YongHyeon c8baac0320 MFC r180176.
Add basic support for RTL8168C, RTL8168CP, RTL8111C and RTL8111CP.
  ATM Tx/Rx checksum offload is supported but TSO and jumbo frame is
  not yet supported. Because these newer controllers use different
  descriptor formats, a flag RL_FLAG_DESCV2 flag was introduced to
  handle that case in Tx/Rx handler. Also newer controllers seems to
  require to not touch 'enable Tx/Rx bit' in RL_CPLUS_CMD register
  so don't blindly try to set that bits.

  Note, it seems that there is still power-saving related issue where
  driver fails to attach PHY. Rebooting seems to fix that issue but
  number of required reboots varys.

  Many thanks to users that helped during developement. I really
  appreciate their patient and test/feedbacks.
2008-07-15 01:58:17 +00:00
Pyun YongHyeon 5ddeaa454f MFC r180175.
Display detected chip revision in device attach. This will help to
  diagnose revision specific issues in future. Also add 0x to notify
  that the revision number is in hex form.
2008-07-15 01:54:53 +00:00
Pyun YongHyeon 59fb20cb0e MFC r180174.
If MSI is not active make sure to disable MSI in EEPROM.
2008-07-15 01:51:30 +00:00
Pyun YongHyeon d6808a2fc9 MFC r180173.
In device detach don't access ifnet structure unless device is
  attached. This fixes NULL pointer dereference when polling(9) is
  active and unsupported hardware is detected in device attach.
2008-07-15 01:48:19 +00:00
Pyun YongHyeon 8f2b6e7ad8 MFC r180172.
Toggling IFF_ALLMULTI flag does not require full interface
  reintialization.
2008-07-15 01:38:41 +00:00
Edwin Groothuis 73481d9105 MFC of r180374
Improve the output of kldload(8) to show which module can't be loaded.

Was:            kldload: Unsupported file type
Is now:         kldload: /boot/modules/test.ko: Unsupported file type

PR:             kern/121276
Submitted by:   Edwin Groothuis <[email protected]>
Approved by:    bde (mentor)
MFC after:      1 week
2008-07-15 01:28:14 +00:00
Pyun YongHyeon 076300045f MFC r180171.
Instead of allocating variables for each events/hardware flags, use
  a dedicated flag that represents controller capabilities/events.
  This will simplify many part of code that requires different
  workaround for each controller revisions and will enhance
  readability.
  While I'm here move PHY wakeup code up before mii_phy_probe() which
  seems to help to wake PHY in some cases.
2008-07-15 01:23:02 +00:00
Pyun YongHyeon db92294cc3 MFC r180169.
Switch to memory space register mapping over IO space. If that
  mapping fails fall back to traditional IO space access.
2008-07-15 01:18:15 +00:00
Pyun YongHyeon 699b50237b MFC r180168.
While accessing EEPROM command register use pre-defined constant
  instead of hardcoded value.
2008-07-15 01:14:36 +00:00
Pyun YongHyeon 9923d3ef82 MFC r180167.
After the change of r176757 re(4) no longer relys on reading
  RL_TXCFG register to identify a device in device probe. Reflect the
  fact by modifing device description with general ethernet
  controller family.
  Note, rl_basetype in struct rl_type is not used and the more
  detailed information is provided with rl_hwrev structure.
2008-07-15 01:11:08 +00:00
Pyun YongHyeon 2f6864523d MFC r180166.
Remove duplicated H/W revision check.
2008-07-15 01:07:08 +00:00
Edwin Groothuis 3befe0619b MFC of revision 173401, 173414 and 173396:
gaames/fortune: add FORTUNE_PATH env var, so ports of fortunes can work sanely

	This patch adds an environment variable FORTUNE_PATH, which
	works like PATH for fortune files.

PR:		bin/36867
Submitted by:	Alan Eldridge <[email protected]>

[patch] fortune -e implementation bug

	Fix the behaviour of "-e file1 file2" to equally pick them
	instead of only picking the first one.

PR:		bin/70182
Submitted by:	Martin Kulas <[email protected]>
2008-07-14 10:49:01 +00:00
Tom Rhodes 265ba58cf9 MFC: r175565:
Xref flopen.3 which references this manual page.

PR: 112650
2008-07-13 19:09:35 +00:00
Colin Percival 9219d099e1 Improve randomization in BIND to prevent response spoofing.
Security:	FreeBSD-SA-08:06.bind
Approved by:	so (cperciva)
Thanks to:	remko, csjp
No thanks to:	bronchitis
2008-07-13 18:42:38 +00:00
Remko Lodder ca2db388ae Merge r180349 as well.
SVN rev 180349 on 2008-07-07 13:08:30Z by remko

  Fix some spelling errors (improper review from my
  side).

  Submitted by:	ed, danger

Submitted by:	Florian Smeets
2008-07-13 18:11:50 +00:00
Marius Strobl c0d075cbeb MFC: r179925
o The FreeBSD bus_dmamap_sync(9) supports ored together flags for quite
  some time now so collapse calls accordingly.
o Given that gem_load_txmbuf() is allowed to fail resulting in a packet
  drop also for quite some time now implement the functionality of
  gem_txcksum() by means of m_pullup(9), which de-obfuscates the code
  and allows to always retrieve the correct length of the IP header.
o Add missing BUS_DMASYNC_PREREAD when syncing the control DMA maps in
  gem_rint() and gem_start_locked().
o Correct some bus_barrier(9) calls to do a read/write barrier as we
  do a read after a write. Add some missing ones in gem_mii_readreg()
  and gem_mii_writereg().
o According to the Apple GMAC driver, the GEM ASIC specification and
  the OpenSolaris eri(7D) the TX FIFO threshold has to be set to 0x4ff
  for the Gigabit variants and 0x100 for the ERI in order do avoid TX
  underruns.
o In gem_init_locked():
  - be conservative and enable the RX and TX MACs,
  - don't clear GEM_LINK otherwise we don't ever mark the link as up
    again if gem_init_locked() is called from gem_watchdog(),
  - remove superfluous setting of sc_ifflags.
o Don't bother to check whether the interface is running or whether its
  queue is empty before calling gem_start_locked() in gem_tint(), the
  former will check these anyway.
o Call gem_start_locked() in gem_watchdog() in order to try to get
  some more packets going.
o In gem_mii_writereg() after reseting the PCS restore its configuration.

GMAC testing:	grehan, marcel
2008-07-13 17:09:22 +00:00
Remko Lodder ce7fdf8541 MFC r179831
Add another 8139D variant.

  PR:             124622
  Submitted by:   Evgeny Zhirnov <jirnov at gmail dot com>
  Approved by:    imp (mentor, implicit)
  MFC after:      3 days

Approved by:	imp (mentor, implicit)
2008-07-13 11:56:55 +00:00
Remko Lodder 862c9403d4 MFC r180345
Add missing information for geom_mirror metadata.

  PR:             124434
  Submitted by:   Philip M. Golluci <pgolluci at p6m7g8 dot com>
  MFC after:      3 days

  Prodded through:        bugbusters@

Approved by:	 imp (mentor, implicit)
2008-07-13 11:48:44 +00:00
Bjoern A. Zeeb 9fc01cd0ea MFC: rev. 1.337, svn 180215
Remove a bogusly introduced rtalloc_ign() in rev. 1.335/SVN 178029,
  generating an RTM_MISS for every IP packet forwarded making user space
  routing daemons unhappy.

PR:		kern/123621, kern/124540, kern/122338
2008-07-12 12:41:21 +00:00
Yoshihiro Takahashi 7851bc37e9 MFC: r180253
Remove Japanese document.
2008-07-12 11:35:27 +00:00
Tom Rhodes e41cbb3aeb MFC of SVN r175563:
The config-recursive target is not run during the normal install process, move
it down to where it belongs.

Document 'all-depends-list' target and bump doc date.

PR: 119519
Submitted by: Yuri Pankov <[email protected]>
Reviewed by: flz
2008-07-12 08:01:05 +00:00
Edwin Groothuis 75eddeb6b8 MFC of svn revision 174891 and 174750
Add the ability to clean up all shared memory segments which are
unused in one go.

PR:		bin/118292
Submitted by:	Callum Gibson <[email protected]>
2008-07-12 06:19:25 +00:00
Yoshihiro Takahashi 271890a26b MFC: r180145
Fix off-by-one error.
2008-07-11 15:43:07 +00:00
Daniel Gerzo 81380c4e8c MFC r180323:
- remove superfluous word
- remove contractions
2008-07-11 09:40:14 +00:00
Daniel Gerzo 6276ba90fc MFC r180325 and r180329:
- This code was intially obtained from NetBSD, but it's missing licence
  statement. Add the one from the current NetBSD version.
- Add description about a missing return value [1]

PR:		docs/75995
Submitted by:	Tarc <[email protected]>
2008-07-11 09:35:20 +00:00
John Baldwin 9d755a5648 MFC: After probing the available frequency settings, restore the CPU to run
at whatever frequency it started at.
2008-07-10 17:06:54 +00:00
Konstantin Belousov 39e444d1e3 MFC r180336:
Move the setting of KQ_FLUXWAIT after KQ_FLUX_WAKEUP() in the kqueue_scan().
2008-07-10 09:37:35 +00:00
Konstantin Belousov 58353846c3 MFC r180347:
Add #include <inttypes.h> for the strtoimax().
2008-07-10 09:24:37 +00:00
Ruslan Ermilov 9fe8e54944 MFC:
- sched_4bsd is no longer a default system scheduler on some
  architectures, so call it "traditional" instead.

- sched_ule is no longer buggy or experimental (according to
  rev. 1.7 of sched_ule(4)), so don't call it experimental
  (reported by a user on stable@).
2008-07-10 06:26:15 +00:00
Pyun YongHyeon 22b36d34fe MFC r179653
Fix typo in comment.
2008-07-10 03:34:10 +00:00
Pyun YongHyeon 87e4b191f6 MFC r179348
ASUS G2S notebook is supported by age(4).
2008-07-10 03:29:10 +00:00
Pyun YongHyeon 83602501b2 MFC r179109
Add age(4) to the list of drivers supported by GENERIC kernel.
2008-07-10 03:20:34 +00:00
Pyun YongHyeon bf8e275c66 MFC r179108
Hook up age(4) to the build.
2008-07-10 02:43:58 +00:00
Pyun YongHyeon e72fc83769 MFC r179107
Add age(4) to the list of supported network interface.
2008-07-10 02:39:32 +00:00
Pyun YongHyeon ef51bde95f MFC r179106
Add an entry for the age(4) module.
2008-07-10 02:36:01 +00:00
Pyun YongHyeon 425a659b9c MFC r179105
Add age(4) to the list of drivers use the miibus interface.
2008-07-10 02:30:23 +00:00
Pyun YongHyeon 1fa898f6ad MFC r179104
Add age(4) to the list of drivers supporting ALTQ.
2008-07-10 02:29:15 +00:00
Pyun YongHyeon 76ca26c014 MFC r179103
Add age(4) to the list of devices supporting full VLAN processing
  in hardware.
2008-07-10 02:26:55 +00:00
Pyun YongHyeon 1126dfec71 MFC r179102
Add man page for age(4).
  brueffer fixed various nits in the document.
2008-07-10 02:23:36 +00:00
Pyun YongHyeon 9aa4092e86 MFC r179101
Hook up age(4) to the build.
2008-07-10 01:43:38 +00:00
Edwin Groothuis 938a9280ba MFC of changes 180234-180236:
On 64 bit architectures, you can run 32 bit executables and the rtld can trace them, but ldd(1) doesn't know yet how to detect them:

    [/] root@ed-exigent>ldd `which httpd`
    ldd: /usr/local/sbin/httpd: can't read program header
    ldd: /usr/local/sbin/httpd: not a dynamic executable

    But...

    [/] root@ed-exigent>LD_32_TRACE_LOADED_OBJECTS==1 `which httpd`
    libm.so.4 => /lib32//libm.so.4 (0x280c8000)
    libaprutil-1.so.2 => /usr/local/lib/libaprutil-1.so.2 (0x280de000)
    libexpat.so.6 => /usr/local/lib/libexpat.so.6 (0x280f2000)
    libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x28110000)
    libapr-1.so.2 => /usr/local/lib/libapr-1.so.2 (0x281fd000)
    libcrypt.so.3 => /lib32//libcrypt.so.3 (0x2821d000)
    libpthread.so.2 => not found (0x0)
    libc.so.6 => /lib32//libc.so.6 (0x28235000)
    libpthread.so.2 => /usr/lib32/libpthread.so.2 (0x2830d000)

    Added support in ldd(1) for the LD_32_xxx environment variables if
    the architecture of the machine is >32 bits. If we ever go to 128
    bit architectures this excercise will have to be repeated but thanks
    to earlier commits today it will be relative simple.

PR:		bin/124906
Submitted by:	edwin
Approved by:	bde (mentor)
2008-07-10 01:32:08 +00:00
Pyun YongHyeon a67bff05e0 MFC r179100
Add age(4), a driver for Attansic/Atheros L1 gigabit ethernet
  controller. L1 has several threshold/timer registers and they
  seem to require careful tuned parameters to get best
  performance. Datasheet for L1 is not available to open source
  driver writers so age(4) focus on stability and correctness of
  basic Tx/Rx operation. ATM the performance of age(4) is far from
  optimal which in turn means there are mis-programmed registers or
  incorrectly configured registers.
  Currently age(4) supports all known hardware assistance including
    - MSI support.
    - TCP Segmentation Offload.
    - Hardware VLAN tag insertion/stripping.
    - TCP/UDP checksum offload.
    - Interrupt moderation.
    - Hardware statistics counter support.
    - Jumbo frame support.
    - WOL support.

  L1 gigabit ethernet controller is mainly found on ASUS
  motherboards. Note, it seems that there are other variants of
  hardware as known as L2(Fast ethernet) and newer gigabit ethernet
  (AR81xx) from Atheros. These are not supported by age(4) and
  requires a seperate driver. Big thanks to all people who reported
  feedback or tested patches.

  Tested by:	kevlo, bsam, Francois Ranchin < fyr AT fyrou DOT net >
		Thomas Nystroem < thn AT saeab DOT se >
		Roman Pogosyan < asternetadmin AT gmail DOT com >
		Derek Tattersal < dlt AT mebtel DOT net >
		Oliver Seitz < karlkiste AT yahoo DOT com >
2008-07-10 01:23:45 +00:00
Philip Paeps e64202561b MFC r180140:
Set bridge MAC addresses to the MAC address of their first interface unless
  locally configured.  This is more in line with the behaviour of other popular
  bridging implementations and makes bridges more predictable after reboots for
  example.
2008-07-08 09:54:19 +00:00
Alexander Motin bbfb692933 MFC rev 179912:
Add support for PORT/EPRT FTP commands in lowercase.
Use strncasecmp() instead of huge local implementation to reduce code size.
Check space presence after command/code.

PR:		kern/73034
2008-07-07 18:39:47 +00:00
Konstantin Belousov 5e9b703908 MFC r180252:
The uniqdosname() function takes char[12] as it third argument.
2008-07-07 10:07:00 +00:00
Rui Paulo 99d590e711 MFC k8temp (r178151, r178152, r178153, r178392, r178949, r178988,
r180312, r180313, r180326):

A driver to monitor AMD K8 CPU temperature via builtin sensors.
This should now be fairly stable as all known bugs have been corrected.
2008-07-06 16:24:50 +00:00
Oleksandr Tymoshenko 4407aed3e9 Add support for VT8237 ISA bridge.
PR:             kern/120714
MFC after:      2 weeks
2008-07-06 12:13:38 +00:00
Daniel Gerzo 68e4320367 MFC r179371 and r180221 [1]:
- various mdoc a spelling fixes
- typo fixes [1]

PR:		docs/125223 [1]
Submitted by:	Fabian Keil <fk (a) fabiankeil.de> [1]
2008-07-06 11:08:50 +00:00
Mike Makonnen 181ca70f04 MFC: r180111
Rev. 1.8 broke matching on lines where the failure mode is at the head
  of the message, such as:
    Jun 30 10:49:21 rogue sshd[17553]: Invalid user iceman from 127.0.0.1

  PR: conf/124569
  Submitted by:	Taku <[email protected]>
2008-07-06 10:21:12 +00:00
Marius Strobl 4e99ce1323 MFC: r180010
Given that sun4u uses sparc64/sparc64/in_cksum.c, use the sparc64
<machine/in_cksum.h> here also.
2008-07-05 16:30:46 +00:00
Marius Strobl 00b87469ca MFC: r180073
Add the condition codes to the clobber list.
2008-07-05 16:28:08 +00:00
Daniel Gerzo 0967303792 MFC r180158:
- install the example wpa_supplicant.conf file to the share/examples/etc
  directory [1]
- add the FILES section to the wpa_supplicant.conf.5 file, so that people
  will be able to detect the example configuration file easier. [2]

PR:		docs/121821 [2]
2008-07-05 11:08:26 +00:00
Daniel Gerzo 541603faa6 MFC r180155:
- add the -m option to the example commands because they would fail w/o it
  as the ``man'' user does not have a valid shell by default.

PR:		docs/121713
2008-07-05 10:47:59 +00:00
Dmitry Morozovsky f3c6563b6b MFC r79910:
Add -v (verbose) option to -l command, to show size and backing store
	of all md devices at one time.

Approved by:	phk
2008-07-05 08:14:04 +00:00
Xin LI 7387fa27f4 MFC revision 179895 and 179896:
Add et(4), a port of DragonFly's Agere ET1310 10/100/Gigabit
Ethernet device driver, written by sephe@

Obtained from:	DragonFly
Sponsored by:	iXsystems
MFC after:	2 weeks
2008-07-04 01:29:12 +00:00
Daniel Gerzo 16169b7d07 MFC r180071, r180112, r180154:
- markup fixes
- advise to use rc script to SIGHUP mountd
- add some missing words
- add information about possiblity of using /prefix network notation [1]

PR:		docs/124373 [1]
Obtained from:	NetBSD [1]
2008-07-03 17:02:04 +00:00
Robert Watson 1a9bb74f4a Merge files:1.1309 (r179787) from head to stable/7:
When NETATALK is compiled into the kernel, at_rmx.c is required regardless
  of whether NETATALKDEBUG is enabled, so make building it conditional on
  NETATALK instead.  This problem appears to have been present from the time
  that the netatalk implementation was imported.

  PR:             124456
  Submitted by:   Nathan Whitehorn <whitehorn at wisc dot edu>
2008-07-02 17:40:34 +00:00
Robert Watson 7cfe30718f Merge ip_dummynet.c:1.116, raw_ip.c:1.185 (r179201) from head to
stable/7:

  Consistently check IPFW and DUMMYNET privileges in the configuration
  routines for those modules, rather than in the raw socket code.  This
  each privilege check to occur in exactly once place and avoids
  duplicate checks across layers.

  Sponsored by:   nCircle Network Security, Inc.
2008-07-02 17:28:41 +00:00
Robert Watson 181cfae4ef Merge uipc_syscalls.c:1.272 (r179196) from head to stable/7:
When sendto(2) is called with an explicit destination address
  argument, call mac_socket_check_connect() on that address before
  proceeding with the send.  Otherwise policies instrumenting the
  connect entry point for the purposes of checking destination
  addresses will not have the opportunity to check implicit
  connect requests.

  Sponsored by:   nCircle Network Security, Inc.
2008-07-02 16:22:00 +00:00
Robert Watson ad6955484a Merge spx_usrreq.c:1.89 (r179410) from head to stable/7:
Rather than m_free(dtom(si)) in spx_reass(), return (1) which causes the
  caller to free the mbuf without using dtom().
2008-07-02 16:08:42 +00:00
Robert Watson 5e1ec1be14 Merge spx_usrreq.c:1.88 (r179408) from head to stable/7:
Correct minor comment typos, make white space use before block comments
  more consistent.
2008-07-02 15:38:20 +00:00
Robert Watson 4c0bb43775 Merge spx_usrreq.c:1.87 (r179332) from head to stable/7:
Avoid unnecessary one use of dtom(9) in spx_input().
2008-07-02 15:23:08 +00:00
Robert Watson 03528bada3 Merge audit_worker.c:1.24 (sys:r179176) from head to stable/7:
Don't use LK_DRAIN before calling VOP_FSYNC() in the panic case for
  audit trail failure -- this doesn't contribute anything, and might
  arguably be wrong.

  MFC after:      1 week
  Requested by:   attilio

Notice that the previous commit merging r179178 was in fact for
audit_worker.c:1.25, but the same description applies.
2008-07-02 14:50:30 +00:00
Robert Watson 96d4659a0d Merge audit_worker.c:1.24 (179178) from head to stable/7:
Don't use LK_DRAIN before calling VOP_FSYNC() in the panic case for
  audit trail failure -- this doesn't contribute anything, and might
  arguably be wrong.

  Requested by:   attilio
2008-07-02 14:31:51 +00:00
Ed Maste 731a553b3c MFC r177899:
Allow crashdumps on machines with >4GB of RAM as long as the adapter can
  do 64-bit S/G.
2008-07-02 14:17:49 +00:00
Mike Makonnen 3e0d376ea9 MFC r180060:
Support for filtering on major device number was removed in rev. 1.7 or
  rule.c. Update man page example accordingly.

  Submitted by:	Mateusz Guzik <[email protected]>
  PR: docs/124892
2008-07-02 13:03:08 +00:00
Ed Maste 3ea9eceddc MFC r179969:
Fix test for waiting AIFs in aac_poll().  This seems to solve the
  problem where Adaptec's arcconf monitoring tool hangs after producing
  its expected output.
2008-07-01 22:16:33 +00:00
Rui Paulo da22ba3623 MFC r180062:
Add the missing support for Asus Eee PC in acpi_asus(4).
	This includes hotkeys support and sysctl variables to control camera
	and card reader. These new sysctls don't have CTFLAG_ANYBODY set.

	While there add entries to devd.conf related to the Eee volume keys.

	Reviewed by:	phillip
	Also tested by:	lme (previous version)
2008-07-01 21:36:03 +00:00
Robert Watson 363712fad3 Merge audit.h:1.18 (sys:r178802) from head to stable/7:
When testing whether to enter the audit argument gathering code, rather
  than checking whether audit is enabled globally, instead check whether
  the current thread has an audit record.  This avoids entering the audit
  code to collect argument data if auditing is enabled but the current
  system call is not of interest to audit.

  Sponsored by:   Apple, Inc.
2008-07-01 18:58:07 +00:00
David E. O'Brien b8f6c4f905 MFC: r180109 / rev 1.53
Document the layout of the address space.
2008-07-01 16:42:51 +00:00
Robert Watson 54e4b7b064 Merge db_capture.c:1.6 (178492) from head to stable/7:
Rename debug.ddb.capture.bytes sysctl to debug.ddb.capture.bufoff in
  order to match the internal variable name.

  Add a new sysctl debug.ddb.capture.inprogress to export the inprogress
  variable.
2008-07-01 12:15:55 +00:00
Luigi Rizzo 6f4c5fb7eb MFC of SVN rev 180061 on 2008-06-27 10:30:08Z by luigi
Add USB ids for the Epson DX7400 / CX7300 multifunction scanner printer
 card reader.
On passing, also MFC similar entries for other epson MFP devices.

MFC after: 3 days
2008-07-01 10:52:15 +00:00
Robert Watson eeb39fdf1d Merge nwfs_node.c:1.43 (r176745) from head to stable/7:
Replace lockmgr lock protecting nwfs vnode hash table with an sx lock.
2008-07-01 10:40:49 +00:00
Robert Watson 3e8ed5bca4 Merge smbfs.h:1.13, smbfs_node.c:1.38, smbfs_vfsops.c:1.44 (r176744)
from head to stable/7:

  Replace lockmgr lock protecting smbfs node hash table with sx lock.
2008-07-01 08:41:02 +00:00
Robert Watson 75364ae797 Merge extattr.h:1.22, ufs_extattr.c:1.91 (r176797) from head to
stable/7:

  Continue on-going campaign to replace lockmgr locks with sx locks where
  the specific semantics of lockmgr aren't required: update UFS1 extended
  attributes to protect its data structures using an sx lock.

  While here, update comments on lock granularity.
2008-06-30 22:19:18 +00:00
Robert Watson 124fb6bbe5 Merge auditpipe.4:1.6 (r178726) from head to stable/7:
Fix type name: struct auditpipe_preselect is actually struct
  auditpipe_ioctl_preselect.

  Submitted by:   Stacey D. Son <stacey at son.org>
2008-06-30 18:35:11 +00:00
Ulf Lilleengen 1c488e2432 MFC rev r179288:
- Add locking to all filesystem operations in fdescfs and flag it as MPSAFE.
- Use proper synhronization primitives to protect the internal fdesc node cache
  used in fdescfs.
- Properly initialize and uninitalize hash.
- Remove unused functions.

Since fdescfs might recurse on itself, adding proper locking to it needed some
tricky workarounds in some parts to make it work. For instance, a descriptor in
fdescfs could refer to an open descriptor to itself, thus forcing the thread to
recurse on vnode locks. Because of this, other race conditions also had to be
fixed.

Approved by:	kib (mentor)
Reviewed by:	kib (mentor)
Tested by:	pho
2008-06-30 15:41:57 +00:00
Daniel Gerzo f56042975a MFC rev. 180024:
- Mark the section describing return values with an appropriate
  section flag.

PR:		docs/122818
2008-06-30 09:16:22 +00:00
Daniel Gerzo 711efdc28c - MFC rev. 180030 and 180113:
- add description of the MLINK error
  - bump a date

PR:		docs/123019
2008-06-30 09:06:19 +00:00
David Schultz ea9b763b7b MFC r179918:
Bring in the vendor's fix for a bug in strtod() whereby
  strtod("0xyz", &endp) resulted in endp pointing to "0xyz"
  instead of "xyz".
2008-06-29 16:35:33 +00:00
Philip Paeps 42d57fa3b9 MFC r180077:
Remove stray "miibus0" reference from ancient kernel config file times.
2008-06-29 12:51:49 +00:00
John Baldwin 0dd61b1869 MFC: Add a BUS_BIND_INTR() method to the bus interface to bind an IRQ
resource to a CPU.  A bus_bind_intr(9) wrapper routine similar to
bus_setup/teardown_intr() is added for device drivers to use.  Currently
it is supported on amd64, i386, and sparc64 via nexus(4) methods that
simply call the intr_bind() routine.
2008-06-28 23:54:51 +00:00
John Baldwin e609e14d75 MFC: Add preliminary support for binding interrupts to CPUs:
- Add a new method to interrupt events (ie_assign_cpu) for binding events
  to CPUs.
- Bind ithreads to CPUs in their main loop (this is the original
  implementation, it may be changed if the cpuset stuff is MFC'd).
- Add intr_event_bind().
- Implement ie_assign_cpu() and a 'intr_bind()' wrapper on amd64, i386,
  and sparc64.
2008-06-28 23:26:57 +00:00
Ed Maste 8a93778dde MFC r175163:
Honour the logical current working directory ($PWD) when using config's
  -d destdir option.  For an automounted src tree using the logical cwd
  in the Makefile keeps amd(8)'s mount timeout refreshed.  Code to check
  $PWD's validity cribbed from pwd(1).

  Discussed on hackers@.
2008-06-27 15:20:18 +00:00
David E. O'Brien 1a2e6aa9ac MFC: r177101, r177102, r177541:
If the special target .MAKEFILEDEPS exists, then enable the
"remaking makefiles" feature.  Otherwise, follow traditional Pmake behavior.
2008-06-27 14:26:43 +00:00
John Baldwin 6bf209faa4 MFC: Add the mpt_user personality to mpt(4). 2008-06-27 04:42:19 +00:00
John Baldwin 673ded81d5 MFC: Probe CPUs after the PCI hierarchy on i386, amd64, and ia64. This
allows the cpufreq drivers to reliably use properties of PCI devices for
quirks, etc.
2008-06-27 03:49:22 +00:00
John Baldwin e993131e96 MFC: Add support for the BCM5906[M] adapters including subsequent
improvements by marius@.
2008-06-27 03:24:54 +00:00
John Baldwin f1e822e26b MFC: Add a flag for Ethernet@WireSpeed capability and correct chip
revisions.
2008-06-27 03:02:50 +00:00
John Baldwin 78c4e441db MFC: Use sysctl to fetch stats from the kernel instead of reading variables
directly via libkvm.
2008-06-27 02:18:01 +00:00
John Baldwin 0667a791da MFC: Workaround a bug in the BIOS of Dell R900 machines by padding the
structure used to fetch SMAP entries.
2008-06-27 00:58:39 +00:00
John Baldwin 1795f79759 MFC: After probing the available frequency settings, restore the CPU to run
at whatever frequency it started at.
2008-06-27 00:48:23 +00:00
John Baldwin 5027c8ac7e Consolidate merge info in sys/. 2008-06-27 00:37:08 +00:00
Craig Rodrigues c98351a959 ffs_vfsops.c:
MFC 179269-179270
 - delete "snapshot" from options list after we convert mount option to MNT_SNAPSHOT flag
 - do not perform string to flag conversions for mount option which are converted
   further up in vfs_donmount() in vfs_mount.c

vfs_mount.c:
 MFC 179268
 - Do not convert the "snapshot" string to the MNT_SNAPSHOT flag here, since
   we do it further down in ffs_vfsops.c

PR:		122833
2008-06-26 22:58:20 +00:00
Alexander Motin 6d6b1e8b64 MFC rev. 1.155-1.156
Rewrite node's r/w/q-lock semantics using only atomics instead of mutex
and atomics combination. Mutex is now used only for queue protection.
Also avoid unneded extra swi scheduling calls.

Add memory barriers to the node locking operations.
Add some comments.
2008-06-26 20:21:20 +00:00
Alex Dupre ffdb4d7391 MFC r179989: Fix links to online gcc docs. 2008-06-26 05:41:25 +00:00
Ruslan Ermilov 8a87738ecf MFC: Removed the no-op -p; documented -P. 2008-06-25 22:13:24 +00:00
Ruslan Ermilov a091346cb3 MFC: src/compat is gone. 2008-06-25 20:37:04 +00:00
Peter Wemm 329016810c Move mergeinfo from file to containing directory. 2008-06-25 10:13:03 +00:00
Peter Wemm 4688f36b06 Move mergeinfo up from file to containing directory. 2008-06-25 10:10:30 +00:00
Peter Wemm 73d0a1d1a9 Move mergeinfo to containing directory. Fix some very strange records
that make no sense.
2008-06-25 10:06:00 +00:00
Peter Wemm 974028b96a Move mergeinfo from file up to directory; fix broken mergeinfo record. 2008-06-25 10:00:28 +00:00
Peter Wemm 68ee20e164 Move mergeinfo from file up to parent directory 2008-06-25 09:56:44 +00:00
Peter Wemm 9c7fa5d7f6 Move mergeinfo from ciss.c up to containing directory. 2008-06-25 09:51:59 +00:00
Max Laier c4a453f842 MFC: r179490
Sort IP addresses before hashing them for the signature.  Otherwise carp
  is sensitive to address configuration order.

  PR:			kern/121574
  Reported by:		Douglas K. Rand, Wouter de Jong
  Obtained from:	OpenBSD (rev 1.114 + fixes)
2008-06-24 23:24:38 +00:00
John Baldwin b3dec93377 MFC: Add KASSERT()'s to catch attempts to recurse on spin mutexes that
aren't marked recursable either via mtx_lock_spin() or thread_lock().
2008-06-24 22:07:51 +00:00
John Baldwin c1c7eb3671 MFC: Add 'compat_freebsd[456]' features corresponding to the kernel options
COMPAT_FREEBSD[456].
2008-06-24 21:06:02 +00:00
Garrett Wollman 846e97e7f7 MFC r173182: remove extraneous .Ef request 2008-06-24 21:00:48 +00:00
John Baldwin db4a765ee9 MFC: Add the kern.features sysctl tree and FEATURE() macro. Add a "pae"
feature for PAE kernels on i386.
2008-06-24 20:04:39 +00:00
John Baldwin 8869f2c22c MFC: Change the roundrobin implementation in the 4BSD scheduler to trigger a
userland preemption directly from hardclock() via sched_clock().
2008-06-24 19:36:33 +00:00
Marcel Moolenaar e510668c8d MFC rev. 173742-178057.
Requested by: mav (twice)
2008-06-23 21:45:04 +00:00
Alexander Motin d486068ecc MFC r179478:
Make m_megapullup() more intelligent:
 - to increase performance do not reallocate mbuf when possible,
 - to support up to 16K packets (was 2K max) use mbuf cluster of proper size.
This change depends on recent ng_nat and ip_fw_nat changes.
2008-06-23 14:38:33 +00:00
Alexander Motin 92e4231349 MFC r179480, r179924:
Increase LINK_TABLE_OUT_SIZE from 101 to 4001 like LINK_TABLE_IN_SIZE
to reduce performance degradation under heavy outgoing scan/flood.
Scalability is now much more important then several kilobytes of RAM.

Remove unneded TCP-specific expiration handeling. Before this connected
TCP sessions could never expire. Now connected TCP sessions will expire
after 24hours of inactivity.

Simplify HouseKeeping() to avoid several mul/div-s per packet. Taking into
account increased LINK_TABLE_OUT_SIZE, precision is still much more then
required.
2008-06-23 14:28:32 +00:00
Alexander Motin 33fa73411a MFC r179477:
Pass really available buffer size to libalias instead of MCLBYTES constant.
MCLBYTES constant were used with believe that m_megapullup() always moves
date into a fresh cluster that may become not so.
2008-06-23 14:19:48 +00:00
Alexander Motin f8575099fd MFC r179473:
PKT_ALIAS_FOUND_HEADER_FRAGMENT result is not an error, so pass that packet.
This fixes packet fragmentation handeling.

Pass really available buffer size to libalias instead of MCLBYTES constant.
MCLBYTES constant were used with believe that m_megapullup() always moves
date into a fresh cluster that sometimes may become not so.
2008-06-23 14:15:53 +00:00
Konstantin Belousov 294af374c6 MFC r179670:
Provide the mutual exclusion between the nfs export list modifications
and nfs requests processing.
2008-06-23 11:02:40 +00:00
Daniel Gerzo fc568fd0c9 MFC rev. 179903: link powerd(8) man page
PR:		docs/123111
2008-06-23 08:01:53 +00:00
Peter Wemm 7c8f26b2dd MFC: revs 175291,175384. Add .POSIX: to break timestamp-sensitive problems
between Makefile and Makefile.in that was disturbed by changes in
src/usr.bin/make/main.c rev 167330 (1.161).
2008-06-22 00:13:19 +00:00
Konstantin Belousov df3c028280 MFC r179634:
Fix the incorrect calculation of a block address within a single indirect
block.

PR:	108215
2008-06-21 08:51:21 +00:00
Ulf Lilleengen 2e40321b9b MFC r179897:
- Fix spelling errors.

Approved by:	kib (mentor)
PR:		kern/124788
Submitted by:	Hywel Mallett <Hywel -at- hmallett.co.uk>
2008-06-20 21:17:40 +00:00
Joerg Wunsch 0068b70ff6 MFC: more intelligent handling of /usr/ports subdirectories. 2008-06-20 08:48:33 +00:00
Alexander Kabaev cda54a195d MFC svn rev 179834.
Install extra include files that were forgotten in original GCC 4.2.x
import changes.

PR: 124647
Submitted by: Vlad GALU
2008-06-20 00:13:37 +00:00
Sean Farley 53a7239dda MFC revisions: 179654
Fixed the output grammar to properly speak non-terminal dits.

Updated Lyndon Nerenberg's radio callsign and E-mail address.

PR:		bin/7868
Submitted by:	Lyndon Nerenberg <[email protected]>
2008-06-19 23:25:00 +00:00
Joerg Wunsch b2024f27bc MFC: SMBus detection for the MCP65 chipset. 2008-06-19 07:35:08 +00:00
Pyun YongHyeon 1cea1277ac MFC: r179099
Connect atphy(4) to the build.
2008-06-19 04:23:26 +00:00
Pyun YongHyeon 8c515c8be1 MFC: r179098
Add Attansic/Atheros F1 PHY driver.
2008-06-19 03:56:39 +00:00
Pyun YongHyeon a68dc781ae MFC: r179647
Ethernet hardware address stored in DC_AL_PAR0/DC_AL_PAR1 register
is in little endian form. Likewise setting DC_AL_PAR0/DC_AL_PAR1
register expect the address to be in little endian form. For big
endian architectures the address should be swapped to get correct
one.
Change setting/getting ethernet hardware address to big endian
architecture frendly.

Reported by:    Robert Murillo ( billypilgrim782001 at yahoo dot com )
Tested by:      Robert Murillo ( billypilgrim782001 at yahoo dot com )
2008-06-19 01:36:31 +00:00
Doug Ambrisko e6c1f31e50 MFC: Allow negative values to be specified in the loader. 2008-06-18 21:39:00 +00:00
Konstantin Belousov f7e0783b00 MFC r179722:
In cd9660_readdir vop, always initialize the idp->uio_off member.

PR:	122925
2008-06-18 09:31:56 +00:00
Konstantin Belousov ce587c86eb MFC r179808:
Do not redo the vnode tear-down work already done by insmntque() when
vnode cannot be put on the vnode list for mount.
2008-06-18 09:25:26 +00:00
Remko Lodder fbab615f33 MFC rev r179848 shar.sh
Remove superfluous eofmarker.

  Requested by:   Jaakko Heinonen
  Discussed with: Jaakko, edwin

  Approved by:    imp (mentor, implicit)

Approved by:	imp (mentor, implicit)
2008-06-17 19:04:17 +00:00
Florent Thoumie d4d741324d MFC: remove 4.x support (r179835) 2008-06-17 10:47:24 +00:00
Peter Wemm 5ad3d20316 Fix a bad mergeinfo path 2008-06-17 06:34:48 +00:00
Jason Evans bb6ada98aa MFC allocator improvements and fixes:
* Implement more compact red-black trees, thus reducing memory usage
  by ~0.5-1%.

* Add a separate tree to track dirty-page-containing chunks, thus
  improving worst case allocation performance.

* Fix a deadlock in base_alloc() for the error (OOM) path.

* Catch integer overflow for huge allocations when using sbrk(2).

* Fix bit vector initialization for run headers.  This fix has no
  practical impact for correct programs.  Incorrect programs will
  potentially experience allocation failures rather than memory
  corruption, both of which are "undefined behavior".
2008-06-16 23:42:05 +00:00
Florent Thoumie 2523db8c89 MFC: style fixes (naked commands, r179819) 2008-06-16 09:17:59 +00:00
Florent Thoumie 47f24f6391 Synchronize pkg_install with HEAD (20080612)
r179760: fix recursive -K (add), '\n' not part of pkg origin (updating)
2008-06-16 09:02:59 +00:00
Remko Lodder e71855ae4f MFC rev 179460
Dont install .svn metadata with the sendmail install.

Submitted by:   marcel
Approved by:    imp (mentor, implicit)
2008-06-15 20:12:11 +00:00
Giorgos Keramidas 7330ed6d21 MFC -r 179355 on behalf of remko.
% r179355 | remko | 2008-05-27 12:45:18 +0300 (Tue, 27 May 2008) | 11 lines
%
% Limit the EOF marker length to a maximum of 79 characters. [1]
%
% Add $FreeBSD$ tag so that I can actually commit this.
%
% PR:             bin/118782
% Reported by:    Bjoern Koenig
% Patch by:       edwin, Jaakko Heinonen (not used patch)
% MFC after:      1 week
% Approved by:    imp (mentor, implicit)
2008-06-15 14:36:01 +00:00
Doug Ambrisko 29f21db7c8 MFC: All changes in current to 7.X.
-	Native 32bit compat modes for amd64
      -	Limit max commands to 128
      -	Add in compat mode for using mfi0 to talk to any card
2008-06-13 15:45:48 +00:00
Kai Wang 68830ef0a1 MFC r178697: Add support for Microsoft Notebook Optical
Mouse 3000 Model 1049.

PR:   usb/121052
2008-06-12 16:45:46 +00:00
Tim Kientzle 3627dd1fba MFC r177341: decrement matched patterns instead of incrementing.
In particular, this fixes --exit-fast behavior.
2008-06-12 06:17:15 +00:00
Marius Strobl 1df8356ce4 MFC: r176996, r177560
- Fix some style bugs and remove another banal comment missed in
  rev. 1.46.
- Move the KASSERT on gem_add_rxbuf() to the right spot and add an
  equivalent one to gem_disable_tx().
- Split the registers into two halves in preparation for SBus
  support. [1]

Obtained from:	NetBSD (loosely) [1]
2008-06-11 21:10:06 +00:00
Marius Strobl 24b78d1cf2 MFC: r178589
- Use the revamped code from the gem(4) PCI front-end, which
  doesn't require parts of the Expansion ROM to be copied around,
  for obtaining the MAC address on !OFW platforms.
- Don't unnecessarily cache bus space tag and handle nor RIDs
  in the softcs of the front-ends.
- Don't use function calls in initializers.
- Let the SBus front-end depend on sbus(4).
2008-06-11 20:52:34 +00:00
Marius Strobl 523dbbb064 MFC: r178470
o Disable HMEDEBUG by default.
o Add CTASSERTs ensuring that HME_NRXDESC and HME_NTXDESC are set to
  legal values.
o Use appropriate maxsize, nsegments and maxsegsize parameters when
  creating DMA tags and correct some comments related to them.
o The FreeBSD bus_dmamap_sync(9) supports ored together flags for quite
  some time now so collapse calls accordingly.
o Add missing BUS_DMASYNC_PREREAD when syncing the control DMA maps in
  hme_rint() and hme_start_locked().
o Keep state of the link state and use it to enable or disable the MAC
  in hme_mii_statchg() accordingly as well as to return early from
  hme_start_locked() in case the link is down.
o Introduce a sc_flags and use it to replace individual members like
  sc_pci.
o Add bus_barrier(9) calls to hme_mac_bitflip(), hme_mii_readreg(),
  hme_mii_writereg() and hme_stop() to ensure the respective bit
  has been written before we starting polling on it and for the right
  bits to change.
o Rather just returning in case hme_mac_bitflip() fails and leaving us
  in an undefined state report the problem and move on; chances are
  the requested configuration will become active shortly after.
o Don't call hme_start_locked() in hme_init_locked() unconditionally
  but only after calls to hme_init_locked() when it's appropriate, i.e.
  in hme_watchdog().
o Add a KASSERT which asserts nsegs is valid also to hme_load_txmbuf().
o In hme_load_txmbuf():
  - use a maximum of the newly introduced HME_NTXSEGS segments instead
    of the incorrect HME_NTXQ, which reflects the maximum TX queue
    length, for loading the mbufs and put the DMA segments back onto
    the stack instead of the softc as 16 should be ok there.
  - use the common errno(2) return values instead of homegrown ones,
  - given that hme_load_txmbuf() is allowed to fail resulting in a
    packet drop for quite some time now implement the functionality of
    hme_txcksum() by means of m_pullup(9), which de-obfuscates the code
    and allows to always retrieve the correct length of the IP header, [1]
  - also add a KASSERT which asserts nsegs is valid,
  - take advantage of m_collapse(9) instead of m_defrag(9) for
    performance reasons.
o Don't bother to check whether the interface is running or whether its
  queue is empty before calling hme_start_locked() in hme_tint(), the
  former will check these anyway.
o In hme_intr() call hme_rint() before hme_tint() as gem_tint() may
  take quite a while to return when it calls hme_start_locked().
o Get rid of sc_debug and just check if_flags for IFF_DEBUG directly.
o Add a shadow sc_ifflags so we don't reset the chip when unnecessary.
o Handle IFF_ALLMULTI correctly. [2]
o Use PCIR_BAR instead of a homegrown macro.
o Replace sc_enaddr[6] with sc_enaddr[ETHER_ADDR_LEN].
o Use the maximum of 256 TX descriptors for better performance as using
  all of them has no additional static cost rather than using just half
  of them.

Reported by:	rwatson [2]
Suggested by:	yongari [1]
Reviewed by:	yongari
2008-06-11 19:48:35 +00:00
Paul Saab f080b13b2c MFC: r179705
Add support for the P212, P410, P410i, P411, and P812 HP Smart Array
controllers.
2008-06-10 18:11:14 +00:00
Florent Thoumie 76123b2e23 Synchronize pkg_install with HEAD (20080530)
r179352,179366: don't regenerate packages
    r179433: add long options
2008-06-10 09:55:25 +00:00
Marcel Moolenaar b1af25ca90 MFC revisions 172857 through 179688:
o  Allow building a rescue version (not applicable yet)
o  Add the bootcode verb for installing bootcode.
o  Various manpage updates.
2008-06-10 03:19:33 +00:00
Marcel Moolenaar 62b6406c9b MFC rev 179628: Add gctl_delete_param() and gctl_has_param(). 2008-06-10 03:02:51 +00:00
Marcel Moolenaar 7b2ececd0e MFC r176724 through r179687 (geom_part): Module support 2008-06-09 19:25:04 +00:00
Marcel Moolenaar bc4199bbe7 MFC r177223 through r179684:
o  Redefine G_PART_SCHEME_DECLARE() from populating a private
   linker set to declaring a proper module.
o  Add support for PC-9800 partition tables.
o  Change the order from SI_ORDER_FIRST to SI_ORDER_ANY (within
   SI_SUB_DRIVERS) to avoid loading schemes before all the GEOM
   classes have been loaded and initialized.
o  Add the bootcode verb for installing boot code.
o  Implement the G_PART_DUMPCONF method for all 6 schemes.
2008-06-09 18:51:30 +00:00
Jung-uk Kim a99de040a6 MFC: r179497
Fix a crash when Arctic Ocean is selected.
2008-06-09 18:41:37 +00:00
Marcel Moolenaar 8a7fed1567 MFC rev 177681: Wither GEOMs while retasting. 2008-06-09 18:03:48 +00:00
Marcel Moolenaar 977ed07fd1 MFC rev 177509: Add g_retaste(). 2008-06-09 17:59:44 +00:00
Doug Rabson 5321b1ec6b MFC: r179510 - nlm_global_lock doesn't exist (yet)
Pointed out by: kib
2008-06-09 12:10:43 +00:00
Doug Rabson ade28c4129 MFC: r179489 - add a missing call to init_nsm(). 2008-06-09 10:54:55 +00:00
Doug Rabson ebed594fd5 MFC: r179488 - check for client reboot before executing the lock request 2008-06-09 10:51:43 +00:00
David Malone 5883913d8a MFC: Sync restore in RELENG_7 with -current.
Fix remaining nits from PR bin/39905.
Check for write failure while building temp files.
Correctly set file group when restore is run by a user other than root.
Use safer string handling.
Fixes the "getfile: lost data" panic when restoring older dumps.
Fix spurious "Header with wrong dumpdate" message.
2008-06-08 21:00:25 +00:00
Philip Paeps 27ccd9b0b6 MFC r179474:
Try to detect a Synaptics touchpad before IntelliMouse.  Some touchpads will
  pretend to be IntelliMouse (which have a few more features than generic mice)
  causing the IntelliMouse probe to work and the Synaptics code never to be
  called.

  This should not break "real" IntelliMouse because the Synaptics detection code
  is fairly specific.

PR:		kern/120833
Submitted by:	Eygene Ryabinkin <rea-fbsd -at- codelabs.ru>
2008-06-08 09:06:45 +00:00
Adrian Chadd e503cf53c0 USB is disabled in RELENG_7 PAE; don't try to build USB
related devices.

PR:     kern/123619
2008-06-07 09:35:41 +00:00
Konstantin Belousov 3875ad7f2a Revert the r179632, it was committed to the wrong branch. 2008-06-07 05:47:24 +00:00
Konstantin Belousov c28ec40473 Fix the incorrect calculation of a block address within a single indirect
block.

PR:	108215
Submitted by:	Yuichiro Goto, y7goto gmail com
MFC after:	2 weeks
2008-06-07 05:42:22 +00:00
Konstantin Belousov 764d1b60fa Put the svn:mergeinfo on the directory instead of the mount.8. 2008-06-06 12:28:33 +00:00
Konstantin Belousov 2167a193da MFC rev. 1.198 of sys/kern/sys_pipe.c,
rev. 1.30 of sys/sys/pipe.h
AKA r179243.

Another problem caused by the knlist_cleardel() potentially dropping
PIPE_MTX().

Since the pipe_present is cleared before (potentially) sleeping, the
second thread may enter the pipeclose() for the reciprocal pipe end.
The test at the end of the pipeclose() for the pipe_present == 0 would
succeed, allowing the second thread to free the pipe memory. First
threads then accesses the freed memory after being woken up.

Properly track the closing state of the pipe in the pipe_present.
Introduce the intermediate state that marks the pipe as mostly
dismantled but might be sleeping waiting for the knote list to be
cleared. Free the pipe pair memory only when both ends pass that point.
2008-06-06 12:17:28 +00:00
Konstantin Belousov ee57050a29 MFC rev. 1.197 AKA r179242:
The pipe_peer that has the knote for write shall be present. Ignore the
pipe_present value for EVFILT_WRITE in filt_pipedetach().
2008-06-06 12:04:31 +00:00
Konstantin Belousov 65f2d86e01 MFC rev. 179514 (committed by ru).
Fix markup after the rev. 179513.
2008-06-06 11:25:03 +00:00
Konstantin Belousov cdcfd59814 MFC rev. 179513.
Add note about a reason to use mount(8) instead of mount_somefs.
2008-06-06 11:19:54 +00:00
Stanislav Sedov ae40b8015c MFC rev. 1.51
- Add quirk for the TrendNet TU-S9 adapter, which uses new version of PL2303.

Approved by:	kib
2008-06-06 10:02:43 +00:00
Stanislav Sedov fdce07c063 MFC rev. 1.28.
- Fix a typo in comment.

Approved by:	kib
2008-06-06 09:59:34 +00:00
Stanislav Sedov d422038c85 MFC rev. 1.22.
- Don't return 0xffff if PHY id isn't equal 0.
2008-06-06 09:35:08 +00:00
Doug Rabson e1153c3e07 MFC: r179358,179434 - make libc's fcntl symbol weak and extend the limited
forward ABI compatibility for fcntl to the thread libraries.
2008-06-06 09:09:37 +00:00
Doug Rabson 867c58a57c MFC: r179425 - cope better when client NLM port changes 2008-06-06 08:54:19 +00:00
Brooks Davis 96598bf9fd MFC r179024: Change a use of u_int32_t to uint32_t.
PR:		bin/93172
2008-06-05 22:35:07 +00:00
Philip Paeps 6389101ed1 MFC: Recode the colemak keymap to ISO-8859. 2008-06-05 10:50:22 +00:00
Christian S.J. Peron dc7b04a3c2 MFC revision 1.19 with some tweaks to the entry point naming. 2008-06-04 16:13:12 +00:00
Christian S.J. Peron 0e3fd7ced9 Back out previous commit. These entry point names are not
valid in this branch.
2008-06-04 15:58:52 +00:00
Christian S.J. Peron b69441a27a MFC cvs revision 1.19
Plug a memory leak
2008-06-04 15:38:28 +00:00
Philip Paeps dc26a2c761 MFC r179476:
Use INSERT_OBJECT_INT_LINK_INDEX macro instead of TAILQ_INSERT_TAIL when
  filling the table of ALTQ queues retrieved from the kernel.

  It is possible for the kernel to return the queues not by pa.altq.qid order.
  When this happens, pf_snmp would only partially fill its table.

PR:		bin/120974
Submitted by:	Mykola Dzham <i -at- levsha.org.ua>
2008-06-04 08:55:49 +00:00
Rong-En Fan 000435f73b MFC ncurses 5.6-20080503 build glue
rev 174999, 176190, 178869
2008-06-04 07:43:58 +00:00
Rong-En Fan b40b0ef82c MFC ncurses 5.6-20080503
rev 174993, 176187, 178866
2008-06-04 07:42:51 +00:00
Rong-En Fan 14e540e728 - Associate myself with ncurses 2008-06-04 07:37:39 +00:00
Ruslan Ermilov 7aa8fc509a MFC: Introduce FreeBSD 8.0 to mdoc(7). 2008-06-04 06:05:12 +00:00
Florent Thoumie ad44ea7968 MFC: distfile target, pkg registration optimization
r178032,179377,179520: add distfile target
    r178103,178753-178754: optimize package registration
2008-06-03 14:58:51 +00:00
Ruslan Ermilov 08520d4c2b MFC: Make it possible to disable sources of entropy harvesting. 2008-06-03 11:39:39 +00:00
Philip Paeps 60692cdc8b MFC: Add support for the Colemak keyboard layout from: http://colemak.com/.
Submitted by:	Geert Hendrickx <ghen -at- netbsd.org>
2008-06-03 10:35:23 +00:00
Doug Barton 773a7e821d MFC the change from version 1.189, add a space between a
close quote and the closing bracket of a test.
2008-06-03 06:01:30 +00:00
Doug Barton 78ccba5e18 Add proper mime-types for files that they are relevant for.
This is useful for things like *.pdf files that svn needs
to know about, and will probably be useful down the road
for other things.
2008-06-02 20:52:28 +00:00
Marcel Moolenaar 6f6e36b750 Merge rev 179173:
We can call ia64_flush_dirty() when the corresponding process is
locked or not. As such, use PROC_LOCKED() to determine which case
it is and lock the process when not.

This is a manual merge. No merge history is created.
2008-06-01 18:04:29 +00:00
Peter Wemm 9155628fe8 Disown ncurses in 7-stable, as an exporter test. 2008-05-31 22:25:43 +00:00
Marius Strobl 45fa63e153 MFC: sys/conf/files.sparc64 1.95; sys/conf/files.sun4v 1.14;
sys/sparc64/isa/isa.c 1.21; sys/sparc64/pci/ofw_pci.h 1.12;
     sys/sparc64/pci/ofw_pci_if.m 1.10; sys/sparc64/pci/psycho.c 1.76;
     sys/sun4v/sun4v/hv_pci.c 1.5

Remove the MD isa_irq_pending() and the underlying PCI-specific
infrastructure. Its only consumer ever was sio(4) and thus was
unused on sparc64 since removing the last traces of sio(4) in
sparc64 configuration files in favor for uart(4) over three
years ago. If similar functionality is required again it should
be brought back as an MD intr_pending() which works for all
busses by using for example interrupt controller hooks.
2008-05-30 22:24:34 +00:00
Marius Strobl dd12d6e911 MFC: sym_defs.h 1.12; sym_fw.h 1.6; sym_fw1.h 1.9; sym_fw2.h 1.10;
sym_hipd.c 1.70

- Const'ify firmware and lookup-tables.
- Obsolete redundant inst_name and unit members of struct sym_hcb.
- Fix three more NULL vs. 0 confusions.
- Use device_set_softc(9) to tell the bus layer that this driver
  allocates a instance of struct sym_hcb itself.
2008-05-30 22:00:02 +00:00
Marius Strobl a9d632c5db MFC: 1.69
- Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9)
  in order to get rid of bus space handle and tag in struct sym_hcb.
- Remove unused members related to bus addresses in struct sym_hcb.
- sym(4) takes care of allocating an instance of struct sym_hcb
  itself so don't let newbus allocate it as an unused softc also.
- Add basic MPSAFE locking. This includes changing the sym(4) CCBs
  to be allocated up-front instead of on demand as needed. Besides
  making these allocations more likely to succeed, this also solves
  the problem of calling bus_dmamap_create(9) with the SIM mutex
  held.
2008-05-30 20:02:06 +00:00
Marius Strobl 747656d400 MFC: 1.68
- Use NULL instead of 0 for pointers.
- Remove superfluous returns in functions returning void.
- In sym_alloc_lcb_tags() return directly instead of jumping
  to a label which just returns.
- Fix some spelling in comments.
- Remove trailing whitespace.
2008-05-30 19:58:23 +00:00
Marius Strobl 91368d9343 MFC: 1.20
- Make failure to route a ISA interrupt non fatal. Apparently the
  Blade 1500/SX1500 boards have inherited the firmware bug of the
  AX1105 mainboards to not include an interrupt map entry for the
  parallel port controller (for the AX1105 the heuristic code for
  E450s probably erroneously kicks in and guesses an interrupt).
- Take advantage of bus_generic_setup_intr(9).
- Fix some whitespace bugs.
2008-05-30 19:31:44 +00:00
Marius Strobl 8f0f73c4fa MFC: bus_common.h 1.8; fhc.c 1.19; intr_machdep.c 1.34 (partial);
intr_machdep.h 1.19 (partial); mp_machdep.c 1.40; psycho.c 1.75;
     sbus.c 1.47; upa.c 1.10

o Rename ic_eoi to ic_clear to emphasize the functions it points
  don't send and EOI which works like on amd64/i386 and blocks all
  interrupts on the relevant interrupt controller.
o Replace the post_filter and post_inthread hooks registered when
  creating the interrupt events with just ic_clear as on sparc64 we
  don't need to do any disable->EOI->enable dance to unblock all but
  the relevant interrupt while running the filter or handler; just
  not clearing the interrupt already has the same effect.
o Merge from amd64/i386:
  - Split the intr_table_lock into an sx lock used for most things,
    and a spin lock to protect intrcnt_index.
  - Add support for binding interrupts to CPUs and initial shuffling
    interrupts arround in a round-robin fashion.
2008-05-30 19:30:06 +00:00
Konstantin Belousov 0cb6393b54 MFC rev. 1.182
Change the fix in the rev. 1.178 to use nfsrv_lockedpair_nd().
2008-05-30 12:27:19 +00:00
Konstantin Belousov 5bec6d0289 MFC rev. 1.181:
Initialize vfslocked prior to calling nfsm_srvmtofh where it was forgotten.
2008-05-30 12:25:29 +00:00
Konstantin Belousov ac11596b48 MFC rev. 1.159:
When vget() fails (because the vnode has been reclaimed), there is no
sense to loop trying to vget() the vnode again.
2008-05-30 11:14:35 +00:00
Konstantin Belousov 572354b762 MFC rev. 1.280:
Rev. 1.274 put the ttyrel() call before the destroy_dev() in the
ttyfree(), freeing the tty. Since destroy_dev() may call d_purge()
cdevsw method, that is the ttypurge() for the tty, the code ends up
accessing freed tty structure.

Put the ttyrel() after destroy_dev() in the ttyfree. To prevent the
panic the rev. 1.274 provided fix for, check the TS_GONE in sysctl
handler and refuse to provide information on such tty.
2008-05-30 11:13:30 +00:00
Konstantin Belousov 8e2e320245 MFC rev. 1.279:
The dev_refthread() in the tty_gettp() may fail, because Giant is taken
in the giant_trick routines after the dev_refthread increments the
si_threadcount. Remove assert, do not perform dev_relthread() for failed
dev_refthread(), and handle failure in the tty_gettp() callers (cdevsw
tty methods).
2008-05-30 11:12:26 +00:00
Konstantin Belousov 7c7ab46152 MFC rev. 1.214:
Assert that si_threadcount > 0 before decrementing it. This helps catching
the improper use of the dev_refthread/dev_relthread.
2008-05-30 11:10:01 +00:00
Maksim Yevmenkin 7ae369fb85 MFC:
Bluetooth SIG is being difficult and keep moving specification
documents away from being public accessible. Replace link to
the Bluetooth specification document with the document name.

Pointed out by:	SoftLover < slserg at uic dot tula dot ru >
2008-05-30 00:37:41 +00:00
Konstantin Belousov 0e9a063e72 MFC rev. 1.212:
Add the devctl notifications for the cdev create/destroy events.
2008-05-28 15:41:16 +00:00
Ariff Abdullah 980cb70d5c MFC (revision 1.109, requested by kib):
Release pcm mutex before calling snd_clone_unref(), which in turns might
calling destroy_dev() with sleepable malloc(9). The entire opetation
is being serialized through pcm cv from top down, so dropping mutex is
rather safe.

Reported by:	delphij
2008-05-28 14:45:05 +00:00
Rui Paulo d4ce52d1ed MFC r1.3:
Update to reflect reality:
    * iasl(8) supports ACPI 3.0b.
    * Add new options.
2008-05-28 09:19:56 +00:00
Marcel Moolenaar 0d1f3fce87 MFC 1.61: Fix RID calculation for Timedia cards. 2008-05-28 03:45:16 +00:00
Xin LI b0577a72e8 Increment the version namespace for 8.0-current after MFC'ing a
FBSD_1.1 symbol back to RELENG_7 (MFC of rev. 1.4).

Requested by:	deischen
2008-05-27 21:47:13 +00:00
Xin LI a42061812f MFC: Add memrchr(3).
Obtained from:	OpenBSD
2008-05-27 20:04:27 +00:00
Antoine Brodin 773f501a72 MFC to RELENG_7:
Move "1000baseT" from IFM_SUBTYPE_ETHERNET_DESCRIPTIONS to
  IFM_SUBTYPE_ETHERNET_ALIASES: there is already "1000baseTX" in
  IFM_SUBTYPE_ETHERNET_DESCRIPTIONS.  This doesn't change ifconfig
  behaviour.

  PR:             45793 (maybe)
  Approved by:    rwatson (mentor)
  MFC after:      1 month
2008-05-27 18:34:20 +00:00
Antoine Brodin 0f2c30c51a MFC to RELENG_7:
Record the dependency of the iscsi initiator on cam.

  PR:             116745
  Submitted by:   OISHI Masakuni
  Approved by:    rwatson (mentor)
  MFC after:      1 month
2008-05-27 18:27:51 +00:00
Gabor Kovesdan 7598c46ea1 MFC:
hu_HU.ISO8859-2.src	r1.9
  hu_HU.UTF-8.src	r1.4

- The names of the months and the days are in lowercase according to the
  Hungarian spelling, change them accordingly
2008-05-26 19:27:32 +00:00
Konstantin Belousov 99f694e4c5 MFC rev. 1.278:
Use the t_state for the TS_GONE test.
2008-05-26 11:03:30 +00:00
Rui Paulo 5f66e00ae9 MFC r1.208:
devctl_process_running(): Check for devsoftc.inuse == 1 instead of
  devsoftc.async_proc != NULL because the latter might not be true
  sometimes.
  This way /etc/rc.suspend gets executed.

  Reviwed by:     njl
  Submitted by:   Mitsuru IWASAKI <iwasaki at jp.FreeBSD.org>
  Tested also by: Andreas Wetzel <mickey242 at gmx.net>
2008-05-25 14:37:33 +00:00
Attilio Rao b12bf76957 MFC revision 1.46:
lockinit() can't accept LK_EXCLUSIVE as a flag.
2008-05-25 14:16:28 +00:00
Alan Cox 8e7328ed82 MFC revision 1.293
Add a read/write sysctl for reconfiguring the maximum number of physical
  pages that can be wired.

PR: 114654
2008-05-25 07:00:07 +00:00
Bjoern A. Zeeb 9029206aab MFC: if_bgereg.h rev. 1.79
if_bge.c rev. 1.205, 1.209, 1.210

  Summary:
  In some situations we were not clearing pending link state attentions.
  Because of this we were not getting further interrupts for link state
  changes, thus never went into iface UP state and thus could not transmit.

  The only way out of this was an incoming packet generating an rx interrupt
  and making us call into bge_link_upd.

  What we do now is force an interrupt at the end of bge_ifmedia_upd_locked
  so we will call bge_link_upd, clear the link state attention and get
  further interrupts.

  While the initial version was not expected to work with all chips
  the later update in rev. 1.210 is.

PR:                             kern/111804
Tested by:                      phk, scottl (initial version)
Thanks for your help to:        davidch, Broadcom
2008-05-24 10:23:35 +00:00
Bjoern A. Zeeb 6c764097aa MFC: rev. 1.287 ata-all.c
devclass_get_maxunit() returns n+1 with n starting at 0.
  So if we have channel 0..3  devclass_get_maxunit is 4.

  It's never been a problem as devclass_get_device() has
  caught any possibly bad input.
2008-05-24 10:15:20 +00:00
Bjoern A. Zeeb 4823b6026e MFC: rev. 1.6
Add ';' missed with the SYSINIT changes.
  Not noticed by tb as TCP_SIGNATURE is not in LINT.

  (this MFC ahead of the MFC of the other SYSINIT ';' chnages)
2008-05-24 10:13:07 +00:00
Konstantin Belousov fbcceb5846 MFC rev. 1.120:
Kqueue_scan() may sleep when encountered the influx knotes. On the other
hand, it may cause other threads to sleep since kqueue_scan() may mark
some knotes as infux. This could lead to the deadlock.

Before kqueue_scan() sleeps, wakeup the threads that are waiting for the
influx knotes produced by this thread.
2008-05-24 03:36:19 +00:00
Konstantin Belousov 884b9f1af0 MFC rev. 1.119:
The kqueue_close() encountering the KN_INFLUX knotes on the kq being
closed is the legitimate situation. For instance, filedescriptor with
registered events may be closed in parallel with closing the kqueue.
Properly handle the case instead of asserting that this cannot happen.
2008-05-24 03:35:13 +00:00
Xin LI 6ae36a2ee6 MFC revision 1.52
date: 2008/05/10 01:27:23;  author: delphij;  state: Exp;  lines: +6 -0

Add support for LSI 1078DE (ServeRAID-AR10is SAS/SATA Controller)
2008-05-24 00:42:53 +00:00
John Baldwin 06ff39ac24 MFC: Teach truss about 32-bit FreeBSD and Linux binaries on amd64. 2008-05-23 20:04:55 +00:00
Ulf Lilleengen 022a54b148 MFC revision 1.6
- Recognize the 'volume' parameter when creating a plex.
2008-05-23 15:39:27 +00:00
Ruslan Ermilov a622817fb6 MFC: Add an ability to run man(1) on local files plus add limited
support for bzip2-compressed manpages.

PR:		bin/120730
2008-05-22 07:30:32 +00:00
Jack F Vogel 24c28db7c4 Primary a delta to pick up the missing UNLOCK in the watchdog
code, this can cause a panic due to a recusion on the TX Lock.
Also sync up other changes in HEAD, all trivial, added PCI ID
and #ifdef's to make the driver compile on 6.3.
2008-05-21 21:34:05 +00:00
Remko Lodder a6c3f6f0e8 MFC rev 1.163 umass.c, 1.354 usbdevs
Add support for the Nikon D300 camera

  PR:             usb/118741
  Submitted by:   Yuri <yuri at tsoft dot com>
  Approved by:    imp (mentor, implicit)
  MFC after:      3 days

Approved by:	imp (mentor, implicit)
Facilitated by:	Snow B.V.
2008-05-21 14:22:03 +00:00
Robert Watson cd3fc72302 Merge uipc_sem.c:1.31 from HEAD to RELENG_7:
Attempt to improve convergence of POSIX semaphore code with style(9).
2008-05-21 13:36:48 +00:00
Tim Kientzle 918cdd1d8b MFC: bsdtar can now use archive_entry_strmode(), since the latter has
been in 7-STABLE since Feb 2008.
2008-05-21 04:18:49 +00:00
Tim Kientzle e9709bd00d MFC: Numerous test updates. 2008-05-21 04:14:39 +00:00
Tim Kientzle 11caa33007 MFC: New manpage links and turn on the compress write support. 2008-05-21 04:14:10 +00:00
Tim Kientzle 7f7373abc3 MFC: updates to the public API plus an attempt to straighten out versioning. 2008-05-21 04:13:43 +00:00
Tim Kientzle a16cf04057 MFC: some documentation corrections and updates. 2008-05-21 04:12:57 +00:00
Tim Kientzle a61833cfec MFC: A number of interrelated changes that I'm too tired to tease
apart into separate MFCs.  These have all been in -CURRENT for
quite some time.
2008-05-21 04:12:29 +00:00
Tim Kientzle 09193177fb MFC: write support for 'compress' format. 2008-05-21 04:11:11 +00:00
Tim Kientzle 743f58c510 MFC: Some changes to 'ar' format support from Kai Wang. 2008-05-21 04:07:35 +00:00
Mike Makonnen 31c4f224ff MFC:
Specify the full path to the md5(1) binary so the script will
	still work even if it's not in the shell's path.
	PR: conf/122215
2008-05-20 15:27:24 +00:00
David Malone aabeef2ace MFC:
Dummynet has a limit of 100 slots queue size (or 1MB, if you give
the limit in bytes) hard coded into both the kernel and userland.
Make both these limits a sysctl, so it is easy to change the limit.
2008-05-20 11:32:03 +00:00
Robert Watson 83abfbe8e0 Merge mac.c:1.13, mac_exec.c:1.3, mac_get.c:1.6, mac_set.c:1.4 from HEAD
to RELENG_7:

  Add __FBSDID() tags.
2008-05-20 11:25:00 +00:00
David Malone fd9a355c81 MFC:
If we are walking the IPv6 header chain and we hit an IPPROTO_NONE
header, then don't try to pullup anything, because there is no next
header if we hit IPPROTO_NONE. Set ulp to a non-NULL value so the
search for an upper layer header terinates.
2008-05-20 11:17:51 +00:00
Robert Watson 23b88709a0 Merge busspace.9:1.5 from HEAD to RELENG_7:
Minor spelling/grammer fixes.
2008-05-20 10:52:52 +00:00
Robert Watson 7d0de4ecfc Merge kern_priv.c:1.5 from HEAD to RELENG_7:
Add __FBSDID() tag.

  Pointed out by: antoine
2008-05-20 10:52:19 +00:00
Philip Paeps fc4c611153 MFC: moused.c rev 1.84
moused.8 rev 1.62

    Improve the virtual scrolling mechanism to make middle clicking less
    difficult.  Add a -L option (yet another option, indeed!) which changes
    the speed of scrolling and change -U to only affect the scroll threshold.

    This should make middle-clicking a much more pleasant experience.

Submitted by:	Aragon Gouveia <aragon -at- phat.za.net>
2008-05-20 10:48:26 +00:00
David Malone 42bb178203 Sync with current - add the ability to traceroute with no-next-header
packets.
2008-05-20 10:46:50 +00:00
Konstantin Belousov 469c8a4996 MFC
rev. 1.126 of libexec/rtld-elf/rtld.c
rev. 1.5 of libexec/rtld-elf/rtld_lock.c
rev. 1.3 of libexec/rtld-elf/rtld_lock.h

Fix the problem with the C++ exception handling for the multithreaded
programs.

From the PR description:
The gcc runtime's _Unwind_Find_FDE function, invoked during exception
handling's stack unwinding, is not safe to execute from within multiple
threads. FreeBSD' s dl_iterate_phdr() however permits multiple threads
to pass through it though. The result is surprisingly reliable infinite
looping of one or more threads if they just happen to be unwinding at
the same time.

Introduce the new lock that is write locked around the dl_iterate_pdr,
thus providing required exclusion for the stack unwinders.

PR:	threads/123062
Submitted by:	Andy Newman <an at atrn org>
Reviewed by:	kan
2008-05-20 09:38:44 +00:00
Marius Strobl a69f8c29e2 MFC: intr_machdep.h 1.18; smp.h 1.23; intr_machdep.c 1.32; mp_machdep.c 1.39
- Add support for IPI_PREEMPT.
- Add my copyright to mp_machdep.c for having implemented support for
  USIII and up and some fixes.
2008-05-19 20:09:04 +00:00
Marius Strobl e18b8f1ad7 MFC: apb.c 1.15; ofw_pci_if.m 1.9; ofw_pcib.c 1.9; ofw_pcib_subr.c 1.9;
ofw_pcib_subr.h 1.4; ofw_pcibus.c 1.18; psycho.c 1.74; psychovar.h 1.18

On sparc64 machines with multiple host-PCI-bridges these bridges
have separate configuration spaces so by definition they implement
different PCI domains. Thus change psycho(4) to use PCI domains
instead of reenumerating all PCI busses so they have globally unique
bus numbers and drop support for reenumerating busses in the OFW PCI
code.
2008-05-19 19:32:00 +00:00
John Baldwin ae3316ae7b MFC: Set sc->dev and add a missing newline. 2008-05-19 18:24:33 +00:00
John Baldwin 208ae223e9 MFC: Always bump tcpstat.tcps_badrst if we get a RST for a connection in
the syncache that has an invalid SEQ.
2008-05-19 18:23:09 +00:00
John Baldwin 7d4d7d7e27 MFC: Only output details about the current working directory of a process
if the vnode pointer is not NULL.
2008-05-19 18:21:52 +00:00
John Baldwin 3f69fd89be MFC: Set D_TRACKCLOSE to avoid a race in devfs that could lead to orphaned
bpf devices never getting fully closed.
2008-05-19 18:19:48 +00:00
Maksim Yevmenkin 3c84bccb4a MFC:
Make -t <tty> optional in server mode. If not specified use stdin/stdout.
Document this. Do not require channel number in server mode. If not
specified - bind to ''wildcard'' channel zero. Real channel number will
be obtained automatically and registered with local sdpd(8). While I'm
here fix serial port service registration.

Submitted by:	luigi
Tested by:	Helge Oldach <freebsd-bluetooth at oldach dot net>
2008-05-19 16:46:42 +00:00
Randall Stewart 39df61e5a9 - MFC in the changes to allow SCTP to not need to
have both INET and INET6. INET only will work now.
2008-05-19 12:34:44 +00:00
Konstantin Belousov 1066c76bab MFC
rev. 1.15 of lib/libc/gen/readdir.c
rev. 1.11 of lib/libc/gen/telldir.c
rev. 1.3  of lib/libc/gen/telldir.h

Do not read away the target directory entry when encountering deleted
files after a seekdir().

The seekdir shall set the position for the next readdir operation.
When the _readdir_unlocked() encounters deleted entry, dd_loc is
already advanced. Continuing the loop leads to premature read of
the target entry.

Submitted by:	Marc Balmer <mbalmer at openbsd org>
Obtained from:	OpenBSD
2008-05-19 11:43:36 +00:00
Florent Thoumie 5986006443 MFC: Don't require a configuration file. Ntpd will be perfectly happy if there's
none or if the file doesn't exist (there's no ntp.conf in the base install).

  src/etc/rc.d/ntpd: rev 1.13 -> 1.14
2008-05-19 09:21:24 +00:00
Greg Lehey 5b4712f814 MFC revision 1.1455: Typo 2008-05-19 04:42:40 +00:00
Greg Lehey 5e9081167e MFC revisions 1.2 and 1.3:
Fix a compiler warning by using a printf format matching the variable
type.

Ensure that the -s flag truncates the accounting data.
2008-05-19 03:50:25 +00:00
Brooks Davis bdae8e45b1 getopt.c is public domain. Add a comment to that effect.
Remove confusing README.

PR:		bin/98911
Submitted by:	Jason McIntyre <jmc at kerhand dot co dot uk>
Obtained from:	OpenBSD
2008-05-19 02:49:02 +00:00
Sean Farley 8278da7ae5 MFC:
Spelling and capitalization fixes.

    src/sys/net/ethernet.h: rev 1.34 -> 1.35
2008-05-19 02:30:56 +00:00
Konstantin Belousov 456da8d0d4 MFC rev. 1.724:
Only return 1 from sync_vnode() in cases where the vnode is still at the
head of the sync list. This prevents sched_sync() from re-queueing a
vnode which may have been freed already.

Approved by:	jeff
2008-05-18 05:05:33 +00:00
Rui Paulo bc02ccd3b2 MFC r1.8:
style(9): remove FreeBSD CVS ID from the initial license comment.
2008-05-17 17:02:55 +00:00
Daichi GOTO 67fc987f07 MFC: rev. 1.105
Fixed panic issue caused by cache incorrect free process
by "umount -f"

Submitted by:	Masanori OZAWA <[email protected]>
2008-05-17 10:56:11 +00:00
Alexander Motin 334bdac276 MFC rev. 1.158
Use separate UMA zone for data items allocation. It is a partial
rev. 1.149 rework.
It allows to save several percents of CPU time on SMP by using UMA's
internal per-CPU allocation limits instead of own global variable
each time updated with atomics.
Also it restores NG_WAITOK flag processing.

PR:		kern/123741
2008-05-17 08:43:50 +00:00
Remko Lodder 802a935c76 MFC rev 1.32 and rev 1.33 termios.4
The first of thirteen patches by Ed that resolves a documentation
  issue in termios.4, ttydefaults.h does not exist in /usr/include
  but in /usr/include/sys.

  MFC after:      3 days
  Submitted by:   Ed Schouten (ed at 80386 dot nl)
2008-05-17 01:29:44 +00:00
Attilio Rao 022f61a307 MFC rev. 1.34:
LK_DRAIN'ed lockmgr needs to be released, so fix a wrong behaviour.
2008-05-16 19:56:24 +00:00
Attilio Rao 7111f3b1d1 MFC ver. 1.20:
Currently, smb_co_init() uses the same lock name for the mutex interlock
and the lockmgr. Use different names in order to avoid WITNESS conflicts.
2008-05-16 19:44:50 +00:00
cvs2svn 63a8deb08b This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2008-05-16 15:34:08 +00:00
Kris Kennaway 143ec1117d MFC:
Replace callout_init(..., 1) with callout_init(..., CALLOUT_MPSAFE) for
  better grep-compliance and to standardize with the rest of the kernel.
2008-05-16 10:11:15 +00:00
Kris Kennaway 925de94d63 MFC 1.330, 1.331:
fdhold can return NULL, so add the one remaining missing check for this
condition.
2008-05-16 10:08:18 +00:00
Paul Saab 0d991b00f9 MFC: rev 1.88
Remove a check that didn't allow > 12 byte CDB's to be issued to
ciss.  This should allow volumes > 2TB to work.
2008-05-16 08:30:25 +00:00
Sean Farley 4e03fb34fd MFC:
Add four utility functions related to struct grp processing modeled in-part
after similar calls related to struct pwd in libutil/pw_util.c:
  - gr_equal()
    Perform a deep comparison of two struct grp's.  It does a thorough, yet
    unoptimized comparison of all the members regardless of order.

  - gr_make()
    Create a string (see group(5)) from a struct grp.

  - gr_dup()
    Duplicate a struct grp.  Returns a value that is a single contiguous
    block of memory.

  - gr_scan()
    Create a struct grp from a string (as produced by gr_make()).

    src/lib/libutil/Makefile: rev 1.66 -> 1.67
    src/lib/libutil/gr_util.c: rev 0 -> 1.1
    src/lib/libutil/libutil.h: rev 1.46 -> 1.47
2008-05-16 02:07:57 +00:00
Sean Farley 093bf02a56 MFC:
Define the size_t type since readpassphrase(3) requires it in its
definition and sys/types.h is not listed within the synopsis of the man
page.

    src/include/readpassphrase.h: rev 1.2 -> 1.3
2008-05-16 01:06:01 +00:00
Marius Strobl 44d03c9f42 MFC: 1.43
- Remove the BUS_HANDLE_MIN checking in the __BUS_DEBUG_ACCESS macro;
  for UPA it should have fulfilled its purpose by now and Fireplane-
  and JBus-based machines are way to messy in organization to implement
  something equivalent.
- Fix a bunch of style(9) bugs.
2008-05-15 20:21:30 +00:00
Marius Strobl 96187008d4 Forced commit to denote that revision 1.198.2.5 actually was
an MFC of 1.206.
2008-05-15 20:12:17 +00:00
Brooks Davis bfe5d2cb10 MFC: Add very limited support for the isc-dhclient. It will almostly certaintly
only work if there's just one interface doing dhcp. This version implements
the same logic as the version in the PR, but uses pgrep to be less verbose.

PR:		conf/95905
2008-05-15 01:53:46 +00:00
Marius Strobl e9fd3adb6c MFC: bus_common.h 1.9; iommuvar.h 1.17; psycho.c 1.77; sbus.c 1.48;
counter.c 1.7; iommu.c 1.47

- Use the name returned by device_get_nameunit(9) for the name of the
  counter-timer timecounter so the associated SYSCTL nodes don't clash on
  machines having multiple U2P and U2S bridges as well as establishing a
  clear mapping between these bridges and their timecounter device.
- Don't bother setting up a "nice" name for the IOMMU, just use the name
  returned by device_get_nameunit(9), too.
- Fix some minor style(9) bugs.
- Use __FBSDID in counter.c
2008-05-14 21:23:14 +00:00
Marius Strobl ef307017cb MFC: 1.208
- Use more appropriate maxsize, nsegments and maxsegsize parameters
  when creating the parent bus DMA tag. While at it correct the style
  and a nearby comment.
- Take advantage of m_collapse(9) for performance reasons.
2008-05-14 21:07:25 +00:00
Rui Paulo bb134c8848 MFC r1.7:
Change the check for cpu_high to actually match CPUID 0x06.

  Submitted by:	Arthur Hartwig <arthur.hartwig at nokia.com>
  PR:		122878
2008-05-14 10:04:17 +00:00
Garance A Drosehn c6ce2c0c9d MFC *: Add the '-u name' option to the env command, which will completely
unset the given variable name (removing it from the environment, instead
of just setting it to a null value).

[* = 1.10->1.11 env.1, 1.20 env.c]

PR:		bin/65649
2008-05-13 21:46:50 +00:00
Xin LI 134de3b032 MFC: Instead of rolling our own jail number allocation procedure, use
alloc_unr() to do it.

Submitted by:   Ed Schouten <ed 80386 nl>
PR:             kern/122270
2008-05-12 18:00:55 +00:00
Xin LI 2c6352c8ef MFC:
usbdevs revisions 1.331 (mav)+1.347 (mav)+1.352 (kris moore)
  uipaq.c revisions 1.8+1.10 (mav), 1.9 (stas), 1.11 (kris moore)

For several HTC Smartphone/PocketPC support.
2008-05-12 16:42:01 +00:00
Mike Makonnen 08f9afc52e MFC:
o Change the warning dialog for the 'W' command in both the label
	  and partition editors to reflect the fact that this is a stand-alone
	  application, not sysinstall(8).
	o Change an instance of sade(8) refering to itself as sysinstall(8) in
	  a confirmation dialog.
2008-05-12 07:37:40 +00:00
Mike Makonnen e89835b01a MFC:
Fix improper use of checkyesno routine.
	Noticed by: oliver
2008-05-12 07:29:03 +00:00
Julian Elischer 754e4eedc4 fix stupid typo.. not an MFC because code is differnt from current
but the logic is the same
2008-05-12 06:47:49 +00:00
Doug Rabson 74939bcb26 MFC kern_lockf.c revision 1.64:
When blocking on an F_FLOCK style lock request which is upgrading a
shared lock to exclusive, drop the shared lock before deadlock
detection.
2008-05-11 08:53:55 +00:00
Weongyo Jeong 757e067f01 MFC: rev. 1.13
don't set sniffer mode to ON when the driver is running with the
monitor mode.  This solves a problem that sometimes mangled frames
are passed.

Submitted by:	Werner Backes <werner_at_bit-1.de>
Tested by:	Werner Backes <werner_at_bit-1.de>
PR:		kern/121608
Approved by:	thompsa (mentor)
2008-05-11 05:53:19 +00:00
Weongyo Jeong 3a26a5a3e5 MFC: rev. 1.12
Fix incorrect dependencies of zyd(4).

Approved by:	thompsa (mentor)
2008-05-11 05:49:02 +00:00
Tim Kientzle 7e2ef17887 MFC: FreeBSD does have fstat() and libarchive should use it (it
reduces some races).  But I need to fix a typo in the one use
of fstat() first.  <sigh>
2008-05-10 23:27:22 +00:00
Robert Watson ff64213dc7 Merge ip_fw.h:1.113 from HEAD to RELENG_7:
Fix a comment typo.
2008-05-10 18:45:30 +00:00
Robert Watson 4607e2f969 Merge Makefile:1.348 from HEAD to RELENG_7:
Mention -U and -ai arguments to mergemaster in a comment for the
  general mergemaster line.

  Suggested by:   Ben Laurie
2008-05-10 18:43:57 +00:00
Robert Watson 1377b2e499 Merge MAkefile:1.2, ddb.8:1.5, ddb.c:1.4, ddb.h:1.2, ddb_capture.c:1.1
from HEAD to RELENG_7:

  Add "ddb capture print" and "ddb capture status" commands do ddb(8),
  alowing the DDB output capture buffer to be easily extracted from
  user space.  Both of these commands include -M/-N arguments, allowing
  them to be used with kernel crash dumps (or /dev/mem).

  This makes it easier to use DDB scripting and output capture with
  minidumps or full dumps rather than with text dumps, allowing DDB
  output (scripted or otherwise) to be easily extracted from a crash
  dump.

  Discussed with: brooks, jhb
2008-05-10 18:43:11 +00:00
Robert Watson 06b5038d37 Merge ddb.8:1.4, ddb.c:1.3 from HEAD to RELENG_7:
- Normalize usage(), add "ddb pathname" syntax.
  - Revise the manpage.
2008-05-10 18:39:53 +00:00
Robert Watson 443414dbbf Merge sctp_generic_recvmsg.2:1.4, sctp_peeloff.2:1.4 from HEAD to
RELENG_7:

  Correct minor typos in SCTP man pages.
2008-05-10 17:31:53 +00:00
Robert Watson 330eb782af Merge audit.h:1.17 from HEAD to RELENG_7:
Fix include guard spelling.

  Submitted by:   diego
2008-05-10 17:30:57 +00:00
Robert Watson 9e3f340c0b Merge uipc_syscalls.c:1.271 from HEAD to RELENG_7:
When writing trailers in sendfile(2), don't call kern_writev()
  while holding the socket buffer lock.  These leads to an
  immediate panic due to recursing the socket buffer lock.  This
  bug was introduced in uipc_syscalls.c:1.240, but masked by
  another bug until that was fixed in uipc_syscalls.c:1.269.

  Note that the current fix isn't perfect, but better than
  panicking: normally we guarantee that simultaneous invocations
  of a system call to write on a stream socket won't be
  interlaced, which is ensured by use of the socket buffer sleep
  lock.  This is guaranteed for the sendfile headers, but not
  trailers.  In practice, this is likely not a problem, but
  should be fixed.

  Pointy hat to:  andre (1.240), cperciva (1.269)
2008-05-10 17:21:20 +00:00
Tim Kientzle 9d707e5277 MFC: Eliminate a bunch of unused fields from the read structure.
Most are write-specific values that are leftovers from when read and
write used a shared structure.
2008-05-10 07:05:14 +00:00
Tim Kientzle dd06832768 MFC: The read side doesn't use the 'nulls' convenience value, so get
rid of it.  We also don't need to set the block size here, since
we don't use it.
2008-05-10 07:03:18 +00:00
Tim Kientzle 975f28bca1 MFC: Set the archive format code and name in the generic portion
of the archive structure, not the write-specific portion.
(This is a bungle from back when the generic and write-specific portions
were first separated and the write-specific part accidentally ended
up with copies of some of the generic fields.)  In particular,
archive_format() and archive_format_name() now work correctly
on write handles.
2008-05-10 06:57:04 +00:00
Tim Kientzle f862d02c9d MFC: Stop using ARCHIVE_DEFAULT_BYTES_PER_BLOCK to set the default
block size.  The default setting here is arbitrary and shouldn't be
published.  Someday, we should be smarter about the default here.
2008-05-10 06:49:13 +00:00
Tim Kientzle 57b639c4bf MFC: Add the useful archive_string_sprintf() function for internal use. 2008-05-10 06:46:09 +00:00
Tim Kientzle f7843d3ae0 MFC 1.25: Portability: on platforms that don't have timegm, don't have
tm_gmtoff and can't reset the timezone to force mktime to use UTC,
just give up and use unadorned mktime().
2008-05-10 06:45:23 +00:00
Tim Kientzle 0cc4a7caa5 MFC 1.2: Minor portability improvement. Not every platform
has S_IXUSR, S_IXGRP, S_IXOTH defines, but the values never change,
so just hardcode the constants.
2008-05-10 06:42:59 +00:00
Christian Brueffer ad959ab20c MFC: rev. 1.2
Bring this manpage more in line with other wlan driver manpages.
2008-05-10 06:37:10 +00:00
Tim Kientzle 42af20258b MFC: Include space for the trailing NUL byte. 2008-05-10 06:12:06 +00:00
Robert Watson 8a3e15ccb9 Merge tcp_input.c:1.374 from HEAD to RELENG_7:
Add further TCP inpcb locking assertions to some TCP input code paths.
2008-05-09 20:40:47 +00:00
Robert Watson 1e3ca4f92d Merge if_loop.c:1.115,1.116 from HEAD to RELENG_7:
Coerce if_loop.c in the general direction of style(9):

  - Use ANSI function declarations
  - Remove use of 'register' keyword
  - Prefer style(9) return parens, white space
  - Trim trailing whitespace at ends of lines.
2008-05-09 20:39:48 +00:00
John Baldwin 37071a0e7a MFC: Fix a few edge cases with error handling in cpufreq(4)'s CPUFREQ_GET()
method.
2008-05-09 19:03:55 +00:00
John Baldwin c80cc4444d MFC: Enable use of 'tid' for remote targets and use gdb_thread_select()
for 'tid' and 'proc' so they provide UI feedback like the 'thread'
command.
2008-05-09 18:59:50 +00:00
John Baldwin 7aaf8af313 MFC: Rework how kgdb manages kernel and vmcore files to be a bit more
gdb-ish.  Specifically, you can now use the 'file' and 'core' commands.
Also, the kernel module stuff now works for remote targets.
2008-05-09 18:41:36 +00:00
John Baldwin fd1d2f0229 MFC: Add 'fbsdcoreops_suppress_target' to support kgdb having its own
coredump target and adjust core dump target's long name and documentation.
2008-05-09 18:20:35 +00:00
Weongyo Jeong b6e6045d79 MFC: rev. 1.413
Connect malo.4 to the build.

Approved by:	thompsa (mentor)
2008-05-09 02:23:11 +00:00
Weongyo Jeong 0a9e1b30ce MFC: rev. 1.560
Add malo driver to the build

Approved by:	thompsa (mentor)
2008-05-09 02:20:39 +00:00
Andrew Thompson 31b72233d0 MFC
Hook geom_linux_lvm up to the build.
2008-05-08 17:25:23 +00:00
Andrew Thompson df44909068 MFC geom_linux_lvm(4), a geom class to map Linux LVM logical volumes. 2008-05-08 17:24:06 +00:00
Marius Strobl 7abe428d0e MFC: 1.15
Don't built the unused counter-timer abstraction.
2008-05-07 21:19:34 +00:00
Marius Strobl 12595007ec Remove a header which is unused for sun4v. 2008-05-07 21:18:19 +00:00
Marius Strobl d687c35eee Don't build unused SBus front-ends for sun4v, don't build EBus front-ends
which are also likely to be irrelevant for sun4v (there's no SBus on sun4v
and only some EBus devices). While at it fix some style bugs according to
style.Makefile(5) where appropriate.
2008-05-07 21:16:55 +00:00
Marius Strobl 3dc169eab1 Adjust the padding of struct pcpu to src/sys/sys/pcpu.h rev. 1.22.2.1. 2008-05-07 21:14:13 +00:00
Daichi GOTO 4c3c462d3a MFC
Fixed inaccessible issue especially including devfs on unionfs case.
fixed also: kern/117829

PR:		kern/117829
Submitted by:	Masanori OZAWA ([email protected])
2008-05-07 08:07:48 +00:00
Daichi GOTO 1e30190ab9 MFC:
- Fixed multi thread access issue reported by Alexander V. Chernikov
  ([email protected])
- fixed: kern/109950

PR:		kern/109950
Submitted by:	Alexander V. Chernikov ([email protected])
Reviewed by:	Masanori OZAWA ([email protected])
2008-05-07 05:11:52 +00:00
Daichi GOTO 05f91f59d8 MFC: rev. 1.154
Fixed rename panic issue.

Submitted by:	Masanori OZAWA ([email protected])
2008-05-07 04:59:27 +00:00
Daichi GOTO d9c85879c8 MFC: rev. 1.101
Add system hang-up process when VOP_READDIR of unionfs_nodeget()
returns not end of the file status on debug mode (DIAGNOSTIC defined)
kernel.

Submitted by:	Masanori OZAWA ([email protected])
2008-05-07 04:47:24 +00:00
Pyun YongHyeon 93cf34098b MFC if_bfe.c rev 1.45 to RELENG_7.
Don't panic even if bus_dmamap_load(9) was failed. Just return
  ENOBUFS so callers can reuse previous mbuf.
2008-05-07 01:32:29 +00:00
Hiroki Sato 2445cd57a8 MFC(rev.1.25):
Add AUTHORS section[*] and fix HISTORY section.

Requested by:		Dave Yost (original author)[*]
History checked by:	The CSRG Archives
2008-05-06 18:07:17 +00:00
Mike Makonnen c047f10ea3 MFC:
Add a dummynet_enable knob to go with firewall_enable. If this knob
	is enabled dummynet(4) is added to the list of required modules.

	Discussed on: #freebsd-bugbusters (rwatson, trhodes)
	PR: conf/79196
2008-05-06 10:50:51 +00:00
Mike Makonnen aee257f633 MFC rev. 1.328:
date: 2008/03/06 14:01:10;  author: mtm;  state: Exp;  lines: +1 -1
	The rarpd(8) daemon must be instructed to start on all interfaces or a
	specific one. Instruct it to listen on all interfaces so that enabling
	it in rc.conf(5) works "out of the box."

	PR:     conf/121406
	Submited by: trasz
2008-05-06 09:45:40 +00:00
David Schultz 35dd1b6e6a MFC scandir.c,v 1.9
scandir(3) previously used st_size to obtain an initial estimate
  of the array length needed to store all the directory entries.
  Although BSD has historically guaranteed that st_size is the size
  of the directory file, POSIX does not, and more to the point, some
  recent filesystems such as ZFS use st_size to mean something else.

  The fix is to not stat the directory at all, set the initial
  array size to 32 entries, and realloc it in powers of 2 if that
  proves insufficient.

  PR:	113668
2008-05-06 05:45:58 +00:00
Andre Oppermann aa4df69aa4 MFC of tcp_output.c rev. 1.147+1.148 and tcp.h rev. 1.42:
Use #defines for TCP options padding after EOL to be consistent.
  Remove now unnecessary comment.
2008-05-05 20:59:35 +00:00
Andre Oppermann 12b89571ea MFC rev. 1.149: Remove TCP options ordering assumptions in tcp_addoptions(). 2008-05-05 20:46:39 +00:00
John Baldwin 273212a1eb MFC: Include libc_private.h for the declaration of __isthreaded. 2008-05-05 19:16:52 +00:00
John Baldwin ca420e037d MFC: Remove the 'add_kld_command' arg from load_kld(). 2008-05-05 19:15:38 +00:00
Attilio Rao 84675a69c8 Bump __FreeBSD_version in order to signal lockmgr(9) now needs sys/lock.h
in order to work on RELENG_7 too.
2008-05-05 16:44:09 +00:00
Attilio Rao 779b7052ed Add a new, necessary include for lockmgr. 2008-05-05 16:12:18 +00:00
Attilio Rao ef97551642 MFC:
Use LOCK_FILE and LOCK_LINE with lockmgr(), add the wrapper protecting for
the public namespace for userland inclusion.
Now lockmgr depends by sys/lock.h header on RELENG_7 too.
2008-05-05 15:58:44 +00:00
Attilio Rao c02b812464 MFC revision 1.712:
As LK_EXCLUPGRADE is used in conjuction with LK_NOWAIT, LK_UPGRADE becames
equivalent with this and so operate the switch.
2008-05-05 15:47:23 +00:00
Jung-uk Kim 8ecb51f31e MFC: 1.194
Check packet directions more properly instead of just checking received
interface is null.
2008-05-05 15:07:07 +00:00
Brooks Davis e0195acaac MFC: Emit a warning when the network_interfaces variable is not set to AUTO. 2008-05-04 16:15:04 +00:00
Ruslan Ermilov 71e4a98b18 MFC: 1.60: Don't forget to clean the "machine" symlink on amd64.
1.61: _setjmp.o was missing a dependency on "machine".
2008-05-04 11:58:25 +00:00
Weongyo Jeong f30263760b MFC: Add support for Marvell Libertas 88W8335 based PCI network
adapters.

Reviewed by:	sam, many wireless people
Approved by:	thompsa (mentor)
2008-05-04 06:43:34 +00:00
Jack F Vogel 5bdd0f2596 Add igb into the module build. 2008-05-03 16:37:55 +00:00
Jack F Vogel 58c61fae17 Left out the inclusion of 82575 when building a static kernel
with JUST em.
2008-05-03 16:20:36 +00:00
Jack F Vogel cf740a02bf MFC of the em/igb split drivers from HEAD. 2008-05-02 23:52:01 +00:00
Jack F Vogel c7d4f9016a MFC of the em/igb drivers from HEAD 2008-05-02 23:49:44 +00:00
Jack F Vogel fa34cc7804 MFC of the em/igb from HEAD 2008-05-02 23:46:58 +00:00
Jack F Vogel 89a7cabf5e MFC of the new em/igb from HEAD 2008-05-02 23:43:23 +00:00
Jack F Vogel d2123e68fb MFC of the em/igb split 2008-05-02 23:41:54 +00:00
Hidetoshi Shimokawa aff3377aca MFC: add -f option and other small fixes
firewire.8 rev 1.22
firewire.c rev 1.24
2008-05-02 06:17:16 +00:00
John Baldwin 3da50936fd MFC: Fix the ofs_fix handling for trapframes for i386 on remote targets. 2008-05-01 18:08:42 +00:00
Sean Farley 5660cf4c52 MFC:
Have the man page catch up with the namespace pollution cleanup that
occurred between 2001-2003.  Thanks to bde for the history lesson[1]
concerning sys/types.h and the many system calls that at one time
(pre-2001) were required by POSIX to include it.

1. http://lists.freebsd.org/pipermail/freebsd-arch/2008-April/008126.html

    src/lib/libc/sys/mkdir.2: rev 1.25 -> 1.26
2008-04-30 23:35:46 +00:00
Marius Strobl 64a86e6dd3 MFC: 1.5
- Include <machine/utrap.h> so this header doesn't have an MD
  dependency.
- Make prototypes style(9) compliant.
2008-04-30 11:26:55 +00:00
Coleman Kane 2a1a3137bd MFC:
revision 1.219

Replace the non-MPSAFE timeout(9) API in ffs_softdep.c with the MPSAFE
callout_* API (e.g. callout_init_mtx(9)). This was one of the numerous
items on the http://wiki.freebsd.org/SMPTODO list.
2008-04-29 21:48:55 +00:00
Brooks Davis c7d9bb8503 MFC rev 1.8
When sending packets directly to the DHCP server, use a socket and send
directly rather than bogusly sending it out as a link layer broadcast
(which fails to be received on some networks).

PR:		bin/96018
MFC after:	2 weeks
2008-04-29 21:29:09 +00:00
Brooks Davis c3947b7fb8 MFC rev 1.278:
Delay the global registration of the struct ifnet in if_alloc() until after
we're certain the allocation will entierly succeed.  This fixes a leak in a
fairly unlikely case.

Reported by:	vijay singh <vijjus at rocketmail dot com>
2008-04-29 20:43:48 +00:00
Brooks Davis fe97a33fe6 MFC per ppp profile variable documentation (revs 1.336 and 1.337)
PR:		conf/121452, conf/122127
2008-04-29 20:17:46 +00:00
John Baldwin ab270b4fd7 MFC: Fix a resource leak in the recent fixes for file descriptors >
SHRT_MAX.
2008-04-29 17:44:00 +00:00
Randall Stewart c9988de0f1 - Have SCTP use the new pru_flush functionality 2008-04-29 09:26:32 +00:00
Randall Stewart 109c55cbd6 Logging changes from MFC 2008-04-29 09:21:52 +00:00
Randall Stewart c3875c8782 Protection against errant sender sending a stream
seq number out of order with no missing TSN's (a
  cisco box has this problem which will make a ssn
  be held forever).
2008-04-29 09:20:25 +00:00
Randall Stewart d7e9c4f15d Use the pru_flush infrastructure to avoid a panic 2008-04-29 09:18:30 +00:00
Randall Stewart fd6d2138fc Add pru_flush routine so a transport can
flush itself during Shutdown
2008-04-29 09:17:39 +00:00
Randall Stewart ad4c332843 1) adds some additional logging
2) changes to use a inqueue_bytes calculated value in max_len calc's.
2008-04-29 09:16:19 +00:00
John Baldwin 2a548a1421 MFC: Add support for detach packets. 2008-04-28 20:47:38 +00:00
Sean Farley 5be7c03aa5 MFC:
Capitalize "Eve".  This is the correct form and now matches
calendar.usholiday.

    src/usr.bin/calendar/calendars/calendar.christian: rev 1.10 -> 1.11
2008-04-27 17:39:33 +00:00
Robert Watson c3d412df48 Merge in_pcb.c:1.203, in6_pcb.c:1.88 from HEAD to RELENG_7:
In in_pcbnotifyall() and in6_pcbnotify(), use LIST_FOREACH_SAFE() and
  eliminate unnecessary local variable caching of the list head pointer,
  making the code a bit easier to read.
2008-04-27 14:39:32 +00:00
Robert Watson 52cd3bb595 Remove fifo_vnops.c:1.143 from HEAD to RELENG_7:
Remove Giant acquisition around soreceive() and sosend() in fifofs.
  The bug that caused us to reintroduce it is believed to be fixed,
  and Kris says he no longer sees problems with fifofs in highly
  parallel builds.

  Pointed out by: kris
2008-04-27 14:24:37 +00:00
Robert Watson c317eeab20 Merge procstat.1:1.3 from HEAD to RELENG_7:
Provide more detailed information about each procstat(1) display mode,
  including a key to fields in each mode and flag abbreviations.

Note: mention of POSIX shared memory in the man page has been removed
in the MFC, as explicit kernel support for pshm hasn't been merged to
RELENG_7 yet.
2008-04-27 14:17:32 +00:00
Robert Watson 1f00ab5427 Merge procstat.1:1.2 from HEAD to RELENG_7:
It is a bug that procstat(8) works only on live kernels and not
  crashdumps; document in case anyone wants to work on fixing this.
2008-04-27 14:13:37 +00:00
Marius Strobl a77b69e62b MFC: 1.61
- vx_stop() requires the driver lock to be held.
- Add some missing newlines to messages printed by vx_getlink().
2008-04-27 11:36:42 +00:00
Marcel Moolenaar e0439172f8 Put the arguments of kse_switchin in local variables, rather than
dereferencing uap throughout. On ia64 uap points into the trapframe
and the call to set_mcontext() in this function will change the
trapframe. Consequently, when we dereference uap afterwards we can
best qualify the behaviour as undefined. By putting the arguments
in local variables we also improve code-generation, because the
compiler is not forced to reload after every function call.

Caught by: Christian Kandeler <[email protected]>
2008-04-26 19:22:41 +00:00
Antoine Brodin 25abd3066c MFC to RELENG_7:
Don't allocate the constant array "props" on the stack in wctype.

  PR:             74743
  Submitted by:   knut st. osmundsen
  Approved by:    rwatson (mentor)
  MFC after:      1 month
2008-04-26 17:38:07 +00:00
Antoine Brodin b027d5af45 MFC to RELENG_7:
Initialize variable "now" before using it (it is used by the LEFTEARTH
  macro)

  PR:             121418
  Submitted by:   Atsuo Ohki
  Approved by:    rwatson (mentor)
  MFC after:      1 month
2008-04-26 17:36:33 +00:00
Pawel Jakub Dawidek 3a26d86862 MFC: sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c:1.28
Fix mmap(2) on ZFS after some changes in VM subsystem.

Submitted by:	alc
Reported by:	kris (originally) and many others
Reminded by:	kris
2008-04-26 13:03:23 +00:00
Marcel Moolenaar 23a55af1b1 MFC: Correct an off-by-1 for GPART.
Revision  Changes    Path
 1.5       +8 -2      src/lib/libdisk/open_ia64_disk.c
2008-04-26 03:56:30 +00:00
Marcel Moolenaar 7ec5d53422 MFC: Better implement I-cache invalidation.
Revision  Changes    Path
 1.25      +4 -0      src/sys/ia64/ia64/elf_machdep.c
 1.235     +18 -5     src/sys/ia64/ia64/machdep.c
 1.198     +37 -84    src/sys/ia64/ia64/pmap.c
 1.28      +1 -0      src/sys/ia64/include/md_var.h
2008-04-26 03:50:24 +00:00
cvs2svn c55967dd76 This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2008-04-26 02:15:41 +00:00
Sam Leffler 571ecb8af2 MFC: bug fix to preserve high 16 bits of if flags so drivers don't lose
IFF_NEEDSGIANT
2008-04-25 18:32:22 +00:00
Sam Leffler fa5dec7efb MFC: hostapd 0.5.10 + radius acl support 2008-04-25 18:02:11 +00:00
Sam Leffler 066ac39a63 MFC: enable syslog support and add -s option to the man page 2008-04-25 17:39:55 +00:00
Sam Leffler 64c8159c47 MFC: wpa_supplicant 0.5.10 + syslog support 2008-04-25 17:35:33 +00:00
Sam Leffler 78affacce2 MFC 1.19: fix locking botch 2008-04-25 17:18:45 +00:00
Sam Leffler 2b7e6c4efc MFC 1.3: spell pidfile correctly so multiple wpa_supplicant processes can be run 2008-04-25 17:05:42 +00:00
Sam Leffler 655638aacd MFC: split out tty create part of ucom_attach into ucom_attach_tty so
derived drivers can use it
2008-04-25 17:04:45 +00:00
Sam Leffler 22931cd38b MFC 1.95: add __noinline 2008-04-25 16:59:30 +00:00
Sam Leffler 815b9bd900 MFC 1.41: IFM_IEEE80211_IBSSMASTER hasn't been used in many years; replace it
with IFM_IEEE80211_WDS
2008-04-25 16:52:09 +00:00
Sam Leffler b5b9292e73 MFC: enable dynamic addition of "show all" commands 2008-04-25 16:50:48 +00:00
Sam Leffler 0862142157 MFC: Fix handling of create operation together with setting other parameters. 2008-04-25 16:48:08 +00:00
Sam Leffler ee4329d881 MFC 1.223: add M_PROTO[678]; sort mbuf flags and extend values to 32 bits;
write M_COPYFLAGS in terms of M_PROTOFLAGS
2008-04-25 16:46:20 +00:00
Sam Leffler 054a04148d MFC 1.23: Defer state change on disassociate to avoid unnecessarily
dropping the lease.
2008-04-25 16:43:19 +00:00
Sam Leffler 5c803d4e9c MFC 1.22: correct syslog mask so LOG_DEBUG msgs are not lost 2008-04-25 16:42:03 +00:00
Sam Leffler 482da7f91e MFC 1.1286: add include path required to find ah_osdep.h 2008-04-25 16:41:13 +00:00
Sam Leffler 0592f60345 MFC 1.344: add some CDMA modems 2008-04-25 16:40:18 +00:00
Sam Leffler 1f941cb94a MFC: add reject+blackhole keywords 2008-04-25 16:38:14 +00:00
Sam Leffler b866e8b652 MFC 1.3: add hints to specify how NPE ports are mapped to MAC+PHY 2008-04-25 16:35:51 +00:00
Sam Leffler 17d722a8de MFC 1.2: map device 5; the optional USB controller on Gateworks 2348 boards
shows up here instead of the minipci slot at J4
2008-04-25 16:35:07 +00:00
Sam Leffler fa6a0428ff MFC 1.12: document device hints including new ones to control rx fifo trigger 2008-04-25 16:34:14 +00:00
Sam Leffler d2fe9ff395 MFC: add device hints to control the rx FIFO interrupt level on 16550A parts 2008-04-25 16:33:23 +00:00
Sam Leffler 94fb362595 MFC 1.179: (finally) add the hal status to the diagnostic generated after
a failed ath_hal_reset call
2008-04-25 16:22:31 +00:00
Sam Leffler 95c6bc03b6 MFC 1.9: Fix adhoc mode to scan all available channels... 2008-04-25 16:21:05 +00:00
Marius Strobl d6f37ad0a4 MFC: 1.561
Hook up ZFS to the sparc64 build.
2008-04-25 11:03:35 +00:00
Marius Strobl 7c9a5a246a MFC: Makefile 1.11; atomic.S 1.1
Add atomic operations for ZFS/sparc64.
2008-04-25 11:02:01 +00:00
Marius Strobl a35f3b7f69 MFC: 1.4
- Fix the path encoded in the multiple inclusion protection.
- GCC uses 32-byte function alignment for UltraSPARC CPUs.
- Remove code duplication.
2008-04-25 10:58:54 +00:00
Oleg Bulyzhin f1875cc9cc MFC: 1.111
Calculate p.fs.lookup_step correctly. This should prevent zeroing of
w_q_lookup table (used in RED algorithm for (1 - w_q)^t computation).
2008-04-25 10:35:53 +00:00
Oleg Bulyzhin a70f5539fb MFC:
src/sys/netinet/ip_dummynet.h	1.41
src/sys/netinet/ip_dummynet.c	1.111-1.114
src/sys/netinet/ip_fw_pfil.c	1.26
src/sys/net/if_bridge.c		1.107
src/sys/net/if_ethersubr.c	1.240
src/sbin/ipfw/ipfw.8		1.206

- style(9) cleanup.
- dummynet_io() declaration has changed.
- Alter packet flow inside dummynet and introduce 'fast' mode of dummynet
  operation: allow certain packets to bypass dummynet scheduler. Benefits are:
  -- lower latency: if packet flow does not exceed pipe bandwidth, packets
     will not be (up to tick) delayed (due to dummynet's scheduler granularity).
  -- lower overhead: if packet avoids dummynet scheduler it shouldn't reenter
     ip stack later. Such packets can be fastforwarded.
  -- recursion (which can lead to kernel stack exhaution) eliminated. This fix
     long existed panic, which can be triggered this way:
	kldload dummynet
	sysctl net.inet.ip.fw.one_pass=0
	ipfw pipe 1 config bw 0
	for i in `jot 30`; do ipfw add 1 pipe 1 icmp from any to any; done
	ping -c 1 localhost
- New sysctl nodes:
  net.inet.ip.dummynet.io_fast -	enables 'fast' dummynet io
  net.inet.ip.dummynet.io_pkt -		packets passed to dummynet
  net.inet.ip.dummynet.io_pkt_fast -	packets avoided dummynet scheduler
  net.inet.ip.dummynet.io_pkt_drop -	packets dropped by dummynet
- Workaround p->numbytes overflow, which can result in infinite loop inside
  dummynet module (prerequisite is using queues with "fat" pipe).

PR:	kern/113548 kern/121955
2008-04-25 10:29:26 +00:00
Sam Leffler df3ef6886d MFC 1.146: explain that you must set a default transmit key for WEP 2008-04-25 05:33:16 +00:00
Sam Leffler d07a00e623 MFC 1.14: enable wired driver support 2008-04-25 05:31:43 +00:00
Sam Leffler 0ae346e75b MFC: move include paths to Makefile, use the AFTER trick to simplify
adding new items, prepare stat blocks for additional data, other stuff
2008-04-25 05:30:11 +00:00
Sam Leffler 5fb1a59bd7 MFC 1.11: sync channel defs w/ _ieee80211.h so cpp doesn't complain
about redefinitions
2008-04-25 05:28:47 +00:00
Marcel Moolenaar fb2327afa5 MFC fix for PR ia64/118024
o  Rename cpu_thread_setup() to cpu_thread_alloc() to better communicate that
   it relates to (is called by) thread_alloc()
o  Add cpu_thread_free() which is called from thread_free() to counter-act
   cpu_thread_alloc().

i386:	Have cpu_thread_free() call cpu_thread_clean() to preserve behaviour.
ia64:	Have cpu_thread_free() call mtx_destroy() for the mutex initialized
	in cpu_thread_alloc().

files:	sys/amd64/amd64/vm_machdep.c:1.256
	sys/arm/arm/vm_machdep.c:1.35
	sys/i386/i386/vm_machdep.c1.284
	sys/ia64/ia64/machdep.c:1.227
	sys/ia64/ia64/vm_machdep.c:1.95
	sys/kern/kern_thread.c:1.260
	sys/powerpc/powerpc/vm_machdep.c:1.117
	sys/sparc64/sparc64/vm_machdep.c:1.77
	sys/sun4v/sun4v/vm_machdep.c:1.8
	sys/sys/proc.h:1.495
2008-04-24 22:42:01 +00:00
Robert Watson b8c4972237 Merged textdump.4:1.4, procstat.1:1.4 from HEAD to RELENG_7:
Use ddb(4), not DDB(4) for man page cross-references.

  Reported by:    novel
2008-04-24 06:32:16 +00:00
Sean Farley 6969bb85a8 Fix spelling mistake made in MFC of rev 1.61. 2008-04-24 01:30:52 +00:00
Marius Strobl e99019a78b - Spelling fix for interupt -> interrupt
- Take advantage of bus_dmamap_load_mbuf_sg(9).
- Take advantage of m_collapse(9).
- Sync with other NIC drivers and prepend a TX mbuf if the first attempt
  to load it fails with an error other than EFBIG and stop trying instead
  of freeing it and keeping on trying to enqueue more mbufs. Also ensure
  the driver queue isn't empty before trying to enqueue mbufs in order to
  reduce locking operations.
- In xl_ifmedia_upd() add a missing XL_UNLOCK(). [1]
- Const'ify the xl_devs array.
- Remove an outdated comment.

PR:		113406 [1]
2008-04-23 21:28:29 +00:00
Marius Strobl ae49499026 MFC: bus.h 1.42; bus_machdep.c 1.47
- Const'ify the bus_stream_asi and bus_type_asi arrays.
- Replace hard-coded functions names missed in bus_machdep.c rev. 1.44
  with __func__.
- Break some long lines.
2008-04-23 21:25:16 +00:00
John Baldwin 3390e058cd MFC: Add PCI ID's for ICH8 USB controllers. 2008-04-23 18:54:51 +00:00
John Baldwin d6f3e1d63d MFC: Add 'zfs' as an alias for the FreeBSD ZFS UUID. 2008-04-23 18:48:36 +00:00
Florent Thoumie 6ddc0666dd MFC: Fix pkg_info when specifying a remote package.
src/usr.sbin/pkg_install/info/perform.c: rev 1.54 -> 1.55
  src/usr.sbin/pkg_install/info/main.c: rev 1.51 -> 1.52
2008-04-23 10:42:00 +00:00
Mark Linimon e7e2ef5f99 MFC of new 'arm' category. 2008-04-23 04:01:53 +00:00
Jung-uk Kim eca7f93cc9 Fix a mis-merge in the previous commit. 2008-04-22 15:53:07 +00:00
Jung-uk Kim 07c9686d1c MFC: 1.192, 1.193
Remove M_SKIP_FIREWALL abuse and add more appropriate check.
2008-04-22 15:45:53 +00:00
Rui Paulo c9f22b1f1e MFC r1.32, r1.33:
Add support for Asus EeePC backlight control.
   style(9) fix.

   Submitted by:   Akira Funahashi <funa at funa.org>
2008-04-22 12:44:39 +00:00
Bjoern A. Zeeb abdbed2bbe MFC: rev. 1.335 ip_input.c, rev. 1.10 ip_ipsec.c, rev. 1.3 ip_ipsec.h
Take the route mtu into account, if available, when sending an
  ICMP unreach, frag needed.  Up to now we only looked at the
  interface MTU. Make sure to only use the minimum of the two.

  In case IPSEC is compiled in, loop the mtu through ip_ipsec_mtu()
  to avoid any further conditional maths.

  Without this, PMTU was broken in those cases when there was a
  route with a lower MTU than the MTU of the outgoing interface.

PR:		kern/122338
Tested by:	Mark Cammidge  mark peralex.com
2008-04-22 12:02:55 +00:00
Bjoern A. Zeeb 665d0463a8 MFC: rev. 1.162
Back out rev. 1.161 (1.157.2.2) and
  switch back to optimized TCP options ordering.

  A lot of testing has shown that the problem people were seeing was due
  to invalid padding after the end of option list option, which was corrected
  in tcp_output.c rev. 1.146 (1.141.2.4).

Thanks to:              anders@, s3raphi, Matt Reimer
Thanks to:              Doug Hardie and Randy Rose, John Mayer, Susan Guzzardi
Special thanks to:      dwhite@ and BitGravity
Discussed with:         silby
2008-04-22 11:57:04 +00:00
John Birrell 6dd0901484 Add FreeBSD IDs to files which originate in FreeBSD. 2008-04-22 09:21:29 +00:00
Ruslan Ermilov f1ee688654 MFC: 1.16: Use calloc() instead of zeroing memory ourselves.
1.17: Better strfmon(3) conversion specifiers sanity checking.
     1.18: Fix memory leaks.
2008-04-22 08:05:38 +00:00
Pyun YongHyeon e00ca50992 MFC ip1000phy.c 1.3, ip1000phyreg.h 1.2 and miidevs 1.52 to RELENG_7.
Add support for IC Plus IP1001 PHY.
2008-04-22 06:35:37 +00:00
Pyun YongHyeon 9e9876e9d2 MFC rgephy.c rev 1.19 to RELENG_7.
Add detection of isolation state.

  PR:	kern/76710
2008-04-22 06:25:11 +00:00
Pyun YongHyeon 8eab1782f9 MFC nfe.4 rev 1.10 to RELENG_7.
Mention support for nForce MCP73.
2008-04-22 06:19:29 +00:00
Pyun YongHyeon d569076754 MFC if_re.c 1.114 to RELENG_7.
Don't touch MSI enable bit in RL_CFG2 register. For unknown reason
  clearing MSI enable bit for MSI capable hardwares resulted in Tx
  problems. MSI enable bit is set only when MSI is requested from
  user.
2008-04-22 06:14:56 +00:00
Pyun YongHyeon 23757703f5 MFC if_re.c 1.113, if_rlreg.h 1.74 to RELENG_7.
Padding more bytes than necessary one broke another variants of
  PCIe RealTek chips. Only pad IP packets if the payload is less than
  28 bytes.
2008-04-22 06:13:05 +00:00
Pyun YongHyeon 2c739dad6d MFC if_re.c 1.112 to RELENG_7.
In revision 1.70, 1.71 and 1.84 re(4) tried to workaround checksum
  offload bugs by manual padding for short IP/UDP frames. Unfortunately
  it seems that these workaround does not work reliably on newer PCIe
  variants of RealTek chips.

  To workaround the hardware bug, always pad short frames if Tx IP
  checksum offload is requested. It seems that the hardware has a
  bug in IP checksum offload handling. NetBSD manually pads short
  frames only when the length of IP frame is less than 28 bytes but I
  chose 60 bytes to safety. Also unconditionally set IP checksum
  offload bit in Tx descriptor if any TCP or UDP checksum offload is
  requested. This is the same way as Linux does but it's not
  mentioned in data sheet.
2008-04-22 06:09:57 +00:00
Pyun YongHyeon 57116479db MFC if_re.c 1.111 to RELENG_7.
MSI handling on some RealTek chips are broken so disable it by
  default.
2008-04-22 06:07:59 +00:00
Pyun YongHyeon 37ef35595c MFC if_re.c 1.110, if_rlreg.h 1.73 to RELENG_7.
For MSI capable hardwares, enable MSI enable bit in RL_CFG2
  register.  If MSI was disabled by hw.re.msi_disable tunable
  expliclty clear the MSI enable bit.
2008-04-22 06:05:46 +00:00
Pyun YongHyeon 93b9c3ab53 MFC if_re.c 1.109 to RELENG_7.
Some RealTek chips are known to be buggy on DAC handling, so
  disable DAC by default.
2008-04-22 06:02:20 +00:00
Pyun YongHyeon 3314c83563 MFC if_re.c 1.108 to RELENG_7.
VLAN hardware tag information should be set for all desciptors of a
  multi-descriptor transmission attempt. Datasheet said nothing about
  this requirements. This should fix a long-standing VLAN hardware
  tagging issues with re(4).
2008-04-22 06:00:34 +00:00
Pyun YongHyeon 5268f84e26 MFC if_re.c 1.107 to RELENG_7.
Always honor configured VLAN/checksum offload capabilities.
  Previously re(4) used to blindly enable VLAN hardware tag stripping
  and Rx checksum offload regardless of enabled optional features of
  interface.
2008-04-22 05:58:44 +00:00
Pyun YongHyeon da57f86e3c MFC if_re.c 1.106, if_rl.c 1.173 to RELENG_7.
Don't map memory/IO resource in device probe and just use PCI
  vendor/revision/sub device id of the hardware to probe it.
  This is the same way as NetBSD does and it enhances readabilty
  a lot.
2008-04-22 05:56:16 +00:00
Pyun YongHyeon 8699e7a651 MFC if_re.c 1.105, if_rlreg.h 1.72 to RELENG_7.
Don't allow jumbo frame on 8139C+ controller.
  While I'm here add a check for minimal MTU length.
2008-04-22 05:51:40 +00:00
Pyun YongHyeon 9399d11ac6 MFC if_re.c 1.104, if_rlreg.h 1.71 to RELENG_7.
Implement WOL.
2008-04-22 05:49:12 +00:00
Pyun YongHyeon 405d0d96ce MFC if_re.c 1.103 to RELENG_7.
- Retire re_defrag() and use m_collapse() instead.
2008-04-22 05:44:51 +00:00
Pyun YongHyeon 37a6a55c28 MFC if_re.c 1.101, if_re.c 1.102, if_rlreg.h 1.70 to RELENG_7.
Overhaul re(4).
  o Increased number of Rx/Tx descriptors to 256 for 8169 GigEs
    because it's hard to push the hardware to the limit with default
    64 descriptors.
    TSO requires large number of Tx descriptors to pass a full sized
    TCP segment(65535 bytes IP packet) to hardware. Previously it
    consumed 32 Tx descriptors, assuming MCLBYTES DMA segment size,
    to send the TCP segment which means re(4) couldn't queue more
    than two full sized IP packets.
    For 8139C+ it still uses 64 Rx/Tx descriptors due to its hardware
    limitations. With this changes there are (very) small waste of
    memory for 8139C+ users but I don't think it would affect 8139C+
    users for most cases.
  o Various bus_dma(9) fixes.
     - The hardware supports DAC so allow 64bit DMA operations.
     - Removed BUS_DMA_ALLOC_NOW flag.
     - Increased DMA segment size to 4096 from MCLBYTES because TSO
       consumes too many descriptors with MCLBYTES DMA segment size.
     - Tx/Rx side bus_dmamap_load_mbuf_sg(9) support. With these
       changes the code is more readable than previous one and got a
       (slightly) better performance as it doesn't need to pass/
       decode arguments to/from callback function.
     - Removed unnecessary callback function re_dmamap_desc() and
       nuked rl_dmaload_arg structure which was used in the callback.
     - Additional protection for DMA map load failure. In case of
       failure reuse current map instead of returning a bogus DMA
       map.
    -  Deferred DMA map unloading/sync operation for maximum
       performance until we really need to load new DMA map. If we
       happen to reuse current map(e.g. input error) there is no need
       to sync/unload/load again.
    -  The number of allowable Tx DMA segments for a mbuf chains are
       now 32 instead of magic nseg value. If the number of available
       Tx descriptors are short enough to send highly fragmented mbuf
       chains an optimized re_defrag() is called to collapse mbuf
       chains which is supposed to be much faster than m_defrag(9).
       re_defrag() was borrowed from ath(4).
     - Separated Rx/Tx DMA tag from a common DMA tag such that Rx DMA
       tag correctly uses DMA maps that were created with DMA alignment
       restriction(8bytes alignments). Tx DMA tag does not have such
       alignment limitation.
     - Added additional sanity checks for DMA ring map load failure.
     - Added additional spare Rx DMA map for graceful handling of Rx
       DMA map load failure.
     - Fixed misused bus_dmamap_sync(9) and added missing
       bus_dmamap_sync(9) in re_encap()/re_txeof()/re_rxeof().
  o Enabled TSO again as re(4) have reasonable number of Tx
    descriptors.
  o Don't touch DMA address of a Tx descriptor in re_txeof(). It's
    not needed.
  o Fix incorrect update of if_ierrors counter. For Rx buffer
    shortage it should update if_qdrops as the buffer is reused.
  o Added checks for unsupported H/W revisions and return ENXIO for
    these hardwares. This is required to remove resource allocation
    code in re_probe as other drivers do in device probe routine.
  o Modified descriptor index manipulation macros as it's now possible
    to have different number of descriptors for Rx/Tx.
  o In re_start, to save a lock operation, use IFQ_DRV_IS_EMPTY before
    trying to invoke IFQ_DRV_DEQUEUE. Also don't blindly call re_encap
    since we already know the number of available Tx descriptors in
    advance.
  o Removed RL_TX_DESC_THLD which was used to reserve RL_TX_DESC_THLD
    descriptors in Tx path. There is no such a limitation mentioned in
    8139C+/8169/8110/8168/8101/8111 datasheet and it seems to work ok
    without reserving RL_TX_DESC_THLD descriptors.
  o Fix a comment for RL_GTXSTART. The register is 8bits register.
  o Added comments for 8169/8139C+ hardware restrictions on descriptors.
  o Removed forward declaration for "struct rl_softc", it's not needed.
  o Added a new structure rl_txdesc for Tx descriptor managements and
    a structure rl_rxdesc for Rx descriptor managements.
  o Removed unused member variable rl_intlock in driver softc. There are
    still several unused member variables which are supposed to be used
    to access hardware statistics counters. But it seems that accessing
    hardware counters were not implemented yet.
2008-04-22 05:41:29 +00:00
David Xu 15d9e4679a MFC revision 1.8:
fix return value for function pthread_mutexattr_settype().
2008-04-22 01:28:15 +00:00
John Birrell 1ceb2842db MFC.
The final stage of the big CDDL file move. These files were repo
copied in head to their new location under the 'cddl' directories
of src and src/sys and then added for this branch. The build has
been using the files in their new locations for a few days now.
2008-04-21 23:57:23 +00:00
Doug Rabson b08a1c43f4 MFC: nlm_prot_impl.c 1.6 - Fix error handling in nlm_get_rpc and correct
some spelling mistakes in comments.
2008-04-21 09:23:31 +00:00
Antoine Brodin f26fb38a13 MFC to RELENG_7:
Introduce a new F_DUP2FD command to fcntl(2), for compatibility with
  Solaris and AIX.
  fcntl(fd, F_DUP2FD, arg) and dup2(fd, arg) are functionnaly equivalent.
  Document it.
  Add some regression tests (identical to the dup2(2) regression tests).

  PR:             120233
  Submitted by:   Jukka Ukkonen
  Approved by:    rwaston (mentor)
  MFC after:      1 month
2008-04-20 19:32:46 +00:00
Paolo Pisati 7b0cda2af4 MFC rev. 1.27:
Raise a bit ipfw kld priority.
2008-04-20 18:55:03 +00:00
Stefan Farfeleder 2853cdecba MFC 1.26: Reset the internal state used for the 'getopts' built-in when 'shift'
or 'set' are used to modify the arguments.
2008-04-20 18:02:41 +00:00
Stefan Farfeleder 3f139558a5 MFC 1.36: Leave working directory variables unchanged if chdir() fails. 2008-04-20 17:55:31 +00:00
Antoine Brodin a3b5a4fcb3 MFC to RELENG_7:
Add some obsolete usr/lib32 libraries.

  PR:             117189
  Submitted by:   Scot Hetzel
  Approved by:    rwatson (mentor)
  MFC after:      1 month
2008-04-20 16:44:50 +00:00
Robert Watson 6521160824 Merge audit.c:1.41, audit_arg.c:1.19, audit_bsm.c:1.26,
audit_bsm_klib.c:1.15, audit_bsm_token.c:1.15, audit_pipe.c:1.15,
audit_syscalls.c:1.26, audit_trigger.c:1.8, audit_worker.c:1.23
from HEAD to RELENG_7:

  Use __FBSDID() for $FreeBSD$ IDs in the audit code.
2008-04-20 16:34:50 +00:00
Antoine Brodin 5a683d1d0b MFC to RELENG_7:
Merge changes from NetBSD on humanize_number.c, 1.8 -> 1.13
  Significant changes:
  - rev. 1.11: Use PRId64 instead of a cast to long long and %lld to print
  an int64_t.
  - rev. 1.12: Fix a bug that humanize_number() produces "1000" where it
  should be "1.0G" or "1.0M".  The bug reported by Greg Troxel.

  PR:             118461
  PR:             102694
  Approved by:    rwatson (mentor)
  Obtained from:  NetBSD
  MFC after:      1 month
2008-04-20 16:29:01 +00:00
Robert Watson 7a5584c187 Merge mac_framework.h:1.97, mac_internal.h:1.124, mac_policy.h:1.107
from HEAD to REENG_7:

  Make naming of include guards for MAC Framework include files more
  consistent with other kernel include guards (don't start with _SYS).
2008-04-20 15:42:11 +00:00
Alexander Motin 53af12d647 MFC some small optimizations:
rev. 1.151: Remove impossible (hk_peer == NULL) check.
rev. 1.152: Remove ng_setisr() call from ng_dequeue().
rev. 1.153: There is no need to erase hook->hk_node before freeing hook.
rev. 1.154: Use new atomic_fetchadd() primitive instead of looping atomic_cmpset().
rev. 1.158: ng_address_hook() microoptimization.
2008-04-20 11:28:16 +00:00
Jeff Roberson cb7d94673e MFC 1.220, 1.221, parts of 1.222
- Improve performance with heavy interrupt loads
 - Fix compile with gcc3
 - Fix timeslicing code for non TIMESHARE threads.
2008-04-19 04:50:29 +00:00
Jeff Roberson 5b8210c490 MFC parts of 1.359: Don't hold the proc slock while calling sigqueue_delete* 2008-04-19 04:47:39 +00:00
Jeff Roberson 244fcd1385 MFC 1.48: Fix a sleepq race when checking signals. 2008-04-19 04:45:51 +00:00
Kip Macy ec62595290 fix build breakage caused by undeclared kdb_backtrace() 2008-04-19 03:46:26 +00:00
Kip Macy 0be22f1ff1 MFC of 1.133 import and fixes:
- add support for T3C
- add multicast support
- update copyrights
- add infrastructure for multiple transmit queues
- add support for compiling firmware in to the kernel
- add conditional define for enabling link at device attach
- exit tick handler if shutdown is in progress
- add sysctls for dumping transmit queues
- use jumbo clusters for large packets
- add pcpu caching
- add inline mbuf header on receive

- upgrade to version 5.0 of the firmware

Supported by: Chelsio Inc.
2008-04-18 02:45:39 +00:00
Maksim Yevmenkin 74d12bcfa4 MFC:
Fix possible buffer overrun on 64-bit arch when generating MAC
address for tap interface.

Reported by:	Marc Lorner < marc dot loerner at hob dot de >
Reviewed by:	bms
2008-04-18 00:52:32 +00:00
Xin LI 5d388ab062 Document SA-08:05.openssh 2008-04-17 19:10:57 +00:00
Doug Rabson 4752eb44c8 MFC: smbfs_vnops.c 1.68 - make sure l_type is F_UNLCK when trying to unlock
a byte range.
2008-04-17 07:53:48 +00:00
John Birrell 8cf95e2253 MFC. Step 2 of the big CDDL file move. Use the files in their new
locations. The next step will be to remove the files from their
old locations.
2008-04-17 04:59:18 +00:00
Christian Brueffer fe7c76e7c8 MFC: rev. 1.102
sf(4) should work on all archs now, remove it from here.
2008-04-17 04:27:44 +00:00
Pyun YongHyeon 04b715f0de MFC if_nfe.c rev 1.28, if_nfereg.h rev 1.12 to RELENG_7.
Add support for MCP73 chips.
2008-04-17 04:22:32 +00:00
Pyun YongHyeon 7b4652949b MFC if_rl.c, rev 1.174 to RELENG_7.
It seems that RealTek 8129/8139 chip reports invalid length of
  received frame under certain conditions. wpaul said the length
  0xfff0 is special meaning that indicates hardware is in the
  process of copying a packet into host memory. But it seems
  there are other cases that hardware is busy or stuck in bad
  situation even if the received frame length is not 0xfff0.
  To work-around this condition, add a check that verifys that
  recevied frame length is in valid range. If received length is out
  of range reinitialize hardware to recover from stuck condition.
2008-04-17 04:16:50 +00:00
John Birrell 72e84fa19a MFC. Par of the big CDDL file move I missed. 2008-04-17 02:41:04 +00:00
John Birrell ef99c7d858 MFC. The great CDDL file move.
These files were repocopied for HEAD. The repo copy process renames
tags, adding a prefix of 'old_', so the history for these files is
in old_RELENG_7 etc.
2008-04-17 01:23:39 +00:00
Xin LI c20e1fffd7 Mention bzip2 1.0.5 MFC. 2008-04-17 01:02:03 +00:00
Xin LI c2ce009652 MFC: bzip2 1.0.5 2008-04-17 00:53:13 +00:00
Colin Percival 239bc8fd7f Fix logic error in sshd(8) concerning the handling of failed
attempts to bind ports for X11 forwarding.

Security:	FreeBSD-SA-08:05.openssh
2008-04-17 00:00:41 +00:00
Remko Lodder e609e88150 MFC rev 1.4 gjournal.8
Add missing device in tunefs entry.

  PR:             docs/122702
  Submitted by:   Yoshihiro Ota <[email protected]>
  MFC After:      3 days

MFC rev 1.5 gjournal.8
  I keep taking timemachines to get back in time. Update the
  year to 2008.

  Noticed by:     ceri
2008-04-16 18:54:08 +00:00
Remko Lodder 8c08a22442 MFC rev 1.431 menus.c
Remove ftp.hk.super.net, the DNS isn't pointing to anything at the moment.

  I tested this as well as the submitter and couldn't resolve this either,
  since I dont want to "announce" dead mirrors, I'll remove it from the
  list.

  PR:             122567
  Submitted by:   vs
  Approved by:    imp (mentor, implicit for trivial changes)
  MFC after:      1 week

Approved by:	imp (mentor, implicit)
2008-04-16 18:50:04 +00:00
cvs2svn 73ba0e3ef7 This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2008-04-16 11:33:33 +00:00
Doug Rabson 3ea8fb1980 MFC: nlm_prot_impl.c 1.5, clnt_rc.c 1.3
Avoid error cascades when trying to monitor a host that doesn't resolve in
DNS. Tighten error handling when attempting to communicate with the userland
part of rpc.lockd.
2008-04-16 09:08:54 +00:00
Brooks Davis b219dc1676 MFC rev 1.20:
Declare _ppp_profile_cleaned, _punct, and _punct_c local in
ppp_start_profile().

Reported by:	yar
2008-04-15 22:34:39 +00:00
Maksim Yevmenkin 76328d6c82 MFC:
Add rfcomm_pppd_server rc script to allow start rfcomm_pppd(8) in server
mode at boot time. Multiple profiles can be started at the same time.
The whole idea is very similar to the ppp rc script.

Document Bluetooth knobs in rc.conf(5)

Set defaults for the rfcomm_pppd_server rc script
2008-04-15 20:23:59 +00:00
Jung-uk Kim 01bd432abd Bump __FreeBSD_version to reflect write(2) support for psm(4). 2008-04-15 17:43:40 +00:00
Jung-uk Kim 6017564837 MFC: 1.95, 1.96
- Add write(2) support for psm(4) in native operation level.  Now arbitrary
commands can be written to /dev/psm%d and status can be read back from it.
- Clean up and fix style(9) nits.
2008-04-15 17:41:52 +00:00
Ruslan Ermilov f4a5dceb53 MFC: 1.85: Fix printing of sockaddr prefixes in verbose mode.
PR:		bin/122403
2008-04-15 10:02:24 +00:00
Jung-uk Kim 0be86d9be3 MFC: 1.31
- Add ASUS G2K laptop support.
- Add DLED and GLED found on newer ASUS laptops.
- Turn on BLED, TLED, and WLED by default as other OSes.
2008-04-14 16:50:55 +00:00
Pyun YongHyeon 641f3009c6 MFC GENERIC rev 1.131 to RELENG_7.
Uncomment sf(4), sf(4) should work on all architectures.
2008-04-14 06:30:46 +00:00
Pyun YongHyeon 4e1b921bc8 MFC sf.4 rev 1.25 to RELENG_7.
Document two new sysctl variables, dev.sf.%d.int_mod and dev.sf.%d.stats.
  Xref vlan(4).
2008-04-14 06:28:21 +00:00
Pyun YongHyeon a933277bf2 MFC vlan.4, rev 1.45 to RELENG_7.
sf(4) gained VLAN_MTU support.
2008-04-14 06:25:32 +00:00
Pyun YongHyeon fe04bcec20 MFC sf(4) to latest HEAD.
o sf(4) repocopied from sys/pci to sys/dev/sf

  Overhaul sf(4) to make it run on all architectures and implement
  checksum offoload by downloading AIC-6915 firmware. Changes are
   o Header file cleanup.
   o Simplified probe logic.
   o s/u_int{8,16,32}_t/uint{8,16,32}_t/g
   o K&R -> ANSI C.
   o In register access function, added support both memory mapped and
     IO space register acccess. The function will dynamically detect
     which method would be choosed.
   o sf_setperf() was modified to support strict-alignment
     architectures.
   o Use SF_MII_DATAPORT instead of hardcoded value 0xffff.
   o Added link state/speed, duplex changes handling task q. The task q
     is also responsible for flow control settings.
   o Always hornor link up/down state reported by mii layers. The link
     state information is used in sf_start() to determine whether we
     got a valid link.
   o Added experimental flow-control setup. It was commented out but
     will be activated once we have flow-cotrol infrastructure in mii
     layer.
   o Simplify IFF_UP/IFCAP_POLLING and IFF_PROMISC handling logic. Rx
     filter always honors promiscuous mode.
   o Implemented suspend/resume methods.
   o Reorganized Rx filter routine so promiscuous mode changes doesn't
     require interface re-initialization.
   o Reimplemnted driver probe routine such that it looks for matching
     device from supported hardware list table. This change will help to
     add newer hardware revision to the driver.
   o Use ETHER_ADDR_LEN instead of hardcoded value.
   o Prefer memory space register mapping over I/O space as the hardware
     requires lots of register access to get various consumer/producer
     index. Failing to get memory space mapping, sf(4) falls back to I/O
     space mapping. Use of memory space register mapping requires
     somewhat large memory space(512K), though.
   o Switch to simpler bus_{read,write}_{1,2,4}.
   o Use PCIR_BAR macro to get BARs.
   o Program PCI cache line size if the cache line size was set to 0
     and enable PCI MWI.
   o Add a new sysctl node 'dev.sf.N.stats' that shows various MAC
     counters for Rx/Tx statistics.
   o Add a sysctl node to configure interrupt moderation timer. The
     timer defers interrupts generation until time specified in timer
     control register is expired. The value in the timer register is in
     units of 102.4us. The allowable range for the timer is 0 - 31
     (0 ~ 3.276ms).
     The default value is 1(102.4us). Users can change the timer value
     with dev.sf.N.int_mod sysctl(8) variable/loader(8) tunable.
   o bus_dma(9) conversion
      - Enable 64bit DMA addressing.
      - Enable 64bit descriptor format support.
      - Apply descriptor ring alignment requirements(256 bytes alignment).
      - Apply Rx buffer address alignment requirements(4 bytes alignment).
      - Apply 4GB boundary restrictions(Tx/Rx ring and its completion ring
        should live in the same 4GB address space.)
      - Set number of allowable number of DMA segments to 16. In fact,
        AIC-6915 doesn't have a limit for number of DMA segments but it
        would be waste of Tx descriptor resource if we allow more than 16.
      - Rx/Tx side bus_dmamap_load_mbuf_sg(9) support.
      - Added alignment fixup code for strict-alignment architectures.
      - Added endianness support code in Tx/Rx descriptor access.
      With these changes sf(4) should work on all platforms.
   o Don't set if_mtu in device attach, it's handled in ether_ifattach.
   o Use our own callout to drive watchdog timer.
   o Enable VLAN oversized frames and announce sf(4)'s VLAN capability
     to upper layer.
   o In sf_detach(), remove mtx_initialized KASSERT as it's not possible
     to get there without initialzing the mutex. Also mark that we're
     about to detaching so active bpf listeners do not panic the system.
   o To reduce PCI register access cycles, Rx completion ring is
     directly scanned instead of reading consumer/producer index
     registers. In theory, Tx completion ring also can be directly
     scanned. However the completion ring is composed of two types
     completion(1 for Tx done and 1 and DMA done). So reading producer
     index via register access would be more safer way to detect the
     ring wrap-around.
   o In sf_rxeof(), don't use m_devget(9) to align recevied frames. The
     alignment is required only for strict-alignment architectures and
     now the alignment is handled by sf_fixup_rx() if required. The
     removal of the copy operation in fast path should increase Rx
     performance a lot on non-strict-alignemnt architectures such as
     i386 and amd64.
   o In sf_newbuf(), don't set descriptor valid bit as sf(4) is
     programmed to run with normal mode. In normal mode, the valid bit
     have no meaning. The valid bit should be used only when the
     hardware uses polling(prefetch) mode. The end of descriptor queue
     bit could be used if needed, but sf(4) relys on auto-wrapping of
     hardware on 256 descriptor queue entries so both valid and
     descriptor end bit are not used anymore.
   o Don't disable generation of Tx DMA completion as said in datasheet
     and use the Tx DMA completion entry instead of relying on Tx done
     completion entry. Also added additional Tx completion entry type
     check in Tx completion handler.
   o Don't blindly reset watchdog timer in sf_txeof(). sf(4) now unarm
     the the watchdog only if there are no active Tx descriptors in Tx
     queue.
   o Don't manually update various counters in driver, instead, use
     built-in MAC statistic registers to update them. The statistic
     registers are updated in every second.
   o Modified Tx underrun handlers to increase the threshold value
     in units of 256 bytes. Previously it used to increase 16 bytes
     at a time which seems to take too long to stabalize whenever Tx
     underrun occurrs.
   o In interrupt handler, additional check for the interrupt is
     performed such that interrupts only for this device is allowed to
     process descriptor rings. Because reading SF_ISR register clears
     all interrtups, nuke writing to a SF_ISR register.
   o Tx underrun is abonormal condition and SF_ISR_ABNORMALINTR includes
     the interrupt. So there is no need to inspect the Tx underrun again
     in main interrupt loop.
   o Don't blindly reinitialize hardware for abnormal interrupt
     condition. sf(4) reintializes the hardware only when it encounters
     DMA error which requires an explicit hardware reinitialization.
   o Fix a long standing bug that incorrectly clears MAC statistic
     registers in sf_init_locked.
   o Added strict-alignment safe way of ethernet address reprogramming
     as IF_LLADDR may return unaligned address.
   o Move sf_reset() to sf_init_locked in order to always reset the
     hardware to a known state prior to configuring hardware.
   o Set default Rx DMA, Tx DMA paramters as shown in datasheet.
   o Enable PCI busmaster logic and autopadding for VLAN frames.
   o Rework sf_encap.
       - Previously sf(4) used to type 0 of Tx descriptor with padding
         enabled to store driver private data. Emebedding private data
         structures into descriptors is bad idea as the structure size
         would be different between 64bit and 32bit architectures. The
         type 0 descriptor allows fixed number of DMA segments in
         a descriptor format and provides relatively simple interface to
         manage multi-fragmented frames.
         However, it wastes lots of Tx descriptors as not all frames are
         fragmented as the number of allowable segments in a descriptor.
       - To overcome the limitation of type 0 descriptor, switch to type
         2 descriptor which allows 64bit DMA addressing and can handle
         unliumited number of fragmented DMA segments. The drawback of
         type 2 descriptor is in its complexity in managing descriptors
         as driver should handle the end of Tx ring manually.
      -  Manually set Tx desciptor queue end mark and record number of
         used descriptors to reclaim used descriptors in sf_txeof().
   o Rework sf_start.
       - Honor link up/down state before attempting transmission.
       - Because sf(4) uses only one of two Tx queues, use low priority
         queue instead of high one. This will remove one shift operation
         in each Tx kick command.
       - Cache last produder index into softc such that subsequenet Tx
         operation doesn't need to access producer index register.
   o Rewrote sf_stats_update to include all available MAC statistic
     counters.
   o Employ AIC-6915 firmware from Adaptec and implement firmware
     download routine and TCP/UDP checksum offload.
     Partial checksum offload support was commented out due to the
     possibility of firmware bug in RxGFP.
     The firmware can strip VLAN tag in Rx path but the lack of firmware
     assistance of VLAN tag insertion in transmit side made it useless
     on FreeBSD. Unlike checksum offload, FreeBSD requires both Tx/Rx
     hardware VLAN assistance capability. The firmware may also detect
     wakeup frame and can wake system up from states other than D0.
     However, the lack of wakeup support form D3cold state keep me from
     adding WOL capability. Also detecting WOL frame requires firmware
     support but it's not yet known to me whether the firmware can
     process the WOL frame.
   o Changed *_ADDR_HIADDR to *_ADDR_HI to match other definitions of
     registers.
   o Added definitioan to interrupt moderation related constants.
   o Redefined SF_INTRS to include Tx DMA done and DMA errors. Removed
     Tx done as it's not needed anymore.
   o Added definition for Rx/Tx DMA high priority threshold.
   o Nuked unused marco SF_IDX_LO, SF_IDX_HI.
   o Added complete MAC statistic register definition.
   o Modified sf_stats structure to hold all MAC statistic regiters.
   o Nuke various driver private padding data in Tx/Rx descriptor
     definition. sf(4) no longer requires private padding. Also remove
     unused padding related definitions. This greatly simplifies
     descriptor manipulation on 64bit architectures.
   o Becase we no longer pad driver private data into descriptor,
     remove deprecated/not-applicable comments for padding.
   o Redefine Rx/Tx desciptor status. sf(4) doesn't use bit fileds
     anymore to support endianness.
   o Import AIC-6915 firmware for GFP from Adaptec.
2008-04-14 06:21:34 +00:00
Max Laier 30f806a841 MFC:
Make ALTQ cope with disappearing interfaces (particularly common with mpd
  and netgraph in gernal).  This also allows to add queues for an interface
  that is not yet existing (you have to provide the bandwidth for the
  interface, however).

  PR:		kern/106400, kern/117827

Tested by:	Florian Smeets, Boris S.
2008-04-12 18:26:48 +00:00
Marius Strobl 68119dd2f1 MFC: tlb.h 1.27; cache.c 1.21; cheetah.c 1.6; mp_machdep.c 1.38;
pmap.c 1.171; spitfire.c 1.6; tlb.c 1.9

- Do as the comment in pmap_bootstrap() suggests and flush all non-locked
  TLB entries possibly left over by the firmware and also do so while
  bootstrapping APs.
- Use __FBSDID.
2008-04-12 13:41:32 +00:00
Florent Thoumie f79977fcd1 MFC: Add support for Verizon v740 to ubsa(4).
src/sys/dev/usb/usbdevs: rev 1.345 -> 1.346
      src/sys/dev/usb/ubsa.c: rev 1.34 -> 1.35

PR:		usb/122610
Submitted by:	Randi Harper <[email protected]>
2008-04-12 11:23:21 +00:00
David Xu f9c0b1636d MFC revision 1.43:
Reduce lock contention by replacing mutex with rwlock.
2008-04-12 04:07:20 +00:00
David Xu 88ab03a429 MFC:
Preserve and restore errno.
2008-04-12 02:54:59 +00:00
David Xu d6366064c4 MFC:
retire type umtx_t.
2008-04-12 02:42:54 +00:00
David Xu d937f5b427 MFC:
- add _umtx_op_err function to improve stability because of errno
	  changed by application signal handler code.
	- use kernel based userland rwlock to implement pthread_rwlock,
	  improve performance in most cases.
2008-04-11 23:52:52 +00:00
Marius Strobl c669d09cca MFC: if_dc.c 1.194; if_dcreg.h 1.55
- Const'ify the dc_devs array.
- Correct the maxsize parameter when creating the mbufs busdma tag to
  reflect the actual requirement of dc(4).
- Move the KASSERT in dc_newbuf() to the right spot.
- Also convert the TX side to take advantage of bus_dmamap_load_mbuf_sg(9).
- Move the comment regarding dc_start_locked() to the right spot.
2008-04-11 23:38:07 +00:00
David Xu c9ff53460e Bump version for added umtx functions. 2008-04-11 14:41:18 +00:00
David Xu 03fb0eb216 MFC:
Add umtx operation UMTX_OP_WAIT_UINT and userland rwlock.
2008-04-11 14:39:11 +00:00
Ruslan Ermilov aff8908b64 MFC: Fix "top -P". 2008-04-11 11:45:27 +00:00
Robert Watson 38064cd709 Bump __FreeBSD_version in RELENG_7 to reflect addition of procstat(1) and
its associated kernel sysctl additions.
2008-04-11 09:13:11 +00:00
Robert Watson 2442da2edc Merge kern_descrip.c:1.322, user.h:1.74, procstat_files.c:1.5:
Add support for displaying a process' current working directory, root
  directory, and jail directory within procstat.  While this functionality
  is available already in fstat, encapsulating it in the kern.proc.filedesc
  sysctl makes it accessible without using kvm and thus without needing
  elevated permissions.

  The new procstat output looks like:

    PID COMM               FD T V FLAGS    REF  OFFSET PRO NAME
    76792 tcsh            cwd v d --------   -       - -   /usr/src
    76792 tcsh           root v d --------   -       - -   /
    76792 tcsh             15 v c rw------  16    9130 -   -
    76792 tcsh             16 v c rw------  16    9130 -   -
    76792 tcsh             17 v c rw------  16    9130 -   -
    76792 tcsh             18 v c rw------  16    9130 -   -
    76792 tcsh             19 v c rw------  16    9130 -   -

  I am also bumping __FreeBSD_version for this as this new feature will be
  used in at least one port.

  Reviewed by:    rwatson
  Approved by:    rwatson

Note that in the MFC, __FreeBSD_version is not bumped as we will bump it
once (shortly) for all procstat(1) MFC changes together.
2008-04-11 09:09:28 +00:00
Doug Rabson 9d743ac4e9 MFC: lockd.c r1.27 - don't call the kernel NLM if its not loaded. 2008-04-11 09:01:31 +00:00
Robert Watson b78d001ada Merge procstat.c:1.2, procstat_basic.c:1.2, procstat_files.c:1.4,
procstat_kstack.c:1.3, procstat_threads.c:1.3, procstat_vm.c:1.2 from
HEAD to RELENG_7:

  WARNS fixes: mainly constness and avoid comparing signed with
  unsigned by making array indicies unsigned. Also note one or two
  unused parameters.
2008-04-11 08:56:25 +00:00
Robert Watson 58b5541a34 Merge init_main.c:1.290, kern_proc.c:1.261, kern_resource.c:1.182,
kern_sync.c:1.305, proc.h:1.499 from HEAD to RELENG_7:

  Don't zero td_runtime when billing thread CPU usage to the process;
  maintain a separate td_incruntime to hold unbilled CPU usage for
  the thread that has the previous properties of td_runtime.

  When thread information is requested using the thread monitoring
  sysctls, export thread td_runtime instead of process rusage runtime
  in kinfo_proc.

  This restores the display of individual ithread and other kernel
  thread CPU usage since inception in ps -H and top -SH, as well for
  libthr user threads, valuable debugging information lost with the
  move to try kthreads since they are no longer independent processes.

  There is universal agreement that we should rewrite the process and
  thread export sysctls, but this commit gets things going a bit
  better in the mean time.  Likewise, there are resevations about the
  continued validity of statclock given the speed of modern processors.

  Reviewed by:            attilio, emaste, jhb, julian

Note: in MFC, td_incruntime is added to the end of struc thread,
rather than the pre-zero'd section, and manually zero'd on thread
creation, in order to avoid a negative ABI impact for third-party
kernel modules.
2008-04-11 08:47:35 +00:00
Robert Watson 3f8ed37a44 Merge vfs_subr.c:1.713 from HEAD to RELENG_7:
In "show lockedvnods" DDB command, use db_printf() rather than printf()
  so that the results end up in the DDB output stream rather than the
  console output stream.

  This should likely also be done for the vprint() function it calls.
2008-04-11 08:13:37 +00:00
Robert Watson 29af36f269 Merge kern_proc.c:1.259 from HEAD to RELENG_7:
Return ESRCH when a kernel stack is queried on a process in execve() --
  p_candebug() will return EAGAIN which, if the other process never
  leaves execve(), will result in the sysctl spinning and never returning
  to userspace.  Processes should always eventually leave execve(), but
  spinning in kernel while we wait is bad for countless reasons, and
  particularly harmful if execve() itself is deadlocked.

  Possibly we should return another error, or return a marker indicating
  the thread is in execve() so it can be reported that way in userspace.

  Reported by:    kris
2008-04-11 08:12:36 +00:00
Robert Watson c1d0314893 Merge procstat_args.c:1.2, procstat_bin.c:1.2, procstat_cred.c:1.2,
and procstat_files.c:1.2 from HEAD to RELENG_7:

  Add 'COMM' column to a few more output modes of procstat(1).  The only
  one it's missing from is the VM display, where there's really not room,
  and the file output display is looking quite cramped.
2008-04-11 08:07:10 +00:00
Pyun YongHyeon b4d1b78423 MFC if_stge.c rev 1.12 to RELENG_7.
Use m_collapse(9) to collapse mbuf chains instead of relying on
  shortest possible chain of mbufs of m_defrag(9). What we want is
  chains of mbufs that can be safely stored to a Tx descriptor which
  can have up to STGE_MAXTXSEGS mbufs. The ethernet controller does
  not need to align Tx buffers on 32bit boundary. So the use of
  m_defrag(9) was waste of time.
2008-04-11 04:03:36 +00:00
Pyun YongHyeon be7fadd077 MFC if_stge.c rev 1.11, if_stgereg.h rev 1.4 to RELENG_7.
Implement WOL capability.
   - Turn on WOL bits in suspend/shutdown method.
   - WOL is disabled in resume routine as WOL can interfere normal
     Rx operation.
   - Move stge_reset() to stge_init_locked() as resetting hardware
     clears configured Rx information which in turn results in
     non-working Rx module after suspend/shutdown operation.
2008-04-11 04:01:25 +00:00
Pyun YongHyeon 30322c60fa MFC GENERIC rev 1.132 to RELENG_7.
Uncomment vr(4), vr(4) should work on all architectures.
2008-04-11 03:52:23 +00:00
Pyun YongHyeon 4f31bd614f MFC vr.4 rev 1.31 to RELENG_7.
Document a new sysctl variable, dev.vr.%d.stats.
2008-04-11 03:49:47 +00:00
Pyun YongHyeon 047710646a MFC vr(4) to latest HEAD.
o vr(4) repocopied from sys/pci to sys/dev/vr.

  Teach vr(4) to use bus_dma(9) and major overhauling to handle link
  state change and reliable error recovery.
   o Moved vr_softc structure and relevant macros to header file.
   o Use PCIR_BAR macro to get BARs.
   o Implemented suspend/resume methods.
   o Implemented automatic Tx threshold configuration which will be
     activated when it suffers from Tx underrun. Also Tx underrun
     will try to restart only Tx path and resort to previous
     full-reset(both Rx/Tx) operation if restarting Tx path have failed.
   o Removed old bit-banging MII interface. Rhine provides simple and
     efficient MII interface. While I'm here show PHY address and PHY
     register number when its read/write operation was failed.
   o Define VR_MII_TIMEOUT constant and use it in MII access routines.
   o Always honor link up/down state reported by mii layers. The link
     state information is used in vr_start() to determine whether we
     got a valid link.
   o Removed vr_setcfg() which is now handled in vr_link_task(), link
     state taskqueue handler. When mii layer reports link state changes
     the taskqueue handler reprograms MAC to reflect negotiated duplex
     settings. Flow-control changes are not handled yet and it should
     be revisited when mii layer knows the notion of flow-control.
   o Added a new sysctl interface to get statistics of an instance of
     the driver.(sysctl dev.vr.0.stats=1)
   o Chip name was renamed to reflect the official name of the chips
     described in VIA Rhine I/II/III datasheet.
          REV_ID_3065_A -> REV_ID_VT6102_A
          REV_ID_3065_B -> REV_ID_VT6102_B
          REV_ID_3065_C -> REV_ID_VT6102_C
          REV_ID_3106_J -> REV_ID_VT6105_A0
          REV_ID_3106_S -> REV_ID_VT6105M_A0
     The following chip revisions were added.
          #define REV_ID_VT6105_B0        0x83
          #define REV_ID_VT6105_LOM       0x8A
          #define REV_ID_VT6107_A0        0x8C
          #define REV_ID_VT6107_A1        0x8D
          #define REV_ID_VT6105M_B1       0x94
   o Always show chip revision number in device attach. This shall help
     identifying revision specific issues.
   o Check whether EEPROM reloading is complete by inspecting the state
     of VR_EECSR_LOAD bit. This bit is self-cleared after the EEPROM
     reloading. Previously vr(4) blindly spins for 200us which may/may
     not enough to complete the EEPROM reload.
   o Removed if_mtu setup. It's done in ether_ifattach().
   o Use our own callout to drive watchdog timer.
   o In vr_attach disable further interrupts after reset. For VT6102 or
     newer hardwares, diable MII state change interrupt as well because
     mii state handling is done by mii layer.
   o Add more sane register initialization for VT6102 or newer chips.
      - Have NIC report error instead of retrying forever.
      - Let hardware detect MII coding error.
      - Enable MODE10T mode.
      - Enable memory-read-multiple for VT6107.
   o PHY address for VT6105 or newer chips is located at fixed address 1.
     For older chips the PHY address is stored in VR_PHYADDR register.
     Armed with these information, there is no need to re-read
     VR_PHYADDR register in miibus handler to get PHY address. This
     saves one register access cycle for each MII access.
   o Don't reprogram VR_PHYADDR register whenever access to a register
     located at a PHY address is made. Rhine fmaily allows reprogramming
     PHY address location via VR_PHYADDR register depending on
     VR_MIISTAT_PHYOPT bit of VR_MIISTAT register. This used to lead
     numerous phantom PHYs attached to miibus during phy probe phase and
     driver used to limit allowable PHY address in mii register accessors
     for certain chip revisions. This removes one more register access
     cycle for each MII access.
   o Correctly set VLAN header length.
   o bus_dma(9) conversion.
      - Limit DMA access to be in range of 32bit address space. Hardware
        doesn't support DAC.
      - Apply descriptor ring alignment requirements(16 bytes alignment)
      - Apply Rx buffer address alignment requirements(4 bytes alignment)
      - Apply Tx buffer address alignment requirements(4 bytes alignment)
        for Rhine I chip. Rhine II or III has no Tx buffer address
        alignment restrictions, though.
      - Reduce number of allowable number of DMA segments to 8.
      - Removed the atomic(9) used in descriptor ownership managements
        as it's job of bus_dmamap_sync(9).
      With these change vr(4) should work on all platforms.
   o Rhine uses two separated 8bits command registers to control Tx/Rx
     MAC. So don't access it as a single 16bit register.
   o For non-strict alignment architectures vr(4) no longer require
     time-consuming copy operation for received frames to align IP
     header. This greatly improves Rx performance on i386/amd64
     platforms. However the alignment is still necessary for
     strict-alignment platforms(e.g. sparc64). The alignment is handled
     in new fuction vr_fixup_rx().
   o vr_rxeof() now rejects multiple-segmented(fragmented) frames as
     vr(4) is not ready to handle this situation. Datasheet said nothing
     about the reason when/why it happens.
   o In vr_newbuf() don't set VR_RXSTAT_FIRSTFRAG/VR_RXSTAT_LASTFRAG
     bits as it's set by hardware.
   o Don't pass checksum offload information to upper layer for
     fragmented frames. The hardware assisted checksum is valid only
     when the frame is non-fragmented IP frames. Also mark the checksum
     is valid for corrupted frames such that upper layers doesn't need
     to recompute the checksum with software routine.
   o Removed vr_rxeoc(). RxDMA doesn't seem to need to be idle before
     sending VR_CMD_RX_GO command. Previously it used to stop RxDMA
     first which in turn resulted in long delays in Rx error recovery.
   o Rewrote Tx completion handler.
      - Always check VR_TXSTAT_OWN bit in status word prior to
        inspecting other status bits in the status word.
      - Collision counter updates were corrected as VT3071 or newer
        ones use different bits to notify collisions.
      - Unlike other chip revisions, VT86C100A uses different bit to
        indicate Tx underrun. For VT3071 or newer ones, check both
        VR_TXSTAT_TBUFF and VR_TXSTAT_UDF bits to see whether Tx
        underrun was happend. In case of Tx underrun requeue the failed
        frame and restart stalled Tx SM. Also double Tx DMA threshold
        size on each failure to mitigate future Tx underruns.
      - Disarm watchdog timer only if we have no queued packets,
        otherwise don't touch watchdog timer.
   o Rewrote interrupt handler.
      - status word in Tx/Rx descriptors indicates more detailed error
        state required to recover from the specific error. There is no
        need to rely on interrupt status word to recover from Tx/Rx
        error except PCI bus error. Other event notifications like
        statistics counter overflows or link state events will be
        handled in main interrupt handler.
      - Don't touch VR_IMR register if we are in suspend mode. Touching
        the register may hang the hardware if we are in suspended state.
        Previously it seems that touching VR_IMR register in interrupt
        handler was to work-around panic occurred in system shutdown
        stage on SMP systems. I think that work-around would hide
        root-cause of the panic and I couldn't reproduce the panic
        with multiple attempts on my box.
   o While padding space to meet minimum frame size, zero the pad data
     in order to avoid possibly leaking sensitive data.
   o Rewrote vr_start_locked().
      - Don't try to queue packets if number of available Tx descriptors
        are short than that of required one.
   o Don't reinitialize hardware whenever media configuration is
     changed. Media/link state changes are reported from mii layer if
     this happens and vr_link_task() will perform necessary changes.
   o Don't reinitialize hardware if only PROMISC bit was changed. Just
     toggle the PROMISC bit in hardware is sufficient to reflect the
     request.
   o Rearrganed the IFCAP_POLLING/IFCAP_HWCSUM handling in vr_ioctl().
   o Generate Tx completion interrupts for every VR_TX_INTR_THRESH-th
     frames. This reduces Tx completion interrupts under heavy network
     loads.
   o Since vr(4) doesn't request Tx interrupts for every queued frames,
     reclaim any pending descriptors not handled in Tx completion
     handler before actually firing up watchdog timeouts.
   o Added vr_tx_stop()/vr_rx_stop() to wait for the end of active
     TxDMA/RxDMA cycles(draining). These routines are used in vr_stop()
     to ensure sane state of MAC before releasing allocated Tx/Rx
     buffers. vr_link_task() also takes advantage of these functions to
     get to idle state prior to restarting Tx/Rx.
   o Added vr_tx_start()/vr_rx_start() to restart Rx/Tx. By separating
     Rx operation from Tx operation vr(4) no longer need to full-reset
     the hardware in case of Tx/Rx error recovery.
   o Implemented WOL.
   o Added VT6105M specific register definitions. VT6105M has the
     following hardware capabilities.
      - Tx/Rx IP/TCP/UDP checksum offload.
      - VLAN hardware tag insertion/extraction. Due to lack of information
         for getting extracted VLAN tag in Rx path, VLAN hardware support
         was not implemented yet.
      - CAM(Content Addressable Memory) based 32 entry perfect multicast/
        VLAN filtering.
      - 8 priority queues.
   o Implemented CAM based 32 entry perfect multicast filtering for
     VT6105M. If number of multicast entry is greater than 32, vr(4)
     uses traditional hash based filtering.
   o Reflect real Tx/Rx descriptor structure. Previously vr(4) used to
     embed other driver (private) data into these structure. This type
     of embedding make it hard to work on LP64 systems.
   o Removed unused vr_mii_frame structure and MII bit-baning
     definitions.
   o Added new PCI configuration registers that controls mii operation
     and mode selection.
   o Reduced number of Tx/Rx descriptors to 128 from 256. From my
     testing, increasing number of descriptors above than 64 didn't help
     increasing performance at all. Experimentations show 128 Rx
     descriptors seems to help a lot reducing Rx FIFO overruns under
     high system loads. It seems the poor Tx performance of Rhine
     hardwares comes from the limitation of hardware. You wouldn't
     satuarte the link with vr(4) no matter how fast CPU/large number of
     descriptors are used.
   o Added vr_statistics structure to hold various counter values.
2008-04-11 03:41:59 +00:00
David Xu e5e179e505 MFC:
Modifying td_flags with thread lock held.
2008-04-11 02:38:28 +00:00
David Xu ee61152b4f MFC:
Unblock SIGCANCEL for thread created by cleanup handler.
2008-04-11 01:42:20 +00:00
Brooks Davis 04175b15f1 MFC rev 1.19
Add a new function is_default_interface() which determines if this
interface is one with the default route (or there isn't one).  Use it to
decide if we should adjust the default route and /etc/resolv.conf.

Fix the delete of the default route.  The if statement was totally bogus
and the delete only worked due to a typo. [1]

Reported by:    Jordan Coleman <jordan at JordanColeman dot com> [1]
2008-04-11 00:18:37 +00:00
Robert Watson 637ba6cb3c Merge kern_proc.c:1.258 from HEAD to RELENG_7:
Check for P_WEXIT before PHOLD() on a process in kstack and vm query
  sysctls, as PHOLD() asserts !P_WEXIT.

  Reported by:    Michael Plass <mfp49_freebsd at plass-family dot net>
2008-04-10 22:58:59 +00:00
Robert Watson 8a16e122d4 Merge procstaT_kstack.c:1.2, procstat_threads.c:1.2 from HEAD to
RELENG_7:

  Display per-thread command line in TDNAME field for -k and -t; if
  no per-thread name is available or the name is identical to the
  process name, display "-" instead.  Very slightly shrink the COMM
  entry to make a bit more room, although this doesn't help with
  stack traces much.

  Suggested by:   thompsa
2008-04-10 22:58:11 +00:00
Robert Watson 7f907a8cbb Merge subr_stack.c:1.6 from HEAD to RELENG_7:
When a symbol name can't be resolved, return "??" as the name, rather
  than "Unknown func", in order to avoid putting spaces in what ideally
  is a string separated by white space.
2008-04-10 22:57:18 +00:00
Robert Watson 698c98ebc1 Merge Makefile:1.304 from HEAD to RELENG_7:
Connect procstat(1) to the build.
2008-04-10 22:50:44 +00:00
Robert Watson dea1c67332 Merge Makefile:1.1, procstat.1:1.1, procstat.c:1.1, procstat.h:1.1,
procstat_args.c:1.1, procstat_basic.c:1.1, procstat_bin.c:1.1,
procstat_cred.c:1.1, procstat_files.c:1.1, procstat_kstack.c:1.1,
procstat_threads.c:1.1, and procstat_vm.c:1.1 from HEAD to RELENG_7:

  Add procstat(1), a process inspection utility.  This provides both some
  of the missing functionality from procfs(4) and new functionality for
  monitoring and debugging specific processes.  procstat(1) operates in
  the following modes:

    -b  Display binary information for the process.
    -c  Display command line arguments for the process.
    -f  Display file descriptor information for the process.
    -k  Display the stacks of kernel threads in the process.
    -s  Display security credential information for the process.
    -t  Display thread information for the process.
    -v  Display virtual memory mappings for the process.

  Further revision and modes are expected.

  Testing, ideas, etc:    cognet, sam, Skip Ford <skip at menantico dot com>
                          Wesley Shields <wxs at atarininja dot org>
2008-04-10 22:49:39 +00:00
Robert Watson 9757bfcf01 Merge kern_proc.c:1.257, sysctl.h:1.154, and user.h:1.72 from HEAD to
RELENG_7:

  Add another new sysctl in support of the forthcoming procstat(1) to
  support its -k argument:

  kern.proc.kstack - dump the kernel stack of a process, if debugging
    is permitted.

  This sysctl is present if either "options DDB" or "options STACK" is
  compiled into the kernel.  Having support for tracing the kernel
  stacks of processes from user space makes it much easier to debug
  (or understand) specific wmesg's while avoiding the need to enter
  DDB in order to determine the path by which a process came to be
  blocked on a particular wait channel or lock.
2008-04-10 22:45:27 +00:00
Xin LI 8b57be706a MFC revision 1.22
date: 2008/03/07 00:01:19;  author: delphij;  state: Exp;  lines: +61 -68
Merge revisions 1.10 and 1.11 from DragonFly:

 - Use real getopt() handling instead of the hand-rolled and
   IOCCC-worthy "Micro getopt()" macros, plus clean up to the
   option handling code:
    * Sort the options in the switch statement;
    * Plug piddling memory leaks when processing repeated options
      by freeing strings before allocating them for a second time;
    * Die with a fatal error if the requested report file cannot
      be opened for appending;
    * Don't call init() before usage() (to prevent the usage
      message being mangled by changes to the terminal settings;)
 - Clean up the usage message, both in usage() and in the main
   program comment, both stylistically (sort and combine options)
   and for accuracy (following the manual page, make note of the -s
   and -S flags, and use the term 'send' instead of 'say' to reduce
   confusion (SAY is the name of a command for output to the user,
   not the connection.))

Obtained from:  DragonFly
2008-04-10 22:43:46 +00:00
Robert Watson b0ccfc63d0 Merge stack.9:1.5, amd64/db_trace.c:1.82, amd64/stack_machdep.c:1.1,
amd64/conf/GENERIC:1.489, amd64/include/stack.h:1.1, arm/db_trace.c:1.14,
arm/stack_machdep.c:1.1, arm/include/stack.h:1.1, NOTES:1.1457,
files:1.1254, files.amd64:1.115, files.arm:1.19, files.i386:1.588,
files.ia64:1.94, files.powerpc:1.67, files.sparc64:1.93, files.sun4v:1.13,
options:1.610, i386/conf/GENERIC:1.478, i386/db_trace.c:1.80,
i386/stack_machdep.c:1.1, i386/include/stack.h:1.1, ia64/conf/GENERIC:1.93,
ia64/db_machdep.c:1.6, ia64/stack_machdep.c:1.1, kern/subr_stack.c:1.5,
pc98/conf/GENERIC:1.299, powerpc/conf/GENERIC:1.73,
powerpc/include/stack.h:1.1, powerpc/db_trace.c:1.14,
powerpc/stack_machdep.c:1.1, sparc64/conf/GENERIC:1.129,
sparc64/include/stack.h:1.1, sparc64/db_trace.c:1.27,
sparc64/stack_machdep.c:1.1, sun4v/conf/GENERIC:1.16,
sun4v/include/stack.h:1.1, sun4v/db_trace.c:1.2, sun4v/stack_machdep.c:1.1,
sys/stack.h:1.4 from HEAD to RELENG_7:

  Break out stack(9) from ddb(4):

  - Introduce per-architecture stack_machdep.c to hold stack_save(9).
  - Introduce per-architecture machine/stack.h to capture any common
    definitions required between db_trace.c and stack_machdep.c.
  - Add new kernel option "options STACK"; we will build in stack(9) if it
    is defined, or also if "options DDB" is defined to provide
    compatibility with existing users of stack(9).

  Add new stack_save_td(9) function, which allows the capture of a
  stacktrace of another thread rather than the current thread, which the
  existing stack_save(9) was limited to.  It requires that the thread be
  neither swapped out nor running, which is the responsibility of the
  consumer to enforce.

  Update stack(9) man page.

  Build tested:   amd64, arm, i386, ia64, powerpc, sparc64, sun4v
  Runtime tested: amd64 (rwatson), arm (cognet), i386 (rwatson)

Merge i386/stack_machdep.c:1.2 from HEAD to RELENG_7:

  Remove duplicate $FreeBSD$ tag.

Merge files.pc98:1.359, pc98/include/stack.h:1.1 from HEAD to RELENG_7:

  Catch up pc98 for i386 stack(9) changes:

    Add stub stack.h for pc98 that includes i386 pc98.

    Add i386 stack_machdep.c to files.pc98.

  Spotted by:     tinderbox
2008-04-10 22:09:25 +00:00
Robert Watson 985ecd8d64 Merge kern_descrip.c:1.314, kern_proc.c:1.256, sysctl.h:1.153,
user.h:1.71 from HEAD to RELENG_7:

  Add two new sysctls in support of the forthcoming procstat(1) to support
  its -f and -v arguments:

  kern.proc.filedesc - dump file descriptor information for a process, if
    debugging is permitted, including socket addresses, open flags, file
    offsets, file paths, etc.

  kern.proc.vmmap - dump virtual memory mapping information for a process,
    if debugging is permitted, including layout and information on
    underlying objects, such as the type of object and path.

  These provide a superset of the information historically available
  through the now-deprecated procfs(4), and are intended to be exported
  in an ABI-robust form.
2008-04-10 20:54:01 +00:00
Robert Watson 8cd49c3ece Merge Makefile:1.320, stack.9:1.4, kern_lock.c:1.114, subr_stack.c:1.4,
stack.h:1.3, redzone.c:1.2 from HEAD to RELENG_7:

  Modify stack(9) stack_print() and stack_sbuf_print() routines to use new
  linker interfaces for looking up function names and offsets from
  instruction pointers.  Create two variants of each call: one that is
  "DDB-safe" and avoids locking in the linker, and one that is safe for
  use in live kernels, by virtue of observing locking, and in particular
  safe when kernel modules are being loaded and unloaded simultaneous to
  their use.  This will allow them to be used outside of debugging
  contexts.

  Modify two of three current stack(9) consumers to use the DDB-safe
  interfaces, as they run in low-level debugging contexts, such as inside
  lockmgr(9) and the kernel memory allocator.

  Update man page.
2008-04-10 20:28:03 +00:00
Robert Watson de9b7458c1 Merge kern_linker.c:1.153, linker.h:1.50 from HEAD to RELENG_7:
The kernel linker includes a number of utility functions to look up symbol
  information in support of DDB(4); these functions bypass normal linker
  locking as they may run in contexts where locking is unsafe (such as the
  kernel debugger).

  Add a new interface linker_ddb_search_symbol_name(), which looks up a
  symbol name and offset given an address, and also
  linker_search_symbol_name() which does the same but *does* follow the
  locking conventions of the linker.

  Unlike existing functions, these functions place the name in a
  caller-provided buffer, which is stable even after linker locks have been
  released.  These functions will be used in upcoming revisions to stack(9)
  to support kernel stack trace generation in contexts as part of a live,
  rather than suspended, kernel.
2008-04-10 20:15:35 +00:00
Robert Watson 812b7b6ba9 MFC audit.c:1.39, audit_bsm_klib.c:1.11, audit_private.h:1.19 from
HEAD to RELENG_7:

  Add audit_prefixes to two more globally visible functions in the Audit
  implementation.
2008-04-10 20:00:18 +00:00
Robert Watson 94379fb926 Merge audit_arg.c:1.18, audit_bsm.c:1.25, audit_bsm_klib.c:1.10,
audit_private.h:1.17 from HEAD to RELENG_7:

  Rename several audit functions in the global kernel symbol namespace to
  have audit_ on the front:

  - canon_path -> audit_canon_path
  - msgctl_to_event -> audit_msgctl_to_event
  - semctl_to_event -> audit_semctl_to_event

Note that audit.c:1.38 is not merged as changes it depends on have also not
yet been merged.
2008-04-10 19:54:54 +00:00
Doug Rabson 036ac6071d Regen. 2008-04-10 09:40:06 +00:00
Doug Rabson 6504a63300 MFC: Kernel mode Network Lock Manager. 2008-04-10 09:39:29 +00:00
Andrew Thompson ce618e348c Sync to HEAD.
- Simplify the error handling
 - Nuke licence clause 3 & 4
 - Drop frames to any of the reserved multicast addresses
 - Remove duplicated code for testing local packets.
2008-04-10 05:03:55 +00:00
Andrew Thompson 3809f9bae3 MFC if_bridge.c r1.106, if_bridgevar.h r1.24
ifbridge.c r1.12, ifconfig.8 r1.144

  Add an option to limit the number of source MACs that can be behind a bridge
  interface.
2008-04-10 04:01:26 +00:00
Peter Wemm 29ae74b6e3 MFC: rev 1.205: compile on systems without SCTL_MASK32 2008-04-10 02:45:39 +00:00
Xin LI 6d5a6da941 MFC: Do nextboot -D twice during boot. The first time in rc.d/root which ensures
that we can remove the file as early as possible, but shut up nextboot at this
moment if the operation is failed, because /boot is not necessarily a part of /;
the newly added second run is placed in rc.d/mountlate after all filesystems were
mounted.
2008-04-10 00:25:53 +00:00
cvs2svn 38172a7edb This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2008-04-10 00:12:45 +00:00
Peter Wemm 28bbcca937 MFC: merge -P flag for displaying per-cpu %user/%system/%idle states. 2008-04-09 19:08:43 +00:00
Peter Wemm 60495972b1 MFC: add -P flag etc for displaying per-cpu stats. 2008-04-09 19:07:34 +00:00
Peter Wemm ea23b03b85 MFC: collect per-cpu stats for %user, %system, %idle etc. Counters are
stored in pcpu area and merged at collection time rather than a common
set being manipulated with atomic ops.
2008-04-09 19:05:59 +00:00
John Baldwin 43329fbc23 MFC: Add an '-a' option which maps to '-RpP'. 2008-04-09 16:17:50 +00:00
Poul-Henning Kamp 1efd6ac30b MFC: Hitch fifolog tools into build 2008-04-09 16:01:07 +00:00
Poul-Henning Kamp 916af59c8d MFC: the fifolog tools.
(Will be connected to build after a make universe check)
2008-04-09 10:01:08 +00:00
Andrew Thompson a9a1e8c937 MFC if_lagg.c r1.26-27, ieee8023ad_lacp.c r1.13-15, ieee8023ad_lacp.h r1.9-11
- Pass any unmatched slowprotocols frames up the stack
 - Switch the LACP state machine over to its own mutex
2008-04-09 00:47:41 +00:00
Andrew Thompson 8a6b3e548d MFC r1.68
Improve EtherIP interaction with the bridge
  Submitted by:   Eugene Grosbein
2008-04-09 00:38:32 +00:00
Tom Rhodes e48c79fcf6 MFC revisions 1.56 and 1.57:
Bring the DIAGNOSTICS section in ed.4 closer to reality by removing missing
diagnostic messages and adding a few found in the code.

PR:	51891

Properly Xref device.hints(5).
2008-04-08 17:33:57 +00:00
Rui Paulo 3bd957ad4c MFC r1.11:
Add Qualcomm, Inc. ZTE CDMA Technologies MSM to the list of supported
  devices.
2008-04-08 16:39:00 +00:00
Rui Paulo c4f8ccb4cd MFC:
Add Qualcomm ZTE CMDMA MSM modem to the list of supported modems.
2008-04-08 16:36:49 +00:00
John Baldwin 1ff2df7fcc MFC: Explicitly bypass bpf(4) for media test packets during attach. 2008-04-08 14:23:23 +00:00
Yoshihiro Takahashi e0940f3139 MFi386: revision 1.474.2.5
Add USB->RS232 devices to the GENERIC kernel.
2008-04-08 13:15:56 +00:00
Rui Paulo 3dfc36bb84 MFC r1.97:
Sync with rev 1.63 of NetBSD's ums.c:
       If a mouse has both a wheel and a Z direction we report both.
       XXX Due to tradition the wheel is reported as the Z direction (and the Z
       direction as W).
       Now Apple's Mighty Mouse is fully supported, except the X11 mouse driver
       doesn't know what to do with the new coordinate.
2008-04-08 12:35:56 +00:00
Poul-Henning Kamp 7676f0b0e4 MFC 1.310: In abort2(2): Accept a NULL arg pointer if nargs == 0 2008-04-08 11:04:06 +00:00
Poul-Henning Kamp 7e7d827b5d MFC:
Add support for "atacontrol spindown"
2008-04-08 10:48:21 +00:00
Poul-Henning Kamp c7cf394dd2 MFC
1.44,1.45:  Report CFA capability.
1.46: Un-cut&paste argument processing, fix things lint found.
2008-04-08 09:54:37 +00:00
Poul-Henning Kamp b478863b58 MFC 1.206: If the disk reports that it support the Compact Flash
Association command set, announce BIO_DELETE capability and issue
ATA_CFA_ERASE when we get one.
2008-04-08 09:49:42 +00:00
Poul-Henning Kamp ec0c8ef10e MFC:
1.127 Use bus_{read|write_*() instead of bus_space_{read|write}_*() for
purely stylistic reasons.
2008-04-08 09:45:06 +00:00
Poul-Henning Kamp b048835a35 MFC:
1.13: Use correct bitmask for checking CPU identities.
1.16: Add XXX comment about the table in general.
2008-04-08 09:38:15 +00:00
Florent Thoumie 934019e756 Add pkg_check and pkg_sign to ObsoleteFiles.inc. 2008-04-08 09:08:17 +00:00
Andrew Thompson 160a9ffc2e MFC bridgestp.c r1.40, bridgestp.h r1.15
Fix spelling, retaining old define.
2008-04-08 06:55:09 +00:00
Andrew Thompson 6073d1af90 Fix MFC, the contents were duplicated. 2008-04-08 06:33:47 +00:00
Ed Maste ceb5bc5527 MFC aac.c 1.137:
Calling RequestSupplementAdapterInfo before RequestAdapterInfo appears
  to trip a bug causing the latter to return a zeroed struct
  aac_adapter_info.  This causes two issues.  One is cosmetic only --
  a verbose boot prints information about the controller, and shows all
  zero:

  aac0: Unknown processor 0MHz, 0MB memory (0MB cache, 0MB execution),
    unknown battery platform

  The second problem is that the firmware version information is stored
  away for aac_rev_check, for userland tools (like aaccli) to query via
  the FSACTL_MINIPORT_REV_CHECK and FSACTL_LNX_MINIPORT_REV_CHECK ioctls.
  When aaccli encounters this issue it prints

  Command Error: <The current AFAAPI.DLL is too old to work with the
    current controller software.>

  Move the RequestSupplementAdapterInfo call after RequestAdapterInfo,
  which seems to fix both problems.
2008-04-07 14:19:57 +00:00
Florent Thoumie c46c22cc93 Synchronize pkg_install with HEAD:
- Add pkg_updating,
- Remove pkg_sign,
- Support for 8-CURRENT,
- Style cleanup (__P use),
- ... and much more.
2008-04-07 10:27:21 +00:00
Rink Springer 171b2ca573 Add USB->RS232 devices to the GENERIC kernel.
imp@ has already done this in HEAD, refer to revision 1.476 of
i386/conf/GENERIC and revision 1.486 of amd64/conf/GENERIC. It seems only fair
to do the same in RELENG_7.

Discussed with:		imp
Approved by:		re (bmah, kensmith)
2008-04-07 08:35:31 +00:00
Brooks Davis 4121e4ebc4 Fix a stupid typo.
Reported by:	bz
2008-04-06 20:40:24 +00:00
Robert Watson 33a1f71054 Merge audit_private.h:1.18, audit_syscalls.c:1.24, audit_trigger.c:1.6,
audit_worker.c:1.21 from HEAD to RELENG_7:

  Rename globally exposed symbol send_trigger() to audit_send_trigger().
2008-04-06 15:57:18 +00:00
Robert Watson 2eab875e3e Merge audit_trigger.c:1.7 from HEAD to RELENG_7:
Rather than copying out the full audit trigger record, which includes
  a queue entry field, just copy out the unsigned int that is the trigger
  message.  In practice, auditd always requested sizeof(unsigned int), so
  the extra bytes were ignored, but copying them out was not the intent.
2008-04-06 15:01:41 +00:00
Robert Watson 3a8eae0e7e Merge audit_worker.c:1.20 from HEAD to RELENG_7:
Replace somewhat awkward audit trail rotation scheme, which involved the
  global audit mutex and condition variables, with an sx lock which protects
  the trail vnode and credential while in use, and is acquired by the system
  call code when rotating the trail.  Previously, a "message" would be sent
  to the kernel audit worker, which did the rotation, but the new code is
  simpler and (hopefully) less error-prone.

  Obtained from:  TrustedBSD Project
2008-04-06 14:03:57 +00:00
Konstantin Belousov b91892f15c MFC
rev. 1.277 of sys/kern/vfs_mount.c
rev. 1.332 of sys/sys/vnode.h
rev. 1.222 of sys/ufs/ffs/ffs_softdep.c

Yield the cpu in the kernel while iterating the list of the
vnodes belonging to the mountpoint. Also, yield when in the
softdep_process_worklist() even when we are not going to sleep due to
buffer drain.
2008-04-06 10:02:20 +00:00
Bruce A. Mah 44c150491e MFC: textdumps, ULE default scheduler, cmx(4), uslcom(4), aac(4) >2TB
volume support, adduser(8) -M, ypserv(8) -P.
2008-04-06 05:19:21 +00:00
Konstantin Belousov b489ff882a MFC rev. 1.211:
Add two missed chunks from the rev. 1.210, for the giant_read() and
giant_ioctl().
2008-04-05 04:18:29 +00:00
Colin Percival add2c183de MFC revision 1.4: Add /boot/devices.hints to the default list of files
which have local modifications merged during upgrading.
2008-04-04 23:25:08 +00:00
Colin Percival 261e54d2c3 MFC revisions 1.13, 1.14: Don't try to compute the SHA256 hashes of
files which don't exist; and fix the handling of symlinks to
dynamically linked libraries.
2008-04-04 23:22:49 +00:00
Julian Elischer 2a9e49ab2b MFC: ipfw2.c 1.114 ipfw.8 1.209
Use an explicit argument to display table args a IP addresses.
2008-04-04 18:08:51 +00:00
Scott Long fde3a40976 Merge rev 1.20:
Fix a buffer overflow in the processing of various SCSI commands.  This
  likely fixes a great number of weird problems that have been reported
  with this driver.
2008-04-04 16:32:05 +00:00
Craig Rodrigues fda025f8a9 MFC 1.49-1.50:
- do not upgrade a read-only mount to read-write when we fsck it

PR:	120319
2008-04-04 02:20:15 +00:00
Sam Leffler 1f9afa8b65 MFC: WOL infrastructure support 2008-04-03 23:43:25 +00:00
Brooks Davis 617beb5fb8 MFC:
Use the new command file feature of ddb(8) to support setting ddb(4)
scripts at boot.  This is currently disabled by default. /etc/ddb.conf
contains some potentially reasonable default scripts.

PR:		conf/119995
Submitted by:	Scot Hetzel <swhetzel at gmail dot com> (Earlier version)
2008-04-03 21:36:11 +00:00
Brooks Davis f65fe8f28f NFC the ability to read a file of commands to ddb(8) modeled after the
feature in ipfw(8).
2008-04-03 21:33:15 +00:00
John Baldwin fcf80d6da2 MFC: Make it possible to continue working after calling doadump() manually. 2008-04-03 19:40:58 +00:00
John Baldwin fe35b23743 MFC: Fix a nit with the 'nofoo' options where 'foo' is mapped to 'nonofoo'
so that filesystems will consider 'nonofoo' a valid option.
2008-04-03 18:51:13 +00:00
John Baldwin 882ff18654 MFC: Initialize list of kld's correctly when there are no kld's and catch
errors in kgdb_parse() so it returns 0 for invalid expressions.  This
fixes the kld loading for 6.x and 7.x.
2008-04-03 18:47:05 +00:00
Christian Brueffer bfc41c155a MFC: rev. 1.6
ARC-1680 is supported.
2008-04-02 16:53:04 +00:00
Ian Dowse 8c094358e5 MFC 1.113: Add IFF_NEEDSGIANT to IFF_CANTCHANGE to prevent userland
code from clearing IFF_NEEDSGIANT.
2008-04-01 23:40:33 +00:00
Remko Lodder 420eb8aee5 MFC rev 1.212 ata-chipset.c
MFC rev 1.83 ata-pci.h

  Add proper support for the SATA/AHCI part of IXP[67]00

Approved by:	imp (mentor, implicit), sos
2008-04-01 15:20:49 +00:00
Andrew Thompson 5792e1c279 MFC r1.85
Add IFT_BRIDGE to the Ethernet section so l2 addresses are formatted correctly
2008-04-01 15:05:10 +00:00
Alexander Motin 3945739ede MFC rev. 1.6-1.7
- Switch from timeval to bintime, to use 1/(2^20) of seconds instead of
microseconds. It allows to use bit shifts instead of some heavy 64bit
mul/div math operations.
- Account all node stats at the shape mode.
- Do not check destination hook presence, it will be done by netgraph.
- Use u_int instead of int in some places to simplify type conversions.
- Use NG_SEND_DATA_ONLY() macro instead of selfmade equivalent.
2008-04-01 13:58:10 +00:00
Robert Watson 815879d1be Merge ddb.4:1.48 from HEAD to RELENG_7:
Update ddb.4 to reflect addition of /S (symbol name) printing mode for
  examine.

  PR:             57976
2008-04-01 11:50:04 +00:00
Robert Watson 913f0eab9e Merge db_examine.c:1.35 from HEAD to RELENG_7:
Add a /S mode to DDB "ex" command, which interprets and prints the
  value at the requested address as a symbol.  For example, "ex /S
  aio_swake" prints the name of the function currently registered in
  via aio_swake hook.

  The change as committed differs slightly from the patch in the PR,
  as I force the size of the retrieved value (and the automatic
  address increment) to be sizeof(void *).  This seems to provide
  the most useful auto-increment behavior, and defaults using the
  default size (4), which is not sizeof(void *) on 64-bit platforms.

  PR:             57976
  Submitted by:   Dan Strick <strick at covad.net>
2008-04-01 11:48:25 +00:00
Robert Watson 7c64677677 Merge db_textdump.c:1.3 from HEAD to RELENG_7:
Use dump_write() instead of direct calls to di->dumper() in textdumps.
  Textdumps already do pretty much the same sanity checking, but
  abstractions and seatbelts are both useful.
2008-04-01 11:39:04 +00:00
Robert Watson a8f1412e7f Merge db_capture.c:1.5 from HEAD to RELENG_7:
Increase maximum DDB capture buffer size to 5MB.

  PR:             119993
  Suggested by:   Scot Hetzel <swhetzel at gmail dot com>
2008-04-01 11:31:18 +00:00
Robert Watson bfa0ab7973 Merge options:1.616, db_capture.c:1.4 from HEAD to RELNEG_7:
Allow DDB_CAPTURE_DEFAULTBUFSIZE and DDB_CAPTURE_MAXBUFSIZE to be
  overridden at compile-time using kernel options of the same names.

  Rather than doing a compile-time CTASSERT of buffer sizes being
  even multiples of block sizes, just adjust them at boottime, as
  the failure mode is more user-friendly.

  MFC after:      2 months
  PR:             119993
  Suggested by:   Scot Hetzel <swhetzel at gmail dot com>
2008-04-01 11:23:32 +00:00
Rink Springer cdd4c2b0c7 MFC:
Some PS/2 mice (at least the A4Tech X-7xx) need to be set to Intelli mode
  first before they can be set to Explorer mode.

  PR:             kern/118578
  Submitted by:   Andriy Gapon <[email protected]> (I added some comments)
  Reviewed by:    philip
2008-04-01 08:05:30 +00:00
Rink Springer 9039078c77 Add cmx.4 file forgotten in previous cmx(4) MFC.
Noticed by:	brueffer
2008-04-01 07:59:39 +00:00
Rink Springer 0c0bd1eb55 MFC:
Import uslcom(4) from OpenBSD - this is a driver for Silicon Laboratories
  CP2101/CP2102 based USB serial adapters.

  Reviewed by:            imp, emaste
  Obtained from:          OpenBSD
2008-04-01 07:57:48 +00:00
Rink Springer 662bad7f67 MFC:
Commit cmx(4), a driver for Omnikey CardMan 4040 PCMCIA smartcard readers.

  PR:             kern/114582
  Submitted by:   Daniel Roethlisberger <[email protected]>
  Reviewed by:    imp, myself
  Tested by:      johans, myself
2008-04-01 07:36:30 +00:00
cvs2svn 91e4b8856f This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2008-04-01 01:48:09 +00:00
Robert Watson 8373f699c2 Merge db_capture.c:1.3 from HEAD to RELENG_7:
Rename DB_ constants in db_capture.c to DDB_ so that when they are
  exposed as kernel compile options, they have more meaningful names.

  PR:             119993
  MFC after:      2 months
  Suggested by:   Scot Hetzel <swhetzel at gmail dot com>
2008-03-31 22:09:00 +00:00
Robert Watson fa810aef02 Merge db_textdump.c:1.2 from HEAD to RELENG_7:
Refine textdump comments slightly.
2008-03-31 22:05:09 +00:00
Robert Watson b0a3027841 Merge ddb.8:1.2 from HEAD to RELENG_7:
Minor formatting tweaks.

  Point at ddb(4) and textdump(4) man pages for more script examples.
2008-03-31 22:04:27 +00:00
Robert Watson 315c74d88a Merge savecore.8:1.26, savecore.c:1.79 from HEAD to RELENG_7:
Teach savecore(8) how to extract textdump(4) dumps.

  Update savecore(8) man page to reflect textdump additions.

Merge savecore.c:1.80 from HEAD to RELENG_7:

  Compare kernel dump header magic with textdump magic using strncmp()
  rather than the memcmp() which is used for regular dumps: the
  textdump string is one character shorter, so we need to stop
  comparing at the end of the string.

  Use independent version checking logic for architecture-specific
  version number vs. textdump version number, as the version sequences
  may (someday) differ.

  Run into by:    rrs
2008-03-31 22:03:54 +00:00
Robert Watson 98ba785051 Merge ddb.4:1.47, textdump.4:1.2 from HEAD to RELENG_7:
Minor formatting tweaks; recommend "call doadump; reset" over "panic"
  from a script as the DDB panic command is unreliable.
2008-03-31 22:02:28 +00:00
Robert Watson 2e7554953e Merge Makefile:1.401, ddb.4:1.46, textdump.4:1.1 from HEAD to RELENG_7:
Add textdump(4) man page to describe the textdump facility and provide
  some stock formulas for use.

  Update ddb(4) to reference the textdump(4) page, list the textdump
  commands, and suggest using them with scripts and output capture.
  Update HISTORY section.

  Hook up textdump(4) to build.
2008-03-31 22:00:27 +00:00
Robert Watson d164d35c01 Merge files:1.1260, db_capture.c:1.2, db_command.c:1.76,
db_textdump.c:1.1, ddb.h:1.46, kern_shutdown.c:1.187 from HEAD to
RELENG_7:

  Add textdump(4) facility, which provides an alternative form of kernel
  dump using mechanically generated/extracted debugging output rather than
  a simple memory dump.  Current sources of debugging output are:

  - DDB output capture buffer, if there is captured output to save
  - Kernel message buffer
  - Kernel configuration, if included in kernel
  - Kernel version string
  - Panic message

  Textdumps are stored in swap/dump partitions as with regular dumps, but
  are laid out as ustar files in order to allow multiple parts to be stored
  as a stream of sequentially written blocks.  Blocks are written out in
  reverse order, as the size of a textdump isn't known a priori.  As with
  regular dumps, they will be extracted using savecore(8).

  One new DDB(4) command is added, "textdump", which accepts "set",
  "unset", and "status" arguments.  By default, normal kernel dumps are
  generated unless "textdump set" is run in order to schedule a textdump.
  It can be canceled using "textdump unset" to restore generation of a
  normal kernel dump.

  Several sysctls exist to configure aspects of textdumps;
  debug.ddb.textdump.pending can be set to check whether a textdump is
  pending, or set/unset in order to control whether the next kernel dump
  will be a textdump from userspace.

  While textdumps don't have to be generated as a result of a DDB script
  run automatically as part of a kernel panic, this is a particular useful
  way to use them, as instead of generating a complete memory dump, a
  simple transcript of an automated DDB session can be captured using the
  DDB output capture and textdump facilities.  This can be used to
  generate quite brief kernel bug reports rich in debugging information
  but not dependent on kernel symbol tables or precisely synchronized
  source code.  Most textdumps I generate are less than 100k including
  the full message buffer.  Using textdumps with an interactive debugging
  session is also useful, with capture being enabled/disabled in order to
  record some but not all of the DDB session.
2008-03-31 21:57:24 +00:00
Ed Maste 26efbba75f MFC >2TB support
aac.c 1.134, aac_disk.c 1.45, aacreg.h 1.25, aacvar.h 1.51:
  Add 64-bit array support for RAIDs > 2TB.  This corresponds to ~ Adaptec
  driver build 15317.

  Tested on:
  Adaptec 2230S, Firmware 4.2-0 (8205)
  ICP ICP5085BL, Firmware 5.2-0 (12814)

 aac.c 1.136, aac_ioctl.h 1.13:
  Implement FSACTL_LNX_GET_FEATURES and FSACTL_GET_FEATURES ioctls.  RAID
  tools (e.g. arcconf) need this to be able to create arrays larger than 2TB.

  Submitted by: Adaptec, via driver build 15317

The RELENG_7 and HEAD drivers are in sync as of this commit.
2008-03-31 19:21:49 +00:00
Ed Maste 84703c0c9d MFC - diff reduction w/ HEAD
aac.c 1.131:
  Diff reduction to Adaptec driver build 15317 (refactoring and code shuffling):

  - Resource allocation in aac_alloc (moved from from aac_init)
  - Interrupt setup in aac_setup_intr (from aac_attach)
  - Container probing in aac_get_container_info (from aac_startup and
    aac_handle_aif)
  - Firmware status check moved to aac_check_firmware from aac_init

 aac.c 1.132, aac_cam.c 1.31, aad_debug.c 1.24, aac_disk.c 1.44,
 aac_pci.c 1.67, aacvar.h 1.50:
  Diff reduction to Adaptec's driver (around build 15317): catch up with a
  change in debugging routines.

  The fwprintf macro in the AAC_DEBUG case (mapping to printf) isn't from the
  Adaptec driver.

 aac.c 1.135:
  Add \n to the end of a printf string and remove it from panic strings.
2008-03-31 14:32:06 +00:00
Ruslan Ermilov 0c36c61cb6 MFC: 1.44: Fix splitting into words of the .for expression to
allow for spaces in values.
2008-03-31 10:06:12 +00:00
Matteo Riondato 0e3059d128 MFC rev. 1.10 of cryptotest.c and rev. 1.3 of cryptostats.c
Add missing includes and correct argument to sysctlbyname

PR:	misc/120274
2008-03-31 06:49:03 +00:00
Bruce A. Mah 005d6c662a MFC: ddb(4) output capture, ddb(4) scripting, BTX real mode, gptboot,
wpi(4) fixes, hptrr(4) 1.2 update, chflags(1) -v, realpath(1) -q,
tzdata2008b, GNOME 2.22.
2008-03-31 05:12:35 +00:00
Matteo Riondato e86d3565be MFC rev. 1.6
Fix incorrect handling of malloc failures

PR:		bin/83369
2008-03-30 19:57:23 +00:00
Matteo Riondato b8c6fb47f8 MFC rev. 1.97-1.98
Fix printing of unionfs mounts when using the -p option
Fix mount -p and mount -u -ocurrent on gjournaled FS

PR: bin/75585, bin/120162
2008-03-30 19:42:34 +00:00
Matteo Riondato 7a2114d5a0 Add -P <port> option to allow binding to a specific port.
PR:		bin/109494
Submitted by:	mtm
2008-03-30 19:39:29 +00:00
Robert Watson 6b4120554e Merge bpf_filter.c:1.30 from HEAD to RELENG_7:
Improve convergence of bpf_filter.c toward style(9).

  Submitted by:   csjp
2008-03-30 17:55:18 +00:00
Robert Watson 8bf9fac8a7 Merge kerneldump.h:1.10 from HEAD to RELENG_7:
Define a new kernel dump "architecture", TEXTDUMPMAGIC, which is used
  to identify textdumps in the swap/dump partition.  While textdumps
  aren't really an architecture, they are architecture-neutral and so
  don't really correspond to any existing architecture.

  Define a version number for textdumps, KERNELDUMP_TEXT_VERSION, of 1.
2008-03-30 17:20:40 +00:00
Robert Watson 24fc5aed28 Merge kerneldump.h:1.9 from HEAD to RELENG_7:
Minor style consistency improvements.
2008-03-30 17:20:04 +00:00
Robert Watson 74c43d1b1c Merge ddb.4:1.45 from HEAD to RELENG_7:
Add SCRIPTING section to describe new DDB scripting facilities.

  Update copyright.
2008-03-30 17:10:35 +00:00
Robert Watson b0c63e355a Merge ddb.4:1.44 from HEAD to RELENG_7:
Add description of 'debug.ddb.capture.data' sysctl to DBD output
  capture section, missed in previous commit.
2008-03-30 17:09:34 +00:00
Robert Watson 26169f2cc7 Merge Makefile:1.169, ddb/Makefile:1.1, ddb.8:1.1, ddb.c:1.1,
ddb.h:1.1, ddb_script.c:1.1 from HEAD to RELENG_7:

  Add command-line tool ddb(8), which allows DDB(4) scripts to be
  managed from userspace.  It is largely a wrapper for sysctl()
  calls, but because the sysctls for adding and removing scripts
  are awkward to use directly, this provides an easier-to-use
  interface.
2008-03-30 17:07:10 +00:00
Robert Watson 5a751b50e6 Merge files:1.1259, db_command.c:1.75, db_command.h:1.14, db_lex.c:1.23,
db_lex.h:1.15, db_main.c:1.7, db_script.c:1.1-1.2, ddb.h:1.45 from HEAD
to RELENG_7:

  Add a simple scripting facility to DDB(4), allowing the user to
  define a set of named scripts.  Each script consists of a list of DDB
  commands separated by ";"s that will be executed verbatim.  No higher
  level language constructs, such as branching, are provided for:
  scripts are executed by sequentially injecting commands into the DDB
  input buffer.

  Four new commands are present in DDB: "run" to run a specific script,
  "script" to define or print a script, "scripts" to list currently
  defined scripts, and "unscript" to delete a script, modeled on shell
  alias commands.  Scripts may also be manipulated using sysctls in the
  debug.ddb.scripting MIB space, although users will prefer to use the
  soon-to-be-added ddb(8) tool for usability reasons.

  Scripts with certain names are automatically executed on various DDB
  events, such as entering the debugger via a panic, a witness error,
  watchdog, breakpoint, sysctl, serial break, etc, allowing customized
  handling.

  Remove duplicate $FreeBSD$ that snuck in.
2008-03-30 17:03:58 +00:00
Doug Rabson ee5227ed47 MFC: nfs_srvsock.c rev. 1.106, 1.107
Don't call nfs_realign while holding locks.
2008-03-30 14:06:43 +00:00
Antoine Brodin 74955f7f00 MFC to RELENG_7:
Add files to remove when MK_GCOV, MK_IPX or MK_NCP are defined.

  PR:             120492
  PR:             121118
  PR:             121121
  Submitted by:   KAMIYA Satosi, Richard Tector
  Approved by:    rwatson (mentor)
  MFC after:      1 month
2008-03-30 13:56:13 +00:00
Robert Watson 9dac471e82 Bump __FreeBSD_version in RELENG_7 to 700102 to reflect the
addition of kdb_enter_why().
2008-03-30 09:20:13 +00:00
Robert Watson 4e9e34aa8b Merge amd64/machdep.c:1.680, amd64/mp_watchdog.c:1.6,
uart_dev_at91usart.c:1.13, scsi_low.h:1.9, subr_ntoskrnl.c:1.94,
OsdDebug.c:1.14, dcons_os.c:1.20, ofw_consle.c:1.37,
dev/sio.c:1.473, syscons.c:1.454, uart_core.c:1.23,
union_subr.c:1.96, i386/machdep.c:1.664, i386/mp_watchdog.c:1.6,
ia64/machdep.c:1.228, kern_clock.c:1.206, kern_shutdown.c:1.186,
subr_kdb.c:1.25, subr_witness.c:1.239, vfs_subr.c:1.711,
ng_base.c:1.140, cbus/sio.c:1.247, pc98/machdep.c:1.399,
aim/machdep.c:1.107, pswitch.c:1.7, mac_test.c:19.3,
psycho.c:1.73, sparc64/machdep.c:1.140, sparc64/trap.c:1.89,
hvcons.c:1.7, sun4v/machdep.c:1.17, sun4v/trap.c:1.17, kdb.h:1.6
from HEAD to RELENG_7:

  Add a new 'why' argument to kdb_enter(), and a set of constants to use
  for that argument.  This will allow DDB to detect the broad category of
  reason why the debugger has been entered, which it can use for the
  purposes of deciding which DDB script to run.

  Assign approximate why values to all current consumers of the
  kdb_enter() interface.

For ABI/KPI reasons, the MFC creates a new function, kdb_enter_why(),
with the new argument, updating existing consumers to use that,
preserving kdb_enter() with the current argument, and wrapping it around
kdb_enter_why().
2008-03-30 09:19:09 +00:00
Alexander Motin eb03c1a8c1 MFC ng_pptpgre.c rev. 1.41-1.42
Rewrite node to support multiple hooks, alike to ng_l2tp, to use one pair
of pptpgre and ksocket nodes for all calls between two peers. This patch
modifies node's API by adding new "session_%04x" hook names support, while
keeping backward compatibility.
2008-03-30 08:01:48 +00:00
Konstantin Belousov ff3f200beb MFC
rev. 1.607 of sys/amd64/amd64/pmap.c
rev. 1.609 of sys/i386/i386/pmap.c

Prevent the overflow in the calculation of the next page directory.
2008-03-30 05:39:24 +00:00
Christian S.J. Peron 382d82d846 Un-break the build by adding a thread argument. This was removed in
-CURRENT but this change has not been MFCed yet.

Submitted by:	attilo
2008-03-30 02:19:27 +00:00
Attilio Rao 6e29981a68 MFC rev. 1.45:
Fix a lock leak in the NTFS locking scheme.
2008-03-29 23:15:04 +00:00
Attilio Rao c906fdd44a MFC rev. 1.21:
Drop Giant lock before to destroy the kthread.
2008-03-29 23:00:29 +00:00
John Birrell d3bad4d960 MFC
stdio.h: 1.61
Allow an application to define FOPEN_MAX (like we allow for OPEN_MAX
in sys/syslimits.h).

awk/Makefile: 1.17
Allow awk to handle 64 files instead of just 20.
2008-03-29 22:53:54 +00:00
Bjoern A. Zeeb 3d545ef731 MFC: rev. 1.32 key.c
Fix a bug that when getting/dumping the soft lifetime we reported
  the hard lifetime instead.
2008-03-29 20:51:09 +00:00
Bjoern A. Zeeb 1479ff7c2d MFC: rev. 1.31 key.c
Import change from KAME, rev. 1.362 kame/kame/sys/netkey/key.c

  In case of "new SA", we must check the hard lifetime of the old SA
  to find out if it is not permanent and we can delete it.
2008-03-29 20:48:47 +00:00
Remko Lodder f8e184cda4 MFC rev 1.134 ObsoleteFiles.inc
Document the removal data for usbdevs.h and usbdevs_data.h,
  sort the entry into it's correct place (behind 200407XX before
  200406XX because we have an explicit date here).

  PR:             misc/122098
  Submitted by:   "John Hein" <[email protected]>
  MFC after:      3 days

Approved by:	imp (mentor, implicit)
2008-03-29 13:53:07 +00:00
Remko Lodder d709be850e MFC rev 1.84 route.c
In route.c in newroute() there's a call to exit(0) if the command was
  'get'. Since rtmsg() always gets called and returns 0 on success and -1
  on failure, it's possible to exit with a suitable exit code by calling
  exit(ret != 0) instead, as is done at the end of newroute().

  PR:		bin/112303
  Submitted by:	[email protected]
  MFC after:	1 week

Approved by:	imp (mentor, implicit)
2008-03-29 13:44:36 +00:00
Remko Lodder a11dfd24cd MFC rev 1.2 410.logincheck
Add a missing ;.

  PR:             misc/122069
  Submitted by:   [email protected]
  MFC after:      3 days
  Approved by:    imp (mentor, implicit trivial change).

Approved by:	imp (mentor, implicit)
2008-03-28 20:59:45 +00:00
Ed Maste e69a5c36da MFC aac.c r1.133:
Correct data direction flags in aac_bio_command() in the
  !AAC_FLAGS_RAW_IO && AAC_FLAGS_SG_64BIT case.

  Submitted by:   Adaptec
2008-03-28 18:13:38 +00:00
Roman Divacky 2aad8c90ba MFC rev. 1.12 of sys/compat/linux/linux_futex.c
MFC rev. 1.3 of sys/compat/linux/linux_futex.h:

	o	Add stub support for some new futex operations,
		so the annoying message is not printed.

	o	Don't warn about FUTEX_FD not being implemented
		and return ENOSYS instead of 0 (eg. success).

	o	Clear FUTEX_PRIVATE_FLAG as we actually implement
		only private futexes so there is no reason to
		return ENOSYS when app asks for a private futex.
		We don't reject shared futexes because they worked
		just fine with our implementation so far.

Approved by:	kib (mentor)
Tested by:	bsam
2008-03-28 10:13:20 +00:00
Ed Maste e03ecab13b MFC
aac.c r1.129 aac_ioctl.h r1.12:

  Add ioctls FSACTL_SEND_LARGE_FIB, FSACTL_SEND_RAW_SRB,
  FSACTL_LNX_SEND_LARGE_FIB, and FSACTL_LNX_SEND_RAW_SRB, and correct size
  checks on FIBs passed in from userspace.  Both changes were obtained from
  Adaptec's driver build 15317.  Adaptec's commandline RAID tool arcconf uses
  these ioctls when creating a RAID-10 array (and probably other operations
  too).

 aac.c r1.130:

  Restore creation of passthrough devices with newer controller firmware by
  putting the correct size in the fib header.  Presumably the older firmware
  silently ignored a bad size field.

  (This change tested with a 3805 controller.  Passthrough devices were
  created when running firmware build 12814, but not 15323 or later.  With
  this change they're created for both old and new firmware versions.)

  Submitted by:   Adaptec
2008-03-27 17:11:38 +00:00
Coleman Kane ade7d7cd01 MFC:
MFC of rev 1.40 to properly add the module dependency on mem, so that it will
be loaded on-demand with this module.

Approved by:	imp
2008-03-27 15:54:45 +00:00
Konstantin Belousov 51c41dd426 MFC
rev. 1.682 of sys/amd64/amd64/machdep.c
rev. 1.16  of sys/amd64/ia32/ia32_signal.c
rev. 1.33  of sys/amd64/linux32/linux32_sysvec.c
rev. 1.666 of sys/i386/i386/machdep.c
rev. 1.152 of sys/i386/linux/linux_sysvec.c
rev. 1.39  of sys/i386/svr4/svr4_machdep.c
rev. 1.402 of sys/pc98/pc98/machdep.c

Modify the signal handler frame setup code to clear the DF {e,r}flags
bit on the amd64/i386 for the signal handlers.
2008-03-27 13:46:27 +00:00
Ed Maste f23825afa8 MFC aac.c r1.127
Avoid holding the aac_io_lock over copyout.

  Submitted by: Achim Leubner @ Adaptec.
2008-03-26 16:53:27 +00:00
Ulf Lilleengen cf3a506f69 MFC Revision 1.27
- Fix a memory leak when re-discovering a gvinum configuration.

Approved by:	pjd (mentor)
2008-03-26 16:28:50 +00:00
Ed Maste 935165d913 MFC aac.c r1.126:
Do not recursively acquire aac_io_lock in aac_ioctl_event.
2008-03-26 15:09:15 +00:00
Ed Maste 2b30804f48 MFC aac.c r1.128:
Change spelling and eliminate a typo in comments to reduce diffs with
  Adaptec's vendor driver.
2008-03-26 14:22:22 +00:00
Hajimu UMEMOTO f01c6f2abc MFC 1.31: Change .8s port name restriction to .15s.
This change corresponds to inet.c 1.13.
2008-03-25 13:14:29 +00:00
Edwin Groothuis de4e759577 MFC of tzdata2008b
Approved by:	grog@ (mentor)
2008-03-25 03:43:19 +00:00
Robert Watson eaf1c418b4 Merge ddb.4:1.43 from HEAD to RELENG_7:
Document DDB capture facility.
2008-03-24 21:25:08 +00:00
Robert Watson 93284e00e6 Merge files:1.1258, db_capture.c:1.1, db_command.c:1.74, db_input.c:1.37,
db_main.c:1.6, db_output.c:1.38, ddb.h:1.44 from HEAD to RELENG_7:

  Add a new DDB(4) facility, output capture.  Input and output from DDB
  may be captured to a memory buffer for later inspection using sysctl(8),
  or in the future, to a textdump.

  A new DDB command, "capture", is added, which accepts arguments "on",
  "off", "reset", and "status".

  A new DDB sysctl tree, debug.ddb.capture, is added, which can be used to
  resize the capture buffer and extract buffer contents.
2008-03-24 21:24:10 +00:00
Robert Watson f8ea2a5cf2 Merge kernel.h:1.138 from HEAD to RELENG_7:
Add a new kernel startup event for DDB services, which will include DDB
  output capture, scripting, and textdumps.
2008-03-24 21:15:24 +00:00
Jung-uk Kim 4a6d4d3fcb MFC: 1.26
Update list of possible mixer devices.
2008-03-24 17:50:24 +00:00
Jung-uk Kim 9ab38fad6d MFC: 1.24-1.26
- Check device masks and bypass printing headers if capable device does
not exist.  /etc/rc.d/mixer tried to restore non-existent recording
source because /var/var/db/mixer*-state contains '=rec' for example.
- Remove hardcoded mixer2 and mixer3 and do the right thing.
- Replace getopt(3) with hand-rolled option parser.  It was not able
to handle 'mixer -rec mic' although it is a valid command.
- Make '-s' and '-S' mutualy exclusive as mixer(8) says.
- Do not re-read recording source unless it has been modified.
- Clean up code and fix style(9) nits.
2008-03-24 17:49:34 +00:00
Jung-uk Kim 18de6ffdff MFC: 1.80-1.83
Prefer clock_gettime(2) over gettimeofday(2) and use CLOCK_MONOTONIC_FAST.
It is only used to track elapsed time and it does not have to be precise.
Fix compiler warnings and style(9) bugs.
2008-03-24 17:16:25 +00:00
Maksim Yevmenkin f9cb6d3dd2 MFC:
Separate SDP parameters data structures for the BNEP based profiles.

Generalize Service Availability SDP parameter creation.

Add mandatory "security description" SDP parameter to the PANU profile

Pointed-out by:	Iain Hibbert < plunky at rya-online dot net >
2008-03-24 16:25:26 +00:00
Antoine Brodin c6303b71ea MFC to RELENG_7:
Make sysctl_kern_arnd return a random buffer instead of a random long,
  as it is expected by userland (stack protector guard setup for example).

  PR:             119129
  Approved by:    rwatson (mentor)
  MFC after:      1 month
2008-03-24 14:28:33 +00:00
Konstantin Belousov ecd6b4c11d MFC
rev. 1.24 of sys/fs/devfs/devfs_rule.c
rev 1.218 of sys/vm/vm_mmap.c

Do not dereference cdev->si_cdevsw, use the dev_refthread() to properly
obtain the reference.
2008-03-24 13:12:43 +00:00
Konstantin Belousov 751270bf6e MFC
rev. 1.210 of sys/kern/kern_conf.c
rev. 1.236 of sys/sys/conf.h

Fix two races in the handling of the d_gianttrick for the D_NEEDGIANT
drivers.

Do not free the memory allocated for the gianttrick cdevsw while holding
the dev_mtx.
2008-03-24 13:09:55 +00:00
Remko Lodder d1525a61ad MFC rev 1.73 newfs.8
Replace reference from vinum.8 to gvinum.8, it was advised in the PR to
  replace this with vinum.4, but that's the kernel interface manual, which
  is not appropriate in my understanding.  I think that gvinum is a suitable
  replacement for this.

  PR:             docs/121938
  Submitted by:   "Federico" <federicogalvezdurand at yahoo dot com>
  MFC after:      3 days
2008-03-24 10:46:00 +00:00
Remko Lodder e92423ab78 MFC rev 1.9 drm_pciids.h
MFC rev 1.7 i915_dma.c

  Add the i915 GME device to DRM.

  PR:             kern/121808
  Submitted by:   Volker Werth <volker at vwsoft dot com>
  Approved by:    imp (mentor, implicit for trivial changes)
  MFC after:      3 days

Approved by:	imp (mentor, implicit)
2008-03-24 10:43:41 +00:00
Remko Lodder 908ccf6ad6 MFC rev 1.9 tinybsd
Alert properly when we have stale mounts left after interupting
  a tinybsd build.  If we do not do this, we can accidentally remove
  critical files from directories like /lib (if mounted).

  PR:             misc/121763
  Submitted by:   Richard Arends < richard at unixguru dot nl >
  MFC after:      3 days

Approved by:	imp (mentor, implicit)
2008-03-24 10:39:34 +00:00
Konstantin Belousov c4f659edca MFC rev. 1.292:
Fix the leak of the vmspace on the fork when the process limits
are exceeded.
2008-03-23 06:52:01 +00:00
David Xu 119fb3173c MFC:
Add manual for sem_timedwait().
2008-03-23 02:17:13 +00:00
David Xu 0739ddcdd4 MFC Revision 1.6:
> Use macro THR_CLEANUP_PUSH/POP.
2008-03-23 02:10:44 +00:00
Kris Kennaway eb8431b52c MFC: Repair handling of X11BASE and LOCALBASE 2008-03-22 15:13:26 +00:00
Doug Rabson c43fd8b1fc MFC:
lockd.c 1.21, 1.22
	rpc.lockd.8 1.18

	Add the "-h <bindip>" option.
2008-03-22 12:05:35 +00:00
Robert Watson b0a0833f3f Merge in_pcb.c:1.200 from HEAD to RELENG_7:
Fix indentation for a closing brace in in_pcballoc().
2008-03-22 08:55:23 +00:00
Bjoern A. Zeeb 8569b3d963 MFC: rev. 1.9 ip_ipsec.c, 1.117 ip6_output.c, 1.18 ipsec_output.c
Correct IPsec behaviour with a 'use' level in SP but no SA available.
  In that case return an continue processing the packet without IPsec.

  PR:             121384
  Reported by:    Cyrus Rahman (crahman gmail.com)
  Tested by:      Cyrus Rahman (crahman gmail.com) [slightly older version]
2008-03-21 23:22:07 +00:00
Bjoern A. Zeeb 81c3c1d05a MFC: rev. 1.30 key.c
Remove the "Fast " from the
  "Fast IPsec: Initialized Security Association Processing." printf.
  People kept asking questions about this after the IPsec shuffle.

  This still is the Fast IPsec implementation so no worries that it would
  be any slower now. There are no functional changes.
2008-03-21 23:15:01 +00:00
Bjoern A. Zeeb f16c90c9fc MFC: rev. 1.9 ip6_ipsec.c, 1.116 ip6_output.c
Correct reference counting on the SP for outgoing IPv6 IPsec connections.

  PR:             121374
  Reported by:    Cyrus Rahman (crahman gmail.com)
  Tested by:      Cyrus Rahman (crahman gmail.com)
2008-03-21 23:08:36 +00:00
Bjoern A. Zeeb 3b979a31b3 MFC: rev. 1.8 ip6_ipsec.c, 1.4 ip6_ipsec.h
#if 0 out a currently unsued (and incomplete) function: ip6_ipsec_mtu().
  No need to compile 'dead' code.
  I am leaving it in because we will have to review the concept and
  should use the common function in various places.
2008-03-21 23:03:32 +00:00
Bjoern A. Zeeb 05be4eed72 MFC: rev. 1.115 ip6_output.c
Replace the function name in two identical printfs
  by __func__, __LINE__ so we can distinguish them
  when people report a problem.
2008-03-21 23:00:13 +00:00
John Baldwin 375ecb6766 MFC: Use the SMAP data from the loader if it is provided. 2008-03-21 15:40:33 +00:00
John Baldwin bf8aa432b6 MFC: Add constants for the different memory types in the SMAP table and
use the SMAP types and constants from <machine/pc/bios.h> in the boot code.
2008-03-21 15:34:39 +00:00
John Baldwin ea431e2fb7 MFC: Fix bug that prevented all CPUs that were marked as interrupt
receivers from being used in certain cases.
2008-03-21 15:23:24 +00:00
Shteryana Shopova 3e18d28529 MFC:
src/contrib/bsnmp/snmpd/main.c: Revision 1.1.1.14

Vendor patch: Prevent bsnmpd from dumping core when a module's init hook
returns an error.

Approved by:	bz (mentor)
2008-03-21 13:21:08 +00:00
Remko Lodder 0e6015360a MFC rev 1.45 agp_i810.c
Add resume support to the agp_i810 family.

  Submitted by:   "Robert Noland" <rnoland at 2hip dot net>
  Reviewed by:    anholt
  Approved by:    anholt, imp (mentor)
  MFC after:      1 week

Approved by:	imp (mentor)
2008-03-20 21:13:14 +00:00
John Baldwin 145571105a MFC: Restore the original hid_is_collection() test and fallback to testing
the interface class, subclass, and protocol if that fails.
2008-03-20 13:07:25 +00:00
Edwin Groothuis 54a170b3a3 MFC of 1.48
Add projects-all collection to cvs-supfile

PR:		misc/121680
Submitted by:	"Philip M. Gollucci" <[email protected]>
2008-03-20 11:27:15 +00:00
Mike Makonnen 352b89c492 MFC:
The check for errors from the mount command did not work as
	intended because another command (echo) is executed between
	the mount command and the check.

	Reported by: Sergey Baturov <[email protected]>
2008-03-20 10:53:18 +00:00
Christian Brueffer aba9f8616b MFC:
Use a standard section 4 SYNOPSIS.
2008-03-20 08:59:04 +00:00
Christian Brueffer cd4be1af07 MFC: rev. 1.4 + 1.5
Correct bpf data-link type.
2008-03-20 08:34:24 +00:00
Christian Brueffer c4b517e391 MFC: rev. 1.23
Device counts are long gone.
2008-03-20 08:15:03 +00:00
Christian Brueffer 250af5a668 MFC: rev. 1.18
Fix AUTHORS formatting.
2008-03-20 08:11:24 +00:00
Christian Brueffer 76be87ac8a MFC: rev. 1.29
Device counts are long gone, also remove the outdated FILES section.
2008-03-20 08:09:07 +00:00
Christian Brueffer b505d64c37 MFC: rev. 1.62
In the description of the password field, -w was meant, not the
nonexistant -p flag.
2008-03-20 08:04:48 +00:00
John Baldwin ec07bc247a MFC: Relax the BIOS/OS sempahore handoff code to workaround different hard
hangs on boot and shutdown.
2008-03-19 16:39:07 +00:00
John Baldwin 71a4aca818 MFC: Use a runtime mask for the PhysBase and PhysMask fields in variable
sized MTRR registers.
2008-03-19 16:37:24 +00:00
John Baldwin d4ac4eef01 MFC: Break up the logic in the mem_drvinit routines. 2008-03-19 16:33:58 +00:00
John Baldwin c50e210b35 MFC: Minimize diffs with i686_mem.c. 2008-03-19 16:31:32 +00:00
John Baldwin aab8d541d1 MFC: Add constants for the various fields in MTRR registers and apply
style(9).  No functional changes.
2008-03-19 16:29:07 +00:00
Paolo Pisati fd4a5aedfd MFC: explicitate newpacket size.
Bug pointed out by: many
Pointy hat to: me :(
2008-03-19 11:29:26 +00:00
Paolo Pisati 9756e83908 Fix printf args. 2008-03-18 23:32:45 +00:00
Andrew Thompson 3a8ae56255 MFC if_wpi.c r1.9-10, if_wpireg.h r1.3, if_wpivar.h r1.2
Update wpi(4) with stability fixes
- remove second taskqueue
- busdma 16k alignment workaround
- use busdma instead of external mbuf storage on Rx
- locking fixes
- net80211 state change fixes
- improve scanning reliability
- improve radio hw switch interaction
- consolidate callouts
2008-03-18 18:52:52 +00:00
John Baldwin ed48e4f27b MFC: Use real mode to invoke BIOS routines rather than virtual 86 mode. 2008-03-18 17:43:36 +00:00
Alexander Motin dbecd09200 MFC rev. 1.25
Add session ID hashing to speedup incoming packets dispatch in case
of many connections working via the same tunnel. For example, in case
of full "client <-> LAC <-> LNS" setup.
2008-03-18 17:33:03 +00:00
Paolo Pisati bb5f4493de MFC:
-Move ipfw's nat code into its own kld: ipfw_nat.
-Raise a bit ipfw kld priority to avoid race on ipfw_nat load.
2008-03-18 17:32:10 +00:00
Ruslan Ermilov 8084ff20c9 MFC: Fix panic on e.g. "kldload /dev/null".
PR:		kern/121427
2008-03-18 11:49:11 +00:00
Robert Watson e919f9ea34 Merge ffs_vfsops.c:1.337 from HEAD to RELENG_7:
Move setting of MNTK_MPSAFE flag before UFS1 extended attribute
  auto-start so that the flag is set before we start performing I/O
  in the auto-start routine.

  Suggested by:   kib
2008-03-18 11:45:30 +00:00
Robert Watson f7159c9e89 Merge TODO:1.5, cnode.h:1.29, coda_kernel.h:1.8, coda_psdev.c:1.48 from
HEAD to RELENG_7:

  Remove custom queue macros in Coda, replacing them with queue(9) tailq
  macros.  The only semantic change was the need to add a vc_opened field
  to struct vcomm since we can no longer use the request queue returning
  to an uninitialized state to hold whether or not the device is open.
2008-03-18 11:40:49 +00:00
Robert Watson b357228c42 Merge TODO:1.4 from HEAD to RELENG_7:
Remove namecache performance-tuning todo for Coda: we now use the FreeBSD
  name cache.
2008-03-18 11:37:57 +00:00
Pyun YongHyeon a579bf9dbe MFC if_bfe.c rev 1.44, if_bfereg.h rev 1.11 to RELENG_7:
Fix link state handling in bfe(4).
   o conversion to callout(9) API.
   o add a missing driver lock in bfe_ifmedia_sts().
   o use our callout to drive watchdog timer.
   o restart Tx routine if pending queued packets are present in
     watchdog handler.
   o unarm watchdog timer only if there are no queued packets.
   o don't blindly reset phy and let phy driver handle link change
     request in bfe_init_locked().
   o return the status of mii_mediachg() to caller in
     bfe_ifmedia_upd(). Previously it always returned 0 to caller.
   o add check for IFF_DRV_RUNNING flag as well as IFF_DRV_OACTIVE
     in bfe_start_locked().
   o implement miibus_statchg method that keeps track of current
     link state changes as well as negotiated speed/duplex/
     flow-control configuration.
     Reprogram MAC to appropriate duplex state. Flow-control
     configuration was also implemented but commented out at the
     moment. The flow-control configuration will be enabled again
     after we have general flow-control framework in mii layer.
2008-03-18 02:11:40 +00:00
Pyun YongHyeon 7cccb8782d MFC if_lge.c rev 1.53 to RELENG_7:
Plug memory leak in jumbo buffer allocation failure path.
  Patch in the PR was modified to check active jumbo buffers in use
  and other possible jumbo buffer leak.

  Jumbo buffer usage in lge(4) still wouldn't be reliable due to lack
  of driver lock in local jumbo buffer allocator. Either introduce
  a new lock to protect jumbo buffer or switch to UMA backed page
  allocator for jumbo frame is required.

  PR:     kern/78072
2008-03-18 01:53:46 +00:00
Pyun YongHyeon a0f9e56724 MFC: if_msk.c 1.30, if_msk.c 1.31 to RELENG_7
To overcome hardware checksum offload bug msk(4) used to compute
  TCP/UDP checksum in driver for short frames. For frames that requires
  hardware VLAN tag insertion, the checksum offload trick does not
  work due to changes of checksum offset in mbuf after the VLAN tag.

  Disable hardware checksum offload for VLAN interface to fix the bug.
2008-03-18 01:31:37 +00:00
Pyun YongHyeon fb3c1c34e1 MFC: if_msk.c 1.29, if_mskreg.h 1.12 to RELENG_7
Workaround GMAC hardware hang of Yukon II on the receipt of pause
  frames. This bug seems to happen on certain hardware model/revision
  (e.g. 88E8053) but it's not identified which hardwares are affected.
  Revision 1.4 of if_mskreg.h was not enough to workaround the bug.
  To workaround it, inrease GMAC FIFO threshold by one FIFO word to
  flush received pause frames.
2008-03-18 01:01:18 +00:00
Pyun YongHyeon 743c5088cb MFC: if_npe.c 1.8, if_gem.c 1.47, if_msk.c 1.27, if_nfe.c 1.25, if_wpi.c 1.6
- Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and
    re_defrag() and use m_collapse() instead.
  - Replace a reference to ath_defrag() in a comment in if_wpi.c with
    m_collapse().
2008-03-18 00:42:26 +00:00
Maksim Yevmenkin 1e2d97f878 MFC:
Add support for the NAP, GN and PANU profiles to the sdpd(8).
It should be mentioned that a somewhat similar patch was
submitted by Rako < rako29 at gmail dot com >
2008-03-18 00:29:26 +00:00
Maksim Yevmenkin ddf4254027 MFC:
Add structures to hold SDP parameters for the NAP, GN and PANU profiles.
It should be mentioned that a somewhat similar patch was submitted by
Rako < rako29 at gmail dot com >
2008-03-18 00:26:01 +00:00
Paolo Pisati ae0e7801f6 MFC revision 1.182:
Don't cache ptr to nat rule in case of tablearg argument.

Bug spotted by: Dyadchenko Mihail
2008-03-17 23:08:42 +00:00
Paolo Pisati 1850889ba8 MFC revision 1.25:
Don't abuse stack space while in kernel land, use heap instead.

PR:	kern/121693
2008-03-17 22:16:19 +00:00
Marius Strobl 86e1f6668a MFC: 1.46
- Fix some style bugs.
- Replace hard-coded functions names missed in rev. 1.44 with __func__.
2008-03-17 20:53:22 +00:00
Marius Strobl 1bc737ccdd MFC: if_gem.c 1.46; if_gem_pci.c 1.24; if_gemreg.h 1.6; if_gemvar.h 1.16
o In preparation for basing a new driver on this one:
  - ANSIfy
  - try to bring closer to style(9)
  - remove banal comments.
o Add my copyright for having done lots of fixes and improvements.
2008-03-17 20:52:10 +00:00
Rui Paulo 87be4268b6 MFC r1.71:
Some PIIX4 chipsets need to be told to generate Stop Breaks by
 setting
 the appropriate bit in the DEVACTB register.
 This change allows the C2 state on those systems to work as expected.

 Reviewed by:    njl
 Submitted by:   Andriy Gapon <avg at icyb.net.ua>
2008-03-17 19:57:21 +00:00
Antoine Brodin 7cda691772 MFC to RELENG_7
- Make Disk_Names() behave as documented in libdisk(3): return an array
  of disk names, where you must free each pointer, as well as the array
  by hand. [1]
  - Destaticize "disks" in Disk_Names, it has no reasons to be static.

  PR:             kern/96077 [1]
  PR:             kern/114110 [1]
  MFC after:      1 month
  Approved by:    rwatson (mentor)
2008-03-17 19:05:36 +00:00
Antoine Brodin f6e893d83f MFC to RELENG_7
Remove a superfluous line in run_interrupt_driven_config_hooks(),
  next_entry is already initialized during TAILQ_FOREACH_SAFE().

  PR:             kern/119604
  Approved by:    rwatson (mentor)
  MFC after:      1 month
2008-03-17 18:57:07 +00:00
John Baldwin b74352a500 MFC: Use cpu_feature2 and don't free anything in detach. 2008-03-17 18:31:06 +00:00
John Baldwin 2265ff9cc8 MFC: Calculate the number of pages the GATT spans instead of assuming it
always spans 33 pages.
2008-03-17 18:27:23 +00:00
John Baldwin 70dbc27450 MFC: Add support for the BCM5722. 2008-03-17 18:24:04 +00:00
John Baldwin d6274900b2 MFC: Force an explicit dependency on opt_global.h for all module object
files.
2008-03-17 18:12:13 +00:00
John Baldwin 28127e8830 MFC: Add a 'c7' CPUTYPE for VIA C7 CPUs. 2008-03-17 18:08:45 +00:00
John Baldwin 062c8415a8 MFC: Display the correct /boot.config file contents after parsing it. 2008-03-17 18:04:59 +00:00
John Baldwin 56d52ba2f2 MFC: Fail attempts to use file descriptors larger than SHRT_MAX. 2008-03-17 17:42:26 +00:00
John Baldwin 5030ef894b MFC: Remove the 'needbounce' variable from _bus_dmamap_load_buffer(). 2008-03-17 17:28:21 +00:00
Marcel Moolenaar f46165324b Sync gpart with HEAD:
o  Add support for BSD disklabels (option GEOM_PART_BSD)
o  Add support for VTOC8 disklabels (option GEOM_PART_VTOC8)
o  Avoid false positives detecting MBRs
2008-03-16 22:51:29 +00:00
Alexander Motin 8e7a9b0770 MFC:
Improve apply callback error reporting:
Before this patch callback returned result of the last finished call chain.
Now it returns last nonzero result from all call chain results in this request.

As soon as this improvement gives reliable error reporting, it is now possible
to remove dirty workaround in ng_socket, made to return ENOBUFS error statuses
of request-response operations. That workaround was responsible for returning
ENOBUFS errors to completely unrelated requests working at the same time
on socket.
2008-03-16 22:06:07 +00:00
Konstantin Belousov c3e91cfff1 MFC rev. 1.186:
Don't check the bpbSecPerTrack and bpbHeads fields of the BPB.

Approved by:	marcel
2008-03-16 19:55:16 +00:00
Robert Watson c90b52583f Merge realpath.1:1.11, realpath.c:1.7 from HEAD to RELENG_7:
Enhance realpath(1) in a number of ways:

  - Allow realpath to accept multiple paths on the command line.
  - Add -q to suppress warnings if some paths can't be processed, and use
    getopt(3) to process flags.
  - Print the path being requested rather than a possibly partially
    processed path when a failure occurs so that you can tell which of
    several passed paths did fail.

  PR:             112920
  Submitted by:   Ighighi <[email protected]>
2008-03-16 18:55:56 +00:00
Robert Watson d2d4d4aa08 Merge chflags.1:1.30, chflags.c:1.24 from HEAD to RELENG_7:
Make chflags(1) more chmod(1)-like (and more feature complete):

  - Add -v to print file names as they are processed; -vv prints the flags
    change as well.
  - Add -f to ignore failures with the same semantics as chflags(1), neither
    printing an error nor affecting the return code.
  - Don't try to set the flags if they won't change.

  I made minor cosmetic tweaks to the code in the patch.

  PR:             112827
  Submitted by:   Ighighi <ighighi at gmail.com>
2008-03-16 18:54:53 +00:00
Robert Watson 2d02dc7b18 Merge gzip.c:1.5 from HEAD to RELENG_7:
When gzipping to a target file, only set the source file flags on the
  target file after the timestamp has been set; otherwise setting the
  timestamp will fail if the flags don't permit it (i.e., uchg).

  PR:             120208
  Submitted by:   Ighighi <ighighi at gmail.com>
2008-03-16 18:53:17 +00:00
Robert Watson a61f3acc9a Merge ufs_extattr.c:1.90 from HEAD to RELENG_7:
Don't auto-start or allow extattrctl for UFS2 file systems, as UFS2 has
  native extended attributes.  This didn't interfere with the operation of
  UFS2 extended attributes, but the code shouldn't be running for UFS2.
2008-03-16 18:52:19 +00:00
Robert Watson a068c7f202 Merge coda_psdev.c:1.47 from HEAD to RELENG_7:
The possibly interruptible msleep in coda_call() means well, but is
  fundamentally fairly confused about how signals work and when it is
  appropriate for upcalls to be interrupted.  In particular, we should
  be exempting certain upcalls from interruption, we should not always
  eventually time out sleeping on a upcall, and we should not be
  interrupting the sleep for certain signals that we currently are
  (including SIGINFO).  This code needs to be reworked in the style of
  NFS interruptible mounts.
2008-03-16 18:29:02 +00:00
Robert Watson 242a5afe5a Merge cnode.h:1.28, coda_psdev.c:1.46 from HEAD to RELENG_7:
Spell replys as replies.
2008-03-16 18:28:37 +00:00
Robert Watson a7b01dee2b Merge coda_vnops.c:1.97 from HEAD to RELENG_7:
Reorder and clean up make_coda_node(), annotate weaknesses in the
  implementation.
2008-03-16 18:27:57 +00:00
Christian Brueffer a2d822fa17 MFC: rev. 1.6
- Use an uppercase provider name in the example, to make the name change
  after labeling the provider more obvious.
- Correct nomenclature usage
2008-03-16 08:18:04 +00:00
David E. O'Brien 0645a83161 MFC: rev 1.18: style.Makefile(5) 2008-03-16 08:03:48 +00:00
David E. O'Brien f72227b731 MFC: rev 1.13: style.Makefile(5) 2008-03-16 08:03:11 +00:00
David E. O'Brien 0910ad96e6 MFC: 1.78: adjust history 2008-03-16 08:02:37 +00:00
David E. O'Brien d80ffe8edf MFC: 1.47: document -t 2008-03-16 08:01:39 +00:00
David E. O'Brien cf05cfc708 MFC: rev 1.41: don't imply O(n) removal for the doubly linked data structures. 2008-03-16 08:00:49 +00:00
David E. O'Brien 8b0c6fd053 MFC: revs 1.64-65: style(9) 2008-03-16 07:52:22 +00:00
David E. O'Brien 6d62e00d4c MFC: rev 1.153: style(9) 2008-03-16 07:23:46 +00:00
David E. O'Brien e3c72b87a8 MFC: use UNZIPPER everywhere. 2008-03-16 07:22:57 +00:00
David E. O'Brien 5c4a526ce5 MFC: rev 1.82: make a few messages more consistant 2008-03-16 07:21:01 +00:00
David E. O'Brien 15374b5ab0 MFC: style(9) 2008-03-16 07:20:18 +00:00
David E. O'Brien a34afe82fa MFC: improve -u (limit uid lookups) behavior.
machine.c rev 1.84 & top.c rev 1.24
2008-03-16 07:12:48 +00:00
David E. O'Brien 2815b57220 MFC: rev 1.125: add to history 2008-03-16 07:09:16 +00:00
David E. O'Brien dd9b4d308d MFC: repcopy from usr.bin/ to bin/ 2008-03-16 07:04:04 +00:00
David E. O'Brien da4fc24a42 MFC: rev 1.1. 2008-03-16 07:00:52 +00:00
David E. O'Brien 2ed4079235 MFC: "make love" and GC bootstrapping aid for old (mid-2001) systems. 2008-03-16 06:59:50 +00:00
David E. O'Brien 102c4f9f1f MFC: style.Makefile(5) 2008-03-16 06:56:22 +00:00
David E. O'Brien 9787e517eb MFC: style(9)
arm/include/pthread_md.h rev 1.5
     sparc64/include/pthread_md.h rev 1.3
2008-03-16 06:55:13 +00:00
David E. O'Brien 9872c2a0af MFC: 1.36: style(9) 2008-03-16 06:53:41 +00:00
Gregory Neil Shapiro 4ec40f3079 MFC: Switch libmilter from select(2) to poll(2) so milters are not limited
by the size of FD_SETSIZE.

     PR:             118824
     Submitted by:   vsevolod
2008-03-15 20:55:37 +00:00
Remko Lodder 1fba07efb3 MFC rev 1.111 disklabel.h
Add missing comma.

  PR:             bin/121645
  Submitted by:   OISHI Masakuni <yamasa at bsdhouse dot org>
  Approved by:    imp (mentor, implicit for trivial changes)
  MFC after:      3 days

Approved by:	imp (mentor, implicit)
2008-03-15 14:41:27 +00:00
Robert Watson 26ae6029a8 Merge kern_sig.c:1.357 from HEAD to RELENG_7:
Use sbuf routines to construct core dump filenames rather than custom
  string buffer handling, making the code both easier to read and more
  robust against string-handling bugs.
2008-03-15 11:08:37 +00:00
Robert Watson 56df556301 Merge coda_psdev.c:1.45 and coda_vnops.c:1.96 from HEAD to RELENG_7:
Remove debugging code under OLD_DIAGNOSTIC; this is all >10 years old and
  hasn't been used in that time.
2008-03-15 11:06:56 +00:00
cvs2svn f2bde5666f This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2008-03-15 11:05:50 +00:00
Robert Watson 61217f42f6 Merge coda_subr.c:1.39 from HEAD to RELENG_7:
In Coda, flush the attribute cache for a cnode when its fid is
  changed, as its synthesized inode number may have changed and we
  want stat(2) to pick up the new inode number.
2008-03-15 11:03:56 +00:00
Maksim Yevmenkin 70e03dffa3 MFC:
Update usage() - add new -D option. While I'm here, update copyright
information and license formatting
2008-03-15 02:36:32 +00:00
Robert Watson 899e4efe87 Merge coda_subr.c:1.38 from HEAD to RELENG_7:
Update cache flushing behavior in light of recent namecache and
  access cache improvements:

  - Flush just access control state on CODA_PURGEUSER, not the full
    namecache for /coda.

  - When replacing a fid on a cnode as a result of, e.g.,
    reintegration after offline operation, we no longer need to
    purge the namecache entries associated with its vnode.
2008-03-14 17:17:49 +00:00
Robert Watson 7d581423a4 Merge cnode.h:1.27, coda_subr.c:1.37, coda_vnops.c:1.95 from HEAD to
RELENG_7:

  Implement a rudimentary access cache for the Coda kernel module,
  modeled on the access cache found in NFS, smbfs, and the Linux coda
  module.  This is a positive access cache of a single entry per file,
  tracking recently granted rights, but unlike NFS and smbfs,
  supporting explicit invalidation by the distributed file system.

  For each cnode, maintain a C_ACCCACHE flag indicating the validity
  of the cache, and a cached uid and mode tracking recently granted
  positive access control decisions.

  Prefer the cache to venus_access() in VOP_ACCESS() if it is valid,
  and when we must fall back to venus_access(), update the cache.

  Allow Venus to clear the access cache, either the whole cache on
  CODA_FLUSH, or just entries for a specific uid on CODA_PURGEUSER.
  Unlike the Coda module on Linux, we don't flush all entries on a
  user purge using a generation number, we instead walk present
  cnodes and clear only entries for the specific user, meaning it is
  somewhat more expensive but won't hit all users.

  Since the Coda module is agressive about not keeping around
  unopened cnodes, the utility of the cache is somewhat limited for
  files, but works will for directories.  We should make Coda less
  agressive about GCing cnodes in VOP_INACTIVE() in order to improve
  the effectiveness of in-kernel caching of attributes and access
  rights.
2008-03-14 17:17:00 +00:00
Robert Watson 7dc2be9cf4 Merge Makefile:1.9 from HEAD to RELENG_7:
Remove coda_namecache from coda5 as well.  We should probably GC coda5
  entirely at this point as coda6 is considered the supported branch.
2008-03-14 17:15:12 +00:00
Robert Watson d60c15bcd4 Merge files:1.1268 from HEAD to RELENG_7:
Remove coda_namecache from "options vcoda", it is no longer required.
2008-03-14 17:14:42 +00:00
Robert Watson 6fd0cd1599 Merge cnode.h:1.26, coda_psdev.c:1.44, coda_subr.c:1.36,
coda_subr.h:1.12, coda_vnops.c:1.94, coda_vnops.h:1.24,
coda_namecache.c:1.26, coda_namecache.h:1.15, Makefile:1.18,
from HEAD to RELENG_7:

  Rather than having the Coda module use its own namecache, use the global
  VFS namecache, as is done by the Coda module on Linux.  Unlike the Coda
  namecache, the global VFS namecache isn't tagged by credential, so use
  ore conservative flushing behavior (for now) when CODA_PURGEUSER is
  issued by Venus.

  This improves overall integration with the FreeBSD VFS, including
  allowing __getcwd() to work better, procfs/procstat monitoring, and so
  on.  This improves shell behavior in many cases, and improves ".."
  handling.  It may lead to some slowdown until we've implemented a
  specific access cache, which should net improve performance, but in the
  mean time, lookup access control now always goes to Venus, whereas
  previously it didn't.
2008-03-14 17:12:40 +00:00
Maksim Yevmenkin 8d97e7a52b MFC:
Add an option to register DUN (Dial-Up Networking) service on the same
RFCOMM channel if needed. There is really no good reason to not to support
this. AT-command exchange can be faked with chat script in ppp.conf.
2008-03-14 16:11:20 +00:00
Paolo Pisati e5ae1da9a3 Fix showing nat rules.
Bug spotted by: Gael Roualland <[email protected]>
PR: bin/121683
2008-03-14 09:41:46 +00:00
Justin T. Gibbs a4c9429ab6 MFC: In est_acpi_info(), initialize count before passing its pointer to
CPUFREQ_DRV_SETTINGS().
2008-03-14 02:57:46 +00:00
Christian Brueffer 2e2a9f4848 MFC: rev. 1.5
Fix typos.
2008-03-13 15:15:38 +00:00
Christian S.J. Peron 8926226095 MFC revision 1.25 -- Make sure we return EINVAL for invalid commands 2008-03-13 13:53:20 +00:00
Robert Watson 691335c62b Merge audit_worker.c:1.22 from HEAD to RELENG_7:
Remove XXX to remind me to check the free space calculation, which to my
  eyes appears right following a check.
2008-03-13 10:30:06 +00:00
Robert Watson 233bda577d Merge smb_conn.h:1.13 from HEAD to RELENG_7:
Remove unused vc_tnode field from struct smb_vc.
2008-03-13 10:29:35 +00:00
Bjoern A. Zeeb 7eff074b73 MFC rev. 1.146 tcp_output.c
Padding after EOL option must be zeros according to RFC793 but
  the NOPs used are 0x01.
  While we could simply pad with EOLs (which are 0x00), rather use an
  explicit 0x00 constant there to not confuse poeple with 'EOL padding'.
  Put in a comment saying just that.

Early MFC requested by:	silby
			because of more people reporting problems on net@
2008-03-13 10:09:12 +00:00
Robert Watson b5af5b6135 Merge Makefile.inc:1.129, kldunload.2:1.19 from HEAD to RELENG_7:
Add reference to kldunloadf system call, which was previously not
  mentioned in the kldunload(2) man page.

  Spotted by:     rink
2008-03-13 09:58:07 +00:00
Pyun YongHyeon b925150109 MFC: Fix function prototype for device_shutdown method. 2008-03-13 07:50:48 +00:00
Garrett Wollman 7d3650575c MFC rev. 1.26:
stdio is currently limited to file descriptors not greater than
  {SHRT_MAX}, so {STREAM_MAX} should be no greater than that.  (This
  does not exactly meet the letter of POSIX but comes reasonably close
  to it in spirit.)
2008-03-13 02:33:20 +00:00
Brooks Davis 79f29c4cc8 MFC rev 1.31:
When the state of the interface changes rapidly enough there is a race
where dhclient is in the process of exiting due to the link going down
when the link coming up causes devd to try and start a new one.  This
results is the link being up, but no dhclient running.

Work around this race by checking a second time after a one second delay
before refusing to start a dhclient instance due to one already being
running.
2008-03-12 17:35:38 +00:00
Brooks Davis 2872d1b561 MFC rev 1.18:
During PREINIT, when giving the interface the address 0.0.0.0, do it as an
alias to avoid distrubing other addresses.

PR:		bin/119255
Submitted by:	Jaakko Heinonen <jh at saunalahti dot fi>
2008-03-12 17:29:42 +00:00
Olivier Houchard ee3a6db750 MFC rev 1.6:
date: 2008/03/06 22:27:35;  author: cognet;  state: Exp;  lines: +3 -1
MFi386:
revision 1.6
date: 2004/08/21 18:50:34;  author: alc;  state: Exp;  lines: +3 -1
Properly free the temporary sf_buf in uiomove_fromphys() if a copyin or
copyout fails.

Obtained from: DragonFlyBSD

Spotted out by: Mark Tinguely
2008-03-12 13:51:51 +00:00
Robert Watson 55b26cb7b7 Merge gzip.c:1.6 from HEAD to RELENG_7:
Teach gunzip that .tbz and .tbz2 uncompress to .tar, in a manner similar to
  its existing understanding that .tgz uncompresses to .tar.

  PR:             121519
  Submitted by:   Ighighi <ighighi at gmail.com>
2008-03-12 11:34:26 +00:00
Robert Watson 0af91e5686 Merge NOTES:1.1475 from HEAD to RELENG_7:
HZ now defaults to 1000 on many architectures, so update NOTES to reflect
  that.

  PR:             113670
  Submitted by:   Ighighi <ighighi at gmail.com>
2008-03-12 11:09:16 +00:00
Robert Watson 03dac1d481 Merge coda_vnops.c:1.93 from HEAD to RELENG_7:
Clean up coda_pathconf() slightly while debugging a problem there.
2008-03-12 11:08:32 +00:00
Tim Kientzle 22bd701ffa MFC a number of minor edits and portability fixups.
This is mostly just to catch 7-STABLE up with -CURRENT
before the next big round of changes.
2008-03-12 04:20:30 +00:00
Xin LI 159897c860 MFen 1.73 -> 1.73.4.3 2008-03-11 22:40:04 +00:00
Remko Lodder 14e5e92c83 MFC rev 1.8 tinybsd
Improve handling of the tinybsd application wrt ports.  Ports that
  have dependencies or need to install a new user/group, are not
  problematic anymore.

  PR:             121367
  Submitted by:   Richard Arends < richard at unixguru dot nl >
  MFC after:      3 days

Approved by:	imp (mentor, implicit)
2008-03-11 19:19:14 +00:00
Alexander Motin 052c79a8ec MFC rev. 1.23-1.24
To avoid control data losses, do not acknowledge recieving of control packet
if netgraph reported error while delivering to destination.
Reset 'next send' counter to the last requested by peer on ack timeout,
to resend all subsequest packets after lost one again without additional hints.
2008-03-11 19:14:10 +00:00
Alexander Motin fbb9b9f730 MFC rev. 1.61
Send only one incoming notification at a time to reduce queue
trashing and improve performance.
Remove waitflag argument from ng_ksocket_incoming2(), it means nothing
as function call was queued by netgraph.
Remove node validity check, as node validity guarantied by netgraph.
Update comments.
2008-03-11 19:04:42 +00:00
Robert Watson 7af7e32d47 Merge cnode.h:1.25, coda_fbsd.c:1.48, coda_io.h:1.10,
coda_kernel.h:1.7, coda_namecache.c:1.25, coda_namecache.h:1.14,
coda_opstats.h:1.8, coda_pioctl.h:1.10, coda_psdev.c:1.43,
coda_psdev.h:1.8, coda_subr.c:1.35, coda_subr.h:1.11,
coda_venus.c:1.30, coda_venus.h:1.11, coda_vfsops.c:1.79,
coda_vfsops.h:1.14, coda_vnops.c:1.92, coda_vnops.h:1.23 from HEAD
to RELENG_7:

  Since we're now actively maintaining the Coda module in the FreeBSD source
  tree, restyle everything but coda.h (which is more explicitly shared
  across systems) into a closer approximation to style(9).

  Remove a few more unused function prototypes.

  Add or clarify some comments.

Minor differences required in the MFC due to diverging VFS locking in
HEAD vs RELENG_7.
2008-03-11 10:14:47 +00:00
Mike Silbersack 7d3a42ffab MFC rev 1.160; Change tcp options order back to how it was
in FreeBSD 6 to improve compatibility.
2008-03-11 06:34:28 +00:00
Yoshihiro Takahashi 07efae2402 MFC: revision 1.400
Add "show sysregs" command to ddb.  On i386, this gives gdt, idt, ldt,
    cr0-4, etc.  Support should be added for other platforms that have a
    different set of registers for system use.
2008-03-10 12:41:47 +00:00
Robert Watson 5c2aa891f0 Merge db_command.c:1.77 from HEAD to RELENG_7:
When killing a user process from DDB, check that the requested signal is
  > 0 rather than >= 0, or we will panic when trying to deliver the signal.

  PR:             100802
  Submitted by:   Valerio Daelli <valerio.daelli at gmail.com>
2008-03-10 10:26:03 +00:00
Robert Watson 4cab752563 Merge db_input.c:1.39 from HEAD to RELENG_7:
Reserve two bytes at the end of the DDB input line in db_readline() to
  hold the newline and nul terminator.  Otherwise, there are cases where
  garbage may end up in the command history due to a lack of a nul
  terminator, or input may end up without room for a newline.

  PR:             119079
  Submitted by:   Michael Plass <[email protected]>
2008-03-10 10:23:03 +00:00
Robert Watson 1c22a94a5b Merge cnode.h:1.24, coda_fbsd.c:1.47, coda_namecache.c:1.24,
coda_psdev.c:1.42, coda_psdev.h:1.7, coda_venus.c:1.29,
coda_vfsops.c:1.78, coda_vfsops.h:1.13, coda_vnops.c:1.91,
coda_vnops.h:1.22 from HEAD to RELENG_7:

  Various further non-functional cleanups to coda:

  - Rename print_vattr to coda_print_vattr and make static, rename
    print_cred to coda_print_cred.
  - Remove unused coda_vop_nop.
  - Add XXX comment because coda_readdir forwards to the cache vnode's
    readdir rather than venus_readdir, and annotate venus_readdir as
    unused.
  - Rename vc_nb_* to vc_*.
  - Use d_open_t, d_close_t, d_read_t, d_write_t, d_ioctl_t and d_poll_t
    for prototyping vc_* as that is the intent, don't use our own
    definitions.
  - Rename coda_nb_statfs to coda_statfs, rename NB_SFS_SIZ to
    CODA_SFS_SIZ.
  - Replace one more OBE reference to NetBSD with a reference to FreeBSD.
  - Tidy up a little vertical whitespace here and there.
  - Annotate coda_nc_zapvnode as unused.
  - Remove unused vcodattach.
  - Annotate VM_INTR as unused.
  - Annotate that coda_fhtovp is unused and doesn't match the FreeBSD
    prototype, so isn't hooked up to vfs_fhtovp.  If we want NFS export of
    Coda to work someday, this needs to be fixed.
  - Remove unused getNewVnode.
  - Remove unused coda_vget, coda_init, coda_quotactl prototypes.
2008-03-10 10:22:23 +00:00
Robert Watson fb0fd40292 Merge coda_vfsops.c:1.77 from HEAD to RELENG_7:
No reason not to maintain stats on statfs in Coda, as it's done for
  other VFS operations, so uncomment the existing statistics gathering.
2008-03-10 10:18:48 +00:00
Robert Watson 31a5aa97fd Merge cnode.h:1.23, coda_vfsops.c:1.76 from HEAD to RELENG_7:
Remove unused devtomp(), which exploited UFS-specific knowledge to find
  the mountpoint for a specific device.  This was implemented incorrectly,
  a bad idea in a fundamental sense, and also never used, so presumably
  a long-idle debugging function.
2008-03-10 10:18:06 +00:00
Robert Watson d2bce6283c Merge coda_vnops.c:1.90, coda_vnops.h:1.21 from HEAD to RELENG_7:
Since Coda is effectively a stacked file system, use VOP_EOPNOTSUPP
  for vop_bmap; delete the existing stub that returned either EINVAL
  or EOPNOTSUPP, and had unreachable calls to VOP_BMAP on the cache
  vnode.
2008-03-10 10:16:09 +00:00
Robert Watson 6b470ce989 Merge coda_vnops.c:1.89 from HEAD to RELENG_7:
Lock cache vnode when VOP_FSYNC() is called on a Coda vnode.
2008-03-10 10:14:51 +00:00
Robert Watson 017fcc6b5e Merge coda_vfsops.c:1.75, coda_vnops.c:1.88 from HEAD to RELENG_7:
Make all calls to vn_lock() in Coda, including recently added ones,
  use LK_RETRY, since failure is undesirable (and not handled).

  Pointed out by: kib
2008-03-10 10:13:48 +00:00
Bjoern A. Zeeb 8fe04e3df6 MFC
1.278 sys/netinet/ip_output.c
  1.114 sys/netinet6/ip6_output.c
  1.26  sys/netipsec/ipsec.c
  1.15  sys/netipsec/ipsec.h
  1.4   sys/netipsec/ipsec6.h

  Rather than passing around a cached 'priv', pass in an ucred to
  ipsec*_set_policy and do the privilege check only if needed.

  Try to assimilate both ip*_ctloutput code blocks calling ipsec*_set_policy.
2008-03-09 21:04:55 +00:00
Alexander Motin a4d137428b MFC: rev. 1.148-1.149
Implement 128 items node name hash for faster name search.
Increase node ID hash size from 32 to 128 items.
Increase default queue items allocation limit from 512 to 4096 items
to avoid terrible unpredicted effects for netgraph operation of their
exhaustion while allocating control messages.
Add separate configurable 512 items limit for data items allocation
for DoS/overload protection.
2008-03-09 20:10:54 +00:00
Bjoern A. Zeeb 226e69bb45 MFC:
1.75  sys/kern/kern_jail.c
  1.8   sys/netinet/ip_options.c
  1.78  sys/netinet6/in6.c
  1.113 sys/netinet6/ip6_output.c
  1.41  sys/netinet6/ip6_var.h
  1.76  sys/netinet6/raw_ip6.c
  1.85  sys/netinet6/udp6_usrreq.c
  [ previously MFCed by rwatson 1.18 sys/sys/priv.h belonging to this change ]

  Replace the last susers calls in netinet6/ with privilege checks.

  Introduce a new privilege allowing to set certain IP header options
  (hop-by-hop, routing headers).

  Leave a few comments that we would like to address later.

Discussed with:	rwatson
2008-03-09 19:01:50 +00:00
Robert Watson d0765fe50e Merge coda_psdev.c:1.41, coda_subr.c:1.45, coda_venus.c:1.28,
coda_vfsops.c:1.74, coda_vnops.c:1.87, coda_vnops.h:1.20 from HEAD
to RELENG_7:

  The Coda module was originally ported to NetBSD from Mach by rvb, and
  then later to FreeBSD.  Update various NetBSD-related comments: in some
  cases delete them because they don't appply, in others update to say
  FreeBSD as they still apply but in FreeBSD (and might for that matter
  no longer apply on NetBSD), and flag one case where I'm not sure
  whether it applies.
2008-03-09 15:12:11 +00:00
Robert Watson cc214bbd2f Merge coda_vnops.c:1.86 from HEAD to RELENG_7:
Before invoking vnode operations on cache vnodes, acquire the vnode
  locks of those vnodes.  Probably, Coda should do the same lock sharing/
  pass-through that is done for nullfs, but in the mean time this ensures
  that locks are adequately held to prevent corruption of data structures
  in the cache file system.

  Assuming most operations came from the top layer of Coda and weren't
  performed directly on the cache vnodes, in practice this corruption was
  relatively unlikely as the Coda vnode locks were ensuring exclusive
  access for most consumers.

  This causes WITNESS to squeal like a pig immediately when Coda is used,
  rather than waiting until file close; I noticed these problems because
  of the lack of said squealing.

NB: Because WITNESS in RELENG_7 doesn't yet support lockmgr, said
squealing doesn't yet happen in RELENG_7, but will do if/when lockmgr
grows support for WITNESS there.
2008-03-09 15:09:22 +00:00
Robert Watson f2b808033e Merge coda_vfsops.c:1.73 from HEAD to RELENG_7:
Remove undefined coda excluded by #if 1 #else, which previously protected
  vget() calls using inode numbers to query the root of /coda, which is not
  needed since we now cache the root vnode with the mountpoint.
2008-03-09 15:06:12 +00:00
Robert Watson fb401729bc Merge db_input.c:1.38 from HEAD to RELENG_7:
When redrawing an input line, count backspaces to get to the beginning of
  the input field from the current cursor location, rather than the end of
  the input line, as the cursor may not be at the end of the line.
  Otherwise, we may overshoot, overwriting a bit of the previous line and
  failing to fully overwrite the current line.

  PR:             119079
  Submitted by:   Michael Plass <[email protected]>
2008-03-09 14:49:39 +00:00
Marius Strobl ec74256a8e MFC: sys/conf/files.sparc64 1.94; sys/sparc64/include/md_var.h 1.17;
sys/sparc64/sparc64/ata_machdep.c 1.1

The Sun disk label only uses 16-bit fields for cylinders, heads and
sectors so the geometry of large IDE disks has to be adjusted.
2008-03-09 14:25:02 +00:00
Konstantin Belousov 0a2609448f MFC rev. 1.11:
Return ENOSYS instead of 0 for the unknown futex operations.
2008-03-09 13:59:19 +00:00
Konstantin Belousov 3f963da827 MFC rev. 1.338:
Initialize mnt_stat.f_iosize before autostarting UFS1 extattrs.
2008-03-09 13:57:48 +00:00
Konstantin Belousov 75d4272ca4 MFC rev. 1.178:
Fix the Giant leak in the nfsrv_remove().
2008-03-09 13:55:51 +00:00
Edwin Groothuis b28a029407 MFC: tzdata2008a
Notable changes:

- Chilis DST has been extended for 3 weeks.
- No leapsecond in 2008

Approved by:	grog@ (mentor)
2008-03-09 11:21:36 +00:00
Bjoern A. Zeeb a414a23b03 MFC rev. 1.3 uipc_debug.c
Add missing sb_sndptr* fields to db_print_sockbuf().
  While here change %d to %u for u_ints.
2008-03-09 00:04:45 +00:00
Bjoern A. Zeeb bc9f52bc1a MFC rev. 1.49 in6_src.c
Correct the commented out debugging printf()s in REPLACE and NEXT macros.
  ip6_sprintf() needs a buffer as first argument these days.
2008-03-08 23:45:39 +00:00
Bjoern A. Zeeb dd8c39bb08 MFC rev. 1.103 in.c
Differentiate between addifaddr and delifaddr for the privilege check.
2008-03-08 23:41:47 +00:00
Bjoern A. Zeeb 099b2ba832 MFC rev. 1.54
Though we are currently not interested in the EDD3 flag,
  Enhanced Disk Drive Specification Ver 3.0 defines that the version
  of extension in AH would be 30h.
  Correct the check for that to be >=30h instead of >3h.
2008-03-08 23:36:25 +00:00
Marius Strobl 5f08232e7a MFC: 1.11
Allow the targeted CPU type to be set via -mcpu instead of
limiting to the hardcoded equivalent of -mcpu=ultrasparc.

PR:		109510
2008-03-08 19:33:34 +00:00
Scott Long 142f812ba4 Re-update to rev 1.2 of the hptrr driver. 2008-03-08 18:16:32 +00:00
Bjoern A. Zeeb e37b933c10 MFC:
rev. 1.372
   Fix indentation (whitespace changes only).

  rev. 1.373
   Some "cleanup" of tcp_mss():
   - Move the assigment of the socket down before we first need it.
     No need to do it at the beginning and then drop out the function
     by one of the returns before using it 100 lines further down.
   - Use t_maxopd which was assigned the "tcp_mssdflt" for the corrrect
     AF already instead of another #ifdef ? : #endif block doing the same.
   - Remove an unneeded (duplicate) assignment of mss to t_maxseg just before
     we possibly change mss and re-do the assignment without using t_maxseg
     in between.
2008-03-08 17:01:27 +00:00
Bjoern A. Zeeb b77abf3738 MFC: rev. 1.29 key.c, 1.6 key_debug.c
Fix bugs when allocating and passing information of current lifetime and
 soft lifetime [1] introduced in rev. 1.21 of key.c.

 Along with that, fix a related problem in key_debug
 printing the correct data.
 While there replace a printf by panic in a sanity check.

PR:		120751
Submitted by:	Kazuaki ODA (kazuaki aliceblue.jp) [1]
2008-03-08 16:58:21 +00:00
Rui Paulo c8ebc9d3d4 MFC r1.12:
Validate the id16 values gathered from ACPI (previously a TODO
  item).
  Style changes by me and njl.

  Submitted by:    Takeharu KATO <takeharu1219 at ybb.ne.jp>
  PR:              119350
2008-03-08 14:14:35 +00:00
Xin LI 344330fc20 Revert powerpc scheduler change for now. This change should be
done after necessary ULE changes to be MFC'ed.

Pointed out by:	peter
2008-03-08 09:38:18 +00:00
Rong-En Fan bfcb6c766a MFC termcap changes for the END/ENTER keys
Log:
  - Remove kH and *6 from xterm. They are defined to the same key as @7 (kp_end).
    As ncurses has the limitation that it returns the first matched key symbol,
    you can not use END in ncurses based program, like mutt, with xterm.
  - Add @8 (kp_enter) definition for xterm so you can use ENTER in xterm with
    ncurses based program.

  I also found that NetBSD's xterm does the same thing.

PR:             100150
Reported by:    Arseny Nasokin <tarc at tarc.po.cs.msu.su>
Discussed with: Thomas Dickey, Ulrich Spoerlein <uspoerlein at gmail.com>
Reviewed by:    freebsd-arch@
2008-03-08 05:42:09 +00:00
Xin LI 64fcbb105e MFC revision 1.108
date: 2008/01/30 22:11:59;  author: delphij;  state: Exp;  lines: +2 -2
Fix two typos.
2008-03-08 01:00:39 +00:00
Xin LI c19491e75c MFC revision 1.14
date: 2008/01/29 00:20:00;  author: delphij;  state: Exp;  lines: +1 -1
Don't coredump when executed with -o.
2008-03-08 00:54:27 +00:00
Xin LI 3994e603bb Merge from RELENG_7_0: Teach pkg_add(1) about 6.3-RELEASE, 7.0-RELEASE
and 7-STABLE.
2008-03-08 00:04:57 +00:00
Xin LI c00fb5a042 MFC: Switch to use ULE as default scheduler on amd64, i386 and powerpc
architectures.
2008-03-07 23:09:10 +00:00
Jason Evans d25eaea390 MFC: Merge malloc(3) improvements and fixes. The highlights are:
* Avoid re-zeroing memory in calloc() when possible.

* Use pthread mutexes where possible instead of libc "spinlocks", and
  actually spin some during contention before blocking.

* Implement dynamic load balancing of thread-->arena mapping.

* Avoid floating point math in order to avoid increased context switch
  overhead for applications that otherwise would not use floating point
  math.

* Restructure how sbrk() and mmap() are used to acquire memory mappings.
  This provides a way to force malloc to only use sbrk(), which can be
  useful in the context of resource limits.

* Reduce the number of mmap() calls typically necessary when allocating
  a chunk.

* Track dirty unused pages so that they can be purged if they exceed a
  threshold.

* Try to realloc() large objects in place.

* Manage page runs with trees instead of chunk maps, which allows
  logarithmic-time run allocation.
2008-03-07 22:39:39 +00:00
Jason Evans 56bd481571 MFC: Implement the RB_FOREACH_REVERSE() and RB_PREV() macros. RB_PREV is
needed by malloc(3).
2008-03-07 22:34:17 +00:00
John Baldwin 0ba2dc462a MFC: VIA Padlock changes:
- Read the brand string from VIA/IDT CPUs.
- Add a VIA Padlock feature line in dmesg.
- Support the newer Via C7 core (0x6d0).
2008-03-07 20:19:33 +00:00
Alexander Motin 04264dfa12 MFC rev. 1.92-1.93
Make session ID generator to use session ID hash.
Make session ID generator thread-safe.
Use more compact LIST instead of TAILQ for session hash.
Add all listening hooks into LIST to simplify searches.
Use ng_findhook() instead of own equal implementation.
2008-03-07 17:58:49 +00:00
Alexander Motin 888e995203 MFC: Add support for the libalias redirect functionality.
Submitted by:   Vadim Goncharov <[email protected]>
2008-03-07 17:54:21 +00:00
Bruce A. Mah 075000e768 New errata notes: SCTP needs INET6, kldxref(8) warnings on source
upgrade, device crypto problems on powerpc.
2008-03-07 16:32:42 +00:00
Remko Lodder b361cca3ec MFC rev 1.162 umass.c
MFC rev 1.338 usbdevs

  Add support for the VIA USB2IDE bridge [1].

  PR: usb/95173
  Submitted by: Goegele Hannes <[email protected]>
  Ben Kelly <bkelly at vadev dot org>
  Tested by: blackend
  Approved by: imp (mentor, blanket for simple patches)
  X-MFC-After: 1 week

Approved by:	imp (mentor, implicit)
2008-03-07 15:54:41 +00:00
Remko Lodder 4dfc482b6d MFC rev 1.340 usbdevs
MFC rev 1.90 uscanner.c

  Add support for the EPSON CX5400 scanner

  PR: usb/120980
  Submitted by: Christophe Etcheverry <cetcheve at gmail dot com>
  MFC after: 3 days
  Approved by: imp (mentor, implicit for trivial changes)

Approved by:	imp (mentor, implicit)
2008-03-07 15:26:41 +00:00
Remko Lodder 0e0aa8060f MFC libfetch from HEAD to RELENG_7
Approved by:	imp (mentor, implicit), DES
Glanced at by:	des
2008-03-07 15:01:52 +00:00
Remko Lodder 24ac6ad321 MFC rev 1.8 drm_pciids.h
Add support for the 965GM.

   PR:             kern/120978
   Submitted by:   Dominic Fandrey <kamikaze at bsdforen dot de>
   Approved by:    imp (mentor, implicit), anholt (drm maintainer)
   MFC after:      3 days

Approved by:	imp (mentor, implicit)
2008-03-07 14:58:50 +00:00
Sean Farley 31aeeda2af MFC:
Replace the use of warnx() with direct output to stderr using _write().
This reduces the size of a statically-linked binary by approximately 100KB
in a trivial "return (0)" test application.  readelf -S was used to verify
that the .text section was reduced and that using strlen() saved a few
more bytes over using sizeof().  Since the section of code is only called
when environ is corrupt (program bug), I went with fewer bytes over fewer
cycles.

I made minor edits to the submitted patch to make the output resemble
warnx().

    src/lib/libc/stdlib/getenv.c: rev 1.12 -> 1.13

Submitted by:	kib bz
Approved by:	wes (mentor)
2008-03-06 15:14:36 +00:00
Guy Helmer 8314e7a483 MFH: 1.30
Fix truncation of lines at LINE_MAX characters by dynamically
extending line buffers.

PR:		bin/76578
2008-03-06 15:02:05 +00:00
Mike Makonnen d59b46942f MFC: rev. 1.32
Add the -M command-line option, which will set home directory
	permissions. Works both in interactive or batch mode. This is
	a heavily modified version of the patch submitted in the PR.

	PR: bin/105060
2008-03-06 14:13:11 +00:00
Christian Brueffer d096710ee8 MFC: rev. 1.17
The Sony i.LINK (CXD1947) is _not_ supported.
2008-03-06 07:20:53 +00:00
Colin Percival 4608d52fee MFC revision 1.269: Fix sending trailers in sendfile(2). 2008-03-06 05:41:45 +00:00
Xin LI 8883d2125f MFC revision 1.5
date: 2008/02/16 00:16:49;  author: delphij;  state: Exp;  lines: +2 -1
Allow underscore in domain names while resolving.  While having underscore
is a violation of RFC 1034 [STD 13], it is accepted by certain name servers
as well as other popular operating systems' resolver library.

Bugs are mine.

Obtained from:  ume
2008-03-06 01:05:30 +00:00
John Baldwin 762e69b292 MFC: Make netstat -rn more resilient to having the routing table change out
from under it while running.
2008-03-05 21:19:25 +00:00
John Baldwin f974c086e9 MFC: Mark the syscons video spin mutex as recursable. 2008-03-05 21:14:06 +00:00
John Baldwin 6c05d010e4 MFC: Mark sleepqueue chain spin mutexes as recursable. 2008-03-05 21:12:49 +00:00
John Baldwin 7f7ea605ea MFC: Add a couple of assertions and KTR logging to thread_lock_flags(). 2008-03-05 21:11:54 +00:00
John Baldwin b7729bbde1 MFC: Use RTFREE_LOCKED() instead of rtfree() when releasing a reference on
the 'rt' route in rtredirect().
2008-03-05 20:33:46 +00:00
John Baldwin 52aefeae42 MFC: Consolidate the code to generate a new XID for a NFS request. 2008-03-05 19:58:07 +00:00
Alexander Motin d0a5a3ff4a MFC rev. 1.63-1.68
Document -instance and -globalport options.
Note that the punch_fw option does not work in securelevel 3.
2008-03-04 12:45:48 +00:00
Paolo Pisati e26f1c1640 MFC:
Add table/tablearg support to ipfw's nat.
Fix display of nat range.
Fix display of multiple nat rules.
Whitespace elimination.

sbin/ipfw/ipfw2.c: rev. 1.115, 1.116 and 1.117
sbin/ipfw/ipfw.8: rev. 1.210
sys/netinet/ip_fw2.c: rev. 1.181
2008-03-04 12:07:34 +00:00
Christian Brueffer 3d20b7779a MFC: rev. 1.5
Move the HARDWARE section below the DESCRIPTION section, like it is
everywhere else.
2008-03-04 06:09:13 +00:00
Andrey A. Chernov 40f9f7a6e7 MFC: 1.51 - better recover from unknown encoding found
(not by core dump)
2008-03-03 11:51:30 +00:00
Shunsuke Akiyama 5e582cccae MFC: rev 1.65.
o Add module event handler.
o Update copyright year.
2008-03-02 13:07:03 +00:00
Philip Paeps 613a7cc49c MFC r1.174:
Zero sc->vnode if mdsetcred() fails.

    This fixes the panic which happens when mdcreate_vnode() calls vn_close()
    and mddestroy() calls it again further down the error handling path.
2008-03-02 11:33:54 +00:00
Philip Paeps d9cc830250 MFC: Note, as required by our agreement with IEEE/The Open Group, that
the message queue manual pages excerpt the POSIX standard.
2008-03-01 16:17:30 +00:00
Robert Watson 92ccb62123 Merge TODO:1.6 from HEAD to RELENG_7:
Add "Make MPSAFE" to the Coda todo list.
2008-03-01 15:43:00 +00:00
Robert Watson 12bee13396 Merge _bus.h:1.2 from HEAD to RELENG_7:
Remove errant % in license comment.
2008-03-01 15:42:23 +00:00
Robert Watson 935f6051cf Merge ixp425.c:1.9 from HEAD to RELENG_7:
On the ixp425, when we fail to initialize the memory rman instance, the
  panic message should read "memory", not "IRQ".
2008-03-01 15:42:01 +00:00
Robert Watson 2e85be98ce Merge uipc_sockbuf.c:1.176, uipc_socket.c:1.305, socketvar.h:1.162 from
HEAD to RELENG_7:

  Further clean up sorflush:

  - Expose sbrelease_internal(), a variant of sbrelease() with no
    expectations about the validity of locks in the socket buffer.
  - Use sbrelease_internel() in sorflush(), and as a result avoid
    initializing and destroying a socket buffer lock for the temporary
    stack copy of the actual buffer, asb.
  - Add a comment indicating why we do what we do, and remove an XXX
    since things have gotten less ugly in sorflush() lately.

  This makes socket close cleaner, and possibly also marginally faster.
2008-03-01 15:40:53 +00:00
Robert Watson f88d59ae15 Merge mac_mls.c:1.99 from HEAD to RELENG_7:
Properly return the error from mls_subject_privileged() in the ifnet
  relabel check for MLS rather than returning 0 directly.

  This problem didn't result in a vulnerability currently as the central
  implementation of ifnet relabeling also checks for UNIX privilege, and
  we currently don't guarantee containment for the root user in mac_mls,
  but we should be using the MLS definition of privilege as well as the
  UNIX definition in anticipation of supporting root containment at some
  point.

  Submitted by:   Zhouyi Zhou <zhouzhouyi at gmail dot com>
  Sponsored by:   Google SoC 2007
2008-03-01 11:55:11 +00:00
Robert Watson 9e5140b3d6 Merge uipc_usrreq.c:1.212 from HEAD to RELENG_7:
Remove "lock pushdown" todo item in comment -- I did that for 7.0.
2008-03-01 11:51:12 +00:00
Robert Watson 84686af162 Merge uipc_usrreq.c:1.211 from HEAD to RELENG_7:
Correct typos in comments.
2008-03-01 11:50:45 +00:00
Robert Watson 9f48e1e65a Merge tcp_usrreq.c:1.166 from HEAD to RELENG_7:
In tcp_ctloutput(), don't hold the inpcb lock over sooptcopyin(), rather,
  drop the lock and then re-acquire it, revalidating TCP connection state
  assumptions when we do so.  This avoids a potential lock order reversal
  (and potential deadlock, although none have been reported) due to the
  inpcb lock being held over a page fault.

  PR:             102752
  Reviewed by:    bz
  Reported by:    Václav Haisman <v dot haisman at sh dot cvut dot cz>
2008-03-01 11:50:00 +00:00
Robert Watson 347520e91d Merge netisr.h:1.34 from HEAD to RELENG_7:
Update netisr comment for the SMPng world order: netisr is no longer
  implemented using the ISR facility, and cannot be triggered by calling
  splnet()/splx().
2008-03-01 11:44:30 +00:00
Bruce A. Mah 790df37d9e Break up a long sentence to make more grammatical sense and be easier
to read.

Problem pointed out by:	ceri
2008-03-01 04:10:20 +00:00
Bruce A. Mah 4a181d9445 New 7.0 post-release errata: tcpdump(1) TX/RX printing issue,
Linuxulator mmap(2) issue, re(4) data corruption issue, TCP options
issue, page footer in release documentation, wrong KDE version number.

Reviewed by:	kensmith
Submitted by:	a cast of several
2008-02-29 23:09:41 +00:00
Bruce A. Mah 97b32fe323 Set release type entities consistently. 2008-02-29 19:01:06 +00:00
Konstantin Belousov 5bd089d0e1 MFC
rev. 1.3 of linux_misc.h,
rev. 1.217 of linux_misc.c:

Sanitize arguments to linux_mremap().
Check that only MREMAP_FIXED and MREMAP_MAYMOVE flags are specified.
Check for the page alignment of the addr argument.
2008-02-29 14:58:08 +00:00
Sam Leffler 5821d7ae5e MFC 1.4: unbreak printing 802.11 tx/rx rates 2008-02-28 17:00:17 +00:00
David E. O'Brien a897d83b90 MFC: rev 1.16: install as awk. 2008-02-28 16:45:38 +00:00
Christian Brueffer ac7f04a717 MFC: rev. 1.25
Add missing words.
2008-02-28 06:09:23 +00:00
Bruce A. Mah 1fc98cbe2a Point RELENG_7 users at stable@ rather than current@.
Reminded by:	cnst
2008-02-28 06:01:48 +00:00
Sean Farley d0e929973f MFC:
Add the groupmod '-d' option to pw to allow the deletion of existing users
from a group without the need to perform the same operation by replacing
the existing list via the '-M' option.  The '-M' option requires someone
to fetch the existing members with pw, deleting the undesired members from
the list and sending the altered list back to pw.

    src/usr.sbin/pw/pw.c: rev 1.32 -> 1.33
    src/usr.sbin/pw/pw_group.c: rev 1.15 -> 1.16
    src/usr.sbin/pw/pw.8: rev 1.42 -> 1.43

Approved by:	wes (mentor)
2008-02-28 04:25:03 +00:00
Sean Farley addf00f1f5 MFC:
style(9) (verified no object changes)

    src/usr.sbin/pw/pw.c: rev 1.31 -> 1.32
    src/usr.sbin/pw/pw_group.c: rev 1.14 -> 1.15

Approved by:	wes (mentor)
2008-02-28 04:19:47 +00:00
Ken Smith 6148aa7d18 7.0-RELEASE is announced, start calling RELENG_7 -STABLE. 2008-02-27 22:27:35 +00:00
Remko Lodder df8d28f235 MFC rev 1.131 if_ti.c
Set the baudrate for if_ti.

  PR: kern/40516
  Submitted by: "Jin Guojun[VFF]" <jin at adsl-63-198-35-122 dot dsl dot snfc21 dot pacbell dot net>
  Approved by: imp (mentor, implicit for minor changes)
  MFC After: 1 week

Approved by:	imp (mentor, implicit)
2008-02-26 19:29:32 +00:00
Randall Stewart 7c1ff6bee3 - Fix patching error ... opps. (missing ;) 2008-02-26 13:29:05 +00:00
Alexander Motin b9a7b612f4 MFC rev. 1.147
Fix incorrect constant used in rev. 1.146 that broke node writer locking.
2008-02-26 12:40:06 +00:00
Randall Stewart d5d486f501 - Fix a bug in the connect() routine. A ref count was incremented
in the wrong place, which could cause a incorrect accounting undre
  certain error conditions. And worse when we have a duplicate
  connect we called TCB_LOCK() not TCB_UNLOCK().... which will
  lead to a system lockup (escalting lock wait scenario).
2008-02-26 11:33:12 +00:00
Randall Stewart d528642fc7 - For VRF enabled platforms, fix a memory leak when a VRF
is deleted
Obtained from:	[email protected]
2008-02-26 11:31:12 +00:00
Randall Stewart b0e7e02dbd Purge a stray #ifdef __NETBSD__ from the file. 2008-02-26 11:30:10 +00:00
Maxim Konovalov 7abec55cd2 MFC rev. 1.11: allow setkey(8) to recognize esp as a protocol
name for spdadd.
2008-02-26 09:44:36 +00:00
Maxim Konovalov 1dba82916d MFC rev. 1.226: correct EasyMP3 EM732X usb 2.0 flash mp3 player revision. 2008-02-26 09:38:09 +00:00
Maxim Konovalov 223ce2af56 MFC rev. 1.60: add Moxa Technologies CP-104EL PCI Express 4 port Serial card. 2008-02-26 09:33:57 +00:00
Maxim Konovalov 91643b80ae MFC rev. 1.112: fix command line parser bug: "ipfw nat 1 config if"
requires an argument.
2008-02-26 09:31:13 +00:00
John Baldwin 38bfd8f7cc MFC: Mostly sync kgdb with HEAD including the following changes:
- Add a new 'add-kld <kld>' command to locate a kld and load its symbols.
- If the quiet flag is specified, don't dump the unread portion of the
  message buffer on startup.
- Remove the warnx() from kgdb_lookup() and add it in callers where a
  failed lookup is warning worthy.
- Add a shared library backend for kernel files that treats klds as shared
  libraries and auto-load symbols for klds on startup.
- Build a section table from the kernel file so that 'info files' output
  looks sane.
2008-02-25 22:20:13 +00:00
Hajimu UMEMOTO 7096d9f932 MFC 1.69: Create a thread to handle passive cooling for 1st zone
which has _PSV, _TSP, _TC1 and _TC2.
2008-02-25 15:34:46 +00:00
Remko Lodder 6aeed0bc1b MFC rev 1.11 100.chksetuid
Eliminate xargs in favor of find -exec {} +

Requested by:	ceri
Approved by:	imp (mentor, implicit trivial changes)
2008-02-24 20:09:52 +00:00
Alexander Motin a0b28f7ba9 MFC rev. 1.35
Fix shutdown bug made by previous commit.
2008-02-24 18:31:16 +00:00
Remko Lodder 2975034994 MFC rev 1.597 to 1.598 Makefile.inc1
rev 1.597
  Give usr.bin/kdump/kdump_subr.c the same treatment as usr.bin/kdump/ioctl.c
  and usr.bin/truss/ioctl.c.  This is the correct way to address the problem
  that arises when doing an incremental build after a header used by kdump
  has been removed (cf. i4b disconnect a while ago)

  Explained by:	ru
  MFC after:	2 weeks

  rev 1.598
  Satisfy a particularly obstinate nit-picker :)

Approved by:	imp (mentor, implicit for trivial changes), des
		(I am doing several MFC's for him)
2008-02-24 14:31:41 +00:00
Remko Lodder 3f372a700b MFC rev 1.10 100.chksetuid
rev 1.10
  Rewrite to consume significantly less memory, by using find -s instead of
  find | sort.  As a bonus, this simplifies the logic considerably.  Also
  remove the bogus "overruning the args to ls" comment and the corresponding
  "-n 20" argument to xargs; the whole point with xargs is precisely that it
  knows how large the argument list can safely get.

  Note that the first run of the updated script may hypotheticall produce
  false positives due to differences between find's and sort's sorting
  algorithm.  I haven't seen this during testing, but others might.

  MFC after:	2 weeks

Approved by:	imp (mentor, implicit for trivial changes), des
		(doing some MFC's for him)
2008-02-24 14:26:44 +00:00
Remko Lodder 7d1e25d8da MFC rev 1.12 to 1.14 for ichwd.c
rev 1.12
  Tabify

  rev 1.13
  Add device IDs for the ICH9 family.

  PR:		i386/119126
  Submitted by:	Dan Lukes <[email protected]>
  MFC after:	1 week

  rev 1.14
  Add support for ICH8M.

  PR:		kern/119351
  Submitted by:	Takeharu KATO <[email protected]>
  MFC after:	1 week

MFC rev 1.6 to 1.8 for ichwd.h

  rev 1.6
  Tabify.

  rev 1.7
  Add device IDs for the ICH9 family.

  PR:		i386/119126
  Submitted by:	Dan Lukes <[email protected]>
  MFC after:	1 week

  rev 1.8
  Add support for ICH8M.

  PR:		kern/119351
  Submitted by:	Takeharu KATO <[email protected]>
  MFC after:	1 week

Approved by:	imp (mentor, implicit for trivial changes), des
		( I am doing some MFC's for him)
2008-02-24 14:01:09 +00:00
Ken Smith 84c97b4cd3 Speculate on the release date for FreeBSD 7.0. 2008-02-24 05:16:55 +00:00
Gregory Neil Shapiro 42ff8310ef MFC: Fix quoting for the dnsbl example -- m4 misparses quoted strings with
commas due to our deconstruction of the line in cf/feature/dnsbl.m4.

     PR:             120038
     Submitted by:   mattijs vreeling

     Revision  Changes    Path
     1.36      +1 -1      src/etc/sendmail/freebsd.mc
2008-02-24 01:03:33 +00:00
Gregory Neil Shapiro a0ea0f8de9 MFC: Use better examples (and comment them out for safety).
PR:             118837
     Submitted by:   Matthew Seaman

     Revision  Changes    Path
     1.4       +13 -6     src/etc/mail/access.sample
2008-02-24 01:00:07 +00:00
Christian Brueffer 954445db2a MFC: rev. 1.4
Add some missing Xrefs to drivers.
2008-02-21 23:04:43 +00:00
Rui Paulo 01f32c73e4 MFC r1.6
Don't attach to non Core CPUs. This is needed because on the PIII,
 querying the number of sensors returns > 0.

PR:             120541
Approved by:    njl (mentor)
2008-02-20 23:52:04 +00:00
Rui Paulo e62469f0d5 MFC r1.70
Skip validation of the C3 state if we disabled C3 by software (i.e.,
 via quirk).

Approved by:	njl (mentor)
2008-02-20 15:51:54 +00:00
Rui Paulo b91d63bf8b MFC r1.68
Allow the user to override the current active cooling state if state
 is currently TZ_ACTIVE_NONE

Approved by:  njl (mentor)
2008-02-20 15:49:50 +00:00
Remko Lodder ac57224b57 MFC rev 1.15 pf.conf.5
MFOpenBSD rev 1.393 pf.conf.5

    do not describe `/' as solidus; from Allen (freebsd pr120484);

  PR:		120484
  Submitted by:	Allen <alandsidel at 1001islington dot com>
  MFC After:	3 days
2008-02-20 10:45:03 +00:00
Rong-En Fan 9a77fdcd41 MFC the following revisions:
src/etc/defaults/rc.conf	1.323
src/etc/rc.firewall		1.54
src/share/man/man5/rc.conf.5	1.333 (by chinsan)

Original log:

  Improve kernel NAT support in rc.firewall

  - Allow IP in firewall_nat_interface, just like natd_interface
  - Allow additional configuration parameters passed to ipfw via
    firewall_nat_flags
  - Document firewall_nat_* in defaults/rc.conf

  Tested by:      Albert B. Wang <abwang at gmail.com>                            MFC after:      1 month
2008-02-20 01:39:04 +00:00
Ken Smith 435635ec30 Back out the update to 1.2 due to problems encountered during testing
of 7.0-RC2.

Reviewed by:	rwatson
X-MFC-after:	about 12 hours so we can proceed with 7.0-RELEASE.
2008-02-19 17:23:11 +00:00
Justin T. Gibbs a8b790f7e4 MFC: Properly advertise U320 transport capabilities to CAM.
MFC: Quiet sense data logging behind AHD_DEBUG/AHD_SHOW_SENSE.

Approved by: scottl
2008-02-18 17:37:03 +00:00
Diomidis Spinellis 4989d29b36 MFC version 1.3
Fix collation order for accented characters.
2008-02-18 09:17:12 +00:00
Robert Watson dfdc15e281 Merge priv.h:1.18 from HEAD to RELENG_7:
Introduce a new privilege allowing to set certain IP header options
  (hop-by-hop, routing headers).

  Leave a few comments to be addressed later.

(Note: This does not MFC the use of the privilege, only the definition of
the privilege.)
2008-02-16 16:31:32 +00:00
Markus Brueffer 34ae0937b4 MFC rev. 1.50:
Fix calculation of descriptor tag checksums. According to ECMA-167, Part 4,
  7.2.3, bytes 0-3 and 5-15 are used to calculate the checksum of a descriptor
  tag.

Approved by:	emax (mentor)
2008-02-16 16:21:17 +00:00
Bruce A. Mah f56c80b9c3 MFC: AMD 6.1.5, awk 20071023, OpenPAM Hydrangea.
Remove definition and use of &merged; marker...we don't use this on
STABLE branches.
2008-02-16 15:56:43 +00:00
Hajimu UMEMOTO 07f25e0959 MFC 1.66: Add sysctl mibs for _TSP, _TC1 and _TC2 which is user
overridable but is blocked on user_override mib.
Not a few people want to use a passive cooling without their ACPI
BIOS support.
2008-02-16 12:45:26 +00:00
Robert Watson fe063d65df Merge priv.h:1.19 from HEAD to RELENG_7:
Add privilege PRIV_NNPFS_DEBUG for use with Arla/nnpfs.  This privilege
  will authorize debugging system calls.

(Slightly sooner than the 1 month MFC time I specified, but it's just a
privilege definition, not a use of the privilege).
2008-02-16 12:02:30 +00:00
Robert Watson b1f545b34a Merge priv.h:1.17 from HEAD to RELENG_7:
Add a new privilage category for DDB(4), and add PRIV_DDB_CAPTURE to
  control access to the DDB capture buffer.
2008-02-16 11:59:56 +00:00
Robert Watson 95356feab1 Merge priv.h:1.16 from HEAD to RELENG_7:
date: 2007/10/21 22:50:11;  author: rwatson;  state: Exp;  lines: +1 -0
  Add PRIV_VFS_STAT privilege, which will allow overriding policy limits on
  the right to stat() a file, such as in mac_bsdextended.

  Obtained from:  TrustedBSD Project
2008-02-16 11:59:23 +00:00
Christian Brueffer 635f3800a6 MFC: rev. 1.3
The hptrr driver first appeared in 6.3, not 5.3.
2008-02-16 09:00:02 +00:00
Rong-En Fan 4e153cea29 MFC rev 1.96
- Remove duplicate tputs.3 from MLINK. As we use termcap in the bsae, remove
  the one links to curs_terminfo.

Submitted by:   David Naylor <blackdragon at highveldmail.co.za>
2008-02-16 05:36:22 +00:00
John Baldwin 2c84fc7617 MFC: Fix a typo when testing for the NO_C3 quirk. 2008-02-15 17:05:39 +00:00
David E. O'Brien 762273c442 MFC: Turn most ffs 'DIAGNOSTIC's into INVARIANTS. 2008-02-15 16:43:03 +00:00
Colin Percival 20e4c828cd MFC rev.1.13: Use case-insensitive comparisons for HTTP header keywords. 2008-02-15 16:16:21 +00:00
Christian Brueffer 0695ef5be3 MFC: rev. 1.325
Remove dublicate MLINK.
2008-02-15 10:29:40 +00:00
Kevin Lo f85c7f9936 MFC:
- sys/dev/usb/usbdevs (revision 1.337)
- sys/dev/usb/if_rum.c (revision 1.16)

Add the SparkLAN RT2573, found in HP s3200n

Obtained from: OpenBSD
2008-02-15 05:29:18 +00:00
Marius Strobl 18c862f191 MFC: 1.87
Change another argument and a variable both related to netname() to
be also 32-bit on all archs.
2008-02-14 21:24:43 +00:00
Christian Brueffer 82f62800f1 MFC: rev. 1.26
Add missing \n.

Approved by:	rwatson (mentor), [email protected]
2008-02-14 20:20:06 +00:00
Marcel Moolenaar 0850678e46 Insta MFC: machdep.c:1.230, pmap.c:1.197
On Montecito processors, the instruction cache is in fact not
coherent with the data caches. Implement a quick fix to allow
us to boot on Montecito, while I'm working on a better fix in
the mean time.

Commit made on Montecito-based Itanium...
2008-02-14 19:15:46 +00:00
Jung-uk Kim 76288e93f2 MFC: sys/amd64/linux32/linux32_machdep.c 1.46
sys/i386/linux/linux_machdep.c		1.80

Fix Linux mmap with MAP_GROWSDOWN flag.
2008-02-14 18:41:00 +00:00
Andrew Gallatin 50fc08019c MFC: Merge the MSI-X, "multi-slice" version of the mxge driver
and firmware.
2008-02-14 18:33:50 +00:00
Mitsuru IWASAKI 53e72e3e32 MFC: share/man/man4/ciss.4:1.15, sys/dev/ciss/ciss.c:1.87
Add `hw.ciss.nop_message_heartbeat' tunable (default disabled) for
NOP-message polling in ciss_periodic().
Note that setting the tunable to non-zero can be workaround only for
`ADAPTER HEARTBEAT FAILED' problem, and may freeze the system w/o
the problem.
2008-02-14 17:01:32 +00:00
Simon L. B. Nielsen fb2cb48d41 Fix sendfile(2) write-only file permission bypass.
Security:	FreeBSD-SA-08:03.sendfile
2008-02-14 11:46:08 +00:00
cvs2svn f244136009 This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2008-02-13 21:58:48 +00:00
John Baldwin aea9cbd19b MFC 1.108 and 1.109: Sync filesystem types with NetBSD and add a type for
ZFS.

This should fix the build of gpt(8).

Pointy hat:	jhb
2008-02-13 15:23:31 +00:00
John Baldwin 4718e616c6 MFC: Add ZFS support. 2008-02-12 20:27:33 +00:00
John Baldwin 103823db75 MFC: Use cpu_spinwait() in DELAY(). 2008-02-12 20:22:29 +00:00
John Baldwin 2e1abf645c MFC: Relax the check for a PCI-express chipset. 2008-02-12 20:21:35 +00:00
John Baldwin 56752393b8 MFC: Add a note pointing to build(7) for more info. 2008-02-12 20:19:34 +00:00
John Baldwin 16879b9d63 MFC: Map 'boot' to GPT_ENT_TYPE_FREEBSD_BOOT when parsing UUIDs. 2008-02-12 19:23:37 +00:00
John Baldwin f93069cfe9 MFC: Properly handle ACPI table headers that cross a page boundary when
looking for the MADT during early boot.
2008-02-12 19:20:10 +00:00
John Baldwin f1987f5af8 MFC: Remove a conditional that is always true. 2008-02-12 19:16:53 +00:00
John Baldwin a385f10311 MFC: Use pause(9) instead of tsleep() on a stack variable. 2008-02-12 19:15:21 +00:00
John Baldwin b00bfaa267 MFC: Use cpu_spinwait() in DELAY(). 2008-02-12 19:14:01 +00:00
Marius Strobl 93e03e47a8 MFC: 1.30
- Fix a typo in a comment.
- Fix whitespace according to style(9).
- Sync the comment describing why we have to wait in nsphy_reset()
  with nsphyter_reset(). It's true that the manual tells to not do a
  reset within 500us of applying power but that's unlikely the cause
  of problems seen here. Generally having to wait 500us after a reset
  however is.
2008-02-11 20:42:36 +00:00
Remko Lodder 3906be98bc With doc-hat, MFC cpio.5
This unbreaks the current build.
2008-02-11 13:14:16 +00:00
Remko Lodder 41136ea782 MFC rev 1.18 timed.8
Typo fix.

  Spotted by:	brueffer
2008-02-11 08:14:58 +00:00
Remko Lodder f3250ab1af MFC rev 1.10, 1.11 nve.4
v1.10
  There is no list to stop, so dont use .El.

  Noticed by:   brueffer

  v1.11
  Language nit.
2008-02-11 07:51:05 +00:00
Remko Lodder 60f2823eca MFC rev 1.70 bsdlabel.8
Remove redundant whitespace.

  Noticed by:	brueffer
2008-02-11 07:48:12 +00:00
Remko Lodder db398eb070 MFC rev 1.23 access.2
After issueing a ntpdate [1] I noticed it's already 2008, reflect that
  in the last modified date.

  Noticed by:     brueffer [1]
2008-02-11 07:45:17 +00:00
Remko Lodder ed6ea97e0c MFC rev 1.21, 1.22 access.2
v1.21
  Fix some style nits.

  Prodded by:   brueffer

  v1.22
  Fix typo (s/existance/existence/)

  Noticed by:   ceri
2008-02-11 07:20:12 +00:00
Tim Kientzle 4b5373e179 MFC: Three files that I accidentally left out of the big MFC to 7-STABLE. 2008-02-11 01:00:27 +00:00
Tim Kientzle b70731e4a9 MFC: Implementation of new archive_entry_strmode() function. 2008-02-11 00:56:59 +00:00
Tim Kientzle 8349d0ebaa MFC: libarchive 2.4.12
* Formats are now only bid once per file, not once per entry
   (Affects archive_read.c, most format readers, internals manpage)
 * Correct tar/cpio history in libarchive_formats manpage
 * Avoid unnecessary copies in {write,read}_compression_none
   (significant performance boost for uncompressed archives!)
 * Protect against zero-length writes in gzip/bzip2 compressors
 * Tar reader: improve hardlink length heuristics, GNU tar --posix
   --sparse support, related fixes to SCHILY.realsize handling
 * Cpio reader: recover from sync errors
 * Cpio writer: pad symlinks properly in newc format
 * Ar writer: close out empty archive correctly
 * Zip reader: ignore PK00 header, code cleanups from des@
 * Iso9660 reader: support device node entries
 * archive_write_disk: support hardlinks with bodies, enforce
    maximum file size
 * Reconnect progress callback from archive_read_extract()
 * New: archive_entry_strmode()
 * New: mtree reader
 * New: "linkresolver" makes it easier to do hardlink resolution
 * UUencode test reference files (be nice to CVS)
 * New test: exercise very large entries (2G up to 1T) in tar archives
 * New test: Detailed verification of cpio odc and newc formats
 * New test: Various strategies for restoring multiple links to a file
 * New tests: Various compatibility checks against gzip, zip, old tar, etc.
 * New test: cpio recovery from damaged archives
 * New test: mtree reading
 * Improved statistics reporting from test harness
 * Plus minor portability improvements
2008-02-11 00:31:09 +00:00
Xin LI af06cef1e4 MFC revision 1.32:
date: 2008/01/12 00:54:47;  author: delphij;  state: Exp;  lines: +4 -0
Plug memory leaks that is observed when argbuf or argspc is used in the
context.

Submitted by:	Michal Vranek <michal.vran
2008-02-11 00:24:59 +00:00
Tim Kientzle 4b9c014d54 MFC: Various, including:
* -l now always has the POSIX behavior (GNU tar recently adjusted their
   -l to comply with POSIX, so bsdtar no longer has to guess what the
   user really meant).
 * More complete COPYING information.
 * Various portability fixes and minor configuration changes.
This brings bsdtar into line with -CURRENT, except for one change that
relies on a new libarchive feature that hasn't been MFCed yet.
2008-02-10 23:24:16 +00:00
Marius Strobl 1d68286d55 MFC: conf/files 1.1266; dev/mii/miidevs 1.48; dev/mii/nsphyter.c 1.1;
dev/mii/nsphyterreg.h 1.1; modules/mii/Makefile 1.32

Add a driver for the National Semiconductor DP83815, DP83843 and
DP83847 PHYs.

PR:	112654
2008-02-10 16:02:50 +00:00
Marius Strobl e673ac080b MFC: 1.31
Sort values according to style.Makefile(5).
2008-02-10 15:24:12 +00:00
Marius Strobl 16a54fa055 MFC: netstat.h 1.53; route.c 1.86
Fix netname() and routename() on big-endian LP64 archs.
2008-02-10 15:19:05 +00:00
Joseph Koshy 67cc202d81 MFC r1.3: "Document the return type for gelf_fsize(3)." 2008-02-10 14:42:17 +00:00
Joseph Koshy d6a16e6740 MFC [r1.3 libelf_data.c, r1.5 elf.3]:
"Sections of type SHT_GNU_versym use ELF type ELF_T_HALF.  Update manual
   page and code to match."
2008-02-10 14:34:36 +00:00
Remko Lodder d229058370 MFC rev 1.9 nve.4
Add 1000baseTX support for the nve driver, which is known here and there.

  Also mention that the driver sometimes returns '10baseTX' as output instead
  of 100baseTX (which is the case at that moment).

  PR: docs/115284
  Submitted by: Julian Stacey Jhs <jhs at berklix dot org>
  MFC After: 3 days
2008-02-10 12:35:04 +00:00
Remko Lodder 04f29bf09a MFC rev 1.17 timed.8
Enhance descriptions in the timed manual.

  PR: docs/115445
  Submitted by: "Julian Stacey" <jhs at berklix dot org>
  MFC After: 3 days
2008-02-10 12:32:59 +00:00
Remko Lodder 730a625863 MFC rev 1.69 bsdlabel.8
Attempt to describe the ''auto'' type a bit better in the default
  section (if nothing had been specified, or if the auto type had
  been specified, a default layout is used).

  PR: docs/116047
  Submitted by: Ian Smith <smithi at nimnet dot asn dot au>
  Minor modifications by me.
2008-02-10 12:31:06 +00:00
Remko Lodder 41e7bc7b53 MFC rev 1.20 access.2
Make the warning a bit less 'broad' then it used to be. The access
  is seems to be a problem for SUID applications, which we like to
  prevent as much as possible.

  PR: docs/39530
  Submitted by: Soren Spies <sspies at apple dot com>
  MFC After: 3 days
2008-02-10 12:28:30 +00:00
Remko Lodder 9596f067d7 MFC rev 1.22 hosts.equiv.5
Improve readability for the hosts.equiv file regarding the notation
  of hostnames.

  PR: docs/35953
  Submitted by: "Gary W. Swearingen" <swear at blarg dot net>
  With minor modifications by me.
2008-02-10 12:26:03 +00:00
Remko Lodder 0e51633278 MFC rev 1.153 nfs_srvsubs.c
Use nfsrv_destroycache() only once, else it crashes the server.

  PR: kern/118152
  Submitted by: Bjoern Groenvall <bg at sics dot se>
  Approved by: imp (mentor, a while ago already), jhb
  MFC After: 3 days

Approved by:	imp (mentor, implicit)
2008-02-10 11:19:34 +00:00
cvs2svn 5376566dab This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2008-02-09 05:16:27 +00:00
Sam Leffler 76816d94f6 MFC 1.4: add opaque pointer to tx ampdu state for drivers 2008-02-08 21:29:12 +00:00
Sam Leffler 8b16f18f60 note addition of m_collapse 2008-02-08 21:26:25 +00:00
Sam Leffler 252599afe2 bump for addition of m_collapse 2008-02-08 21:01:39 +00:00
Sam Leffler d227a6fb5a MFC: promote ath_defrag to m_collapse 2008-02-08 20:58:19 +00:00
Ruslan Ermilov e6fafa74a9 MFC: 1.75: Revise TECHNICAL DETAILS. 2008-02-08 14:01:02 +00:00
Doug Barton 5a6bd12da6 MFC version 1.14, from the 4 February 2008 update:
IPv6 addresses for 6 of the root name servers!
2008-02-07 20:56:34 +00:00
Ulf Lilleengen 1d3e550c8f MFC revision 1.13
- Add extra paths for GEOM_LIBRARY_PATH to the fixit environment to enable all
  geom commands in a chrooted environment on the livefs cd.

PR:		misc/120169
Approved by:	pjd (mentor)
2008-02-07 12:21:21 +00:00
Ulf Lilleengen 65438f4a9a - Forced commit to note that revision 1.19.2.1 log was misspelled and that comma
should be spelled as colon.

Approved by:	pjd (mentor)
2008-02-07 12:17:18 +00:00
Ulf Lilleengen c349e7e8cf MFC revision 1.21
- Update geom(8) to explain that GEOM_LIBRARY_PATH can take a comma-separated
  list of paths.

Approved by:	pjd (mentor)
2008-02-07 12:13:48 +00:00
Ulf Lilleengen 877ee084a9 MFC revision 1.34
- Make geom commands handle multiple library paths in the GEOM_LIBRARY_PATH
  environment variable using ':' as a separator.

Approved by:	pjd (mentor)
2008-02-07 12:10:47 +00:00
Dmitry Morozovsky 150ddcf433 MFC rev 1.5:
There is no PUC_FASTINTR option anymore.
2008-02-07 10:22:14 +00:00
Rink Springer e694ed9846 MFC 1.35:
Allow watch(8) to use more than 10 snp* devices. This limitation was purely
due to the way watch(8) looks for available snoop devices.

PR:		bin/118286
Submitted by:	Mykola Zubach <[email protected]>
Reviewed by:	rwatson, csjp, imp (all a long time ago)
Approved by:	imp (mentor) (long time ago)
2008-02-07 07:36:31 +00:00
Rink Springer 00c668e97e MFC 1.14:
Fix bootparamd on 64 bit platforms - at least amd64 was broken due to the
code believing long == 64 bits and using it to store/compare IPv4 addresses.

PR:		bin/112163
Submitted by:	Tyler Spivey <[email protected]>
Reviewed by:	imp
Approved by:	imp (mentor)
2008-02-07 07:31:16 +00:00
Pierre Beyssac 1a0c75dba4 MFC rev 1.4: fix a bug in hexadecimal formatting of the CHAP digest:
bytes >= 0x80 were formatted as 0xff, causing the authentication
to fail.

Note: fast MFC to RELENG_7 and RELENG_7_0 to get the changes in
time for 7.0-RC2.

Approved by:	re (kensmith)
2008-02-06 23:57:11 +00:00
Alexander Motin b1e8ac0766 MFC:
Add option to set packets per second limits instead of default
bits per second ones.
2008-02-06 21:52:55 +00:00
Alexander Motin 36e7157612 MFC:
Do not use bcmp() to compare two bytes with constants.
2008-02-06 21:44:45 +00:00
Alexander Motin 342b8095bd MFC rev. 1.47
Implement stack protection based on GET_STACK_USAGE() macro.
This fixes system panics possible with complicated netgraph setups
and allows to avoid unneded extra queueing for stack unwrapping.
2008-02-06 21:08:58 +00:00
Alexander Motin 16f4570b59 MFC ng_base.c rev. 1.141-1.146:
Implement stack protection based on GET_STACK_USAGE() macro.
This fixes system panics possible with complicated netgraph setups
and allows to avoid unneded extra queueing for stack unwrapping.
2008-02-06 20:50:50 +00:00
Xin LI dedd09bc11 Revert rev. 1.128, we have a hard link generated from new
hptrr(4) to rr232x.

Pointed out by:	bruffer
Pointy hat to:	delphij
2008-02-06 19:45:45 +00:00
Xin LI 8e0ecde08c Reflect rr232x(4) manpage removal 2008-02-06 18:51:15 +00:00
Sepherosa Ziehau 4caef993a0 MFC: rt2560.c 1.19
rt2560var.h	1.4
     rt2560reg.h	1.3
Various bug fixes for 2560 parts of ral(4)

Approved by: sam (mentor)
2008-02-06 12:05:04 +00:00
Scott Long 541f68c6d8 Fix a symbol conflict between hptrr and hptmv 2008-02-06 08:33:15 +00:00
Scott Long 61d8838669 Add a note that the hptrr driver supersedes the rr232x driver. 2008-02-06 03:35:55 +00:00
Mitsuru IWASAKI dbf1af3ead MFC revision: 1.83, 1.85, 1.86
Add NOP-message polling to ciss_periodic().
Disable adapter by detecting adapter is dead.

Reviewed by:	scottl
Approved by:	re (kensmith)
2008-02-06 01:44:44 +00:00
Mitsuru IWASAKI 0e6611dfd8 MFC revistion: 1.244
Enter the sleep state immediately without waiting for timeout if
devd(8) is not running such as the system in single user mode.

Approved by:	re (kensmith)
2008-02-06 01:38:04 +00:00
Mitsuru IWASAKI 5ffca72edf MFC revision: subr_bus.c:1.204, bus.h:1.79
Add devctl_process_running() so that power management system driver
can check whether devd(8) is running.

Approved by:	re (kensmith)
2008-02-06 01:34:18 +00:00
Scott Long 0b0ae3f9d9 Update the hptrr driver to version 1.2. This adds port multiplier support
for several cards.  See the Highpoint website for more information.  Again,
many thanks to Highpoint for their continued support of FreeBSD.
2008-02-06 01:02:20 +00:00
Kip Macy a9b9f44618 Don't pollute the mbuf helper routine namespace 2008-02-05 22:20:16 +00:00
Alexander Motin 46a518342f MFC rev. 1.23-1.24
- Avoid data copying when it is possible. bpf_filter() is able to work
directly on mbuf chain
 - Prepare hooks direct pointers on setup to avoid heavy ng_findhook() calls
during operarion.
2008-02-05 19:48:04 +00:00
Alexander Motin d69014c9ad MFC rev. 1.34
Move all possible node logic out of the rcvdata() function
to the newhook()/disconnect().
Unify function names with other nodes.
2008-02-05 19:33:03 +00:00
Alexander Motin 5b4d7b8835 MFC rev. 1.89-1.91
Implement Session-ID hashing to improve receive performance scalability
for big number of concurrent sessions.
2008-02-05 19:24:09 +00:00
Sam Leffler 21ddbdbb81 MFC 1.115: fix use with altq
Submitted by:	sephe
2008-02-05 18:27:54 +00:00
Simon L. B. Nielsen 141dcad356 MFC 1.2:
Unbreak detection of cryptodev support for FreeBSD which was broken
  with OpenSSL 0.9.8 import.

  Note that this does not enable cryptodev by default, as it was the
  case with OpenSSL 0.9.7 in FreeBSD base, but this change makes it
  possible to enable cryptodev at all.
2008-02-05 18:10:31 +00:00
David E. O'Brien 3ba355b721 MFC: 1.17 (style nit) 2008-02-05 17:35:29 +00:00
Christian S.J. Peron a0b05a6750 MFC revision 1.24
Whitespace fix
2008-02-05 15:09:24 +00:00
Christian S.J. Peron 5344975cfb MFC revision 1.23
Make sure we handle listen() and eliminate console messages for unknown
event types.
2008-02-05 14:34:37 +00:00
Julian Elischer 0f4ea69cd7 MFC changes from 1.14 for sys/lock.c and 1.127+1.128 for thread/thr_kern.c
this copes with the fact that during a fork the child may get
really screwy state in the threading system due to the
sudden vaporisation of it's sibling threads.
2008-02-04 19:59:40 +00:00
Sam Leffler ecdbdf6808 MFC 1.15: updates for additional chip support
MFC after:	3 days
2008-02-04 03:33:55 +00:00
Sam Leffler ac7268030c MFC 1.8: correct typo that broke check when handling addba response
MFC after:	3 days
2008-02-04 03:32:56 +00:00
Sam Leffler 7b5a48831b MFC 1.50: correct tx rate displayed by list sta
MFC after:	3 days
2008-02-04 03:31:28 +00:00
Sam Leffler 16657ba7ed MFC 1.49: fix list mac
MFC after:	3 days
2008-02-04 03:30:27 +00:00
Doug Ambrisko 09f0bb7230 MFC: Fix some bugs in dealing with DCMD's without data. MegaCli was sending
down some DCMD's without any data.  Thanks to Dell and LSI for helping
to provide clues to figure out this problem.  Now MegaCli can upgrade
the firmware and should work identical when run on Linux.
2008-02-03 22:32:52 +00:00
Christian Brueffer 66e492f17c MFC: rev. 1.406 + 1.407
MLINK hptrr(4) to rr232x(4).
2008-02-03 17:32:25 +00:00
Christian Brueffer ed3d71898a MFC:
The rr232x driver has been removed, kill it here as well.
2008-02-03 16:26:17 +00:00
Scott Long 6271bb721f Update the hptiop manual page for the new driver. 2008-02-03 16:19:27 +00:00
Scott Long c1c38a084b Update the hptiop driver to version 1.3. This adds support for the 4xxx
series of SAS adapters.  Thanks again to Highpoint for their continued
support of FreeBSD.
2008-02-03 16:18:55 +00:00
Christian Brueffer 72f5b8987a MFC: rev. 1.553
Don't build the rr232x module, it has been removed.

Approved by:	rwatson (mentor)
2008-02-03 12:13:02 +00:00
Matteo Riondato 0d49d9741c MFC rev 1.95,1.96 mountd.c
MFC rev 1.30 mountd.8
2008-02-03 10:45:36 +00:00
Alexander Motin 5bd0af954e Revert previous commit.
glebius@ noticed that it was not a bug, but undocumented feature.
2008-02-03 10:30:45 +00:00
Pyun YongHyeon a06654f8d5 MFC if_msk.c rev 1.24 to RELENG_7.
Add MSI support for 88E8058(Yukon EC Ultra). Unlike other Yukon II
  family 88E8058 supports only one MSI message. Teach msk(4) to handle
  that case.
2008-02-03 08:12:58 +00:00
Pyun YongHyeon 0d9449b4b3 MFC msk.4 rev 1.5 to RELENG_7.
Add 88E8058 to the list of supported hardware.
2008-02-03 08:06:28 +00:00
Pyun YongHyeon 7be5eebaa9 MFC if_msk.c rev 1.23, if_mskreg.h 1.10 to RELENG_7.
Add device id for 88E8058(Yukon EC Ultra) which is found on 3rd
  generation MacBooks.
  Unfortunately 88E8058 supports one MSI message so msk(4) needs more
  generic way to handle the MSI capability.

  PR:   118110
2008-02-03 07:57:04 +00:00
Pyun YongHyeon f4c28cc4d6 MFC if_msk.c rev 1.22, if_mskreg.h 1.9 to RELENG_7.
Make phy respond only at address 0. This makes phy driver attached
  only at address 0 which is supposed to be the only valid phy address
  on Marvell PHY. The more correct solution would be masking PHY
  address ranges allowable in PHY probe routine. Unfortunately,
  FreeBSD has no way to retrict the PHY address ranges or to pass special
  flags to PHY driver.
  This change assumes that PHY hardwares attached to msk(4) would be
  Marvell made 88E11xx PHY.

  With this changes the phantom phys attached on 88E8036(Yukon FE)
  should disappear.
2008-02-03 07:48:13 +00:00
Pyun YongHyeon 630a5bd1ff MFC if_msk.c rev 1.21 to RELENG_7.
o Don't hardcode that Yukon FE has 16KB SRAM. In fact, Yukon FE has
     only 4KB SRAM.
   o Rework setting Tx/Rx RAM buffer size. Give receiver 2/3 of memory
     and round it down to the multiple of 1024. The RAM buffer size of
     Yukon II should be multiple of 1024. This fixes bogus RAM buffer
     configuration used in Yukon FE.
2008-02-03 07:39:33 +00:00
Pyun YongHyeon caeede9270 MFC if_msk.c rev 1.20, if_mskreg.h rev. 1.8 to RELENG_7
Drop maintaing hardware feature(bug) lists for Yukon II. We don't have
  publicly available datasheet for Yukon II and don't know what
  bug/workaround exist for the specific hardware revision. Also I don't
  think the vendor will release hardware errata in near future.
  The hardware feature lists were not used at all except setting water
  mark registers. Since msk(4) should know exact chip model/revision
  number to decide which hardware capability could be used the extra
  feature lists were redundant.
2008-02-03 07:35:04 +00:00
Scott Long 7c390e3f8e Remove the rr232x manual page. 2008-02-03 07:31:49 +00:00
Scott Long 71501f8fb5 Remove the rr232x driver. It has been superseced by the hptrr driver. 2008-02-03 07:28:39 +00:00
Pyun YongHyeon 398b288dc8 MFC if_msk.c rev 1.19, if_mskreg.h rev. 1.7 to RELENG_7
Various fixes for EC Ultra.
   o Enable jumbo frame support for EC Ultra and disable jumbo frame
     for FE.
   o Enable store and forward mode for standard MTU sized frame.
   o Enable TSO for EC Ultra. However TSO/checksum offload is disabled
     for jumbo frame case. Because EC Ultra can't use store and forward
     mode for jumbo frame TSO/checksum offload is not available.
   o Adjust Tx GMAC almost empty threshold value and add a jumbo frame
     water mark. The maic value was obtained from Marvell's sk98lin
     driver.
   o Fix EC Ultra chip revision number.
2008-02-03 07:26:11 +00:00
Pyun YongHyeon 2aac2b48db MFC e1000phy.c, rev 1.20 to RELENG_7
Reset autonegotation timer if media option is not IFM_AUTO.
  Make mii_ticks advance, autonegiation is retried every
  mii_anegticks seconds.
2008-02-03 05:32:55 +00:00
Pyun YongHyeon 005c6b20f7 MFC if_re.c, rev 1.100 to RELENG_7
By definition promiscuous mode should see all unicast frames as well
  as multicast/broadcast frames. Previously re(4) ignored multicast
  frames in promiscuous mode. The RTL8169 datasheet was not clear
  how it handles multicast frames in promiscuous mode.

  PR:	kern/118572
2008-02-03 05:18:14 +00:00
Pyun YongHyeon cfe66b59d0 MFC if_txp.c, rev 1.48 to RELENG_7.
Read MII_ANAR register and get common denominator ability.

  PR:	92599
2008-02-03 04:16:26 +00:00
Pyun YongHyeon 97096c313d MFC fix for IEEE 802.3 compliance of auto-negotiation process.
IEEE 802.3 Annex 28B.3 explicitly specifies the following relative
  priorities of the technologies supported by 802.3 Selector Field
  value.

  1000BASE-T full duplex
  1000BASE-T
  100BASE-T2 full duplex
  100BASE-TX full duplex
  100BASE-T2
  100BASE-T4
  100BASE-TX
  10BASE-T full duplex
  10BAST-T

  However PHY drivers didn't honor the order such that 100BASE-T4 had
  higher priority than 100BASE-TX full duplex. Fix that long standing
  bugs such that have PHY drivers choose the highest common denominator
  ability.
  Fix a bug in dcphy which inadvertently aceepts 100BASE-T4.

  PR:	92599
2008-02-03 04:12:06 +00:00
David E. O'Brien 72b5649887 MFV: remove files not part of version 4.23. 2008-02-02 18:28:31 +00:00
Alexander Motin 27c87e7cf9 MFC rev. 1.15
Run expire even without export hook connected.
2008-02-02 15:48:05 +00:00
David E. O'Brien b9851b7a03 MFC: rev 1.1.1.7 - fix -p. 2008-02-02 07:48:06 +00:00
Sam Leffler 1de3f6edab MFC 1.7: use m_gethdr to populate the rx ring 2008-02-02 06:49:57 +00:00
Robert Watson 91a4c98c29 Merge uipc_sockbuf.c:1.175, uipc_socket.c:1.304, uipc_syscalls.c:1.264,
sctp_input.c:1.67, sctp_peeloff.c:1.17, sctputil.c:1.73,
socketvar.h:1.161 from HEAD to RELENG_7:

  Correct two problems relating to sorflush(), which is called to flush
  read socket buffers in shutdown() and close():

  - Call socantrcvmore() before sblock() to dislodge any threads that
    might be sleeping (potentially indefinitely) while holding sblock(),
    such as a thread blocked in recv().

  - Flag the sblock() call as non-interruptible so that a signal
    delivered to the thread calling sorflush() doesn't cause sblock() to
    fail.  The sblock() is required to ensure that all other socket
    consumer threads have, in fact, left, and do not enter, the socket
    buffer until we're done flushin it.

  To implement the latter, change the 'flags' argument to sblock() to
  accept two flags, SBL_WAIT and SBL_NOINTR, rather than one M_WAITOK
  flag.  When SBL_NOINTR is set, it forces a non-interruptible sx
  acquisition, regardless of the setting of the disposition of SB_NOINTR
  on the socket buffer; without this change it would be possible for
  another thread to clear SB_NOINTR between when the socket buffer mutex
  is released and sblock() is invoked.

  Reviewed by:    bz, kmacy
  Reported by:    Jos Backus <jos at catnook dot com>
2008-02-01 22:51:40 +00:00
Jung-uk Kim e0f99e0ebd MFC: 1.159, 1.160
Do not sanitize disk geometry if it is set by scripts in non-interactive mode.
2008-02-01 20:29:56 +00:00
Alexander Motin dea11784f5 MFC rev. 1.41
mdoc and language fixes for the previous commit, also bump .Dd.
2008-01-31 12:01:18 +00:00
Alexander Motin 3224759978 MFC rev. 1.40-1.41
Document new "AC-Name\Service-Name" connect syntax.
2008-01-31 11:55:53 +00:00
Randall Stewart 73484334b4 - Fixes is a bug in sctp_auth that will cause a panic if
a socket is closed as it gets auth'd data in. (sctp_auth.c)
- Reverts the priority back to 0, do not change prioritys (sctp_bsd_addr.c)
- Fixes a wrap error in calculation of gap ack segments that
  wrap the TSN number. (sctp_indata.c)
- Fixes a comment, and also moves a lock up to cover the pulling
  of the VRF from the inp structure. (sctp_pcb.c)
2008-01-31 09:58:11 +00:00
Christian Brueffer a5b21bd7e8 MFC: rev. 1.194
Correct the kernel config hint in a printf statement.

Approved by:	rwatson (mentor)
2008-01-31 09:31:41 +00:00
Robert Watson a3061d42b5 Merge ddp_output.c:1.32 from HEAD to RELENG_7:
Annotate two possible bugs in a comment: (1) we allocate and explicitly
  prepend a data mbuf in front of a header mbuf without moving the header
  to the new mbuf, and (2) a possible alignment problem on architectures
  with strict alignment as reported in kern/4184.

  PR:     kern/4184 (1)
2008-01-30 22:25:34 +00:00
Robert Watson 0541afcb55 Merge aarp.c:1.45 from HEAD to RELENG_7:
Add additional robustness to at_aarpinput() by testing for broadcast
  addresses as the source of an AARP request.  While this PR was submitted
  in the context of work in OpenBSD to port netatalk (in 1997), I've
  synchronized the code more to our ARP input routine, which had similar
  requirements.

  Submitted by:   Denton Gentry
  PR:             kern/4184
2008-01-30 22:25:13 +00:00
Christian Brueffer 726f528bbb MFC:
Remove references to the obsolete card(4) manpage.
2008-01-30 17:59:19 +00:00
Christian Brueffer c4bf630b89 MFC:
OLDCARD is long gone, so finally remove the oldcard.4 manpage.
2008-01-30 17:58:15 +00:00
Ruslan Ermilov defc9ef763 Regen. 2008-01-30 15:07:01 +00:00
Ruslan Ermilov 826c91b586 MFC: Add the WITHOUT_INSTALLLIB option description. 2008-01-30 15:05:41 +00:00
Ruslan Ermilov ff3602064d MFC: Fix markup nits. 2008-01-30 15:03:37 +00:00
Ruslan Ermilov 185287a1bd MFC: Add a wrapper function that bound checks writes to the dump device. 2008-01-30 10:20:07 +00:00
Mike Makonnen 5b4bc78dbb MFC: rev. 1.325
Clarify that devfs_system_ruleset should contain a
	name, not a number.  Prompted by PR conf/85363
2008-01-30 08:25:38 +00:00
David E. O'Brien 28f6545c26 MFC: version 6.1.5. 2008-01-30 03:18:56 +00:00
David E. O'Brien fa5e5a3eec MFC: version 4.23. 2008-01-30 02:53:12 +00:00
David E. O'Brien 39e9a45b17 MFC: AWK release Oct 23, 2007.
MF6: Don't use patch files.
2008-01-30 02:44:27 +00:00
Alexander Motin 1603d851e8 MFC rev. 1.72-1.74
Improve multilink receive performance by fragment headers preallocation.
Improve multilink performance by netgraph item reuse.
2008-01-29 21:18:26 +00:00
Marius Strobl 0a33bdbe0f MFC: sys/dev/le/am7990.c 1.5; sys/dev/le/am79900.c 1.5
Correct the comments in am7990_intr() and am79900_intr().
2008-01-29 19:20:48 +00:00
David E. O'Brien a6eab6f78e MFC: rev. 1.1.1.7 (Check for a failure return from cplus_demangle_type) 2008-01-29 16:21:54 +00:00
Ken Smith dad4cf65ef MFC v1.7 (by request from remko because he is injured)
> revision 1.7
> date: 2008/01/16 13:54:40;  author: remko;  state: Exp;  lines: +9 -6
> Dont accidentally remove a filesocket which is still in use. This gives
> problems when the DRM driver is loaded and the AIXGL extension is loaded
> , the AIXGL driver requests a drm_close and this will cause the radeon
> driver to fail while starting X windows.
>
> PR:             kern/114688
> Submitted by:   vehemens <vehemens at verizon dot net>
> Prodded by:     Robert Noland
> Approved by:    imp (mentor, a while ago already), anholt
2008-01-29 01:19:31 +00:00
Doug Barton 95aa7b1014 MFC functional changes to etc:
1. yar's "dry run" patch to Makefile
2. Add zfs to the list of filesystems to check in
periodic/security/100.chksetuid
3. GC the nfslocking script, which has been superseded by lockd and statd
4. Add security warning to rc.d/jail
5. Add stop_cmd=':' to those rc.d scripts that do not start services,
but did not already have a stop_cmd.
2008-01-29 00:18:08 +00:00
Mike Makonnen f582c7f576 MFC: ver. 1.7
Partial backout of rev. 1.6, but instead of putting
	kerberos5_server_flags back in command_args, put it
	where rc.subr(8) expects it: kerberos5_flags.
2008-01-28 23:36:54 +00:00
John Baldwin 320845726b MFC 1.42,1.43: Fix races and other bugs with sleepq timeout handling. 2008-01-28 21:02:08 +00:00
Alexander Motin 1005b9c4b3 MFC rev. 1.26-1.27
Remove one very strange unneded if.
Fix memory leak when export hook is not connected.
2008-01-28 19:46:17 +00:00
Mike Makonnen e510fcc8c8 MFC:
Rev. 1.6 made it impossible to use rc.d/kerberos with the krb5 port.
	Re-implement the change so that the script once again works with
	the krb5 port.

	Submitted by: kensmith (slightly modified)
2008-01-28 18:55:57 +00:00
Andrew Gallatin 7b5b8ce292 MFC: Only reset driver state when a hardware error is detected. 2008-01-28 15:54:52 +00:00
Robert Watson c3eed3c2bc Merge ipfw2.c:1.113, ip_fw.h:1.111, ip_fw2.c:1.180 from HEAD to RELENG_7:
Hide ipfw internal data structures behind IPFW_INTERNAL rather than
  exposing them to all consumers of ip_fw.h.  These structures are
  used in both ipfw(8) and ipfw(4), but not part of the user<->kernel
  interface for other applications to use, rather, shared
  implementation.

  Reported by:    Paul Vixie <paul at vix dot com>
2008-01-28 14:00:30 +00:00
Jean-Sébastien Pédron 39fa9c6538 MFC:
sys/kern/vfs_aio.c; revision 1.237
  sys/sys/event.h; revision 1.38

  When asked to use kqueue, AIO stores its internal state in the
  `kn_sdata' member of the newly registered knote. The problem is that
  this member is overwritten by a call to kevent(2) with the EV_ADD flag,
  targetted at the same kevent/knote. For instance, a userland application
  may set the pointer to NULL, leading to a panic.

  A testcase was provided by the submitter.

  PR:	kern/118911
  Submitted by:	MOROHOSHI Akihiko <[email protected]>
2008-01-28 10:26:24 +00:00
Doug Barton a9e3c821c3 Regenerated page with WITHOUT_GSSAPI 2008-01-28 08:51:58 +00:00
Doug Barton 0391b68f83 MFC the WITHOUT_GSSAPI knob. 2008-01-28 08:42:15 +00:00
Doug Barton d19f710f7f MFC the purely cosmetic changes, including removal of $NetBSD$ Ids,
a few spurious #'s, an empty REQUIRE, and a never-used KEYWORD.
2008-01-28 07:55:44 +00:00
Mike Makonnen 6289bc40f5 MFC: ver. 1.82-1.83
Fix an error in bit shifting logic for network addresses. The route
	command would add incorrect routing entries if network numbers weren't
	fully "spelled" out according to their class. For example:
	  # route add 128.0/16   (works)
	  # route add 128/16     (doesn't work)
	  # route add 193.0.0/24 (works)
	  # route add 193/24     (doesn't work)

	Also, rework the way a netmask is deduced from network number if
	it [netmask] is not specified.

	Submitted by:	Nuno Antunes <[email protected]> (mostly)
2008-01-28 07:37:08 +00:00
Doug Barton c6033859b1 GC this file, which was brought over from NetBSD but never used by us. 2008-01-28 07:31:31 +00:00
Mike Makonnen f6aff7ccfb MFC: rev. 1.42
Clarify in what formats the grouplist for the '-G' switch
	may be accepted.

	Submitted by: Eygene Ryabinkin <[email protected]>
2008-01-27 22:16:03 +00:00
Marius Strobl f8947cd8ac MFC: 1.36
Add missing locking for SBus controllers.
2008-01-27 15:42:06 +00:00
Diomidis Spinellis 1a47e27af0 MFC: A new configuration variable, daily_status_mail_rejects_shorten, allows
the rejected mail reports to tally the rejects per blacklist without
providing details about individual sender hosts.  The default configuration
keeps the reports in their original form.
2008-01-27 08:07:15 +00:00
Konstantin Belousov dcd51925c4 MFC rev. 1.457:
Do not dereference NULL scp in the case the screen is not opened.
Instead, return ENXIO to the ioctl caller.
2008-01-27 07:52:23 +00:00
Konstantin Belousov 804d661332 MFC rev. 1.157:
In rev. 1.156, the convertion of the minor number to the unit number
resulted in the argument to the make_dev() to be a unit number.

Correct this by supplying a minor number to make_dev(), and using
the unit number for the calculation of the slave tty name.
2008-01-27 07:51:43 +00:00
Diomidis Spinellis e9e9fa6954 MFC revisions 1.47-1.50.
- Follow POSIX specification when moving a directory to an existing
  directory across devices.

- Improve consistency and remove some style bugs of earlier versions.

This version passes all tests of tools/regression/bin/mv/regress.sh 1.6

PR:		bin/118367
2008-01-27 07:38:39 +00:00
Alexander Motin 4064bab74c MFC rev. 1.88
Add support for optional "AC-Name\Service-Name" syntax at NGM_PPPOE_CONNECT
argument. It allows ppp, mpd or any other node consumer to request
connection to specified access concentrator.

Proposed by:	Alexander A. Burylov <[email protected]>
2008-01-27 02:47:32 +00:00
Alexander Motin 66367bec0e MFC rev 1.85-1.86
Remove ng_pppoe_sendpacket() function to simplify code as it is called
as much times as it has cases inside of it.
Split ng_pppoe_rcvdata() function into three hook-specific ones
to simplify code and reduce stack usage.
2008-01-27 02:45:41 +00:00
Alexander Motin af5bcf5f16 MFC rev. 1.25
Remove some prehistoric never used defines.
2008-01-27 02:36:08 +00:00
Marius Strobl 49058716d0 MFC: 1.4
- Remove MIIF_NOISOLATE.
- Fix spelling in a comment.
2008-01-27 01:00:28 +00:00
Xin LI 9f6b04bf78 MFC revision 1.7
date: 2008/01/12 00:11:26;  author: delphij;  state: Exp;  lines: +4 -4
 - Handle the case where interface from "middle" is missing by
   more carefully inspecting the return value from sysctl(3). [1]
 - Use calloc instead of malloc+memset of zero.

Submitted by:	Alexander Chernikov <admin su29 net> [1]
PR:		bin/119581
MFC after:	2 weeks
2008-01-26 21:59:10 +00:00
David Schultz 545cd859bb MFC _ldtoa.c,v 1.5
Fix handling of subnormals on i386/ia64/amd64.

    PR:		85080
2008-01-26 08:21:32 +00:00
David Schultz 027aa8b416 MFC qsort.c,v 1.14-1.15, heapsort.c,v 1.6
Use size_t to avoid overflow when sorting arrays larger than 2 GB.

    PR:		111085
2008-01-26 08:21:13 +00:00
David Schultz a61cb7a2c0 MFC growfs.c,v 1.26
Fix an int overflow on very large file systems.

    PR:			bin/113399
    Submitted by:	Staffan Ulfberg <[email protected]>
2008-01-26 08:21:12 +00:00
Mike Makonnen a90bf649d6 MFC: rev. 1.110
----------------------------------------------------------------------------
Instead of manually freeing the packet options structure (and not even doing
a good job of it) in the copypktopts() function, just call ip6_clearpktopts()
directly. Otherwise, the callers of this function would end up freeing the
memory twice.

Reviewed by: jinmei
PR:          kern/116360
----------------------------------------------------------------------------
2008-01-26 06:49:27 +00:00
Konstantin Belousov c75d7f815c MFC rev. 1.52:
udf_vget() shall vgone() the vnode when the file_entry cannot be allocated
or read from the volume. Otherwise, half-constructed vnode could be found
later and cause panic when accessed.

PR:	118322
2008-01-25 10:12:33 +00:00
Marcus Alves Grando 4a3bf0c53a MFC: 1.430
- Add new NTP servers provided by NIC.br (http://www.ntp.br)
  - Remove nonfunctional servers

  PR:             119884
  Approved by:    simon
2008-01-25 02:00:24 +00:00
Ulf Lilleengen 9d9625bfc8 - Add geom_virstor to the module build.
PR:		kern/119902
Submitted by:	Yoshihiro Ota <ota -at- j.email.ne.jp>
Approved by:	re (kensmith), pjd (mentor)
2008-01-24 20:23:07 +00:00
John Baldwin f44c4cc580 MFC: Add support for booting from GPT-labeled disks from the BIOS. This
includes /boot/pmbr, /boot/gptboot, and 'gpt boot'.
2008-01-24 19:42:17 +00:00
Ruslan Ermilov 7a0b3fae52 MFC: 1.95: Weed out a warning argument that isn't applicable to C++ code. 2008-01-24 13:33:00 +00:00
Dag-Erling Smørgrav 3f08eaf3ca MFC: (1.101) replace fclose() with comment explaining why it's incorrect.
Approved by:	re (kensmith)
2008-01-24 08:07:52 +00:00
Ruslan Ermilov cf175b062e MFC: 1.79: Fix printing of the number of syncache entries added. 2008-01-24 07:50:12 +00:00
Christian Brueffer 1b71611156 MFC: rev. 1.65
Document the 'maintainer' target.
2008-01-24 05:48:55 +00:00
Robert Watson c909e6c520 Merge tcp_usrreq.c:1.167 from HEAD to RELENG_7:
tcp_usrreq.c:1.313 removed tcbinfo locking from tcp_usr_accept(), which
  while in principle a good idea, opened us up to a race inherrent to
  the syncache's direct insertion of incoming TCP connections into the
  "completed connection" listen queue, as it transpires that the socket
  is inserted before the inpcb is fully filled in by syncache_expand().
  The bug manifested with the occasional returning of 0.0.0.0:0 in the
  address returned by the accept() system call, which occurred if accept
  managed to execute tcp_usr_accept() before syncache_expand() had copied
  the endpoint addresses into inpcb connection state.

  Re-add tcbinfo locking around the address copyout, which has the effect
  of delaying the copy until syncache_expand() has finished running, as
  it is run while the tcbinfo lock is held.  This is undesirable in that
  it increases contention on tcbinfo further, but a more significant
  change will be required to how the syncache inserts new sockets in
  order to fix this and keep more granular locking here.  In particular,
  either more state needs to be passed into sonewconn() so that
  pru_attach() can fill in the fields *before* the socket is inserted, or
  the socket needs to be inserted in the incomplete connection queue
  until it is actually ready to be used.

  Reported by:    glebius (and kris)
  Tested by:      glebius

Approved:	re (kensmith)
2008-01-23 23:40:22 +00:00
Ken Smith 192942a8ca MFC:
Add fsck_4.2bsd and fsck_ufs as hard links to fsck_ffs in /stand on
the MFS image so that (for example) "fsck /dev/ad0s1a" will work.
Without this you needed (for example) "fsck -t ffs /dev/ad0s1a" (or
needed to run fsck_ffs instead of fsck).

Versions being MFCed:

        1.62    src/release/amd64/boot_crunch.conf
        1.62    src/release/i386/boot_crunch.conf
        1.12    src/release/ia64/boot_crunch.conf
        1.63    src/release/pc98/boot_crunch.conf
        1.5     src/release/powerpc/boot_crunch.conf
        1.9     src/release/sparc64/boot_crunch.conf
        1.2     src/release/sun4v/boot_crunch.conf
2008-01-23 20:19:18 +00:00
Ken Smith 04f51e7151 MFC v1.12:
Update EDITOR and PAGER environment variables so they are correct for
the CDROM fixit environment.

Noticed by:     gallatin
2008-01-23 20:05:22 +00:00
John Baldwin fca567caef MFC: Don't cache the new-bus name of a PCI device in the PCI conf
structure.
2008-01-23 18:05:34 +00:00
John Baldwin 0b5a6be2f9 MFC: Fix some minor issues such as using read/modify/write for updating
the configuration register and add a header file to hold HPET register
constants.
2008-01-23 18:03:15 +00:00
John Baldwin bf7fee82b0 MFC: Update openpty(3) manpage for the recent pty fixes and remove some
now-unused macros from grantpt.c.
2008-01-23 17:59:27 +00:00
Robert Watson 5394cc771d Merge revisions 1.1 and 1.2 of the coda.4 man page from HEAD to RELENG_7:
Add a rather basic man page for the coda kernel module.

  Small fixes.

Approved by:	re (kensmith)
2008-01-23 12:16:00 +00:00
Robert Watson b76a85f059 Merge uipc_usrreq.c:1.214 from HEAD to RELENG_7:
Move unlock of global UNIX domain socket lock slightly lower in
  unp_connect(): it is expected to return with the lock held, and two
  possible error paths otherwise returned with it unlocked.

  The fix committed here is slightly different from the patch in the
  PR, but along an alternative line suggested in the PR.

  PR:             119778
  Submitted by:   James Juran <james dot juran at baesystems dot com>

Approved by:	re (gnn)
2008-01-23 12:07:17 +00:00
Alexander Motin 2acf48afc9 MFC rev 1.71
Fix bundle xmit octets stats for packet-split operation mode.
2008-01-23 11:50:35 +00:00
cvs2svn 8d42bf1d82 This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2008-01-23 05:43:27 +00:00
Jung-uk Kim bbfa8b3fc4 MFC: 1.26
Check battery presence first before trying to get battery information.
2008-01-22 17:53:40 +00:00
cvs2svn ba56452d29 This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2008-01-22 07:40:22 +00:00
Robert Watson 9fd8c5def1 Merge a variety of Coda fixes from HEAD to RELENG_7:
coda_vnops.c:1.79:

  Borrow the VM object associated with an underlying cache vnode with the
  Coda vnode derived from it, in the style of nullfs.  This allows files
  in the Coda file system to be memory-mapped, such as with execve(2) or
  mmap(2).

  Reported by:    Rune <u+openafsdev-sr55 at chalmers dot se>

coda_vnops.c:1.80:

  Lock the new directory vnode returned by coda_mkdir(), as this is required
  by FreeBSD's vnode locking protocol.

coda_vnops.c:1.81:

  Use VOP_NULL rather than VOP_PANIC for Coda's vop_print routine, so as
  to avoid panicking in DDB show lockedvnods.

cnode.h:1.22, coda_namecache.h:1.12, coda_psdev.c:1.40, coda_vfsops.c:1.70:

  Don't declare functions as extern.

  Move all extern variable definitions to associated .h files, move some
  extern variable definitions between include files to place them more
  appropriately.

coda_vnops.c:1.82:

  Don't acquire an additional vnode reference to a vnode when it is opened
  and then release it when it is closed: we rely on the caller to keep the
  vnode around with a valid reference.  This avoids vrele() destroying the
  vnode vop_close() is being called from during a call to vop_close(), and
  a crash due to lockmgr recursing the vnode lock when a Coda unmount
  occurs.

coda_vfsops.c:1.71:

  Zero mi_rotovp and coda_ctlvp immediately after calling vrele() on the
  vnodes during coda_unmount() in order to detect errant use of them
  after the vnode references may no longer be valid.

  No need to clear the VV_ROOT flag on mi_rootvp flag (especially after
  the vnode reference is no longer valid) as this isn't done on other
  file systems.

coda_vfsops.c:

  Rework coda_statfs(): no longer need to zero the statfs structure or
  fill out all fields, just fill out the ones the file system knows
  about.  Among other things, this causes the outpuf of "mount" and
  "df" to make quite a bit more sense as /dev/cfs0 is specified as the
  mountfrom name.

coda_vnops.c:1.83:

  Improve default vnode operation handling for Coda:

  - Don't specify vnode operations for mknod, lease, and advlock--let them
    fall through to vop_default.

  - Implement vop_default with &default_vnodeops, rather than with
    VOP_PANIC, so that unimplemented vnode operations are handled in more
    sensible ways than panicking, such as EOPNOTSUPP on ACL queries
    generated by bsdtar, or mknod.

coda_namecache.h:1.13:

  Remove unused oldhash definition from Coda namecache.

coda_vnops.c:1.84:

  Replace references to VOP_LOCK() w/o LK_RETRY to vn_lock() with LK_RETRY,
  avoiding extra error handling, or in some cases, missing error handling.

  Discussed with: kib

coda_vnops.c:1.85:

  Put "coda_rdwr: Internally Opening" printf generated by in-kernel writes
  to files, such as ktrace output, under CODA_VERBOSE.  Otherwise, each
  such call to VOP_WRITE() results in a kernel printf.

  Obtained from:  NetBSD
2008-01-22 00:32:53 +00:00
Christian Brueffer ef807c589e MFC: rev. 1.72
Remove remnants of old *_FORTRAN build flags.

Approved by:	rwatson (mentor)
2008-01-21 18:50:17 +00:00
Christian Brueffer d93877d1e5 MFC: rev. 1.592
Remove WITHOUT_FORTRAN from the XMAKE target, it doesn't exist anymore.

Approved by:	rwatson (mentor)
2008-01-21 18:49:04 +00:00
Christian Brueffer 734ddfcc69 MFC: rev. 1.12
Remove files conditional on the obsolete MK_FORTRAN knob.  They are already
listed in ObsoleteFiles.inc anyway.

Approved by:	rwatson (mentor)
2008-01-21 18:47:37 +00:00
Jung-uk Kim eaa65b1e26 MFC: 1.201
Fix mbuf pool watermark configuration.
2008-01-21 17:17:00 +00:00
Dag-Erling Smørgrav 2b4f57be93 Final part of the OpenPAM MFC which CVS botched. 2008-01-21 16:12:05 +00:00
Ruslan Ermilov bde92f91fa Add copyrights.
PR:	119136
2008-01-21 13:26:33 +00:00
Nate Lawson 7750485ac5 MFC 1.28,1.29: reject cpufreq changes before sched_bind() is usable and
remove duplicated levels.

Approved by:	re
2008-01-19 20:31:00 +00:00
Bruce A. Mah 403585bf4b Update release documentation entities for a post 7.0 world. 2008-01-19 18:25:18 +00:00
Bruce A. Mah ab5cbee9a0 Now that RELENG_7 is in a slush state, trim release notes for a
post-7.0 world.
2008-01-19 18:24:30 +00:00
Maxim Konovalov 7ddc72c8d0 MFC revs. 1.116-1.118: OpenBSD 4.2, NetBSD 4.0, FreeBSD 6.3. 2008-01-19 18:07:07 +00:00
Maxim Konovalov 51fd959d7f MFC rev. 1.85: wait/nowait column for ONC services. 2008-01-19 18:02:11 +00:00
Konstantin Belousov b9fb400c9d MFC rev. 1.156:
In the rev. 1.153, the one place for converting minor number to unit
was missed. As result, pty_create_slave() may index out of the names[]
bounds, creating wrong slave tty names.
2008-01-19 17:57:06 +00:00
Maxim Konovalov 7810b17b58 MFC rev. 1.90 ntfs_vfsops.c and revs. 1.22, 1.23 mount_ntfs.8: mask
maximum file permissions with ACCESSPERMS.
2008-01-19 17:54:11 +00:00
Maxim Konovalov 69d0dbc986 MFC rev. 1.53 rc.firewall and rev. 1.18 rc.firewall6: fix bibliography. 2008-01-19 17:40:27 +00:00
Maxim Konovalov 7cc866b877 MFC revs. 1.8, 1.9: do not claim vlan(4) uses mbuf_tags(9). 2008-01-19 17:33:02 +00:00
Maxim Konovalov ad1e78c9de MFC rev 1.37: fix an output. MFC revs. 1.38, 1.39: plug a memory leak. 2008-01-19 17:27:43 +00:00
Maxim Konovalov 6f120c17d3 MFC rev. 1.322 rc.conf, rev. 1.332 rc.conf.5: TCP_DROP_SYNFIN has gone. 2008-01-19 17:18:57 +00:00
Rong-En Fan 98fe30aeee - Add missing file for OpenPAM Hydrangea MFC 2008-01-19 11:47:37 +00:00
Konstantin Belousov 1c96a42a73 MFC rev. 1.53:
ffs_balloc_ufsX() routines, in the case of recovering from the failed
allocation, free the indirect blocks before clearing the disk pointers,
that could lead to the softupdate inconsistencies in the case of the
machine or disk crash at the wrong time.

Rearrange the recover code to do the ffs_blkfree() after the second
ffs_syncvnode(), that clears the pointers chain.
2008-01-19 05:57:48 +00:00
Konstantin Belousov 78bce72b13 MFC rev. 1.52:
The ffs_balloc() routines, whan allocating the indirect blocks for
the inode, do the rollback in case the allocation failed (due to
insufficient free space or quota limits). But, the code does leaves the
buffers corresponding to the inoirect blocks on the vnode bufobj list.
This causes several assertion failures (for instance, "ffs_truncate3"
in ffs_truncate()) to fail, and could result in the indirect block
aliasing problem, like writing the context of such blocks to random
disk location.

Remove the buffers from the bufobj properly.
2008-01-19 05:48:30 +00:00
Christian Brueffer 790eb5a91d MFC:
WITHOUT_FORTRAN was removed some time ago.  Regen src.conf.5.
2008-01-18 16:45:43 +00:00
Dag-Erling Smørgrav 84aa9fc785 MFC: (1.68) document environment variables. 2008-01-18 13:35:09 +00:00
Dag-Erling Smørgrav 8acf0a5bc0 MFC: OpenPAM Hydrangea 2008-01-18 13:29:05 +00:00
Dag-Erling Smørgrav 8cfbe08463 MFC: (1.10) correct documentation of ~/.opiealways
PR:		117512
2008-01-18 13:28:24 +00:00
Dag-Erling Smørgrav 44e9c0d761 MFC: clean up namespace violations; correct is*() usage; NO_PROXY support 2008-01-18 13:23:57 +00:00
Dag-Erling Smørgrav e699bd1102 MFC: (1.26) traverse the tree in lexical order 2008-01-18 13:13:01 +00:00
Konstantin Belousov 62b5cd7fa8 MFC fix for the panic("vm_thread_new: kstack allocation failed") and
silent NULL pointer dereference in the i386 and sparc64 pmap_pinit()
when the kmem_alloc_nofault() failed to allocate address space. Both
functions now return error instead of panicing or dereferencing NULL.

The reason for MFCing this so late in release cycle is, according to
marius@, because
> it fixes the crashing (though no panic) of the test suite
> of the graphic/OpenEXR port on sparc64. This test suite is run
> (and required to succeed) during the package build and that's
> why portmgr@ bitch about at it as OpenEXR is a dependency of KDE
> which in turn is supposed to end up on the release CD images.

Revisions MFCed:
  1.677     of      src/sys/amd64/amd64/machdep.c
  1.592     of      src/sys/amd64/amd64/pmap.c
  1.88      of      src/sys/arm/arm/pmap.c
  1.27      of      src/sys/arm/at91/kb920x_machdep.c
  1.22      of      src/sys/arm/sa11x0/assabet_machdep.c
  1.8       of      src/sys/arm/xscale/i80321/ep80219_machdep.c
  1.29      of      src/sys/arm/xscale/i80321/iq31244_machdep.c
  1.3       of      src/sys/arm/xscale/i8134x/crb_machdep.c
  1.6       of      src/sys/arm/xscale/ixp425/avila_machdep.c
  1.41      of      src/sys/compat/pecoff/imgact_pecoff.c
  1.26      of      src/sys/compat/svr4/imgact_svr4.c
  1.660     of      src/sys/i386/i386/machdep.c
  1.596     of      src/sys/i386/i386/pmap.c
  1.68      of      src/sys/i386/ibcs2/imgact_coff.c
  1.56      of      src/sys/i386/linux/imgact_linux.c
  1.226     of      src/sys/ia64/ia64/machdep.c
  1.192     of      src/sys/ia64/ia64/pmap.c
  1.102     of      src/sys/kern/imgact_aout.c
  1.179     of      src/sys/kern/imgact_elf.c
  1.56      of      src/sys/kern/imgact_gzip.c
  1.310     of      src/sys/kern/kern_exec.c
  1.287     of      src/sys/kern/kern_fork.c
  1.236     of      src/sys/kern/kern_kse.c
  1.253     of      src/sys/kern/kern_proc.c
  1.352     of      src/sys/kern/kern_sig.c
  1.63      of      src/sys/kern/kern_thr.c
  1.257     of      src/sys/kern/kern_thread.c
  1.397     of      src/sys/pc98/pc98/machdep.c
  1.104     of      src/sys/powerpc/powerpc/machdep.c
  1.10      of      src/sys/powerpc/powerpc/pmap_dispatch.c
  1.139     of      src/sys/sparc64/sparc64/machdep.c
  1.167     of      src/sys/sparc64/sparc64/pmap.c
  1.16      of      src/sys/sun4v/sun4v/machdep.c
  1.40      of      src/sys/sun4v/sun4v/pmap.c
  1.493     of      src/sys/sys/proc.h
  1.78      of      src/sys/sys/signalvar.h
  1.80      of      src/sys/vm/pmap.h
  1.79      of      src/sys/vm/vm_extern.h
  1.226     of      src/sys/vm/vm_glue.c
  1.390     of       src/sys/vm/vm_map.c

Requested by:	marius
Tested by:	Peter Holm, marius (make universe and sparc64 runs)
Approved by:	re (kensmith)
2008-01-18 10:02:53 +00:00
Konstantin Belousov 3497a769e5 MFC rev. 1.319, 1.320:
Fix unload of the fdc.ko:
Wakeup the thread doing the fdc_detach() when the fdc worker thread exits.
Write access to the write-protected floppy shall call device_unbusy() to
pair the device_busy() in the fd_access().
2008-01-18 09:39:35 +00:00
cvs2svn ba6d4b633f This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2008-01-18 05:05:59 +00:00
John Baldwin de2dee850d MFC: Force consistent use of the mountpoint's credentials when connecting
to the NFS server by temporarily changing the current thread's credentials
to that of the mountpoint while establishing the connection.
2008-01-17 21:04:51 +00:00
Pawel Jakub Dawidek 87000da0e4 MFC: sys/contrib/opensolaris/uts/common/fs/zfs/zvol.c 1.4
Call zil_commit() (if ZIL is not disabled) after every non-read request
(BIO_WRITE and BIO_FLUSH) as it is done is Solaris. The difference is
that Solaris calls it only for sync requests, but we can't say in GEOM
if the request is sync or async, so we do it for every request.

Approved by:	re (gnn)
2008-01-17 07:50:34 +00:00
Pawel Jakub Dawidek 3d01d1c5d4 Close access to vdev when setting state to anything but open state.
This fixes replacing drive in place, eg. zpool replace tank da1 da1.
Before the fix, it complained that device is already open.

Obtained from:	OpenSolaris
Approved by:	re (gnn)
2008-01-17 07:49:16 +00:00
Pawel Jakub Dawidek edfe4770d1 MFC: sys/vm/vm_kern.c 1.131
When one tries to allocate memory with the M_WAITOK flag and we are short in
address space in kmem map call vm_lowmem event in a loop and wait a bit for
subsystems to reclaim some memory which in turn will reclaim address space as
well.

Note, this is a work-around.

Reviewed by:	alc
Approved by:	alc, re (gnn)
2008-01-17 07:47:03 +00:00
Craig Rodrigues ca9e4afa63 MFC: 1.270
- In vfs_scanopt(), make sure that the mount option value is not NULL
   before calling vsscanf().

PR:		118531

MFC: 1.268
  - Internally convert "rdonly" mount option to "ro".

Approved by:	re (kensmith)
2008-01-17 04:24:53 +00:00
Olivier Houchard 91bf96df29 MFC rev 1.14:
Back when I committed the arm port, I've been asked to move
memcpy/memset/memcmp and friends from libkern/arm to arm/arm/support.S, and so
I did, but in the process, I didn't add the appropriate copyrights.
This is a major oversight from me, and I apology to the NetBSD people for it.

Approved by:	re (mux)
2008-01-16 22:45:03 +00:00
Robert Watson bfd688e80a Merge uipc_sem.c:1.30 from HEAD to RELENG_7:
Free MAC label on a POSIX semaphore when the semaphore is freed.

  Submitted by:   jhb

Approved by:	re (kensmith)
2008-01-16 21:40:05 +00:00
Nate Lawson ef0d7806fe MFC: queue an asynch handler to re-enable a level-triggered GPE
Approved by:	re
2008-01-16 01:22:15 +00:00
John Baldwin 84d423e19f MFC: Use a dummy interrupt handler to work around lpt(4) interrupt
problems.

Approved by:	re (gnn)
2008-01-15 22:28:15 +00:00
Andrew Gallatin e0646edc0d MFC: Update to firmware version 1.4.29 from 1.4.25
Approved by: re (kensmith)
2008-01-15 17:59:15 +00:00
Colin Percival d894c3e621 Fix issues which allow snooping on ptys. [08:01]
Fix an off-by-one error in inet_network(3). [08:02]

Security: FreeBSD-SA-08:01.pty
Security: FreeBSD-SA-08:02.libc
Approved by:	re (kensmith)
2008-01-14 22:57:45 +00:00
Christian Brueffer 03d54a370c Remove a dublicate complete copy of the manpage. No MFC as the version
in HEAD is ok.

Submitted by:	pluknet
Approved by:	re (hrs)
2008-01-14 21:45:02 +00:00
Ken Smith 76de13e893 MFC: dist.c v1.254, dist.h v1.72, menus.c v1.429, sysinstall.h v1.275
> Change sysinstall's handling of X11 stuff.  Doing it in pieces was
> probably the right thing to do a while ago but xorg has progressed
> to the point that for novice users (who are the ones expected to think
> installing X11 during an install...) it's best to just install the
> whole x11/xorg metaport for them.  This removes the X11 sub-menus
> and sets it up so you just select whether or not you want X11.  While
> here garbage collect an X11 configuration menu I missed removing when
> I removed support for attempting xorg configuration from inside sysinstall
> a while ago.

Approved by:    re (hrs)
2008-01-14 19:28:43 +00:00
Ken Smith 7c8464f8df Add the various packages we've ejected from the CD sets through
recent years back on disc3.

Approved by:	re (hrs)
2008-01-14 17:28:36 +00:00
Doug Barton db87c71854 MFC the change from 1.27, removal of zones from the empty zone list that
may theoretically be allocated some day.

Approved by:	re (kensmith)
2008-01-13 20:51:09 +00:00
John Baldwin 880b64a772 MFC: Close a race in the kern.ttys sysctl handler that resulted in panics
in dev2udev().

Approved by:	re (gnn)
2008-01-12 00:20:06 +00:00
John Baldwin 38d490615a MFC: Lock the vnode interlock while reading v_usecount to update
si_usecount in a cdev in devfs_reclaim().

Approved by:	re (gnn)
2008-01-12 00:13:33 +00:00
John Baldwin 6868cc19c7 MFC: Only use sockoptname() to parse socket option names for SOL_SOCKET
requests.

Approved by:	re (gnn)
2008-01-12 00:07:50 +00:00
Attilio Rao 0b8938aacd MFC rev. 1.62:
g_vfs_close wants the sx topology lock held while executing, so add
correct locking for mounting operation.

Approved by: re
2008-01-11 19:56:17 +00:00
Marius Strobl 2c6b21572c MFC: 1.25
Fix some bugs in the FreeBSD 4/5/6 pci(4) IOCTLs compatibility code:
- Use the correct offsets when copying out the results of PCIOCGETCONF_OLD.
  This happened to not affect the 64-bit architectures because there the
  addition of pc_domain to struct pcisel didn't change the overall size of
  struct pci_conf.
- Always copy the name and unit information to conf_old so it's also part
  of the output once this information is cached in dinfo.
- Use the correct type for flags in struct pci_match_conf_old. This
  change is more or less cosmetic though.

Approved by:	re (gnn)
2008-01-09 21:45:37 +00:00
Alexander Motin ed9e6852da MFC rev. 1.22
Increase control channel xmit queue to 128 packets.
Previous value 16 was too small for real LAC as temporal activity
spike cound easily overflow queue demanding tunnel disconnection due
to possible state inconsistency.

Approved by:	re (gnn)
2008-01-09 19:55:51 +00:00
John Baldwin 291cf90677 MFC: More properly handle links who only have 1 valid IRQ in their bitmask.
Approved by:	re (kensmith)
2008-01-09 18:01:51 +00:00
John Baldwin 10273e13de MFC: Update the shlib version for libgssapi_krb5.
Approved by:	re (kensmith)
2008-01-09 18:00:51 +00:00
Konstantin Belousov 22cb935a75 MFC rev. 1.89, 1.90:
Apply the LCONVPATH() to the (old) linux_stat() and linux_lstat() syscalls.

Approved by:	re (kensmith)
2008-01-09 15:30:34 +00:00
Maxime Henrion 1da2cc63aa MFC [email protected] and [email protected]:
Add a workaround for a deadlock between the rt_setgate() and rt_check()
  functions.  It is easily triggered by running routed, and, I expect, by
  running any other daemon that uses routing sockets.

Approved by:    re (kensmith)
2008-01-09 15:23:36 +00:00
Konstantin Belousov c7ae2157cd MFC rev. 1.392:
In the vm_map_stack(), check for the specified stack region wraparound.

Approved by:	re (kensmith)
2008-01-09 15:19:22 +00:00
Xin LI 14ecffe185 MFC important fixes by sos@:
Implement a workaround of the datacorruption problem on ServerWorks
HT1000 chipsets.  The HT1000 DMA engine seems to not always like 64K
transfers and sometimes barfs data all over memory leading to instant
chrash and burn.

Also fix 48bit adressing issues, apparently newer chips needs 16bit
writes and not the usual fifo thing.

HW donated by:	Travis Mikalson at TerraNovaNet
Original work:	sos
Approved by:	re (kensmith)
2008-01-09 08:55:10 +00:00
Gabor Kovesdan c5d94cf279 MFC r1.5:
- This driver will first appear in FreeBSD 6.3, not 7.0

Approved by:	re (hrs)
2008-01-08 15:37:57 +00:00
Henrik Brix Andersen f27ee0d6bb MFC:
- src/sys/dev/usb/usb_quirks.c (revision 1.64)
- src/sys/dev/usb/usbdevs (revision 1.333)

Update quirks for the MetaGeek Wi-Spy 1A, 1B and 2.4x.

Approved by:	re (kensmith), erwin (mentor)
2008-01-07 23:12:45 +00:00
John Baldwin 5c1629391b MFC: Fix a typo in regards to the ENOENT error.
Approved by:	re (hrs)
2008-01-07 21:29:29 +00:00
John Baldwin faafe99721 MFC: Use devclass_get_count() instead of devclass_get_maxunit().
Approved by:	re (hrs)
2008-01-07 21:27:50 +00:00
Henrik Brix Andersen f08b26d8a6 MFC: (revision 1.2)
Add reload functionality.

Approved by:	re (kensmith), erwin (mentor)
2008-01-07 21:15:45 +00:00
Gabor Kovesdan 3bad529897 MFC r1.10:
- ipmi(4) appeared in FreeBSD 6.2, not in 6.3

Approved by:	re (hrs)
2008-01-07 14:53:59 +00:00
Peter Wemm 95dddc99ea MFC: rev 1.4: forward compatability with cvs-1.12 repository
Approved by:  re (kensmith)
2008-01-07 09:02:02 +00:00
Edwin Groothuis afb3fd0086 MFC of tzdata2007k.
Approved by:	re (ken smith)
2008-01-06 07:36:08 +00:00
Edwin Groothuis d8df95c3e6 Update iso3166 with the data from Newsletter VI-1 2007-09-21:
Added SAINT BARTHELEMY (BL) and SAINT MARTIN (MF).

MFC of rev 1.17

Approved by: re (ken smith)
2008-01-06 07:25:43 +00:00
Marius Strobl abf814e13f On FreeBSD GCC 4.2.x checks for the existence of pthread_cancel() in
order to determine whether a program is running with multithreading
support. This check causes __gthread_active_p() to always return 1
however, regardless of whether the program was actually compiled with
-pthread or not, due to the fact that the FreeBSD libc contains a
pthread_cancel() stub. Fix this by using the __gthread_active_p()
version that GCC uses for Solaris and which actively checks for a
working POSIX threads implementation (if such functions exist) instead
of checking for the mere existence of corresponding functions.

On platforms without TLS support, i.e. on arm and sparc64 due to the
lack of GNU TLS support for these archs in binutils 2.15., the false
positives returned by __gthread_active_p() for non-threaded programs
cause the exception handling implementation GCC uses in this case to
crash. This is because GCC assumes that the POSIX threading functions
actually work when __gthread_active_p() returns 1 while in fact the
corresponding stubs in libc just immediately return.
Given that __gthread_active_p() is also used in a couple of other
places besides exception handling, this bug has great potential to
also cause problems in other areas and on all archs.

This is committed to RELENG_7 directly in order to get a fix into
RELENG_7_0 as soon as possible while allowing to loop the official
fix back into the vendor branch and not taking gthr-posix.h off the
vendor branch in HEAD.

PR:		119289
Reviewed by:	obrien (plus style fix)
Approved by:	re (kensmith)
2008-01-05 22:58:51 +00:00
Gabor Kovesdan 9fb42d6ce9 MFC
r1.62:
- Document icase variable of make search, which can be used to control
  case-sensitivity
r1.63:
- Document PORT_DBDIR
r1.64:
- Remove incomplete sentence fragment

Approved by:	re (hrs)
2008-01-04 13:33:01 +00:00
Gabor Kovesdan 55639bfae8 MFC r1.39
- Adjust INDEX file name to INDEX-7 so that it matches the major FreeBSD
  version number, as it is named after that

Approved by:	re (hrs)
2008-01-04 13:22:09 +00:00
Gabor Kovesdan 1de82c636e MFC r1.7
- This driver has already appeared in 6.2

Approved by:	re (hrs)
2008-01-04 13:15:02 +00:00
Gabor Kovesdan 44ccc0cb3e MFC r1.4
- This driver will first appear in 6.3, not 7.0

Approved by:	re (hrs)
2008-01-04 13:14:32 +00:00
Gabor Kovesdan d48bbb31e0 MFC r1.13
- This driver will first appear in 6.3, not 7.0

Approved by:	re (hrs)
2008-01-04 13:14:06 +00:00
Gabor Kovesdan 263835bed6 MFC r1.3
- This driver will first appear in 6.3, not 7.0

Approved by:	re (hrs)
2008-01-04 13:13:44 +00:00
Gabor Kovesdan adbcba00c6 MFC r1.9
- This driver will first appear in 6.3, not 7.0

Approved by:	re (hrs)
2008-01-04 13:12:19 +00:00
Gabor Kovesdan 07080b81a2 MFC r1.2
- This driver will first appear in 6.3, not 7.0

Approved by:	re (hrs)
2008-01-04 13:11:59 +00:00
Gabor Kovesdan dc6678ca6d MFC r1.8
- This driver will first appear in 6.3, not 7.0

Approved by:	re (hrs)
2008-01-04 13:09:04 +00:00
Konstantin Belousov 92771f9d52 MFC rev. 1.107:
Plug the leaks in the present implementation of the linux_openat().

Approved by:	re (kensmith)
2008-01-03 12:40:55 +00:00
Konstantin Belousov 7e2b916031 MFC rev. 1.106:
Do not allow the SNPSTTY ioctl for the snoop device that has a tty
attached. Otherwise, the snp->snp_tty would be overwritten, while the
tty line discipline still set to the snpdisc. Then snplwrite() causes
panic because ttytosnp() cannot find the snp. (And do it at the proper
place, from rev. 1.107).

MFC rev. 1.107:
The snp_target == NULL implies the snp_tty == NULL. Remove the code
that is put under snp_target == NULL and snp_tty != NULL clause.

In snpclose(), do the snp_detach() before scheduling the snp device
destruction. Otherwise, after the return from snpclose(), the snp
device is already removed from the snp_list, but tty is still in
snooped state. Any attempt to do i/o on such tty cause panic because
ttytosnp() returns NULL.

Approved by:	re (kensmith)
2008-01-03 12:31:44 +00:00
Warner Losh fb20d5835b MFC: Happy New Year
Approved by: re@
2008-01-01 09:35:58 +00:00
David E. O'Brien 6db3fbcb91 MFC: rev 1.149: Fix a broken DIAGNOSTICS/INVARIANTS check to handle a block
range that spans two block maps.

Approved by:	re(kensmith)
2008-01-01 03:00:17 +00:00
John Baldwin a771149ea7 MFC: Clean up some of the pts(4) vs pty(4) stuff in grantpt(3) and friends.
Approved by:	re (gnn)
2007-12-31 17:39:24 +00:00
Andrew Thompson bc803eaf49 MFC r1.8
Fix a panic where if the mbuf was consumed by the filter for requeueing
  (dummynet), ipsec_filter() would return the empty error code and the ipsec
  code would continue to forward/deference the null mbuf.

Approved by:	re (gnn)
2007-12-29 17:29:11 +00:00
Ken Smith a6a073a68d MFC v1.117:
> Plug a memory leak.  Once any given package (e.g. perl) was installed
> we would leak a saved screen for every other package we tried to install
> that listed perl as one of its dependencies.  When installing things
> like gnome and kde that wound up being a LOT of leaked memory.

Approved by:	re (bmah)
2007-12-29 06:17:39 +00:00
Ken Smith a9c15f361e MFC v1.78 and v1.79:
Remove process limits for datasize and stacksize which are unlimited
during a "normal login" (thanks to /etc/login.conf) but not when
sysinstall is running as part of an installation.  Fixups for error
messages and a comment that became untrue.

Approved by:	 re (bmah)
2007-12-29 06:14:35 +00:00
Randall Stewart 44da768dbf - sctp-iterator should run at PI_NET priority ...not 0.
Approved by:	[email protected] (gnn)
2007-12-28 12:38:00 +00:00
Warner Losh 0f0889ad07 MFC: Update to 2008.
Approved by: re@ (kensmith)
2007-12-26 16:49:12 +00:00
Ken Smith 0a7da5a7b6 MFC v1.116:
> For the INDEX file to be used on disc1 of the 7.0-RELEASE the longest
> "build dependencies" field is 5,108 characters which overflows the
> length of the junk buffer by a teeny bit.  This whole section needs
> much more error checking but for now just completely ignore stuff
> we have no interest in instead of copying it to someplace we don't
> use in the process.

Approved by:    re (bmah)
2007-12-24 06:42:35 +00:00
Doug Barton ec1ea103be MFC version 1.55, safety belt for the (unlikely) disappearance of
the temproot before a -r run.

Approved by:	re (kensmith)
2007-12-24 05:51:45 +00:00
Marius Strobl 87b8309953 MFC: 1.8
In openprom_ioctl() ensure appropriate permissions and that data isn't
NULL and doesn't point to a NULL pointer before dereferencing it.

Approved by:	re (kensmith)
2007-12-23 11:31:24 +00:00
Robert Watson c24790b065 Merge in_pcb.c:1.198 from HEAD to RELENG_7:
When IPSEC fails to allocate policy state for an inpcb, and MAC is in use,
  free the MAC label on the inpcb before freeing the inpcb.

  Submitted by:   tanyong <tanyong at ercist dot iscas dot ac dot cn>,
                  zhouzhouyi

Approved by:	re (kensmith)
2007-12-22 19:04:14 +00:00
Ken Smith c9d04a0398 Bump __FreeBSD_version now that RELENG_7_0 has been created.
Approved by:	re (implicit)
2007-12-22 13:48:44 +00:00
Ken Smith 1cabd4712c Technically speaking RELENG_7 becomes 7.0-STABLE once RELENG_7_0 gets
created but that confuses too many people who think that means the
release happened.  So call it PRERELEASE for now.

Approved by:	re (implicit)
2007-12-22 11:28:40 +00:00
Ken Smith 0f36dbfe3d Adjust to shift some packages onto disc3. Strictly speaking not an MFC
since packages are decided on a release-by-release basis but for now
this is the same package set as for 6.3.

Approved by:	re (rwatson)
2007-12-22 06:32:45 +00:00
Ken Smith 2eae01dcda MFC v1.887.2.22:
> Add support for disc3.  Depending on architecture the combination of
> kde3 and gnome2 is at least 670Mb which would mean if we stick with
> just disc1/disc2 the only packages we could provide on the iso's
> would be X11, kde3, and gnome2...

Approved by:	re (rwatson)
2007-12-22 06:29:13 +00:00
Ken Smith 48afcc4f66 MFC v1.253 of dist.c and v1.71 of dist.h:
> A few more adjustments needed because of changes in xorg.  Just installing
> xorg-server doesn't include any video drivers so install xorg-drivers as
> well.  And if font-alias isn't installed the X server won't start,
> complaining it can't find the font "fixed".

Approved by:	re (rwatson)
2007-12-22 06:25:49 +00:00
Robert Watson 2b72de12e7 Merge mac_posix_sem.c:1.12 from HEAD to RELENG_7:
Fix a MAC label leak for POSIX semaphores, in which per-policy labels
  would be properly disposed of, but the global label structure for the
  semaphore wouldn't be freed.

  Reported by:    tanyong <tanyong at ercist dot iscas dot ac dot cn>,
                  zhouzhouyi

Approved by:	re (kensmith)
2007-12-21 14:32:04 +00:00
Robert Watson 5c1368a724 Merge in6_pcb.c:1.86 from HEAD to RELENG_7:
Fix leaking MAC labels for IPv6 inpcbs by adding missing MAC label
  destroy call; this transpired because the inpcb alloc path for IPv4/IPv6
  is the same code, but IPv6 has a separate free path.  The results was
  that as new IPv6 TCP connections were created, kernel memory would
  gradually leak.

  Reported by:    tanyong <tanyong at ercist dot iscas dot ac dot cn>,
                  zhouzhouyi

Approved by:	re (kensmith)
2007-12-21 14:25:43 +00:00
Andrew Thompson 3dc9a55575 MFC r1.25
- Use the macro to check the port status has it will also test if its
    administratively down (!IFF_UP)
  - Use the same parameters to lagg_link_active() to get the backup port as in
    the output path, this didnt actually matter in practice as sc_primary is
    always the first on the port list.

Approved by:	re (kensmith)
2007-12-21 05:33:48 +00:00
Andrew Thompson dc023ffd8f MFC r1.108
When the bridge has an address and a packet comes in for it then drop it if
 the link has been marked discarding by Spanning Tree.

Approved by:	re (kensmith)
2007-12-21 05:29:15 +00:00
John Baldwin 33e3033572 MFC: Remove redundant checks for msgsnd(3) and msgrcv(3).
Approved by:	re (kensmith)
2007-12-20 19:43:55 +00:00
Ruslan Ermilov da65031984 MFC: 1.4: The default of 3 retransmits corresponds to a timeout
value of 45 seconds, not 15.

Approved by:	re (kensmith)
2007-12-20 12:52:06 +00:00
Ruslan Ermilov d832e0e8ec MFC: 1.141: Fix bugs in the TCP syncache timeout code.
Approved by:	re (kensmith)
2007-12-20 12:34:32 +00:00
David Xu ebcdb3dfdf MFC:
Fix LOR of thread lock and umtx's priority propagation mutex due
    to the reworking of scheduler lock.

Approved by: re (kensmith)
2007-12-20 07:15:40 +00:00
Rui Paulo fad8016856 MFC revision 1.679:
Disallow the legacy USB circuit to generate an SMI# via an ICH
  register (MacBooks only).
  This allows MacBooks to boot in SMP mode without any trick and
  solves
  the timer problems with HZ=1000.

Approved by:	     re (kensmith), njl (mentor)
2007-12-19 20:52:37 +00:00
John Baldwin ad237ab823 Regen.
Approved by:	re (kensmith)
2007-12-19 20:48:53 +00:00
Rui Paulo 9961f423b2 MFC revision 1.662 and 1.663:
Disallow the legacy USB circuit to generate an SMI# via an ICH
  register (MacBooks only).
  This allows MacBooks to boot in SMP mode without any trick and solves
  the timer problems with HZ=1000.

Approved by:	     re (kensmith), njl (mentor)
2007-12-19 20:47:44 +00:00
John Baldwin 9b49d7070c MFC: Add freebsd32 compat wrappers for msgctl() and __semctl().
Approved by:	re (kensmith)
2007-12-19 20:43:41 +00:00
John Baldwin 2555aae197 MFC: Move several data structure definitions out of freebsd32_misc.c and
into freebsd32.h and freebsd32_ipc.h.

Approved by:	re (kensmith)
2007-12-19 20:37:53 +00:00
Guido van Rooij 483a6b10be MFC 1.334
Approved by:	[email protected]
2007-12-19 08:10:30 +00:00
Christian Brueffer 5d9cc9c840 MFC: rev. 1.22
Minor language cleanup.

Approved by:	re (blanket)
2007-12-18 20:13:43 +00:00
John Baldwin b7550ae7c5 MFC: Only pass paths to directories or config files that exist for ldconfig
for 32-bit binaries.

Approved by:	re (kensmith)
2007-12-18 01:35:26 +00:00
John Baldwin f6f1df19a8 MFC: Only attach to a GPT partition if it has the GPT_ENT_TYPE_FREEBS
type.

Approved by:	re (kensmith)
2007-12-18 01:24:27 +00:00
Andrew Thompson ddc321ea83 MFC r1.23 - 24
- Support monitor mode where the frame is discarded after bpf and stats
   processing.
 - Add myself to the copyright.

Approved by:	re (kensmith)
2007-12-18 01:23:14 +00:00
John Baldwin 27dc93d62a MFC: Add several missing comma's in the fancy syscall parsing case.
Approved by:	re (kensmith)
2007-12-18 01:21:49 +00:00
John Baldwin 9f7625195f MFC: Update posix_openpt(3) to handle 512 ptys.
Approved by:	re (gnn)
2007-12-18 00:36:21 +00:00
David Xu cc8cab3ea6 MFC revision 1.57:
unbreaks compilation of some old programs.

Approved by: re (kensmith)
2007-12-17 03:05:56 +00:00
Xin LI 4d7ea11f18 MFen:
hardware/article.sgml: 1.326 -> 1.326.2.1
	relnotes/article.sgml: 1.1068.2.18 -> 1.1068.2.20

Approved by:	re (hrs)
2007-12-16 21:38:28 +00:00
Bruce A. Mah 2f7150eb7d MFC: wpi(4), hptrr(4).
src/release/doc/share/misc/dev.archlist.txt		1.101
	src/release/doc/en_US.ISO8859-1/hardware/article.sgml	1.328

Approved by:	re (implicitly)
2007-12-16 13:21:08 +00:00
Bruce A. Mah 0a2ccfca49 New release notes: wpi(4), hptrr(4).
Approved by:	re (implicitly)
2007-12-16 11:45:11 +00:00
Bruce A. Mah 46725d7e98 Modified release note: pf(4), to mention a couple of changes that
might be surprising to users who are upgrading.

Approved by:	re (implicitly)
2007-12-16 02:08:04 +00:00
Randall Stewart de0deac6d1 - Add real sysctl's that change the limits on the number of
4k/9k and 16k clusters, the old sysctl's were just empty
  things that just set delusional numbers that had no effect :-(
- Add an initial limit each to be 1/2 of the previous value starting
 at 2k.. i.e. limit for 4k = 1/2 of 2k, limit for 9k = 1/2 4k etc.

Reviewed by:	[email protected]
Approved by:	[email protected] (gnn)
2007-12-15 23:16:04 +00:00
Xin LI 830abbdcd0 MFC revision 1.46
date: 2007/11/03 17:33:41;  author: scottl;  state: Exp;  lines: +2 -1
Ever since the module registration system was introduced to this driver,
it's been printing out scary messages about "Unhanded Event Notify Frame"
that are needlessly worrisome to users.  Change this warning to only print
out at an elevated debugging level.

Approved by:	re (kensmith)
2007-12-15 18:39:07 +00:00
Xin LI 43ebfcaebb Diff reduction against -HEAD: MFC revision 1.45
date: 2007/10/12 06:03:43;  author: kevlo;  state: Exp;  lines: +3 -3
Spelling fix for interupt -> interrupt

Approved by:	re (kensmith)
2007-12-15 18:38:16 +00:00
Ariff Abdullah 88d01e1652 MFC:
Limit total hardware playback channels to just 1. The reliability of
it's multi DAC / playback channels is not that good. Enabling vchans
make the bug more visible since playback allocation will look for
possible free hardware channels first (i.e: the next DAC, the very first
has been consumed by vchan mixer) which in this case has been proven faulty.

Tested by:	Dominic Fandrey <LoN_Kamikaze at gmx dot de>
URL:		http://lists.freebsd.org/pipermail/freebsd-stable/2007-December/039022.html
Approved by:	re (kensmith)
2007-12-15 04:07:25 +00:00
Ariff Abdullah f197b674c8 MFC:
Disable AC97 microphone channel. Due to the channel allocation priority
that favours true hardware channel, the first instance of recording
request will grab this channel (the first channel is being used as
vchan master). In many cases, it is not really work as intended and give
false impression of broken recording.

PR:		kern/118546
Approved by:	re (kensmith)
2007-12-15 04:06:52 +00:00
Ariff Abdullah 9edf09d984 MFC:
-  nid 28 for Acer @ ALC268 should be identified as analog CD input pin,
   though it doesn't provides proper (sane, valid, usable, etc) analog CD
   playback due to its stripped down nature.
-  Add speaker/headphone controls for HP Compaq DC7700 Small Form Factor PC
   @ ALC262. [1]

   Submitted by:  [1]  Carlos A. M. dos Santos <unixmania at gmail dot com>

Approved by:	re (kensmith)
2007-12-15 04:06:12 +00:00
Scott Long 98f4ad8758 Add the hptrr driver.
Submitted by: Highpoint
Approved by: re
2007-12-15 02:57:31 +00:00
Pyun YongHyeon c624e58a52 MFC if_re.c rev 1.99, if_rlreg.h rev 1.69 to RELENG_7
Add another RTL8168 revision 3 which is found on RTL8111-GR Gigabit
  Ethernet Controller.

Requested by:	delphij
Approved by:	re (kensmith)
2007-12-15 02:57:18 +00:00
cvs2svn 2b6a405622 This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2007-12-15 00:56:20 +00:00
David E. O'Brien 9b9edf29eb MFC: rev 1.1.1.20: Do not fold -C*ABS<n> to ABS<-C*n>
Approved by:	re(kensmith)
2007-12-14 23:57:56 +00:00
Hajimu UMEMOTO ee920b29e4 MFC: Update libc's resolver to BIND 9.4.2.
lib/libc/nameser/ns_parse.c:	1.1.1.3
	lib/libc/resolv/res_data.c:	1.5
	lib/libc/resolv/res_init.c:	1.7

Approved by:	re (kensmith)
2007-12-14 20:32:13 +00:00
Randall Stewart df328b80a4 - Add init,fini,ctor and dtor events for process and thread
creation.
Approved by:	[email protected](gnn)
2007-12-14 13:41:09 +00:00
Alan Cox 8a127db5fb MFC
Eliminate compilation warnings due to the use of non-static inlines
  through the introduction and use of the __gnu89_inline attribute.

Approved by:	re (kensmith)
2007-12-13 19:34:23 +00:00
Konstantin Belousov a17df66f73 MFC rev. 1.710:
Use curthread instead of the FIRST_THREAD_IN_PROC for vnlru and syncer,
when applicable.

Aquire Giant slightly later for vnlru.

In the syncer, aquire the Giant only when a vnode belongs to the
non-MPsafe fs.

In both speedup_syncer() and syncer_shutdown(), remove the syncer thread from
the lbolt sleep queue after the syncer state is modified, not before.

Approved by:	re (kensmith)
2007-12-13 11:58:00 +00:00
Doug Barton d690d861c3 MFC all updates to date, including the merger of the fortunes-o.real
and fortunes2-o files, and the relevant ObsoleteFiles.inc entry.

Approved by:	re (kensmith)
2007-12-13 05:45:08 +00:00
David Xu d695d61f3a MFC revision 1.64:
> Enclose all code for macro ENQUEUE_MUTEX in do while statement, and
	> add missing brackets.

Approved by: re (kensmith)
2007-12-13 02:29:17 +00:00
Ed Maste e0ade83eb2 MFC to RELENG_7:
aac.c:1.124
aacvar.h:1.49

  Allow simultaneous opens of the device for issuing commands to the
  controller.  This is merged from Adaptec driver build 11669.

aac.c:1.125
aac_pci.c:1.66
aacreg.h:1.24

  Add family support to allow the driver to attach to new devices that
  share the same interface.

aac_cam.c:1.30

  Merge from Adaptec a 64 bit fix and a workaround for luns != 0
  returning CAM_SEL_TIMEOUT on SAS controllers, which prevented
  passthrough devices from being created.

Approved by:	re (kensmith)
2007-12-10 20:18:19 +00:00
Gabor Kovesdan 87466ff3c0 MFC rev 1.13:
- Add doc/hu_* and doc/mn_* to the refuse examples so that include all
  of the currently used languages

Approved by:	re (kensmith)
2007-12-10 18:47:05 +00:00
Gabor Kovesdan 6ad5804dfa MFC rev 1.14:
- Add doc/hu_* and doc/mn_* to the sample refuse file so that it includes all
  of the languages

Approved by:	re (kensmith)
2007-12-10 18:40:55 +00:00
Jung-uk Kim b85c778904 MFC: 1.3
Teach dhclient(8) about net80211 link (association) status.

Especially it helps ndis(4) where it is used with wpa_supplicant(8)
since 0.5.8 is imported.  Previously ndis_events(8) was used to notify
link status to wpa_supplicant but it is defuct now, i. e., external event
notification mechanism is removed by the vendor and there is no substitute
for ndisulator yet.

Reviewed by:	brooks
OK'd by:	sam
Approved by:	re (kensmith)
2007-12-10 17:49:16 +00:00
Ed Maste 7d63e86312 MFC to RELENG_7 new PCI IDs
aac_pci.c 1.64, 1.65
  aac.4 1.39

  Adaptec RAID 51245
  Adaptec RAID 51645
  Adaptec RAID 52445
  Adaptec RAID 5405
  AOC-USAS-S4i
  AOC-USAS-S8i
  AOC-USAS-S4iR
  AOC-USAS-S8iR
  AOC-USAS-S8i-LP
  AOC-USAS-S8iR-LP
  SG-XPCIESAS-R-IN
  SG-XPCIESAS-R-EX
  Sun STK RAID REM
  Sun STK RAID EM

Approved by:	re (kensmith)
2007-12-10 15:29:32 +00:00
Xin LI 07c239f3b8 Bring in Simplified Chinese translation for RELENG_7's release documentations.
Approved by:	re (kensmith)
2007-12-09 23:37:43 +00:00
cvs2svn 3dd4c0540a This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2007-12-09 23:37:11 +00:00
Randall Stewart d451c79512 - Found a problem in non-blocking sends. When
sending, once the locks are all unlocked to
     do the copy's in, its possible that other
     events could then raise the number of bytes
     outstanding pushing it so not all the message
     would fit. This would then cause us to send
     only part of the message. This fix makes it
     so we keep a "reserved" amount that can be
     kept in mind when making calculations to send.
   - rcv msg args with a NULL/NULL for to/tolen will return
     an error incorrectly for the 1-2-1 model.
   - We were not doing 0 len return correctly and not
     setting socantrcv() more correctly. Previouly we "fixed"
     this area by taking out the socantrcv()
     since we then could not get the data out. The correct fix
     is to still flag the socket but alow a by-pass route to
     continue to read until all data is consumed.
   - Fix the initial buf calculation to be more friendly, calc is
     the same but we use different variable to make it easier
     amongst the different code versions.
   - Signedness issue with one of the new var's (this is an issue
     mainly in apple but with the right -Wall it could effect us too).
   - optimize the initialization of the SB max variables.
   - Missing lock(s) when sending data and moving it to the
     outqueue.
   - If a mbuf alloc fails during moving to outqueue the
     reassembly of the old mbuf chain was incorrect.
   - some_taken becomes a counter in sctputil.c instead of a set to 1.
   - Fix a panic to be only under invarients and have a proper recovery
     in reading messages.
   - msg_flags needed to be set to the value collected not or'd.
   - More fixes for lock misses on the transfer of data to
     the sent_queue. Sometimes I wonder why any code
     ever works   :-)
   - Fix the pad of the last mbuf routine, It was working improperly
     on non-4 byte aligned chunks which could cause memory overruns.
Approved by:	[email protected](gnn)
2007-12-09 20:23:47 +00:00
Xin LI 42e3aac809 Sync up ata(4) work by sos@ on -HEAD:
* Add preliminary SATA ATAPI support for sii 3132/3124 chips.
 * Fix speed report on Intel SATA chips in compat mode.
 * Fix broken detect of JMicron 368.

Related revisions:
 - ata-chipset.c: 1.208, 1.210
 - ata-disk.c.c:  1.205

Approved by:	re (kensmith), sos
2007-12-09 19:27:19 +00:00
Scott Long 8d176865b8 MFC: Adjust locking definitions.
Approved by: re
2007-12-09 19:26:21 +00:00
Nate Lawson 5a75f72cbe MFC: 1.149-1.150. Hold Giant over device_suspend/resume() methods in apm.
Approved by:	re
2007-12-09 00:24:16 +00:00
Scott Long 2acdd5ba85 Support new ARC120x family of controllers. Many thanks for Areca's continued
support of FreeBSD.

Submitted by: Erich Chen @ Areca
Approved by: re
2007-12-08 21:39:06 +00:00
Benjamin Close eb7309d73c MFC rev 1.5 if_wpi.c
MFC rev 1.2 if_wpireg.h
MFC rev 1.1 if_wpivar.h
MFC rev 1.3 wpi.4

    o Initial Import of Intel 3945abg Wireless Lan Controller (wpi) driver
    o Turn off debug output
    o Fix WEP compatiblity
    o Handle missed beacons correctly

    MFC includes firmware & LICENSE as well.

Approved by: re (kensmith), mlaier (comentor)
2007-12-08 12:44:59 +00:00
Remko Lodder d00e129312 MFC rev 1.6 msk.4
MFC rev 1.26 if_msk.c
MFC rev 1.11 if_mskreg.h

  Bring in support for: Marvell Yukon 8039

  PR:             118401
  Submitted by:   Skip Ford <skip at menantico dot com>
  Approved by:    imp (mentor), yongari
  MFC After:      3 days

Approved by:	re (kensmith), imp (mentor, implicit)
2007-12-08 12:19:13 +00:00
Ulf Lilleengen b09ad44098 - Add support for all geom class command options in the Fixit environment by
pointing GEOM_LIBRARY_PATH to the geom libraries.

PR:		misc/113543
Submitted by:	Ed Schouten <ed -at- fxq.nl>
Approved by:	re (kensmith), pjd (mentor)
2007-12-08 09:41:50 +00:00
Tim Kientzle 2d0c4f2e9c MFC: If "length at end" flag is specified, then a zero length
at the beginning shouldn't be interpreted to mean an empty body.

Approved by: re (Ken Smith)
2007-12-08 07:52:40 +00:00
Xin LI 282efc867a - Reflect the fact that em(4) was updated to 6.7.3;
- Reflect the fact that BIND was updated to 9.4.2;
 - Move TMPFS to file systems section.

Approved by:	re (hrs, kensmith)
2007-12-08 05:59:12 +00:00
Alan Cox 5e5aac0b48 MFC revision 1.601
Correct an error under COUNT_IPIS within pmap_lazyfix_action(): Increment
  the counter that the pointer refers to, not the pointer.

Approved by: re (kensmith)
2007-12-08 05:16:29 +00:00
Kip Macy 34ff01ab72 MFC: 1.317, 1.318, 1.319
Fix bit macros to work on multi-byte types

Approved by: re(kensmith)
2007-12-07 23:22:57 +00:00
Olivier Houchard 02c8f08473 MFC rev 1.90:
Fix a potential bug in pmap :
We used to allocate the domains 0-14 for userland, and leave the domain 15
for the kernel. Now supersections requires the use of domain 0, so we
switched the kernel domain to 0, and use 1-15 for userland.
How it's done currently, the kernel domain could be allocated for a
userland process.
So switch back to the previous way we did things, set the first available
domain to 0, and just add 1 to get the real domain number in the struct pmap.

Reported by:    Mark Tinguely <tinguely AT casselton DOT net>
Approved by:	re (kensmith)
2007-12-07 22:28:49 +00:00
Olivier Houchard 5a466dbfe7 MFC:
sys/arm/include/asmacros.h rev 1.7
sys/arm/include/atomic.h rev 1.23

Close a race.

The RAS implementation would set the end address, then the start
address.  These were used by the kernel to restart a RAS sequence if
it was interrupted.  When the thread switching code ran, it would
check these values and adjust the PC and clear them if it did.

However, there's a small flaw in this scheme.  Thread T1, sets the end
address and gets preempted.  Thread T2 runs and also does a RAS
operation.  This resets end to zero.  Thread T1 now runs again and
sets start and then begins the RAS sequence, but is preempted before
the RAS sequence executes its last instruction.  The kernel code that
would ordinarily restart the RAS sequence doesn't because the PC isn't
between start and 0, so the PC isn't set to the start of the sequence.
So when T1 is resumed again, it is at the wrong location for RAS to
produce the correct results.  This causes the wrong results for the
atomic sequence.

The window for the first race is 3 instructions.  The window for the
second race is 5-10 instructions depending on the atomic operation.
This makes this failure fairly rare and hard to reproduce.

Mutexs are implemented in libthr using atomic operations.  When the
above race would occur, a lock could get stuck locked, causing many
downstream problems, as you might expect.

Also, make sure to reset the start and end address when doing a syscall, or
a malicious process could set them before doing a syscall.

Reviewed by: imp, ups (thanks guys)
Approved by:	re (kensmith)
Pointy hat to:  cognet
2007-12-07 22:08:02 +00:00
Xin LI 1fa75bf5b4 MFC revision 1.209
date: 2007/11/26 19:08:08;  author: sos;  state: Exp;  lines: +1 -1
Use device_set_desc_copy in the generic ident as its used on a temp buffer.

Approved by:	re (kensmith)
2007-12-07 17:59:39 +00:00
Doug Barton 906c6141ea MFC contrib code and bmake changes for BIND version 9.4.2
Approved by:	re (kensmith)
2007-12-07 08:31:23 +00:00
Mike Silbersack 962e919636 MFC rev 1.136: Fix SACK
No merges to branches prior to 7 are necessary; this is a 7 and above
bug only.

Approved by:	re (gnn)
2007-12-07 05:52:24 +00:00
Kip Macy f967770ba1 Add padding for anticipated functionality
- vimage
  - TOE
  - multiq
  - host rtentry caching

 Rename spare used by 80211 to if_llsoftc

 Reviewed by: rwatson, gnn
 Approved by: re(gnn)
2007-12-07 05:46:09 +00:00
Kevin Lo e1ae40edae MFC r1.18:
zic(8) should exit the loop when the end of the string is reached
due to the call to error(). The problem found by doing fuzz testing.

Approved by: re (kensmith)
2007-12-07 05:17:34 +00:00
Andrew Thompson 55d4d32d14 MFC r1.209
Apply a workaround for the unkillable jail problem where some devices created
  within the jail are never freed.

Approved by:	re (kensmith)
2007-12-07 03:46:23 +00:00
Brooks Davis bc06bb7574 MFC:
To reduce the impact of possible removal of the syscalls required by
libkse in FreeBSD 8.0, do not build or install static versions of libkse
(i.e. libkse*.a) in the default case.  Static versions will be built and
installed if libthr is not built or if libkse is the default threading
library.

Discussed on:	freebsd-arch
Approved by:	re (kensmith)
2007-12-06 16:22:18 +00:00
Konstantin Belousov 82631e01b1 MFC
rev 1.323 of src/sys/amd64/amd64/trap.c
rev 1.310 of src/sys/i386/i386/trap.c

Fix the ABI change of the signal delivered on the access to the page
with insufficient protection mode.

Approved by:	re (kensmith)
2007-12-06 14:20:25 +00:00
Konstantin Belousov 87385bb59a MFC
rev 1.182 of src/sys/kern/imgact_elf.c
rev 1.288 of src/sys/kern/init_main.c
rev 1.312 of src/sys/kern/kern_exec.c
rev 1.85 of src/sys/kern/kern_mib.c
rev 1.496 of src/sys/sys/proc.h
rev 1.262 of src/sys/sys/systm.h

Implement fetching of the __FreeBSD_version from the ELF ABI-tag note.
The value is read into the p_osrel member of the struct proc. p_osrel
is set to 0 for the binaries without the note.

Approved by:	re (kensmith)
2007-12-06 14:19:43 +00:00
Konstantin Belousov 8c4e722f2c MFC rev. 1.181:
Check for the program headers alignment of the ELF images before
dereferencing. Unaligned access could cause panic on strict alignment
architectures.

Approved by:	re (kensmith)
2007-12-06 13:47:46 +00:00
Konstantin Belousov 4026164992 MFC rev. 1.5, 1.6:
Restore the branding of the ELF executables. The structure was optimized out.

Approved by:	re (kensmith)
2007-12-06 13:43:43 +00:00
Florent Thoumie 724bc24618 MFC: Fix exit code when using -l on a non-existent md(4) device.
src/sbin/mdconfig/mdconfig.c: rev 1.54 -> 1.55

PR:		conf/116177
Submitted by:	Remi Guyomarch <[email protected]>
Approved by:	re (kensmith)
2007-12-06 11:54:36 +00:00
Philip Paeps 406ba5f77d MFC r1.33: Add a cross-reference to newgrp(1).
Approved by:	re (kensmith)
2007-12-06 10:50:35 +00:00
Robert Watson 6d80dfcee4 Disable support for /dev/ptmx in FreeBSD 7.0. While it's a good idea in
principle, the current devfs-based cloning facilit makes the current
user<->kernel protocol for allocating new pts nodes difficult or
impossible to do without leading to resource leaks or race conditions.

We tentatively plan to reintroduce ptmx/pts support in FreeBSD 7.1 once
a fixed version has settled out in HEAD.  People who really want to run
with the current code can re-enable it but it will require tweaking
conf files and unifdef'ing it.  By removing it now before the release,
we avoid having to support the current allocation protocol in future
releases in order to provide backwards compatibility with older libc's.

Discussed with:	cognet, erwin
Approved by:	re (kensmith)
2007-12-06 10:15:29 +00:00
Philip Paeps 2fe10c0994 MFC r1.13:
Fix a use-after-free.

Submitted by:	Ilja van Sprundel <ilja -at- netric.org>
Reviewed by:	secteam
Approved by:	re (kensmith)
2007-12-06 09:53:42 +00:00
Philip Paeps 5e10dd18c6 MFC r1.34:
Plug two potential (root-only, local) information leaks.  buf is not
  initialized before use and returned integrally instead of up to size.

Submitted by:	Ilja van Sprundel <ilja -at- netric.org>
Reviewed by:	secteam
Approved by:	re (kensmith)
2007-12-06 09:52:28 +00:00
Philip Paeps 6c6becd398 MFC r1.59:
Plug two potential (root-only, local) information leaks.  buf is not
  initialized before use and returned integrally instead of up to size.

Submitted by:	Ilja van Sprundel <ilja -at- netric.org>
Reviewed by:	secteam
Approved by:	re (kensmith)
2007-12-06 09:50:48 +00:00
John Baldwin 2df37175be MFC: Always assume type #1 PCI config transactions for amd64 and relax the
probe for type #1 on i386.

Approved by:	re (kensmith)
2007-12-06 08:27:03 +00:00
John Baldwin 6a589c6a46 MFC: Change pci_cfgdisable() into a nop for type #1 similar to what other
OSs do.

Approved by:	re (kensmith)
2007-12-06 08:13:52 +00:00
John Baldwin a3c4c4af76 MFC: Don't delete files in the X11 socket directories under /tmp.
Approved by:	re (kensmith)
2007-12-06 08:11:19 +00:00
John Baldwin 6f61e79716 MFC: Properly sort 'sync' in the list of options passed to -o.
Approved by:	re (kensmith)
2007-12-06 08:08:04 +00:00
Pyun YongHyeon 3ee5c17152 MFC if_re.c, rev 1.98 to RELENG_7
Always honor promiscuous flag prior to programming Rx multicast
filter. This fixes a regression introduced in rev 1.89.

PR:	114632
Approved by:	re (kensmith)
2007-12-06 06:00:58 +00:00
Ariff Abdullah 3e7c85ac90 Fix audio playback aborted with SNDCTL_DSP_SETTRIGGER, affecting
PortAudio version 19.

PR:		kern/118395
Submitted by:	Henrik Gulbrandsen <henrik at gulbra dot net>
Approved by:	re (kensmith)
2007-12-06 05:21:39 +00:00
Ariff Abdullah 0bbdfe5f8f Headphone / speakers automute fixup for Acer Aspire 4710 @ ALC268 laptop.
Tested by:	Liyu, She
Approved by:	re (kensmith)
2007-12-06 05:21:07 +00:00
Pyun YongHyeon a9203a9048 MFC if_nfe.c, rev 1.22 to RELENG_7
Apparently some NVIDIA NICs store ethernet address in reverse order
  while other variants have inorder ethernet address for the same
  chipset. Override ethernet address ordering if we already know how
  it was stored. This fixes the use of inversed ethernet address on
  MCP67.

Approved by:	re (kensmith)
2007-12-06 04:05:56 +00:00
Ruslan Ermilov fec80518d1 MFC: 1.126: Revise the markup.
Approved by:	re (kensmith)
2007-12-05 14:29:07 +00:00
Konstantin Belousov f1e2fec476 MFC rev. 1.79:
Implement read_default_ldt in linux_modify_ldt().

Approved by:	re (kensmith)
2007-12-05 13:31:57 +00:00
Bjoern A. Zeeb acd6444a97 MFC: rev. 1.143 sys/netinet/tcp_output.c
Make TSO work with IPSEC compiled into the kernel.

    The lookup hurts a bit for connections but had been there anyway
    if IPSEC was compiled in. So moving the lookup up a bit gives us
    TSO support at not extra cost.

Approved by:    re (kensmith)
2007-12-05 10:37:17 +00:00
Andrew Thompson 4a30332e8c MFC r1.126
Hide a debug printf.

Approved by:	re (kensmith)
2007-12-05 02:53:44 +00:00
Colin Percival 95da346d28 MFC revision 1.3: Add /root/, /.cshrc, and /.profile to the default
UpdateIfUnmodified directive in order to avoid overwriting these when
users upgrade to future versions of FreeBSD.

Approved by:	re (kensmith)
2007-12-04 22:49:18 +00:00
Xin LI 5e98c79bff MFC: less v416
Approved by:	re (kensmith)
2007-12-04 22:37:28 +00:00
Marius Strobl bc0e585d84 MFC: sys/sparc64/pci/ofw_pcibus.c 1.17;
sys/sparc64/pci/psycho.c 1.71, 1.72;
     sys/sparc64/pci/psychovar.h 1.17

- Add the PCI side of the HOST-PCI bridge itself to the bus. This
  is required by the X.Org PCI domains code and additionally needs
  a workaround for Hummingbird and Sabre bridges as these don't
  allow their config headers to be read at any width, which is an
  unusual behavior.
- In psycho(4) take advantage of DEFINE_CLASS_0 and use more
  appropriate types for some softc members.

Approved by:	re (kensmith)
2007-12-04 21:40:47 +00:00
Robert Watson 351626b1a3 MFC stack(9) up through revision 1.3 from HEAD to RELENG_7.
Approved by:	re (kensmith)
2007-12-04 15:22:31 +00:00
cvs2svn 276f367d58 This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2007-12-03 11:38:29 +00:00
Joseph Koshy ce57e3ce15 MFC r1.6:
"Revert revision 1.4.

 Intel CPUs with family 0x6, model 0xE and later (i.e., Intel Core(TM))
 have a PMC architecture that differs somewhat from previous CPUs in
 family 0x6.  Even though the basic programming model is similar, the
 documented set of legal values that may be loaded into their PMC MSRs
 differs from that of the previous PMCs in family 0x6 and reusing bit
 values legal for the older PMCs could result in undefined behaviour in
 the general case."

Approved by:	re (gnn)
2007-12-03 10:50:58 +00:00
Olivier Houchard 33b7747f90 MFC:
libthread_db bits for arm.

Approved by:	re (kensmith)
2007-12-02 14:44:34 +00:00
Olivier Houchard ff2d9e41c6 MFC:
gnu/usr.bin/gdb/arch/arm/nm-fbsd.h rev 1.2
gnu/usr.bin/gdb/arch/arm/Makefile rev 1.2
gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c 1.2
gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c rev 1.2
gnu/usr.bin/gdb/arch/arm/init.c rev 1.2
Allow gdb to attach live process.
Thread support for arm.

Approved by:	re (kensmith)
2007-12-02 14:38:21 +00:00
Olivier Houchard fae91cdd6e MFC:
arm/at91/kb920x_machdep.c rev 1.24, 1.25 and 1.26
arm/at91/std.at91 rev 1.4
arm/at91/std.kb920x rev 1.5
arm/at91/at91rm92reg.h rev 1.6
conf/options.arm 1.18
Small tweaks to be able to load the kernel at a different address than
0x20000000 + add an option to override the default value of the master clock
frequency.
arm/at91/if_ate.c rev 1.21:
In ate_get_mac(), try to get the mac address in the right order, at least
in the same order as it's set in ate_set_mac.

arm/conf/HL200: config file for the Hot-e HL200

Approved by:	re (kensmith)
2007-12-02 14:21:27 +00:00
Olivier Houchard 17f3e5151e MFC rev 1.94:
date: 2007/11/05 23:08:34;  author: cognet;  state: Exp;  lines: +4 -0
Switch arm to -O until the -O2 issues are resolved.

Approved by:	re (kensmith)
2007-12-02 13:24:43 +00:00
cvs2svn c27e674e3e This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2007-12-02 13:10:45 +00:00
Bjoern A. Zeeb 1d5ed42e42 MFC: rev. 1.303 sys/netinet/tcp_subr.c [1]
rev. 1.135 sys/netinet/tcp_syncache.c
     rev. 1.145 sys/netinet/tcp_output.c

   Unbreak TCP-MD5 signature calculations.

   Submitted by:   Nick Hilliard (see net@) [1]
   Tested by:      Nick Hilliard (see net@)
   Tested by:      tools/regression/netinet/tcpconnect

Approved by:	re (kensmith)
2007-12-02 10:32:49 +00:00
Bjoern A. Zeeb 3db2bd5dd0 MFC: rev. 1.144 sys/netinet/tcp_output.c
Let opt be an array.  Though &opt[0] == opt == &opt, &opt is highly
   confusing and hard to understand so change it to just opt and
   remove the extra cast no longer/not needed.

Approved by:	re (kensmith)
2007-12-02 10:17:30 +00:00
Doug Rabson 3ed7d7c408 MFC: Make sure GSS-API mechanisms are loaded if gss_acquire_cred is called
with a null mechanism list.`

Approved by: re (hrs)
2007-12-02 10:06:59 +00:00
Ken Smith c85c431742 Get ready for BETA4 builds.
Approved by:	re (implicit)
2007-12-02 09:12:03 +00:00
Remko Lodder 22af6f832c MFC rev 1.29 atacontrol.8
Expand the EXAMPLES section for atacontrol.8

  PR:             docs/117310
  Submitted by:   Ted Mittelstaedt <tedm at ipinc dot net>
                  with minor modifications by me.

Approved by:	re (hrs)
2007-12-02 08:49:23 +00:00
Remko Lodder 216acdaa1a MFC rev 1.64 sysctl.8
Remove mentionings of kern.dumpdev which is no longer available.

  PR:             docs/113570
  Submitted by:   lawrance
  MFC After:      3 days (where applicable)

Approved by:	re (hrs)
2007-12-02 08:48:30 +00:00
Remko Lodder 926f00db2e MFC rev 1.41, 1.42 mdconfig.8
Sync with md(4)'s information regarding the swap backend.

  PR:             docs/115721
  Submitted by:   Stefan Lambrev <[email protected]>
  MFC After:      3 days

  Every newline should start on it's own line. I didn't do that in the
  previous commit, so make it happen now.

  Prodded by:     brueffer

Approved by:	re (hrs)
2007-12-02 08:47:28 +00:00
Remko Lodder 993a73f693 MFC rev 1.9 nfe.4
The nfe driver will first appear in 7.0 and not in 6.x

  PR:             i386/118264
  Submitted by:   "Julian H. Stacey" <jhs at berklix dot org>
  Nod from:       yongari

Approved by:	re (hrs)
2007-12-02 08:45:57 +00:00
Remko Lodder a66454e437 MFC rev 1.7 newsyslog.conf.5
s/effect/affect/

  PR:             docs/118266
  Submitted by:   "Kim Scarborough" <sluggo at unknown dot nu>
  MFC After:      3 days

Approved by:	re (hrs)
2007-12-02 08:45:05 +00:00
Remko Lodder 40f459ba13 MFC rev 1.8 ichsmb.4
Add information about the ICH6 and ICH7 being supported since recently.

MFC rev 1.20 ichsmb_pci.c

  Add the Intel 82801FB (ICH6) SMBus controller and the
  Intel 82801GB (ICH7) SMBus controller.

  PR:             85106 [1]
  PR:             99663 [2]
  Approved by:    imp (mentor), jhb
  Submitted by:   Oliver Fromme <olli at lurza.secnetix dot de>, [1]
                  Arthur Hartwig <arthur dot hartwig at nokia dot com>, [1]
                  Lowell Gilbert <lgfbsd at be-well dot ilk dot org> [2]@
  MFC After:      3 days

Approved by:	re (hrs), imp (mentor, implicit)
2007-12-02 08:42:16 +00:00
Remko Lodder 79bebf6780 MFC rev 1.45 rl.4
Add the Planex FNW-3603TX card to the list.

MFC rev 1.172 if_rl.c
MFC rev 1.68  if_rlreg.h

  Add the FNW3603TX Planex NIC.

  PR:             76081
  Approved by:    imp (mentor)
  Submitted by:   umi at pocke dot org
  MFC After:      3 days

Approved by:	re (hrs), imp (mentor, implicit)
2007-12-02 08:38:32 +00:00
Remko Lodder 32f463a00d MFC rev 1.11 agp.4
Add information about the 845M card that I recently committed support
    for.

Approved by:	re (hrs)
2007-12-01 17:24:18 +00:00
Remko Lodder 2463e28798 MFC rev 1.11 agp.4
Add information about the 845M card that I recently committed support
  for.

MFC rev 1.44 agp_i810.c

  Add the 845M GMCH controller.

  PR:             114802
  Approved by:    imp (mentor), anholt (private mail)
  Submitted by:   Alex Goncharov <algo1 at comcast dot net>
  MFC After:      3 days

Approved by:	re (hrs), imp (mentor, implicit)
2007-12-01 16:24:23 +00:00
Attilio Rao a0a70cee4e MFC kern_mutex.c rev. 1.201 and kern_rwlock.c rev. 1.32:
Simplify adaptive spinning algorithm which should make things faster
when sleeping / waking up waiters.
Also fix a bug with rw_try_upgrade() when adaptive spinning is enabled
as turnstile_lookup() will recurse on ts_lock that will never be
released [1].

[1] Reported by: jeff with Nokia help
Tested by: pho, kris (earlier, bugged version of rwlock part)
Discussed with: jhb, jeff
Approved by: re
2007-12-01 11:28:37 +00:00
Tai-hwa Liang 7d94ab0d2e MFC(1.86): Eliminating an unnecessary check on an_gone inside
an_stats_update() since a properly locked callout_stop(9) does do the
right thing.

Approved by:	re (kensmith)
2007-12-01 07:01:45 +00:00
Darren Reed 317b869c4d MFC:
Fix 3 issues relating to the use of "auth" rules in IPFilter, from sourceforge:
1837014 Kernel panics after authentication of an outgoing packet
1836992 Potential bugs in packet auth code (w/patches)
1836967 Kernel panic when using auth rule with keep state
and another reported only to FreeBSD by Andiry (see PR)

PR:             kern/118251
Submitted by:   Andriy Syrovenko <[email protected]>
Reviewed by:    darrenr
Approved by:    re
2007-12-01 00:53:41 +00:00
Ed Maste fbe46d536d Merge from HEAD to RELENG_7
src/sys/dev/aac/aac_pci.c 1.63
src/share/man/man4/aac.4 1.37, 1.38

  Add PCI IDs from Adaptec's driver version b11669:

  Adaptec RAID 3085
  Adaptec RAID 31205
  Adaptec RAID 31605
  Adaptec RAID 5085
  Adaptec RAID 51205
  Adaptec RAID 51605
  Adaptec RAID 5445
  Adaptec RAID 5805
  IBM ServeRAID 8s
  ICP RAID ICP5045BL
  ICP RAID ICP5085BL
  ICP RAID ICP5085SL
  ICP RAID ICP5125BR
  ICP RAID ICP5125SL
  ICP RAID ICP5165BR
  ICP RAID ICP5165SL
  ICP RAID ICP5445SL
  ICP RAID ICP5805BL
  ICP RAID ICP5805SL
  ICP9067MA SATA RAID

Approved by:	re (kensmith)
2007-11-30 15:55:50 +00:00
Ariff Abdullah f52747efb1 MFC:
- Remove magic number and fit max rx buffer size accurately.
- Patch registers CR47 and CR157 on devices that require it.
- Fix power calibration setting on ZD1211B.

Obtained from:  OpenBSD

- Fix multicast transfer by properly reprogram multicast global
  hash table, which in turns fix promiscuous mode and IPv6
  autoconfiguration / local networking.

Reviewed by:	sam, Weongyo Jeong
Tested using:	Aztech WL230 , Belkin F5D7050, Unicorn WL-54G,
             	3COM 3CRUSB10075
Approved by:	re (kensmith)
2007-11-30 15:39:22 +00:00
Henrik Brix Andersen 074e5b657b MFC: (revision 1.121)
Add usr/lib/libgssapi_krb5.so.8 to the list of old libs from the
20071120 shared library version bump.

Approved by:	re (kensmith), erwin (mentor)
2007-11-30 15:35:18 +00:00
Ariff Abdullah d4188c1576 MFC: (revision 1.47, 1.48)
- Add missing MCP65 id which was accidentally removed in previous commit.
- Add Analog Devices AD1984 codec id.
- Enable pcbeep control for Acer + ALC268 (nid 29). Give enough (fake)
  hints so the parser will grab it and allocate "speaker" control.
- Fix regression while preparing DAC and ADC for multichannel
  format. Since playback policy is to output to every possible path,
  ensure that each DAC is started.

Reported / Tested by:	Guy Brand
Approved by:		re (kensmith)
2007-11-30 15:12:06 +00:00
Bruce A. Mah cb37077b69 New release note: SA-07:09.random.
Approved by:	re (implicitly)
2007-11-30 05:19:24 +00:00
Bruce A. Mah 87c5c6cf54 Use 7.0-stable base system and 7.2 X.org manpages.
Approved by:	re (implicitly)
2007-11-30 05:11:58 +00:00
Sam Leffler 68511542cc MFC: ieee80211_find_channel_byieee for use with sta mode scanning
changes to handle off-channel beacons

Approved by:	re (kensmith)
2007-11-29 21:23:22 +00:00
Robert Watson a0c6c9893b Restore RFC 1724 hack for interface selection to RELENG_7, as routed and
other routing daemons still rely on this interface and otherwise do not
function on 7.0.  It has not been restored to 8-CURRENT, so this is not
an MFC.

Reviewed by:	bms
Submitted by:	Marko Zec <zec icir org>
Tested by:	kensmith
Approved by:	re (kensmith)
2007-11-29 20:16:42 +00:00
Andrew Thompson 943560d276 MFC r1.22
Have the lagg interface generate link up/down events, this fixes using
 carp+lagg together.

Approved by:	re (kensmith)
2007-11-29 19:05:22 +00:00
Sam Leffler 61a8731f19 MFC 1.8: be more careful handling off-channel frames
Approved by:	re (kensmith)
2007-11-29 19:05:09 +00:00
Maxim Konovalov 4c2e9c55a9 MFC rev. 1.23: do not leak inodes hash table at module unload.
Approved by:	re (kensmith)
2007-11-29 19:02:05 +00:00
Maxim Konovalov 3a3a146365 MFC rev. 1.204: fix a typo in ipfw table usage example.
Approved by:	re (kensmith)
2007-11-29 18:42:15 +00:00
Ed Maste ee4fe8d52d MFC aac.c v1.121:
Correct calculation of aac_sg_tablesize.

  Obtained from:  Adaptec, via driver b11669

Approved by:	re (kensmith)
2007-11-29 18:38:31 +00:00
Simon L. B. Nielsen 177061dbad Correct a random value disclosure in random(4).
Security:	FreeBSD-SA-07:09.random
Approved by:	re (kensmith)
2007-11-29 16:06:54 +00:00
Max Khon 190aa7c4ce Fix -jX when makefiles are remade.
Approved by:	re (kensmith)
2007-11-29 04:20:19 +00:00
Tai-hwa Liang 6d36b5c0b3 MFC(1.14): Fixing a double free bug which will cause tail to dump core when
there's no tailing newline(\n) character.

PR:		bin/118267
Reviewed by:	kib
Approved by:	re (kensmith)
2007-11-29 03:54:56 +00:00
Jack F Vogel bbb346a6d1 Latest driver version added to RELEASE.
Approved by: re
2007-11-28 23:52:14 +00:00
Jack F Vogel 5928852f5c MFC of the New em driver from HEAD
Approved by:re
2007-11-28 23:24:38 +00:00
Colin Percival 002ba3a4a6 Back out previous commit; i.e., turn hyperthreading back on by default.
Newer Intel processors have better hyperthreading implementations than
the original ones, and FreeBSD's SMP and scheduler code has greatly
improved between 6.x and 7.x; so hyperthreading now provides a
non-trivial performance win.

Note that security issues involving shared caches and other
microarchitectural features (e.g., dynamic branch prediction tables)
still exist; consequently, it is recommended that hyperthreading be
turned off on systems with untrusted local users.  This can be
performed by setting machdep.hyperthreading_allowed=0 in
/boot/loader.conf.

Hyperthreading will continue to be disabled by default on FreeBSD 6.x.

Requested by:	core
Approved by:	re (kensmith)
Security:	See FreeBSD-SA-05:09.htt for background information.
2007-11-28 23:24:07 +00:00
Alan Cox f78bd811dc MFC revision 1.360
When reactivating a cached page, reset the page's pool to the default
  pool.  (Not doing this before was a performance pessimization but not
  a cause for panic.)

Approved by:	re (kensmith)
2007-11-28 22:23:35 +00:00
David E. O'Brien 83e6f06f3a MFC: fix situation where GDB gives incorrect backtraces when a signal
handler is in the call chain.

Approved by:	re(kensmith)
2007-11-28 16:55:39 +00:00
Sam Leffler 6f8cb47796 MFC: sta mode setup for 11n devices
Approved by:	re (kensmith)
2007-11-28 06:15:03 +00:00
Sam Leffler 2c6468d80b MFC 1.91: correct re-association indicator dispatched in node join event
Approved by:	re (kensmith)
2007-11-28 06:13:23 +00:00
Sam Leffler 4f67ec757e MFC: WMM packet classification fixes
Approved by:	re (kensmith)
2007-11-28 06:12:30 +00:00
Sam Leffler 2aa15316b8 MFC 1.45: update default wme parameters to latest WiFi test plans
Approved by:	re (kensmith)
2007-11-28 06:11:18 +00:00
Sam Leffler 7a6037bead MFC: add the Planex GW-US54GXS adapter
Approved by:	re (kensmith)
2007-11-28 06:10:16 +00:00
Ariff Abdullah 213e43bd97 * Fix support for followings:
o Acer Aspire 4520 laptop
    - jack sensing / automute
  o Toshiba Satellite A135-S4527 laptop
    - jack sensing / automute
      Tested by: lioux
  o Apple Macbook 3 (is it?)
    - require gpio0 (for speakers) and ovref50 (for headphone)
      to make it works
    - jack sensing / automute
      Tested by: Ed Schouten
* Add Nvidia MCP67 controller ids.
* Be sensible about simmilar controller with multiple pci ids.
* Connect unused DAC/ADC to stream#0 rather than forcing each of them
  managing their own stream.

Approved by:	re (kensmith)
2007-11-27 23:37:48 +00:00
Simon L. B. Nielsen 8402c765da MFC 1.928:
Remove kernel and module symbol files from disc1 (and the livecd if it
  is enabled).  This saves around 80MB (for i386) on the ISO images.

  Note that this is only from the install media, not the installed
  system where the symbols are still installed, if part of the release.

  Should anybody want the symbols which match disc1/livecd, they can
  just be extracted from the kernel distribution files.

Approved by:	re (kensmith)
2007-11-27 21:04:06 +00:00
John Baldwin 18ddf4af54 MFC: Bump up the number of ttys supported by pty(4) to 512.
Approved by:	re (kensmith)
2007-11-27 18:43:09 +00:00
Dmitry Morozovsky c3e4db1a27 MFC revision 1.31:
devinfo(8) manual page refers to pciconfr(8).  Add back reference for
	completeness.

Approved by:	re (kensmith)
2007-11-27 17:00:35 +00:00
Attilio Rao c33b25ca8f MFC sx.9 rev. 1.12 and rwlock.9 rev. 1.43:
- Introduce rw_init_flags() and relative flags for it
- Introduce sx_slock_sig() and sx_xlock_sig()

Approved by: re
2007-11-27 14:08:14 +00:00
Attilio Rao 060b3829c9 Partially MFC subr_witness.c rev. 1.238:
- add missing spinlock scrlock in the static table

Approved by: re
2007-11-27 13:18:54 +00:00
Robert Watson c982f7ad54 Merge aac_debug.c:1.23 from HEAD to RELENG_7:
Respell 'Conatainer' as 'Container'.

  Reported by:    Toomas Aas <toomas dot aas at raad dot tartu dot ee>

Approved by:	re (kensmith)
2007-11-27 12:23:29 +00:00
Robert Watson 041bb79bd6 Merge tcp_subr.c:1.302 from HEAD to RELENG_7:
More carefully handle various cases in sysctl_drop(), such as unlocking
  the inpcb when there's an inpcb without associated timewait state, and
  not unlocking when the inpcb has been freed.  This avoids a kernel panic
  when tcpdrop(8) is run on a socket in the TIMEWAIT state.

  Reported by:    Rako <rako29 at gmail dot com>

Approved by:	re (kensmith)
2007-11-27 12:22:17 +00:00
Robert Watson e74431486a Merge nfs_vnops.c:1.277 from HEAD to RELENG_7:
Remove hacks from the NFSv2/3 client intended to handle a lack of a
  server-side RPC retranmission cache for non-idempotent operations: these
  hacks substituted 0 (success) for the expected EEXIST in the event that
  a target name already existed for LINK, SYMLINK, and MKDIR operations,
  under the assumption that EEXIST represented a second application of the
  original RPC rather than a true failure.

  Background: certain NFS operations (in this case, LINK, SYMLINK, and
  MKDIR) are not idempotent, as they leave behind persisting state on the
  server that prevents them from being replayed without an error;if an UDP
  RPC reply is lost leading to a retransmission by theclient, the second
  reply will return EEXIST rather than success, asthe new object has
  already been created.  The NFS client previouslysilently mapped the
  EEXIST return into success to paper over thisproblem.

  However, in all modern NFS server implementations, a reply cache is kept
  in order to retransmit the original reply to a retransmitted request,
  rather than performing the operation a second time, allowing this hack
  to be avoided.  This allows link()-based filelocking over NFS to operate
  correctly, as an application requestingthe creation of a new link for a
  file to tell if it succeededatomically or not.

  Other NFS clients, including Solaris and Linux, generally follow this
  behavior for the same reasons.  Most clients also now default to TCP,
  which also helps avoid the issue of retransmitted but non-idempotent
  requests in most cases.

  Reported by:    Adam McDougall <mcdouga9 at egr dot msu dot edu>,
                  Timo Sirainen <tss at iki dot fi>
  Reviewed by:    mohans

Approved by:	re (kensmith)
2007-11-27 12:20:58 +00:00
Bruce A. Mah 62d0ca8c7e Modified release notes: Fix an error with freebsd-update(8) upgrade
note [1].

MFCs noted:  ipfwpcap(8), IPFilter 4.1.28.

Approved by:	re (implicitly)
Noticed by:	cperciva [1]
2007-11-26 23:27:37 +00:00
Marius Strobl e3b54a6dac MFC: UPDATING 1.512, sys/sparc64/conf/DEFAULTS 1.11
Let sunkbd(4) emulate an AT keyboard by default.
This has the following benefits:
- allows to use the AT keyboard maps in share/syscons/keymaps with
  sunkbd(4),
- allows to use kbdmux(4) with sunkbd(4),
- allows Sun RS232 keyboards to be configured and used the same
  way as Sun USB keyboards driven by ukbd(4) (which also does AT
  keyboard emulation) with X.Org, putting an end to the problem
  of native support for the former in X.Org being broken over and
  over again.

Approved by:	re (kensmith)
2007-11-26 20:07:20 +00:00
Jack F Vogel 233ca7d4ea MFC of device support for Intel S7000FC4UR
Approved by: re
2007-11-26 18:21:42 +00:00
Jung-uk Kim 063d5e83c3 MFC: 1.356
Make VPD register access more robust:

- Implement timing out of VPD register access.
- Fix an off-by-one error of freeing malloc'd space when checksum is invalid.
- Fix style(9) bugs, i.e., sizeof cannot be followed by space.
- Retire now obsolete 'hw.pci.enable_vpd' tunable.

Approved by:	re (kensmith)
2007-11-26 17:37:24 +00:00
Jung-uk Kim 2e3197fd89 MFC: 1.199
Do not report MAC, TX, and RX stats via sysctl(8) with BCM5705+.
The register layout is little different from memory-mapped stats
in the previous generation chips.  In fact, it is bad because
registers in this range are cleared after reading them.

Approved by:	re (kensmith)
2007-11-26 17:33:28 +00:00
Scott Long 0f7c1edf1f MFC: expand critical section coverage so that shared fast and ithread handlers
don't stall.

Approved by: re
2007-11-26 16:14:45 +00:00
Scott Long c4e3df83bd MFC: expand critical section coverage so that shared fast and ithread handlers
don't stall.

Approved by: re
2007-11-26 15:06:50 +00:00
Xin LI 6181c1cdb9 MFC MFp4: Several fixes to tmpfs which makes it to survive from pho@'s
strees2 suite, to quote his letter, this change:

1. It removes the tn_lookup_dirent stuff. I think this cannot be fixed,
   because nothing protects vnode/tmpfs node between lookup is done, and
   actual operation is performed, in the case the vnode lock is dropped.
   At least, this is the case with the from vnode for rename.

   For now, we do the linear lookup in the parent node. This has its own
   drawbacks. Not mentioning speed (that could be fixed by using hash), the
   real problem is the situation where several hardlinks exist in the dvp.
   But, I think this is fixable.

2. The patch restores the VV_ROOT flag on the root vnode after it became
   reclaimed and allocated again. This fixes MPASS assertion at the start
   of the tmpfs_lookup() reported by many.

Submitted by:   kib
Approved by:	re (kensmith)
2007-11-26 06:46:44 +00:00
Xin LI 21d6465ccb MFC revision 1.13
date: 2007/11/18 04:40:42;  author: delphij;  state: Exp;  lines: +12 -19
MFp4: Fix several style(9) bugs.

Submitted by:   des
Approved by:	re (kensmith)
2007-11-26 06:45:31 +00:00
David Xu 30ca9d8727 MFC revision 1.27:
In _pthread_key_create() ensure that libkse is initialized.

Approved by: re (kensmith)
2007-11-26 02:44:05 +00:00
Max Laier 846cf29528 MFC tcpdump.c 1.13:
Avoid excessive error message printout.

PR:		bin/118150
Approved by:	re (kensmith)
2007-11-25 19:28:38 +00:00
Max Laier 780c3a1b31 MFC pf.c 1.51, pf_ioctl.c 1.30 and pf_if.c 1.13-1.14:
Reloop OpenBSD rev. 1.563:
    In pf_test_fragment(), ignore protocol-specific criteria for packets of
    different protocols.

  Cleanup pf interface mangement - esp. remove EVENTHANDLER before
  unloading the coresponding code.  This was lost during 4.1 import.

  Bring back pf_if.c revs 1.8 and 1.6 also lost during last import:
   - Use correct time for tzero when compiled in
   - Don't use bogus interface addresses on ptp-interfaces with :0

Approved by:	re (kensmith)
2007-11-25 19:26:46 +00:00
Robert Watson 2c5aec2594 Merge nfs.h:1.83, nfs_srvsubs.c:1.150 from HEAD to RELENG_7:
Garbage collect now-unused nfsrv_setcred() -- it's not only unused, but
  also a purveyor of unfortunate (and now unsupported) direct frobbing of
  struct ucred.

Approved by:	re (kensmith)
2007-11-25 19:15:53 +00:00
Bruce A. Mah 50e7e1c19d New release note: freebsd-update(8).
Approved by:	re (implicitly)
2007-11-25 18:09:14 +00:00
Robert Watson 6646ffa721 Merge files:1.1252 from HEAD to RELENG_7:
Alphabetize pts before pty.

Approved by:	re (kensmith)
2007-11-25 13:02:56 +00:00
Jean-Sébastien Pédron 8e114f600a MFC 1.193:
The kernel uses two ways to write data on a pipe:
      o  buffered write, for chunks smaller than PIPE_MINDIRECT bytes
      o  direct write, for everything else

  A call to writev(2) may receive struct iov of various size and the
  kernel may have to switch from one solution to the other. Before doing
  this, it must wake reader processes and any select/poll/kqueue up.

  This commit fixes a bug where select/poll/kqueue are not triggered
  when switching from buffered write to direct write. It adds calls to
  pipeselwakeup().

  I give more details on freebsd-arch@:
  http://lists.freebsd.org/pipermail/freebsd-arch/2007-September/006790.html

  This should fix issues with Erlang (lang/erlang) and kqueue.

Reported by:	Rickard Green (Erlang)
Approved by:	re (kensmith)
2007-11-25 11:11:28 +00:00
Robert Watson 4a219720a8 Merge kern_proc.c:1.255 from HEAD to RELENG_7:
Test that p_textvp is non-NULL be dereferencing, as no executable vnode is
  set for kernel processes.

  Reported by:    Skip Ford <skip at menantico dot com>

Approved by:	re (kensmith)
2007-11-24 18:27:29 +00:00
Sam Leffler de9d96422c MFC 1.23: use the private task q thread instead of the shared system thread
Approved by:	re (kensmith)
2007-11-23 05:48:35 +00:00
Xin LI f3416a39c4 MFC revision 1.119
date: 2007/11/20 22:12:52;  author: delphij;  state: Exp;  lines: +14 -0
Mark old shared library versions as obsolete.

Approved by:	re (kensmith)
2007-11-22 21:25:17 +00:00
Gregory Neil Shapiro d621fa0dd5 Forced commit to .mc files to force creation of new .cf files for mergemaster.
Approved by:	re (kensmith)
2007-11-22 16:19:40 +00:00
Xin LI e8e718520a MFC revision 1.342
date: 2007/10/18 08:41:52;  author: delphij;  state: Exp;  lines: +2 -2
Do not bail out for cleanworld target just because
chflags is failed.

Approved by:	re (kensmith)
2007-11-22 01:33:08 +00:00
Søren Schmidt 95b7a65768 Update with the latest fixes from -current.
Approved by: re@
2007-11-21 21:15:00 +00:00
Maksim Yevmenkin 23cab32a73 Fix bug in handling SDP continuation state.
Approved by:	re (kensmith)
Reported by:	Eric Millbrandt emillbrandt at coldhaus dot com
2007-11-21 17:36:14 +00:00
Maksim Yevmenkin c1a09e422a Allow search for any UUID entered by user.
Approved by:	re (kensmith)
2007-11-21 17:30:50 +00:00
John Baldwin 2e02c7ce5b MFC: Teach kgdb how to handle double fault frames on i386.
Approved by:	re (kensmith)
2007-11-21 16:47:15 +00:00
John Baldwin 8f5d91b32a MFC: Add support for debugging double fault frames.
Approved by:	re (kensmith)
2007-11-21 16:41:51 +00:00
John Baldwin 6bde64f285 MFC: Handle pts(4) ttys.
Approved by:	re (kensmith)
2007-11-21 16:25:00 +00:00
John Baldwin b6292775b7 MFC: Add a trailing \0 to the read error string.
Approved by:	re (kensmith)
2007-11-21 16:22:34 +00:00
Colin Percival 3c6448617c MFC revisions 1.11,1.12: Unbreak "freebsd-update rollback" applied to
minor version upgrades, by being more careful about the order in which
files are rolled back to their old versions.

Approved by:	re (kensmith)
2007-11-21 14:37:03 +00:00
Gleb Smirnoff 4912167faa MFC:
- Merge all the ng_send_fn2* functions into one - ng_send_fn2(),
    removing some copy&pasted code.
  - Reduce copy and paste in ng_apply_item().
  - Resurrect ng_send_fn() as a valid symbol, not a define.

  Reviewed by:	mav, julian

Approved by:	re (kensmith)
2007-11-21 12:14:00 +00:00
Luigi Rizzo 9b8ce42cf8 MFC 2007-11-14 05:42:54 UTC
Fix picobsd builds. Changes include:
- use proper make configuration for the build, using
  ${BINMAKE} as evaluated by ${VERSION}/src/Makefile
- remove -lmytinfo from crunch.conf
- remove support for login_access in tinyware/login
- remove "machine i386" from the kernel config file

It might actually be interesting to extend the script to do
a cross build for !i386 ...

Approved by: re
2007-11-21 07:20:11 +00:00
Tai-hwa Liang 525c4e72ff MFC(if_an.c:1.85, if_anreg.h:1.24): Trying to eliminate a racing as well as
reducing the chance of device removal(PCCARD) panic by replacing the
timeout(9) with callout(9) APIs.

Tested by:	dhw
Approved by:	re (kensmith)
MFC after:	3 days
2007-11-21 06:37:40 +00:00
Sam Leffler 635a8e7328 MFC: install example files for folks that don't have source
Approved by:	re (kensmith)
2007-11-21 06:07:12 +00:00
Sam Leffler de1e3eafd1 MFC 1.331-2: add wpa_supplicant + hostapd directories to examples
Approved by:	re (kensmith)
2007-11-21 06:04:54 +00:00
Sam Leffler 607fabe1c0 MFC 1.13: ix building w/ WITHOUT_WPA_SUPPLICANT_EAPOL
Approved by:	re (kensmith)
2007-11-21 06:02:50 +00:00
Sam Leffler b754501b83 MFC 1.17: correct MIMO power save action frame format
Approved by:	re (kensmith)
2007-11-21 06:01:01 +00:00
Attilio Rao e3c713a414 MFC: revision 1.102
Approved by: re
2007-11-21 02:21:55 +00:00
Xin LI 5ef14f40ee MFC revision 1.12
date: 2007/11/12 18:57:33;  author: delphij;  state: Exp;  lines: +1 -1
Correct a stack overflow which will trigger panics when
mode= is specified, caused by incorrect format string
specified to vfs_scanopt() and subsequently vsscanf().

Pointed out by:	kib
Submitted by:	des
Approved by:	re (kensmith)
2007-11-21 01:47:08 +00:00
Ken Smith 26beef6d6e MFC of library version bump. From original commit:
> While checking over the libraries for 7.0-REL Kris found the following
> libraries had not had their versions bumped relative to 6.3-REL but
> had indeed been changed.  We need to bump their version so they can be
> properly added to the compat6x port:
>
>         libasn1.so.8 libgssapi.so.8 libhdb.so.8 libkadm5clnt.so.8
>         libkadm5srv.so.8 libkafs5.so.8 libkrb5.so.8 libobjc.so.2

Versions being MFCed:

	gnu/lib/libobjc/Makefile:	1.33
	kerberos5/lib/Makefile.inc:	1.8
	lib/libgssapi/Makefile:		1.3

Approved by:	re (bmah)
2007-11-20 20:48:01 +00:00
Mike Silbersack 06af448448 MFC rev 1.134: Comment out the syncache's test which ensures that hosts which
negotiate TCP timestamps in the initial SYN packet actually use them in the
rest of the connection.

Approved by:	re (kensmith)
2007-11-20 15:26:18 +00:00
Bjoern A. Zeeb a1626fa4a1 MFC: rev. 1.20 sys/netipsec/keysock.c
Move the priv check before the malloc call for so_pcb.
    In case attach fails because of the priv check we leaked the
    memory and left so_pcb as fodder for invariants.

Approved by: re (kensmith)
2007-11-20 09:35:15 +00:00
Ruslan Ermilov 2991ce874a MFC: Revise markup, apply some wordsmithing, document "label -c".
Approved by:	re (bmah)
2007-11-20 07:32:54 +00:00
Ken Smith 4118d0240d Insta-MFC of v1.927 so it can be part of 7.0-BETA3 build. Shift i386
(and pc98, it's over disc1 size target as well) over to having a separate
livefs iso image.

Approved by:	re (rwatson)
2007-11-16 13:33:38 +00:00
Ruslan Ermilov 924c8c36d5 MFC: 1.70: Fix bad rule and bad dependency for nsparser.h that can
cause the build to fail by "replacing" it with bsd.dep.mk rules.

Approved by:	re (kensmith)
2007-11-16 07:18:12 +00:00
John Baldwin 15f9b1f123 MFC: Make it easier to add more ptys to the pty(4) driver.
Approved by:	re (kensmith)
2007-11-15 20:20:54 +00:00
Remko Lodder e88eb1baa5 MFC rev 1.96 if_re.c
Add support for D-Link DGE-528(T) Rev.B1

  PR:		112774
  Submitted by:	Denis Fortin <fortin at acm dot org>
  Approved by:	imp (mentor), yongari
  MFC After:	3 days

Approved by:	imp (mentor, implicit)
Approved by:	re (kensmith)
2007-11-15 17:45:46 +00:00
Ken Smith b51aa592da Get ready for BETA3 builds.
Approved by:	re (implicit)
2007-11-15 17:10:18 +00:00
Ariff Abdullah 52e3426d88 MFC (revision 1.54):
Limit total playback channels to just 1, for ALi M5451.
The reliability of it's multi DAC / playback channels is
not that good. Enabling vchans make the bug more visible
since playback allocation will look for possible free
hardware channels first (i.e: the next DAC, the very first
has been consumed by vchan mixer) which in this case has
been proven faulty.

Reported / Tested by:   Sascha Klauder
Approved by:		re (kensmith)
2007-11-15 16:59:29 +00:00
Scott Long 717fbc2f39 MFC rev 1.37: Add ATA defintions
Approved by: re
2007-11-15 16:29:33 +00:00
Scott Long 5e971fe593 MFC rev 1.29: Add structures and definitions to support new drivers.
Approved by: re
2007-11-15 16:27:59 +00:00
John Baldwin 577dfe22ef MFC: Teach ps(1) to parse pts TT values for the -t flag.
Approved by:	re (kensmith)
2007-11-15 15:56:59 +00:00
Ken Smith 04fe237f14 MFC another adjustment to the X related distributions based on xorg-7.3
layout.  xorg-printserver still exists in the ports tree but it's marked
as depreciated and scheduled for removal.

Versions MFCed:
	dist.c:		1.252
	dist.h:		1.70
	menus.c:	1.428

Approved by:	re (bmah)
2007-11-15 15:46:35 +00:00
Stefan Eßer 55930f85a7 MFC: Increase string buffer to account for addition of "jail" to flags.
Approved by:	re (ken)
2007-11-15 15:18:44 +00:00
Stefan Eßer 8df1768750 Add ZFS to list of file system types to scan when building the locate db.
Approved by:	re (ken)
2007-11-15 15:14:16 +00:00
Randall Stewart fbc42229aa - Fixes a bug in rwnd handling that would cause an incorrect rwnd
advertisement during low mem conditions.
- Fixes a compile error on mac-os (signedness stuff).
- Touches up some comments.

Approved by:	[email protected] (Ken Smith)
2007-11-15 15:03:17 +00:00
Konstantin Belousov e7e238d972 MFC rev. 1.139 of src/sys/compat/linux/linux_ioctl.c,
rev. 1.27 of src/sys/compat/linux/linux_ioctl.h:

Implement  LINUX_SIOCGIFCOUNT and LINUX_SIOCGIFINDEX/LINUX_SIOGIFINDEX.

Approved by:	re (kensmith)
2007-11-15 10:38:06 +00:00
Attilio Rao 00ecfdccbc MFC: revision 1.30
Approved by: re
2007-11-14 23:33:41 +00:00
Remko Lodder 0547dec6eb MFC rev 1.7 nfsmb.c
Add SMB support for the MCP61 chipset.

  PR: 108830
  Submitted by: Edwin Mons <freebsd at edwinm dot ik dot nu>
  Approbed by: imp (mentor)

Approved by:    imp (mentor, implicit)
Approved by:	re (kensmith)
2007-11-14 19:40:56 +00:00
Ruslan Ermilov db153611b7 MFC: Fix various markup nits.
Approved by:	re (kensmith)
2007-11-14 19:25:05 +00:00
Ruslan Ermilov 1f82297218 MFC: Apply style(9) to usage(), fix markup of the manpage.
Approved by:	re (kensmith)
2007-11-14 19:24:10 +00:00
Ruslan Ermilov 56a950fbee MFC: 1.35: Fix documentation to match code.
Approved by:	re (kensmith)
2007-11-14 19:22:42 +00:00
Ruslan Ermilov e5f3625c96 MFC: 1.32: Fix numerous bugs when parsing options and arguments.
Approved by:	re (kensmith)
2007-11-14 19:18:40 +00:00
Peter Grehan e47d2d582f MFC:
Split decr_init() into two, with the section that reads the timebase
  frequency from OpenFirmware moved out and into a routine that is called
  from cpu_startup().

  This allows correct reporting of the CPU clockspeed when printing out
  CPU information at boot time.

Approved by: re (Ken Smith)
2007-11-14 16:41:31 +00:00
Bjoern A. Zeeb 8014a2c467 MFC: rev 1.19 sys/netipsec/keysock.c
Add a missing priv check in key_attach to prevent non-su users
  from messing with the spdb and sadb.

  Problem sneaked in with the fast_ipsec+v6->ipsec merger by no
  longer going via raw_usrreqs.pr_attach.

Approved by:	re (kensmith)
2007-11-14 11:52:44 +00:00
Kris Kennaway 3db6ca3802 MFC: Add support for non-portable adaptive mutexes, as well as experimental
support for spinning/yielding loops.

Approved by: re@ (kensmith)
2007-11-14 09:54:48 +00:00
Colin Percival 0b6b1fee2c MFC addition of "freebsd-update upgrade".
Approved by:	re (kensmith)
2007-11-14 05:10:45 +00:00
Kris Kennaway a666c430f7 MFC: Add support for non-portable adaptive mutexes, as well as experimental
support for spinning/yielding loops.

Approved by: re@ (kensmith)
2007-11-14 01:10:12 +00:00
Sam Leffler 52e5bf08fd MFC 1.6: correct handling of off-channel frames
Approved by:	re (kensmith)
2007-11-12 17:05:37 +00:00
Alexander Kabaev 88afc19c45 MFC revisions
1.75: Make ukbd_getc respect non-blocking behavior if one is requested;
  1.76: Do not pass an address of local stack variable to
        usbd_set_report_async.

Approved by:	re (kensmith)
2007-11-12 16:09:45 +00:00
Christian S.J. Peron 7b500bb35a MFC revision 1.5
Un-break logins to jailed environments when PTS is in use.

Approved by:	re@ (kensmith)
2007-11-11 22:52:31 +00:00
Sam Leffler 2a06ae2e2a MFC 1.6: correct termination check doing amsdu de-aggregation
Approved by:	re (kensmith)
2007-11-11 17:52:32 +00:00
Sam Leffler 2aa41ecdf6 sync with 11n changes
Approved by:	re (kensmith)
2007-11-11 17:49:50 +00:00
Sam Leffler c5e91c80cb MFC 1.2: align stats printed out w/o any args
Approved by:	re (kensmith)
2007-11-11 17:48:48 +00:00
Sam Leffler 65af6751d3 MFC 1.2: add -o ampdu; remove noise from default stat list
Approved by:	re (kensmith)
2007-11-11 17:48:17 +00:00
Sam Leffler dc08335838 MFC 1.48: sync with vap code base; updates for 11n support and some
general code cleanups

Approved by:	re (kensmith)
2007-11-11 17:47:06 +00:00
Sam Leffler a0b4b29c22 MFC 1.143: minor wireless-related corrections
Approved by:	re (kensmith)
2007-11-11 17:45:56 +00:00
Sam Leffler bedbd38c88 MFC: sync 11n support with vap code base
Approved by:	re (kensmith)
2007-11-11 17:44:36 +00:00
Sam Leffler bf8b1eeec1 MFC 1.25: correct channel flags returned by IEEE80211_IOC_STA_INFO
Approved by:	re (kensmith)
2007-11-11 17:34:38 +00:00
Sam Leffler c17e24ea93 MFC 1.43: don't try to re-associate after a parameter change
Approved by:	re (kensmith)
2007-11-11 17:32:30 +00:00
Gregory Neil Shapiro 574b6bd440 MFC: sendmail 8.14.2
Approved by:	re (kensmith)
2007-11-11 17:07:37 +00:00
Max Laier 78815f1ceb MFC:
Update pf examples from OpenBSD to catch up with new stateful defaults and
  other syntax changes.  Move pf.conf from /etc to examples, too.

Approved by:	re (kensmith)
2007-11-11 02:16:00 +00:00
cvs2svn 7ceb827e8e This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2007-11-11 01:16:52 +00:00
Sam Leffler 9c0558c986 MFC 1.2: upgrade zd1211b firmware; fixes reset problem
Approved by:	re (gnn)
2007-11-11 00:24:43 +00:00
Sam Leffler 4df4f81cd9 MFC 1.7: fix a typo in rx radiotap's flags
Approved by:	re (gnn)
2007-11-11 00:23:39 +00:00
Daniel Gerzo 3331e09fa8 s/maybe/may be/
Approved by: re (bmah@)
2007-11-10 11:32:37 +00:00
Remko Lodder a287efe2ad MFC rev 1.29 phys_pager.c
Correct a copy and paste'o in phys_pager.c, we are talking about phys here
  and not about devices.

  PR:		93755
  Approved by:	imp (mentor, implicit when re-assigning the ticket to me).

Approved by:	re (kensmith), imp (mentor)
2007-11-10 11:21:17 +00:00
Marius Strobl 7b6884e083 MFC: 1.7
In _pthread_key_create() ensure that libthr is initialized. This
fixes a NULL-dereference of curthread when libstdc+ initializes
the exception handling globals on archs we can't use GNU TLS due
to lack of support in binutils 2.15 (i.e. arm and sparc64), yet,
thus making threaded C++ programs compiled with GCC 4.2.1 work
again on these archs.

Approved by:	re (kensmith)
2007-11-09 21:15:58 +00:00
Ruslan Ermilov c6af3fff67 MFC: Teach source installation shell script and sysinstall(8) about
the 'scompat' source dist that holds src/compat/.

Approved by:	re (kensmith)
2007-11-09 16:16:59 +00:00
John Baldwin dcf5bc078f MFC: Don't look for GPT primary and secondary tables on a disk unless we
have a valid PMBR.

Approved by:	re (kensmith)
2007-11-09 02:29:43 +00:00
Ken Smith 53862ffce2 MFC changes to X11 distributions based on xorg-7.3 layout.
Versions:
        dist.c v1.250
        dist.h v1.68
        menus.c v1.426

Approved by:	re (bmah)
2007-11-08 23:20:21 +00:00
John Baldwin e7635ae3f4 MFC: Update copyright attribution.
Approved by:	re (kensmith)
2007-11-08 21:33:40 +00:00
John Baldwin 1f2518e4d4 MFC: Use the smaller cgbase() macro in ufsread.c if UFS_SMALL_CGBASE is
defined.  This also effectively enables the use of the smaller cgbase()
in the arm/at91/boot2 loader.

Approved by:	re (kensmith)
2007-11-08 21:31:38 +00:00
Nate Lawson 46a00dd234 MFC: poll EC during resume
Approved by:	re
2007-11-08 21:21:27 +00:00
Ed Maste c6c439d7b7 MFC to RELENG_7
Revision  Changes    Path
1.123     +5 -2      src/sys/dev/aac/aac.c
1.29      +17 -17    src/sys/dev/aac/aac_cam.c

  Rework aac locking for MPSAFE CAM.  This fixes a Giant mutex assertion
  reported on freebsd-current [1].

  Also dequeue all events in aac_release_command (instead of just one)
  so that there's no risk of them getting stranded.

  Reported by:    Steven Brown [1]
  Submitted by:   scottl@

  [1] http://lists.freebsd.org/pipermail/freebsd-current/2007-October/077928.html

Approved by:	re
2007-11-08 21:12:36 +00:00
John Baldwin 2388225b27 MFC: Split agp_generic_detach() up into two routines: agp_free_cdev() and
agp_free_res().

Approved by:	re (kensmith)
2007-11-08 20:29:53 +00:00
John Baldwin f0f863f474 MFC: Honor db_pager_quit in the examine command.
Approved by:	re (kensmith)
2007-11-08 20:25:47 +00:00
John Baldwin 7fe1156c2d MFC: Don't always re-route IRQs on resume.
Approved by:	re (kensmith)
2007-11-08 20:21:40 +00:00
John Baldwin 95904116ba MFC: Rework the read/write support in the bios disk driver some to cut down
on duplicated code and support 64-bit LBAs for GPT.  This also changes the
code to always use EDD on devices that support it which matches the rest of
the x86 bootstrap.

Approved by:	re (kensmith)
2007-11-08 20:19:58 +00:00
John Baldwin 089de0b5e6 MFC: Don't test the APIC flag in the cpuid features for amd64 to see if a
local APIC is present or not.

Approved by:	re (kensmith)
2007-11-08 20:09:15 +00:00
Colin Percival 3b33cede20 Change the default for hyperthreading (or, generally speaking, cases
where the L1 cache is shared between CPUs) to disabled for security
reasons.  As in earlier releases, this can be changed by setting
machdep.hyperthreading_allowed=1 in /boot/loader.conf.

This is not an MFC -- no seatbelts in CURRENT.

Approved by:	re (kensmith)
Security:	See FreeBSD-SA-05:09.htt for background material.
2007-11-08 19:45:19 +00:00
Alan Cox 10e83f309e MFC
Add comments explaining why all stores updating a non-kernel page table
  must be globally performed before calling any of the TLB invalidation
  functions.

  With one exception, on amd64, this requirement was already met.  Fix this
  one case.  Also, as a clarification, change an existing atomic op into a
  release.

Approved by:	re (kensmith)
2007-11-08 17:17:23 +00:00
Konstantin Belousov cd6571c9e8 MFC rev. 1.359:
Do not cache the page belonging to the swap object that has no backing
store allocated in the pager.

Approved by:	re (kensmith)
2007-11-08 14:03:00 +00:00
Sam Leffler a1d03a63e2 MFC 1.19: bandaid crash
Approved by:	re (kensmith)
2007-11-08 07:14:37 +00:00
Andrew Thompson 8ceb270ef5 MFC network.subr r1.181, driver_freebsd.c r1.15
Change wpa_supplicant to down the interface at the start of the init routine.
  wpa_supplicant expects that it has exclusive access to the net80211 state so
  when its starts poking in the WEP/WPA settings and the card is already
  scanning it can cause net80211 to try and associate incorrectly with a
  protected AP.

  This is an inconvenience for firmware based cards such as iwi where it can be
  sent an auth instruction with incomplete security info and cause a firmware
  error.

  Remove the 'ifconfig up' from network.subr since wpa_supplicant will
  immediately down the interface again.

Approved by:	re (gnn)
2007-11-08 05:52:24 +00:00
Alan Cox 09b5d6225d MFC
Eliminate spurious "Approaching the limit on PV entries, ..."
  warnings by get_pv_entry().

  Eliminate the direct call to pagedaemon_wakeup() by get_pv_entry().

Approved by:	re (gnn)
2007-11-08 04:37:02 +00:00
Bruce A. Mah 415e83c5d1 Updated release notes: IPFilter 4.1.28, OpenBSM 1.0.
Approved by:	re (implicitly)
2007-11-08 04:04:53 +00:00
Andrew Thompson 11bd295874 Pad struct ifbreq to be the same size as in HEAD. This allows ifconfig to be
used to configure a bridge on both and adds room for later MFCs.

The struct is part of the API/ABI and shouldnt be changed again (c/o rwatson)

Approved by:	re (rwatson)
2007-11-07 19:21:41 +00:00
Maksim Yevmenkin 5c20fec1ff MFC
Allow RFCOMM servers to bind to a ''wildcard'' RFCOMM channel
zero (0). Actual RFCOMM channel will be assigned after listen(2)
call is done on a RFCOMM socket bound to a ''wildcard'' RFCOMM
channel zero (0).

Address locking issues in ng_btsocket_rfcomm_bind()

Submitted by:	Heiko Wundram (Beenic) < wundram at beenic dot net >
Approved by:	re (kensmith)
2007-11-07 17:37:18 +00:00
Kris Kennaway ce2f6a4ab8 MFC: Catch up to current state of ports tree
Approved by:  re (kensmith)
2007-11-07 13:57:08 +00:00
Nate Lawson e875c72170 MFC 1.68: remove smp_rendezvous() during shutdown
Approved by:	re
2007-11-06 20:13:33 +00:00
Simon L. B. Nielsen fa2f6df166 MFC 1.17:
If the INDEX file cannot be opened, print the actual filename / path
  pkg_version tried to open instead of just "INDEX" to make the actual
  problem more clear (e.g. missing INDEX-8).

Approved by:	re (kensmith)
2007-11-06 18:15:21 +00:00
Simon L. B. Nielsen 525807074b MFC 1.3:
Document the '-P pidfile' command line argument.

PR:		docs/116658
Approved by:	re (kensmith)
2007-11-06 18:13:25 +00:00
Robert Watson 58ba392560 Merge mac_framework.h:1.85, mac_policy.h:1.95, mac_posix_sem.c:1.10,
mac_biba.c:1.108, mac_mls.c:1.89, mac_stub.c:1.69, mac_test.c:1.79 from
HEAD to RELENG_7:

  Canonicalize naming of local variables for struct ksem and associated
  labels to 'ks' and 'kslabel' to reflect the convention in posix_sem.c.

  Obtained from:	TrustedBSD Project

Approved by:	re (kensmith)
2007-11-06 14:46:59 +00:00
Benjamin Close 481583bfaa MFC:
Regen:

* Hart:         rev 652 of pcidevs.txt (2007-09-24)
* Boemler:      vendors.txt (2007-10-25)

Approved by: 	mlaier (comentor)
Approved by: 	re (kensmith)
2007-11-06 04:02:45 +00:00
Julian Elischer 0510c1d5f5 MFC of removal of single threading code from the main fork path.
This turns out to be un-needed, and in fact can produce deadlocks.

Approved by: re(ken)
2007-11-06 02:59:40 +00:00
Randall Stewart 17d9b280e6 - Change the Time Wait of vtags value to match the cookie-life
- Select a tag gains ability to optionally save new tags
   off in the timewait system.
 - When looking up associations do not give back a stcb that
   is in the about-to-be-freed state, and instead continue
   looking for other candiates.
 - New function to query to see if value is in time-wait.
 - Timewait had a time comparison error that caused very
   few vtags to actually stay in time-wait.
 - When setting tags in time-wait, we now use the time
   requested NOT a fixed constant value.
 - sstat now gets the proper associd when we do the query.
 - When we process an association, we expect the tag chosen
   (if we have one from a cookie) to be in time-wait. Before
   we would NOT allow the assoc up by checking if its good.
   In theory this should have caused almost all assoc not
   to come up except for the time-comparison bug above (this
   bug was hidden by the time comparison bug :-D).
 - Don't save tags for nonce values in the time-wait cache
   since these are used only during cookie collisions and do
   not matter if they are unique or not.

Approved by:	[email protected] (Ken Smith)
2007-11-06 02:48:04 +00:00
Ariff Abdullah 03a23ac910 MFC:
Revisions:
  1.21     src/sys/dev/sound/pci/atiixp.c
  1.4      src/sys/dev/sound/pci/atiixp.h

Add support for trimmed down version of ATI SB600 AC97 audio
controller.

URL:		http://www.ipc2u.de/catalog/P/PE/36486.html
PR:		kern/117813
Submitted by:	Klaus Mayr
Approved by:	re (kensmith)
2007-11-06 02:07:56 +00:00
Maksim Yevmenkin fd2876d496 Fix locking issue in ng_btsocket_l2cap_ctloutput()
Submitted by:	Heiko Wundram (Beenic) < wundram at beenic dot net >
Approved by:	re (kensmith)
2007-11-05 17:51:14 +00:00
Pyun YongHyeon b1a9d00078 MFC miidevs rev 1.47 to RELENG_7
Add a newer RTL8211B(L) PHY.

Approved by:	re (kensmith)
2007-11-05 01:42:02 +00:00
Pyun YongHyeon df34168ccb MFC rgephy.c rev 1.17-1.18, rgephyreg.h rev 1.3 to RELENG_7
rgephy.c rev 1.17, rgephyreg.h rev 1.3
  Add support for RealTek RTL8211B(L) PHY. It's based on the patch
  made by Michael Eisele and the patch was slightly modified by me.
  With this change several NVIDIA ethernet controllers(e.g. MCP61)
  works.

  RTL8211B(L) is RealTek's new gigabit PHY. The PHY has several
  features including crossover correction, polarity correction as
  well as supporting triple speed(10/100/1000bps). Data transfer
  between MAC and PHY is via RGMII for 1000baseT, MII for
  10baseT/100baseTX.
  Unfortunately, RealTek used the same model number for RTL8211B(L)
  PHY so there is no way to discriminate between RTL8211B(L) and its
  predecessors. ATM RTL8211B uses revision number 2 so checking the
  revision number seems to be only way to identify it.

rgephyreg.c rev 1.18
  Setting sc->mii_anegticks to MII_ANEGTICKS_GIGE in rgephy_attach()
  is redundant. mii_phy_add_media() already takes care of that.

Approved by:	re (kensmith)
2007-11-05 01:39:25 +00:00
Pyun YongHyeon 5083ca8496 MFC rgephy.c rev 1.16 to RELENG_7
o RTL8169S/8110S integrated PHY and RTL8211B are gigabit PHYs so set
    mii_anegticks to MII_ANEGTICKS_GIGE and use it. Previously it used
    to MII_ANEGTICKS which may not be enough to wait before retrying
    autonegotiation process at 1000bps.
  o Reset autonegotation timer if media option is not IFM_AUTO or we
    got a valid link.
  o Announce link loss right after it happends.
  o Autonegiation is retried every mii_anegticks seconds.
  o Report link state changes right after setting autonegotiation.

Approved by:	re (kensmith)
2007-11-05 01:31:59 +00:00
Doug Barton 9c47c99dd9 MFC version 1.13, update of IP address for l.root-servers.net
Approved by:	re (kensmith)
2007-11-04 23:58:11 +00:00
Sam Leffler a67be7b61b add zyd
Approved by:	re (kensmith)
2007-11-04 17:59:12 +00:00
Christian S.J. Peron 9731ff5b8b MFC revision 1.13
Make sure we are incrementing read counters

Approved by:	re@ (kensmith)
2007-11-04 16:44:48 +00:00
Robert Watson 5cfd7b3725 Merge OpenBSM 1.0 changes to src/sys/bsm from HEAD to RELENG_7:
- Remove AU_.* hard-coded audit class constants, as udit classes are now
    entirely dynamically configured using /etc/security/audit_class.

  Obtained from:  TrustedBSD Project

Approved by:	re (kensmith)
2007-11-04 12:50:40 +00:00
Robert Watson 639e377241 Merge OpenBSM 1.0 from HEAD to RELENG_7:
- Fix bug in auditreduce(8) which resulted in a memory fault/crash when
    the user specified an event name with -m.
  - Remove AU_.* hard-coded audit class constants, as audit classes are now
    entirely dynamically configured using /etc/security/audit_class.

  Obtained from:	TrustedBSD Project

Approved by:	re (kensmith)
2007-11-04 12:50:01 +00:00
Christian Brueffer eb6c456843 MFC: rev. 1.5
Clean up after the previous commit.

Approved by:	re (blanket)
2007-11-03 20:51:50 +00:00
John Baldwin 00c1eba07e MFC: Don't attach to the "IBM0057" ID.
Approved by:	re (kensmith)
2007-11-02 18:54:09 +00:00
Robert Watson 89ee7c98a7 Merge audit.c:1.35, audit_bsm_klib.c:1.8 from HEAD to RELENG_7:
Replace use of AU_NULL with 0 when no audit classes are in use; this
  supports the removal of hard-coded audit class constants in OpenBSM
  1.0.  All audit classes are now dynamically configured via the
  audit_class database.

  Obtained from:  TrustedBSD Project

Approved by:	re (kensmith)
2007-11-02 09:53:32 +00:00
Tim Kientzle d3679dba0a MFC 1.18: When skipping input data, request a minimum of 1 instead
of the full request size.  This avoids a 32-bit overflow
problem skipping an exact multiple of 4GB and is faster
anyway because it allows the underlying I/O framework
to minimize copying.

In particular, this fixes bsdtar failing to properly skip
entries in uncompressed tar archives that are an exact
multiple of 4GB.

Approved by: re (Ken Smith)
2007-11-02 08:42:14 +00:00
Ken Smith 6d2bc17dc0 Get ready for the BETA2 builds.
Approved by:	re (implicit)
2007-11-02 00:59:38 +00:00
Robert Watson de78d995f2 Merge Neterion if_nxge driver version 2.0.9.11230 from HEAD to RELENG_7:
01 -  Enhanced LRO:
    LRO feature is extended to support multi-buffer mode. Previously,
    Ethernet frames received in contiguous buffers were offloaded.
    Now, frames received in multiple non-contiguous buffers can be
    offloaded, as well. The driver now supports LRO for jumbo frames.

    02 - Locks Optimization:
    The driver code was re-organized to limit the use of locks.
    Moreover, lock contention was reduced by replacing wait locks
    with try locks.

    03 - Code Optimization:
    The driver code was re-factored  to eliminate some memcpy
    operations.  Fast path loops were optimized.

    04 - Tag Creations:
    Physical Buffer Tags are now optimized based upon frame size.
    For better performance, Physical Memory Maps are now re-used.

    05 - Configuration:
    Features such as TSO, LRO, and Interrupt Mode can be configured
    either at load or at run time. Rx buffer mode (mode 1 or mode 2)
    can be configured at load time through kenv.

    06 - Driver Statistics:
    Run time statistics are enhanced to provide better visibility
    into the driver performance.

    07 - Bug Fixes:
    The driver contains fixes for the problems discovered and
    reported since last submission.

    08 - MSI support:
    Added Message Signaled Interrupt feature which currently uses 1
    message.
    message.

    09  Removed feature:
    Rx 3 buffer mode feature has been removed. Driver now supports 1,
    2 and 5 buffer modes of which 2 and 5 buffer modes can be used
    for header separation.

    10  Compiler warning:
    Fixed compiler warning when compiled for 32 bit system.

    11 Copyright notice:
    Source files are updated with the proper copyright notice.

  Submitted by:   Alicia Pena <Alicia dot Pena at neterion dot com>,
                  Muhammad Shafiq <Muhammad dot Shafiq at neterion dot com>

Approved by:	re (gnn, kensmith)
2007-11-02 00:52:34 +00:00
Christian S.J. Peron 07a35b6a86 MFC revision 1.350, move where we audit the PID to ensure that it gets
audited even if it's invalid.

Approved by:	re@ (kensmith)
2007-11-01 19:04:13 +00:00
Christian S.J. Peron 267c460267 MFC revision 1.21, use extended process tokens by default
Approved by:	re@ (kensmith)
2007-11-01 19:03:03 +00:00
John Baldwin d4715a067f MFC: Reindent the read/write code of bd_realstrategy().
Approved by:	re (kensmith)
2007-11-01 18:22:53 +00:00
John Baldwin 8dbc59062f MFC: Slightly cleanup the 'bootdev' concept on x86.
Approved by:	re (kensmith)
2007-11-01 18:19:19 +00:00
Craig Rodrigues b897500d32 MFC 1.2
Add a small note about how "mkfs.xfs -p" can be used to create
an XFS file system populated with files.

Approved by:	re (gnn)
2007-11-01 14:20:37 +00:00
Craig Rodrigues c3d9d1849a MFC: 1.267
In nmount(), if MNT_ROOT is in the mount flags, filter it
out instead of returning an error.
(1)  This makes the behavior consistent with mount(2).
(2)  This makes update mounts on the root file system work properly.
(3)  The explicit checks for MNT_ROOTFS in src/sbin/fsck_ffs/main.c
     and src/usr.sbin/mountd/mountd.c which were put in to
     eliminate errors during update mounts on the root file system
     can be removed.

The only place were MNT_ROOTFS can be validly set
is inside the kernel, i.e. with vfs_mountroot_try().

Approved by:	re (gnn)
2007-11-01 14:09:07 +00:00
Ken Smith 09cbd642d1 MFC v1.243 of config.c and v1.48 of dmenu.c - fixes needed because
sysinstall had made bad assumptions about the behavior of getenv(3)
and the new getenv(3) doesn't behave the same as the old one did
if you call it with getenv("amd_enable=YES").

It was noted during review that the use of strdup(3) here is wrong
and should be checked for NULL.  It's worth noting that's what I meant
when I said I conformed to sysinstall's style despite urges to do otherwise
in the original commit.  sysinstall is in desperate need of some major
rototilling (or being thrown out...).

Approved by:	re (rwatson)
2007-11-01 13:07:28 +00:00
Pyun YongHyeon 4eb4dd7dfd MFC e1000phy.c rev 1.19, e1000phyreg.h rev. 1.5 to RELENG_7
Add 88E1116/88E1116R PHY support code that takes the PHY out of
  power-down mode.

Approved by:	re (kensmith)
2007-11-01 04:26:33 +00:00
Alexander Motin 2aaf75ceb0 MFC rev 1.4,1.5
Fix some mistakes.
Update my email.

Approved by:	re (gnn)
2007-10-31 22:52:51 +00:00
Søren Schmidt d1325d6272 MFC:
Add SATA ATAPI support for AHCI controllers.

Approved by: re@
2007-10-31 19:59:53 +00:00
Sam Leffler 97bc3ec1d7 MFC 1.4: silence complaint about not loading the wlan_scan_monitor module
Approved by:	re (gnn)
2007-10-31 16:53:44 +00:00
Maksim Yevmenkin a96f115e93 MFC: etc/rc.d/ppp,v1.14 and etc/defaults/rc.conf,v1.319
Teach /etc/rc.d/ppp to start multiple instances of ppp.

ppp_profile variable can now contain multiple profiles.
Overrides for ppp mode and nat can go into ppp_$profile_mode
and ppp_$profile_nat variables respectively. If those are
not specified, defaults from ppp_mode and ppp_nat are used.

MFC: etc/rc.d/ppp v1.15

Teach /etc/rc.d/ppp how to start/stop individual instances
of ppp. This is an extension of previous commit.

Submitted by:	Yuri Kurenkov < y dot kurenkov at init dot ru >
Reviewed by:	mtm
Approved by:	re (kensmith)
2007-10-31 16:42:41 +00:00
John Baldwin 81bb85457c MFC: Print IRQs in decimal rather than hex.
Approved by:	re (kensmith)
2007-10-31 16:17:24 +00:00
John Baldwin 3580f90556 MFC: Actually support the new HT capability type from HT 2.00b.
Approved by:	re (kensmith)
2007-10-31 16:15:33 +00:00
John Baldwin d6cb10ee90 MFC: Don't destroy an ACPI device_t for a PCI device if the ACPI device_t
is already attached to a driver.

Approved by:	re (kensmith)
2007-10-31 16:10:12 +00:00
Darren Reed 0c232a4b1c MFC the following:
Apply a few changes from ipfilter-current:
* Do not hold any locks over calls to copyin/copyout.
* Clean up some #ifdefs
* fix a possible mbuf leak when NAT fails on policy routed packets

PR:		117216
Approved by:	re
2007-10-31 05:00:38 +00:00
Alan Cox 2345684755 MFC revision 1.389
Correct an error in vm_map_sync(), nee vm_map_clean(), that has existed
  since revision 1.1.  Specifically, neither traversal of the vm map checks
  whether the end of the vm map has been reached.  Consequently, the first
  traversal can wrap around and bogusly return an error.

Approved by:	re (kensmith)
2007-10-31 02:31:51 +00:00
Alan Cox a9eef3af45 MFC revision 1.358
Change vm_page_cache_transfer() such that it does not transfer pages
  that would have an offset beyond the end of the target object.  Such
  pages should remain in the source object.

Approved by:	re (kensmith)
2007-10-31 02:27:28 +00:00
John Baldwin 6e71fbb4aa MFC: Close a race when trying to lookup a gateway route in rt_check().
Approved by:	re (kensmith)
2007-10-30 18:03:50 +00:00
John Baldwin fb4f386b61 MFC: Update copyright attribution.
Approved by:	re (kensmith)
2007-10-30 18:00:56 +00:00
Christian S.J. Peron 363c721c49 MFC revision 1.34
Add support for processing extended (ip6) subject termids

Approved by:	re@ (kensmith)
2007-10-30 13:17:02 +00:00
Michael Bushkov d19137594f Fast MFC: Adding recently removed etc/cached.conf to the list of
obsolete files.

Approved by:	re (kensmith), brooks (mentor)
2007-10-30 11:40:26 +00:00
Remko Lodder 15be235059 MFC pccarddevs v1.130
MFC pccard_cis_quirks.c v1.17

  Bring in some new Sierra Wireless drivers running under pccard.

  (AC710/AC750/AC850/A550/A555/A710/A750)

  PR:		kern/110190
  Submitted by:	Pascal Vizeli<pvizeli at yahoo dot de>
  Approved by:	imp (mentor)

  MFC After:	1 week

Approved by:	re (kensmith)
Approved by:	imp (mentor)
2007-10-30 10:21:03 +00:00
Rong-En Fan f398d9152c MFC rev. 1.32-1.33
Small improvement for __isctype(): don't use __mb_sb_limit but
 hardcode 128 here instead, since default locale never define anything
 above 127 char.

Approved by:	re (kensmith)
2007-10-30 04:45:27 +00:00
Yoshihiro Takahashi c5850c85e1 MFC: revision 1.546
Disable the coretemp and nvram on pc98.

Approved by:	re (kensmith)
2007-10-30 02:52:47 +00:00
Peter Wemm 2e74d23f34 MFC: split nvram out of isa/clock.c into its own device (default to off).
This matches the 6.x and earlier behavior where there is no (marginally
useful) /dev/nvram.  When it was in isa/clock.c, it was mandatory.

Approved by:  re (kensmith)
2007-10-29 22:26:36 +00:00
Peter Wemm 14aa857adf MFC: remove some _FREEFALL_CONFIG hacks. We don't use ksu on the
freebsd.org cluster any more.

Approved by:  re (kensmith)
2007-10-29 21:39:03 +00:00
Sam Leffler af72e05726 MFC 1.6: fix an incorrect setting of `retry times' in case of zd1211b
Submitted by:	Weongyo Jeong
Approved by:	re (kensmith)
2007-10-29 20:15:51 +00:00
Ariff Abdullah b0c8cb6a2c Remap and virtualize mixer controls for HP nx6110 with
AD1981B AC97 codec, unifying master volume control.

  * Remap "phout" --> SOUND_MIXER_VOLUME (internal speakers)
  * Virtual "vol" --> { "phout", "ogain" (headphone) }

Tested by:	Frederic Chardon
Approved by:	re (kensmith)
2007-10-29 18:47:47 +00:00
Ariff Abdullah 7665384130 Enable headphone jack-sense for HP nx6100 with AD1981B AC'97 codec,
automuting internal speakers.

Tested by:	Frederic Chardon
Approved by:	re (kensmith)
2007-10-29 18:47:27 +00:00
Randall Stewart 5aaa6872b4 Fix spelling error in netstat output for netstat -s
PR:		115641
Approved by:	[email protected](Ken Smith)
2007-10-29 12:50:28 +00:00
Søren Schmidt 8c5d428ef5 MFC:
Fix the signature matching code on AHCI controllers.

Approved by: re@
2007-10-29 10:30:28 +00:00
Marcel Moolenaar 3210dc64c8 MFC: show command and assorted manpage updates.
Approved by: re (kensmith)
2007-10-29 06:18:03 +00:00
Tim Kientzle 2c43001f02 MFC 1.62: Fix reading of files that use pax 'size' attribute
to store size.  In particular, the pax 'size' attribute is required
for any file over 8G.

This seems to fix tar -cf - | tar -xf - when there are files
over 8G in the heirarchy being copied.

Approved by: re (Ken Smith)
2007-10-29 03:28:28 +00:00
Marcel Moolenaar 862f8e07f6 MFC: Add ZFS partition types for APM and GPT and add the
"freebsd-zfs" alias.

Approved by: re (kensmith)
2007-10-29 00:11:40 +00:00
Marcel Moolenaar 33b54e7fea Unbreak. With DDB removed, KTR can not be used as-is because
GEOM wants to save the stack as part of KTR support.

Approved by: re (kensmith)
2007-10-29 00:07:03 +00:00
Bruce A. Mah a96060406a More RELENG_7 release notes trimmings, removing more notes for
features that have already appeared in prior FreeBSD releases.

Approved by:	re (implicitly)
2007-10-28 21:41:36 +00:00
Sam Leffler 241b26dbe8 MFC 1.215: enable use of ULE on arm
Approved by:	re (kensmith)
2007-10-28 21:09:46 +00:00
Mike Makonnen 6fd7030bef MFC: 1.31
Allow adding a user(s) to additional groups in batch mode as well.

	Submitted by: Eygene Ryabinkin <[email protected]>
		      (modulo minor changes)

Approved by: re (kensmith)
2007-10-28 21:06:34 +00:00
Mike Makonnen 4cf0e0f742 MFC: rev. 1.19 and 1.20
The amd_map_program knob can potentially contain a command whose output
   is then used as an argument to the amd program. This outpu may contain
   newlines, but the script did not take care to strip those newlines before
   apending it to rc_flags. Revision 1.72 of rc.subr(8) introduced changes that
   exposed this problem (specifically putting the final eval'ed command in
   quotes).[1]

   Also, for correctness' sake, shell directives appended to the command-line
   by the script should go into command_args, and not appended directly
   to rc_flags.

Approved by: re (kensmith)
2007-10-28 20:07:29 +00:00
Max Laier fc2cfccff7 MFC: pf_if.c 1.12, pf_table.c 1.9
Properly drop the pf mutex around all copyout (consistency still
    protected by the sx) and avoid a WITNESS panic.  Overlooked during last
    import.

    Reported and tested by:	Max N. Boyarov

Approved by:	re (kensmith)
2007-10-28 19:46:30 +00:00
Alexander Motin 95f108cdc8 MFC ng_base.c rev 1.136-1.137, netgraph.h rev 1.69, ng_socket.c rev 1.83
Implement new apply callback mechanism to handle item forwarding.
When item forwarded, refence counter is incremented, when item
processed, counter decremented. When counter reaches zero,
apply handler is getting called.
It allows to report connect() call status only when it is really completed.

Reviewed by:	julian
Approved by:	re (kensmith)
2007-10-28 17:52:08 +00:00
Marius Strobl b825780693 MFC: UPDATING 1.511; sys/dev/pci/pci_user.c 1.23, 1.24;
sys/sys/param.h 1.312, sys/sys/pciio.h 1.8

Add ABI backwards compatibility to the FreeBSD 4/5/6 versions of
the PCIOCGETCONF, PCIOCREAD and PCIOCWRITE IOCTLs, which was broken
with the introduction of PCI domain support.
As the size of struct pci_conf_io wasn't changed with that commit,
this unfortunately requires the ABI of PCIOCGETCONF to be broken
again in order to be able to provide backwards compatibility to
the old version of that IOCTL.

Approved by:	re (kensmith)
2007-10-28 17:31:52 +00:00
Bruce A. Mah 5a23c75a40 For a number of contributed software programs that were updated from
older versions, update the "older" version to match what shipped in
6.2-RELEASE.

Also remove lukemftpd and OpenSSH notes, since those versions already
appeared in 6.2-RELEASE.

Approved by:	re (implicitly)
2007-10-28 17:16:24 +00:00
Bruce A. Mah 779c6ec3b7 Fix sorting order in Contributed Software section. No content
changes.

Approved by:	re (implicitly)
2007-10-28 17:11:36 +00:00
Andrew Thompson 710fd4c3a0 MFC ethernet.h r.133, if_bridge.c r1.104, if_ethersubr.c r1.237, if_vlan.c r1.125
The bridging output function puts the mbuf directly on the interfaces send
  queue so the output network card must support the same tagging mechanism as
  how the frame was input (prepended Ethernet header tag or stripped HW mflag).

  Now the vlan Ethernet header is _always_ stripped in ether_input and the mbuf
  flagged, only only network cards with VLAN_HWTAGGING enabled would properly
  re-tag any outgoing vlan frames.

  If the outgoing interface does not support hardware tagging then readd the vlan
  header to the front of the frame. Move the common vlan encapsulation in to
  ether_vlanencap().

Approved by:	re (kensmith)
2007-10-28 16:24:16 +00:00
Marius Strobl 7a5ebe41f2 - Given that we tell the compiler that struct ip is packed and 32-bit
aligned, GCC 4.2.1 also generates code for sendudp() that assumes
  this alignment. GCC 4.2.1 however doesn't 32-bit align wbuf, causing
  the loader to crash due to an unaligned access of wbuf in sendudp()
  when netbooting sparc64. Solve this by specifying wbuf as packed and
  32-bit aligned, too. As for lastdata and readudp() this currently is
  no issue when compiled with GCC 4.2.1, though give lastdata the same
  treatment as wbuf for consistency and possibility of being affected
  in the future.
- Sprinkle const on a lookup table.

Approved by:		re (kensmith)
2007-10-28 15:41:11 +00:00
Bruce A. Mah 3525d10497 MFCs noted: coretemp(4), awk 1 May 2007 update.
Approved by:	re (implicitly)
2007-10-28 04:55:56 +00:00
Bruce A. Mah 08ccf93b26 MFCs noted (noticed in RELENG_6 release notes, apparently missing
their MFC markers on RELENG_7):  snd_envy24(4), snd_envy24ht(4),
snd_hda(4), snd_spicds(4), cxgb(4), fdisk(8) -p, etc/rc.d/sendmail
alias rebuild change.

For some important ports that were upgraded from some older version,
match the older version with the version that shipped with
6.2-RELEASE:  GNOME, KDE, X.org.

Approved by:	re (implicitly)
2007-10-28 04:36:31 +00:00
Doug Barton 124ebb31f7 MFC version 1.27:
1. Determine the location of the rndc* binaries relative to $command
2. Make the stop routine work more like rc.subr's, but try rndc first
3. Allow the rndc.key file to be owned by root OR the named_uid user

Approved by:	re (kensmith)
2007-10-28 00:26:53 +00:00
Bruce A. Mah cfc3332c0a Trim release notes for 7.0 to remove items for features, bugfixes,
etc. that appeared in prior FreeBSD releases.  This change is based on
reviewing the release notes for 6.1-RELEASE and 6.2-RELEASE.

There's still some more work to be done here but this is a good
checkpoint.

Approved by:	re (implicitly)
Discussed with:	hrs
2007-10-27 21:43:47 +00:00
Bruce A. Mah 63a7bbd490 Updated release notes: ipi/iwi firmware in base system is only on 8.X/7.X
for now, so remove MFC marker, libpcap 0.9.8, tcpdump 3.9.8.

Approved by:	re (implicity)
2007-10-27 21:13:51 +00:00
Bruce A. Mah 745b6d6f28 New release notes: FreeBSD-SA-07:08.openssl, sade(8) [1].
Updated release notes:  GNOME 2.20.1, X.org 7.3.0.

Submitted by:	Andrey V. Elsukov [1]
Approved by:	re (implicity)
2007-10-27 17:19:12 +00:00
Robert Watson ede01361e9 Merge Makefile:1.8 from HEAD to RELENG_7:
Install getaudit_addr(2) and setaudit_addr(2) links to getaudit(2) and
  setaudit(2).

Approved by:	re (kensmith)
Submitted by:	csjp
Obtained from:	TrustedBSD Project
2007-10-27 16:35:46 +00:00
John Baldwin b133fe6e30 MFC: A tsleep -> msleep conversion missed in the intpm(4) locking.
Approved by:	re (kensmith)
2007-10-27 13:27:02 +00:00
Bruce A. Mah db78be41af Somewhat belatedly, update release documentation entities for 7.0-BETA.
I could have sworn I committed this last week.

Approved by:	re (implicitly)
2007-10-26 23:01:34 +00:00
John Baldwin 436febd5ff MFC: Add a -z flag to nfsstat which zeros the NFS statistics after
displaying them.

Approved by:	re (kensmith)
2007-10-26 21:46:32 +00:00
cvs2svn da52a855b5 This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2007-10-26 21:02:32 +00:00
Jung-uk Kim d87b559201 Disable hw.bge.allow_asf tunable by default on the release branch.
This is not to surprise 6.x users when they upgrade to 7.0.

Approved by:	re (kensmith)
2007-10-26 19:47:01 +00:00
Mike Makonnen 2fc1a292ab Note deprecation of rc.d/nfslocking.
Approved by:	re (bmah)
2007-10-26 16:32:32 +00:00
Michael Bushkov eface3c948 MFC: Regen (nscd -> cached, WITHOUT_LIBPTHREAD disabling BIND).
Approved by:	re (hrs), brooks (mentor)
MFC after:	6 days
2007-10-26 08:29:10 +00:00
Michael Bushkov dcef915314 MFC: Another cached -> nscd fix.
Approved by:	re (hrs), brooks (mentor)
MFC after:	6 days
2007-10-26 08:14:08 +00:00
Bjoern A. Zeeb 9c6f2ad7c4 MFC: rev. 1.29 sys/i386/i386/in_cksum.c
rev. 1.18 sys/i386/include/in_cksum.h

  Fold multiple asm statements into one so that the compiler at a certain
  optimization level (-march=pentium-mmx for example) does not insert
  intermediate ops which would trash the carry.

  Change both sys/i386/i386/in_cksum.c[1] and sys/i386/include/in_cksum.h.

  To my best understanding the same problem was addressed in rev. 1.16
  of src/sys/i386/include/in_cksum.h for just a single function 3y ago.

  Reviewed by:  jhb
  Submitted by: Zhouyi ZHOU <zhouzhouyi FreeBSD.org> (intial version of [1])
  PR:           115678, 69257

Approved by:	re (kensmith)
2007-10-26 07:15:04 +00:00
Mike Silbersack 68c86e5b1a MFC:
tcp_syncache.c rev 1.131
	tcp_usrreq.c rev 1.164

Pick the smallest possible TCP window scaling factor that will still allow
us to scale up to sb_max, aka kern.ipc.maxsockbuf.

Approved by:	re (kensmith)
2007-10-26 05:41:25 +00:00
Alan Cox 73c9a67c0b MFC revision 1.237
Correct an error of omission in the reimplementation of the page
  cache: vnode_pager_setsize() must handle the case where a file is
  truncated to a non-page-size-aligned boundary and there is a cached
  page underlying the new end of file.

Approved by:	re (gnn)
2007-10-26 00:12:23 +00:00
Xin LI 174a0511fa Bump __FreeBSDversion for wide and single byte ctype separation MFC.
Approved by:	re (kensmith)
2007-10-25 20:29:46 +00:00
John Baldwin 3988510d6b MFC: Clear the flags in the persistent keyboard data for ukbd0 when
init_keyboard() or kbd_register() fail.

Approved by:	re (kensmith)
2007-10-25 16:55:00 +00:00
Randall Stewart 033c2efde7 - fix sctp_ifn initial refcount issue (prevents deletion)
- fix a bug during cookie collision that prevented an
  association from coming up in a specific restart case.
- Fix it so the shutdown-pending flag gets removed (this is
  more for correctness then needed) when we enter shutdown-sent
  or shutdown-ack-sent states.
- Fix a bug that caused the receiver to sometimes NOT send
  a SACK when a duplicate TSN arrived. Without this fix
  it was possible for the association to fall down if the
- Deleted primary destination is also stored when SCTP_MOBILITY_BASE.
  (Previously, it is stored when only SCTP_MOBILITY_FASTHANDOFF)
- Fix a locking issue where we might call send_initiate_ack() and
  incorrectly state the lock held/not held. Also fix it so that
  when we release the lock the inp cannot be deleted on us.
- Add the debug option that can cause the stack to panic instead
  of aborting an assoc. This does not and should never show up
  in options but is useful for debugging unexpected aborts.
- Add cumack_log sent to track sending cumack information for
  the debug case where we are running a special log per assoc.
- Added extra () aroudn sctp_sbspace macro to avoid compile warnings.
Approved by:	[email protected] (Ken Smith)
2007-10-25 12:27:06 +00:00
Daniel Eischen 95f402b600 MFC: Remove symbols that should not be exported.
Approved by:	re@
2007-10-24 23:53:20 +00:00
Doug Barton 384b018dfa MFC fortunes 1.242: The original version of "The Guy in the Glass" with
proper attribution. See also http://www.theguyintheglass.com/

MFC fortunes 1.243, fortunes-o.real 1.23, and limerick 1.12:
Fix a few small typos and remove a duplicate

Approved by:	re (kensmith)
2007-10-24 20:58:06 +00:00
Rong-En Fan c29f5a6e0a MFC ctype(3) fix for UTF-8 locale. See original commit log for details.
PR:		116363
Reported by:	Petr Hroudny <petr.hroudny at gmail.com>
Patched by:	ache
Reviewed by:	i18n@
Approved by:	re (kensmith)
OK-ed by:	portmgr
2007-10-24 14:32:33 +00:00
Konstantin Belousov b0a9438374 MFC rev. 1.12:
Fix various memory leaks.

Approved by:	re (kensmith)
2007-10-24 12:56:49 +00:00
David Xu 0fbd434d7c MFC revision 1.87, remove bogus if statement.
Approved by: re(kensmith)
2007-10-24 01:04:10 +00:00
Ruslan Ermilov 9939260597 MFC: Added MK_INSTALLLIB support and fixed usr.bin/lex/lib/Makefile
in case of installing with WITHOUT_INSTALLLIB (e.g. in nanobsd(8)).

PR:		bin/114200
Approved by:	re (kensmith)
2007-10-23 15:41:34 +00:00
Ruslan Ermilov 2eb2f49f44 MFC: 1.24: Align the warning message with the one in bsd.own.mk.
Approved by:	re (kensmith)
2007-10-23 15:36:41 +00:00
Ruslan Ermilov c83c5beac6 MFC: Reflect the "libpthread -> libkse", "libthr is the default threding
library", and "libpthread is a symlink" changes in manpages.

Approved by:	re (gnn)
2007-10-23 12:53:04 +00:00
Ruslan Ermilov a0dcb7d494 MFC: 1.114: Remove the libmytinfow links.
Approved by:	re (gnn)
2007-10-23 12:50:14 +00:00
Andrew Thompson b612db5f80 MFC r1.105
Use ETHER_BPF_MTAP so that the vlan tags are visible to bpf(4) when bridging a
 vlan trunk.

Approved by:	re (kensmith)
2007-10-23 02:31:39 +00:00
Andrew Thompson c4266f447e MFC r1.21
Use ETHER_BPF_MTAP so that the vlan tags are visible to bpf(4) when stacked
 under a vlan.

Approved by:	re (kensmith)
2007-10-23 02:30:20 +00:00
Daichi GOTO 2d21093e4d MFC:
This changes give nullfs correctly work with latest unionfs.

Submitted by:   Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by:    jeff, kensmith
Approved by:    re (kensmith)
2007-10-22 05:44:07 +00:00
Daichi GOTO 48585fcd37 MFC:
Added whiteout behavior option. ``-o whiteout=always'' is default mode
(it is established practice) and ``-o whiteout=whenneeded'' is less
disk-space using mode especially for resource restricted environments
like embedded environments. (Contributed by Ed Schouten. Thanks)

Submitted by:   Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by:    jeff, kensmith
Approved by:    re (kensmith)
2007-10-22 05:41:54 +00:00
Daichi GOTO 8481c834c4 MFC:
Default copy mode has been changed from traditional-mode to transparent-mode.
Some folks who have reported some issues have solved with transparent mode.
We guess it is time to change the default copy mode. The transparent-mode is
the best in most situations.

Submitted by:   Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by:    jeff, kensmith
Approved by:    re (kensmith)
2007-10-22 05:38:29 +00:00
Daichi GOTO b6b43348db MFC:
Fixed un-vrele issue of upper layer root vnode of  unionfs.

Submitted by: Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by:   jeff, kensmith
Approved by:   re (kensmith)
2007-10-22 05:36:38 +00:00
Daichi GOTO f343213c52 MFC:
Added NULL check code pointed out by Coverity. (via Stanislav
Sedov. Thanks)

Submitted by:   Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by:    jeff, kensmith
Approved by:    re (kensmith)
2007-10-22 05:35:18 +00:00
Daichi GOTO de5a2db811 MFC:
- It has been become MPSAFE.
  - Fixed lock panic issue under MPSAFE.
  - Fixed panic issue whenever it locks vnode with reclaim.
  - Fixed lock implementations not conforming to vnode_if.src style.

Submitted by:   Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by:    jeff, kensmith
Approved by:    re (kensmith)
2007-10-22 05:34:00 +00:00
Daichi GOTO e6a432eb18 MFC:
Fixed vnode unlock/vrele untreated issues whenever errors have
occurred during some treatments.

Submitted by:   Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by:    jeff, kensmith
Approved by:    re (kensmith)
2007-10-22 05:32:07 +00:00
Daichi GOTO 7a14df136c MFC:
- Added support for vfs_cache on unionfs. As a result, you can use
    applications that use procfs on unionfs.
  - Removed unionfs internal cache mechanism because it has
    vfs_cache support instead. As a result, it just simplified code of
    unionfs.
  - Fixed kern/111262 issue.

Submitted by:   Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by:    jeff, kensmith
Approved by:    re (kensmith)
2007-10-22 05:30:40 +00:00
Daichi GOTO 49c0062cd5 MFC:
Added treatments to prevent readdir infinity loop using with Linux binary
compatibility feature.

Submitted by:   Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by:    jeff, kensmith
Approved by:    re (kensmith)
2007-10-22 05:28:02 +00:00
Daichi GOTO 6a7e4be847 MFC:
Changed it frees unneeded memory ASAP.

Submitted by:   Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by:    jeff, kensmith
Approved by:    re (kensmith)
2007-10-22 05:26:28 +00:00
Daichi GOTO 69a7796c08 MFC:
Improved access permission check treatments.

Submitted by:   Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by:    jeff, kensmith
Approved by:    re (kensmith)
2007-10-22 05:23:57 +00:00
Tim Kientzle aa94e89899 MFC: archive_write_set_format_cpio.c 1.12
MFC: archive_write_set_format_cpio_newc.c 1.2

Non-regular files should have zero-length bodies.  libarchive
flags this to clients by updating the entry description when
it writes the header.

Approved by: re (Ken Smith)
2007-10-21 22:17:25 +00:00
Marius Strobl c23470b57d MFC: libexec/rtld-elf/sparc64/reloc.c 1.16,
sys/sparc64/sparc64/elf_machdep.c 1.24

- Fix the handling of R_SPARC_OLO10, which is a bit of a special case
  in the way we implement handling of relocations.
  As for the kernel part this fixes the loading of lots of modules,
  which failed to load due to unresolvable symbols when built after
  the GCC 4.2.0 import. This wasn't due to a change in GCC itself
  though but one of several changes in configuration done along the
  import. Specfically, HAVE_AS_REGISTER_PSEUDO_OP, which causes GCC
  to denote global registers used for scratch purposes and in turn
  GAS uses R_SPARC_OLO10 relocations for, is now defined.
  While at it replace some more ELF_R_TYPE which should have been
  ELF64_R_TYPE_ID but didn't cause problems so far.
- Sync a sanity check between kernel and rtld(1) and change it to be
  maintenance free regarding the type used for the lookup table.
- Sprinkle const on lookup tables.
- Use __FBSDID.

Approved by:	re (kensmith)
2007-10-21 21:09:55 +00:00
Max Laier 87a2a78d20 MFC: bpf.h, rev. 1.48
Additions from libpcap 0.9.8 unbreak the build.

Approved by:	re (implicit)
2007-10-21 14:05:27 +00:00
Max Laier 2263ac7d16 MFC: pcap.h, 1.14
Revert back to including the whole net/bpf.h again.

Approved by:	re (implicit)
2007-10-20 20:25:49 +00:00
Christian S.J. Peron a3bcc96162 MFC audit_pipe.c revision 1.12
Approved by:	re@ (kensmith)
2007-10-20 15:11:00 +00:00
Christian S.J. Peron 942402992a MFC bpf.c revision 1.182
Approved by:	re@ (kensmith)
2007-10-20 15:09:24 +00:00
Christian S.J. Peron 40f365c7d2 MFC lockf.c revision 1.17
MFC lockf.1 revision 1.19

Approved by:	re (kensmith)
2007-10-20 15:07:56 +00:00
Olivier Houchard 7460f1fc2c MFC rev 1.63:
date: 2007/10/16 18:32:37;  author: cognet;  state: Exp;  lines: +3 -1
Backout rev 1.62, and revert to use -march=armv5te -D__XSCALE__ instead
of -mcpu=xscale for XScale.
gcc still has issues with -mcpu=xscale, and now crashes while building
systat.

Approved by:	re (kensmith)
2007-10-19 17:08:38 +00:00
Sam Leffler 4e77a33fe7 MFC 1.2: increase max rx size so there's room for multi-frame transactions
Submitted by:	Weongyo Jeong
Reviewed by:	sam
Approved by:	re (kensmith)
2007-10-19 17:02:55 +00:00
Ariff Abdullah ae7d95e51d - Gigabyte G33-S2H fixup, due to the present of multiple competing
codecs. Codec at address 0 seems purely digital, or perhaps an HDMI
  interface. Let the driver skip it and continue scanning the codecs
  starting with address 2 (Realtek ALC885).
  * Due to possibilities of future similar cases, put enough logic
    in hdac_scan_codecs() to force codec scanning starting from
    XX address via tunable "hint.pcm.%d.codec_index".

  Reported / Tested by:	Toomas Pelberg <[email protected]>

- Trivial headphone / speaker automute fixup for Fujitsu-Siemens
  AMILO Si 1848 laptop.

  Reported / Tested by:	Ed <[email protected]>

- Trivial headphone / speaker automute fixup for Fujitsu-Siemens
  Lifebook S7020D laptop.

  Reported / Tested by: Jaromir Dvoracek <[email protected]>

- Some smart vendor trying to create interplanetary wormhole by
  screwing pci config space during their BIOS update. The side effects
  of their failure attempt includes mutilated hardware id, broken
  speaker automuting and loosing the entire analog CD connectivity,
  thus causing enough collateral damages to collapse the entire
  universe.  Move along with it.

  Please exercise extra cautious when applying BIOS updates.

  Reported / Tested by:	Pietro Cerutti <[email protected]>
                       	- assembled laptop, based on the MSI-1034
                          (662) which is now becoming MSI-034A.

- Fix no sound issues (on headphones) for Lenovo ThinkCentre A55 due
  to global automute table entry which is not applicable for
  non-laptops.

  Reported / Tested by:	Piotr Smyrak <[email protected]>

- Speaker mute control for HP DC7700 since the front headphone jack
  does not generate any interesting unsolicited signal/response.

  Reported / Tested by:	tyop @ irc.freenode.net

Approved by:	re (kensmith)
2007-10-19 15:53:45 +00:00
Scott Long 61327842cd Merge rev 1.3: Clean up warnings on boot.
Approved by: re
2007-10-19 15:23:23 +00:00
Scott Long 2651587f54 Merge rev 1.62: Fix use-after-free panic.
Approved by: re
2007-10-19 15:22:24 +00:00
Scott Long 2fb50104d4 Merge rev 1.6: Disable defered interrupt processing. There are reports that
this feature still works with the 4BSD scheduler, but I'm disabling it anyways
for the sake of safety.

Approved by: re
2007-10-19 15:21:16 +00:00
Scott Long 0b4bef9bd3 Merge rev 1.82: Don't serialize requests to the controller.
Approved by: re
2007-10-19 15:19:22 +00:00
Ken Smith ffda5de57b Time to start calling it BETA1.
Approved by:	re (implicit)
2007-10-19 14:13:01 +00:00
Alexander Motin 104e8616c5 MFC rev. 1.18-1.21
- Fix thread safety.
 - Make some optimizations.

Approved by:	re (kensmith)
2007-10-19 13:09:01 +00:00
Mike Makonnen b475eb93eb MFC:
rev. 1.10
	The POP daemon's temporary mail file has a leading dot ('.').
	This was lost in the shell script rewrite of the rmuser command.

Approved by:	re (kensmith)
2007-10-19 07:46:33 +00:00
Alan Cox 0cd44d1f56 MFC revision 1.386
The previous revision, updating vm_object_page_remove() for the new page
  cache, did not account for the case where the vm object has nothing but
  cached pages.

Approved by:	re (kensmith)
Requested by:	kensmith
2007-10-19 05:48:45 +00:00
Max Laier efb96a3f45 MFC:
Import of tcpdump 3.9.8 and libpcap 0.9.8

Approved by:	re (kensmith)
2007-10-19 03:04:02 +00:00
Michael Bushkov 1eb2ad1e4e Fast MFC: Small fix in man pages after cached -> nscd renaming.
Approved by:	re (kensmith), brooks (mentor)
2007-10-19 00:18:19 +00:00
Michael Bushkov 50b5c77458 MFC: Renaming etc/cached.conf to etc/nscd.conf. etc/Makefile changed
accordingly.

Approved by:	re (kensmith), brooks (mentor)
2007-10-19 00:09:54 +00:00
Michael Bushkov d535154f8c MFC: Correctly define CACHED_SOCKET_PATH as /var/run/nscd after cached
to nscd renaming.

Approved by:	re (kensmith), brooks (mentor)
2007-10-18 23:59:12 +00:00
Michael Bushkov 99d7b4efa0 MFC: Remove default (compressed) manpages.
Approved by:	re (kensmith), brooks(mentor)
2007-10-18 23:52:44 +00:00
Simon L. B. Nielsen c4d356d3b5 MFC: Import DTLS security fix from upstream OpenSSL_0_9_8-stable branch.
Security:	CVE-2007-4995
Security:	http://www.openssl.org/news/secadv_20071012.txt
Approved by:	re (kensmith)
2007-10-18 22:20:04 +00:00
John Baldwin c58fe70a11 MFC: Allow recursion on the 'zones' internal UMA zone.
Approved by:	re (kensmith)
2007-10-18 18:45:17 +00:00
Edwin Groothuis da03aa6abe Fast MFC for inclusion of 7.0-BETA1:
Teach makewhatis.c to treat .SS with the same severity as .SH.

At least one port (net-mgmt/net-snmp) creates man-pages which are
in the format:

        .SH NAME
        The Net-SNMP agent \- The snmp agent responds to SNMP queries from manag
ement stations.

        .PP
        .SS "Modules"

At this moment, makewhatis determines the end of the .SH NAME section
as where it finds .SH again, but there is none here, is it "terminated"
by the .SS.

PR:             bin/116706
Submitted by:   edwin@
Approved by:    re (Ken Smith), grog (mentor)
2007-10-18 12:55:27 +00:00
Yoshihiro Takahashi f76b1ae6b0 MFC: Optimize for size on pc98. It enables to boot a kernel again.
Approved by:	re (kensmith)
2007-10-18 12:08:53 +00:00
Dag-Erling Smørgrav 5178882e40 MFC: (1.17) fix subvendor / subdevice matching
Approved by:	re (kensmith)
2007-10-18 09:03:40 +00:00
cvs2svn bc812b1b5d This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2007-10-18 08:26:21 +00:00
Tim Kientzle 704ebb3d12 MFC 1.15: When reading ZIP archives, non-regular files should
return EOF immediately on any attempts to read their data.
(Previously, it would return a zero-length block, then EOF,
which elicited bogus warnings from bsdtar.)

Also, correct the EOF return to correctly identify EOF
as part of an empty block at the correct offset.

Approved by: re (Ken Smith)
2007-10-18 05:16:50 +00:00
Pyun YongHyeon 3d805ce70e MFC if_gem.c, rev 1.45 to RELENG_7:
Fix a NULL pointer dereference in Tx checksum calculation.

Approved by:	re (kensmith)
2007-10-18 05:12:20 +00:00
Andrew Thompson 6754c88d9a MFC if_ipw.c r1.31-32, if_ipwreg.h 1.3, if_ipwvar.h r1.7
Update ipw to work with the new net80211 stack, plus other driver improvements.

Approved by:	re (kensmith)
2007-10-18 01:32:58 +00:00
Andrew Thompson 26b811b837 MFC if_lagg.c r1.20, if_lagg.h r1.11
Fix two panics in lagg.

  1. The locking was changed to shared but roundrobin mode still updated a
     pointer in the softc with the next tx interface to use. This will panic
     under high load. Change this to an atomically incremented sequence number
     in order to choose the tx port in round robin.

  2. IFQ_HANDOFF will free the mbuf if the queue is full, this will then be
     freed again by lagg_start() and panic.  Reorganised the error handling and
     freeing to fix this.

Approved by:	re (kensmith)
2007-10-18 01:28:30 +00:00
Andrew Thompson 9df46aa968 MFC r1.3, 1.4
Print the ZFS ereport to the console if vfs.zfs.debug is set to help diagnose
  problems with zfs-on-root since devd isnt running yet.

Approved by:	re (kensmith)
2007-10-17 19:50:40 +00:00
Xin LI 756cad44b8 MFC: less v409.
Approved by:	re (kensmith)
2007-10-17 17:51:28 +00:00
Sam Leffler 905a294209 MFC 1.19:
revert 1.18: the negotiated rate set may not match the hal rate
tables, so using the hal's rateCodeToIndex array will produce wrong
indices for the negotiated rate set

Approved by:	re (kensmith)
2007-10-16 19:07:26 +00:00
Mark Peek 0c85abf74d Apply two vendor fixes from tcsh-6.15.01. The fixes are:
- Fix pty detection for autologout setting
  - kill `foo` got stuck because sigchld was disabled too soon

Approved by: re
2007-10-16 16:18:39 +00:00
Konstantin Belousov f98d3e9ab6 MFC rev. 1.6, 1.7 of src/lib/libutil/pidfile.3,
rev. 1.8 of src/lib/libutil/pidfile.c:

When pidfile is already locked and has zero length, do not return
success and zero pid from pidfile_read(). Return EAGAIN instead. Sleep
up to three times for 5 ms while waiting for pidfile to be written.

Approved by:	re (kensmith)
2007-10-15 10:49:05 +00:00
Ruslan Ermilov 40d9c42a65 MFC: 1.68: Enforce the BIND dependency on libpthread.
Approved by:	re (kensmith)
2007-10-12 19:37:47 +00:00
Mohan Srinivasan 83acd8b389 MFC:
NFS MP scaling changes.
- Eliminate the hideous nfs_sndlock that serialized NFS/TCP request senders
  thru the sndlock.
- Institute a new nfs_connectlock that serializes NFS/TCP reconnects. Add
  logic to wait for pending request senders to finish sending before
  reconnecting. Dial down the sb_timeo for NFS/TCP sockets to 1 sec.
- Break out the nfs xid manipulation under a new nfs xid lock, rather than
  over loading the nfs request lock for this purpose.
- Fix some of the locking in nfs_request.
Many thanks to Kris Kennaway for his help with this and for initiating the
MP scaling analysis and work. Kris also tested this patch thorougly.
Approved by: re@ (Ken Smith)
2007-10-12 19:18:46 +00:00
Bruce A. Mah 6f7e66a088 Stage RELENG_7 release documentation to the correct directory.
Technically, "7-STABLE" isn't the right name for
this directory but it will be after 7.0-RELEASE, and naming the
directory this way means we don't have to go fix it up later.

Approved by:	re (implicitly)
2007-10-12 15:12:17 +00:00
Rong-En Fan 6a531c9cce - After gcc 4.2 import, include/objc/objc-api.h requires objc-decls.h which
we did not install. Install objc-decls.h to fix.

PR:             116943
Reported by:    beech
Submitted by:   vanilla on -current, kan
Approved by:	re (kensmith)
2007-10-12 12:57:39 +00:00
Mohan Srinivasan 5d4e8807e4 MFC :
Set the NFS server sockbuf high watermarks to the system defaults
(up form 32KB). The low highwatermark setting caused UDP fullsock
request drops, throttling thruput greatly.
Reported by: Kris Kennaway
Approved by: re@ (Ken Smith)
2007-10-12 03:59:18 +00:00
Pyun YongHyeon 44fbb6baaa MFC if_vr.c, 1.127 to RELENG_7:
Not all VIA Rhine chips support 256 register space. So touching
  VR_STICKHW register would result in unexpected results on these
  hardwares. wpaul said the following for the issue.

    The vr_attach() routine unconditionally does this for all supported
    chips:

	/*
	 * Windows may put the chip in suspend mode when it
	 * shuts down. Be sure to kick it in the head to wake it
	 * up again.
	 */
	VR_CLRBIT(sc, VR_STICKHW, (VR_STICKHW_DS0|VR_STICKHW_DS1));

    The problem is, the VR_STICKHW register is not valid on all Rhine
    devices. The VT86C100A chip, which is present on the D-Link DFE-530TX
    boards, doesn't support power management, and its register space is
    only 128 bytes wide. The VR_STICKHW register offset falls outside this
    range. This may go unnoticed in most scenarios, but if you happen to have
    another PCI device in your system which is assigned the register
    space immediately after that of the Rhine, the vr(4) driver will
    incorrectly stomp it. In my case, the BIOS on my test board decided
    to put the register space for my PRO/100 ethernet board right next
    to the Rhine, and the Rhine driver ended up clobbering the IMR register
    of the PRO/100 device. (Long story short: the board kept locking up on
    boot. Took me the better part of the morning suss out why.)

    The strictly correct thing to do would be to check the PCI config space
    to make sure the device supports the power management capability and only
    write to the VR_STICKHW register if it does.

  Instead of inspecting chip revision numbers for the availability of
  VR_STICKHW register, check the existence of power management capability
  of the hardware as wpaul suggested.

Reported by:	wpaul
Suggested by:	wpaul
OK'ed by:	jhb
Approved by:	re (kensmith)
2007-10-12 03:41:54 +00:00
Xin LI 232e200f8f MFC:
- Mention that less v408 was MFC'ed.
 - Mention tzdata2007h update.  An in advance &merged; is
   added so that we don't have to change this again when
   it is actually MFC'ed.

Approved by:	re (bmah)
2007-10-11 20:45:06 +00:00
Ken Smith 88fee42777 I forgot to remove the -A flag in previous commit.
Spotted by:	ru
Approved by:	re (implicit)
2007-10-11 12:34:40 +00:00
Ken Smith 419d5e2694 Turn on MALLOC_PRODUCTION which turns off some stuff used for debugging
support.

Reminded by:	kris
Approved by:	re (implicit)
2007-10-11 06:35:46 +00:00
Ken Smith 053dc5b664 Adjust for RELENG_7.
Approved by:	re (implicit)
2007-10-11 06:26:19 +00:00
Ken Smith 57a376bd2a Adjustments for RELENG_7 / CURRENT -> STABLE.
Approved by:	re (implicit)
2007-10-11 06:22:30 +00:00
Ken Smith 8d6a5b67d8 Remove debugging support from GENERIC kernels, remove warning in
UPDATING that says debugging support makes FreeBSD slower, and note
RELENG_7 creation.

Approved by:	re (implicit)
2007-10-11 06:20:27 +00:00
Ken Smith 8ae8870710 Adjust "make update" to use RELENG_7.
Approved by:	re (implicit)
2007-10-11 06:08:51 +00:00
Ken Smith fb1fe5636e 7.0-CURRENT -> 7.0-PRERELEASE. 2007-10-11 06:05:23 +00:00
cvs2svn d617d42018 This commit was manufactured by cvs2svn to create branch 'RELENG_7'. 2007-10-10 16:59:15 +00:00
9031 changed files with 1177847 additions and 751278 deletions

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@
The compilation of software known as FreeBSD is distributed under the
following terms:
Copyright (C) 1992-2007 The FreeBSD Project. All rights reserved.
Copyright (c) 1992-2009 The FreeBSD Project. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
+1 -1
View File
@@ -72,7 +72,6 @@ pkill gad Heads-up appreciated.
ps gad I am working on a number of changes to this. Would
like advance notice of major changes planned to it.
cvs peter Heads-up appreciated, try not to break it.
ncurses peter Heads-up appreciated, try not to break it.
nvi peter Try not to break it.
libz peter Try not to break it.
pppd/chat peter Try not to break it.
@@ -129,6 +128,7 @@ usr.sbin/bluetooth emax Pre-commit review preferred.
gnu/usr.bin/send-pr bugmaster Pre-commit review requested.
BSD.{local,x11*}.dist portmgr Pre-commit review requested, since these files interface with ports.
usb core Please contact core@ before any major changes
ncurses rafan Heads-up appreciated, try not to break it.
Following are the entries from the Makefiles, and a few other sources.
Please remove stale entries from both their origin, and this file.
+22 -12
View File
@@ -57,7 +57,7 @@
# 6. `mergemaster -p'
# 7. `make installworld'
# 8. `make delete-old'
# 9. `mergemaster'
# 9. `mergemaster' (you may wish to use -U or -ai).
# 10. `reboot'
# 11. `make delete-old-libs' (in case no 3rd party program uses them anymore)
#
@@ -75,6 +75,8 @@
# developer convenience only. They are intentionally not documented and
# completely subject to change without notice.
#
# For more information, see the build(7) manual page.
#
TGTS= all all-man buildenv buildenvvars buildkernel buildworld \
check-old check-old-dirs check-old-files check-old-libs \
checkdpadd clean cleandepend cleandir \
@@ -147,14 +149,14 @@ cleanworld:
.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR}
.if exists(${BW_CANONICALOBJDIR}/)
-rm -rf ${BW_CANONICALOBJDIR}/*
chflags -R 0 ${BW_CANONICALOBJDIR}
-chflags -R 0 ${BW_CANONICALOBJDIR}
rm -rf ${BW_CANONICALOBJDIR}/*
.endif
# To be safe in this case, fall back to a 'make cleandir'
${_+_}@cd ${.CURDIR}; ${_MAKE} cleandir
.else
-rm -rf ${.OBJDIR}/*
chflags -R 0 ${.OBJDIR}
-chflags -R 0 ${.OBJDIR}
rm -rf ${.OBJDIR}/*
.endif
@@ -277,28 +279,36 @@ universe_prologue:
@echo "--------------------------------------------------------------"
.for target in ${TARGETS}
KERNCONFS!= cd ${.CURDIR}/sys/${target}/conf && \
find [A-Z]*[A-Z] -type f -maxdepth 0 \
find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \
! -name DEFAULTS ! -name LINT
KERNCONFS:= ${KERNCONFS:S/^NOTES$/LINT/}
universe: universe_${target}
.ORDER: universe_prologue universe_${target} universe_epilogue
universe_${target}:
.if !defined(MAKE_JUST_KERNELS)
@echo ">> ${target} started on `LC_ALL=C date`"
-cd ${.CURDIR} && ${MAKE} ${JFLAG} buildworld \
@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
${MAKE} ${JFLAG} buildworld \
TARGET=${target} \
__MAKE_CONF=/dev/null \
> _.${target}.buildworld 2>&1
> _.${target}.buildworld 2>&1 || \
echo "${target} world failed," \
"check _.${target}.buildworld for details")
@echo ">> ${target} buildworld completed on `LC_ALL=C date`"
.endif
.if exists(${.CURDIR}/sys/${target}/conf/NOTES)
-cd ${.CURDIR}/sys/${target}/conf && ${MAKE} LINT \
> ${.CURDIR}/_.${target}.makeLINT 2>&1
@(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \
${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \
echo "${target} 'make LINT' failed," \
"check _.${target}.makeLINT for details")
.endif
.for kernel in ${KERNCONFS}
-cd ${.CURDIR} && ${MAKE} ${JFLAG} buildkernel \
@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
${MAKE} ${JFLAG} buildkernel \
TARGET=${target} \
KERNCONF=${kernel} \
__MAKE_CONF=/dev/null \
> _.${target}.${kernel} 2>&1
> _.${target}.${kernel} 2>&1 || \
echo "${target} ${kernel} kernel failed," \
"check _.${target}.${kernel} for details")
.endfor
@echo ">> ${target} completed on `LC_ALL=C date`"
.endfor
+55 -18
View File
@@ -10,6 +10,7 @@
# -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
# -DNO_PORTSUPDATE do not update ports in ${MAKE} update
# -DNO_DOCUPDATE do not update doc in ${MAKE} update
# -DNO_CTF do not run the DTrace CTF conversion tools on built objects
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
# TARGET="machine" to crossbuild world for a different machine type
@@ -42,6 +43,8 @@ SUBDIR+=games
.endif
.if ${MK_CDDL} != "no"
SUBDIR+=cddl
.else
NO_CTF=1
.endif
SUBDIR+=gnu include
.if ${MK_KERBEROS} != "no"
@@ -85,7 +88,7 @@ CLEANDIR= cleandir
.endif
CVS?= cvs
CVSFLAGS?= -A -P -d -I!
CVSFLAGS?= -r RELENG_7_2 -P -d -I!
SUP?= /usr/bin/csup
SUPFLAGS?= -g -L 2
.if defined(SUPHOST)
@@ -102,6 +105,11 @@ OSRELDATE= 0
.endif
.endif
.if !defined(VERSION)
VERSION!= uname -srp
VERSION+= ${OSRELDATE}
.endif
# Guess machine architecture from machine type, and vice versa.
.if !defined(TARGET_ARCH) && defined(TARGET)
TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/}
@@ -201,6 +209,7 @@ CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
PATH=${BPATH}:${PATH} \
WORLDTMP=${WORLDTMP} \
VERSION="${VERSION}" \
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
${BMAKEENV} ${MAKE} -f Makefile.inc1 \
@@ -208,25 +217,30 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
BOOTSTRAPPING=${OSRELDATE} \
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
-DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \
-DNO_CPU_CFLAGS -DNO_WARNS
-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF
# build-tools stage
TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
${BMAKEENV} ${MAKE} -f Makefile.inc1 \
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
DESTDIR= \
BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS
BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS \
-DNO_WARNS -DNO_CTF
# cross-tools stage
XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
-DWITHOUT_FORTRAN -DWITHOUT_GDB
-DWITHOUT_GDB
# world stage
WMAKEENV= ${CROSSENV} \
_SHLIBDIRPREFIX=${WORLDTMP} \
VERSION="${VERSION}" \
INSTALL="sh ${.CURDIR}/tools/install.sh" \
PATH=${TMPPATH}
.if ${MK_CDDL} == "no" || defined(NO_CTF)
WMAKEENV+= NO_CTF=1
.endif
WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP}
.if ${TARGET_ARCH} == "amd64"
@@ -234,11 +248,11 @@ WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP}
LIB32TMP= ${OBJTREE}${.CURDIR}/lib32
.if empty(TARGET_CPUTYPE)
LIB32CPUTYPE= k8
LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2
.else
LIB32CPUTYPE= ${TARGET_CPUTYPE}
LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
.endif
LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -DCOMPAT_32BIT \
LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -mfancy-math-387 -DCOMPAT_32BIT \
-iprefix ${LIB32TMP}/usr/ \
-L${LIB32TMP}/usr/lib32 \
-B${LIB32TMP}/usr/lib32
@@ -246,6 +260,7 @@ LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -DCOMPAT_32BIT \
# Yes, the flags are redundant.
LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
_SHLIBDIRPREFIX=${LIB32TMP} \
VERSION="${VERSION}" \
MACHINE=i386 \
MACHINE_ARCH=i386 \
INSTALL="sh ${.CURDIR}/tools/install.sh" \
@@ -260,7 +275,7 @@ LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \
-DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_INFO \
-DWITHOUT_HTML DESTDIR=${LIB32TMP}
-DWITHOUT_HTML -DNO_CTF DESTDIR=${LIB32TMP}
LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS
.endif
@@ -304,8 +319,9 @@ _worldtmp:
.endif
.else
rm -rf ${WORLDTMP}/legacy/usr/include
# XXX - These two can depend on any header file.
# XXX - These three can depend on any header file.
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c
rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
.endif
.for _dir in \
@@ -451,24 +467,33 @@ build32:
cd ${.CURDIR}; \
${LIB32WMAKE} -f Makefile.inc1 libraries
.for _t in obj depend all
cd ${.CURDIR}/libexec/rtld-elf; \
PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_t}
cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_t}
cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} ${_t}
.endfor
distribute32 install32:
.if make(distribute32)
mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32 # XXX add to mtree
mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32/dtrace # XXX add to mtree
.else
mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree
mkdir -p ${DESTDIR}/usr/lib32/dtrace # XXX add to mtree
.endif
cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
.if ${MK_CDDL} != "no"
cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
.endif
cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
.if ${MK_CRYPT} != "no"
cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
.endif
cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//}
.if ${MK_KERBEROS} != "no"
cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
.endif
cd ${.CURDIR}/libexec/rtld-elf; \
PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//}
cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//}
.endif
WMAKE_TGTS=
.if !defined(SUBDIR_OVERRIDE)
@@ -572,10 +597,14 @@ installcheck_UGID:
#
# Installs everything compiled by a 'buildworld'.
#
.if ${MK_INFO} != "no"
_install-info= install-info
.endif
distributeworld installworld: installcheck
mkdir -p ${INSTALLTMP}
for prog in [ awk cap_mkdb cat chflags chmod chown \
date echo egrep find grep install-info \
date echo egrep find grep ${_install-info} \
ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
test true uname wc zic; do \
cp `which $$prog` ${INSTALLTMP}; \
@@ -610,7 +639,8 @@ redistribute:
@echo "--------------------------------------------------------------"
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
.if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 DISTRIBUTION=lib32
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \
DISTRIBUTION=lib32
.endif
distrib-dirs distribution:
@@ -705,13 +735,14 @@ buildkernel:
@echo "--------------------------------------------------------------"
cd ${KRNLOBJDIR}/${_kernel}; \
MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
${MAKE} -DNO_CPU_CFLAGS -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
${MAKE} -DNO_CPU_CFLAGS -DNO_CTF \
-f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
.for target in obj depend all
cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
${MAKE} -DNO_CPU_CFLAGS ${target}
${MAKE} -DNO_CPU_CFLAGS -DNO_CTF ${target}
.endfor
.endif
.if !defined(NO_KERNELDEPEND)
@@ -873,8 +904,14 @@ _crunchgen= usr.sbin/crunch/crunchgen
_pwd_mkdb= usr.sbin/pwd_mkdb
.endif
#.if ${MK_CDDL} != "no"
#_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \
# lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
#.endif
bootstrap-tools:
.for _tool in \
${_dtrace_tools} \
${_strfile} \
${_gperf} \
${_groff} \
@@ -1028,7 +1065,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \
lib/libradius lib/libsbuf lib/libtacplus lib/libutil \
${_lib_libypclnt} lib/libz lib/msun \
${_secure_lib_libcrypto} ${_secure_lib_libssh} \
${_secure_lib_libssl}
${_secure_lib_libssl} lib/libdwarf lib/libproc
.if ${MK_LIBTHR} != "no" && ${MK_LIBKSE} != "no"
_default_thread_lib= lib/${DEFAULT_THREAD_LIB}
+97 -10
View File
@@ -14,11 +14,36 @@
# The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
#
# 20090203: adding_user.8 moved to adding_user.7
OLD_FILES+=usr/share/man/man8/adding_user.8.gz
# 20080407: pkg_sign has been removed
OLD_FILES+=usr/sbin/pkg_check
OLD_FILES+=usr/sbin/pkg_sign
OLD_FILES+=usr/share/man/man1/pkg_check.1.gz
OLD_FILES+=usr/share/man/man1/pkg_sign.1.gz
# 20080126: oldcard.4 removal
OLD_FILES+=usr/share/man/man4/card.4.gz
OLD_FILES+=usr/share/man/man4/oldcard.4.gz
# 20071207: Merged with fortunes-o.real
OLD_FILES+=usr/share/games/fortune/fortunes2-o
OLD_FILES+=usr/share/games/fortune/fortunes2-o.dat
# 20071206: Disabled static versions of libkse by default
.if ${DEFAULT_THREAD_LIB} != "libkse" && ${MK_LIBTHR} != "no"
OLD_FILES+=usr/lib/libkse.a
OLD_FILES+=usr/lib/libkse_p.a
OLD_FILES+=usr/lib/libkse_pic.a
.if ${TARGET_ARCH} == "amd64"
OLD_FILES+=usr/lib32/libkse.a
OLD_FILES+=usr/lib32/libkse_p.a
OLD_FILES+=usr/lib32/libkse_pic.a
.endif
.endif
# 20070930: rename of cached to nscd
OLD_FILES+=etc/cached.conf
OLD_FILES+=etc/rc.d/cached
OLD_FILES+=usr/sbin/cached
OLD_FILES+=usr/share/man/man5/cached.conf.5
OLD_FILES+=usr/share/man/man8/cached.8
OLD_FILES+=usr/share/man/man5/cached.conf.5.gz
OLD_FILES+=usr/share/man/man8/cached.8.gz
# 20070807: removal of PowerPC specific header file.
.if ${TARGET_ARCH} == "powerpc"
OLD_FILES+=usr/include/machine/interruptvar.h
@@ -98,6 +123,12 @@ OLD_DIRS+=usr/include/netatm/ipatm
OLD_DIRS+=usr/include/netatm/uni
OLD_DIRS+=usr/include/netatm
OLD_DIRS+=usr/share/examples/atm
.if ${TARGET_ARCH} == "amd64"
OLD_FILES+=usr/lib32/libatm.a
OLD_FILES+=usr/lib32/libatm.so
OLD_LIBS+=usr/lib32/libatm.so.5
OLD_FILES+=usr/lib32/libatm_p.a
.endif
# 20070705: I4B headers repo-copied to include/i4b/
.if ${TARGET_ARCH} == "i386"
OLD_FILES+=usr/include/machine/i4b_cause.h
@@ -188,6 +219,42 @@ OLD_LIBS+=usr/lib/snmp_hostres.so.4
OLD_LIBS+=usr/lib/snmp_mibII.so.4
OLD_LIBS+=usr/lib/snmp_netgraph.so.4
OLD_LIBS+=usr/lib/snmp_pf.so.4
.if ${TARGET_ARCH} == "amd64"
OLD_LIBS+=usr/lib32/libalias.so.5
OLD_LIBS+=usr/lib32/libbsnmp.so.3
OLD_LIBS+=usr/lib32/libdialog.so.5
OLD_LIBS+=usr/lib32/libgnuregex.so.3
OLD_LIBS+=usr/lib32/libhistory.so.6
OLD_LIBS+=usr/lib32/libncurses.so.6
OLD_LIBS+=usr/lib32/libncursesw.so.6
OLD_LIBS+=usr/lib32/libpam.so.3
OLD_LIBS+=usr/lib32/libreadline.so.6
OLD_LIBS+=usr/lib32/libssh.so.3
OLD_LIBS+=usr/lib32/pam_chroot.so.3
OLD_LIBS+=usr/lib32/pam_deny.so.3
OLD_LIBS+=usr/lib32/pam_echo.so.3
OLD_LIBS+=usr/lib32/pam_exec.so.3
OLD_LIBS+=usr/lib32/pam_ftpusers.so.3
OLD_LIBS+=usr/lib32/pam_group.so.3
OLD_LIBS+=usr/lib32/pam_guest.so.3
OLD_LIBS+=usr/lib32/pam_krb5.so.3
OLD_LIBS+=usr/lib32/pam_ksu.so.3
OLD_LIBS+=usr/lib32/pam_lastlog.so.3
OLD_LIBS+=usr/lib32/pam_login_access.so.3
OLD_LIBS+=usr/lib32/pam_nologin.so.3
OLD_LIBS+=usr/lib32/pam_opie.so.3
OLD_LIBS+=usr/lib32/pam_opieaccess.so.3
OLD_LIBS+=usr/lib32/pam_passwdqc.so.3
OLD_LIBS+=usr/lib32/pam_permit.so.3
OLD_LIBS+=usr/lib32/pam_radius.so.3
OLD_LIBS+=usr/lib32/pam_rhosts.so.3
OLD_LIBS+=usr/lib32/pam_rootok.so.3
OLD_LIBS+=usr/lib32/pam_securetty.so.3
OLD_LIBS+=usr/lib32/pam_self.so.3
OLD_LIBS+=usr/lib32/pam_ssh.so.3
OLD_LIBS+=usr/lib32/pam_tacplus.so.3
OLD_LIBS+=usr/lib32/pam_unix.so.3
.endif
# 20070613: IPX over IP tunnel removal
OLD_FILES+=usr/include/netipx/ipx_ip.h
# 20070605: sched_core removal
@@ -567,6 +634,9 @@ OLD_FILES+=usr/bin/uuidgen
OLD_FILES+=usr/share/info/bzip2.info.gz
# 20070303: libarchive 2.0
OLD_LIBS+=usr/lib/libarchive.so.3
.if ${TARGET_ARCH} == "amd64"
OLD_LIBS+=usr/lib32/libarchive.so.3
.endif
# 20070301: remove addr2ascii and ascii2addr
OLD_FILES+=usr/share/man/man3/addr2ascii.3.gz
OLD_FILES+=usr/share/man/man3/ascii2addr.3.gz
@@ -579,11 +649,17 @@ OLD_FILES+=usr/share/man/man4/kame.4.gz
# 20070201: remove libmytinfo link
OLD_FILES+=usr/lib/libmytinfo.a
OLD_FILES+=usr/lib/libmytinfo.so
OLD_FILES+=usr/lib/libmytinfo_p.a
OLD_FILES+=usr/lib/libmytinfo_p.a
OLD_FILES+=usr/lib/libmytinfow.a
OLD_FILES+=usr/lib/libmytinfow.so
OLD_FILES+=usr/lib/libmytinfow_p.a
.if ${TARGET_ARCH} == "amd64"
OLD_FILES+=usr/lib32/libmytinfo.a
OLD_FILES+=usr/lib32/libmytinfo.so
OLD_FILES+=usr/lib32/libmytinfo_p.a
OLD_FILES+=usr/lib32/libmytinfow.a
OLD_FILES+=usr/lib32/libmytinfow.so
OLD_FILES+=usr/lib32/libmytinfow_p.a
.endif
# 20070128: remove vnconfig
OLD_FILES+=usr/sbin/vnconfig
@@ -1009,6 +1085,9 @@ OLD_FILES+=usr/sbin/ntp-genkeys
OLD_FILES+=usr/sbin/ntptimeset
OLD_FILES+=usr/share/man/man8/kernbb.8.gz
OLD_FILES+=usr/share/man/man8/ntp-genkeys.8.gz
# 20040627: usbdevs.h and usbdevs_data.h removal
OLD_FILES+=usr/include/dev/usb/usbdevs.h
OLD_FILES+=usr/include/dev/usb/usbdevs_data.h
# 200406XX
OLD_FILES+=usr/bin/gasp
OLD_FILES+=usr/bin/gdbreplay
@@ -3454,11 +3533,8 @@ OLD_FILES+=usr/games/worm
OLD_FILES+=usr/games/worms
OLD_FILES+=usr/games/wump
OLD_FILES+=sbin/mount_reiserfs
OLD_FILES+=usr/bin/hesinfo
OLD_FILES+=usr/include/c++/3.4/ext/demangle.h
OLD_FILES+=usr/include/cam/cam_extend.h
OLD_FILES+=usr/include/dev/usb/usbdevs.h
OLD_FILES+=usr/include/dev/usb/usbdevs_data.h
OLD_FILES+=usr/include/dev/wi/wi_hostap.h
OLD_FILES+=usr/include/disktab.h
OLD_FILES+=usr/include/g++/FlexLexer.h
@@ -3866,10 +3942,8 @@ OLD_FILES+=usr/share/doc/ntp/release.htm
OLD_FILES+=usr/share/doc/ntp/tickadj.htm
OLD_FILES+=usr/share/doc/papers/nqnfs.ascii.gz
OLD_FILES+=usr/share/doc/papers/px.ascii.gz
OLD_FILES+=usr/share/man/man1/hesinfo.1.gz
OLD_FILES+=usr/share/man/man3/mbrune.3.gz
OLD_FILES+=usr/share/man/man3/rune.3.gz
OLD_FILES+=usr/share/man/man3/hesiod.3.gz
OLD_FILES+=usr/share/man/man3/mac_is_present_np.3.gz
OLD_FILES+=usr/share/man/man3/fpsetsticky.3.gz
OLD_FILES+=usr/share/man/man3/gss_krb5_copy_ccache.3.gz
@@ -3884,7 +3958,6 @@ OLD_FILES+=usr/share/man/man3/setrunelocale.3.gz
OLD_FILES+=usr/share/man/man3/setinvalidrune.3.gz
OLD_FILES+=usr/share/man/man3/mbrune.3.gz
OLD_FILES+=usr/share/man/man3/rune.3.gz
OLD_FILES+=usr/share/man/man3/hesiod.3.gz
OLD_FILES+=usr/share/man/man3/mac_is_present_np.3.gz
OLD_FILES+=usr/share/man/man3/fpsetsticky.3.gz
OLD_FILES+=usr/share/man/man3/gss_krb5_copy_ccache.3.gz
@@ -3900,7 +3973,6 @@ OLD_FILES+=usr/share/man/man3/setinvalidrune.3.gz
OLD_FILES+=usr/share/man/man3/fungetrune.3.gz
OLD_FILES+=usr/share/man/man3/fputrune.3.gz
OLD_FILES+=usr/share/man/man3/fgetrune.3.gz
OLD_FILES+=usr/share/man/man5/hesiod.conf.5.gz
OLD_FILES+=usr/share/man/man5/usbd.conf.5.gz
.if ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "amd64"
OLD_FILES+=usr/share/man/man8/boot_i386.8.gz
@@ -3946,6 +4018,21 @@ OLD_FILES+=usr/libdata/msdosfs/koi8u2dos
# - usr/share/tmac/mm/locale
# - usr/share/tmac/mm/se_locale
# - var/yp/Makefile
# 20071120: shared library version bump
OLD_LIBS+=usr/lib/libasn1.so.8
OLD_LIBS+=usr/lib/libgssapi.so.8
OLD_LIBS+=usr/lib/libgssapi_krb5.so.8
OLD_LIBS+=usr/lib/libhdb.so.8
OLD_LIBS+=usr/lib/libkadm5clnt.so.8
OLD_LIBS+=usr/lib/libkadm5srv.so.8
OLD_LIBS+=usr/lib/libkafs5.so.8
OLD_LIBS+=usr/lib/libkrb5.so.8
OLD_LIBS+=usr/lib/libobjc.so.2
.if ${TARGET_ARCH} == "amd64"
OLD_LIBS+=usr/lib32/libgssapi.so.8
OLD_LIBS+=usr/lib32/libobjc.so.2
.endif
# 20070519: GCC 4.2
OLD_LIBS+=usr/lib/libg2c.a
OLD_LIBS+=usr/lib/libg2c.so
+250 -13
View File
@@ -1,4 +1,4 @@
Updating Information for FreeBSD current users
Updating Information for FreeBSD STABLE users
This file is maintained and copyrighted by M. Warner Losh
<[email protected]>. See end of file for further details. For commonly
@@ -8,18 +8,241 @@ Items affecting the ports and packages system can be found in
/usr/ports/UPDATING. Please read that file before running
portupgrade.
NOTE TO PEOPLE WHO THINK THAT FreeBSD 7.x IS SLOW:
FreeBSD 7.x has many debugging features turned on, in
both the kernel and userland. These features attempt to detect
incorrect use of system primitives, and encourage loud failure
through extra sanity checking and fail stop semantics. They
also substantially impact system performance. If you want to
do performance measurement, benchmarking, and optimization,
you'll want to turn them off. This includes various WITNESS-
related kernel options, INVARIANTS, malloc debugging flags
in userland, and various verbose features in the kernel. Many
developers choose to disable these features on build machines
to maximize performance.
20100526: p8 FreeBSD-SA-10:05.opie, FreeBSD-SA-10:06.nfsclient
Fix a one-NUL-byte buffer overflow in libopie. [10:05]
Correctly sanity-check a buffer length in nfs mount. [10:06]
20100227: p7 FreeBSD-EN-10:02.sched_ule
Fix a deadlock in the ULE scheduler.
20100106: p6 FreeBSD-SA-10:01.bind, FreeBSD-SA-10:02.ntpd,
FreeBSD-SA-10:03.zfs
Fix BIND named(8) cache poisoning with DNSSEC validation.
[SA-10:01]
Fix ntpd mode 7 denial of service. [SA-10:02]
Fix ZFS ZIL playback with insecure permissions. [SA-10:03]
20091203: p5 FreeBSD-SA-09:15.ssl, FreeBSD-SA-09:16.rtld,
FreeBSD-SA-09:17.freebsd-update
Disable SSL renegotiation in order to protect against a serious
protocol flaw. [09:15]
Correctly handle failures from unsetenv resulting from a corrupt
environment in rtld-elf. [09:16]
Fix permissions in freebsd-update in order to prevent leakage of
sensitive files. [09:17]
20091002: p4 FreeBSD-SA-09:14.devfs FreeBSD-EN-09:05.null
Fix devfs / VFS NULL pointer race condition. [SA-09:14]
Add no zero mapping feature. [EN-09:05]
20090729: p3 FreeBSD-SA-09:12.bind
Fix BIND named(8) dynamic update message remote DoS.
20090624: p2 FreeBSD-EN-09:02.bce, FreeBSD-EN-09:03.fxp,
FreeBSD-EN-09:04.fork
Fix packet length calculation in bce(4). [EN-09:02]
Correctly set IP packet length for TSO in fxp(4). [EN-09:03]
Fix a lock order reversal bug that could cause deadlock during
fork(2). [EN-09:04]
20090610: p1 FreeBSD-SA-09:09.pipe, FreeBSD-SA-09:10.ipv6,
FreeBSD-SA-09:11.ntpd
Prevent integer overflow in direct pipe write code from circumventing
virtual-to-physical page lookups. [09:09]
Add missing permissions check for SIOCSIFINFO_IN6 ioctl. [09:10]
Fix buffer overflow in "autokey" negotiation in ntpd(8). [09:11]
20090504:
FreeBSD 7.2-RELEASE
20090422: FreeBSD-SA-09:07.libc, FreeBSD-SA-09:08.openssl
Don't leak information via uninitialized space in db(3) records.
[09:07]
Sanity-check string lengths in order to stop OpenSSL crashing
when printing corrupt BMPString or UniversalString objects. [09:08]
20090326:
Following bug-fixes to TCP connection state flags, netstat, systat,
and sockstat will need to be rebuilt in order to properly print
connections in the TIMEWAIT state.
20090318:
Change IPv6 ephemeral port allocation from sequential to
random allocation, like IPv4 has done for more than four years.
The implementation shares infrastructure with IPv4. This
means that there is only one set of sysctls to control both
IPv4 and IPv6. See ip(4) man page for details.
20090312:
A workaround is committed to allow the creation of System V shared
memory segment of size > 2 GB on the 64-bit architectures.
Due to a limitation of the existing ABI, the shm_segsz member
of the struct shmid_ds, returned by shmctl(IPC_STAT) call is
wrong for large segments. Note that limits must be explicitely
raised to allow such segments to be created.
The management interface that is used by ipcs(1) has to be changed
in incompatible way. Rebuild the ipcs(1) utility with the new
headers after the update. Buildworld/installworld takes care
of this issue automatically.
20090312:
The open-source Atheros HAL has been merged from HEAD
to STABLE.
The kernel compile-time option AH_SUPPORT_AR5416 has been
added to support certain newer Atheros parts, particularly
PCI-Express chipsets.
The following modules are no longer available, and should be
removed from MODULES_OVERRIDE and/or loader.conf:-
ath_hal ath_rate_amrr ath_rate_onoe ath_rate_sample
20090207:
ZFS users on amd64 machines with 4GB or more of RAM should
reevaluate their need for setting vm.kmem_size_max and
vm.kmem_size manually. In fact, after recent changes to the
kernel, the default value of vm.kmem_size is larger than the
suggested manual setting in most ZFS/FreeBSD tuning guides.
20090207:
Multi-IPv4/v6/no-IP jail support was merged to STABLE.
You need to rebuild jls(8) and to use the new features
jail(8), jexec(8) and cpuset(1) with a new kernel.
__FreeBSD_version was bumped to 701103.
20090119:
NTFS has been removed from GENERIC kernel on amd64 to match
GENERIC on i386. Should not cause any issues since mount_ntfs(8)
will load ntfs.ko module automatically when NTFS support is
actually needed, unless ntfs.ko is not installed or security
level prohibits loading kernel modules. If either is the case,
"options NTFS" has to be added into kernel config.
20090110:
powerd(8) was updated to get better SMP support.
Meanings of the -i and -r command line options were changed.
20090107:
snd_hda(4) driver was updated to version 20081226_0122.
Due to added HDMI audio and logical audio devices support, updated
driver often provides several PCM devices. In some cases it can make
system default audio device no longer correspond to the users's
habbitual audio connectors. In such cases wanted device can be
specified in audio application setup or defined globally via
hw.snd.default_unit sysctl according to sound(4) and snd_hda(4)
man pages.
20090106:
FreeBSD 7.1-RELEASE
20080903:
ntpd has been upgraded to 4.2.4p5.
20080901:
OpenSSH has been upgraded to 5.1p1.
20080826:
DTrace support was merged to STABLE today. In the best
tradition of "the dog ate my homework", subversion decided
that the commit message was too large and opted not to send
it. It was a stealth commit!
A 'make buildkernel' will now default to build the kernel
and modules with both DTrace kernel hooks and CTF data ready
for DTrace.
After you have installed both world and the kernel, and
rebooted, you can 'kldload dtraceall' to load all the DTrace
kernel modules and then you're set to run the 'dtrace'
client (as root).
For DTrace documentation, refer to:
<http://wikis.sun.com/display/DTrace/Documentation>
We are limited to kernel tracing at the moment, so the pid
provider is not available.
For the syscall provider, note that the arguments to the
return probes are the same as for the entry probes.
20080811:
Today STABLE got a reorganization of the Intel E1000
driver code. In order to better support our new adapters
there is a new driver, igb, that is now to be used for
either the 82575 or 82576 adapters. The source however,
is all now in sys/dev/e1000, both em and igb drivers are
built from that common directory if you configure them
in the kernel. Making loadable drivers still happens in
the same place: sys/modules/[em, igb].
The important thing to note is that the 82575 adapters
were supported in the em driver in 7.0, but now needed
to be moved into igb, so if you have the effected cards
be sure and make any script changes to follow the name
change.
There are only 3 PCI ID's effected in this change:
0x10A7, 0x10A9, and 0x10D6
So you can know ahead of time if they will be effected,
these will now be supported in the igb driver. That
driver will also support the new 82576 followon.
The driver reorg in STABLE is inconvenient but it really
was necessary for Intel to do this, and I figured it was
better to have this small admin type issue than not to
have support for this new hardware for a whole release
cycle.
20080724:
I have MFC'd in code to support multiple routing tables.
see the man pages setfib(1) and setfib(2).
This is a backwards compatible version,
but to make use of it you need to compile your kernel
with options ROUTETABLES=2 (or more up to 16).
20080226:
FreeBSD 7.0-RELEASE
20080208:
Note the addition of m_collapse for compacting mbuf chains.
20071126:
The AT keyboard emulation of sunkbd(4) has been turned on
by default. In order to make the special symbols of the Sun
keyboards driven by sunkbd(4) work under X these now have
to be configured the same way as Sun USB keyboards driven
by ukbd(4) (which also does AT keyboard emulation), f.e.:
Option "XkbLayout" "us"
Option "XkbRules" "xorg"
Option "XkbSymbols" "pc(pc105)+sun_vndr/usb(sun_usb)+us"
20071028:
It has been decided that it is desirable to provide ABI
backwards compatibility to the FreeBSD 4/5/6 versions of the
PCIOCGETCONF, PCIOCREAD and PCIOCWRITE IOCTLs, which was
broken with the introduction of PCI domain support (see the
20070930 entry). Unfortunately, this required the ABI of
PCIOCGETCONF to be broken again in order to be able to
provide backwards compatibility to the old version of that
IOCTL. Thus consumers of PCIOCGETCONF have to be recompiled
again. As for prominent ports this affects neither pciutils
nor xorg-server this time, the hal port needs to be rebuilt
however.
20071010:
RELENG_7 branched.
20071009:
Setting WITHOUT_LIBPTHREAD now means WITHOUT_LIBKSE and
@@ -264,6 +487,20 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 7.x IS SLOW:
are encouraged to use these devs instead of (old) "/dev/dsp%d.%d".
This does not affect those who are using "/dev/dsp".
20061122:
geom(4)'s gmirror(8) class metadata structure has been
rev'd from v3 to v4. If you update across this point and
your metadata is converted for you, you will not be easily
able to downgrade since the /boot/kernel.old/geom_mirror.ko
kernel module will be unable to read the v4 metadata. You
can resolve this by doing from the loader(8) prompt:
set vfs.root.mountfrom="ufs:/dev/XXX"
where XXX is the root slice of one of the disks that composed
the mirror (i.e.: /dev/ad0s1a). You can then rebuild
the array the same way you built it originally.
20061122:
The following binaries have been disconnected from the build:
mount_devfs, mount_ext2fs, mount_fdescfs, mount_procfs, mount_linprocfs,
+2 -1
View File
@@ -37,7 +37,8 @@ SUBDIR= cat \
sleep \
stty \
sync \
test
test \
uuidgen
.if ${MK_RCMDS} != "no"
_rcp= rcp
+15 -1
View File
@@ -40,7 +40,7 @@
.Nd change file flags
.Sh SYNOPSIS
.Nm
.Op Fl h
.Op Fl fhv
.Oo
.Fl R
.Op Fl H | Fl L | Fl P
@@ -57,6 +57,12 @@ operand.
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl f
Do not display a diagnostic message if
.Nm
could not modify the flags for
.Va file ,
nor modify the exit status to reflect such failures.
.It Fl H
If the
.Fl R
@@ -79,6 +85,14 @@ This is the default.
.It Fl R
Change the file flags for the file hierarchies rooted
in the files instead of just the files themselves.
.It Fl v
Cause
.Nm
to be verbose, showing filenames as the flags are modified.
If the
.Fl v
option is specified more than once, the old and new flags of the file
will also be printed, in octal notation.
.El
.Pp
The flags are specified as an octal number or a comma separated list
+28 -16
View File
@@ -60,14 +60,15 @@ main(int argc, char *argv[])
{
FTS *ftsp;
FTSENT *p;
u_long clear, set;
u_long clear, newflags, set;
long val;
int Hflag, Lflag, Rflag, hflag, ch, fts_options, oct, rval;
int Hflag, Lflag, Rflag, fflag, hflag, vflag;
int ch, fts_options, oct, rval;
char *flags, *ep;
int (*change_flags)(const char *, unsigned long);
Hflag = Lflag = Rflag = hflag = 0;
while ((ch = getopt(argc, argv, "HLPRh")) != -1)
Hflag = Lflag = Rflag = fflag = hflag = vflag = 0;
while ((ch = getopt(argc, argv, "HLPRfhv")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
@@ -83,9 +84,15 @@ main(int argc, char *argv[])
case 'R':
Rflag = 1;
break;
case 'f':
fflag = 1;
break;
case 'h':
hflag = 1;
break;
case 'v':
vflag++;
break;
case '?':
default:
usage();
@@ -166,18 +173,23 @@ main(int argc, char *argv[])
default:
break;
}
if (oct) {
if (!(*change_flags)(p->fts_accpath, set))
continue;
} else {
p->fts_statp->st_flags |= set;
p->fts_statp->st_flags &= clear;
if (!(*change_flags)(p->fts_accpath,
(u_long)p->fts_statp->st_flags))
continue;
if (oct)
newflags = set;
else
newflags = (p->fts_statp->st_flags | set) & clear;
if (newflags == p->fts_statp->st_flags)
continue;
if ((*change_flags)(p->fts_accpath, newflags) && !fflag) {
warn("%s", p->fts_path);
rval = 1;
} else if (vflag) {
(void)printf("%s", p->fts_path);
if (vflag > 1)
(void)printf(": 0%lo -> 0%lo",
(u_long)p->fts_statp->st_flags,
newflags);
(void)printf("\n");
}
warn("%s", p->fts_path);
rval = 1;
}
if (errno)
err(1, "fts_read");
@@ -188,6 +200,6 @@ void
usage(void)
{
(void)fprintf(stderr,
"usage: chflags [-h] [-R [-H | -L | -P]] flags file ...\n");
"usage: chflags [-fhv] [-R [-H | -L | -P]] flags file ...\n");
exit(1);
}
+6 -4
View File
@@ -69,7 +69,7 @@ static const char *bits_to_string(ces_status_flags, const char *);
static void find_element(char *, uint16_t *, uint16_t *);
static struct changer_element_status *get_element_status
(unsigned int, unsigned int);
(unsigned int, unsigned int, int);
static int do_move(const char *, int, char **);
static int do_exchange(const char *, int, char **);
@@ -969,7 +969,8 @@ do_return(const char *cname, int argc, char **argv)
++argv; --argc;
/* Get the status */
ces = get_element_status((unsigned int)type, (unsigned int)element);
ces = get_element_status((unsigned int)type, (unsigned int)element,
CHET_VT == type);
if (NULL == ces)
errx(1, "%s: null element status pointer", cname);
@@ -1004,7 +1005,7 @@ usage:
* should free() it when done.
*/
static struct changer_element_status *
get_element_status(unsigned int type, unsigned int element)
get_element_status(unsigned int type, unsigned int element, int use_voltags)
{
struct changer_element_status_request cesr;
struct changer_element_status *ces;
@@ -1020,7 +1021,8 @@ get_element_status(unsigned int type, unsigned int element)
cesr.cesr_element_type = (uint16_t)type;
cesr.cesr_element_base = (uint16_t)element;
cesr.cesr_element_count = 1; /* Only this one element */
cesr.cesr_flags |= CESR_VOLTAGS; /* Grab voltags as well */
if (use_voltags)
cesr.cesr_flags |= CESR_VOLTAGS; /* Grab voltags as well */
cesr.cesr_element_status = ces;
if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) {
+6 -2
View File
@@ -45,7 +45,7 @@
.Op Fl H | Fl L | Fl P
.Oc
.Op Fl f | i | n
.Op Fl lpv
.Op Fl alpv
.Ar source_file target_file
.Nm
.Oo
@@ -53,7 +53,7 @@
.Op Fl H | Fl L | Fl P
.Oc
.Op Fl f | i | n
.Op Fl lpv
.Op Fl alpv
.Ar source_file ... target_directory
.Sh DESCRIPTION
In the first synopsis form, the
@@ -116,6 +116,10 @@ If you need to preserve hard links, consider using
or
.Xr pax 1
instead.
.It Fl a
Archive mode.
Same as
.Fl RpP .
.It Fl f
For each existing destination pathname, remove it and
create a new file, without prompting for confirmation
+7 -1
View File
@@ -102,7 +102,7 @@ main(int argc, char *argv[])
char *target;
Hflag = Lflag = Pflag = 0;
while ((ch = getopt(argc, argv, "HLPRfilnprv")) != -1)
while ((ch = getopt(argc, argv, "HLPRafilnprv")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
@@ -119,6 +119,12 @@ main(int argc, char *argv[])
case 'R':
Rflag = 1;
break;
case 'a':
Pflag = 1;
pflag = 1;
Rflag = 1;
Hflag = Lflag = 0;
break;
case 'f':
fflag = 1;
iflag = nflag = 0;
+33 -33
View File
@@ -137,41 +137,39 @@ copy_file(const FTSENT *entp, int dne)
* Mmap and write if less than 8M (the limit is so we don't totally
* trash memory on big files. This is really a minor hack, but it
* wins some CPU back.
* Some filesystems, such as smbnetfs, don't support mmap,
* so this is a best-effort attempt.
*/
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
if (S_ISREG(fs->st_mode) && fs->st_size > 0 &&
fs->st_size <= 8 * 1048576) {
if ((p = mmap(NULL, (size_t)fs->st_size, PROT_READ,
MAP_SHARED, from_fd, (off_t)0)) == MAP_FAILED) {
fs->st_size <= 8 * 1024 * 1024 &&
(p = mmap(NULL, (size_t)fs->st_size, PROT_READ,
MAP_SHARED, from_fd, (off_t)0)) != MAP_FAILED) {
wtotal = 0;
for (bufp = p, wresid = fs->st_size; ;
bufp += wcount, wresid -= (size_t)wcount) {
wcount = write(to_fd, bufp, wresid);
if (wcount <= 0)
break;
wtotal += wcount;
if (info) {
info = 0;
(void)fprintf(stderr,
"%s -> %s %3d%%\n",
entp->fts_path, to.p_path,
cp_pct(wtotal, fs->st_size));
}
if (wcount >= (ssize_t)wresid)
break;
}
if (wcount != (ssize_t)wresid) {
warn("%s", to.p_path);
rval = 1;
}
/* Some systems don't unmap on close(2). */
if (munmap(p, fs->st_size) < 0) {
warn("%s", entp->fts_path);
rval = 1;
} else {
wtotal = 0;
for (bufp = p, wresid = fs->st_size; ;
bufp += wcount, wresid -= (size_t)wcount) {
wcount = write(to_fd, bufp, wresid);
if (wcount <= 0)
break;
wtotal += wcount;
if (info) {
info = 0;
(void)fprintf(stderr,
"%s -> %s %3d%%\n",
entp->fts_path, to.p_path,
cp_pct(wtotal, fs->st_size));
}
if (wcount >= (ssize_t)wresid)
break;
}
if (wcount != (ssize_t)wresid) {
warn("%s", to.p_path);
rval = 1;
}
/* Some systems don't unmap on close(2). */
if (munmap(p, fs->st_size) < 0) {
warn("%s", entp->fts_path);
rval = 1;
}
}
} else
#endif
@@ -211,7 +209,6 @@ copy_file(const FTSENT *entp, int dne)
rval = 1;
}
}
(void)close(from_fd);
/*
* Don't remove the target even after an error. The target might
@@ -231,6 +228,9 @@ copy_file(const FTSENT *entp, int dne)
rval = 1;
}
}
(void)close(from_fd);
return (rval);
}
@@ -429,8 +429,8 @@ usage(void)
{
(void)fprintf(stderr, "%s\n%s\n",
"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-lpv] source_file target_file",
" cp [-R [-H | -L | -P]] [-f | -i | -n] [-lpv] source_file ... "
"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file target_file",
" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file ... "
"target_directory");
exit(EX_USAGE);
}
+6 -1
View File
@@ -32,7 +32,7 @@
.\" @(#)dd.1 8.2 (Berkeley) 1/13/94
.\" $FreeBSD$
.\"
.Dd August 15, 2004
.Dd January 23, 2009
.Dt DD 1
.Os
.Sh NAME
@@ -392,6 +392,11 @@ Remove parity bit from a file:
Check for (even) parity errors on a file:
.Pp
.Dl "dd if=file conv=pareven | cmp -x - file"
.Pp
To create an image of a Mode-1 CD-ROM, which is a commonly used format
for data CD-ROM disks, use a block size of 2048 bytes:
.Pp
.Dl "dd if=/dev/acd0 of=filename.iso bs=2048"
.Sh SEE ALSO
.Xr cp 1 ,
.Xr mt 1 ,
+23 -9
View File
@@ -32,20 +32,24 @@
.\" @(#)ln.1 8.2 (Berkeley) 12/30/93
.\" $FreeBSD$
.\"
.Dd February 14, 2006
.Dd June 6, 2008
.Dt LN 1
.Os
.Sh NAME
.Nm ln ,
.Nm link
.Nd make links
.Nd link files
.Sh SYNOPSIS
.Nm
.Op Fl Ffhinsv
.Op Fl s Op Fl F
.Op Fl f | iw
.Op Fl hnv
.Ar source_file
.Op Ar target_file
.Nm
.Op Fl Ffhinsv
.Op Fl s Op Fl F
.Op Fl f | iw
.Op Fl hnv
.Ar source_file ...
.Ar target_dir
.Nm link
@@ -53,8 +57,13 @@
.Sh DESCRIPTION
The
.Nm
utility creates a new directory entry (linked file) which has the
same modes as the original file.
utility creates a new directory entry (linked file) for the file name
specified by
.Ar target_file .
The
.Ar target_file
will be created with the same file modes as the
.Ar source_file .
It is useful for maintaining multiple copies of a file in many places
at once without using up storage for the
.Dq copies ;
@@ -75,6 +84,8 @@ then unlink it so that the link may occur.
.Fl f
option overrides any previous
.Fl i
and
.Fl w
options.)
.It Fl F
If the target file already exists and is a directory, then remove it
@@ -130,6 +141,8 @@ Create a symbolic link.
Cause
.Nm
to be verbose, showing files as they are processed.
.It Fl w
Warn if the source of a symbolic link does not currently exist.
.El
.Pp
By default,
@@ -140,7 +153,7 @@ links.
A hard link to a file is indistinguishable from the original directory entry;
any changes to a file are effectively independent of the name used to reference
the file.
Hard links may not normally refer to directories and may not span file systems.
Directories may not be hardlinked, and hard links may not span file systems.
.Pp
A symbolic link contains the name of the file to
which it is linked.
@@ -190,9 +203,10 @@ operation using the two passed arguments.
The
.Fl h ,
.Fl i ,
.Fl n
and
.Fl n ,
.Fl v
and
.Fl w
options are non-standard and their use in scripts is not recommended.
They are provided solely for compatibility with other
.Nm
+39 -4
View File
@@ -58,6 +58,8 @@ int hflag; /* Check new name for symlink first. */
int iflag; /* Interactive mode. */
int sflag; /* Symbolic, not hard, link. */
int vflag; /* Verbose output. */
int wflag; /* Warn if symlink target does not
* exist, and -f is not enabled. */
/* System link call. */
int (*linkf)(const char *, const char *);
char linkch;
@@ -92,7 +94,7 @@ main(int argc, char *argv[])
exit(linkit(argv[0], argv[1], 0));
}
while ((ch = getopt(argc, argv, "Ffhinsv")) != -1)
while ((ch = getopt(argc, argv, "Ffhinsvw")) != -1)
switch (ch) {
case 'F':
Fflag = 1;
@@ -100,6 +102,7 @@ main(int argc, char *argv[])
case 'f':
fflag = 1;
iflag = 0;
wflag = 0;
break;
case 'h':
case 'n':
@@ -115,6 +118,9 @@ main(int argc, char *argv[])
case 'v':
vflag = 1;
break;
case 'w':
wflag = 1;
break;
case '?':
default:
usage();
@@ -127,8 +133,10 @@ main(int argc, char *argv[])
linkch = sflag ? '-' : '=';
if (sflag == 0)
Fflag = 0;
if (Fflag == 1 && iflag == 0)
if (Fflag == 1 && iflag == 0) {
fflag = 1;
wflag = 0; /* Implied when fflag != 0 */
}
switch(argc) {
case 0:
@@ -167,6 +175,7 @@ linkit(const char *target, const char *source, int isdir)
const char *p;
int ch, exists, first;
char path[PATH_MAX];
char wbuf[PATH_MAX];
if (!sflag) {
/* If target doesn't exist, quit now. */
@@ -203,6 +212,32 @@ linkit(const char *target, const char *source, int isdir)
}
exists = !lstat(source, &sb);
/*
* If the link source doesn't exist, and a symbolic link was
* requested, and -w was specified, give a warning.
*/
if (sflag && wflag) {
if (*source == '/') {
/* Absolute link source. */
if (stat(source, &sb) != 0)
warn("warning: %s inaccessible", source);
} else {
/*
* Relative symlink source. Try to construct the
* absolute path of the source, by appending `source'
* to the parent directory of the target.
*/
p = strrchr(target, '/');
if (p != NULL)
p++;
else
p = target;
(void)snprintf(wbuf, sizeof(wbuf), "%.*s%s",
(int)(p - target), target, source);
if (stat(wbuf, &sb) != 0)
warn("warning: %s", source);
}
}
/*
* If the file exists, then unlink it forcibly if -f was specified
* and interactively if -i was specified.
@@ -254,8 +289,8 @@ void
usage(void)
{
(void)fprintf(stderr, "%s\n%s\n%s\n",
"usage: ln [-Ffhinsv] source_file [target_file]",
" ln [-Ffhinsv] source_file ... target_dir",
"usage: ln [-s [-F]] [-f | -i] [-hnv] source_file [target_file]",
" ln [-s [-F]] [-f | -i] [-hnv] source_file ... target_dir",
" link source_file target_file");
exit(1);
}
+1 -1
View File
@@ -32,7 +32,7 @@
.\" @(#)mv.1 8.1 (Berkeley) 5/31/93
.\" $FreeBSD$
.\"
.Dd July 9, 2002
.Dd May 12, 2007
.Dt MV 1
.Os
.Sh NAME
+59 -18
View File
@@ -65,6 +65,9 @@ __FBSDID("$FreeBSD$");
#include <sysexits.h>
#include <unistd.h>
/* Exit code for a failed exec. */
#define EXEC_FAILED 127
int fflg, iflg, nflg, vflg;
int copy(char *, char *);
@@ -198,6 +201,11 @@ do_move(char *from, char *to)
}
}
}
/*
* Rename on FreeBSD will fail with EISDIR and ENOTDIR, before failing
* with EXDEV. Therefore, copy() doesn't have to perform the checks
* specified in the Step 3 of the POSIX mv specification.
*/
if (!rename(from, to)) {
if (vflg)
printf("%s -> %s\n", from, to);
@@ -219,7 +227,7 @@ do_move(char *from, char *to)
if (!S_ISLNK(sb.st_mode)) {
/* Can't mv(1) a mount point. */
if (realpath(from, path) == NULL) {
warnx("cannot resolve %s: %s", from, path);
warn("cannot resolve %s: %s", from, path);
return (1);
}
if (!statfs(path, &sfs) &&
@@ -252,9 +260,9 @@ fastcopy(char *from, char *to, struct stat *sbp)
struct timeval tval[2];
static u_int blen;
static char *bp;
acl_t acl;
mode_t oldmode;
int nread, from_fd, to_fd;
acl_t acl;
if ((from_fd = open(from, O_RDONLY, 0)) < 0) {
warn("%s", from);
@@ -305,7 +313,7 @@ err: if (unlink(to))
}
/*
* POSIX 1003.2c states that if _POSIX_ACL_EXTENDED is in effect
* for dest_file, then it's ACLs shall reflect the ACLs of the
* for dest_file, then its ACLs shall reflect the ACLs of the
* source_file.
*/
if (fpathconf(to_fd, _PC_ACL_EXTENDED) == 1 &&
@@ -355,43 +363,76 @@ err: if (unlink(to))
int
copy(char *from, char *to)
{
struct stat sb;
int pid, status;
if ((pid = fork()) == 0) {
if (lstat(to, &sb) == 0) {
/* Destination path exists. */
if (S_ISDIR(sb.st_mode)) {
if (rmdir(to) != 0) {
warn("rmdir %s", to);
return (1);
}
} else {
if (unlink(to) != 0) {
warn("unlink %s", to);
return (1);
}
}
} else if (errno != ENOENT) {
warn("%s", to);
return (1);
}
/* Copy source to destination. */
if (!(pid = vfork())) {
execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", "--", from, to,
(char *)NULL);
warn("%s", _PATH_CP);
_exit(1);
_exit(EXEC_FAILED);
}
if (waitpid(pid, &status, 0) == -1) {
warn("%s: waitpid", _PATH_CP);
warn("%s %s %s: waitpid", _PATH_CP, from, to);
return (1);
}
if (!WIFEXITED(status)) {
warnx("%s: did not terminate normally", _PATH_CP);
warnx("%s %s %s: did not terminate normally",
_PATH_CP, from, to);
return (1);
}
if (WEXITSTATUS(status)) {
warnx("%s: terminated with %d (non-zero) status",
_PATH_CP, WEXITSTATUS(status));
switch (WEXITSTATUS(status)) {
case 0:
break;
case EXEC_FAILED:
warnx("%s %s %s: exec failed", _PATH_CP, from, to);
return (1);
default:
warnx("%s %s %s: terminated with %d (non-zero) status",
_PATH_CP, from, to, WEXITSTATUS(status));
return (1);
}
/* Delete the source. */
if (!(pid = vfork())) {
execl(_PATH_RM, "mv", "-rf", "--", from, (char *)NULL);
warn("%s", _PATH_RM);
_exit(1);
_exit(EXEC_FAILED);
}
if (waitpid(pid, &status, 0) == -1) {
warn("%s: waitpid", _PATH_RM);
warn("%s %s: waitpid", _PATH_RM, from);
return (1);
}
if (!WIFEXITED(status)) {
warnx("%s: did not terminate normally", _PATH_RM);
warnx("%s %s: did not terminate normally", _PATH_RM, from);
return (1);
}
if (WEXITSTATUS(status)) {
warnx("%s: terminated with %d (non-zero) status",
_PATH_RM, WEXITSTATUS(status));
switch (WEXITSTATUS(status)) {
case 0:
break;
case EXEC_FAILED:
warnx("%s %s: exec failed", _PATH_RM, from);
return (1);
default:
warnx("%s %s: terminated with %d (non-zero) status",
_PATH_RM, from, WEXITSTATUS(status));
return (1);
}
return (0);
+4 -36
View File
@@ -425,18 +425,10 @@ node_creat(ARCHD *arcn)
* we were able to create the node. set uid/gid, modes and times
*/
if (pids)
res = ((arcn->type == PAX_SLK) ?
set_lids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid) :
set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid));
res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid);
else
res = 0;
/*
* symlinks are done now.
*/
if (arcn->type == PAX_SLK)
return(0);
/*
* IMPORTANT SECURITY NOTE:
* if not preserving mode or we cannot set uid/gid, then PROHIBIT any
@@ -632,7 +624,7 @@ chk_path( char *name, uid_t st_uid, gid_t st_gid)
* used by -t to reset access times).
* When ign is zero, only those times the user has asked for are set, the
* other ones are left alone. We do not assume the un-documented feature
* of many utimes() implementations that consider a 0 time value as a do
* of many lutimes() implementations that consider a 0 time value as a do
* not set request.
*/
@@ -661,7 +653,7 @@ set_ftime(char *fnm, time_t mtime, time_t atime, int frc)
/*
* set the times
*/
if (utimes(fnm, tv) < 0)
if (lutimes(fnm, tv) < 0)
syswarn(1, errno, "Access/modification time set failed on: %s",
fnm);
return;
@@ -676,30 +668,6 @@ set_ftime(char *fnm, time_t mtime, time_t atime, int frc)
int
set_ids(char *fnm, uid_t uid, gid_t gid)
{
if (chown(fnm, uid, gid) < 0) {
/*
* ignore EPERM unless in verbose mode or being run by root.
* if running as pax, POSIX requires a warning.
*/
if (strcmp(NM_PAX, argv0) == 0 || errno != EPERM || vflag ||
geteuid() == 0)
syswarn(1, errno, "Unable to set file uid/gid of %s",
fnm);
return(-1);
}
return(0);
}
/*
* set_lids()
* set the uid and gid of a file system node
* Return:
* 0 when set, -1 on failure
*/
int
set_lids(char *fnm, uid_t uid, gid_t gid)
{
if (lchown(fnm, uid, gid) < 0) {
/*
@@ -724,7 +692,7 @@ void
set_pmode(char *fnm, mode_t mode)
{
mode &= ABITS;
if (chmod(fnm, mode) < 0)
if (lchmod(fnm, mode) < 0)
syswarn(1, errno, "Could not set permissions on %s", fnm);
return;
}
+23 -9
View File
@@ -74,6 +74,8 @@ __FBSDID("$FreeBSD$");
#include "ps.h"
#define _PATH_PTS "/dev/pts/"
#define W_SEP " \t" /* "Whitespace" list separators */
#define T_SEP "," /* "Terminate-element" list separators */
@@ -705,9 +707,9 @@ addelem_pid(struct listinfo *inf, const char *elem)
/*-
* The user can specify a device via one of three formats:
* 1) fully qualified, e.g.: /dev/ttyp0 /dev/console
* 2) missing "/dev", e.g.: ttyp0 console
* 3) two-letters, e.g.: p0 co
* 1) fully qualified, e.g.: /dev/ttyp0 /dev/console /dev/pts/0
* 2) missing "/dev", e.g.: ttyp0 console pts/0
* 3) two-letters, e.g.: p0 co 0
* (matching letters that would be seen in the "TT" column)
*/
static int
@@ -715,10 +717,11 @@ addelem_tty(struct listinfo *inf, const char *elem)
{
const char *ttypath;
struct stat sb;
char pathbuf[PATH_MAX], pathbuf2[PATH_MAX];
char pathbuf[PATH_MAX], pathbuf2[PATH_MAX], pathbuf3[PATH_MAX];
ttypath = NULL;
pathbuf2[0] = '\0';
pathbuf3[0] = '\0';
switch (*elem) {
case '/':
ttypath = elem;
@@ -735,6 +738,8 @@ addelem_tty(struct listinfo *inf, const char *elem)
ttypath = pathbuf;
if (strncmp(pathbuf, _PATH_TTY, strlen(_PATH_TTY)) == 0)
break;
if (strncmp(pathbuf, _PATH_PTS, strlen(_PATH_PTS)) == 0)
break;
if (strcmp(pathbuf, _PATH_CONSOLE) == 0)
break;
/* Check to see if /dev/tty${elem} exists */
@@ -745,21 +750,30 @@ addelem_tty(struct listinfo *inf, const char *elem)
ttypath = NULL;
break;
}
/* Check to see if /dev/pts/${elem} exists */
strlcpy(pathbuf3, _PATH_PTS, sizeof(pathbuf3));
strlcat(pathbuf3, elem, sizeof(pathbuf3));
if (stat(pathbuf3, &sb) == 0 && S_ISCHR(sb.st_mode)) {
/* No need to repeat stat() && S_ISCHR() checks */
ttypath = NULL;
break;
}
break;
}
if (ttypath) {
if (stat(ttypath, &sb) == -1) {
if (pathbuf2[0] != '\0')
warn("%s and %s", pathbuf2, ttypath);
if (pathbuf3[0] != '\0')
warn("%s, %s, and %s", pathbuf3, pathbuf2,
ttypath);
else
warn("%s", ttypath);
optfatal = 1;
return (0);
}
if (!S_ISCHR(sb.st_mode)) {
if (pathbuf2[0] != '\0')
warnx("%s and %s: Not a terminal", pathbuf2,
ttypath);
if (pathbuf3[0] != '\0')
warnx("%s, %s, and %s: Not a terminal",
pathbuf3, pathbuf2, ttypath);
else
warnx("%s: Not a terminal", ttypath);
optfatal = 1;
+8
View File
@@ -41,7 +41,9 @@
.Nd return resolved physical path
.Sh SYNOPSIS
.Nm
.Op Fl q
.Ar path
.Op Ar ...
.Sh DESCRIPTION
The
.Nm
@@ -55,6 +57,12 @@ and
.Pa /../
in
.Ar path .
.Pp
If
.Fl q
is specified, warnings will not be printed when
.Xr realpath 3
fails.
.Sh EXIT STATUS
.Ex -std
.Sh SEE ALSO
+26 -7
View File
@@ -44,20 +44,39 @@ main(int argc, char *argv[])
{
char buf[PATH_MAX];
char *p;
int ch, i, qflag, rval;
if (argc == 2) {
if ((p = realpath(argv[1], buf)) == NULL)
err(1, "%s", buf);
} else
qflag = 0;
while ((ch = getopt(argc, argv, "q")) != -1) {
switch (ch) {
case 'q':
qflag = 1;
break;
case '?':
default:
usage();
}
}
argc -= optind;
argv += optind;
if (argc < 1)
usage();
(void)printf("%s\n", p);
exit(0);
rval = 0;
for (i = 0; i < argc; i++) {
if ((p = realpath(argv[i], buf)) == NULL) {
if (!qflag)
warn("%s", argv[i]);
rval = 1;
} else
(void)printf("%s\n", p);
}
exit(rval);
}
static void
usage(void)
{
(void)fprintf(stderr, "usage: realpath path\n");
(void)fprintf(stderr, "usage: realpath [-q] path [...]\n");
exit(1);
}
+5 -1
View File
@@ -30,8 +30,12 @@
* $FreeBSD$
*/
#include "shell.h"
#define DIGITS(var) (3 + (2 + CHAR_BIT * sizeof((var))) / 3)
extern char *arith_buf, *arith_startbuf;
int arith(char *);
arith_t arith(char *);
void arith_lex_reset(void);
int expcmd(int, char **);
+13 -9
View File
@@ -75,7 +75,10 @@ __FBSDID("$FreeBSD$");
exp:
expr
{ return ($1); }
{
*YYPARSE_PARAM = $1;
return (0);
}
;
expr:
@@ -259,12 +262,13 @@ expr:
#include "output.h"
#include "memalloc.h"
#define lstrlen(var) (3 + (2 + CHAR_BIT * sizeof((var))) / 3)
#define YYPARSE_PARAM_TYPE arith_t *
#define YYPARSE_PARAM result
char *arith_buf, *arith_startbuf;
int yylex(void);
int yyparse(void);
int yyparse(YYPARSE_PARAM_TYPE);
static int
arith_assign(char *name, arith_t value)
@@ -272,22 +276,22 @@ arith_assign(char *name, arith_t value)
char *str;
int ret;
str = (char *)ckmalloc(lstrlen(value));
str = (char *)ckmalloc(DIGITS(value));
sprintf(str, ARITH_FORMAT_STR, value);
ret = setvarsafe(name, str, 0);
free(str);
return ret;
}
int
arith_t
arith(char *s)
{
long result;
arith_t result;
arith_buf = arith_startbuf = s;
INTOFF;
result = yyparse();
yyparse(&result);
arith_lex_reset(); /* Reprime lex. */
INTON;
@@ -313,7 +317,7 @@ expcmd(int argc, char **argv)
char *p;
char *concat;
char **ap;
long i;
arith_t i;
if (argc > 1) {
p = argv[1];
@@ -338,7 +342,7 @@ expcmd(int argc, char **argv)
i = arith(p);
out1fmt("%ld\n", i);
out1fmt(ARITH_FORMAT_STR "\n", i);
return !i;
}
+45 -38
View File
@@ -68,7 +68,9 @@ STATIC int cdlogical(char *);
STATIC int cdphysical(char *);
STATIC int docd(char *, int, int);
STATIC char *getcomponent(void);
STATIC int updatepwd(char *);
STATIC char *findcwd(char *);
STATIC void updatepwd(char *);
STATIC char *getpwd2(char *, size_t);
STATIC char *curdir = NULL; /* current working directory */
STATIC char *prevdir; /* previous working directory */
@@ -201,10 +203,11 @@ cdlogical(char *dest)
}
INTOFF;
if (updatepwd(badstat ? NULL : dest) < 0 || chdir(curdir) < 0) {
if ((p = findcwd(badstat ? NULL : dest)) == NULL || chdir(p) < 0) {
INTON;
return (-1);
}
updatepwd(p);
INTON;
return (0);
}
@@ -212,12 +215,14 @@ cdlogical(char *dest)
STATIC int
cdphysical(char *dest)
{
char *p;
INTOFF;
if (chdir(dest) < 0 || updatepwd(NULL) < 0) {
if (chdir(dest) < 0 || (p = findcwd(NULL)) == NULL) {
INTON;
return (-1);
}
updatepwd(p);
INTON;
return (0);
}
@@ -247,38 +252,20 @@ getcomponent(void)
}
/*
* Update curdir (the name of the current directory) in response to a
* cd command. We also call hashcd to let the routines in exec.c know
* that the current directory has changed.
*/
STATIC int
updatepwd(char *dir)
STATIC char *
findcwd(char *dir)
{
char *new;
char *p;
hashcd(); /* update command hash table */
/*
* If our argument is NULL, we don't know the current directory
* any more because we traversed a symbolic link or something
* we couldn't stat().
*/
if (dir == NULL || curdir == NULL) {
if (prevdir)
ckfree(prevdir);
INTOFF;
prevdir = curdir;
curdir = NULL;
if (getpwd() == NULL) {
INTON;
return (-1);
}
setvar("PWD", curdir, VEXPORT);
setvar("OLDPWD", prevdir, VEXPORT);
INTON;
return (0);
p = stalloc(PATH_MAX);
return getpwd2(p, PATH_MAX);
}
cdcomppath = stalloc(strlen(dir) + 1);
scopy(dir, cdcomppath);
@@ -302,16 +289,25 @@ updatepwd(char *dir)
if (new == stackblock())
STPUTC('/', new);
STACKSTRNUL(new);
INTOFF;
return stackblock();
}
/*
* Update curdir (the name of the current directory) in response to a
* cd command. We also call hashcd to let the routines in exec.c know
* that the current directory has changed.
*/
STATIC void
updatepwd(char *dir)
{
hashcd(); /* update command hash table */
if (prevdir)
ckfree(prevdir);
prevdir = curdir;
curdir = savestr(stackblock());
curdir = savestr(dir);
setvar("PWD", curdir, VEXPORT);
setvar("OLDPWD", prevdir, VEXPORT);
INTON;
return (0);
}
int
@@ -355,17 +351,31 @@ pwdcmd(int argc, char **argv)
}
/*
* Find out what the current directory is. If we already know the current
* directory, this routine returns immediately.
* Get the current directory and cache the result in curdir.
*/
char *
getpwd(void)
{
char buf[PATH_MAX];
char *p;
if (curdir)
return curdir;
if (getcwd(buf, sizeof(buf)) == NULL) {
p = getpwd2(buf, sizeof(buf));
if (p != NULL)
curdir = savestr(p);
return curdir;
}
/*
* Return the current directory.
*/
STATIC char *
getpwd2(char *buf, size_t size)
{
if (getcwd(buf, size) == NULL) {
char *pwd = getenv("PWD");
struct stat stdot, stpwd;
@@ -373,12 +383,9 @@ getpwd(void)
stat(pwd, &stpwd) != -1 &&
stdot.st_dev == stpwd.st_dev &&
stdot.st_ino == stpwd.st_ino) {
curdir = savestr(pwd);
return curdir;
return pwd;
}
return NULL;
}
curdir = savestr(buf);
return curdir;
return buf;
}
+1 -1
View File
@@ -437,7 +437,7 @@ expredir(union node *n)
case NFROMFD:
case NTOFD:
if (redir->ndup.vname) {
expandarg(redir->ndup.vname, &fn, EXP_FULL | EXP_TILDE);
expandarg(redir->ndup.vname, &fn, EXP_TILDE | EXP_REDIR);
fixredir(redir, fn.list->text, 1);
}
break;
+11 -7
View File
@@ -356,7 +356,7 @@ void
expari(int flag)
{
char *p, *start;
int result;
arith_t result;
int begoff;
int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR);
int quoted;
@@ -372,10 +372,7 @@ expari(int flag)
* have to rescan starting from the beginning since CTLESC
* characters have to be processed left to right.
*/
#if INT_MAX / 1000000000 >= 10 || INT_MIN / 1000000000 <= -10
#error "integers with more than 10 digits are not supported"
#endif
CHECKSTRSPACE(12 - 2, expdest);
CHECKSTRSPACE(DIGITS(result) - 2, expdest);
USTPUTC('\0', expdest);
start = stackblock();
p = expdest - 2;
@@ -397,7 +394,7 @@ expari(int flag)
if (quotes)
rmescapes(p+2);
result = arith(p+2);
fmtstr(p, 12, "%d", result);
fmtstr(p, DIGITS(result), ARITH_FORMAT_STR, result);
while (*p++)
;
if (quoted == 0)
@@ -641,7 +638,13 @@ evalvar(char *p, int flag)
special = 1;
p = strchr(p, '=') + 1;
again: /* jump here after setting a variable with ${var=text} */
if (special) {
if (varflags & VSLINENO) {
set = 1;
special = 0;
val = var;
p[-1] = '\0'; /* temporarily overwrite '=' to have \0
terminated string */
} else if (special) {
set = varisset(var, varflags & VSNUL);
val = NULL;
} else {
@@ -771,6 +774,7 @@ record:
default:
abort();
}
p[-1] = '='; /* recover overwritten '=' */
if (subtype != VSNORMAL) { /* skip to end of alternative */
int nesting = 1;
+1
View File
@@ -147,6 +147,7 @@ readcmd(int argc __unused, char **argv __unused)
if (tcgetattr(0, &told) == 0) {
memcpy(&tnew, &told, sizeof(told));
cfmakeraw(&tnew);
tnew.c_iflag |= told.c_iflag & ICRNL;
tcsetattr(0, TCSANOW, &tnew);
tsaved = 1;
}
+2 -2
View File
@@ -338,6 +338,7 @@ setparam(char **argv)
shellparam.malloc = 1;
shellparam.nparam = nparam;
shellparam.p = newparam;
shellparam.reset = 1;
shellparam.optnext = NULL;
}
@@ -383,7 +384,7 @@ shiftcmd(int argc, char **argv)
}
ap2 = shellparam.p;
while ((*ap2++ = *ap1++) != NULL);
shellparam.optnext = NULL;
shellparam.reset = 1;
INTON;
return 0;
}
@@ -414,7 +415,6 @@ void
getoptsreset(const char *value)
{
if (number(value) == 1) {
shellparam.optnext = NULL;
shellparam.reset = 1;
}
}
+25 -3
View File
@@ -94,6 +94,7 @@ STATIC union node *redirnode;
STATIC struct heredoc *heredoc;
STATIC int quoteflag; /* set if (part of) last token was quoted */
STATIC int startlinno; /* line # where last token started */
STATIC int funclinno; /* line # where the current function started */
/* XXX When 'noaliases' is set to one, no alias expansion takes place. */
static int noaliases = 0;
@@ -567,12 +568,14 @@ simplecmd(union node **rpp, union node *redir)
/* We have a function */
if (readtoken() != TRP)
synexpect(TRP);
funclinno = plinno;
#ifdef notdef
if (! goodname(n->narg.text))
synerror("Bad function name");
#endif
n->type = NDEFUN;
n->narg.next = command();
funclinno = 0;
goto checkneg;
} else {
tokpushback++;
@@ -1176,12 +1179,16 @@ parseredir: {
*/
parsesub: {
char buf[10];
int subtype;
int typeloc;
int flags;
char *p;
static const char types[] = "}-+?=";
int bracketed_name = 0; /* used to handle ${[0-9]*} variables */
int bracketed_name = 0; /* used to handle ${[0-9]*} variables */
int i;
int linno;
int length;
c = pgetc();
if (c != '(' && c != '{' && (is_eof(c) || !is_name(c)) &&
@@ -1200,6 +1207,7 @@ parsesub: {
typeloc = out - stackblock();
USTPUTC(VSNORMAL, out);
subtype = VSNORMAL;
flags = 0;
if (c == '{') {
bracketed_name = 1;
c = pgetc();
@@ -1213,10 +1221,25 @@ parsesub: {
subtype = 0;
}
if (!is_eof(c) && is_name(c)) {
length = 0;
do {
STPUTC(c, out);
c = pgetc();
length++;
} while (!is_eof(c) && is_in_name(c));
if (length == 6 &&
strncmp(out - length, "LINENO", length) == 0) {
/* Replace the variable name with the
* current line number. */
linno = plinno;
if (funclinno != 0)
linno -= funclinno - 1;
snprintf(buf, sizeof(buf), "%d", linno);
STADJUST(-6, out);
for (i = 0; buf[i] != '\0'; i++)
STPUTC(buf[i], out);
flags |= VSLINENO;
}
} else if (is_digit(c)) {
if (bracketed_name) {
do {
@@ -1239,11 +1262,10 @@ parsesub: {
c = pgetc();
}
}
flags = 0;
if (subtype == 0) {
switch (c) {
case ':':
flags = VSNUL;
flags |= VSNUL;
c = pgetc();
/*FALLTHROUGH*/
default:
+5 -3
View File
@@ -45,9 +45,11 @@
#define CTLQUOTEMARK '\210'
/* variable substitution byte (follows CTLVAR) */
#define VSTYPE 0x0f /* type of variable substitution */
#define VSNUL 0x10 /* colon--treat the empty string as unset */
#define VSQUOTE 0x80 /* inside double quotes--suppress splitting */
#define VSTYPE 0x0f /* type of variable substitution */
#define VSNUL 0x10 /* colon--treat the empty string as unset */
#define VSLINENO 0x20 /* expansion of $LINENO, the line number \
follows immediately */
#define VSQUOTE 0x80 /* inside double quotes--suppress splitting */
/* values of VSTYPE field */
#define VSNORMAL 0x1 /* normal variable: $var or ${var} */
+382 -275
View File
File diff suppressed because it is too large. Load diff
+11 -4
View File
@@ -33,6 +33,11 @@
* $FreeBSD$
*/
#ifndef SHELL_H_
#define SHELL_H_
#include <inttypes.h>
/*
* The follow should be set to reflect the type of system you have:
* JOBS -> 1 if you have Berkeley job control, 0 otherwise.
@@ -50,10 +55,10 @@
/*
* Type of used arithmetics. SUSv3 requires us to have at least signed long.
*/
typedef long arith_t;
#define ARITH_FORMAT_STR "%ld"
#define atoarith_t(arg) strtol(arg, NULL, 0)
#define strtoarith_t(nptr, endptr, base) strtol(nptr, endptr, base)
typedef intmax_t arith_t;
#define ARITH_FORMAT_STR "%" PRIdMAX
#define atoarith_t(arg) strtoimax(arg, NULL, 0)
#define strtoarith_t(nptr, endptr, base) strtoimax(nptr, endptr, base)
typedef void *pointer;
#define STATIC static
@@ -68,3 +73,5 @@ extern char nullstr[1]; /* null string */
#else
#define TRACE(param)
#endif
#endif /* !SHELL_H_ */
+1 -1
View File
@@ -310,7 +310,7 @@ are evaluated consistently according to the rules specified in the
standards document.
All other cases are subject to the ambiguity in the
command semantics.
.Sh RETURN VALUES
.Sh EXIT STATUS
The
.Nm
utility exits with one of the following values:
-2
View File
@@ -1,7 +1,5 @@
# $FreeBSD$
BINDIR= /bin
PROG= uuidgen
WARNS?= 6
+6 -1
View File
@@ -1,3 +1,8 @@
# $FreeBSD$
CFLAGS+= -D_SOLARIS_C_SOURCE
OPENSOLARIS_USR_DISTDIR= ${.CURDIR}/../../../cddl/contrib/opensolaris
OPENSOLARIS_SYS_DISTDIR= ${.CURDIR}/../../../sys/cddl/contrib/opensolaris
IGNORE_PRAGMA= YES
CFLAGS+= -DNEED_SOLARIS_BOOLEAN
+35
View File
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2007 John Birrell <jb@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*
*/
#ifndef _COMPAT_OPENSOLARIS_ALLOCA_H_
#define _COMPAT_OPENSOLARIS_ALLOCA_H_
#include <stdlib.h>
#endif
+2
View File
@@ -18,6 +18,8 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* $FreeBSD$
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+37
View File
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2008 John Birrell <jb@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*
*/
#ifndef _COMPAT_OPENSOLARIS_DTRACE_H_
#define _COMPAT_OPENSOLARIS_DTRACE_H_
#define ps_prochandle proc_handle
#include_next <dtrace.h>
#endif
+37
View File
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2007 John Birrell <jb@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*
*/
#ifndef _COMPAT_OPENSOLARIS_FCNTL_H_
#define _COMPAT_OPENSOLARIS_FCNTL_H_
#include_next <fcntl.h>
#define open64 open
#endif
@@ -1,3 +1,5 @@
/* $FreeBSD$ */
#ifndef _LIBINTL_H_
#define _LIBINTL_H_
+46
View File
@@ -0,0 +1,46 @@
/*
* Copyright (C) 2008 John Birrell <jb@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*
*/
#ifndef _COMPAT_OPENSOLARIS_LIBPROC_H_
#define _COMPAT_OPENSOLARIS_LIBPROC_H_
#include <fcntl.h>
#define ps_prochandle proc_handle
#define Lmid_t int
#define PR_RLC 0x0001
#define PR_KLC 0x0002
#define PGRAB_RDONLY O_RDONLY
#define PGRAB_FORCE 0
#include_next <libproc.h>
#endif
+2
View File
@@ -1,3 +1,5 @@
/* $FreeBSD$ */
#ifndef _OPENSOLARIS_MNTTAB_H_
#define _OPENSOLARIS_MNTTAB_H_
+2
View File
@@ -1,3 +1,5 @@
/* $FreeBSD$ */
#ifndef _OPENSOLARIS_PRIV_H_
#define _OPENSOLARIS_PRIV_H_
@@ -1,3 +1,5 @@
/* $FreeBSD$ */
#ifndef _SOLARIS_H_
#define _SOLARIS_H_
+39
View File
@@ -0,0 +1,39 @@
/*
* Copyright (C) 2007 John Birrell <jb@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*
*/
#ifndef _COMPAT_OPENSOLARIS_STDIO_H_
#define _COMPAT_OPENSOLARIS_STDIO_H_
#include_next <stdio.h>
#define ftello64 ftello
#define lseek64 lseek
#define fseeko64 fseeko
#endif
+37
View File
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2007 John Birrell <jb@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*
*/
#ifndef _COMPAT_OPENSOLARIS_STDLIB_H_
#define _COMPAT_OPENSOLARIS_STDLIB_H_
#include_next <stdlib.h>
#define getexecname getprogname
#endif
+37
View File
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2007 John Birrell <jb@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*
*/
#ifndef _COMPAT_OPENSOLARIS_STRINGS_H_
#define _COMPAT_OPENSOLARIS_STRINGS_H_
#include_next <strings.h>
#include <string.h>
#endif
+39
View File
@@ -0,0 +1,39 @@
/*
* Copyright (C) 2007 John Birrell <jb@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*
*/
#ifndef _COMPAT_OPENSOLARIS_UNISTD_H_
#define _COMPAT_OPENSOLARIS_UNISTD_H_
#include_next <unistd.h>
#define fork1 fork
#define ftruncate64 ftruncate
#define pread64 pread
#endif
+2
View File
@@ -1,3 +1,5 @@
/* $FreeBSD$ */
#ifndef _ZONE_H_
#define _ZONE_H_
@@ -17,6 +17,8 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* $FreeBSD$
*/
/*
* Copyright 2006 Ricardo Correia. All rights reserved.
@@ -18,6 +18,8 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* $FreeBSD$
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+2
View File
@@ -18,6 +18,8 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* $FreeBSD$
*/
/* Copyright (c) 1988 AT&T */
@@ -0,0 +1,670 @@
'\" te
.\" CDDL HEADER START
.\"
.\" The contents of this file are subject to the terms of the
.\" Common Development and Distribution License (the "License").
.\" You may not use this file except in compliance with the License.
.\"
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
.\" or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions
.\" and limitations under the License.
.\"
.\" When distributing Covered Code, include this CDDL HEADER in each
.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
.\" If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying
.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
.\" CDDL HEADER END
.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
.TH dtrace 1M "5 Sep 2006" "SunOS 5.11" "System Administration Commands"
.SH NAME
dtrace \- DTrace dynamic tracing compiler and tracing utility
.SH SYNOPSIS
.LP
.nf
\fBdtrace\fR [\fB-32\fR | \fB-64\fR] [\fB-aACeFGHhlqSvVwZ\fR] [\fB-b\fR \fIbufsz\fR] [\fB-c\fR \fIcmd\fR]
[\fB-D\fR \fIname\fR [\fI=value\fR]] [\fB-I\fR \fIpath\fR] [\fB-L\fR \fIpath\fR] [\fB-o\fR \fIoutput\fR]
[\fB-s\fR \fIscript\fR] [\fB-U\fR \fIname\fR] [\fB-x\fR \fIarg\fR [\fI=val\fR]]
[\fB-X\fR a | c | s | t] [\fB-p\fR \fIpid\fR]
[\fB-P\fR \fIprovider\fR [[\fIpredicate\fR] \fIaction\fR]]
[\fB-m\fR [\fIprovider:\fR] \fImodule\fR [[\fIpredicate\fR] \fIaction\fR]]
[\fB-f\fR [[\fIprovider:\fR] \fImodule:\fR] \fIfunction\fR [[\fIpredicate\fR] \fIaction\fR]]
[\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]]
[\fB-i\fR \fIprobe-id\fR [[\fIpredicate\fR] \fIaction\fR]]
.fi
.SH DESCRIPTION
.sp
.LP
DTrace is a comprehensive dynamic tracing framework for the Solaris Operating System. DTrace provides a powerful infrastructure that permits administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs.
.sp
.LP
The \fISolaris Dynamic Tracing Guide\fR describes how to use DTrace to observe, debug, and tune system behavior. Refer to this book for a detailed description of DTrace features, including the bundled DTrace observability
tools, instrumentation providers, and the D programming language.
.sp
.LP
The \fBdtrace\fR command provides a generic interface to the essential services provided by the DTrace facility, including:
.RS +4
.TP
.ie t \(bu
.el o
Options that list the set of probes and providers currently published by DTrace
.RE
.RS +4
.TP
.ie t \(bu
.el o
Options that enable probes directly using any of the probe description specifiers (provider, module, function, name)
.RE
.RS +4
.TP
.ie t \(bu
.el o
Options that run the D compiler and compile one or more D program files or programs written directly on the command line
.RE
.RS +4
.TP
.ie t \(bu
.el o
Options that generate anonymous tracing programs
.RE
.RS +4
.TP
.ie t \(bu
.el o
Options that generate program stability reports
.RE
.RS +4
.TP
.ie t \(bu
.el o
Options that modify DTrace tracing and buffering behavior and enable additional D compiler features
.RE
.sp
.LP
You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR declaration to create an interpreter file. You can also use \fBdtrace\fR to attempt to compile D programs and determine their properties without actually enabling tracing using the \fB-e\fR option. See \fBOPTIONS\fR. See the \fISolaris Dynamic Tracing Guide\fR for detailed examples of how to use the \fBdtrace\fR utility to perform these tasks.
.SH OPTIONS
.sp
.LP
The arguments accepted by the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, and \fB-i\fR options can include an optional D language \fIpredicate\fR enclosed in slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed in braces \fB{}\fR. D program code specified on the command line must be appropriately quoted to avoid intepretation of meta-characters by the shell.
.sp
.LP
The following options are supported:
.sp
.ne 2
.mk
.na
\fB\fB-32\fR | \fB-64\fR\fR
.ad
.sp .6
.RS 4n
The D compiler produces programs using the native data model of the operating system kernel. You can use the \fBisainfo\fR \fB-b\fR command to determine the current operating system data model. If the \fB-32\fR option is specified, \fBdtrace\fR forces
the D compiler to compile a D program using the 32-bit data model. If the \fB-64\fR option is specified, \fBdtrace\fR forces the D compiler to compile a D program using the 64-bit data model. These options are typically not required as \fBdtrace\fR selects the
native data model as the default. The data model affects the sizes of integer types and other language properties. D programs compiled for either data model can be executed on both 32-bit and 64-bit kernels. The \fB-32\fR and \fB-64\fR options also determine the ELF file format
(ELF32 or ELF64) produced by the \fB-G\fR option.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-a\fR\fR
.ad
.sp .6
.RS 4n
Claim anonymous tracing state and display the traced data. You can combine the \fB-a\fR option with the \fB-e\fR option to force \fBdtrace\fR to exit immediately after consuming the anonymous tracing state rather than continuing to wait for new
data. See the \fISolaris Dynamic Tracing Guide\fR for more information about anonymous tracing.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-A\fR\fR
.ad
.sp .6
.RS 4n
Generate \fBdriver.conf\fR(4) directives for anonymous tracing. This option constructs a set of \fBdtrace\fR(7D) configuration file directives to enable the specified probes for anonymous tracing and then exits. By default, \fBdtrace\fR attempts to store the directives to the file \fB/kernel/drv/dtrace.conf\fR. You can modify this behavior if you use the \fB-o\fR option to specify an alternate output file.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-b\fR \fIbufsz\fR\fR
.ad
.sp .6
.RS 4n
Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the buffer space cannot be allocated, \fBdtrace\fR attempts
to reduce the buffer size or exit depending on the setting of the \fBbufresize\fR property.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-c\fR \fIcmd\fR\fR
.ad
.sp .6
.RS 4n
Run the specified command \fIcmd\fR and exit upon its completion. If more than one \fB-c\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each child process as it
terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information
on macro variables.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-C\fR\fR
.ad
.sp .6
.RS 4n
Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB-D\fR, \fB-U\fR, \fB-I\fR, and \fB-H\fR options. You can select the degree of C standard conformance if you use the \fB-X\fR option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB-X\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-D\fR \fIname\fR \fB[=\fR\fIvalue\fR\fB]\fR\fR
.ad
.sp .6
.RS 4n
Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). If you specify the equals sign (\fB=\fR)
and additional \fIvalue\fR, the name is assigned the corresponding value. This option passes the \fB-D\fR option to each \fBcpp\fR invocation.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-e\fR\fR
.ad
.sp .6
.RS 4n
Exit after compiling any requests and consuming anonymous tracing state (\fB-a\fR option) but prior to enabling any probes. You can combine this option with the \fB-a\fR option to print anonymous tracing data and exit. You can also combine this option with D
compiler options. This combination verifies that the programs compile without actually executing them and enabling the corresponding instrumentation.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR
.ad
.sp .6
.RS 4n
Specify function name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR.
Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fR are specified in the description, all probes with the corresponding \fIfunction\fR are matched.
The \fB-f\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB-f\fR option on the command line at a time.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-F\fR\fR
.ad
.sp .6
.RS 4n
Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with \fB->\fR. Function return probe reports are unindented and their output is prefixed with \fB<-\fR\&. System call
entry probe reports are indented and their output is prefixed with \fB=>\fR. System call return probe reports are unindented and their output is prefixed with \fB<=\fR\&.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-G\fR\fR
.ad
.sp .6
.RS 4n
Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB-o\fR option is present, the ELF file is saved using the pathname specified
as the argument for this operand. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name \fB\fIfilename\fR.o\fR.
Otherwise the ELF file is saved using the name \fBd.out\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-H\fR\fR
.ad
.sp .6
.RS 4n
Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-H\fR option
to each \fBcpp\fR invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-h\fR\fR
.ad
.sp .6
.RS 4n
Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB-G\fR option. If the \fB-o\fR option
is present, the header file is saved using the pathname specified as the argument for that option. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fIfilename\fR\fB\&.d\fR, then the header file is saved
using the name \fIfilename\fR\fB\&.h\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-i\fR \fIprobe-id\fR\fB[[\fR\fIpredicate\fR] \fIaction\fR\fB]\fR\fR
.ad
.sp .6
.RS 4n
Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB-l\fR option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fR \fB-l\fR. The \fB-i\fR argument can be suffixed with an optional
D probe clause. You can specify more than one \fB-i\fR option at a time.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-I\fR \fIpath\fR\fR
.ad
.sp .6
.RS 4n
Add the specified directory \fIpath\fR to the search path for \fB#include\fR files when invoking \fBcpp\fR(1) (enabled
using the \fB-C\fR option). This option passes the \fB-I\fR option to each \fBcpp\fR invocation. The specified \fIpath\fR is inserted into the search path ahead of the default directory list.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-L\fR \fIpath\fR\fR
.ad
.sp .6
.RS 4n
Add the specified directory \fIpath\fR to the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specified \fIpath\fR is added after the default library
search path.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-l\fR\fR
.ad
.sp .6
.RS 4n
List probes instead of enabling them. If the \fB-l\fR option is specified, \fBdtrace\fR produces a report of the probes matching the descriptions given using the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, \fB-i\fR,
and \fB-s\fR options. If none of these options are specified, this option lists all probes.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR] \fIaction\fR]]\fR
.ad
.sp .6
.RS 4n
Specify module name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module\fR or \fImodule\fR. Unspecified probe description fields are left blank and match
any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fR are specified in the description, all probes with a corresponding \fImodule\fR are matched. The \fB-m\fR argument can be suffixed with an optional D
probe clause. More than one \fB-m\fR option can be specified on the command line at a time.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]\fR
.ad
.sp .6
.RS 4n
Specify probe name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fR, \fImodule:function:name\fR, \fIfunction:name\fR,
or \fIname\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fR are specified in the description, all probes with a corresponding \fIname\fR are
matched. The \fB-n\fR argument can be suffixed with an optional D probe clause. More than one \fB-n\fR option can be specified on the command line at a time.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-o\fR \fIoutput\fR\fR
.ad
.sp .6
.RS 4n
Specify the \fIoutput\fR file for the \fB-A\fR , \fB-G\fR, and \fB-l\fR options, or for the traced data itself. If the \fB-A\fR option is present and \fB-o\fR is not present, the default output file is \fB/kernel/drv/dtrace.conf\fR. If the \fB-G\fR option is present and the \fB-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB-o\fR is not present, the default output file is \fB\fIfilename\fR.o\fR.
Otherwise the default output file is \fBd.out\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-p\fR \fIpid\fR\fR
.ad
.sp .6
.RS 4n
Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon its completion. If more than one \fB-p\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status
for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for
more information on macro variables.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-P\fR \fIprovider\fR \fB[[\fR\fIpredicate\fR\fB]\fR \fIaction\fR]\fR
.ad
.sp .6
.RS 4n
Specify provider name to trace or list (\fB-l\fR option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB-P\fR argument can be suffixed with an optional D
probe clause. You can specify more than one \fB-P\fR option on the command line at a time.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-q\fR\fR
.ad
.sp .6
.RS 4n
Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes matched by the specified options and D programs and does not print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program
statements such as \fBtrace()\fR and \fBprintf()\fR is displayed to \fBstdout\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-s\fR\fR
.ad
.sp .6
.RS 4n
Compile the specified D program source file. If the \fB-e\fR option is present, the program is compiled but instrumentation is not enabled. If the \fB-l\fR option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation
is not enabled. If none of \fB-e\fR, \fB-l\fR, \fB-G\fR, or \fB-A\fR are present, the instrumentation specified by the D program is enabled and tracing begins.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-S\fR\fR
.ad
.sp .6
.RS 4n
Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to \fBstderr\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-U\fR \fIname\fR\fR
.ad
.sp .6
.RS 4n
Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR invocation.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-v\fR\fR
.ad
.sp .6
.RS 4n
Set verbose mode. If the \fB-v\fR option is specified, \fBdtrace\fR produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fISolaris Dynamic Tracing Guide\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-V\fR\fR
.ad
.sp .6
.RS 4n
Report the highest D programming interface version supported by \fBdtrace\fR. The version information is printed to \fBstdout\fR and the \fBdtrace\fR command exits. Refer to the \fISolaris Dynamic Tracing Guide\fR for
more information about DTrace versioning features.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-w\fR\fR
.ad
.sp .6
.RS 4n
Permit destructive actions in D programs specified using the \fB-s\fR, \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options. If the \fB-w\fR option is not specified, \fBdtrace\fR does not
permit the compilation or enabling of a D program that contains destructive actions.
.RE
.sp
.ne 2
.mk
.na
\fB\fB-x\fR \fIarg\fR [\fI=val\fR]\fR
.ad
.sp .6
.RS 4n
Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fISolaris Dynamic Tracing Guide\fR. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and
value with an equals sign (\fB=\fR).
.RE
.sp
.ne 2
.mk
.na
\fB\fB-X\fR \fBa | c | s | t\fR\fR
.ad
.sp .6
.RS 4n
Specify the degree of conformance to the ISO C standard that should be selected when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option).
The \fB-X\fR option argument affects the value and presence of the \fB__STDC__\fR macro depending upon the value of the argument letter.
.sp
The \fB-X\fR option supports the following arguments:
.sp
.ne 2
.mk
.na
\fB\fBa\fR\fR
.ad
.RS 5n
.rt
Default. ISO C plus K&R compatibility extensions, with semantic changes required by ISO C. This is the default mode if \fB-X\fR is not specified. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction
with the \fB-Xa\fR option.
.RE
.sp
.ne 2
.mk
.na
\fB\fBc\fR\fR
.ad
.RS 5n
.rt
Conformance. Strictly conformant ISO C, without K&R C compatibility extensions. The predefined macro \fB__STDC__\fR has a value of 1 when \fBcpp\fR is invoked in conjunction with the \fB-Xc\fR option.
.RE
.sp
.ne 2
.mk
.na
\fB\fBs\fR\fR
.ad
.RS 5n
.rt
K&R C only. The macro \fB__STDC__\fR is not defined when \fBcpp\fR is invoked in conjunction with the \fB-Xs\fR option.
.RE
.sp
.ne 2
.mk
.na
\fB\fBt\fR\fR
.ad
.RS 5n
.rt
Transition. ISO C plus K&R C compatibility extensions, without semantic changes required by ISO C. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction with the \fB-Xt\fR option.
.RE
As the \fB-X\fR option only affects how the D compiler invokes the C preprocessor, the \fB-Xa\fR and \fB-Xt\fR options are equivalent from the perspective of D and both are provided only to ease re-use of settings from a C build environment.
.sp
Regardless of the \fB-X\fR mode, the following additional C preprocessor definitions are always specified and valid in all modes:
.RS +4
.TP
.ie t \(bu
.el o
\fB__sun\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB__unix\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB__SVR4\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB__sparc\fR (on SPARC systems only)
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB__sparcv9\fR (on SPARC systems only when 64-bit programs are compiled)
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB__i386\fR (on x86 systems only when 32-bit programs are compiled)
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB__amd64\fR (on x86 systems only when 64-bit programs are compiled)
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB__\fI`uname -s`\fR_\fI`uname -r`\fR\fR (for example, \fB__SunOS_5_10\fR)
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB__SUNW_D=1\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB__SUNW_D_VERSION=0x\fIMMmmmuuu\fR\fR
.sp
Where \fIMM\fR is the major release value in hexadecimal, \fImmm\fR is the minor release value in hexadecimal, and \fIuuu\fR is the
micro release value in hexadecimal. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information about DTrace versioning.
.RE
.RE
.sp
.ne 2
.mk
.na
\fB\fB-Z\fR\fR
.ad
.sp .6
.RS 4n
Permit probe descriptions that match zero probes. If the \fB-Z\fR option is not specified, \fBdtrace\fR reports an error and exits if any probe descriptions specified in D program files (\fB-s\fR option) or on the command line (\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options) contain descriptions that do not match any known probes.
.RE
.SH OPERANDS
.sp
.LP
You can specify zero or more additional arguments on the \fBdtrace\fR command line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The additional arguments can be used in D programs specified using the \fB-s\fR option
or on the command line. The use of macro variables is described further in the \fISolaris Dynamic Tracing Guide\fR.
.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.mk
.na
\fB0\fR
.ad
.RS 5n
.rt
Successful completion.
.sp
For D program requests, an exit status of \fB0\fR indicates that programs were successfully compiled, probes were successfully enabled, or anonymous state was successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified tracing requests
encountered errors or drops.
.RE
.sp
.ne 2
.mk
.na
\fB\fB1\fR\fR
.ad
.RS 5n
.rt
An error occurred.
.sp
For D program requests, an exit status of \fB1\fR indicates that program compilation failed or that the specified request could not be satisfied.
.RE
.sp
.ne 2
.mk
.na
\fB\fB2\fR\fR
.ad
.RS 5n
.rt
Invalid command line options or arguments were specified.
.RE
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i)
lw(2.75i) |lw(2.75i)
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
AvailabilitySUNWdtrc
_
Interface StabilitySee below.
.TE
.sp
.LP
The command-line syntax is Committed. The human-readable output is Uncommitted.
.SH SEE ALSO
.sp
.LP
\fBcpp\fR(1), \fBisainfo\fR(1), \fBlibdtrace\fR(3LIB), \fBdriver.conf\fR(4), \fBattributes\fR(5), \fBdtrace\fR(7D)
.sp
.LP
\fISolaris Dynamic Tracing Guide\fR
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,32 @@
CDDL HEADER START
The contents of this file are subject to the terms of the
Common Development and Distribution License (the "License").
You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
or http://www.opensolaris.org/os/licensing.
See the License for the specific language governing permissions
and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each
file and include the License file at usr/src/OPENSOLARIS.LICENSE.
If applicable, add the following below this CDDL HEADER, with the
fields enclosed by brackets "[]" replaced with your own identifying
information: Portions Copyright [yyyy] [name of copyright owner]
CDDL HEADER END
Copyright 2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
ident "%Z%%M% %I% %E% SMI"
DTrace Testing Suite
The SUNWdtrt package delivers a set of test programs and D source
files into the directory /opt/SUNWdtrt. For more information see
the following web site:
http://www.opensolaris.org/os/community/dtrace/dtest
@@ -0,0 +1,209 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/varargs.h>
#include <errno.h>
#include <math.h>
#include <dtrace.h>
void
fatal(char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "%s: ", "baddof");
vfprintf(stderr, fmt, ap);
if (fmt[strlen(fmt) - 1] != '\n')
fprintf(stderr, ": %s\n", strerror(errno));
exit(1);
}
#define LEAP_DISTANCE 20
void
corrupt(int fd, unsigned char *buf, int len)
{
static int ttl, valid;
int bit, i;
unsigned char saved;
int val[LEAP_DISTANCE], pos[LEAP_DISTANCE];
int new, rv;
again:
printf("valid DOF #%d\n", valid++);
/*
* We are going iterate through, flipping one bit and attempting
* to enable.
*/
for (bit = 0; bit < len * 8; bit++) {
saved = buf[bit / 8];
buf[bit / 8] ^= (1 << (bit % 8));
if ((bit % 100) == 0)
printf("%d\n", bit);
if ((rv = ioctl(fd, DTRACEIOC_ENABLE, buf)) == -1) {
/*
* That failed -- restore the bit and drive on.
*/
buf[bit / 8] = saved;
continue;
}
/*
* That worked -- and it may have enabled probes. To keep
* enabled probes down to a reasonable level, we'll close
* and reopen pseudodevice if we have more than 10,000
* probes enabled.
*/
ttl += rv;
if (ttl < 10000) {
buf[bit / 8] = saved;
continue;
}
printf("enabled %d probes; resetting device.\n", ttl);
close(fd);
new = open("/devices/pseudo/dtrace@0:dtrace", O_RDWR);
if (new == -1)
fatal("couldn't open DTrace pseudo device");
if (new != fd) {
dup2(new, fd);
close(new);
}
ttl = 0;
buf[bit / 8] = saved;
}
for (;;) {
/*
* Now we want to get as many bits away as possible. We flip
* bits randomly -- getting as far away as we can until we don't
* seem to be making any progress.
*/
for (i = 0; i < LEAP_DISTANCE; i++) {
/*
* Pick a random bit and corrupt it.
*/
bit = lrand48() % (len * 8);
val[i] = buf[bit / 8];
pos[i] = bit / 8;
buf[bit / 8] ^= (1 << (bit % 8));
}
/*
* Let's see if that managed to get us valid DOF...
*/
if ((rv = ioctl(fd, DTRACEIOC_ENABLE, buf)) > 0) {
/*
* Success! This will be our new base for valid DOF.
*/
ttl += rv;
goto again;
}
/*
* No luck -- we'll restore those bits and try flipping a
* different set. Note that this must be done in reverse
* order...
*/
for (i = LEAP_DISTANCE - 1; i >= 0; i--)
buf[pos[i]] = val[i];
}
}
int
main(int argc, char **argv)
{
char *filename = argv[1];
dtrace_hdl_t *dtp;
dtrace_prog_t *pgp;
int err, fd, len;
FILE *fp;
unsigned char *dof, *copy;
if (argc < 1)
fatal("expected D script as argument\n");
if ((fp = fopen(filename, "r")) == NULL)
fatal("couldn't open %s", filename);
/*
* First, we need to compile our provided D into DOF.
*/
if ((dtp = dtrace_open(DTRACE_VERSION, 0, &err)) == NULL) {
fatal("cannot open dtrace library: %s\n",
dtrace_errmsg(NULL, err));
}
pgp = dtrace_program_fcompile(dtp, fp, 0, 0, NULL);
fclose(fp);
if (pgp == NULL) {
fatal("failed to compile script %s: %s\n", filename,
dtrace_errmsg(dtp, dtrace_errno(dtp)));
}
dof = dtrace_dof_create(dtp, pgp, 0);
len = ((dof_hdr_t *)dof)->dofh_loadsz;
if ((copy = malloc(len)) == NULL)
fatal("could not allocate copy of %d bytes", len);
for (;;) {
bcopy(dof, copy, len);
/*
* Open another instance of the dtrace device.
*/
fd = open("/devices/pseudo/dtrace@0:dtrace", O_RDWR);
if (fd == -1)
fatal("couldn't open DTrace pseudo device");
corrupt(fd, copy, len);
close(fd);
}
/* NOTREACHED */
return (0);
}
@@ -0,0 +1,145 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/varargs.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include <unistd.h>
#define DTRACEIOC (('d' << 24) | ('t' << 16) | ('r' << 8))
#define DTRACEIOC_MAX 17
void
fatal(char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "%s: ", "badioctl");
vfprintf(stderr, fmt, ap);
if (fmt[strlen(fmt) - 1] != '\n')
fprintf(stderr, ": %s\n", strerror(errno));
exit(1);
}
void
badioctl(pid_t parent)
{
int fd = -1, random, ps = sysconf(_SC_PAGESIZE);
int i = 0, seconds;
caddr_t addr;
hrtime_t now, last = 0, end;
if ((random = open("/dev/random", O_RDONLY)) == -1)
fatal("couldn't open /dev/random");
if ((addr = mmap(0, ps, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE, -1, 0)) == (caddr_t)-1)
fatal("mmap");
for (;;) {
unsigned int ioc;
if ((now = gethrtime()) - last > NANOSEC) {
if (kill(parent, 0) == -1 && errno == ESRCH) {
/*
* Our parent died. We will kill ourselves in
* sympathy.
*/
exit(0);
}
/*
* Once a second, we'll reopen the device.
*/
if (fd != -1)
close(fd);
fd = open("/devices/pseudo/dtrace@0:dtrace", O_RDONLY);
if (fd == -1)
fatal("couldn't open DTrace pseudo device");
last = now;
}
if ((i++ % 1000) == 0) {
/*
* Every thousand iterations, change our random gunk.
*/
read(random, addr, ps);
}
read(random, &ioc, sizeof (ioc));
ioc %= DTRACEIOC_MAX;
ioc++;
ioctl(fd, DTRACEIOC | ioc, addr);
}
}
int
main()
{
pid_t child, parent = getpid();
int status;
for (;;) {
if ((child = fork()) == 0)
badioctl(parent);
while (waitpid(child, &status, WEXITED) != child)
continue;
if (WIFEXITED(status)) {
/*
* Our child exited by design -- we'll exit with
* the same status code.
*/
exit(WEXITSTATUS(status));
}
/*
* Our child died on a signal. Respawn it.
*/
printf("badioctl: child died on signal %d; respawning.\n",
WTERMSIG(status));
fflush(stdout);
}
/* NOTREACHED */
return (0);
}
@@ -0,0 +1,148 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <strings.h>
#include <unistd.h>
#include <dtrace.h>
static int g_count;
static int g_errs;
static int g_fd;
static int g_verbose;
static int g_errexit;
static int
probe(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp, void *data)
{
dtrace_probeinfo_t p;
dtrace_argdesc_t arg;
char buf[BUFSIZ];
int i;
(void) printf("\r%6d", ++g_count);
(void) fflush(stdout);
if (dtrace_probe_info(dtp, pdp, &p) != 0) {
(void) printf(" failed to get probe info for "
"%s:%s:%s:%s [%d]\n", pdp->dtpd_provider, pdp->dtpd_mod,
pdp->dtpd_func, pdp->dtpd_name, pdp->dtpd_id);
g_errs++;
return (0);
}
for (i = 0; i < p.dtp_argc; i++) {
if (p.dtp_argv[i].dtt_type == CTF_ERR) {
bzero(&arg, sizeof (dtrace_argdesc_t));
arg.dtargd_id = pdp->dtpd_id;
arg.dtargd_ndx = i;
(void) ioctl(g_fd, DTRACEIOC_PROBEARG, &arg);
(void) printf(" failed to get types for args[%d] "
"of %s:%s:%s:%s [%d]: <%s> -> <%s>\n", i,
pdp->dtpd_provider, pdp->dtpd_mod, pdp->dtpd_func,
pdp->dtpd_name, pdp->dtpd_id,
arg.dtargd_native, arg.dtargd_xlate);
g_errs++;
if (g_errexit)
return (-1);
} else if (g_verbose) {
(void) printf("%d args[%d] : %s\n", pdp->dtpd_id, i,
ctf_type_name(p.dtp_argv[i].dtt_ctfp,
p.dtp_argv[i].dtt_type, buf, sizeof (buf)));
}
}
return (0);
}
int
main(int argc, char *argv[])
{
dtrace_probedesc_t pd, *pdp = NULL;
dtrace_hdl_t *dtp;
int err, c;
char *p;
if ((dtp = dtrace_open(DTRACE_VERSION, 0, &err)) == NULL) {
(void) fprintf(stderr, "%s: failed to open dtrace: %s\n",
argv[0], dtrace_errmsg(dtp, err));
return (1);
}
while ((c = getopt(argc, argv, "evx:")) != -1) {
switch (c) {
case 'e':
g_errexit++;
break;
case 'v':
g_verbose++;
break;
case 'x':
if ((p = strchr(optarg, '=')) != NULL)
*p++ = '\0';
if (dtrace_setopt(dtp, optarg, p) != 0) {
(void) fprintf(stderr, "%s: failed to set "
"option -x %s: %s\n", argv[0], optarg,
dtrace_errmsg(dtp, dtrace_errno(dtp)));
return (2);
}
break;
default:
(void) fprintf(stderr, "Usage: %s [-ev] "
"[-x opt[=arg]] [probedesc]\n", argv[0]);
return (2);
}
}
argv += optind;
argc -= optind;
if (argc > 0) {
if (dtrace_str2desc(dtp, DTRACE_PROBESPEC_NAME, argv[1], &pd)) {
(void) fprintf(stderr, "%s: invalid probe description "
"%s: %s\n", argv[0], argv[1],
dtrace_errmsg(dtp, dtrace_errno(dtp)));
return (2);
}
pdp = &pd;
}
g_fd = dtrace_ctlfd(dtp);
(void) dtrace_probe_iter(dtp, pdp, probe, NULL);
dtrace_close(dtp);
(void) printf("\nTotal probes: %d\n", g_count);
(void) printf("Total errors: %d\n\n", g_errs);
return (g_errs != 0);
}
@@ -0,0 +1,453 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* ident "%Z%%M% %I% %E% SMI"
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
import java.io.StringWriter;
import java.io.PrintWriter;
/**
* A Java port of Solaris {@code lib/libc/port/gen/getopt.c}, which is a
* port of System V UNIX getopt. See <b>getopt(3C)</b> and SUS/XPG
* getopt() for function definition and requirements. Unlike that
* definition, this implementation moves non-options to the end of the
* argv array rather than quitting at the first non-option.
*/
public class Getopt {
static final int EOF = -1;
private String progname;
private String[] args;
private int argc;
private String optstring;
private int optind = 0; // args index
private int optopt = 0;
private String optarg = null;
private boolean opterr = true;
/*
* _sp is required to keep state between successive calls to
* getopt() while extracting aggregated short-options (ie: -abcd).
*/
private int _sp = 1;
/**
* Creates a {Code Getopt} instance to parse the given command-line
* arguments. Modifies the given args array by swapping the
* positions of non-options and options so that non-options appear
* at the end of the array.
*/
public Getopt(String programName, String[] args,
String optionString)
{
progname = programName;
// No defensive copy; Getopt is expected to modify the given
// args array
this.args = args;
argc = this.args.length;
optstring = optionString;
validate();
}
private void
validate()
{
if (progname == null) {
throw new NullPointerException("program name is null");
}
int i = 0;
for (String s : args) {
if (s == null) {
throw new NullPointerException("null arg at index " + i);
}
++i;
}
if (optstring == null) {
throw new NullPointerException("option string is null");
}
}
private static class StringRef {
private String s;
public String
get()
{
return s;
}
public StringRef
set(String value)
{
s = value;
return this;
}
}
/*
* Generalized error processing method. If the optstr parameter is
* null, the character c is converted to a string and displayed
* instead.
*/
void
err(String format, char c, String optstr)
{
if (opterr && optstring.charAt(0) != ':') {
StringWriter w = new StringWriter();
PrintWriter p = new PrintWriter(w);
p.printf(format, progname, (optstr == null ?
Character.toString(c) : optstr.substring(2)));
System.err.println(w.toString());
}
}
/*
* Determine if the specified character (c) is present in the string
* (optstring) as a regular, single character option. If the option
* is found, return an index into optstring where the short-option
* character is found, otherwise return -1. The characters ':' and
* '(' are not allowed.
*/
static int
parseshort(String optstring, char c)
{
if (c == ':' || c == '(') {
return -1;
}
int ch;
int len = optstring.length();
for (int i = 0; i < len; ++i) {
ch = optstring.charAt(i);
if (ch == c) {
return i;
}
while (i < len && ch == '(') {
for (++i; i < len && (ch = optstring.charAt(i)) != ')'; ++i);
}
}
return -1;
}
/**
* Determine if the specified string (opt) is present in the string
* (optstring) as a long-option contained within parenthesis. If the
* long-option specifies option-argument, return a reference to it
* in longoptarg. Otherwise set the longoptarg reference to null.
* If the option is found, return an index into optstring at the
* position of the short-option character associated with the
* long-option; otherwise return -1.
*
* @param optstring the entire optstring passed to the {@code
* Getopt} constructor
* @param opt the long option read from the command line
* @param longoptarg the value of the option is returned in this
* parameter, if an option exists. Possible return values in
* longoptarg are:
* <ul>
* <li><b>NULL:</b> No argument was found</li>
* <li><b>empty string (""):</b> Argument was explicitly left empty
* by the user (e.g., --option= )</li>
* <li><b>valid string:</b> Argument found on the command line</li>
* </ul>
* @return index to equivalent short-option in optstring, or -1 if
* option not found in optstring.
*/
static int
parselong(String optstring, String opt, StringRef longoptarg)
{
int cp; // index into optstring, beginning of one option spec
int ip; // index into optstring, traverses every char
char ic; // optstring char
int il; // optstring length
int op; // index into opt
char oc; // opt char
int ol; // opt length
boolean match; // true if opt is matching part of optstring
longoptarg.set(null);
cp = ip = 0;
il = optstring.length();
ol = opt.length();
do {
ic = optstring.charAt(ip);
if (ic != '(' && ++ip == il)
break;
ic = optstring.charAt(ip);
if (ic == ':' && ++ip == il)
break;
ic = optstring.charAt(ip);
while (ic == '(') {
if (++ip == il)
break;
op = 0;
match = true;
while (ip < il && (ic = optstring.charAt(ip)) != ')' &&
op < ol) {
oc = opt.charAt(op++);
match = (ic == oc && match);
++ip;
}
if (match && ip < il && ic == ')' && (op >= ol ||
opt.charAt(op) == '=')) {
if (op < ol && opt.charAt(op) == '=') {
/* may be an empty string - OK */
longoptarg.set(opt.substring(op + 1));
} else {
longoptarg.set(null);
}
return cp;
}
if (ip < il && ic == ')' && ++ip == il)
break;
ic = optstring.charAt(ip);
}
cp = ip;
/*
* Handle double-colon in optstring ("a::(longa)") The old
* getopt() accepts it and treats it as a required argument.
*/
while ((cp > 0) && (cp < il) && (optstring.charAt(cp) == ':')) {
--cp;
}
} while (cp < il);
return -1;
}
/**
* Get the current option value.
*/
public String
getOptarg()
{
return optarg;
}
/**
* Get the index of the next option to be parsed.
*/
public int
getOptind()
{
return optind;
}
/**
* Gets the command-line arguments.
*/
public String[]
getArgv()
{
// No defensive copy: Getopt is expected to modify the given
// args array.
return args;
}
/**
* Gets the aggregated short option that just failed. Since long
* options can't be aggregated, a failed long option can be obtained
* by {@code getArgv()[getOptind() - 1]}.
*/
public int
getOptopt()
{
return optopt;
}
/**
* Set to {@code false} to suppress diagnostic messages to stderr.
*/
public void
setOpterr(boolean err)
{
opterr = err;
}
/**
* Gets the next option character, or -1 if there are no more
* options. If getopt() encounters a short-option character or a
* long-option string not described in the {@code optionString}
* argument to the constructor, it returns the question-mark (?)
* character. If it detects a missing option-argument, it also
* returns the question-mark (?) character, unless the first
* character of the {@code optionString} argument was a colon (:),
* in which case getopt() returns the colon (:) character.
* <p>
* This implementation swaps the positions of options and
* non-options in the given argv array.
*/
public int
getopt()
{
char c;
int cp;
boolean longopt;
StringRef longoptarg = new StringRef();
/*
* Has the end of the options been encountered? The following
* implements the SUS requirements:
*
* If, when getopt() is called:
* - the first character of argv[optind] is not '-'
* - argv[optind] is the string "-"
* getopt() returns -1 without changing optind if
* - argv[optind] is the string "--"
* getopt() returns -1 after incrementing optind
*/
if (_sp == 1) {
boolean nonOption;
do {
nonOption = false;
if (optind >= argc || args[optind].equals("-")) {
return EOF;
} else if (args[optind].equals("--")) {
++optind;
return EOF;
} else if (args[optind].charAt(0) != '-') {
// non-option: here we deviate from the SUS requirements
// by not quitting, and instead move non-options to the
// end of the args array
nonOption = true;
String tmp = args[optind];
if (optind + 1 < args.length) {
System.arraycopy(args, optind + 1, args, optind,
args.length - (optind + 1));
args[args.length - 1] = tmp;
}
--argc;
}
} while (nonOption);
}
/*
* Getting this far indicates that an option has been encountered.
* Note that the syntax of optstring applies special meanings to
* the characters ':' and '(', so they are not permissible as
* option letters. A special meaning is also applied to the ')'
* character, but its meaning can be determined from context.
* Note that the specification only requires that the alnum
* characters be accepted.
*
* If the second character of the argument is a '-' this must be
* a long-option, otherwise it must be a short option. Scan for
* the option in optstring by the appropriate algorithm. Either
* scan will return an index to the short-option character in
* optstring if the option is found and -1 otherwise.
*
* For an unrecognized long-option, optopt will equal 0, but
* since long-options can't aggregate the failing option can be
* identified by argv[optind-1].
*/
optopt = c = args[optind].charAt(_sp);
optarg = null;
longopt = (_sp == 1 && c == '-');
if (!(longopt
? ((cp = parselong(optstring, args[optind].substring(2),
longoptarg)) != -1)
: ((cp = parseshort(optstring, c)) != -1))) {
err("%s: illegal option -- %s", c,
(longopt ? args[optind] : null));
/*
* Note: When the long option is unrecognized, optopt will
* be '-' here, which matches the specification.
*/
if (args[optind].length() == ++_sp || longopt) {
++optind;
_sp = 1;
}
return '?';
}
optopt = c = optstring.charAt(cp);
/*
* A valid option has been identified. If it should have an
* option-argument, process that now. SUS defines the setting
* of optarg as follows:
*
* 1. If the option was the last character in an element of
* argv, then optarg contains the next element of argv, and
* optind is incremented by 2. If the resulting value of
* optind is not less than argc, this indicates a missing
* option-argument, and getopt() returns an error indication.
*
* 2. Otherwise, optarg points to the string following the
* option character in that element of argv, and optind is
* incremented by 1.
*
* The second clause allows -abcd (where b requires an
* option-argument) to be interpreted as "-a -b cd".
*
* Note that the option-argument can legally be an empty string,
* such as:
* command --option= operand
* which explicitly sets the value of --option to nil
*/
if (cp + 1 < optstring.length() && optstring.charAt(cp + 1) == ':') {
// The option takes an argument
if (!longopt && ((_sp + 1) < args[optind].length())) {
optarg = args[optind++].substring(_sp + 1);
} else if (longopt && (longoptarg.get() != null)) {
/*
* The option argument was explicitly set to the empty
* string on the command line (--option=)
*/
optind++;
optarg = longoptarg.get();
} else if (++optind >= argc) {
err("%s: option requires an argument -- %s", c,
(longopt ? args[optind - 1] : null));
_sp = 1;
optarg = null;
return (optstring.charAt(0) == ':' ? ':' : '?');
} else
optarg = args[optind++];
_sp = 1;
} else {
// The option does NOT take an argument
if (longopt && (longoptarg.get() != null)) {
// User supplied an arg to an option that takes none
err("%s: option doesn't take an argument -- %s", (char)0,
(longopt ? args[optind] : null));
optarg = longoptarg.set(null).get();
c = '?';
}
if (longopt || args[optind].length() == ++_sp) {
_sp = 1;
++optind;
}
optarg = null;
}
return (c);
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,77 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
# Exception list: names tests that are bypassed when running in Java
# mode (relative to /opt/SUNWdtrt/tst)
# double precision (64-bit floating point) not same in java
common/aggs/tst.neglquant.d
common/aggs/tst.negquant.d
# freopen() (to suppress output) not supported by Java DTrace API
common/printa/tst.walltimestamp.ksh
# -G option not supported by jdtrace
common/dtraceUtil/tst.ELFGenerationOut.d.ksh
common/dtraceUtil/tst.ELFGenerationWithO.d.ksh
# -H option not supported by jdtrace
common/dtraceUtil/tst.PreprocessorStatement.d.ksh
# -G and -h options not supported by jdtrace
common/usdt/tst.badguess.ksh
common/usdt/tst.dlclose1.ksh
common/usdt/tst.dlclose2.ksh
common/usdt/tst.dlclose3.ksh
common/usdt/tst.eliminate.ksh
common/usdt/tst.enabled.ksh
common/usdt/tst.enabled2.ksh
common/usdt/tst.entryreturn.ksh
common/usdt/tst.fork.ksh
common/usdt/tst.header.ksh
common/usdt/tst.guess32.ksh
common/usdt/tst.guess64.ksh
common/usdt/tst.linkpriv.ksh
common/usdt/tst.linkunpriv.ksh
common/usdt/tst.multiple.ksh
common/usdt/tst.nodtrace.ksh
common/usdt/tst.onlyenabled.ksh
common/usdt/tst.reeval.ksh
common/usdt/tst.static.ksh
common/usdt/tst.static2.ksh
common/usdt/tst.user.ksh
sparc/usdt/tst.tailcall.ksh
common/pid/tst.provregex3.ksh
common/pid/tst.provregex4.ksh
# freopen() and ftruncate() not supported by Java DTrace API
common/funcs/tst.badfreopen.ksh
common/funcs/tst.freopen.ksh
common/funcs/tst.ftruncate.ksh
# jdtrace doesn't pull in library files?
common/pragma/tst.libdepfullyconnected.ksh
@@ -0,0 +1,60 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <alloca.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/systeminfo.h>
int
main(int argc, char **argv)
{
int i, ac, has64;
char **av, **p;
ac = argc + 3;
av = p = alloca(sizeof (char *) * ac);
*p++ = "java";
*p++ = "-jar";
*p++ = "/opt/SUNWdtrt/lib/java/jdtrace.jar";
argc--;
argv++;
for (i = 0; i < argc; i++) {
p[i] = argv[i];
}
p[i] = NULL;
(void) execvp(av[0], av);
perror("exec failed");
return (0);
}
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: JDTrace
Class-Path: /usr/share/lib/java/dtrace.jar
@@ -0,0 +1,236 @@
#!/usr/local/bin/perl
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#pragma ident "%Z%%M% %I% %E% SMI"
require 5.6.1;
$PNAME = $0;
$PNAME =~ s:.*/::;
$USAGE = "Usage: $PNAME [file ...]\n";
$errs = 0;
sub err
{
my($msg) = @_;
print "$file: $lineno: $msg\n";
$errs++;
}
sub dstyle
{
open(FILE, "$file");
$lineno = 0;
$inclause = 0;
$skipnext = 0;
while (<FILE>) {
$lineno++;
chop;
if ($skipnext) {
$skipnext = 0;
next;
}
#
# Amazingly, some ident strings are longer than 80 characters!
#
if (/^#pragma ident/) {
next;
}
#
# The algorithm to calculate line length from cstyle.
#
$line = $_;
if ($line =~ tr/\t/\t/ * 7 + length($line) > 80) {
# yes, there is a chance.
# replace tabs with spaces and check again.
$eline = $line;
1 while $eline =~
s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
if (length($eline) > 80) {
err "line > 80 characters";
}
}
if (/\/\*DSTYLED\*\//) {
$skipnext = 1;
next;
}
if (/^#pragma/) {
next;
}
if (/^#include/) {
next;
}
#
# Before we do any more analysis, we want to prune out any
# quoted strings. This is a bit tricky because we need
# to be careful of backslashed quotes within quoted strings.
# I'm sure there is a very crafty way to do this with a
# single regular expression, but that will have to wait for
# somone with better regex juju that I; we do this by first
# eliminating the backslashed quotes, and then eliminating
# whatever quoted strings are left. Note that we eliminate
# the string by replacing it with "quotedstr"; this is to
# allow lines to end with a quoted string. (If we simply
# eliminated the quoted string, dstyle might complain about
# the line ending in a space or tab.)
#
s/\\\"//g;
s/\"[^\"]*\"/quotedstr/g;
if (/[ \t]$/) {
err "space or tab at end of line";
}
if (/^[\t]+[ ]+[\t]+/) {
err "spaces between tabs";
}
if (/^[\t]* \*/) {
next;
}
if (/^ /) {
err "indented by spaces not tabs";
}
if (/^{}$/) {
next;
}
if (!/^enum/ && !/^\t*struct/ && !/^\t*union/ && !/^typedef/ &&
!/^translator/ && !/^provider/) {
if (/[\w\s]+{/) {
err "left brace not on its own line";
}
if (/{[\w\s]+/) {
err "left brace not on its own line";
}
}
if (!/;$/) {
if (/[\w\s]+}/) {
err "right brace not on its own line";
}
if (/}[\w\s]+/) {
err "right brace not on its own line";
}
}
if (/^}/) {
$inclause = 0;
}
if (!$inclause && /^[\w ]+\//) {
err "predicate not at beginning of line";
}
if (!$inclause && /^\/[ \t]+\w/) {
err "space between '/' and expression in predicate";
}
if (!$inclause && /\w[ \t]+\/$/) {
err "space between expression and '/' in predicate";
}
if (!$inclause && /\s,/) {
err "space before comma in probe description";
}
if (!$inclause && /\w,[\w\s]/ && !/;$/) {
if (!/extern/ && !/\(/ && !/inline/) {
err "multiple probe descriptions on same line";
}
}
if ($inclause && /sizeof\(/) {
err "missing space after sizeof";
}
if ($inclause && /^[\w ]/) {
err "line doesn't begin with a tab";
}
if ($inclause && /,[\w]/) {
err "comma without trailing space";
}
if (/\w&&/ || /&&\w/ || /\w\|\|/ || /\|\|\w/) {
err "logical operator not set off with spaces";
}
#
# We want to catch "i<0" variants, but we don't want to
# erroneously flag translators.
#
if (!/\w<\w+>\(/) {
if (/\w>/ || / >\w/ || /\w</ || /<\w/) {
err "comparison operator not set " .
"off with spaces";
}
}
if (/\w==/ || /==\w/ || /\w<=/ || />=\w/ || /\w!=/ || /!=\w/) {
err "comparison operator not set off with spaces";
}
if (/\w=/ || /=\w/) {
err "assignment operator not set off with spaces";
}
if (/^{/) {
$inclause = 1;
}
}
}
foreach $arg (@ARGV) {
if (-f $arg) {
push(@files, $arg);
} else {
die "$PNAME: $arg is not a valid file\n";
}
}
die $USAGE if (scalar(@files) == 0);
foreach $file (@files) {
dstyle($file);
}
exit($errs != 0);
@@ -0,0 +1,705 @@
#!/usr/local/bin/perl
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
require 5.6.1;
use File::Find;
use File::Basename;
use Getopt::Std;
use Cwd;
use Cwd 'abs_path';
$PNAME = $0;
$PNAME =~ s:.*/::;
$OPTSTR = 'abd:fghi:jlnqsx:';
$USAGE = "Usage: $PNAME [-abfghjlnqs] [-d dir] [-i isa] "
. "[-x opt[=arg]] [file | dir ...]\n";
($MACH = `uname -p`) =~ s/\W*\n//;
($PLATFORM = `uname -i`) =~ s/\W*\n//;
@dtrace_argv = ();
$ksh_path = '/bin/sh';
@files = ();
%exceptions = ();
%results = ();
$errs = 0;
#
# If no test files are specified on the command-line, execute a find on "."
# and append any tst.*.d, tst.*.ksh, err.*.d or drp.*.d files found within
# the directory tree.
#
sub wanted
{
push(@files, $File::Find::name)
if ($_ =~ /^(tst|err|drp)\..+\.(d|ksh)$/ && -f "$_");
}
sub dirname {
my($s) = @_;
my($i);
$s = substr($s, 0, $i) if (($i = rindex($s, '/')) != -1);
return $i == -1 ? '.' : $i == 0 ? '/' : $s;
}
sub usage
{
print $USAGE;
print "\t -a execute test suite using anonymous enablings\n";
print "\t -b execute bad ioctl test program\n";
print "\t -d specify directory for test results files and cores\n";
print "\t -g enable libumem debugging when running tests\n";
print "\t -f force bypassed tests to run\n";
print "\t -h display verbose usage message\n";
print "\t -i specify ISA to test instead of isaexec(3C) default\n";
print "\t -j execute test suite using jdtrace (Java API) only\n";
print "\t -l save log file of results and PIDs used by tests\n";
print "\t -n execute test suite using dtrace(1m) only\n";
print "\t -q set quiet mode (only report errors and summary)\n";
print "\t -s save results files even for tests that pass\n";
print "\t -x pass corresponding -x argument to dtrace(1M)\n";
exit(2);
}
sub errmsg
{
my($msg) = @_;
print STDERR $msg;
print LOG $msg if ($opt_l);
$errs++;
}
sub fail
{
my(@parms) = @_;
my($msg) = $parms[0];
my($errfile) = $parms[1];
my($n) = 0;
my($dest) = basename($file);
while (-d "$opt_d/failure.$n") {
$n++;
}
unless (mkdir "$opt_d/failure.$n") {
warn "ERROR: failed to make directory $opt_d/failure.$n: $!\n";
exit(125);
}
open(README, ">$opt_d/failure.$n/README");
print README "ERROR: " . $file . " " . $msg;
if (scalar @parms > 1) {
print README "; see $errfile\n";
} else {
if (-f "$opt_d/$pid.core") {
print README "; see $pid.core\n";
} else {
print README "\n";
}
}
close(README);
if (-f "$opt_d/$pid.out") {
rename("$opt_d/$pid.out", "$opt_d/failure.$n/$pid.out");
link("$file.out", "$opt_d/failure.$n/$dest.out");
}
if (-f "$opt_d/$pid.err") {
rename("$opt_d/$pid.err", "$opt_d/failure.$n/$pid.err");
link("$file.err", "$opt_d/failure.$n/$dest.err");
}
if (-f "$opt_d/$pid.core") {
rename("$opt_d/$pid.core", "$opt_d/failure.$n/$pid.core");
}
link("$file", "$opt_d/failure.$n/$dest");
$msg = "ERROR: " . $dest . " " . $msg;
if (scalar @parms > 1) {
$msg = $msg . "; see $errfile in failure.$n\n";
} else {
$msg = $msg . "; details in failure.$n\n";
}
errmsg($msg);
}
sub logmsg
{
my($msg) = @_;
print STDOUT $msg unless ($opt_q);
print LOG $msg if ($opt_l);
}
# Trim leading and trailing whitespace
sub trim {
my($s) = @_;
$s =~ s/^\s*//;
$s =~ s/\s*$//;
return $s;
}
# Load exception set of skipped tests from the file at the given
# pathname. The test names are assumed to be paths relative to $dt_tst,
# for example: common/aggs/tst.neglquant.d, and specify tests to be
# skipped.
sub load_exceptions {
my($listfile) = @_;
my($line) = "";
%exceptions = ();
if (length($listfile) > 0) {
exit(123) unless open(STDIN, "<$listfile");
while (<STDIN>) {
chomp;
$line = $_;
# line is non-empty and not a comment
if ((length($line) > 0) && ($line =~ /^\s*[^\s#]/ )) {
$exceptions{trim($line)} = 1;
}
}
}
}
# Return 1 if the test is found in the exception set, 0 otherwise.
sub is_exception {
my($file) = @_;
my($i) = -1;
if (scalar(keys(%exceptions)) == 0) {
return 0;
}
# hash absolute pathname after $dt_tst/
$file = abs_path($file);
$i = index($file, $dt_tst);
if ($i == 0) {
$file = substr($file, length($dt_tst) + 1);
return $exceptions{$file};
}
return 0;
}
#
# Iterate over the set of test files specified on the command-line or by a find
# on "$defdir/common", "$defdir/$MACH" and "$defdir/$PLATFORM" and execute each
# one. If the test file is executable, we fork and exec it. If the test is a
# .ksh file, we run it with $ksh_path. Otherwise we run dtrace -s on it. If
# the file is named tst.* we assume it should return exit status 0. If the
# file is named err.* we assume it should return exit status 1. If the file is
# named err.D_[A-Z0-9]+[.*].d we use dtrace -xerrtags and examine stderr to
# ensure that a matching error tag was produced. If the file is named
# drp.[A-Z0-9]+[.*].d we use dtrace -xdroptags and examine stderr to ensure
# that a matching drop tag was produced. If any *.out or *.err files are found
# we perform output comparisons.
#
# run_tests takes two arguments: The first is the pathname of the dtrace
# command to invoke when running the tests. The second is the pathname
# of a file (may be the empty string) listing tests that ought to be
# skipped (skipped tests are listed as paths relative to $dt_tst, for
# example: common/aggs/tst.neglquant.d).
#
sub run_tests {
my($dtrace, $exceptions_path) = @_;
my($passed) = 0;
my($bypassed) = 0;
my($failed) = $errs;
my($total) = 0;
die "$PNAME: $dtrace not found\n" unless (-x "$dtrace");
logmsg($dtrace . "\n");
load_exceptions($exceptions_path);
foreach $file (sort @files) {
$file =~ m:.*/((.*)\.(\w+)):;
$name = $1;
$base = $2;
$ext = $3;
$dir = dirname($file);
$isksh = 0;
$tag = 0;
$droptag = 0;
if ($name =~ /^tst\./) {
$isksh = ($ext eq 'ksh');
$status = 0;
} elsif ($name =~ /^err\.(D_[A-Z0-9_]+)\./) {
$status = 1;
$tag = $1;
} elsif ($name =~ /^err\./) {
$status = 1;
} elsif ($name =~ /^drp\.([A-Z0-9_]+)\./) {
$status = 0;
$droptag = $1;
} else {
errmsg("ERROR: $file is not a valid test file name\n");
next;
}
$fullname = "$dir/$name";
$exe = "./$base.exe";
$exe_pid = -1;
if ($opt_a && ($status != 0 || $tag != 0 || $droptag != 0 ||
-x $exe || $isksh || -x $fullname)) {
$bypassed++;
next;
}
if (!$opt_f && is_exception("$dir/$name")) {
$bypassed++;
next;
}
if (!$isksh && -x $exe) {
if (($exe_pid = fork()) == -1) {
errmsg(
"ERROR: failed to fork to run $exe: $!\n");
next;
}
if ($exe_pid == 0) {
open(STDIN, '</dev/null');
exec($exe);
warn "ERROR: failed to exec $exe: $!\n";
}
}
logmsg("testing $file ... ");
if (($pid = fork()) == -1) {
errmsg("ERROR: failed to fork to run test $file: $!\n");
next;
}
if ($pid == 0) {
open(STDIN, '</dev/null');
exit(125) unless open(STDOUT, ">$opt_d/$$.out");
exit(125) unless open(STDERR, ">$opt_d/$$.err");
unless (chdir($dir)) {
warn "ERROR: failed to chdir for $file: $!\n";
exit(126);
}
push(@dtrace_argv, '-xerrtags') if ($tag);
push(@dtrace_argv, '-xdroptags') if ($droptag);
push(@dtrace_argv, $exe_pid) if ($exe_pid != -1);
if ($isksh) {
exit(123) unless open(STDIN, "<$name");
exec("$ksh_path /dev/stdin $dtrace");
} elsif (-x $name) {
warn "ERROR: $name is executable\n";
exit(1);
} else {
if ($tag == 0 && $status == $0 && $opt_a) {
push(@dtrace_argv, '-A');
}
push(@dtrace_argv, '-C');
push(@dtrace_argv, '-s');
push(@dtrace_argv, $name);
exec($dtrace, @dtrace_argv);
}
warn "ERROR: failed to exec for $file: $!\n";
exit(127);
}
if (waitpid($pid, 0) == -1) {
errmsg("ERROR: timed out waiting for $file\n");
kill(9, $exe_pid) if ($exe_pid != -1);
kill(9, $pid);
next;
}
kill(9, $exe_pid) if ($exe_pid != -1);
if ($tag == 0 && $status == $0 && $opt_a) {
#
# We can chuck the earler output.
#
unlink($pid . '.out');
unlink($pid . '.err');
#
# This is an anonymous enabling. We need to get
# the module unloaded.
#
system("dtrace -ae 1> /dev/null 2> /dev/null");
system("svcadm disable -s " .
"svc:/network/nfs/mapid:default");
system("modunload -i 0 ; modunload -i 0 ; " .
"modunload -i 0");
if (!system("modinfo | grep dtrace")) {
warn "ERROR: couldn't unload dtrace\n";
system("svcadm enable " .
"-s svc:/network/nfs/mapid:default");
exit(124);
}
#
# DTrace is gone. Now update_drv(1M), and rip
# everything out again.
#
system("update_drv dtrace");
system("dtrace -ae 1> /dev/null 2> /dev/null");
system("modunload -i 0 ; modunload -i 0 ; " .
"modunload -i 0");
if (!system("modinfo | grep dtrace")) {
warn "ERROR: couldn't unload dtrace\n";
system("svcadm enable " .
"-s svc:/network/nfs/mapid:default");
exit(124);
}
#
# Now bring DTrace back in.
#
system("sync ; sync");
system("dtrace -l -n bogusprobe 1> /dev/null " .
"2> /dev/null");
system("svcadm enable -s " .
"svc:/network/nfs/mapid:default");
#
# That should have caused DTrace to reload with
# the new configuration file. Now we can try to
# snag our anonymous state.
#
if (($pid = fork()) == -1) {
errmsg("ERROR: failed to fork to run " .
"test $file: $!\n");
next;
}
if ($pid == 0) {
open(STDIN, '</dev/null');
exit(125) unless open(STDOUT, ">$opt_d/$$.out");
exit(125) unless open(STDERR, ">$opt_d/$$.err");
push(@dtrace_argv, '-a');
unless (chdir($dir)) {
warn "ERROR: failed to chdir " .
"for $file: $!\n";
exit(126);
}
exec($dtrace, @dtrace_argv);
warn "ERROR: failed to exec for $file: $!\n";
exit(127);
}
if (waitpid($pid, 0) == -1) {
errmsg("ERROR: timed out waiting for $file\n");
kill(9, $pid);
next;
}
}
logmsg("[$pid]\n");
$wstat = $?;
$wifexited = ($wstat & 0xFF) == 0;
$wexitstat = ($wstat >> 8) & 0xFF;
$wtermsig = ($wstat & 0x7F);
if (!$wifexited) {
fail("died from signal $wtermsig");
next;
}
if ($wexitstat == 125) {
die "$PNAME: failed to create output file in $opt_d " .
"(cd elsewhere or use -d)\n";
}
if ($wexitstat != $status) {
fail("returned $wexitstat instead of $status");
next;
}
if (-f "$file.out" &&
system("cmp -s $file.out $opt_d/$pid.out") != 0) {
fail("stdout mismatch", "$pid.out");
next;
}
if (-f "$file.err" &&
system("cmp -s $file.err $opt_d/$pid.err") != 0) {
fail("stderr mismatch: see $pid.err");
next;
}
if ($tag) {
open(TSTERR, "<$opt_d/$pid.err");
$tsterr = <TSTERR>;
close(TSTERR);
unless ($tsterr =~ /: \[$tag\] line \d+:/) {
fail("errtag mismatch: see $pid.err");
next;
}
}
if ($droptag) {
$found = 0;
open(TSTERR, "<$opt_d/$pid.err");
while (<TSTERR>) {
if (/\[$droptag\] /) {
$found = 1;
last;
}
}
close (TSTERR);
unless ($found) {
fail("droptag mismatch: see $pid.err");
next;
}
}
unless ($opt_s) {
unlink($pid . '.out');
unlink($pid . '.err');
}
}
if ($opt_a) {
#
# If we're running with anonymous enablings, we need to
# restore the .conf file.
#
system("dtrace -A 1> /dev/null 2> /dev/null");
system("dtrace -ae 1> /dev/null 2> /dev/null");
system("modunload -i 0 ; modunload -i 0 ; modunload -i 0");
system("update_drv dtrace");
}
$total = scalar(@files);
$failed = $errs - $failed;
$passed = ($total - $failed - $bypassed);
$results{$dtrace} = {
"passed" => $passed,
"bypassed" => $bypassed,
"failed" => $failed,
"total" => $total
};
}
die $USAGE unless (getopts($OPTSTR));
usage() if ($opt_h);
foreach $arg (@ARGV) {
if (-f $arg) {
push(@files, $arg);
} elsif (-d $arg) {
find(\&wanted, $arg);
} else {
die "$PNAME: $arg is not a valid file or directory\n";
}
}
$dt_tst = '/opt/SUNWdtrt/tst';
$dt_bin = '/opt/SUNWdtrt/bin';
$defdir = -d $dt_tst ? $dt_tst : '.';
$bindir = -d $dt_bin ? $dt_bin : '.';
find(\&wanted, "$defdir/common") if (scalar(@ARGV) == 0);
find(\&wanted, "$defdir/$MACH") if (scalar(@ARGV) == 0);
find(\&wanted, "$defdir/$PLATFORM") if (scalar(@ARGV) == 0);
die $USAGE if (scalar(@files) == 0);
$dtrace_path = '/usr/sbin/dtrace';
$jdtrace_path = "$bindir/jdtrace";
%exception_lists = ("$jdtrace_path" => "$bindir/exception.lst");
if ($opt_j || $opt_n || $opt_i) {
@dtrace_cmds = ();
push(@dtrace_cmds, $dtrace_path) if ($opt_n);
push(@dtrace_cmds, $jdtrace_path) if ($opt_j);
push(@dtrace_cmds, "/usr/sbin/$opt_i/dtrace") if ($opt_i);
} else {
@dtrace_cmds = ($dtrace_path, $jdtrace_path);
}
if ($opt_d) {
die "$PNAME: -d arg must be absolute path\n" unless ($opt_d =~ /^\//);
die "$PNAME: -d arg $opt_d is not a directory\n" unless (-d "$opt_d");
system("coreadm -p $opt_d/%p.core");
} else {
my $dir = getcwd;
system("coreadm -p $dir/%p.core");
$opt_d = '.';
}
if ($opt_x) {
push(@dtrace_argv, '-x');
push(@dtrace_argv, $opt_x);
}
die "$PNAME: failed to open $PNAME.$$.log: $!\n"
unless (!$opt_l || open(LOG, ">$PNAME.$$.log"));
if ($opt_g) {
$ENV{'UMEM_DEBUG'} = 'default,verbose';
$ENV{'UMEM_LOGGING'} = 'fail,contents';
$ENV{'LD_PRELOAD'} = 'libumem.so';
}
#
# Ensure that $PATH contains a cc(1) so that we can execute the
# test programs that require compilation of C code.
#
#$ENV{'PATH'} = $ENV{'PATH'} . ':/ws/onnv-tools/SUNWspro/SS11/bin';
if ($opt_b) {
logmsg("badioctl'ing ... ");
if (($badioctl = fork()) == -1) {
errmsg("ERROR: failed to fork to run badioctl: $!\n");
next;
}
if ($badioctl == 0) {
open(STDIN, '</dev/null');
exit(125) unless open(STDOUT, ">$opt_d/$$.out");
exit(125) unless open(STDERR, ">$opt_d/$$.err");
exec($bindir . "/badioctl");
warn "ERROR: failed to exec badioctl: $!\n";
exit(127);
}
logmsg("[$badioctl]\n");
#
# If we're going to be bad, we're just going to iterate over each
# test file.
#
foreach $file (sort @files) {
($name = $file) =~ s:.*/::;
$dir = dirname($file);
if (!($name =~ /^tst\./ && $name =~ /\.d$/)) {
next;
}
logmsg("baddof'ing $file ... ");
if (($pid = fork()) == -1) {
errmsg("ERROR: failed to fork to run baddof: $!\n");
next;
}
if ($pid == 0) {
open(STDIN, '</dev/null');
exit(125) unless open(STDOUT, ">$opt_d/$$.out");
exit(125) unless open(STDERR, ">$opt_d/$$.err");
unless (chdir($dir)) {
warn "ERROR: failed to chdir for $file: $!\n";
exit(126);
}
exec($bindir . "/baddof", $name);
warn "ERROR: failed to exec for $file: $!\n";
exit(127);
}
sleep 60;
kill(9, $pid);
waitpid($pid, 0);
logmsg("[$pid]\n");
unless ($opt_s) {
unlink($pid . '.out');
unlink($pid . '.err');
}
}
kill(9, $badioctl);
waitpid($badioctl, 0);
unless ($opt_s) {
unlink($badioctl . '.out');
unlink($badioctl . '.err');
}
exit(0);
}
#
# Run all the tests specified on the command-line (the entire test suite
# by default) once for each dtrace command tested, skipping any tests
# not valid for that command.
#
foreach $dtrace_cmd (@dtrace_cmds) {
run_tests($dtrace_cmd, $exception_lists{$dtrace_cmd});
}
$opt_q = 0; # force final summary to appear regardless of -q option
logmsg("\n==== TEST RESULTS ====\n");
foreach $key (keys %results) {
my $passed = $results{$key}{"passed"};
my $bypassed = $results{$key}{"bypassed"};
my $failed = $results{$key}{"failed"};
my $total = $results{$key}{"total"};
logmsg("\n mode: " . $key . "\n");
logmsg(" passed: " . $passed . "\n");
if ($bypassed) {
logmsg(" bypassed: " . $bypassed . "\n");
}
logmsg(" failed: " . $failed . "\n");
logmsg(" total: " . $total . "\n");
}
exit($errs != 0);
@@ -0,0 +1,45 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* An aggregation must call an aggregating function.
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@counts["xyz"] = breakpoint();
exit(0);
}
@@ -0,0 +1,45 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* An aggregation may not be used as a multi-dimensional array
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@counts[0][2] = count();
exit(0);
}
@@ -0,0 +1,44 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* An aggregation must have an aggregating function applied.
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@a[1];
}
@@ -0,0 +1,45 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* Test redefining the aggregation
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@a = count();
}
END
{
@a = max(0);
}
@@ -0,0 +1,43 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* avg() should not accept a non-scalar value
*
* SECTION: Aggregations/Aggregations
*
*/
#pragma D option quiet
BEGIN
{
@a[pid] = avg(probefunc);
}
@@ -0,0 +1,41 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* max() should not accept a non-scalar value
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@a[pid] = max(probefunc);
}
@@ -0,0 +1,42 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* min() should not accept a non-scalar value
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@a[pid] = min(probefunc);
}
@@ -0,0 +1,41 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* quantize() should not accept a non-scalar value
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@a[pid] = quantize(probefunc);
}
@@ -0,0 +1,42 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* sum() should not accept a non-scalar value
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@a[pid] = sum(probefunc);
}
@@ -0,0 +1,77 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* The argument to clear() must be an aggregation.
*
* SECTION: Aggregations/Clearing aggregations
*
*
*/
#pragma D option quiet
#pragma D option aggrate=10ms
#pragma D option switchrate=10ms
BEGIN
{
i = 0;
start = timestamp;
}
tick-100ms
/i < 20/
{
@func[i%5] = sum(i * 100);
i++;
}
tick-100ms
/i == 10/
{
printf("Aggregation data before clear():\n");
printa(@func);
clear(count());
printf("Aggregation data after clear():\n");
printa(@func);
i++;
}
tick-100ms
/i == 20/
{
printf("Final aggregation data:\n");
printa(@func);
exit(0);
}
@@ -0,0 +1,77 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* clear() should handle no args as an error.
*
* SECTION: Aggregations/Clearing aggregations
*
*
*/
#pragma D option quiet
#pragma D option aggrate=10ms
#pragma D option switchrate=10ms
BEGIN
{
i = 0;
start = timestamp;
}
tick-100ms
/i < 20/
{
@func[i%5] = sum(i * 100);
i++;
}
tick-100ms
/i == 10/
{
printf("Aggregation data before clear():\n");
printa(@func);
clear();
printf("Aggregation data after clear():\n");
printa(@func);
i++;
}
tick-100ms
/i == 20/
{
printf("Final aggregation data:\n");
printa(@func);
exit(0);
}
@@ -0,0 +1,45 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* An aggregation must call an aggregating function, not a probe
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@counts[0][2] = tick-1();
exit(0);
}
@@ -0,0 +1,43 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* Test the use of a non-supported aggregate function.
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@counts["badtest"] = foo();
}
@@ -0,0 +1,41 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* Test using an aggregation in an expression context.
* This should result in a compile-time error.
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
trace(@a + 3);
}
@@ -0,0 +1,42 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* Test the use of a dynamic expression as an aggregation key.
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@t[i] = count();
}
@@ -0,0 +1,41 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* Test compiling an aggregation statement that has no effect.
* This should result in a compile-time error.
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@a;
}
@@ -0,0 +1,41 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* Test the use of a void expression as an aggregation key.
* This should result in a compile-time error.
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@a[1, (void)0] = count();
}
@@ -0,0 +1,42 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* Test the use of a dynamic expression as an aggregation key.
* This should result in a compile-time error.
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@a[0] = count();
@b[@a] = count();
}
@@ -0,0 +1,44 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* Test the use of a dynamic expression as an aggregation key.
* This should result in a compile-time error.
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@a[curpsinfo] = count();
}
@@ -0,0 +1,44 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* lquantize() lower bound around must be an integer constant
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
x = 'a';
@a[1] = lquantize(timestamp, x, 1000, 1);
}
@@ -0,0 +1,44 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* lquantize() lower bound around must be an integer constant
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
x = 'a';
@a[1] = lquantize(timestamp, x, 1000, 1);
}
@@ -0,0 +1,43 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* lquantize() lower bound must be a 32-bit quantity
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@a[1] = lquantize(timestamp, 2147483657, 1000, 1);
}
@@ -0,0 +1,45 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* lquantize() upper bound around must be an integer constant
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
x = 'a';
@a[1] = lquantize(timestamp, 100, rand(), 1);
}
@@ -0,0 +1,44 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* lquantize() upper bound around must be an integer constant
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
x = 'a';
@a[1] = lquantize(timestamp, 100, 2147483657, 1);
}
@@ -0,0 +1,33 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
BEGIN
{
@ = lquantize(0, 10, 20, 1);
@ = lquantize(0, 15, 20, 1);
}
@@ -0,0 +1,33 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
BEGIN
{
@ = lquantize(0, 10, 20, 1);
@ = lquantize(0, 15, 30, 10);
}
@@ -0,0 +1,33 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
BEGIN
{
@ = lquantize(0, 10, 20, 1);
@ = lquantize(0, 10, 2000, 1);
}
@@ -0,0 +1,33 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
BEGIN
{
@ = lquantize(0, 10, 20, 1);
@ = lquantize(0, 10, 2000, 10);
}
@@ -0,0 +1,33 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
BEGIN
{
@ = lquantize(0, 10, 20, 1);
@ = lquantize(0, 10, 20, 2);
}
@@ -0,0 +1,55 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* Upper bound must be greater than lower bound argument
*
* SECTION: Aggregations/Aggregations
*/
#pragma D option quiet
BEGIN
{
i = 0;
}
tick-1
/i < 1000/
{
@a[i] = lquantize(i, 1100, -100, -100 );
i += 100;
}
tick-1
/i == 1000/
{
exit(0);
}
@@ -0,0 +1,42 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* lquantize() should not accept more than 4 arguments.
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
@a[1] = lquantize(1, 2, 3, 4, 5);
}
@@ -0,0 +1,55 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* Number of quantization levels must be a 16-bit quantity
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
i = 0;
}
tick-10ms
/i < 1000/
{
@a[i] = lquantize(i, 0, 1000000, 10);
i += 100;
}
tick-10ms
/i == 1000/
{
exit(0);
}
@@ -0,0 +1,56 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* Upper bound must be greater than lower bound argument
*
* SECTION: Aggregations/Aggregations
*
*/
#pragma D option quiet
BEGIN
{
i = 0;
}
tick-1
/i < 1000/
{
@a[i] = lquantize(i, 0, 1100, -100);
i += 100;
}
tick-1
/i == 1000/
{
exit(0);
}
@@ -0,0 +1,56 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* lquantize() step value should be a 16-bit quantity
*
* SECTION: Aggregations/Aggregations
*
*/
BEGIN
{
i = 0;
}
tick-10ms
/i < 1000/
{
@a[i] = lquantize(i, 100, 1100, 200000 );
i += 100;
}
tick-10ms
/i == 1000/
{
exit(0);
}
Loaded 100 of 9031 files, more files were not shown because too many files have changed in this diff. Show more