From hrs at FreeBSD.org Mon Jan 5 03:50:06 2009
From: hrs at FreeBSD.org (Hiroki Sato)
Date: Mon Jan 5 03:50:23 2009
Subject: svn commit: r186755 - in stable/7/release/doc:
en_US.ISO8859-1/errata share/sgml
Message-ID: <200901050350.n053o5a0083907@svn.freebsd.org>
Author: hrs
Date: Mon Jan 5 03:50:04 2009
New Revision: 186755
URL: http://svn.freebsd.org/changeset/base/186755
Log:
- 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)
Modified:
stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml
stable/7/release/doc/share/sgml/release.ent
Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml
==============================================================================
--- stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Mon Jan 5 03:06:55 2009 (r186754)
+++ stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Mon Jan 5 03:50:04 2009 (r186755)
@@ -16,7 +16,7 @@
%release;
-
+
]>
@@ -41,6 +41,7 @@
2008
+ 2009
The &os; Documentation Project
@@ -125,11 +126,9 @@
Security Advisories
-No advisories.
-]]>
-The following security advisories pertain to &os; &release.bugfix;.
For more information, consult the individual advisories available from
.
@@ -154,128 +153,72 @@
17 April 2008
OpenSSH X11-forwarding privilege escalation
-
- SA-08:06.bind
- 13 July 2008
- DNS cache poisoning
-
-
- SA-08:07.amd64
- 3 September 2008
- amd64 swapgs local privilege escalation
-
-
- SA-08:08.nmount
- 3 September 2008
- &man.nmount.2; local arbitrary code execution
-
-
- SA-08:09.icmp6
- 3 September 2008
- Remote kernel panics on IPv6 connections
-
-
- SA-08:10.nd6
- 1 October 2008
- IPv6 Neighbor Discovery Protocol routing vulnerability
-
-
- SA-08:11.arc4random
- 24 November 2008
- &man.arc4random.9; predictable sequence vulnerability
-
-
- SA-08:12.ftpd
- 23 December 2008
- Cross-site request forgery in &man.ftpd.8;
-
-
- SA-08:13.protosw
- 23 December 2008
- netgraph / bluetooth privilege escalation
-
-]]>
+-->
Open Issues
-No open issues.
-]]>
-
-[20080229] &man.tcpdump.1; does not correctly print the
- TX/RX rates for 802.11 frames. This issue has been fixed on the
- HEAD and RELENG_7 branches.
-
- [20080229] A bug in Linux emulation may cause segmentation
- faults for some Linux programs using &man.mmap.2;. This issue
- has been fixed on the HEAD and RELENG_7 branches.
-
- [20080229] Instances of packet corruption and instability
- have been observed with the &man.re.4; network driver. Some
- users have reported that using a newer version of this driver
- (on HEAD) has solved their problems, or at least mitigated
- them.
-
- [20080229, updated 20080817] A change in the way that &os; sends TCP options
- has been reported to cause connectivity issues.
- This problem has been corrected on
- HEAD and the RELENG_7 and RELENG_7_0 branches.. Further
- details are contained in errta notice
- FreeBSD-EN-08:02.tcp.
-
- [20080307] The &os; implementation of SCTP currently depends
- on having INET6 support compiled into the
- kernel. This requirement is planned to be removed in future
- releases.
-
- [20080307] Source upgrades from &os;
- 6.X to &os; &release.bugfix; will
- generate warnings from &man.kldxref.8; during
- the installkernel step. These warnings are
- harmless and can be ignored.
-
- [20080307] The &man.crypto.4; driver, which is required for
- IPsec functionality, has severe problems on &os;/&arch.powerpc;
- (a kernel with device crypto included in its
- configuration will be non-functional).
-
-]]>
+ [20090105] As in the Announcement of 7.1-RELEASE, certain Intel NICs
+ will come up as &man.igb.4; instead of &man.em.4; in this
+ release. There are only 3 PCI ID's that should have
+ their name changed from &man.em.4; to &man.igb.4;:
+
+
+
+ 0x10A78086
+
+
+
+ 0x10A98086
+
+
+
+ 0x10D68086
+
+
+
+ You should be able to determine if your card will
+ change names by running the following command:
+
+ &prompt.user; pciconf -l
+. . .
+em0@pci0:0:25:0: class=0x020000 card=0x02381028 chip=0x10c08086 rev=0x02 hdr=0x00
+
+ and for the line representing your NIC (should be named
+ em on older systems,
+ e.g. em0 or em1, etc)
+ check the fourth column. If that says
+ chip=0x10a78086 (or one of the other two IDs
+ given above) you will have the adapter's name change.
+
+ [20090105] The Release Notes for 7.1-RELEASE should have mentioned
+ changes that the &man.ae.4; driver has been added to provide support
+ for the Attansic/Atheros L2 FastEthernet controllers.
+ This driver is not enabled in GENERIC
+ kernels for this release.
+
+ [20090105] The Release Notes for 7.1-RELEASE included the
+ following misdescriptions:
+
+
+
+ In the entry of &man.linux.4; ABI support,
+ get_setaffinity() should have been
+ sched_setaffinity().
+
+
Late-Breaking News and Corrections
-No news.
-]]>
-
-[20080229] The &os; &release.bugfix; release documentation
- (release notes, hardware notes, and so forth) all contained a
- note that users of &os; 7-STABLE should be subscribed to
- the freebsd-current mailing list. This note
- should not have appeared.
-
- [20080229] The release notes gave an incorrect version
- number for KDE. The correct version number is 3.5.8.
-
-]]>
Modified: stable/7/release/doc/share/sgml/release.ent
==============================================================================
--- stable/7/release/doc/share/sgml/release.ent Mon Jan 5 03:06:55 2009 (r186754)
+++ stable/7/release/doc/share/sgml/release.ent Mon Jan 5 03:50:04 2009 (r186755)
@@ -6,12 +6,12 @@
-
+
-
+
-
+
@@ -40,7 +40,7 @@
-
+
From rafan at FreeBSD.org Mon Jan 5 04:26:25 2009
From: rafan at FreeBSD.org (Rong-En Fan)
Date: Mon Jan 5 04:26:32 2009
Subject: svn commit: r186756 - stable/7/usr.sbin/rpc.yppasswdd
Message-ID: <200901050426.n054QPaQ084704@svn.freebsd.org>
Author: rafan
Date: Mon Jan 5 04:26:24 2009
New Revision: 186756
URL: http://svn.freebsd.org/changeset/base/186756
Log:
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
Submitted by: Jui-Nan Lin"
Reviewed by: delphij
Modified:
stable/7/usr.sbin/rpc.yppasswdd/ (props changed)
stable/7/usr.sbin/rpc.yppasswdd/yppasswdd_main.c
Modified: stable/7/usr.sbin/rpc.yppasswdd/yppasswdd_main.c
==============================================================================
--- stable/7/usr.sbin/rpc.yppasswdd/yppasswdd_main.c Mon Jan 5 03:50:04 2009 (r186755)
+++ stable/7/usr.sbin/rpc.yppasswdd/yppasswdd_main.c Mon Jan 5 04:26:24 2009 (r186756)
@@ -165,6 +165,7 @@ main(int argc, char *argv[])
struct sockaddr_in saddr;
socklen_t asize = sizeof (saddr);
struct netconfig *nconf;
+ struct sigaction sa;
void *localhandle;
int ch;
char *mastername;
@@ -268,6 +269,9 @@ the %s domain -- aborting", yppasswd_dom
}
}
openlog("rpc.yppasswdd", LOG_PID, LOG_DAEMON);
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_flags = SA_NOCLDWAIT;
+ sigaction(SIGCHLD, &sa, NULL);
rpcb_unset(YPPASSWDPROG, YPPASSWDVERS, NULL);
rpcb_unset(MASTER_YPPASSWDPROG, MASTER_YPPASSWDVERS, NULL);
From kensmith at FreeBSD.org Mon Jan 5 04:45:19 2009
From: kensmith at FreeBSD.org (Ken Smith)
Date: Mon Jan 5 04:45:30 2009
Subject: svn commit: r186757 - stable/7/sys/conf
Message-ID: <200901050445.n054jIs1085134@svn.freebsd.org>
Author: kensmith
Date: Mon Jan 5 04:45:17 2009
New Revision: 186757
URL: http://svn.freebsd.org/changeset/base/186757
Log:
Release is done, bump stable/7 to -STABLE.
Modified:
stable/7/sys/conf/newvers.sh
Modified: stable/7/sys/conf/newvers.sh
==============================================================================
--- stable/7/sys/conf/newvers.sh Mon Jan 5 04:26:24 2009 (r186756)
+++ stable/7/sys/conf/newvers.sh Mon Jan 5 04:45:17 2009 (r186757)
@@ -32,7 +32,7 @@
TYPE="FreeBSD"
REVISION="7.1"
-BRANCH="PRERELEASE"
+BRANCH="STABLE"
if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
fi
From hrs at FreeBSD.org Mon Jan 5 05:53:15 2009
From: hrs at FreeBSD.org (Hiroki Sato)
Date: Mon Jan 5 05:53:27 2009
Subject: svn commit: r186759 - stable/7/release/doc/en_US.ISO8859-1/relnotes
Message-ID: <200901050553.n055rEmL086398@svn.freebsd.org>
Author: hrs
Date: Mon Jan 5 05:53:14 2009
New Revision: 186759
URL: http://svn.freebsd.org/changeset/base/186759
Log:
- Trim old items.
- Fix indent.
Modified:
stable/7/release/doc/en_US.ISO8859-1/relnotes/article.sgml
Modified: stable/7/release/doc/en_US.ISO8859-1/relnotes/article.sgml
==============================================================================
--- stable/7/release/doc/en_US.ISO8859-1/relnotes/article.sgml Mon Jan 5 05:14:26 2009 (r186758)
+++ stable/7/release/doc/en_US.ISO8859-1/relnotes/article.sgml Mon Jan 5 05:53:14 2009 (r186759)
@@ -12,342 +12,238 @@
]>
-
- &os; &release.current; Release Notes
+
+ &os; &release.current; Release Notes
- The &os; Project
+ The &os; Project
- $FreeBSD$
+ $FreeBSD$
-
- 2000
- 2001
- 2002
- 2003
- 2004
- 2005
- 2006
- 2007
- 2008
- The &os; Documentation Project
-
-
-
- &tm-attrib.freebsd;
- &tm-attrib.ibm;
- &tm-attrib.ieee;
- &tm-attrib.intel;
- &tm-attrib.sparc;
- &tm-attrib.general;
-
-
-
- The release notes for &os; &release.current; contain a summary
- of the changes made to the &os; base system on the
- &release.branch; development line.
- This document lists applicable security advisories that were issued since
- the last release, as well as significant changes to the &os;
- kernel and userland.
- Some brief remarks on upgrading are also presented.
-
-
-
-
- Introduction
-
- This document contains the release notes for &os;
- &release.current;. It
- describes recently added, changed, or deleted features of &os;.
- It also provides some notes on upgrading
- from previous versions of &os;.
+
+ 2000
+ 2001
+ 2002
+ 2003
+ 2004
+ 2005
+ 2006
+ 2007
+ 2008
+ 2009
+ The &os; Documentation Project
+
+
+
+ &tm-attrib.freebsd;
+ &tm-attrib.ibm;
+ &tm-attrib.ieee;
+ &tm-attrib.intel;
+ &tm-attrib.sparc;
+ &tm-attrib.general;
+
+
+
+ The release notes for &os; &release.current; contain a summary
+ of the changes made to the &os; base system on the
+ &release.branch; development line.
+ This document lists applicable security advisories that were issued since
+ the last release, as well as significant changes to the &os;
+ kernel and userland.
+ Some brief remarks on upgrading are also presented.
+
+
+
+
+ Introduction
+
+ This document contains the release notes for &os;
+ &release.current;. It
+ describes recently added, changed, or deleted features of &os;.
+ It also provides some notes on upgrading
+ from previous versions of &os;.
The &release.type; distribution to which these release notes
- apply represents the latest point along the &release.branch; development
- branch since &release.branch; was created. Information regarding pre-built, binary
- &release.type; distributions along this branch
- can be found at .
+ The &release.type; distribution to which these release notes
+ apply represents the latest point along the &release.branch; development
+ branch since &release.branch; was created. Information regarding pre-built, binary
+ &release.type; distributions along this branch
+ can be found at .
]]>
The &release.type; distribution to which these release notes
- apply represents a point along the &release.branch; development
- branch between &release.prev; and the future &release.next;.
- Information regarding
- pre-built, binary &release.type; distributions along this branch
- can be found at .
+ The &release.type; distribution to which these release notes
+ apply represents a point along the &release.branch; development
+ branch between &release.prev; and the future &release.next;.
+ Information regarding
+ pre-built, binary &release.type; distributions along this branch
+ can be found at .
]]>
This distribution of &os; &release.current; is a
- &release.type; distribution. It can be found at or any of its mirrors. More
- information on obtaining this (or other) &release.type;
- distributions of &os; can be found in the Obtaining
- &os;
appendix to the &os;
- Handbook.
+ This distribution of &os; &release.current; is a
+ &release.type; distribution. It can be found at or any of its mirrors. More
+ information on obtaining this (or other) &release.type;
+ distributions of &os; can be found in the Obtaining
+ &os;
appendix to the &os; Handbook.
]]>
- All users are encouraged to consult the release errata before
- installing &os;. The errata document is updated with
- late-breaking
information discovered late in the
- release cycle or after the release. Typically, it contains
- information on known bugs, security advisories, and corrections to
- documentation. An up-to-date copy of the errata for &os;
- &release.current; can be found on the &os; Web site.
-
-
-
-
- What's New
-
- This section describes
- the most user-visible new or changed features in &os;
- since &release.prev;.
-
-
- Typical release note items
- document recent security advisories issued after
- &release.prev;,
- new drivers or hardware support, new commands or options,
- major bug fixes, or contributed software upgrades. They may also
- list changes to major ports/packages or release engineering
- practices. Clearly the release notes cannot list every single
- change made to &os; between releases; this document focuses
- primarily on security advisories, user-visible changes, and major
- architectural improvements.
-
-
- Security Advisories
-
-
-
-
-
- Kernel Changes
-
- The &man.ddb.4; kernel debugger now has an output capture
- facility. Input and output from &man.ddb.4; can now be captured
- to a memory buffer for later inspection using &man.sysctl.8; or
- a textdump. The new capture command controls
- this feature.
-
- The &man.ddb.4; debugger now supports a simple scripting
- facility, which supports a set of named scripts consisting of a
- set of &man.ddb.4; commands. These commands can be managed from
- within &man.ddb.4; or with the use of the new &man.ddb.8;
- utility. More details can be found in the &man.ddb.4; manual
- page.
-
- The kernel now supports a new textdump format of kernel
- dumps. A textdump provides higher-level information via
- mechanically generated/extracted debugging output, rather than a
- simple memory dump. This facility can be used to generate brief
- kernel bug reports that are rich in debugging information, but
- are not dependent on kernel symbol tables or precisely
- synchronized source code. More information can be found in the
- &man.textdump.4; manual page.
-
- [&arch.amd64;, &arch.i386;] The ULE
- scheduler is now the default process scheduler
- in GENERIC kernels.
+ All users are encouraged to consult the release errata before
+ installing &os;. The errata document is updated with
+ late-breaking
information discovered late in the
+ release cycle or after the release. Typically, it contains
+ information on known bugs, security advisories, and corrections to
+ documentation. An up-to-date copy of the errata for &os;
+ &release.current; can be found on the &os; Web site.
+
+
+
+ What's New
+
+ This section describes the most user-visible new or changed
+ features in &os; since &release.prev;.
+
+ Typical release note items document recent security
+ advisories issued after &release.prev;, new drivers or hardware
+ support, new commands or options, major bug fixes, or
+ contributed software upgrades. They may also list changes to
+ major ports/packages or release engineering practices. Clearly
+ the release notes cannot list every single change made to &os;
+ between releases; this document focuses primarily on security
+ advisories, user-visible changes, and major architectural
+ improvements.
-
- Boot Loader Changes
+
+ Security Advisories
+
- [&arch.amd64;, &arch.i386;] The BTX kernel used by the boot
- loader has been changed to invoke BIOS routines from real
- mode. This change makes it possible to boot &os; from USB
- devices.
-
- [&arch.amd64;, &arch.i386;] A new gptboot boot loader has
- been added to support booting from a GPT labeled disk. A
- new boot command has been added to
- &man.gpt.8;, which makes a GPT disk bootable by writing the
- required bits of the boot loader, creating a new boot
- partition if required.
-
-
-
-
- Hardware Support
-
- The &man.cmx.4; driver, a driver for Omnikey CardMan 4040
- PCMCIA smartcard readers, has been added.
-
- The &man.uslcom.4; driver, a driver for Silicon
- Laboratories CP2101/CP2102-based USB serial adapters, has been
- imported from OpenBSD.
-
-
- Multimedia Support
-
-
-
-
-
- Network Interface Support
-
- The &man.ale.4; driver has been added to provide support
- for Atheros AR8121/AR8113/AR8114 Gigabit/Fast Ethernet controllers.
- This driver is not enabled in GENERIC
- kernels for this release.
-
- The &man.em.4; driver has been split into two drivers
- with some common parts. The &man.em.4; driver will continue
- to support adapters up to the 82575, as well as new
- client/desktop adapters. A new &man.igb.4; driver
- will support new server adapters.
-
- [&arch.amd64;, &arch.i386;] The &man.wpi.4; driver has
- been updated to include a number of stability fixes.
-
-
-
-
-
- Network Protocols
+
+ Kernel Changes
-
-
-
- Disks and Storage
+
+ Boot Loader Changes
- The &man.aac.4; driver now supports volumes larger than
- 2TB in size.
+
+
- The &man.hptrr.4; driver has been updated to version 1.2
- from Highpoint.
+
+ Hardware Support
-
+
-
- File Systems
+
+ Multimedia Support
-
-
-
+
+
-
- Userland Changes
+
+ Network Interface Support
- The &man.adduser.8; utility now supports
- a option to set the mode of a new user's
- home directory.
-
- &man.chflags.1; now supports a flag for
- verbose output and a flag to ignore errors
- with the same semantics as (for example)
- &man.chmod.1;.
-
- The &man.realpath.1; utility now supports
- a flag to suppress warnings; it now also
- accepts multiple paths on its command line.
-
- &man.cron.8; now supports a option,
- which can help managing cron mails in massive hosting
- environment.
+
- &man.ypserv.8; now supports a option to
- specify the port number on which it should listen.
+
+
-
- /etc/rc.d Scripts
+
+ Network Protocols
-
-
-
-
-
- Contributed Software
+
- AMD has been updated from 6.0.10
- to 6.1.5.
+
- awk has been updated from 1 May
- 2007 release to the 23 October 2007 release.
+
+ Disks and Storage
- bzip2 has been updated from 1.0.4
- to 1.0.5.
+
- OpenPAM has been updated from the
- Figwort release to the Hydrangea release.
+
- OpenSSH has been updated from
- 4.5p1 to 5.1p1.
+
+ File Systems
- sendmail has been updated from
- 8.14.2 to 8.14.3.
+
+
+
- The timezone database has been updated from
- the tzdata2007h release to
- the tzdata2008b release.
+
+ Userland Changes
-
+
-
- Ports/Packages Collection Infrastructure
+
+ /etc/rc.d Scripts
-
+
+
+
-
+
+ Contributed Software
-
- Release Engineering and Integration
+
+
- The supported version of
- the GNOME desktop environment
- (x11/gnome2) has been
- updated from 2.20.1 to 2.22.
+
+ Ports/Packages Collection Infrastructure
-
+
-
- Documentation
+
-
-
-
+
+ Release Engineering and Integration
-
- Upgrading from previous releases of &os;
+
+
- [&arch.i386;, &arch.amd64;] Beginning with &os; 6.2-RELEASE,
- binary upgrades between RELEASE versions (and snapshots of the
- various security branches) are supported using the
- &man.freebsd-update.8; utility. The binary upgrade procedure will
- update unmodified userland utilities, as well as unmodified GENERIC or
- SMP kernels distributed as a part of an official &os; release.
- The &man.freebsd-update.8; utility requires that the host being
- upgraded have Internet connectivity.
+
+ Documentation
- An older form of binary upgrade is supported through the
- Upgrade option from the main &man.sysinstall.8;
- menu on CDROM distribution media. This type of binary upgrade
- may be useful on non-&arch.i386;, non-&arch.amd64; machines
- or on systems with no Internet connectivity.
+
+
+
- Source-based upgrades (those based on recompiling the &os;
- base system from source code) from previous versions are
- supported, according to the instructions in
- /usr/src/UPDATING.
+
+ Upgrading from previous releases of &os;
-
- Upgrading &os; should, of course, only be attempted after
- backing up all data and configuration
- files.
-
-
+ Beginning with &os; 6.2-RELEASE, binary
+ upgrades between RELEASE versions (and snapshots of the various
+ security branches) are supported using the
+ &man.freebsd-update.8; utility. The binary upgrade procedure
+ will update unmodified userland utilities, as well as unmodified
+ GENERIC or SMP kernels distributed as a part of an official &os;
+ release. The &man.freebsd-update.8; utility requires that the
+ host being upgraded have Internet connectivity.
+
+ An older form of binary upgrade is supported through the
+ Upgrade option from the main
+ &man.sysinstall.8; menu on CDROM distribution media. This type
+ of binary upgrade may be useful on non-&arch.i386;,
+ non-&arch.amd64; machines or on systems with no Internet
+ connectivity.
+
+ Source-based upgrades (those based on recompiling the &os;
+ base system from source code) from previous versions are
+ supported, according to the instructions in
+ /usr/src/UPDATING.
+
+
+ Upgrading &os; should, of course, only be attempted after
+ backing up all data and configuration
+ files.
+
+
From hrs at FreeBSD.org Mon Jan 5 05:54:14 2009
From: hrs at FreeBSD.org (Hiroki Sato)
Date: Mon Jan 5 05:54:25 2009
Subject: svn commit: r186760 - stable/7/release/doc/share/sgml
Message-ID: <200901050554.n055sDGp086454@svn.freebsd.org>
Author: hrs
Date: Mon Jan 5 05:54:13 2009
New Revision: 186760
URL: http://svn.freebsd.org/changeset/base/186760
Log:
Update &release.manpath.*;.
Modified:
stable/7/release/doc/share/sgml/release.ent
Modified: stable/7/release/doc/share/sgml/release.ent
==============================================================================
--- stable/7/release/doc/share/sgml/release.ent Mon Jan 5 05:53:14 2009 (r186759)
+++ stable/7/release/doc/share/sgml/release.ent Mon Jan 5 05:54:13 2009 (r186760)
@@ -36,9 +36,8 @@
-
-
-
+
+
@@ -58,4 +57,3 @@
-
From hrs at FreeBSD.org Mon Jan 5 05:56:22 2009
From: hrs at FreeBSD.org (Hiroki Sato)
Date: Mon Jan 5 05:56:43 2009
Subject: svn commit: r186761 - in stable/7/release/doc: . share/mk share/sgml
Message-ID: <200901050556.n055uJvt086555@svn.freebsd.org>
Author: hrs
Date: Mon Jan 5 05:56:19 2009
New Revision: 186761
URL: http://svn.freebsd.org/changeset/base/186761
Log:
Clean up a DSSSL file for release documents:
Remove {,no.}include.historic,
Fix arch="" support, and
Update platform list in README.
Modified:
stable/7/release/doc/README
stable/7/release/doc/share/mk/doc.relnotes.mk
stable/7/release/doc/share/sgml/release.dsl
Modified: stable/7/release/doc/README
==============================================================================
--- stable/7/release/doc/README Mon Jan 5 05:54:13 2009 (r186760)
+++ stable/7/release/doc/README Mon Jan 5 05:56:19 2009 (r186761)
@@ -99,9 +99,10 @@ element will be included. For example:
SPARC64-specific text
-The currently-supported architectures are i386, sparc64, and
-ia64. An element may appear for multiple architectures by specifying
-a comma-separated list of architectures (i.e. arch="sparc64,ia64").
+The currently-supported architectures are amd64, arm, i386, ia64,
+pc98, powerpc, and sparc64. An element may appear for multiple
+architectures by specifying a comma-separated list of architectures
+(i.e. arch="sparc64,ia64").
When creating a translation, make a new directory under this
directory with a language code (paralleling the DocProj directory
Modified: stable/7/release/doc/share/mk/doc.relnotes.mk
==============================================================================
--- stable/7/release/doc/share/mk/doc.relnotes.mk Mon Jan 5 05:54:13 2009 (r186760)
+++ stable/7/release/doc/share/mk/doc.relnotes.mk Mon Jan 5 05:56:19 2009 (r186761)
@@ -11,23 +11,6 @@ DSLHTML?= ${RELN_ROOT}/share/sgml/defaul
DSLPRINT?= ${RELN_ROOT}/share/sgml/default.dsl
#
-# Tweakable Makefile variables
-#
-# INCLUDE_HISTORIC Used by relnotes document only. When set,
-# causes all release notes entries to be printed,
-# even those marked as "historic". If not set
-# (the default), only print "non-historic"
-# release note entries. To designate a release
-# note entry as "historic", add a role="historic"
-# attribute to the applicable element(s).
-#
-.if defined(INCLUDE_HISTORIC)
-JADEFLAGS+= -iinclude.historic
-.else
-JADEFLAGS+= -ino.include.historic
-.endif
-
-#
# Automatic device list generation:
#
.if exists(${RELN_ROOT}/../man4)
Modified: stable/7/release/doc/share/sgml/release.dsl
==============================================================================
--- stable/7/release/doc/share/sgml/release.dsl Mon Jan 5 05:54:13 2009 (r186760)
+++ stable/7/release/doc/share/sgml/release.dsl Mon Jan 5 05:56:19 2009 (r186761)
@@ -3,8 +3,6 @@
-
-
%release.ent;
@@ -14,14 +12,6 @@
-; Configure behavior of this stylesheet
-
-
-
; String manipulation functions
(define (split-string-to-list STR)
;; return list of STR separated with char #\ or #\,
@@ -54,92 +44,6 @@
((equal? STR (car s)) #t)
(else (loop (cdr s))))))
-; Deal with conditional inclusion of text via entities.
-(default
- (let* ((arch (attribute-string (normalize "arch")))
- (role (attribute-string (normalize "role")))
- (for-arch (entity-text "arch")))
- (cond
-
- ; If role=historic, and we're not printing historic things, then
- ; don't output this element.
- ((and (equal? role "historic")
- (not %include-historic%))
- (empty-sosofo))
-
-
- ; If arch= not specified, then print unconditionally. This clause
- ; handles the majority of cases.
- ((or (equal? arch #f) (equal? arch ""))
- (next-match))
-
- ; arch= specified, see if it's equal to "all". If so, then
- ; print unconditionally. Note that this clause could be
- ; combined with the check to see if arch= wasn't specified
- ; or was empty; they have the same outcome.
- ((equal? arch "all")
- (next-match))
-
- ; arch= specified. If we're building for all architectures,
- ; then print it prepended with the set of architectures to which
- ; this element applies.
- ;
- ; XXX This doesn't work.
-; ((equal? for-arch "all")
-; (sosofo-append (literal "[") (literal arch) (literal "] ")
-; (process-children)))
-
- ; arch= specified, so we need to check to see if the specified
- ; parameter includes the architecture we're building for.
- ((string-list-match? for-arch (split-string-to-list arch))
- (next-match))
-
- ; None of the above
- (else (empty-sosofo)))))
-
-(mode qandatoc
- (default
- (let* ((arch (attribute-string (normalize "arch")))
- (role (attribute-string (normalize "role")))
- (for-arch (entity-text "arch")))
- (cond
-
- ; If role=historic, and we're not printing historic things, then
- ; don't output this element.
- ((and (equal? role "historic")
- (not %include-historic%))
- (empty-sosofo))
-
-
- ; If arch= not specified, then print unconditionally. This clause
- ; handles the majority of cases.
- ((or (equal? arch #f) (equal? arch ""))
- (next-match))
-
- ; arch= specified, see if it's equal to "all". If so, then
- ; print unconditionally. Note that this clause could be
- ; combined with the check to see if arch= wasn't specified
- ; or was empty; they have the same outcome.
- ((equal? arch "all")
- (next-match))
-
- ; arch= specified. If we're building for all architectures,
- ; then print it prepended with the set of architectures to which
- ; this element applies.
- ;
- ; XXX This doesn't work.
-; ((equal? for-arch "all")
-; (sosofo-append (literal "[") (literal arch) (literal "] ")
-; (process-children)))
-
- ; arch= specified, so we need to check to see if the specified
- ; parameter includes the architecture we're building for.
- ((string-list-match? for-arch (split-string-to-list arch))
- (next-match))
-
- ; None of the above
- (else (empty-sosofo))))))
-
; We might have some sect1 level elements where the modification times
; are significant. An example of this is the "What's New" section in
; the release notes. We enable the printing of pubdate entry in
@@ -150,6 +54,88 @@
; Put URLs in footnotes, and put footnotes at the bottom of each page.
(define bop-footnotes #t)
(define %footnote-ulinks% #t)
+
+ (define ($paragraph$)
+ (let ((arch (attribute-string (normalize "arch")))
+ (role (attribute-string (normalize "role")))
+ (arch-string (entity-text "arch"))
+ (merged-string (entity-text "merged")))
+ (if (or (equal? (print-backend) 'tex)
+ (equal? (print-backend) #f))
+ ;; avoid using country: characteristic because of a JadeTeX bug...
+ (make paragraph
+ first-line-start-indent: (if (is-first-para)
+ %para-indent-firstpara%
+ %para-indent%)
+ space-before: %para-sep%
+ space-after: (if (INLIST?)
+ 0pt
+ %para-sep%)
+ quadding: %default-quadding%
+ hyphenate?: %hyphenation%
+ language: (dsssl-language-code)
+ (make sequence
+ (cond
+ ;; If arch= not specified, then print unconditionally. This clause
+ ;; handles the majority of cases.
+ ((or (equal? arch #f)
+ (equal? arch "")
+ (equal? arch "all"))
+ (process-children-trim))
+ (else
+ (make sequence
+ (literal "[")
+ (let loop ((prev (car (split-string-to-list arch)))
+ (rest (cdr (split-string-to-list arch))))
+ (make sequence
+ (literal prev)
+ (if (not (null? rest))
+ (make sequence
+ (literal ", ")
+ (loop (car rest) (cdr rest)))
+ (empty-sosofo))))
+ (literal "] ")
+ (process-children-trim))))
+ (if (and (not (null? role)) (equal? role "merged"))
+ (literal " [" merged-string "]")
+ (empty-sosofo))))
+ (make paragraph
+ first-line-start-indent: (if (is-first-para)
+ %para-indent-firstpara%
+ %para-indent%)
+ space-before: %para-sep%
+ space-after: (if (INLIST?)
+ 0pt
+ %para-sep%)
+ quadding: %default-quadding%
+ hyphenate?: %hyphenation%
+ language: (dsssl-language-code)
+ country: (dsssl-country-code)
+ (make sequence
+ (cond
+ ;; If arch= not specified, then print unconditionally. This clause
+ ;; handles the majority of cases.
+ ((or (equal? arch #f)
+ (equal? arch "")
+ (equal? arch "all"))
+ (process-children-trim))
+ (else
+ (make sequence
+ (literal "[")
+ (let loop ((prev (car (split-string-to-list arch)))
+ (rest (cdr (split-string-to-list arch))))
+ (make sequence
+ (literal prev)
+ (if (not (null? rest))
+ (make sequence
+ (literal ", ")
+ (loop (car rest) (cdr rest)))
+ (empty-sosofo))))
+ (literal "] ")
+ (process-children-trim))))
+ (if (and (not (null? role)) (equal? role "merged"))
+ (literal " [" merged-string "]")
+ (empty-sosofo)))))))
]]>
(define (toc-depth nd)
From hrs at FreeBSD.org Mon Jan 5 08:33:58 2009
From: hrs at FreeBSD.org (Hiroki Sato)
Date: Mon Jan 5 08:34:15 2009
Subject: svn commit: r186763 - stable/7/release/doc/en_US.ISO8859-1/errata
Message-ID: <200901050833.n058Xvxf089555@svn.freebsd.org>
Author: hrs
Date: Mon Jan 5 08:33:56 2009
New Revision: 186763
URL: http://svn.freebsd.org/changeset/base/186763
Log:
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
Modified:
stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml
Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml
==============================================================================
--- stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Mon Jan 5 06:02:17 2009 (r186762)
+++ stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Mon Jan 5 08:33:56 2009 (r186763)
@@ -195,6 +195,10 @@ em0@pci0:0:25:0: class=0x020000 card=0x0
check the fourth column. If that says
chip=0x10a78086 (or one of the other two IDs
given above) you will have the adapter's name change.
+
+
+
+ Late-Breaking News and Corrections
[20090105] The Release Notes for 7.1-RELEASE should have mentioned
changes that the &man.ae.4; driver has been added to provide support
@@ -213,12 +217,129 @@ em0@pci0:0:25:0: class=0x020000 card=0x0
-
+ [20090105] The Release Notes for 7.1-RELEASE should have
+ mentioned changes that the &man.jme.4; driver has been added to
+ provide support for PCIe adapters based on JMicron JMC250
+ gigabit Ethernet and JMC260 fast Ethernet controllers.
+
+ [20090105] The Release Notes for 7.1-RELEASE should have
+ mentioned changes that the &man.age.4; driver has been added to
+ provide support for Attansic/Atheros L1 gigabit Ethernet
+ controller.
+
+ [20090105] The Release Notes for 7.1-RELEASE should have
+ mentioned changes that the &man.malo.4; driver has been added to
+ provide support for Marvell Libertas 88W8335 based PCI network
+ adapters.
+
+ [20090105] The Release Notes for 7.1-RELEASE should have
+ mentioned changes that the bm(4) driver has been added to
+ provide support for Apple Big Mac (BMAC) Ethernet controller,
+ found on various Apple G3 models.
+
+ [20090105] The Release Notes for 7.1-RELEASE should have
+ mentioned changes that the et(4) driver has been added to
+ provide support for Agere ET1310 10/100/Gigabit Ethernet
+ controller.
+
+ [20090105] The Release Notes for 7.1-RELEASE should have
+ mentioned changes that the &man.glxsb.4; driver has been added
+ to provide support for the Security Block in AMD Geode LX
+ processors.
+
+ [20090105] The Release Notes for 7.1-RELEASE should have
+ mentioned that &os; now supports multiple routing tables. To
+ enable this, the following steps are needed:
-
- Late-Breaking News and Corrections
+
+
+ Add the following kernel configuration option and
+ rebuild the kernel. The 2 is the
+ number of FIB (the maximum value is 16).
+
+ options ROUTETABLES=2
+
+ The procedure for rebuilding the &os; kernel is
+ described in the &os;
+ Handbook.
+
+ This number can be modified on boot time. To do so, add
+ the following to /boot/loader.conf and
+ reboot the system:
- No news.
-
+ net.fibs=6
+
+
+ Set a loader tunable net.my_fibnum if
+ needed. This means the default number of routing tables.
+ If not specified, 0 will be used.
+
+
+
+ Set a loader tunable
+ net.add_addr_allfibs if needed. This
+ enables to add routes to all FIBs for new interfaces by
+ default. When this is set to 0, it will
+ only allocate routes on interface changes for the FIB of the
+ caller when adding a new set of addresses to an interface.
+ Note that this tunable is set to 1 by
+ default.
+
+
+
+ To select one of the FIBs, the new &man.setfib.1; utility
+ can be used. This set an associated FIB with the process. For
+ example:
+
+ &prompt.root; setfib -3 ping target.example.com
+
+ The FIB #3 will be used for the &man.ping.8; command.
+
+ The FIB which the packet will be associated with will be
+ determined in the following rules:
+
+
+
+ All packets which have a FIB associated with them will
+ use the FIB. If not, FIB #0 will be used.
+
+
+
+ A packet received on an interface for forwarding uses
+ FIB #0.
+
+
+
+ A TCP listen socket associated with an FIB will generate
+ accept sockets which are associated with the same FIB.
+
+
+
+ A packet generated in response to other packet uses the
+ FIB associated with the packet being responded to.
+
+
+
+ A packet generated on tunnel interfaces such as
+ &man.gif.4; and &man.tun.4; will be encapsulated using the
+ FIB of the process which set up the tunnel.
+
+
+
+ Routing messages will be associated with the process's
+ FIB.
+
+
+
+ Also, the &man.ipfw.8; now supports an action rule
+ setfib. The following action:
+
+ setfib fibnum
+
+ will make the matched packet use the FIB specified in
+ fibnum. The rule processing
+ continues at the next rule.
+
From hrs at FreeBSD.org Mon Jan 5 08:56:48 2009
From: hrs at FreeBSD.org (Hiroki Sato)
Date: Mon Jan 5 08:57:00 2009
Subject: svn commit: r186764 - stable/7/release/doc/en_US.ISO8859-1/errata
Message-ID: <200901050856.n058ujil089969@svn.freebsd.org>
Author: hrs
Date: Mon Jan 5 08:56:45 2009
New Revision: 186764
URL: http://svn.freebsd.org/changeset/base/186764
Log:
Add explanation of FIB.
Modified:
stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml
Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml
==============================================================================
--- stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Mon Jan 5 08:33:56 2009 (r186763)
+++ stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Mon Jan 5 08:56:45 2009 (r186764)
@@ -254,8 +254,9 @@ em0@pci0:0:25:0: class=0x020000 card=0x0
Add the following kernel configuration option and
- rebuild the kernel. The 2 is the
- number of FIB (the maximum value is 16).
+ rebuild the kernel. The 2 is the number
+ of FIB (Forward Information Base, synonym for a routing
+ table here). The maximum value is 16.
options ROUTETABLES=2
From flz at FreeBSD.org Mon Jan 5 13:10:07 2009
From: flz at FreeBSD.org (Florent Thoumie)
Date: Mon Jan 5 13:10:14 2009
Subject: svn commit: r186773 - in stable/7/usr.sbin/pkg_install: . create lib
Message-ID: <200901051310.n05DA6UQ097067@svn.freebsd.org>
Author: flz
Date: Mon Jan 5 13:10:06 2009
New Revision: 186773
URL: http://svn.freebsd.org/changeset/base/186773
Log:
Synchronize pkg_install with HEAD (20080708):
r180361: actually enable '-n' for pkg_create(1)
r181376: use humanize_number to report pen-sizes
Modified:
stable/7/usr.sbin/pkg_install/ (props changed)
stable/7/usr.sbin/pkg_install/Makefile.inc
stable/7/usr.sbin/pkg_install/create/main.c
stable/7/usr.sbin/pkg_install/lib/lib.h
stable/7/usr.sbin/pkg_install/lib/pen.c
Modified: stable/7/usr.sbin/pkg_install/Makefile.inc
==============================================================================
--- stable/7/usr.sbin/pkg_install/Makefile.inc Mon Jan 5 13:06:03 2009 (r186772)
+++ stable/7/usr.sbin/pkg_install/Makefile.inc Mon Jan 5 13:10:06 2009 (r186773)
@@ -4,6 +4,9 @@
LIBINSTALL= ${.OBJDIR}/../lib/libinstall.a
+DPADD+= ${LIBUTIL}
+LDADD+= -lutil
+
.if ${MK_OPENSSL} != "no" && \
defined(LDADD) && ${LDADD:M-lfetch} != ""
DPADD+= ${LIBSSL} ${LIBCRYPTO}
Modified: stable/7/usr.sbin/pkg_install/create/main.c
==============================================================================
--- stable/7/usr.sbin/pkg_install/create/main.c Mon Jan 5 13:06:03 2009 (r186772)
+++ stable/7/usr.sbin/pkg_install/create/main.c Mon Jan 5 13:10:06 2009 (r186773)
@@ -208,6 +208,10 @@ main(int argc, char **argv)
Recursive = TRUE;
break;
+ case 'n':
+ Regenerate = FALSE;
+ break;
+
case 0:
if (Help)
usage();
Modified: stable/7/usr.sbin/pkg_install/lib/lib.h
==============================================================================
--- stable/7/usr.sbin/pkg_install/lib/lib.h Mon Jan 5 13:06:03 2009 (r186772)
+++ stable/7/usr.sbin/pkg_install/lib/lib.h Mon Jan 5 13:10:06 2009 (r186773)
@@ -105,7 +105,7 @@
* Version of the package tools - increase only when some
* functionality used by bsd.port.mk is changed, added or removed
*/
-#define PKG_INSTALL_VERSION 20080612
+#define PKG_INSTALL_VERSION 20080708
#define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf"
#define main(argc, argv) real_main(argc, argv)
Modified: stable/7/usr.sbin/pkg_install/lib/pen.c
==============================================================================
--- stable/7/usr.sbin/pkg_install/lib/pen.c Mon Jan 5 13:06:03 2009 (r186772)
+++ stable/7/usr.sbin/pkg_install/lib/pen.c Mon Jan 5 13:10:06 2009 (r186773)
@@ -23,6 +23,7 @@ __FBSDID("$FreeBSD$");
#include "lib.h"
#include
+#include
#include
#include
#include
@@ -44,6 +45,7 @@ find_play_pen(char *pen, off_t sz)
{
char *cp;
struct stat sb;
+ char humbuf[6];
if (pen[0] && isdir(dirname(pen)) == TRUE && (min_free(dirname(pen)) >= sz))
return pen;
@@ -59,10 +61,12 @@ find_play_pen(char *pen, off_t sz)
strcpy(pen, "/usr/tmp/instmp.XXXXXX");
else {
cleanup(0);
+ humanize_number(humbuf, sizeof humbuf, sz, "", HN_AUTOSCALE,
+ HN_NOSPACE);
errx(2,
"%s: can't find enough temporary space to extract the files, please set your\n"
-"PKG_TMPDIR environment variable to a location with at least %ld bytes\n"
-"free", __func__, (long)sz);
+"PKG_TMPDIR environment variable to a location with at least %s bytes\n"
+"free", __func__, humbuf);
return NULL;
}
return pen;
@@ -98,6 +102,8 @@ popPen(char *pen)
char *
make_playpen(char *pen, off_t sz)
{
+ char humbuf1[6], humbuf2[6];
+
if (!find_play_pen(pen, sz))
return NULL;
@@ -111,8 +117,13 @@ make_playpen(char *pen, off_t sz)
}
if (Verbose) {
- if (sz)
- fprintf(stderr, "Requested space: %d bytes, free space: %lld bytes in %s\n", (int)sz, (long long)min_free(pen), pen);
+ if (sz) {
+ humanize_number(humbuf1, sizeof humbuf1, sz, "", HN_AUTOSCALE,
+ HN_NOSPACE);
+ humanize_number(humbuf2, sizeof humbuf2, min_free(pen),
+ "", HN_AUTOSCALE, HN_NOSPACE);
+ fprintf(stderr, "Requested space: %s bytes, free space: %s bytes in %s\n", humbuf1, humbuf2, pen);
+ }
}
if (min_free(pen) < sz) {
From hrs at FreeBSD.org Mon Jan 5 15:38:47 2009
From: hrs at FreeBSD.org (Hiroki Sato)
Date: Mon Jan 5 15:38:59 2009
Subject: svn commit: r186782 - stable/7/release/doc/en_US.ISO8859-1/errata
Message-ID: <200901051538.n05FcjU8000460@svn.freebsd.org>
Author: hrs
Date: Mon Jan 5 15:38:45 2009
New Revision: 186782
URL: http://svn.freebsd.org/changeset/base/186782
Log:
Add more missing bits: procstat(1).
Modified:
stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml
Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml
==============================================================================
--- stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Mon Jan 5 15:18:16 2009 (r186781)
+++ stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Mon Jan 5 15:38:45 2009 (r186782)
@@ -200,6 +200,13 @@ em0@pci0:0:25:0: class=0x020000 card=0x0
Late-Breaking News and Corrections
+ [20090105] The Release Notes for 7.1-RELEASE should have
+ mentioned that the &man.procstat.1; utility has been added.
+ This is a process inspection utility which provides both some of
+ the missing functionality from &man.procfs.5; and new
+ functionality for monitoring and debugging specific
+ processes.
+
[20090105] The Release Notes for 7.1-RELEASE should have mentioned
changes that the &man.ae.4; driver has been added to provide support
for the Attansic/Atheros L2 FastEthernet controllers.
From mav at FreeBSD.org Mon Jan 5 19:40:11 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Mon Jan 5 19:40:24 2009
Subject: svn commit: r186786 - stable/7/sys/dev/mmc
Message-ID: <200901051940.n05Je9pD008934@svn.freebsd.org>
Author: mav
Date: Mon Jan 5 19:40:09 2009
New Revision: 186786
URL: http://svn.freebsd.org/changeset/base/186786
Log:
Sync MMC/SD subsystem with HEAD.
Add support for MMC and SDHC cards, high speed timing, wide bus, multiblock
transfers and many other features.
Modified:
stable/7/sys/dev/mmc/bridge.h
stable/7/sys/dev/mmc/mmc.c
stable/7/sys/dev/mmc/mmcbrvar.h
stable/7/sys/dev/mmc/mmcreg.h
stable/7/sys/dev/mmc/mmcsd.c
stable/7/sys/dev/mmc/mmcvar.h
Modified: stable/7/sys/dev/mmc/bridge.h
==============================================================================
--- stable/7/sys/dev/mmc/bridge.h Mon Jan 5 17:38:03 2009 (r186785)
+++ stable/7/sys/dev/mmc/bridge.h Mon Jan 5 19:40:09 2009 (r186786)
@@ -104,6 +104,10 @@ enum mmc_bus_width {
bus_width_1 = 0, bus_width_4 = 2, bus_width_8 = 3
};
+enum mmc_bus_timing {
+ bus_timing_normal = 0, bus_timing_hs
+};
+
struct mmc_ios {
uint32_t clock; /* Speed of the clock in Hz to move data */
enum mmc_vdd vdd; /* Voltage to apply to the power pins/ */
@@ -111,6 +115,7 @@ struct mmc_ios {
enum mmc_chip_select chip_select;
enum mmc_bus_width bus_width;
enum mmc_power_mode power_mode;
+ enum mmc_bus_timing timing;
};
enum mmc_card_mode {
@@ -125,6 +130,7 @@ struct mmc_host {
uint32_t caps;
#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can do 4-bit data transfers */
#define MMC_CAP_8_BIT_DATA (1 << 1) /* Can do 8-bit data transfers */
+#define MMC_CAP_HSPEED (1 << 2) /* Can do High Speed transfers */
enum mmc_card_mode mode;
struct mmc_ios ios; /* Current state of the host */
};
Modified: stable/7/sys/dev/mmc/mmc.c
==============================================================================
--- stable/7/sys/dev/mmc/mmc.c Mon Jan 5 17:38:03 2009 (r186785)
+++ stable/7/sys/dev/mmc/mmc.c Mon Jan 5 19:40:09 2009 (r186786)
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
#include
@@ -82,10 +83,23 @@ struct mmc_softc {
struct mmc_ivars {
uint32_t raw_cid[4]; /* Raw bits of the CID */
uint32_t raw_csd[4]; /* Raw bits of the CSD */
+ uint32_t raw_scr[2]; /* Raw bits of the SCR */
+ uint8_t raw_ext_csd[512]; /* Raw bits of the EXT_CSD */
+ uint32_t raw_sd_status[16]; /* Raw bits of the SD_STATUS */
uint16_t rca;
enum mmc_card_mode mode;
struct mmc_cid cid; /* cid decoded */
struct mmc_csd csd; /* csd decoded */
+ struct mmc_scr scr; /* scr decoded */
+ struct mmc_sd_status sd_status; /* SD_STATUS decoded */
+ u_char read_only; /* True when the device is read-only */
+ u_char bus_width; /* Bus width to use */
+ u_char timing; /* Bus timing support */
+ u_char high_cap; /* High Capacity card (block addressed) */
+ uint32_t sec_count; /* Card capacity in 512byte blocks */
+ uint32_t tran_speed; /* Max speed in normal mode */
+ uint32_t hs_tran_speed; /* Max speed in high speed mode */
+ uint32_t erase_sector; /* Card native erase sector size */
};
#define CMD_RETRIES 3
@@ -94,21 +108,32 @@ struct mmc_ivars {
static int mmc_probe(device_t dev);
static int mmc_attach(device_t dev);
static int mmc_detach(device_t dev);
+static int mmc_suspend(device_t dev);
+static int mmc_resume(device_t dev);
#define MMC_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
#define MMC_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
-#define MMC_LOCK_INIT(_sc) \
- mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \
+#define MMC_LOCK_INIT(_sc) \
+ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \
"mmc", MTX_DEF)
#define MMC_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx);
#define MMC_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED);
#define MMC_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED);
+static int mmc_calculate_clock(struct mmc_softc *sc);
static void mmc_delayed_attach(void *);
+static void mmc_power_down(struct mmc_softc *sc);
static int mmc_wait_for_cmd(struct mmc_softc *sc, struct mmc_command *cmd,
int retries);
static int mmc_wait_for_command(struct mmc_softc *sc, uint32_t opcode,
uint32_t arg, uint32_t flags, uint32_t *resp, int retries);
+static int mmc_select_card(struct mmc_softc *sc, uint16_t rca);
+static int mmc_set_card_bus_width(struct mmc_softc *sc, uint16_t rca, int width);
+static int mmc_app_send_scr(struct mmc_softc *sc, uint16_t rca, uint32_t *rawscr);
+static void mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr);
+static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd);
+static void mmc_scan(struct mmc_softc *sc);
+static int mmc_delete_cards(struct mmc_softc *sc);
static void
mmc_ms_delay(int ms)
@@ -120,7 +145,7 @@ static int
mmc_probe(device_t dev)
{
- device_set_desc(dev, "mmc/sd bus");
+ device_set_desc(dev, "MMC/SD bus");
return (0);
}
@@ -145,35 +170,47 @@ static int
mmc_detach(device_t dev)
{
struct mmc_softc *sc = device_get_softc(dev);
- device_t *kids;
- int i, nkid;
-
- /* kill children [ph33r]. -sorbo */
- if (device_get_children(sc->dev, &kids, &nkid) != 0)
- return 0;
- for (i = 0; i < nkid; i++) {
- device_t kid = kids[i];
- void *ivar = device_get_ivars(kid);
-
- device_detach(kid);
- device_delete_child(sc->dev, kid);
- free(ivar, M_DEVBUF);
- }
- free(kids, M_TEMP);
+ int err;
+ if ((err = mmc_delete_cards(sc)) != 0)
+ return (err);
+ mmc_power_down(sc);
MMC_LOCK_DESTROY(sc);
- return 0;
+ return (0);
+}
+
+static int
+mmc_suspend(device_t dev)
+{
+ struct mmc_softc *sc = device_get_softc(dev);
+ int err;
+
+ err = bus_generic_suspend(dev);
+ if (err)
+ return (err);
+ mmc_power_down(sc);
+ return (0);
+}
+
+static int
+mmc_resume(device_t dev)
+{
+ struct mmc_softc *sc = device_get_softc(dev);
+
+ mmc_scan(sc);
+ return (bus_generic_resume(dev));
}
static int
mmc_acquire_bus(device_t busdev, device_t dev)
{
struct mmc_softc *sc;
+ struct mmc_ivars *ivar;
int err;
int rca;
- err = MMCBR_ACQUIRE_HOST(device_get_parent(busdev), dev);
+ err = MMCBR_ACQUIRE_HOST(device_get_parent(busdev), busdev);
if (err)
return (err);
sc = device_get_softc(busdev);
@@ -184,24 +221,36 @@ mmc_acquire_bus(device_t busdev, device_
MMC_UNLOCK(sc);
if (busdev != dev) {
- // Keep track of the last rca that we've selected. If
- // we're asked to do it again, don't. We never unselect
- // unless the bus code itself wants the mmc bus.
+ /*
+ * Keep track of the last rca that we've selected. If
+ * we're asked to do it again, don't. We never
+ * unselect unless the bus code itself wants the mmc
+ * bus, and constantly reselecting causes problems.
+ */
rca = mmc_get_rca(dev);
if (sc->last_rca != rca) {
- mmc_wait_for_command(sc, MMC_SELECT_CARD, rca << 16,
- MMC_RSP_R1 | MMC_CMD_AC, NULL, CMD_RETRIES);
+ mmc_select_card(sc, rca);
sc->last_rca = rca;
+ /* Prepare bus width for the new card. */
+ ivar = device_get_ivars(dev);
+ if (bootverbose) {
+ device_printf(busdev,
+ "setting bus width to %d bits\n",
+ (ivar->bus_width == bus_width_4) ? 4 :
+ (ivar->bus_width == bus_width_8) ? 8 : 1);
+ }
+ mmc_set_card_bus_width(sc, rca, ivar->bus_width);
+ mmcbr_set_bus_width(busdev, ivar->bus_width);
+ mmcbr_update_ios(busdev);
}
- // XXX should set bus width here?
} else {
- // If there's a card selected, stand down.
+ /*
+ * If there's a card selected, stand down.
+ */
if (sc->last_rca != 0) {
- mmc_wait_for_command(sc, MMC_SELECT_CARD, 0,
- MMC_RSP_R1 | MMC_CMD_AC, NULL, CMD_RETRIES);
+ mmc_select_card(sc, 0);
sc->last_rca = 0;
}
- // XXX should set bus width here?
}
return (0);
@@ -221,7 +270,7 @@ mmc_release_bus(device_t busdev, device_
if (sc->owner != dev)
panic("mmc: you don't own the bus. game over.");
MMC_UNLOCK(sc);
- err = MMCBR_RELEASE_HOST(device_get_parent(busdev), dev);
+ err = MMCBR_RELEASE_HOST(device_get_parent(busdev), busdev);
if (err)
return (err);
MMC_LOCK(sc);
@@ -230,17 +279,11 @@ mmc_release_bus(device_t busdev, device_
return (0);
}
-static void
-mmc_rescan_cards(struct mmc_softc *sc)
-{
- /* XXX: Look at the children and see if they respond to status */
-}
-
static uint32_t
mmc_select_vdd(struct mmc_softc *sc, uint32_t ocr)
{
- // XXX
- return ocr;
+
+ return (ocr & MMC_OCR_VOLTAGE);
}
static int
@@ -250,7 +293,7 @@ mmc_highest_voltage(uint32_t ocr)
for (i = 30; i >= 0; i--)
if (ocr & (1 << i))
- return i;
+ return (i);
return (-1);
}
@@ -259,31 +302,25 @@ mmc_wakeup(struct mmc_request *req)
{
struct mmc_softc *sc;
-// printf("Wakeup for req %p done_data %p\n", req, req->done_data);
sc = (struct mmc_softc *)req->done_data;
MMC_LOCK(sc);
req->flags |= MMC_REQ_DONE;
- wakeup(req);
MMC_UNLOCK(sc);
+ wakeup(req);
}
static int
mmc_wait_for_req(struct mmc_softc *sc, struct mmc_request *req)
{
- int err;
req->done = mmc_wakeup;
req->done_data = sc;
-// printf("Submitting request %p sc %p\n", req, sc);
MMCBR_REQUEST(device_get_parent(sc->dev), sc->dev, req);
MMC_LOCK(sc);
- do {
- err = msleep(req, &sc->sc_mtx, PZERO | PCATCH, "mmcreq",
- hz / 10);
- } while (!(req->flags & MMC_REQ_DONE) && err == EAGAIN);
-// printf("Request %p done with error %d\n", req, err);
+ while ((req->flags & MMC_REQ_DONE) == 0)
+ msleep(req, &sc->sc_mtx, 0, "mmcreq", 0);
MMC_UNLOCK(sc);
- return (err);
+ return (0);
}
static int
@@ -291,7 +328,7 @@ mmc_wait_for_request(device_t brdev, dev
{
struct mmc_softc *sc = device_get_softc(brdev);
- return mmc_wait_for_req(sc, req);
+ return (mmc_wait_for_req(sc, req));
}
static int
@@ -302,9 +339,8 @@ mmc_wait_for_cmd(struct mmc_softc *sc, s
memset(&mreq, 0, sizeof(mreq));
memset(cmd->resp, 0, sizeof(cmd->resp));
cmd->retries = retries;
- cmd->data = NULL;
mreq.cmd = cmd;
-// printf("CMD: %x ARG %x\n", cmd->opcode, cmd->arg);
+/* printf("CMD: %x ARG %x\n", cmd->opcode, cmd->arg); */
mmc_wait_for_req(sc, &mreq);
return (cmd->error);
}
@@ -320,6 +356,7 @@ mmc_wait_for_app_cmd(struct mmc_softc *s
appcmd.opcode = MMC_APP_CMD;
appcmd.arg = rca << 16;
appcmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
+ appcmd.data = NULL;
mmc_wait_for_cmd(sc, &appcmd, 0);
err = appcmd.error;
if (err != MMC_ERR_NONE)
@@ -345,6 +382,7 @@ mmc_wait_for_command(struct mmc_softc *s
cmd.opcode = opcode;
cmd.arg = arg;
cmd.flags = flags;
+ cmd.data = NULL;
err = mmc_wait_for_cmd(sc, &cmd, retries);
if (err)
return (err);
@@ -374,6 +412,7 @@ mmc_idle_cards(struct mmc_softc *sc)
cmd.opcode = MMC_GO_IDLE_STATE;
cmd.arg = 0;
cmd.flags = MMC_RSP_NONE | MMC_CMD_BC;
+ cmd.data = NULL;
mmc_wait_for_cmd(sc, &cmd, 0);
mmc_ms_delay(1);
@@ -392,19 +431,21 @@ mmc_send_app_op_cond(struct mmc_softc *s
cmd.opcode = ACMD_SD_SEND_OP_COND;
cmd.arg = ocr;
cmd.flags = MMC_RSP_R3 | MMC_CMD_BCR;
+ cmd.data = NULL;
for (i = 0; i < 100; i++) {
err = mmc_wait_for_app_cmd(sc, 0, &cmd, CMD_RETRIES);
if (err != MMC_ERR_NONE)
break;
- if ((cmd.resp[0] & MMC_OCR_CARD_BUSY) || ocr == 0)
+ if ((cmd.resp[0] & MMC_OCR_CARD_BUSY) ||
+ (ocr & MMC_OCR_VOLTAGE) == 0)
break;
err = MMC_ERR_TIMEOUT;
mmc_ms_delay(10);
}
if (rocr && err == MMC_ERR_NONE)
*rocr = cmd.resp[0];
- return err;
+ return (err);
}
static int
@@ -417,19 +458,37 @@ mmc_send_op_cond(struct mmc_softc *sc, u
cmd.opcode = MMC_SEND_OP_COND;
cmd.arg = ocr;
cmd.flags = MMC_RSP_R3 | MMC_CMD_BCR;
+ cmd.data = NULL;
for (i = 0; i < 100; i++) {
err = mmc_wait_for_cmd(sc, &cmd, CMD_RETRIES);
if (err != MMC_ERR_NONE)
break;
- if ((cmd.resp[0] & MMC_OCR_CARD_BUSY) || ocr == 0)
+ if ((cmd.resp[0] & MMC_OCR_CARD_BUSY) ||
+ (ocr & MMC_OCR_VOLTAGE) == 0)
break;
err = MMC_ERR_TIMEOUT;
mmc_ms_delay(10);
}
if (rocr && err == MMC_ERR_NONE)
*rocr = cmd.resp[0];
- return err;
+ return (err);
+}
+
+static int
+mmc_send_if_cond(struct mmc_softc *sc, uint8_t vhs)
+{
+ struct mmc_command cmd;
+ int err;
+
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.opcode = SD_SEND_IF_COND;
+ cmd.arg = (vhs << 8) + 0xAA;
+ cmd.flags = MMC_RSP_R7 | MMC_CMD_BCR;
+ cmd.data = NULL;
+
+ err = mmc_wait_for_cmd(sc, &cmd, CMD_RETRIES);
+ return (err);
}
static void
@@ -448,43 +507,269 @@ mmc_power_up(struct mmc_softc *sc)
mmc_ms_delay(1);
mmcbr_set_clock(dev, mmcbr_get_f_min(sc->dev));
+ mmcbr_set_timing(dev, bus_timing_normal);
mmcbr_set_power_mode(dev, power_on);
mmcbr_update_ios(dev);
mmc_ms_delay(2);
}
-// I wonder if the following is endian safe.
+static void
+mmc_power_down(struct mmc_softc *sc)
+{
+ device_t dev = sc->dev;
+
+ mmcbr_set_bus_mode(dev, opendrain);
+ mmcbr_set_chip_select(dev, cs_dontcare);
+ mmcbr_set_bus_width(dev, bus_width_1);
+ mmcbr_set_power_mode(dev, power_off);
+ mmcbr_set_clock(dev, 0);
+ mmcbr_set_timing(dev, bus_timing_normal);
+ mmcbr_update_ios(dev);
+}
+
+static int
+mmc_select_card(struct mmc_softc *sc, uint16_t rca)
+{
+ int flags;
+
+ flags = (rca ? MMC_RSP_R1B : MMC_RSP_NONE) | MMC_CMD_AC;
+ return (mmc_wait_for_command(sc, MMC_SELECT_CARD, (uint32_t)rca << 16,
+ flags, NULL, CMD_RETRIES));
+}
+
+static int
+mmc_switch(struct mmc_softc *sc, uint8_t set, uint8_t index, uint8_t value)
+{
+ struct mmc_command cmd;
+ int err;
+
+ cmd.opcode = MMC_SWITCH_FUNC;
+ cmd.arg = (MMC_SWITCH_FUNC_WR << 24) |
+ (index << 16) |
+ (value << 8) |
+ set;
+ cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;
+ cmd.data = NULL;
+ err = mmc_wait_for_cmd(sc, &cmd, 0);
+ return (err);
+}
+
+static int
+mmc_sd_switch(struct mmc_softc *sc, uint8_t mode, uint8_t grp, uint8_t value, uint8_t *res)
+{
+ int err;
+ struct mmc_command cmd;
+ struct mmc_data data;
+
+ memset(&cmd, 0, sizeof(struct mmc_command));
+ memset(&data, 0, sizeof(struct mmc_data));
+
+ memset(res, 0, 64);
+ cmd.opcode = SD_SWITCH_FUNC;
+ cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
+ cmd.arg = mode << 31;
+ cmd.arg |= 0x00FFFFFF;
+ cmd.arg &= ~(0xF << (grp * 4));
+ cmd.arg |= value << (grp * 4);
+ cmd.data = &data;
+
+ data.data = res;
+ data.len = 64;
+ data.flags = MMC_DATA_READ;
+
+ err = mmc_wait_for_cmd(sc, &cmd, CMD_RETRIES);
+ return (err);
+}
+
+static int
+mmc_set_card_bus_width(struct mmc_softc *sc, uint16_t rca, int width)
+{
+ int err;
+
+ if (mmcbr_get_mode(sc->dev) == mode_sd) {
+ struct mmc_command cmd;
+
+ memset(&cmd, 0, sizeof(struct mmc_command));
+ cmd.opcode = ACMD_SET_BUS_WIDTH;
+ cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
+ switch (width) {
+ case bus_width_1:
+ cmd.arg = SD_BUS_WIDTH_1;
+ break;
+ case bus_width_4:
+ cmd.arg = SD_BUS_WIDTH_4;
+ break;
+ default:
+ return (MMC_ERR_INVALID);
+ }
+ err = mmc_wait_for_app_cmd(sc, rca, &cmd, CMD_RETRIES);
+ } else {
+ uint8_t value;
+
+ switch (width) {
+ case bus_width_1:
+ value = EXT_CSD_BUS_WIDTH_1;
+ break;
+ case bus_width_4:
+ value = EXT_CSD_BUS_WIDTH_4;
+ break;
+ case bus_width_8:
+ value = EXT_CSD_BUS_WIDTH_8;
+ break;
+ default:
+ return (MMC_ERR_INVALID);
+ }
+ err = mmc_switch(sc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, value);
+ }
+ return (err);
+}
+
+static int
+mmc_set_timing(struct mmc_softc *sc, int timing)
+{
+ int err;
+ uint8_t value;
+
+ switch (timing) {
+ case bus_timing_normal:
+ value = 0;
+ break;
+ case bus_timing_hs:
+ value = 1;
+ break;
+ default:
+ return (MMC_ERR_INVALID);
+ }
+ if (mmcbr_get_mode(sc->dev) == mode_sd) {
+ u_char switch_res[64];
+
+ err = mmc_sd_switch(sc, 1, 0, value, switch_res);
+ } else {
+ err = mmc_switch(sc, EXT_CSD_CMD_SET_NORMAL,
+ EXT_CSD_HS_TIMING, value);
+ }
+ return (err);
+}
+
+static int
+mmc_test_bus_width(struct mmc_softc *sc)
+{
+ struct mmc_command cmd;
+ struct mmc_data data;
+ int err;
+ uint8_t buf[8];
+ uint8_t p8[8] = { 0x55, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ uint8_t p8ok[8] = { 0xAA, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ uint8_t p4[4] = { 0x5A, 0x00, 0x00, 0x00, };
+ uint8_t p4ok[4] = { 0xA5, 0x00, 0x00, 0x00, };
+
+ if (mmcbr_get_caps(sc->dev) & MMC_CAP_8_BIT_DATA) {
+ mmcbr_set_bus_width(sc->dev, bus_width_8);
+ mmcbr_update_ios(sc->dev);
+
+ cmd.opcode = MMC_BUSTEST_W;
+ cmd.arg = 0;
+ cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
+ cmd.data = &data;
+
+ data.data = p8;
+ data.len = 8;
+ data.flags = MMC_DATA_WRITE;
+ mmc_wait_for_cmd(sc, &cmd, 0);
+
+ cmd.opcode = MMC_BUSTEST_R;
+ cmd.arg = 0;
+ cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
+ cmd.data = &data;
+
+ data.data = buf;
+ data.len = 8;
+ data.flags = MMC_DATA_READ;
+ err = mmc_wait_for_cmd(sc, &cmd, 0);
+
+ mmcbr_set_bus_width(sc->dev, bus_width_1);
+ mmcbr_update_ios(sc->dev);
+
+ if (err == MMC_ERR_NONE && memcmp(buf, p8ok, 8) == 0)
+ return (bus_width_8);
+ }
+
+ if (mmcbr_get_caps(sc->dev) & MMC_CAP_4_BIT_DATA) {
+ mmcbr_set_bus_width(sc->dev, bus_width_4);
+ mmcbr_update_ios(sc->dev);
+
+ cmd.opcode = MMC_BUSTEST_W;
+ cmd.arg = 0;
+ cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
+ cmd.data = &data;
+
+ data.data = p4;
+ data.len = 4;
+ data.flags = MMC_DATA_WRITE;
+ mmc_wait_for_cmd(sc, &cmd, 0);
+
+ cmd.opcode = MMC_BUSTEST_R;
+ cmd.arg = 0;
+ cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
+ cmd.data = &data;
+
+ data.data = buf;
+ data.len = 4;
+ data.flags = MMC_DATA_READ;
+ err = mmc_wait_for_cmd(sc, &cmd, 0);
+
+ mmcbr_set_bus_width(sc->dev, bus_width_1);
+ mmcbr_update_ios(sc->dev);
+
+ if (err == MMC_ERR_NONE && memcmp(buf, p4ok, 4) == 0)
+ return (bus_width_4);
+ }
+ return (bus_width_1);
+}
+
static uint32_t
-mmc_get_bits(uint32_t *bits, int start, int size)
+mmc_get_bits(uint32_t *bits, int bit_len, int start, int size)
{
- const int i = 3 - (start / 32);
+ const int i = (bit_len / 32) - (start / 32) - 1;
const int shift = start & 31;
uint32_t retval = bits[i] >> shift;
if (size + shift > 32)
retval |= bits[i - 1] << (32 - shift);
- return retval & ((1 << size) - 1);
+ return (retval & ((1 << size) - 1));
}
static void
-mmc_decode_cid(int is_sd, uint32_t *raw_cid, struct mmc_cid *cid)
+mmc_decode_cid_sd(uint32_t *raw_cid, struct mmc_cid *cid)
{
int i;
+ /* There's no version info, so we take it on faith */
memset(cid, 0, sizeof(*cid));
- if (is_sd) {
- /* There's no version info, so we take it on faith */
- cid->mid = mmc_get_bits(raw_cid, 120, 8);
- cid->oid = mmc_get_bits(raw_cid, 104, 16);
- for (i = 0; i < 5; i++)
- cid->pnm[i] = mmc_get_bits(raw_cid, 96 - i * 8, 8);
- cid->prv = mmc_get_bits(raw_cid, 56, 8);
- cid->psn = mmc_get_bits(raw_cid, 24, 32);
- cid->mdt_year = mmc_get_bits(raw_cid, 12, 8) + 2001;
- cid->mdt_month = mmc_get_bits(raw_cid, 8, 4);
- } else {
- // XXX write me
- panic("write mmc cid decoder");
- }
+ cid->mid = mmc_get_bits(raw_cid, 128, 120, 8);
+ cid->oid = mmc_get_bits(raw_cid, 128, 104, 16);
+ for (i = 0; i < 5; i++)
+ cid->pnm[i] = mmc_get_bits(raw_cid, 128, 96 - i * 8, 8);
+ cid->prv = mmc_get_bits(raw_cid, 128, 56, 8);
+ cid->psn = mmc_get_bits(raw_cid, 128, 24, 32);
+ cid->mdt_year = mmc_get_bits(raw_cid, 128, 12, 8) + 2001;
+ cid->mdt_month = mmc_get_bits(raw_cid, 128, 8, 4);
+}
+
+static void
+mmc_decode_cid_mmc(uint32_t *raw_cid, struct mmc_cid *cid)
+{
+ int i;
+
+ /* There's no version info, so we take it on faith */
+ memset(cid, 0, sizeof(*cid));
+ cid->mid = mmc_get_bits(raw_cid, 128, 120, 8);
+ cid->oid = mmc_get_bits(raw_cid, 128, 104, 8);
+ for (i = 0; i < 6; i++)
+ cid->pnm[i] = mmc_get_bits(raw_cid, 128, 96 - i * 8, 8);
+ cid->prv = mmc_get_bits(raw_cid, 128, 48, 8);
+ cid->psn = mmc_get_bits(raw_cid, 128, 16, 32);
+ cid->mdt_month = mmc_get_bits(raw_cid, 128, 12, 4);
+ cid->mdt_year = mmc_get_bits(raw_cid, 128, 8, 4) + 1997;
}
static const int exp[8] = {
@@ -501,50 +786,142 @@ static const int cur_max[8] = {
};
static void
-mmc_decode_csd(int is_sd, uint32_t *raw_csd, struct mmc_csd *csd)
+mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd)
{
int v;
int m;
int e;
memset(csd, 0, sizeof(*csd));
- if (is_sd) {
- csd->csd_structure = v = mmc_get_bits(raw_csd, 126, 2);
- if (v == 0) {
- m = mmc_get_bits(raw_csd, 115, 4);
- e = mmc_get_bits(raw_csd, 112, 3);
- csd->tacc = exp[e] * mant[m] + 9 / 10;
- csd->nsac = mmc_get_bits(raw_csd, 104, 8) * 100;
- m = mmc_get_bits(raw_csd, 99, 4);
- e = mmc_get_bits(raw_csd, 96, 3);
- csd->tran_speed = exp[e] * 10000 * mant[m];
- csd->ccc = mmc_get_bits(raw_csd, 84, 12);
- csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 80, 4);
- csd->read_bl_partial = mmc_get_bits(raw_csd, 79, 1);
- csd->write_blk_misalign = mmc_get_bits(raw_csd, 78, 1);
- csd->read_blk_misalign = mmc_get_bits(raw_csd, 77, 1);
- csd->dsr_imp = mmc_get_bits(raw_csd, 76, 1);
- csd->vdd_r_curr_min = cur_min[mmc_get_bits(raw_csd, 59, 3)];
- csd->vdd_r_curr_max = cur_max[mmc_get_bits(raw_csd, 56, 3)];
- csd->vdd_w_curr_min = cur_min[mmc_get_bits(raw_csd, 53, 3)];
- csd->vdd_w_curr_max = cur_max[mmc_get_bits(raw_csd, 50, 3)];
- m = mmc_get_bits(raw_csd, 62, 12);
- e = mmc_get_bits(raw_csd, 47, 3);
- csd->capacity = ((1 + m) << (e + 2)) * csd->read_bl_len;
- csd->erase_blk_en = mmc_get_bits(raw_csd, 46, 1);
- csd->sector_size = mmc_get_bits(raw_csd, 39, 7);
- csd->wp_grp_size = mmc_get_bits(raw_csd, 32, 7);
- csd->wp_grp_enable = mmc_get_bits(raw_csd, 31, 1);
- csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 26, 3);
- csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 22, 4);
- csd->write_bl_partial = mmc_get_bits(raw_csd, 21, 1);
- } else if (v == 1) {
- panic("Write SDHC CSD parser");
- } else
- panic("unknown SD CSD version");
- } else {
- panic("Write a MMC CSD parser");
+ csd->csd_structure = v = mmc_get_bits(raw_csd, 128, 126, 2);
+ if (v == 0) {
+ m = mmc_get_bits(raw_csd, 128, 115, 4);
+ e = mmc_get_bits(raw_csd, 128, 112, 3);
+ csd->tacc = exp[e] * mant[m] + 9 / 10;
+ csd->nsac = mmc_get_bits(raw_csd, 128, 104, 8) * 100;
+ m = mmc_get_bits(raw_csd, 128, 99, 4);
+ e = mmc_get_bits(raw_csd, 128, 96, 3);
+ csd->tran_speed = exp[e] * 10000 * mant[m];
+ csd->ccc = mmc_get_bits(raw_csd, 128, 84, 12);
+ csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 128, 80, 4);
+ csd->read_bl_partial = mmc_get_bits(raw_csd, 128, 79, 1);
+ csd->write_blk_misalign = mmc_get_bits(raw_csd, 128, 78, 1);
+ csd->read_blk_misalign = mmc_get_bits(raw_csd, 128, 77, 1);
+ csd->dsr_imp = mmc_get_bits(raw_csd, 128, 76, 1);
+ csd->vdd_r_curr_min = cur_min[mmc_get_bits(raw_csd, 128, 59, 3)];
+ csd->vdd_r_curr_max = cur_max[mmc_get_bits(raw_csd, 128, 56, 3)];
+ csd->vdd_w_curr_min = cur_min[mmc_get_bits(raw_csd, 128, 53, 3)];
+ csd->vdd_w_curr_max = cur_max[mmc_get_bits(raw_csd, 128, 50, 3)];
+ m = mmc_get_bits(raw_csd, 128, 62, 12);
+ e = mmc_get_bits(raw_csd, 128, 47, 3);
+ csd->capacity = ((1 + m) << (e + 2)) * csd->read_bl_len;
+ csd->erase_blk_en = mmc_get_bits(raw_csd, 128, 46, 1);
+ csd->erase_sector = mmc_get_bits(raw_csd, 128, 39, 7) + 1;
+ csd->wp_grp_size = mmc_get_bits(raw_csd, 128, 32, 7);
+ csd->wp_grp_enable = mmc_get_bits(raw_csd, 128, 31, 1);
+ csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3);
+ csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4);
+ csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1);
+ } else if (v == 1) {
+ m = mmc_get_bits(raw_csd, 128, 115, 4);
+ e = mmc_get_bits(raw_csd, 128, 112, 3);
+ csd->tacc = exp[e] * mant[m] + 9 / 10;
+ csd->nsac = mmc_get_bits(raw_csd, 128, 104, 8) * 100;
+ m = mmc_get_bits(raw_csd, 128, 99, 4);
+ e = mmc_get_bits(raw_csd, 128, 96, 3);
+ csd->tran_speed = exp[e] * 10000 * mant[m];
+ csd->ccc = mmc_get_bits(raw_csd, 128, 84, 12);
+ csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 128, 80, 4);
+ csd->read_bl_partial = mmc_get_bits(raw_csd, 128, 79, 1);
+ csd->write_blk_misalign = mmc_get_bits(raw_csd, 128, 78, 1);
+ csd->read_blk_misalign = mmc_get_bits(raw_csd, 128, 77, 1);
+ csd->dsr_imp = mmc_get_bits(raw_csd, 128, 76, 1);
+ csd->capacity = ((uint64_t)mmc_get_bits(raw_csd, 128, 48, 22) + 1) *
+ 512 * 1024;
+ csd->erase_blk_en = mmc_get_bits(raw_csd, 128, 46, 1);
+ csd->erase_sector = mmc_get_bits(raw_csd, 128, 39, 7) + 1;
+ csd->wp_grp_size = mmc_get_bits(raw_csd, 128, 32, 7);
+ csd->wp_grp_enable = mmc_get_bits(raw_csd, 128, 31, 1);
+ csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3);
+ csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4);
+ csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1);
+ } else
+ panic("unknown SD CSD version");
+}
+
+static void
+mmc_decode_csd_mmc(uint32_t *raw_csd, struct mmc_csd *csd)
+{
+ int m;
+ int e;
+
+ memset(csd, 0, sizeof(*csd));
+ csd->csd_structure = mmc_get_bits(raw_csd, 128, 126, 2);
+ csd->spec_vers = mmc_get_bits(raw_csd, 128, 122, 4);
+ m = mmc_get_bits(raw_csd, 128, 115, 4);
+ e = mmc_get_bits(raw_csd, 128, 112, 3);
+ csd->tacc = exp[e] * mant[m] + 9 / 10;
+ csd->nsac = mmc_get_bits(raw_csd, 128, 104, 8) * 100;
+ m = mmc_get_bits(raw_csd, 128, 99, 4);
+ e = mmc_get_bits(raw_csd, 128, 96, 3);
+ csd->tran_speed = exp[e] * 10000 * mant[m];
+ csd->ccc = mmc_get_bits(raw_csd, 128, 84, 12);
+ csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 128, 80, 4);
+ csd->read_bl_partial = mmc_get_bits(raw_csd, 128, 79, 1);
+ csd->write_blk_misalign = mmc_get_bits(raw_csd, 128, 78, 1);
+ csd->read_blk_misalign = mmc_get_bits(raw_csd, 128, 77, 1);
+ csd->dsr_imp = mmc_get_bits(raw_csd, 128, 76, 1);
+ csd->vdd_r_curr_min = cur_min[mmc_get_bits(raw_csd, 128, 59, 3)];
+ csd->vdd_r_curr_max = cur_max[mmc_get_bits(raw_csd, 128, 56, 3)];
+ csd->vdd_w_curr_min = cur_min[mmc_get_bits(raw_csd, 128, 53, 3)];
+ csd->vdd_w_curr_max = cur_max[mmc_get_bits(raw_csd, 128, 50, 3)];
+ m = mmc_get_bits(raw_csd, 128, 62, 12);
+ e = mmc_get_bits(raw_csd, 128, 47, 3);
+ csd->capacity = ((1 + m) << (e + 2)) * csd->read_bl_len;
+ csd->erase_blk_en = 0;
+ csd->erase_sector = (mmc_get_bits(raw_csd, 128, 42, 5) + 1) *
+ (mmc_get_bits(raw_csd, 128, 37, 5) + 1);
+ csd->wp_grp_size = mmc_get_bits(raw_csd, 128, 32, 5);
+ csd->wp_grp_enable = mmc_get_bits(raw_csd, 128, 31, 1);
+ csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3);
+ csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4);
+ csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1);
+}
+
+static void
+mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr)
+{
+ unsigned int scr_struct;
+
+ memset(scr, 0, sizeof(*scr));
+
+ scr_struct = mmc_get_bits(raw_scr, 64, 60, 4);
+ if (scr_struct != 0) {
+ printf("Unrecognised SCR structure version %d\n",
+ scr_struct);
+ return;
}
+ scr->sda_vsn = mmc_get_bits(raw_scr, 64, 56, 4);
+ scr->bus_widths = mmc_get_bits(raw_scr, 64, 48, 4);
+}
+
+static void
+mmc_app_decode_sd_status(uint32_t *raw_sd_status,
+ struct mmc_sd_status *sd_status)
+{
+
+ memset(sd_status, 0, sizeof(*sd_status));
+
+ sd_status->bus_width = mmc_get_bits(raw_sd_status, 512, 510, 2);
+ sd_status->secured_mode = mmc_get_bits(raw_sd_status, 512, 509, 1);
+ sd_status->card_type = mmc_get_bits(raw_sd_status, 512, 480, 16);
+ sd_status->prot_area = mmc_get_bits(raw_sd_status, 512, 448, 12);
+ sd_status->speed_class = mmc_get_bits(raw_sd_status, 512, 440, 8);
+ sd_status->perf_move = mmc_get_bits(raw_sd_status, 512, 432, 8);
+ sd_status->au_size = mmc_get_bits(raw_sd_status, 512, 428, 4);
+ sd_status->erase_size = mmc_get_bits(raw_sd_status, 512, 408, 16);
+ sd_status->erase_timeout = mmc_get_bits(raw_sd_status, 512, 402, 6);
+ sd_status->erase_offset = mmc_get_bits(raw_sd_status, 512, 400, 2);
}
static int
@@ -556,6 +933,7 @@ mmc_all_send_cid(struct mmc_softc *sc, u
cmd.opcode = MMC_ALL_SEND_CID;
cmd.arg = 0;
cmd.flags = MMC_RSP_R2 | MMC_CMD_BCR;
+ cmd.data = NULL;
err = mmc_wait_for_cmd(sc, &cmd, 0);
memcpy(rawcid, cmd.resp, 4 * sizeof(uint32_t));
return (err);
@@ -570,12 +948,103 @@ mmc_send_csd(struct mmc_softc *sc, uint1
cmd.opcode = MMC_SEND_CSD;
cmd.arg = rca << 16;
cmd.flags = MMC_RSP_R2 | MMC_CMD_BCR;
+ cmd.data = NULL;
err = mmc_wait_for_cmd(sc, &cmd, 0);
memcpy(rawcid, cmd.resp, 4 * sizeof(uint32_t));
return (err);
}
static int
+mmc_app_send_scr(struct mmc_softc *sc, uint16_t rca, uint32_t *rawscr)
+{
+ int err;
+ struct mmc_command cmd;
+ struct mmc_data data;
+
+ memset(&cmd, 0, sizeof(struct mmc_command));
+ memset(&data, 0, sizeof(struct mmc_data));
+
+ memset(rawscr, 0, 8);
+ cmd.opcode = ACMD_SEND_SCR;
+ cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
+ cmd.arg = 0;
+ cmd.data = &data;
+
+ data.data = rawscr;
+ data.len = 8;
+ data.flags = MMC_DATA_READ;
+
+ err = mmc_wait_for_app_cmd(sc, rca, &cmd, CMD_RETRIES);
+ rawscr[0] = be32toh(rawscr[0]);
+ rawscr[1] = be32toh(rawscr[1]);
+ return (err);
+}
+
+static int
+mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd)
+{
+ int err;
+ struct mmc_command cmd;
+ struct mmc_data data;
+
+ memset(&cmd, 0, sizeof(struct mmc_command));
+ memset(&data, 0, sizeof(struct mmc_data));
+
+ memset(rawextcsd, 0, 512);
+ cmd.opcode = MMC_SEND_EXT_CSD;
+ cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
+ cmd.arg = 0;
+ cmd.data = &data;
+
+ data.data = rawextcsd;
+ data.len = 512;
+ data.flags = MMC_DATA_READ;
+
+ err = mmc_wait_for_cmd(sc, &cmd, CMD_RETRIES);
+ return (err);
+}
+
+static int
+mmc_app_sd_status(struct mmc_softc *sc, uint16_t rca, uint32_t *rawsdstatus)
+{
+ int err, i;
+ struct mmc_command cmd;
+ struct mmc_data data;
+
+ memset(&cmd, 0, sizeof(struct mmc_command));
+ memset(&data, 0, sizeof(struct mmc_data));
+
+ memset(rawsdstatus, 0, 64);
+ cmd.opcode = ACMD_SD_STATUS;
+ cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
+ cmd.arg = 0;
+ cmd.data = &data;
+
+ data.data = rawsdstatus;
+ data.len = 64;
+ data.flags = MMC_DATA_READ;
+
+ err = mmc_wait_for_app_cmd(sc, rca, &cmd, CMD_RETRIES);
+ for (i = 0; i < 16; i++)
+ rawsdstatus[i] = be32toh(rawsdstatus[i]);
+ return (err);
+}
+
+static int
+mmc_set_relative_addr(struct mmc_softc *sc, uint16_t resp)
+{
+ struct mmc_command cmd;
+ int err;
+
+ cmd.opcode = MMC_SET_RELATIVE_ADDR;
+ cmd.arg = resp << 16;
+ cmd.flags = MMC_RSP_R6 | MMC_CMD_BCR;
+ cmd.data = NULL;
+ err = mmc_wait_for_cmd(sc, &cmd, 0);
+ return (err);
+}
+
+static int
mmc_send_relative_addr(struct mmc_softc *sc, uint32_t *resp)
{
struct mmc_command cmd;
@@ -584,6 +1053,7 @@ mmc_send_relative_addr(struct mmc_softc
cmd.opcode = SD_SEND_RELATIVE_ADDR;
cmd.arg = 0;
cmd.flags = MMC_RSP_R6 | MMC_CMD_BCR;
+ cmd.data = NULL;
err = mmc_wait_for_cmd(sc, &cmd, 0);
*resp = cmd.resp[0];
return (err);
@@ -592,39 +1062,182 @@ mmc_send_relative_addr(struct mmc_softc
static void
mmc_discover_cards(struct mmc_softc *sc)
{
- struct mmc_ivars *ivar;
- int err;
- uint32_t resp;
+ struct mmc_ivars *ivar = NULL;
+ device_t *devlist;
+ int err, i, devcount, newcard;
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From mav at FreeBSD.org Mon Jan 5 19:54:00 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Mon Jan 5 19:54:17 2009
Subject: svn commit: r186787 - stable/7/sys/arm/at91
Message-ID: <200901051953.n05JrwlM009207@svn.freebsd.org>
Author: mav
Date: Mon Jan 5 19:53:58 2009
New Revision: 186787
URL: http://svn.freebsd.org/changeset/base/186787
Log:
MFC rev. 183479, 184452.
Keep in sync with latest MMC stack:
- limit transfers with single block,
- properly implement read-only.
Modified:
stable/7/sys/arm/at91/at91_mci.c
Modified: stable/7/sys/arm/at91/at91_mci.c
==============================================================================
--- stable/7/sys/arm/at91/at91_mci.c Mon Jan 5 19:40:09 2009 (r186786)
+++ stable/7/sys/arm/at91/at91_mci.c Mon Jan 5 19:53:58 2009 (r186787)
@@ -462,7 +462,7 @@ at91_mci_request(device_t brdev, device_
static int
at91_mci_get_ro(device_t brdev, device_t reqdev)
{
- return (-1);
+ return (0);
}
static int
@@ -649,6 +649,9 @@ at91_mci_read_ivar(device_t bus, device_
case MMCBR_IVAR_VDD:
*(int *)result = sc->host.ios.vdd;
break;
+ case MMCBR_IVAR_MAX_DATA:
+ *(int *)result = 1;
+ break;
}
return (0);
}
@@ -685,9 +688,11 @@ at91_mci_write_ivar(device_t bus, device
case MMCBR_IVAR_VDD:
sc->host.ios.vdd = value;
break;
+ /* These are read-only */
case MMCBR_IVAR_HOST_OCR:
case MMCBR_IVAR_F_MIN:
case MMCBR_IVAR_F_MAX:
+ case MMCBR_IVAR_MAX_DATA:
return (EINVAL);
}
return (0);
From mav at FreeBSD.org Mon Jan 5 20:23:02 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Mon Jan 5 20:23:09 2009
Subject: svn commit: r186790 - stable/7/sys/dev/sdhci
Message-ID: <200901052023.n05KN1BD009899@svn.freebsd.org>
Author: mav
Date: Mon Jan 5 20:23:01 2009
New Revision: 186790
URL: http://svn.freebsd.org/changeset/base/186790
Log:
MFC sdhci driver.
Added:
stable/7/sys/dev/sdhci/
stable/7/sys/dev/sdhci/sdhci.c (contents, props changed)
stable/7/sys/dev/sdhci/sdhci.h (contents, props changed)
Added: stable/7/sys/dev/sdhci/sdhci.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/sys/dev/sdhci/sdhci.c Mon Jan 5 20:23:01 2009 (r186790)
@@ -0,0 +1,1566 @@
+/*-
+ * Copyright (c) 2008 Alexander Motin
+ * 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 THE AUTHOR ``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 THE AUTHOR 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.
+ */
+
+#include
+__FBSDID("$FreeBSD$");
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include "mmcbr_if.h"
+#include "sdhci.h"
+
+#define DMA_BLOCK_SIZE 4096
+#define DMA_BOUNDARY 0 /* DMA reload every 4K */
+
+/* Controller doesn't honor resets unless we touch the clock register */
+#define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1<<0)
+/* Controller really supports DMA */
+#define SDHCI_QUIRK_FORCE_DMA (1<<1)
+/* Controller has unusable DMA engine */
+#define SDHCI_QUIRK_BROKEN_DMA (1<<2)
+/* Controller doesn't like to be reset when there is no card inserted. */
+#define SDHCI_QUIRK_NO_CARD_NO_RESET (1<<3)
+/* Controller has flaky internal state so reset it on each ios change */
+#define SDHCI_QUIRK_RESET_ON_IOS (1<<4)
+/* Controller can only DMA chunk sizes that are a multiple of 32 bits */
+#define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<5)
+/* Controller needs to be reset after each request to stay stable */
+#define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<6)
+/* Controller has an off-by-one issue with timeout value */
+#define SDHCI_QUIRK_INCR_TIMEOUT_CONTROL (1<<7)
+/* Controller has broken read timings */
+#define SDHCI_QUIRK_BROKEN_TIMINGS (1<<8)
+
+static const struct sdhci_device {
+ uint32_t model;
+ uint16_t subvendor;
+ char *desc;
+ u_int quirks;
+} sdhci_devices[] = {
+ { 0x08221180, 0xffff, "RICOH R5C822 SD",
+ SDHCI_QUIRK_FORCE_DMA },
+ { 0x8034104c, 0xffff, "TI XX21/XX11 SD",
+ SDHCI_QUIRK_FORCE_DMA },
+ { 0x05501524, 0xffff, "ENE CB712 SD",
+ SDHCI_QUIRK_BROKEN_TIMINGS },
+ { 0x05511524, 0xffff, "ENE CB712 SD 2",
+ SDHCI_QUIRK_BROKEN_TIMINGS },
+ { 0x07501524, 0xffff, "ENE CB714 SD",
+ SDHCI_QUIRK_RESET_ON_IOS |
+ SDHCI_QUIRK_BROKEN_TIMINGS },
+ { 0x07511524, 0xffff, "ENE CB714 SD 2",
+ SDHCI_QUIRK_RESET_ON_IOS |
+ SDHCI_QUIRK_BROKEN_TIMINGS },
+ { 0x410111ab, 0xffff, "Marvell CaFe SD",
+ SDHCI_QUIRK_INCR_TIMEOUT_CONTROL },
+ { 0x2381197B, 0xffff, "JMicron JMB38X SD",
+ SDHCI_QUIRK_32BIT_DMA_SIZE |
+ SDHCI_QUIRK_RESET_AFTER_REQUEST },
+ { 0, 0xffff, NULL,
+ 0 }
+};
+
+struct sdhci_softc;
+
+struct sdhci_slot {
+ struct sdhci_softc *sc;
+ device_t dev; /* Slot device */
+ u_char num; /* Slot number */
+ u_char opt; /* Slot options */
+#define SDHCI_HAVE_DMA 1
+ uint32_t max_clk; /* Max possible freq */
+ uint32_t timeout_clk; /* Timeout freq */
+ struct resource *mem_res; /* Memory resource */
+ int mem_rid;
+ bus_dma_tag_t dmatag;
+ bus_dmamap_t dmamap;
+ u_char *dmamem;
+ bus_addr_t paddr; /* DMA buffer address */
+ struct task card_task; /* Card presence check task */
+ struct callout card_callout; /* Card insert delay callout */
+ struct mmc_host host; /* Host parameters */
+ struct mmc_request *req; /* Current request */
+ struct mmc_command *curcmd; /* Current command of current request */
+
+ uint32_t intmask; /* Current interrupt mask */
+ uint32_t clock; /* Current clock freq. */
+ size_t offset; /* Data buffer offset */
+ uint8_t hostctrl; /* Current host control register */
+ u_char power; /* Current power */
+ u_char bus_busy; /* Bus busy status */
+ u_char cmd_done; /* CMD command part done flag */
+ u_char data_done; /* DAT command part done flag */
+ u_char flags; /* Request execution flags */
+#define CMD_STARTED 1
+#define STOP_STARTED 2
+#define SDHCI_USE_DMA 4 /* Use DMA for this req. */
+ struct mtx mtx; /* Slot mutex */
+};
+
+struct sdhci_softc {
+ device_t dev; /* Controller device */
+ u_int quirks; /* Chip specific quirks */
+ struct resource *irq_res; /* IRQ resource */
+ int irq_rid;
+ void *intrhand; /* Interrupt handle */
+
+ int num_slots; /* Number of slots on this controller */
+ struct sdhci_slot slots[6];
+};
+
+static inline uint8_t
+RD1(struct sdhci_slot *slot, bus_size_t off)
+{
+ bus_barrier(slot->mem_res, 0, 0xFF,
+ BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+ return bus_read_1(slot->mem_res, off);
+}
+
+static inline void
+WR1(struct sdhci_slot *slot, bus_size_t off, uint8_t val)
+{
+ bus_barrier(slot->mem_res, 0, 0xFF,
+ BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+ bus_write_1(slot->mem_res, off, val);
+}
+
+static inline uint16_t
+RD2(struct sdhci_slot *slot, bus_size_t off)
+{
+ bus_barrier(slot->mem_res, 0, 0xFF,
+ BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+ return bus_read_2(slot->mem_res, off);
+}
+
+static inline void
+WR2(struct sdhci_slot *slot, bus_size_t off, uint16_t val)
+{
+ bus_barrier(slot->mem_res, 0, 0xFF,
+ BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+ bus_write_2(slot->mem_res, off, val);
+}
+
+static inline uint32_t
+RD4(struct sdhci_slot *slot, bus_size_t off)
+{
+ bus_barrier(slot->mem_res, 0, 0xFF,
+ BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+ return bus_read_4(slot->mem_res, off);
+}
+
+static inline void
+WR4(struct sdhci_slot *slot, bus_size_t off, uint32_t val)
+{
+ bus_barrier(slot->mem_res, 0, 0xFF,
+ BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+ bus_write_4(slot->mem_res, off, val);
+}
+
+/* bus entry points */
+static int sdhci_probe(device_t dev);
+static int sdhci_attach(device_t dev);
+static int sdhci_detach(device_t dev);
+static void sdhci_intr(void *);
+
+static void sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock);
+static void sdhci_start(struct sdhci_slot *slot);
+static void sdhci_start_data(struct sdhci_slot *slot, struct mmc_data *data);
+
+static void sdhci_card_task(void *, int);
+
+/* helper routines */
+#define SDHCI_LOCK(_slot) mtx_lock(&(_slot)->mtx)
+#define SDHCI_UNLOCK(_slot) mtx_unlock(&(_slot)->mtx)
+#define SDHCI_LOCK_INIT(_slot) \
+ mtx_init(&_slot->mtx, "SD slot mtx", "sdhci", MTX_DEF)
+#define SDHCI_LOCK_DESTROY(_slot) mtx_destroy(&_slot->mtx);
+#define SDHCI_ASSERT_LOCKED(_slot) mtx_assert(&_slot->mtx, MA_OWNED);
+#define SDHCI_ASSERT_UNLOCKED(_slot) mtx_assert(&_slot->mtx, MA_NOTOWNED);
+
+static int
+slot_printf(struct sdhci_slot *slot, const char * fmt, ...)
+{
+ va_list ap;
+ int retval;
+
+ retval = printf("%s-slot%d: ",
+ device_get_nameunit(slot->sc->dev), slot->num);
+
+ va_start(ap, fmt);
+ retval += vprintf(fmt, ap);
+ va_end(ap);
+ return (retval);
+}
+
+static void
+sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
+{
+ if (error != 0) {
+ printf("getaddr: error %d\n", error);
+ return;
+ }
+ *(bus_addr_t *)arg = segs[0].ds_addr;
+}
+
+static void
+sdhci_dumpregs(struct sdhci_slot *slot)
+{
+ slot_printf(slot,
+ "============== REGISTER DUMP ==============\n");
+
+ slot_printf(slot, "Sys addr: 0x%08x | Version: 0x%08x\n",
+ RD4(slot, SDHCI_DMA_ADDRESS), RD2(slot, SDHCI_HOST_VERSION));
+ slot_printf(slot, "Blk size: 0x%08x | Blk cnt: 0x%08x\n",
+ RD2(slot, SDHCI_BLOCK_SIZE), RD2(slot, SDHCI_BLOCK_COUNT));
+ slot_printf(slot, "Argument: 0x%08x | Trn mode: 0x%08x\n",
+ RD4(slot, SDHCI_ARGUMENT), RD2(slot, SDHCI_TRANSFER_MODE));
+ slot_printf(slot, "Present: 0x%08x | Host ctl: 0x%08x\n",
+ RD4(slot, SDHCI_PRESENT_STATE), RD1(slot, SDHCI_HOST_CONTROL));
+ slot_printf(slot, "Power: 0x%08x | Blk gap: 0x%08x\n",
+ RD1(slot, SDHCI_POWER_CONTROL), RD1(slot, SDHCI_BLOCK_GAP_CONTROL));
+ slot_printf(slot, "Wake-up: 0x%08x | Clock: 0x%08x\n",
+ RD1(slot, SDHCI_WAKE_UP_CONTROL), RD2(slot, SDHCI_CLOCK_CONTROL));
+ slot_printf(slot, "Timeout: 0x%08x | Int stat: 0x%08x\n",
+ RD1(slot, SDHCI_TIMEOUT_CONTROL), RD4(slot, SDHCI_INT_STATUS));
+ slot_printf(slot, "Int enab: 0x%08x | Sig enab: 0x%08x\n",
+ RD4(slot, SDHCI_INT_ENABLE), RD4(slot, SDHCI_SIGNAL_ENABLE));
+ slot_printf(slot, "AC12 err: 0x%08x | Slot int: 0x%08x\n",
+ RD2(slot, SDHCI_ACMD12_ERR), RD2(slot, SDHCI_SLOT_INT_STATUS));
+ slot_printf(slot, "Caps: 0x%08x | Max curr: 0x%08x\n",
+ RD4(slot, SDHCI_CAPABILITIES), RD4(slot, SDHCI_MAX_CURRENT));
+
+ slot_printf(slot,
+ "===========================================\n");
+}
+
+static void
+sdhci_reset(struct sdhci_slot *slot, uint8_t mask)
+{
+ int timeout;
+ uint8_t res;
+
+ if (slot->sc->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) {
+ if (!(RD4(slot, SDHCI_PRESENT_STATE) &
+ SDHCI_CARD_PRESENT))
+ return;
+ }
+
+ /* Some controllers need this kick or reset won't work. */
+ if ((mask & SDHCI_RESET_ALL) == 0 &&
+ (slot->sc->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET)) {
+ uint32_t clock;
+
+ /* This is to force an update */
+ clock = slot->clock;
+ slot->clock = 0;
+ sdhci_set_clock(slot, clock);
+ }
+
+ WR1(slot, SDHCI_SOFTWARE_RESET, mask);
+
+ if (mask & SDHCI_RESET_ALL) {
+ slot->clock = 0;
+ slot->power = 0;
+ }
+
+ /* Wait max 100 ms */
+ timeout = 100;
+ /* Controller clears the bits when it's done */
+ while ((res = RD1(slot, SDHCI_SOFTWARE_RESET)) & mask) {
+ if (timeout == 0) {
+ slot_printf(slot,
+ "Reset 0x%x never completed - 0x%x.\n",
+ (int)mask, (int)res);
+ sdhci_dumpregs(slot);
+ return;
+ }
+ timeout--;
+ DELAY(1000);
+ }
+}
+
+static void
+sdhci_init(struct sdhci_slot *slot)
+{
+
+ sdhci_reset(slot, SDHCI_RESET_ALL);
+
+ /* Enable interrupts. */
+ slot->intmask = SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT |
+ SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX |
+ SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT |
+ SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT |
+ SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL |
+ SDHCI_INT_DMA_END | SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE |
+ SDHCI_INT_ACMD12ERR;
+ WR4(slot, SDHCI_INT_ENABLE, slot->intmask);
+ WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
+}
+
+static void
+sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock)
+{
+ uint32_t res;
+ uint16_t clk;
+ int timeout;
+
+ if (clock == slot->clock)
+ return;
+ slot->clock = clock;
+
+ /* Turn off the clock. */
+ WR2(slot, SDHCI_CLOCK_CONTROL, 0);
+ /* If no clock requested - left it so. */
+ if (clock == 0)
+ return;
+ /* Looking for highest freq <= clock. */
+ res = slot->max_clk;
+ for (clk = 1; clk < 256; clk <<= 1) {
+ if (res <= clock)
+ break;
+ res >>= 1;
+ }
+ /* Divider 1:1 is 0x00, 2:1 is 0x01, 256:1 is 0x80 ... */
+ clk >>= 1;
+ /* Now we have got divider, set it. */
+ clk <<= SDHCI_DIVIDER_SHIFT;
+ WR2(slot, SDHCI_CLOCK_CONTROL, clk);
+ /* Enable clock. */
+ clk |= SDHCI_CLOCK_INT_EN;
+ WR2(slot, SDHCI_CLOCK_CONTROL, clk);
+ /* Wait up to 10 ms until it stabilize. */
+ timeout = 10;
+ while (!((clk = RD2(slot, SDHCI_CLOCK_CONTROL))
+ & SDHCI_CLOCK_INT_STABLE)) {
+ if (timeout == 0) {
+ slot_printf(slot,
+ "Internal clock never stabilised.\n");
+ sdhci_dumpregs(slot);
+ return;
+ }
+ timeout--;
+ DELAY(1000);
+ }
+ /* Pass clock signal to the bus. */
+ clk |= SDHCI_CLOCK_CARD_EN;
+ WR2(slot, SDHCI_CLOCK_CONTROL, clk);
+}
+
+static void
+sdhci_set_power(struct sdhci_slot *slot, u_char power)
+{
+ uint8_t pwr;
+
+ if (slot->power == power)
+ return;
+ slot->power = power;
+
+ /* Turn off the power. */
+ pwr = 0;
+ WR1(slot, SDHCI_POWER_CONTROL, pwr);
+ /* If power down requested - left it so. */
+ if (power == 0)
+ return;
+ /* Set voltage. */
+ switch (1 << power) {
+ case MMC_OCR_LOW_VOLTAGE:
+ pwr |= SDHCI_POWER_180;
+ break;
+ case MMC_OCR_290_300:
+ case MMC_OCR_300_310:
+ pwr |= SDHCI_POWER_300;
+ break;
+ case MMC_OCR_320_330:
+ case MMC_OCR_330_340:
+ pwr |= SDHCI_POWER_330;
+ break;
+ }
+ WR1(slot, SDHCI_POWER_CONTROL, pwr);
+ /* Turn on the power. */
+ pwr |= SDHCI_POWER_ON;
+ WR1(slot, SDHCI_POWER_CONTROL, pwr);
+}
+
+static void
+sdhci_read_block_pio(struct sdhci_slot *slot)
+{
+ uint32_t data;
+ char *buffer;
+ size_t left;
+
+ buffer = slot->curcmd->data->data;
+ buffer += slot->offset;
+ /* Transfer one block at a time. */
+ left = min(512, slot->curcmd->data->len - slot->offset);
+ slot->offset += left;
+
+ /* If we are too fast, broken controllers return zeroes. */
+ if (slot->sc->quirks & SDHCI_QUIRK_BROKEN_TIMINGS)
+ DELAY(10);
+ /* Handle unalligned and alligned buffer cases. */
+ if ((intptr_t)buffer & 3) {
+ while (left > 3) {
+ data = RD4(slot, SDHCI_BUFFER);
+ buffer[0] = data;
+ buffer[1] = (data >> 8);
+ buffer[2] = (data >> 16);
+ buffer[3] = (data >> 24);
+ buffer += 4;
+ left -= 4;
+ }
+ } else {
+ bus_read_multi_stream_4(slot->mem_res, SDHCI_BUFFER,
+ (uint32_t *)buffer, left >> 2);
+ left &= 3;
+ }
+ /* Handle uneven size case. */
+ if (left > 0) {
+ data = RD4(slot, SDHCI_BUFFER);
+ while (left > 0) {
+ *(buffer++) = data;
+ data >>= 8;
+ left--;
+ }
+ }
+}
+
+static void
+sdhci_write_block_pio(struct sdhci_slot *slot)
+{
+ uint32_t data = 0;
+ char *buffer;
+ size_t left;
+
+ buffer = slot->curcmd->data->data;
+ buffer += slot->offset;
+ /* Transfer one block at a time. */
+ left = min(512, slot->curcmd->data->len - slot->offset);
+ slot->offset += left;
+
+ /* Handle unalligned and alligned buffer cases. */
+ if ((intptr_t)buffer & 3) {
+ while (left > 3) {
+ data = buffer[0] +
+ (buffer[1] << 8) +
+ (buffer[2] << 16) +
+ (buffer[3] << 24);
+ left -= 4;
+ buffer += 4;
+ WR4(slot, SDHCI_BUFFER, data);
+ }
+ } else {
+ bus_write_multi_stream_4(slot->mem_res, SDHCI_BUFFER,
+ (uint32_t *)buffer, left >> 2);
+ left &= 3;
+ }
+ /* Handle uneven size case. */
+ if (left > 0) {
+ while (left > 0) {
+ data <<= 8;
+ data += *(buffer++);
+ left--;
+ }
+ WR4(slot, SDHCI_BUFFER, data);
+ }
+}
+
+static void
+sdhci_transfer_pio(struct sdhci_slot *slot)
+{
+
+ /* Read as many blocks as possible. */
+ if (slot->curcmd->data->flags & MMC_DATA_READ) {
+ while (RD4(slot, SDHCI_PRESENT_STATE) &
+ SDHCI_DATA_AVAILABLE) {
+ sdhci_read_block_pio(slot);
+ if (slot->offset >= slot->curcmd->data->len)
+ break;
+ }
+ } else {
+ while (RD4(slot, SDHCI_PRESENT_STATE) &
+ SDHCI_SPACE_AVAILABLE) {
+ sdhci_write_block_pio(slot);
+ if (slot->offset >= slot->curcmd->data->len)
+ break;
+ }
+ }
+}
+
+static void
+sdhci_card_delay(void *arg)
+{
+ struct sdhci_slot *slot = arg;
+
+ taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task);
+}
+
+static void
+sdhci_card_task(void *arg, int pending)
+{
+ struct sdhci_slot *slot = arg;
+
+ SDHCI_LOCK(slot);
+ if (RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT) {
+ if (slot->dev == NULL) {
+ /* If card is present - attach mmc bus. */
+ slot->dev = device_add_child(slot->sc->dev, "mmc", -1);
+ device_set_ivars(slot->dev, slot);
+ SDHCI_UNLOCK(slot);
+ device_probe_and_attach(slot->dev);
+ } else
+ SDHCI_UNLOCK(slot);
+ } else {
+ if (slot->dev != NULL) {
+ /* If no card present - detach mmc bus. */
+ device_t d = slot->dev;
+ slot->dev = NULL;
+ SDHCI_UNLOCK(slot);
+ device_delete_child(slot->sc->dev, d);
+ } else
+ SDHCI_UNLOCK(slot);
+ }
+}
+
+static int
+sdhci_probe(device_t dev)
+{
+ uint32_t model;
+ uint16_t subvendor;
+ uint8_t class, subclass;
+ int i, result;
+
+ model = (uint32_t)pci_get_device(dev) << 16;
+ model |= (uint32_t)pci_get_vendor(dev) & 0x0000ffff;
+ subvendor = pci_get_subvendor(dev);
+ class = pci_get_class(dev);
+ subclass = pci_get_subclass(dev);
+
+ result = ENXIO;
+ for (i = 0; sdhci_devices[i].model != 0; i++) {
+ if (sdhci_devices[i].model == model &&
+ (sdhci_devices[i].subvendor == 0xffff ||
+ sdhci_devices[i].subvendor == subvendor)) {
+ device_set_desc(dev, sdhci_devices[i].desc);
+ result = BUS_PROBE_DEFAULT;
+ break;
+ }
+ }
+ if (result == ENXIO && class == PCIC_BASEPERIPH &&
+ subclass == PCIS_BASEPERIPH_SDHC) {
+ device_set_desc(dev, "Generic SD HCI");
+ result = BUS_PROBE_GENERIC;
+ }
+
+ return (result);
+}
+
+static int
+sdhci_attach(device_t dev)
+{
+ struct sdhci_softc *sc = device_get_softc(dev);
+ uint32_t model;
+ uint16_t subvendor;
+ uint8_t class, subclass, progif;
+ int err, slots, bar, i;
+
+ sc->dev = dev;
+ model = (uint32_t)pci_get_device(dev) << 16;
+ model |= (uint32_t)pci_get_vendor(dev) & 0x0000ffff;
+ subvendor = pci_get_subvendor(dev);
+ class = pci_get_class(dev);
+ subclass = pci_get_subclass(dev);
+ progif = pci_get_progif(dev);
+ /* Apply chip specific quirks. */
+ for (i = 0; sdhci_devices[i].model != 0; i++) {
+ if (sdhci_devices[i].model == model &&
+ (sdhci_devices[i].subvendor == 0xffff ||
+ sdhci_devices[i].subvendor == subvendor)) {
+ sc->quirks = sdhci_devices[i].quirks;
+ break;
+ }
+ }
+ /* Read slots info from PCI registers. */
+ slots = pci_read_config(dev, PCI_SLOT_INFO, 1);
+ bar = PCI_SLOT_INFO_FIRST_BAR(slots);
+ slots = PCI_SLOT_INFO_SLOTS(slots);
+ if (slots > 6 || bar > 5) {
+ device_printf(dev, "Incorrect slots information (%d, %d).\n",
+ slots, bar);
+ return (EINVAL);
+ }
+ /* Allocate IRQ. */
+ sc->irq_rid = 0;
+ sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid,
+ RF_SHAREABLE | RF_ACTIVE);
+ if (sc->irq_res == NULL) {
+ device_printf(dev, "Can't allocate IRQ\n");
+ return (ENOMEM);
+ }
+ /* Scan all slots. */
+ for (i = 0; i < slots; i++) {
+ struct sdhci_slot *slot = &sc->slots[sc->num_slots];
+ uint32_t caps;
+
+ SDHCI_LOCK_INIT(slot);
+ slot->sc = sc;
+ slot->num = sc->num_slots;
+ /* Allocate memory. */
+ slot->mem_rid = PCIR_BAR(bar + i);
+ slot->mem_res = bus_alloc_resource(dev,
+ SYS_RES_MEMORY, &slot->mem_rid, 0ul, ~0ul, 0x100, RF_ACTIVE);
+ if (slot->mem_res == NULL) {
+ device_printf(dev, "Can't allocate memory\n");
+ SDHCI_LOCK_DESTROY(slot);
+ continue;
+ }
+ /* Allocate DMA tag. */
+ err = bus_dma_tag_create(bus_get_dma_tag(dev),
+ DMA_BLOCK_SIZE, 0, BUS_SPACE_MAXADDR_32BIT,
+ BUS_SPACE_MAXADDR, NULL, NULL,
+ DMA_BLOCK_SIZE, 1, DMA_BLOCK_SIZE,
+ BUS_DMA_ALLOCNOW, NULL, NULL,
+ &slot->dmatag);
+ if (err != 0) {
+ device_printf(dev, "Can't create DMA tag\n");
+ SDHCI_LOCK_DESTROY(slot);
+ continue;
+ }
+ /* Allocate DMA memory. */
+ err = bus_dmamem_alloc(slot->dmatag, (void **)&slot->dmamem,
+ BUS_DMA_NOWAIT, &slot->dmamap);
+ if (err != 0) {
+ device_printf(dev, "Can't alloc DMA memory\n");
+ SDHCI_LOCK_DESTROY(slot);
+ continue;
+ }
+ /* Map the memory. */
+ err = bus_dmamap_load(slot->dmatag, slot->dmamap,
+ (void *)slot->dmamem, DMA_BLOCK_SIZE,
+ sdhci_getaddr, &slot->paddr, 0);
+ if (err != 0 || slot->paddr == 0) {
+ device_printf(dev, "Can't load DMA memory\n");
+ SDHCI_LOCK_DESTROY(slot);
+ continue;
+ }
+ /* Initialize slot. */
+ sdhci_init(slot);
+ caps = RD4(slot, SDHCI_CAPABILITIES);
+ /* Calculate base clock frequency. */
+ slot->max_clk =
+ (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT;
+ if (slot->max_clk == 0) {
+ device_printf(dev, "Hardware doesn't specify base clock "
+ "frequency.\n");
+ }
+ slot->max_clk *= 1000000;
+ /* Calculate timeout clock frequency. */
+ slot->timeout_clk =
+ (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT;
+ if (slot->timeout_clk == 0) {
+ device_printf(dev, "Hardware doesn't specify timeout clock "
+ "frequency.\n");
+ }
+ if (caps & SDHCI_TIMEOUT_CLK_UNIT)
+ slot->timeout_clk *= 1000;
+
+ slot->host.f_min = slot->max_clk / 256;
+ slot->host.f_max = slot->max_clk;
+ slot->host.host_ocr = 0;
+ if (caps & SDHCI_CAN_VDD_330)
+ slot->host.host_ocr |= MMC_OCR_320_330 | MMC_OCR_330_340;
+ if (caps & SDHCI_CAN_VDD_300)
+ slot->host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310;
+ if (caps & SDHCI_CAN_VDD_180)
+ slot->host.host_ocr |= MMC_OCR_LOW_VOLTAGE;
+ if (slot->host.host_ocr == 0) {
+ device_printf(dev, "Hardware doesn't report any "
+ "support voltages.\n");
+ }
+ slot->host.caps = MMC_CAP_4_BIT_DATA;
+ if (caps & SDHCI_CAN_DO_HISPD)
+ slot->host.caps |= MMC_CAP_HSPEED;
+ /* Decide if we have usable DMA. */
+ if (caps & SDHCI_CAN_DO_DMA)
+ slot->opt |= SDHCI_HAVE_DMA;
+ if (class == PCIC_BASEPERIPH &&
+ subclass == PCIS_BASEPERIPH_SDHC &&
+ progif != PCI_SDHCI_IFDMA)
+ slot->opt &= ~SDHCI_HAVE_DMA;
+ if (sc->quirks & SDHCI_QUIRK_BROKEN_DMA)
+ slot->opt &= ~SDHCI_HAVE_DMA;
+ if (sc->quirks & SDHCI_QUIRK_FORCE_DMA)
+ slot->opt |= SDHCI_HAVE_DMA;
+
+ if (bootverbose) {
+ slot_printf(slot, "%uMHz%s 4bits%s%s%s %s\n",
+ slot->max_clk / 1000000,
+ (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "",
+ (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "",
+ (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "",
+ (caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "",
+ (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO");
+ sdhci_dumpregs(slot);
+ }
+
+ TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot);
+ callout_init(&slot->card_callout, 1);
+ sc->num_slots++;
+ }
+ device_printf(dev, "%d slot(s) allocated\n", sc->num_slots);
+ /* Activate the interrupt */
+ err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
+ NULL, sdhci_intr, sc, &sc->intrhand);
+ if (err)
+ device_printf(dev, "Can't setup IRQ\n");
+ pci_enable_busmaster(dev);
+ /* Process cards detection. */
+ for (i = 0; i < sc->num_slots; i++) {
+ struct sdhci_slot *slot = &sc->slots[i];
+
+ sdhci_card_task(slot, 0);
+ }
+
+ return (0);
+}
+
+static int
+sdhci_detach(device_t dev)
+{
+ struct sdhci_softc *sc = device_get_softc(dev);
+ int i;
+
+ bus_teardown_intr(dev, sc->irq_res, sc->intrhand);
+ bus_release_resource(dev, SYS_RES_IRQ,
+ sc->irq_rid, sc->irq_res);
+
+ for (i = 0; i < sc->num_slots; i++) {
+ struct sdhci_slot *slot = &sc->slots[i];
+ device_t d;
+
+ callout_drain(&slot->card_callout);
+ taskqueue_drain(taskqueue_swi_giant, &slot->card_task);
+
+ SDHCI_LOCK(slot);
+ d = slot->dev;
+ slot->dev = NULL;
+ SDHCI_UNLOCK(slot);
+ if (d != NULL)
+ device_delete_child(dev, d);
+
+ SDHCI_LOCK(slot);
+ sdhci_reset(slot, SDHCI_RESET_ALL);
+ SDHCI_UNLOCK(slot);
+ bus_dmamap_unload(slot->dmatag, slot->dmamap);
+ bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap);
+ bus_dma_tag_destroy(slot->dmatag);
+ bus_release_resource(dev, SYS_RES_MEMORY,
+ slot->mem_rid, slot->mem_res);
+ SDHCI_LOCK_DESTROY(slot);
+ }
+ return (0);
+}
+
+static int
+sdhci_suspend(device_t dev)
+{
+ struct sdhci_softc *sc = device_get_softc(dev);
+ int i, err;
+
+ err = bus_generic_suspend(dev);
+ if (err)
+ return (err);
+ for (i = 0; i < sc->num_slots; i++)
+ sdhci_reset(&sc->slots[i], SDHCI_RESET_ALL);
+ return (0);
+}
+
+static int
+sdhci_resume(device_t dev)
+{
+ struct sdhci_softc *sc = device_get_softc(dev);
+ int i;
+
+ for (i = 0; i < sc->num_slots; i++)
+ sdhci_init(&sc->slots[i]);
+ return (bus_generic_resume(dev));
+}
+
+static int
+sdhci_update_ios(device_t brdev, device_t reqdev)
+{
+ struct sdhci_slot *slot = device_get_ivars(reqdev);
+ struct mmc_ios *ios = &slot->host.ios;
+
+ SDHCI_LOCK(slot);
+ /* Do full reset on bus power down to clear from any state. */
+ if (ios->power_mode == power_off) {
+ WR4(slot, SDHCI_SIGNAL_ENABLE, 0);
+ sdhci_init(slot);
+ }
+ /* Configure the bus. */
+ sdhci_set_clock(slot, ios->clock);
+ sdhci_set_power(slot, (ios->power_mode == power_off)?0:ios->vdd);
+ if (ios->bus_width == bus_width_4)
+ slot->hostctrl |= SDHCI_CTRL_4BITBUS;
+ else
+ slot->hostctrl &= ~SDHCI_CTRL_4BITBUS;
+ if (ios->timing == bus_timing_hs)
+ slot->hostctrl |= SDHCI_CTRL_HISPD;
+ else
+ slot->hostctrl &= ~SDHCI_CTRL_HISPD;
+ WR1(slot, SDHCI_HOST_CONTROL, slot->hostctrl);
+ /* Some controllers like reset after bus changes. */
+ if(slot->sc->quirks & SDHCI_QUIRK_RESET_ON_IOS)
+ sdhci_reset(slot, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
+
+ SDHCI_UNLOCK(slot);
+ return (0);
+}
+
+static void
+sdhci_set_transfer_mode(struct sdhci_slot *slot,
+ struct mmc_data *data)
+{
+ uint16_t mode;
+
+ if (data == NULL)
+ return;
+
+ mode = SDHCI_TRNS_BLK_CNT_EN;
+ if (data->len > 512)
+ mode |= SDHCI_TRNS_MULTI;
+ if (data->flags & MMC_DATA_READ)
+ mode |= SDHCI_TRNS_READ;
+ if (slot->req->stop)
+ mode |= SDHCI_TRNS_ACMD12;
+ if (slot->flags & SDHCI_USE_DMA)
+ mode |= SDHCI_TRNS_DMA;
+
+ WR2(slot, SDHCI_TRANSFER_MODE, mode);
+}
+
+static void
+sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd)
+{
+ struct mmc_request *req = slot->req;
+ int flags, timeout;
+ uint32_t mask, state;
+
+ slot->curcmd = cmd;
+ slot->cmd_done = 0;
+
+ cmd->error = MMC_ERR_NONE;
+
+ /* This flags combination is not supported by controller. */
+ if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) {
+ slot_printf(slot, "Unsupported response type!\n");
+ cmd->error = MMC_ERR_FAILED;
+ slot->req = NULL;
+ slot->curcmd = NULL;
+ req->done(req);
+ return;
+ }
+
+ /* Read controller present state. */
+ state = RD4(slot, SDHCI_PRESENT_STATE);
+ /* Do not issue command if there is no card, clock or power.
+ * Controller will not detect timeout without clock active. */
+ if ((state & SDHCI_CARD_PRESENT) == 0 ||
+ slot->power == 0 ||
+ slot->clock == 0) {
+ cmd->error = MMC_ERR_FAILED;
+ slot->req = NULL;
+ slot->curcmd = NULL;
+ req->done(req);
+ return;
+ }
+ /* Always wait for free CMD bus. */
+ mask = SDHCI_CMD_INHIBIT;
+ /* Wait for free DAT if we have data or busy signal. */
+ if (cmd->data || (cmd->flags & MMC_RSP_BUSY))
+ mask |= SDHCI_DAT_INHIBIT;
+ /* We shouldn't wait for DAT for stop commands. */
+ if (cmd == slot->req->stop)
+ mask &= ~SDHCI_DAT_INHIBIT;
+ /* Wait for bus no more then 10 ms. */
+ timeout = 10;
+ while (state & mask) {
+ if (timeout == 0) {
+ slot_printf(slot, "Controller never released "
+ "inhibit bit(s).\n");
+ sdhci_dumpregs(slot);
+ cmd->error = MMC_ERR_FAILED;
+ slot->req = NULL;
+ slot->curcmd = NULL;
+ req->done(req);
+ return;
+ }
+ timeout--;
+ DELAY(1000);
+ state = RD4(slot, SDHCI_PRESENT_STATE);
+ }
+
+ /* Prepare command flags. */
+ if (!(cmd->flags & MMC_RSP_PRESENT))
+ flags = SDHCI_CMD_RESP_NONE;
+ else if (cmd->flags & MMC_RSP_136)
+ flags = SDHCI_CMD_RESP_LONG;
+ else if (cmd->flags & MMC_RSP_BUSY)
+ flags = SDHCI_CMD_RESP_SHORT_BUSY;
+ else
+ flags = SDHCI_CMD_RESP_SHORT;
+ if (cmd->flags & MMC_RSP_CRC)
+ flags |= SDHCI_CMD_CRC;
+ if (cmd->flags & MMC_RSP_OPCODE)
+ flags |= SDHCI_CMD_INDEX;
+ if (cmd->data)
+ flags |= SDHCI_CMD_DATA;
+ if (cmd->opcode == MMC_STOP_TRANSMISSION)
+ flags |= SDHCI_CMD_TYPE_ABORT;
+ /* Prepare data. */
+ sdhci_start_data(slot, cmd->data);
+ /*
+ * Interrupt aggregation: To reduce total number of interrupts
+ * group response interrupt with data interrupt when possible.
+ * If there going to be data interrupt, mask response one.
+ */
+ if (slot->data_done == 0) {
+ WR4(slot, SDHCI_SIGNAL_ENABLE,
+ slot->intmask &= ~SDHCI_INT_RESPONSE);
+ }
+ /* Set command argument. */
+ WR4(slot, SDHCI_ARGUMENT, cmd->arg);
+ /* Set data transfer mode. */
+ sdhci_set_transfer_mode(slot, cmd->data);
+ /* Set command flags. */
+ WR1(slot, SDHCI_COMMAND_FLAGS, flags);
+ /* Start command. */
+ WR1(slot, SDHCI_COMMAND, cmd->opcode);
+}
+
+static void
+sdhci_finish_command(struct sdhci_slot *slot)
+{
+ int i;
+
+ slot->cmd_done = 1;
+ /* Interrupt aggregation: Restore command interrupt.
+ * Main restore point for the case when command interrupt
+ * happened first. */
+ WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask |= SDHCI_INT_RESPONSE);
+ /* In case of error - reset host and return. */
+ if (slot->curcmd->error) {
+ sdhci_reset(slot, SDHCI_RESET_CMD);
+ sdhci_reset(slot, SDHCI_RESET_DATA);
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From mav at FreeBSD.org Mon Jan 5 20:37:08 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Mon Jan 5 20:37:19 2009
Subject: svn commit: r186792 - in stable/7/sys: conf modules modules/sdhci
Message-ID: <200901052037.n05Kb7pC010250@svn.freebsd.org>
Author: mav
Date: Mon Jan 5 20:37:07 2009
New Revision: 186792
URL: http://svn.freebsd.org/changeset/base/186792
Log:
MFC rev. 184138.
Add mmc, mmcsd and sdhci modules to the build.
Added:
stable/7/sys/modules/sdhci/
stable/7/sys/modules/sdhci/Makefile (contents, props changed)
Modified:
stable/7/sys/conf/NOTES
stable/7/sys/conf/files
stable/7/sys/modules/Makefile
Modified: stable/7/sys/conf/NOTES
==============================================================================
--- stable/7/sys/conf/NOTES Mon Jan 5 20:29:01 2009 (r186791)
+++ stable/7/sys/conf/NOTES Mon Jan 5 20:37:07 2009 (r186792)
@@ -2238,10 +2238,13 @@ device cardbus
#
# MMC/SD
#
-# mmc: mmc bus
-# mmcsd: mmc memory and sd cards.
-#device mmc
-#device mmcsd
+# mmc MMC/SD bus
+# mmcsd MMC/SD memory card
+# sdhci Generic PCI SD Host Controller
+#
+device mmc
+device mmcsd
+device sdhci
#
# SMB bus
Modified: stable/7/sys/conf/files
==============================================================================
--- stable/7/sys/conf/files Mon Jan 5 20:29:01 2009 (r186791)
+++ stable/7/sys/conf/files Mon Jan 5 20:37:07 2009 (r186792)
@@ -935,6 +935,7 @@ dev/scc/scc_dev_sab82532.c optional scc
dev/scc/scc_dev_z8530.c optional scc
dev/scd/scd.c optional scd isa
dev/scd/scd_isa.c optional scd isa
+dev/sdhci/sdhci.c optional sdhci pci
dev/sf/if_sf.c optional sf pci
dev/si/si.c optional si
dev/si/si2_z280.c optional si
Modified: stable/7/sys/modules/Makefile
==============================================================================
--- stable/7/sys/modules/Makefile Mon Jan 5 20:29:01 2009 (r186791)
+++ stable/7/sys/modules/Makefile Mon Jan 5 20:37:07 2009 (r186792)
@@ -180,6 +180,8 @@ SUBDIR= ${_3dfx} \
mii \
mlx \
${_mly} \
+ mmc \
+ mmcsd \
mpt \
mqueue \
msdosfs \
@@ -246,6 +248,7 @@ SUBDIR= ${_3dfx} \
scc \
scd \
${_scsi_low} \
+ sdhci \
sem \
sf \
${_sio} \
Added: stable/7/sys/modules/sdhci/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/sys/modules/sdhci/Makefile Mon Jan 5 20:37:07 2009 (r186792)
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../dev/sdhci
+
+KMOD= sdhci
+SRCS= sdhci.c sdhci.h device_if.h bus_if.h pci_if.h mmcbr_if.h
+
+.include
From mav at FreeBSD.org Mon Jan 5 20:55:57 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Mon Jan 5 20:56:10 2009
Subject: svn commit: r186794 - stable/7/share/man/man4
Message-ID: <200901052055.n05KtumJ010922@svn.freebsd.org>
Author: mav
Date: Mon Jan 5 20:55:56 2009
New Revision: 186794
URL: http://svn.freebsd.org/changeset/base/186794
Log:
MFC mmc, mmcsd and sdhci man pages.
Added:
stable/7/share/man/man4/sdhci.4
- copied unchanged from r184156, head/share/man/man4/sdhci.4
Modified:
stable/7/share/man/man4/ (props changed)
stable/7/share/man/man4/igb.4 (props changed)
stable/7/share/man/man4/mmc.4
stable/7/share/man/man4/mmcsd.4
Modified: stable/7/share/man/man4/mmc.4
==============================================================================
--- stable/7/share/man/man4/mmc.4 Mon Jan 5 20:46:46 2009 (r186793)
+++ stable/7/share/man/man4/mmc.4 Mon Jan 5 20:55:56 2009 (r186794)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 26, 2007
+.Dd October 8, 2008
.Dt MMC 4
.Os
.Sh NAME
@@ -48,7 +48,8 @@ MultiMediaCards exist only in memory.
SD Cards exist as memory, I/O, or combination cards.
.Sh SEE ALSO
.Xr mmcsd 4 ,
-.Xr at91_mci 4
+.Xr at91_mci 4 ,
+.Xr sdhci 4
.Rs
.%T "SD Specifications, Part 1, Physical Layer, Simplified Specification"
.Re
@@ -56,6 +57,4 @@ SD Cards exist as memory, I/O, or combin
.%T "The MultiMediaCard System Specification"
.Re
.Sh BUGS
-Memory MultMediaCards do not currently work.
SDIO cards currently do not work.
-SDHC cards currently do not work.
Modified: stable/7/share/man/man4/mmcsd.4
==============================================================================
--- stable/7/share/man/man4/mmcsd.4 Mon Jan 5 20:46:46 2009 (r186793)
+++ stable/7/share/man/man4/mmcsd.4 Mon Jan 5 20:55:56 2009 (r186794)
@@ -24,28 +24,25 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 26, 2007
+.Dd October 22, 2008
.Dt MMCSD 4
.Os
.Sh NAME
.Nm mmcsd
-.Nd MMC and SD card driver.
+.Nd MMC and SD memory card driver.
.Sh SYNOPSIS
.Cd device mmcsd
.Sh DESCRIPTION
The
.Nm
-driver implements the MMC and SD memory cards.
+driver implements direct access block device for MMC and SD memory cards.
.Sh SEE ALSO
.Xr mmc 4 ,
-.Xr at91_mci 4
+.Xr at91_mci 4 ,
+.Xr sdhci 4
.Rs
.%T "SD Specifications, Part 1, Physical Layer, Simplified Specification"
.Re
.Rs
.%T "The MultiMediaCard System Specification"
.Re
-.Sh BUGS
-Memory MultMediaCards do not currently work.
-SDIO cards currently do not work.
-SDHC cards currently do not work.
Copied: stable/7/share/man/man4/sdhci.4 (from r184156, head/share/man/man4/sdhci.4)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/share/man/man4/sdhci.4 Mon Jan 5 20:55:56 2009 (r186794, copy of r184156, head/share/man/man4/sdhci.4)
@@ -0,0 +1,52 @@
+.\"
+.\" Copyright (c) 2008 Alexander Motin
+.\" 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. The name of the author may not be used to endorse or promote products
+.\" derived from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE 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 THE 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$
+.\"
+.Dd October 22, 2008
+.Dt SDHCI 4
+.Os
+.Sh NAME
+.Nm sdhci
+.Nd PCI SD Host Controller bridge driver
+.Sh SYNOPSIS
+.Cd device mmc
+.Cd device mmcsd
+.Cd device sdhci
+.Sh DESCRIPTION
+The
+.Nm
+driver supports PCI devices with class 8 and subclass 5 according to
+SD Host Controller Specification.
+Driver supports up to six high speed 4bit MMC/SD slots per controller.
+Driver attaches mmc bus to the respective slot on card insertion and
+detaches it on card removing.
+.Sh SEE ALSO
+.Xr mmc 4 ,
+.Xr mmcsd 4
+.Rs
+.%T "SD Specifications, Part 2, SD Host Controller, Simplified Specification"
+.Re
+.Sh AUTHORS
+.An Alexander Motin Aq mav@FreeBSD.org .
From danger at FreeBSD.org Tue Jan 6 00:20:12 2009
From: danger at FreeBSD.org (Daniel Gerzo)
Date: Tue Jan 6 00:20:26 2009
Subject: svn commit: r186802 - in stable/7/usr.sbin/ntp: . doc
Message-ID: <200901060020.n060KBUe016317@svn.freebsd.org>
Author: danger (doc committer)
Date: Tue Jan 6 00:20:11 2009
New Revision: 186802
URL: http://svn.freebsd.org/changeset/base/186802
Log:
MFC r185072:
- fix typo
PR: docs/128973
Submitted by: tabthorpe
Approved by: roberto
Modified:
stable/7/usr.sbin/ntp/ (props changed)
stable/7/usr.sbin/ntp/doc/ntp-keygen.8
Modified: stable/7/usr.sbin/ntp/doc/ntp-keygen.8
==============================================================================
--- stable/7/usr.sbin/ntp/doc/ntp-keygen.8 Tue Jan 6 00:11:18 2009 (r186801)
+++ stable/7/usr.sbin/ntp/doc/ntp-keygen.8 Tue Jan 6 00:20:11 2009 (r186802)
@@ -126,7 +126,7 @@ The safest way to run the
program is logged in directly as root.
The recommended procedure is change to the keys directory,
usually
-.Pa /ust/local/etc ,
+.Pa /usr/local/etc ,
then run the program.
When run for the first time,
or if all
From danger at FreeBSD.org Tue Jan 6 12:10:26 2009
From: danger at FreeBSD.org (Daniel Gerzo)
Date: Tue Jan 6 12:10:38 2009
Subject: svn commit: r186811 - in stable/7/lib/libc: . string sys
Message-ID: <200901061210.n06CANMM030154@svn.freebsd.org>
Author: danger (doc committer)
Date: Tue Jan 6 12:10:23 2009
New Revision: 186811
URL: http://svn.freebsd.org/changeset/base/186811
Log:
MFC r180534:
- Update the definition of modspecific structure
PR: docs/125630
Submitted by: Mateusz Guzik
Modified:
stable/7/lib/libc/ (props changed)
stable/7/lib/libc/string/ffsll.c (props changed)
stable/7/lib/libc/string/flsll.c (props changed)
stable/7/lib/libc/sys/modstat.2
Modified: stable/7/lib/libc/sys/modstat.2
==============================================================================
--- stable/7/lib/libc/sys/modstat.2 Tue Jan 6 11:11:58 2009 (r186810)
+++ stable/7/lib/libc/sys/modstat.2 Tue Jan 6 12:10:23 2009 (r186811)
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 13, 2007
+.Dd July 15, 2008
.Dt MODSTAT 2
.Os
.Sh NAME
@@ -55,9 +55,9 @@ struct module_stat {
};
typedef union modspecific {
int intval;
- u_int u_intval;
+ u_int uintval;
long longval;
- u_long u_longval;
+ u_long ulongval;
} modspecific_t;
.Ed
.Pp
From danger at FreeBSD.org Tue Jan 6 13:09:20 2009
From: danger at FreeBSD.org (Daniel Gerzo)
Date: Tue Jan 6 13:09:26 2009
Subject: svn commit: r186818 - in stable/7/lib/libc: . net string
Message-ID: <200901061309.n06D9J0D031795@svn.freebsd.org>
Author: danger (doc committer)
Date: Tue Jan 6 13:09:19 2009
New Revision: 186818
URL: http://svn.freebsd.org/changeset/base/186818
Log:
MFC r180162:
- AI_ALL and AI_V4MAPPED flags are currently not supported
PR: docs/120248
Submitted by: Heiko Wundram
Modified:
stable/7/lib/libc/ (props changed)
stable/7/lib/libc/net/getaddrinfo.3
stable/7/lib/libc/string/ffsll.c (props changed)
stable/7/lib/libc/string/flsll.c (props changed)
Modified: stable/7/lib/libc/net/getaddrinfo.3
==============================================================================
--- stable/7/lib/libc/net/getaddrinfo.3 Tue Jan 6 13:05:58 2009 (r186817)
+++ stable/7/lib/libc/net/getaddrinfo.3 Tue Jan 6 13:09:19 2009 (r186818)
@@ -18,7 +18,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 6, 2007
+.Dd July 1, 2008
.Dt GETADDRINFO 3
.Os
.Sh NAME
@@ -237,6 +237,11 @@ flag shall be ignored unless
.Fa ai_family
equals
.Dv AF_INET6 .
+Note: this flag is currently
+.Em not
+supported, see the
+.Sx BUGS
+section.
.El
.El
.Pp
@@ -485,6 +490,18 @@ freeaddrinfo(res0);
.%B "Proceedings of the freenix track: 2000 USENIX annual technical conference"
.%D June 2000
.Re
+.Sh BUGS
+The
+.Nm
+function as implemented in
+.Fx
+currently does not support
+.Dv AI_ALL
+and
+.Dv AI_V4MAPPED
+flags and returns
+.Dv EAI_BADFLAGS
+if one of them is specified.
.Sh STANDARDS
The
.Fn getaddrinfo
From kib at FreeBSD.org Tue Jan 6 15:18:15 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Tue Jan 6 15:18:26 2009
Subject: svn commit: r186830 - in stable/7/sys: . contrib/pf dev/cxgb pci sys
Message-ID: <200901061518.n06FIE6S034755@svn.freebsd.org>
Author: kib
Date: Tue Jan 6 15:18:14 2009
New Revision: 186830
URL: http://svn.freebsd.org/changeset/base/186830
Log:
MFC r186433:
Clear busy state on the pages which are after the one that failed the bind
attempt.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/pci/agp.c
stable/7/sys/sys/copyright.h (props changed)
Modified: stable/7/sys/pci/agp.c
==============================================================================
--- stable/7/sys/pci/agp.c Tue Jan 6 15:10:26 2009 (r186829)
+++ stable/7/sys/pci/agp.c Tue Jan 6 15:18:14 2009 (r186830)
@@ -563,6 +563,7 @@ agp_generic_bind_memory(device_t dev, st
device_printf(dev, "memory already bound\n");
error = EINVAL;
VM_OBJECT_LOCK(mem->am_obj);
+ i = 0;
goto bad;
}
@@ -591,7 +592,6 @@ agp_generic_bind_memory(device_t dev, st
* Bail out. Reverse all the mappings
* and unwire the pages.
*/
- vm_page_wakeup(m);
for (k = 0; k < i + j; k += AGP_PAGE_SIZE)
AGP_UNBIND_PAGE(dev, offset + k);
goto bad;
@@ -621,8 +621,10 @@ agp_generic_bind_memory(device_t dev, st
bad:
mtx_unlock(&sc->as_lock);
VM_OBJECT_LOCK_ASSERT(mem->am_obj, MA_OWNED);
- for (i = 0; i < mem->am_size; i += PAGE_SIZE) {
- m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(i));
+ for (k = 0; k < mem->am_size; k += PAGE_SIZE) {
+ m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(k));
+ if (k >= i)
+ vm_page_wakeup(m);
vm_page_lock_queues();
vm_page_unwire(m, 0);
vm_page_unlock_queues();
From rnoland at FreeBSD.org Tue Jan 6 17:05:46 2009
From: rnoland at FreeBSD.org (Robert Noland)
Date: Tue Jan 6 17:05:57 2009
Subject: svn commit: r186832 - in stable/7/sys: . contrib/pf dev/cxgb pci sys
Message-ID: <200901061705.n06H5i3F036935@svn.freebsd.org>
Author: rnoland
Date: Tue Jan 6 17:05:44 2009
New Revision: 186832
URL: http://svn.freebsd.org/changeset/base/186832
Log:
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
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/pci/agp_i810.c
stable/7/sys/sys/copyright.h (props changed)
Modified: stable/7/sys/pci/agp_i810.c
==============================================================================
--- stable/7/sys/pci/agp_i810.c Tue Jan 6 16:24:22 2009 (r186831)
+++ stable/7/sys/pci/agp_i810.c Tue Jan 6 17:05:44 2009 (r186832)
@@ -167,7 +167,7 @@ static const struct agp_i810_match {
"Intel GM965 SVGA controller"},
{0x2A128086, CHIP_I965, 0x00020000,
"Intel GME965 SVGA controller"},
- {0x2A428086, CHIP_I965, 0x00020000,
+ {0x2A428086, CHIP_G4X, 0x00020000,
"Intel GM45 SVGA controller"},
{0x2E028086, CHIP_G4X, 0x00020000,
"Intel 4 Series SVGA controller"},
@@ -284,6 +284,7 @@ agp_i810_probe(device_t dev)
case CHIP_I915:
case CHIP_I965:
case CHIP_G33:
+ case CHIP_G4X:
deven = pci_read_config(bdev, AGP_I915_DEVEN, 4);
if ((deven & AGP_I915_DEVEN_D2F0) ==
AGP_I915_DEVEN_D2F0_DISABLED) {
@@ -348,6 +349,7 @@ agp_i810_dump_regs(device_t dev)
case CHIP_I915:
case CHIP_I965:
case CHIP_G33:
+ case CHIP_G4X:
device_printf(dev, "AGP_I855_GCC1: 0x%02x\n",
pci_read_config(sc->bdev, AGP_I855_GCC1, 1));
device_printf(dev, "AGP_I915_MSAC: 0x%02x\n",
@@ -397,7 +399,7 @@ agp_i810_attach(device_t dev)
return error;
if (sc->chiptype != CHIP_I965 && sc->chiptype != CHIP_G33 &&
- ptoa((vm_paddr_t)Maxmem) > 0xfffffffful)
+ sc->chiptype != CHIP_G4X && ptoa((vm_paddr_t)Maxmem) > 0xfffffffful)
{
device_printf(dev, "agp_i810.c does not support physical "
"memory above 4GB.\n");
@@ -659,8 +661,7 @@ agp_i810_attach(device_t dev)
return EINVAL;
}
- if (sc->chiptype != CHIP_G4X)
- gtt_size += 4;
+ gtt_size += 4;
sc->stolen = (stolen - gtt_size) * 1024 / 4096;
if (sc->stolen > 0)
@@ -780,6 +781,7 @@ agp_i810_set_aperture(device_t dev, u_in
case CHIP_I915:
case CHIP_I965:
case CHIP_G33:
+ case CHIP_G4X:
return agp_generic_set_aperture(dev, aperture);
}
@@ -798,7 +800,8 @@ agp_i810_write_gtt_entry(device_t dev, i
u_int32_t pte;
pte = (u_int32_t)physical | 1;
- if (sc->chiptype == CHIP_I965 || sc->chiptype == CHIP_G33) {
+ if (sc->chiptype == CHIP_I965 || sc->chiptype == CHIP_G33 ||
+ sc->chiptype == CHIP_G4X) {
pte |= (physical & 0x0000000f00000000ull) >> 28;
} else {
/* If we do actually have memory above 4GB on an older system,
@@ -825,6 +828,10 @@ agp_i810_write_gtt_entry(device_t dev, i
bus_write_4(sc->sc_res[0],
(offset >> AGP_PAGE_SHIFT) * 4 + (512 * 1024), pte);
break;
+ case CHIP_G4X:
+ bus_write_4(sc->sc_res[0],
+ (offset >> AGP_PAGE_SHIFT) * 4 + (2 * 1024 * 1024), pte);
+ break;
}
}
From rodrigc at FreeBSD.org Tue Jan 6 21:34:55 2009
From: rodrigc at FreeBSD.org (Craig Rodrigues)
Date: Tue Jan 6 21:35:06 2009
Subject: svn commit: r186840 - in stable/7/sys: . contrib/pf dev/cxgb kern
sys
Message-ID: <200901062134.n06LYrKW042499@svn.freebsd.org>
Author: rodrigc
Date: Tue Jan 6 21:34:53 2009
New Revision: 186840
URL: http://svn.freebsd.org/changeset/base/186840
Log:
MFC 184700:
Add DTrace probes for process execution. This covers cases tested
by the DTrace test suite.
Approved by: jb
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/kern/kern_exec.c
stable/7/sys/kern/vfs_syscalls.c
stable/7/sys/sys/copyright.h (props changed)
Modified: stable/7/sys/kern/kern_exec.c
==============================================================================
--- stable/7/sys/kern/kern_exec.c Tue Jan 6 21:16:42 2009 (r186839)
+++ stable/7/sys/kern/kern_exec.c Tue Jan 6 21:34:53 2009 (r186840)
@@ -363,8 +363,6 @@ do_execve(td, args, mac_p)
imgp->image_header = NULL;
- SDT_PROBE(proc, kernel, , exec, args->fname, 0, 0, 0, 0 );
-
/*
* Translate the file name. namei() returns a vnode pointer
* in ni_vp amoung other things.
@@ -376,6 +374,8 @@ do_execve(td, args, mac_p)
NDINIT(ndp, LOOKUP, ISOPEN | LOCKLEAF | FOLLOW | SAVENAME | MPSAFE |
AUDITVNODE1, UIO_SYSSPACE, args->fname, td);
+ SDT_PROBE(proc, kernel, , exec, args->fname, 0, 0, 0, 0 );
+
interpret:
error = namei(ndp);
if (error)
@@ -749,6 +749,7 @@ interpret:
vfs_mark_atime(imgp->vp, td);
+ SDT_PROBE(proc, kernel, , exec_success, args->fname, 0, 0, 0, 0);
done1:
/*
* Free any resources malloc'd earlier that we didn't use.
@@ -760,8 +761,6 @@ done1:
crfree(newcred);
VOP_UNLOCK(imgp->vp, 0, td);
- SDT_PROBE(proc, kernel, , exec_success, args->fname, 0, 0, 0, 0);
-
/*
* Handle deferred decrement of ref counts.
*/
Modified: stable/7/sys/kern/vfs_syscalls.c
==============================================================================
--- stable/7/sys/kern/vfs_syscalls.c Tue Jan 6 21:16:42 2009 (r186839)
+++ stable/7/sys/kern/vfs_syscalls.c Tue Jan 6 21:34:53 2009 (r186840)
@@ -38,6 +38,7 @@
__FBSDID("$FreeBSD$");
#include "opt_compat.h"
+#include "opt_kdtrace.h"
#include "opt_ktrace.h"
#include "opt_mac.h"
@@ -58,6 +59,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
#include
#include
@@ -82,6 +84,14 @@ __FBSDID("$FreeBSD$");
#include
#include
+SDT_PROVIDER_DEFINE(vfs);
+SDT_PROBE_DEFINE(vfs, , stat, mode);
+SDT_PROBE_ARGTYPE(vfs, , stat, mode, 0, "char *");
+SDT_PROBE_ARGTYPE(vfs, , stat, mode, 1, "int");
+SDT_PROBE_DEFINE(vfs, , stat, reg);
+SDT_PROBE_ARGTYPE(vfs, , stat, reg, 0, "char *");
+SDT_PROBE_ARGTYPE(vfs, , stat, reg, 1, "int");
+
static int chroot_refuse_vdir_fds(struct filedesc *fdp);
static int getutimes(const struct timeval *, enum uio_seg, struct timespec *);
static int setfown(struct thread *td, struct vnode *, uid_t, gid_t);
@@ -2114,6 +2124,11 @@ kern_stat(struct thread *td, char *path,
return (error);
vfslocked = NDHASGIANT(&nd);
error = vn_stat(nd.ni_vp, &sb, td->td_ucred, NOCRED, td);
+ if (!error) {
+ SDT_PROBE(vfs, , stat, mode, path, sb.st_mode, 0, 0, 0);
+ if (S_ISREG(sb.st_mode))
+ SDT_PROBE(vfs, , stat, reg, path, pathseg, 0, 0, 0);
+ }
NDFREE(&nd, NDF_ONLY_PNBUF);
vput(nd.ni_vp);
VFS_UNLOCK_GIANT(vfslocked);
From bz at FreeBSD.org Tue Jan 6 23:05:31 2009
From: bz at FreeBSD.org (Bjoern A. Zeeb)
Date: Tue Jan 6 23:05:41 2009
Subject: svn commit: r186842 - in stable/7/sys: . contrib/pf dev/cxgb sys
Message-ID: <200901062305.n06N5SuT044356@svn.freebsd.org>
Author: bz
Date: Tue Jan 6 23:05:28 2009
New Revision: 186842
URL: http://svn.freebsd.org/changeset/base/186842
Log:
Move mergeinfo for r186587 from sys/sys/copyright.h to sys/.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/sys/copyright.h (props changed)
From mav at FreeBSD.org Wed Jan 7 11:04:59 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Wed Jan 7 11:05:14 2009
Subject: svn commit: r186855 - stable/7/share/man/man4
Message-ID: <200901071104.n07B4vk7083826@svn.freebsd.org>
Author: mav
Date: Wed Jan 7 11:04:57 2009
New Revision: 186855
URL: http://svn.freebsd.org/changeset/base/186855
Log:
Partially MFC rev. 172658 to reduce diff.
Sort.
Modified:
stable/7/share/man/man4/Makefile
Modified: stable/7/share/man/man4/Makefile
==============================================================================
--- stable/7/share/man/man4/Makefile Wed Jan 7 09:56:54 2009 (r186854)
+++ stable/7/share/man/man4/Makefile Wed Jan 7 11:04:57 2009 (r186855)
@@ -299,8 +299,8 @@ MAN= aac.4 \
sched_4bsd.4 \
sched_ule.4 \
screen.4 \
- sctp.4 \
scsi.4 \
+ sctp.4 \
sem.4 \
ses.4 \
sf.4 \
@@ -330,8 +330,8 @@ MAN= aac.4 \
snd_gusc.4 \
snd_hda.4 \
snd_ich.4 \
- snd_maestro.4 \
snd_maestro3.4 \
+ snd_maestro.4 \
snd_mss.4 \
snd_neomagic.4 \
snd_sbc.4 \
@@ -542,12 +542,12 @@ MLINKS+=vge.4 if_vge.4
MLINKS+=vlan.4 if_vlan.4
MLINKS+=vpo.4 imm.4
MLINKS+=vr.4 if_vr.4
+MLINKS+=watchdog.4 SW_WATCHDOG.4
MLINKS+=wb.4 if_wb.4
MLINKS+=wi.4 if_wi.4
MLINKS+=${_wpi.4} ${_if_wpi.4}
MLINKS+=xe.4 if_xe.4
MLINKS+=xl.4 if_xl.4
-MLINKS+=watchdog.4 SW_WATCHDOG.4
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
_acpi_dock.4= acpi_dock.4
@@ -563,13 +563,13 @@ _if_nxge.4= if_nxge.4
_if_wpi.4= if_wpi.4
_ipmi.4= ipmi.4
_k8temp.4= k8temp.4
-_nfsmb.4= nfsmb.4
_nfe.4= nfe.4
+_nfsmb.4= nfsmb.4
_nve.4= nve.4
_nxge.4= nxge.4
_rr232x.4= rr232x.4
-_spkr.4= spkr.4
_speaker.4= speaker.4
+_spkr.4= spkr.4
_wpi.4= wpi.4
.endif
From mav at FreeBSD.org Wed Jan 7 11:19:19 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Wed Jan 7 11:19:30 2009
Subject: svn commit: r186856 - stable/7/share/man/man4
Message-ID: <200901071119.n07BJIPk084239@svn.freebsd.org>
Author: mav
Date: Wed Jan 7 11:19:18 2009
New Revision: 186856
URL: http://svn.freebsd.org/changeset/base/186856
Log:
MFC rev. 186855
Hook up sdhci man page to the build.
Modified:
stable/7/share/man/man4/ (props changed)
stable/7/share/man/man4/Makefile
stable/7/share/man/man4/igb.4 (props changed)
Modified: stable/7/share/man/man4/Makefile
==============================================================================
--- stable/7/share/man/man4/Makefile Wed Jan 7 11:04:57 2009 (r186855)
+++ stable/7/share/man/man4/Makefile Wed Jan 7 11:19:18 2009 (r186856)
@@ -301,6 +301,7 @@ MAN= aac.4 \
screen.4 \
scsi.4 \
sctp.4 \
+ sdhci.4 \
sem.4 \
ses.4 \
sf.4 \
From mav at FreeBSD.org Wed Jan 7 11:44:04 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Wed Jan 7 11:44:21 2009
Subject: svn commit: r186857 - in stable/7/sys: . contrib/pf crypto/rc4
dev/cxgb
Message-ID: <200901071144.n07Bi3A3084743@svn.freebsd.org>
Author: mav
Date: Wed Jan 7 11:44:03 2009
New Revision: 186857
URL: http://svn.freebsd.org/changeset/base/186857
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/crypto/rc4/rc4.c
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/crypto/rc4/rc4.c
==============================================================================
--- stable/7/sys/crypto/rc4/rc4.c Wed Jan 7 11:19:18 2009 (r186856)
+++ stable/7/sys/crypto/rc4/rc4.c Wed Jan 7 11:44:03 2009 (r186857)
@@ -61,7 +61,7 @@ void
rc4_init(struct rc4_state *const state, const u_char *key, int keylen)
{
u_char j;
- int i;
+ int i, k;
/* Initialize state with identity permutation */
for (i = 0; i < 256; i++)
@@ -70,9 +70,11 @@ rc4_init(struct rc4_state *const state,
state->index2 = 0;
/* Randomize the permutation using key data */
- for (j = i = 0; i < 256; i++) {
- j += state->perm[i] + key[i % keylen];
+ for (j = i = k = 0; i < 256; i++) {
+ j += state->perm[i] + key[k];
swap_bytes(&state->perm[i], &state->perm[j]);
+ if (++k >= keylen)
+ k = 0;
}
}
From mav at FreeBSD.org Wed Jan 7 12:38:32 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Wed Jan 7 12:38:43 2009
Subject: svn commit: r186859 - in stable/7/sys: . contrib/pf dev/cxgb
netgraph
Message-ID: <200901071238.n07CcVke085919@svn.freebsd.org>
Author: mav
Date: Wed Jan 7 12:38:31 2009
New Revision: 186859
URL: http://svn.freebsd.org/changeset/base/186859
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/netgraph/ng_mppc.c
Modified: stable/7/sys/netgraph/ng_mppc.c
==============================================================================
--- stable/7/sys/netgraph/ng_mppc.c Wed Jan 7 11:54:00 2009 (r186858)
+++ stable/7/sys/netgraph/ng_mppc.c Wed Jan 7 12:38:31 2009 (r186859)
@@ -492,17 +492,18 @@ ng_mppc_compress(node_p node, struct mbu
/* Work with contiguous regions of memory. */
inlen = m->m_pkthdr.len;
inbuf = malloc(inlen, M_NETGRAPH_MPPC, M_NOWAIT);
- if (inbuf == NULL) {
- m_freem(m);
- return (ENOMEM);
- }
+ if (inbuf == NULL)
+ goto err1;
m_copydata(m, 0, inlen, (caddr_t)inbuf);
outlen = MPPC_MAX_BLOWUP(inlen);
outbuf = malloc(outlen, M_NETGRAPH_MPPC, M_NOWAIT);
if (outbuf == NULL) {
- m_freem(m);
free(inbuf, M_NETGRAPH_MPPC);
+err1:
+ m_freem(m);
+ MPPC_InitCompressionHistory(d->history);
+ d->flushed = 1;
return (ENOMEM);
}
@@ -538,8 +539,13 @@ ng_mppc_compress(node_p node, struct mbu
free(outbuf, M_NETGRAPH_MPPC);
/* Check m_devget() result. */
- if (m == NULL)
+ if (m == NULL) {
+ if (!d->flushed) {
+ MPPC_InitCompressionHistory(d->history);
+ d->flushed = 1;
+ }
return (ENOMEM);
+ }
}
#endif
@@ -551,6 +557,18 @@ ng_mppc_compress(node_p node, struct mbu
/* Set header bits */
header |= MPPC_FLAG_ENCRYPTED;
+ /* We must own the mbuf chain exclusively to modify it. */
+ m = m_unshare(m, M_DONTWAIT);
+ if (m == NULL) {
+ if (!d->flushed) {
+#ifdef NETGRAPH_MPPC_COMPRESSION
+ MPPC_InitCompressionHistory(d->history);
+#endif
+ d->flushed = 1;
+ }
+ return (ENOMEM);
+ }
+
/* Update key if it's time */
if ((d->cfg.bits & MPPE_STATELESS) != 0
|| (d->cc & MPPE_UPDATE_MASK) == MPPE_UPDATE_FLAG) {
@@ -562,11 +580,6 @@ ng_mppc_compress(node_p node, struct mbu
rc4_init(&d->rc4, d->key, KEYLEN(d->cfg.bits));
}
- /* We must own the mbuf chain exclusively to modify it. */
- m = m_unshare(m, M_DONTWAIT);
- if (m == NULL)
- return (ENOMEM);
-
/* Encrypt packet */
m1 = m;
while (m1) {
@@ -811,21 +824,24 @@ ng_mppc_reset_req(node_p node)
static void
ng_mppc_getkey(const u_char *h, u_char *h2, int len)
{
- static const u_char pad1[10] =
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
- static const u_char pad2[10] =
- { 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, };
+ static const u_char pad1[40] =
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ static const u_char pad2[40] =
+ { 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2,
+ 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2,
+ 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2,
+ 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2 };
u_char hash[20];
SHA1_CTX c;
- int k;
SHA1Init(&c);
SHA1Update(&c, h, len);
- for (k = 0; k < 4; k++)
- SHA1Update(&c, pad1, sizeof(pad1));
+ SHA1Update(&c, pad1, sizeof(pad1));
SHA1Update(&c, h2, len);
- for (k = 0; k < 4; k++)
- SHA1Update(&c, pad2, sizeof(pad2));
+ SHA1Update(&c, pad2, sizeof(pad2));
SHA1Final(hash, &c);
bcopy(hash, h2, len);
}
From kib at FreeBSD.org Wed Jan 7 12:44:04 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Wed Jan 7 12:44:16 2009
Subject: svn commit: r186860 - in stable/7/sys: . contrib/pf dev/cxgb kern
Message-ID: <200901071244.n07Ci3RI086090@svn.freebsd.org>
Author: kib
Date: Wed Jan 7 12:44:03 2009
New Revision: 186860
URL: http://svn.freebsd.org/changeset/base/186860
Log:
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
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/kern/vfs_cache.c
Modified: stable/7/sys/kern/vfs_cache.c
==============================================================================
--- stable/7/sys/kern/vfs_cache.c Wed Jan 7 12:38:31 2009 (r186859)
+++ stable/7/sys/kern/vfs_cache.c Wed Jan 7 12:44:03 2009 (r186860)
@@ -511,28 +511,18 @@ cache_enter(dvp, vp, cnp)
CACHE_LOCK();
/*
- * See if this vnode is already in the cache with this name.
- * This can happen with concurrent lookups of the same path
- * name.
+ * See if this vnode or negative entry is already in the cache
+ * with this name. This can happen with concurrent lookups of
+ * the same path name.
*/
- if (vp) {
- TAILQ_FOREACH(n2, &vp->v_cache_dst, nc_dst) {
- if (n2->nc_dvp == dvp &&
- n2->nc_nlen == cnp->cn_namelen &&
- !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) {
- CACHE_UNLOCK();
- cache_free(ncp);
- return;
- }
- }
- } else {
- TAILQ_FOREACH(n2, &ncneg, nc_dst) {
- if (n2->nc_nlen == cnp->cn_namelen &&
- !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) {
- CACHE_UNLOCK();
- cache_free(ncp);
- return;
- }
+ ncpp = NCHHASH(hash);
+ LIST_FOREACH(n2, ncpp, nc_hash) {
+ if (n2->nc_dvp == dvp &&
+ n2->nc_nlen == cnp->cn_namelen &&
+ !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) {
+ CACHE_UNLOCK();
+ cache_free(ncp);
+ return;
}
}
@@ -550,7 +540,6 @@ cache_enter(dvp, vp, cnp)
* Insert the new namecache entry into the appropriate chain
* within the cache entries table.
*/
- ncpp = NCHHASH(hash);
LIST_INSERT_HEAD(ncpp, ncp, nc_hash);
if (LIST_EMPTY(&dvp->v_cache_src)) {
hold = 1;
From mav at FreeBSD.org Wed Jan 7 15:28:48 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Wed Jan 7 15:29:08 2009
Subject: svn commit: r186862 - stable/7/sys/dev/sound/pci/hda
Message-ID: <200901071528.n07FSlXM090711@svn.freebsd.org>
Author: mav
Date: Wed Jan 7 15:28:47 2009
New Revision: 186862
URL: http://svn.freebsd.org/changeset/base/186862
Log:
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
Modified:
stable/7/sys/dev/sound/pci/hda/hda_reg.h
stable/7/sys/dev/sound/pci/hda/hdac.c
stable/7/sys/dev/sound/pci/hda/hdac_private.h
Modified: stable/7/sys/dev/sound/pci/hda/hda_reg.h
==============================================================================
--- stable/7/sys/dev/sound/pci/hda/hda_reg.h Wed Jan 7 14:00:44 2009 (r186861)
+++ stable/7/sys/dev/sound/pci/hda/hda_reg.h Wed Jan 7 15:28:47 2009 (r186862)
@@ -180,13 +180,14 @@
HDA_CMD_VERB_SET_CONV_FMT, (payload)))
/* Digital Converter Control */
-#define HDA_CMD_VERB_GET_DIGITAL_CONV_FMT 0xf0d
+#define HDA_CMD_VERB_GET_DIGITAL_CONV_FMT1 0xf0d
+#define HDA_CMD_VERB_GET_DIGITAL_CONV_FMT2 0xf0e
#define HDA_CMD_VERB_SET_DIGITAL_CONV_FMT1 0x70d
#define HDA_CMD_VERB_SET_DIGITAL_CONV_FMT2 0x70e
#define HDA_CMD_GET_DIGITAL_CONV_FMT(cad, nid) \
(HDA_CMD_12BIT((cad), (nid), \
- HDA_CMD_VERB_GET_DIGITAL_CONV_FMTT, 0x0))
+ HDA_CMD_VERB_GET_DIGITAL_CONV_FMT1, 0x0))
#define HDA_CMD_SET_DIGITAL_CONV_FMT1(cad, nid, payload) \
(HDA_CMD_12BIT((cad), (nid), \
HDA_CMD_VERB_SET_DIGITAL_CONV_FMT1, (payload)))
@@ -1034,7 +1035,7 @@
HDA_PARAM_PIN_CAP_HEADPHONE_CAP_SHIFT)
#define HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(param) \
(((param) & HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP_MASK) >> \
- HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP_MASK)
+ HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP_SHIFT)
#define HDA_PARAM_PIN_CAP_TRIGGER_REQD(param) \
(((param) & HDA_PARAM_PIN_CAP_TRIGGER_REQD_MASK) >> \
HDA_PARAM_PIN_CAP_TRIGGER_REQD_SHIFT)
@@ -1193,14 +1194,47 @@
HDA_PARAM_VOLUME_KNOB_CAP_NUM_STEPS_SHIFT)
-#define HDA_CONFIG_DEFAULTCONF_SEQUENCE_MASK 0x00000000f
-#define HDA_CONFIG_DEFAULTCONF_ASSOCIATION_MASK 0x0000000f0
-#define HDA_CONFIG_DEFAULTCONF_MISC_MASK 0x000000f00
-#define HDA_CONFIG_DEFAULTCONF_COLOR_MASK 0x00000f000
-#define HDA_CONFIG_DEFAULTCONF_CONNECTION_TYPE_MASK 0x000f00000
-#define HDA_CONFIG_DEFAULTCONF_DEVICE_MASK 0x000f00000
-#define HDA_CONFIG_DEFAULTCONF_LOCATION_MASK 0x03f000000
-#define HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK 0x0c0000000
+#define HDA_CONFIG_DEFAULTCONF_SEQUENCE_MASK 0x0000000f
+#define HDA_CONFIG_DEFAULTCONF_SEQUENCE_SHIFT 0
+#define HDA_CONFIG_DEFAULTCONF_ASSOCIATION_MASK 0x000000f0
+#define HDA_CONFIG_DEFAULTCONF_ASSOCIATION_SHIFT 4
+#define HDA_CONFIG_DEFAULTCONF_MISC_MASK 0x00000f00
+#define HDA_CONFIG_DEFAULTCONF_MISC_SHIFT 8
+#define HDA_CONFIG_DEFAULTCONF_COLOR_MASK 0x0000f000
+#define HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT 12
+#define HDA_CONFIG_DEFAULTCONF_CONNECTION_TYPE_MASK 0x000f0000
+#define HDA_CONFIG_DEFAULTCONF_CONNECTION_TYPE_SHIFT 16
+#define HDA_CONFIG_DEFAULTCONF_DEVICE_MASK 0x00f00000
+#define HDA_CONFIG_DEFAULTCONF_DEVICE_SHIFT 20
+#define HDA_CONFIG_DEFAULTCONF_LOCATION_MASK 0x3f000000
+#define HDA_CONFIG_DEFAULTCONF_LOCATION_SHIFT 24
+#define HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK 0xc0000000
+#define HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_SHIFT 30
+
+#define HDA_CONFIG_DEFAULTCONF_SEQUENCE(conf) \
+ (((conf) & HDA_CONFIG_DEFAULTCONF_SEQUENCE_MASK) >> \
+ HDA_CONFIG_DEFAULTCONF_SEQUENCE_SHIFT)
+#define HDA_CONFIG_DEFAULTCONF_ASSOCIATION(conf) \
+ (((conf) & HDA_CONFIG_DEFAULTCONF_ASSOCIATION_MASK) >> \
+ HDA_CONFIG_DEFAULTCONF_ASSOCIATION_SHIFT)
+#define HDA_CONFIG_DEFAULTCONF_MISC(conf) \
+ (((conf) & HDA_CONFIG_DEFAULTCONF_MISC_MASK) >> \
+ HDA_CONFIG_DEFAULTCONF_MISC_SHIFT)
+#define HDA_CONFIG_DEFAULTCONF_COLOR(conf) \
+ (((conf) & HDA_CONFIG_DEFAULTCONF_COLOR_MASK) >> \
+ HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT)
+#define HDA_CONFIG_DEFAULTCONF_CONNECTION_TYPE(conf) \
+ (((conf) & HDA_CONFIG_DEFAULTCONF_CONNECTION_TYPE_MASK) >> \
+ HDA_CONFIG_DEFAULTCONF_CONNECTION_TYPE_SHIFT)
+#define HDA_CONFIG_DEFAULTCONF_DEVICE(conf) \
+ (((conf) & HDA_CONFIG_DEFAULTCONF_DEVICE_MASK) >> \
+ HDA_CONFIG_DEFAULTCONF_DEVICE_SHIFT)
+#define HDA_CONFIG_DEFAULTCONF_LOCATION(conf) \
+ (((conf) & HDA_CONFIG_DEFAULTCONF_LOCATION_MASK) >> \
+ HDA_CONFIG_DEFAULTCONF_LOCATION_SHIFT)
+#define HDA_CONFIG_DEFAULTCONF_CONNECTIVITY(conf) \
+ (((conf) & HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK) >> \
+ HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_SHIFT)
#define HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_JACK (0<<30)
#define HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_NONE (1<<30)
Modified: stable/7/sys/dev/sound/pci/hda/hdac.c
==============================================================================
--- stable/7/sys/dev/sound/pci/hda/hdac.c Wed Jan 7 14:00:44 2009 (r186861)
+++ stable/7/sys/dev/sound/pci/hda/hdac.c Wed Jan 7 15:28:47 2009 (r186862)
@@ -1,6 +1,7 @@
/*-
* Copyright (c) 2006 Stephane E. Potvin
* Copyright (c) 2006 Ariff Abdullah
+ * Copyright (c) 2008 Alexander Motin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -61,6 +62,7 @@
* * Daniel Eischen *
* * Maxime Guillaud *
* * Ariff Abdullah *
+ * * Alexander Motin *
* * *
* * ....and various people from freebsd-multimedia@FreeBSD.org *
* * *
@@ -81,8 +83,7 @@
#include "mixer_if.h"
-#define HDA_DRV_TEST_REV "20080420_0052"
-#define HDA_WIDGET_PARSER_REV 1
+#define HDA_DRV_TEST_REV "20081226_0122"
SND_DECLARE_FILE("$FreeBSD$");
@@ -92,6 +93,12 @@ SND_DECLARE_FILE("$FreeBSD$");
} \
} while(0)
+#define HDA_BOOTHVERBOSE(stmt) do { \
+ if (snd_verbose > 3) { \
+ stmt \
+ } \
+} while(0)
+
#if 1
#undef HDAC_INTR_EXTRA
#define HDAC_INTR_EXTRA 1
@@ -141,6 +148,8 @@ SND_DECLARE_FILE("$FreeBSD$");
#define HDA_INTEL_82801G HDA_MODEL_CONSTRUCT(INTEL, 0x27d8)
#define HDA_INTEL_82801H HDA_MODEL_CONSTRUCT(INTEL, 0x284b)
#define HDA_INTEL_82801I HDA_MODEL_CONSTRUCT(INTEL, 0x293e)
+#define HDA_INTEL_82801J HDA_MODEL_CONSTRUCT(INTEL, 0x3a3e)
+#define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b)
#define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff)
/* Nvidia */
@@ -153,6 +162,16 @@ SND_DECLARE_FILE("$FreeBSD$");
#define HDA_NVIDIA_MCP65_2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x044b)
#define HDA_NVIDIA_MCP67_1 HDA_MODEL_CONSTRUCT(NVIDIA, 0x055c)
#define HDA_NVIDIA_MCP67_2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x055d)
+#define HDA_NVIDIA_MCP78_1 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0774)
+#define HDA_NVIDIA_MCP78_2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0775)
+#define HDA_NVIDIA_MCP78_3 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0776)
+#define HDA_NVIDIA_MCP78_4 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0777)
+#define HDA_NVIDIA_MCP73_1 HDA_MODEL_CONSTRUCT(NVIDIA, 0x07fc)
+#define HDA_NVIDIA_MCP73_2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x07fd)
+#define HDA_NVIDIA_MCP79_1 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac0)
+#define HDA_NVIDIA_MCP79_2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac1)
+#define HDA_NVIDIA_MCP79_3 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac2)
+#define HDA_NVIDIA_MCP79_4 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac3)
#define HDA_NVIDIA_ALL HDA_MODEL_CONSTRUCT(NVIDIA, 0xffff)
/* ATI */
@@ -171,6 +190,11 @@ SND_DECLARE_FILE("$FreeBSD$");
#define HDA_SIS_966 HDA_MODEL_CONSTRUCT(SIS, 0x7502)
#define HDA_SIS_ALL HDA_MODEL_CONSTRUCT(SIS, 0xffff)
+/* ULI */
+#define ULI_VENDORID 0x10b9
+#define HDA_ULI_M5461 HDA_MODEL_CONSTRUCT(ULI, 0x5461)
+#define HDA_ULI_ALL HDA_MODEL_CONSTRUCT(ULI, 0xffff)
+
/* OEM/subvendors */
/* Intel */
@@ -195,6 +219,7 @@ SND_DECLARE_FILE("$FreeBSD$");
#define DELL_VENDORID 0x1028
#define DELL_D630_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01f9)
#define DELL_D820_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01cc)
+#define DELL_V1400_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x0227)
#define DELL_V1500_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x0228)
#define DELL_I1300_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01c9)
#define DELL_XPSM1210_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01d7)
@@ -213,6 +238,7 @@ SND_DECLARE_FILE("$FreeBSD$");
#define ACER_A4710_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x012f)
#define ACER_A4715_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x0133)
#define ACER_3681WXM_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x0110)
+#define ACER_T6292_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x011b)
#define ACER_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0xffff)
/* Asus */
@@ -260,6 +286,11 @@ SND_DECLARE_FILE("$FreeBSD$");
#define APPLE_VENDORID 0x106b
#define APPLE_MB3_SUBVENDOR HDA_MODEL_CONSTRUCT(APPLE, 0x00a1)
+/* Sony */
+#define SONY_VENDORID 0x104d
+#define SONY_S5_SUBVENDOR HDA_MODEL_CONSTRUCT(SONY, 0x81cc)
+#define SONY_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(SONY, 0xffff)
+
/*
* Apple Intel MacXXXX seems using Sigmatel codec/vendor id
* instead of their own, which is beyond my comprehension
@@ -308,6 +339,7 @@ SND_DECLARE_FILE("$FreeBSD$");
/* Misc constants.. */
+#define HDA_AMP_VOL_DEFAULT (-1)
#define HDA_AMP_MUTE_DEFAULT (0xffffffff)
#define HDA_AMP_MUTE_NONE (0)
#define HDA_AMP_MUTE_LEFT (1 << 0)
@@ -317,16 +349,10 @@ SND_DECLARE_FILE("$FreeBSD$");
#define HDA_AMP_LEFT_MUTED(v) ((v) & (HDA_AMP_MUTE_LEFT))
#define HDA_AMP_RIGHT_MUTED(v) (((v) & HDA_AMP_MUTE_RIGHT) >> 1)
-#define HDA_DAC_PATH (1 << 0)
-#define HDA_ADC_PATH (1 << 1)
-#define HDA_ADC_RECSEL (1 << 2)
-
-#define HDA_DAC_LOCKED (1 << 3)
-#define HDA_ADC_LOCKED (1 << 4)
-
-#define HDA_CTL_OUT (1 << 0)
-#define HDA_CTL_IN (1 << 1)
-#define HDA_CTL_BOTH (HDA_CTL_IN | HDA_CTL_OUT)
+#define HDA_ADC_MONITOR (1 << 0)
+
+#define HDA_CTL_OUT 1
+#define HDA_CTL_IN 2
#define HDA_GPIO_MAX 8
/* 0 - 7 = GPIO , 8 = Flush */
@@ -346,6 +372,7 @@ SND_DECLARE_FILE("$FreeBSD$");
#define HDA_QUIRK_FORCESTEREO (1 << 11)
#define HDA_QUIRK_EAPDINV (1 << 12)
#define HDA_QUIRK_DMAPOS (1 << 13)
+#define HDA_QUIRK_SENSEINV (1 << 14)
/* 26 - 31 = vrefs */
#define HDA_QUIRK_IVREF50 (1 << 26)
@@ -361,9 +388,6 @@ SND_DECLARE_FILE("$FreeBSD$");
HDA_QUIRK_OVREF100)
#define HDA_QUIRK_VREF (HDA_QUIRK_IVREF | HDA_QUIRK_OVREF)
-#define SOUND_MASK_SKIP (1 << 30)
-#define SOUND_MASK_DISABLE (1 << 31)
-
#if __FreeBSD_version < 600000
#define taskqueue_drain(...)
#endif
@@ -386,6 +410,7 @@ static const struct {
{ "forcestereo", HDA_QUIRK_FORCESTEREO },
{ "eapdinv", HDA_QUIRK_EAPDINV },
{ "dmapos", HDA_QUIRK_DMAPOS },
+ { "senseinv", HDA_QUIRK_SENSEINV },
{ "ivref50", HDA_QUIRK_IVREF50 },
{ "ivref80", HDA_QUIRK_IVREF80 },
{ "ivref100", HDA_QUIRK_IVREF100 },
@@ -413,14 +438,18 @@ static const struct {
#define HDA_PARSE_MAXDEPTH 10
#define HDAC_UNSOLTAG_EVENT_HP 0x00
-#define HDAC_UNSOLTAG_EVENT_TEST 0x01
MALLOC_DEFINE(M_HDAC, "hdac", "High Definition Audio Controller");
-enum {
- HDA_PARSE_MIXER,
- HDA_PARSE_DIRECT
-};
+const char *HDA_COLORS[16] = {"Unknown", "Black", "Grey", "Blue", "Green", "Red",
+ "Orange", "Yellow", "Purple", "Pink", "Res.A", "Res.B", "Res.C", "Res.D",
+ "White", "Other"};
+
+const char *HDA_DEVS[16] = {"Line-out", "Speaker", "Headphones", "CD",
+ "SPDIF-out", "Digital-out", "Modem-line", "Modem-handset", "Line-in",
+ "AUX", "Mic", "Telephony", "SPDIF-in", "Digital-in", "Res.E", "Other"};
+
+const char *HDA_CONNS[4] = {"Jack", "None", "Fixed", "Both"};
/* Default */
static uint32_t hdac_fmt[] = {
@@ -439,6 +468,8 @@ static const struct {
{ HDA_INTEL_82801G, "Intel 82801G" },
{ HDA_INTEL_82801H, "Intel 82801H" },
{ HDA_INTEL_82801I, "Intel 82801I" },
+ { HDA_INTEL_82801J, "Intel 82801J" },
+ { HDA_INTEL_SCH, "Intel SCH" },
{ HDA_NVIDIA_MCP51, "NVidia MCP51" },
{ HDA_NVIDIA_MCP55, "NVidia MCP55" },
{ HDA_NVIDIA_MCP61_1, "NVidia MCP61" },
@@ -447,16 +478,28 @@ static const struct {
{ HDA_NVIDIA_MCP65_2, "NVidia MCP65" },
{ HDA_NVIDIA_MCP67_1, "NVidia MCP67" },
{ HDA_NVIDIA_MCP67_2, "NVidia MCP67" },
+ { HDA_NVIDIA_MCP73_1, "NVidia MCP73" },
+ { HDA_NVIDIA_MCP73_2, "NVidia MCP73" },
+ { HDA_NVIDIA_MCP78_1, "NVidia MCP78" },
+ { HDA_NVIDIA_MCP78_2, "NVidia MCP78" },
+ { HDA_NVIDIA_MCP78_3, "NVidia MCP78" },
+ { HDA_NVIDIA_MCP78_4, "NVidia MCP78" },
+ { HDA_NVIDIA_MCP79_1, "NVidia MCP79" },
+ { HDA_NVIDIA_MCP79_2, "NVidia MCP79" },
+ { HDA_NVIDIA_MCP79_3, "NVidia MCP79" },
+ { HDA_NVIDIA_MCP79_4, "NVidia MCP79" },
{ HDA_ATI_SB450, "ATI SB450" },
{ HDA_ATI_SB600, "ATI SB600" },
{ HDA_VIA_VT82XX, "VIA VT8251/8237A" },
{ HDA_SIS_966, "SiS 966" },
+ { HDA_ULI_M5461, "ULI M5461" },
/* Unknown */
{ HDA_INTEL_ALL, "Intel (Unknown)" },
{ HDA_NVIDIA_ALL, "NVidia (Unknown)" },
{ HDA_ATI_ALL, "ATI (Unknown)" },
{ HDA_VIA_ALL, "VIA (Unknown)" },
{ HDA_SIS_ALL, "SiS (Unknown)" },
+ { HDA_ULI_ALL, "ULI (Unknown)" },
};
#define HDAC_DEVICES_LEN (sizeof(hdac_devices) / sizeof(hdac_devices[0]))
@@ -526,8 +569,13 @@ static const struct {
#define REALTEK_VENDORID 0x10ec
#define HDA_CODEC_ALC260 HDA_CODEC_CONSTRUCT(REALTEK, 0x0260)
#define HDA_CODEC_ALC262 HDA_CODEC_CONSTRUCT(REALTEK, 0x0262)
+#define HDA_CODEC_ALC267 HDA_CODEC_CONSTRUCT(REALTEK, 0x0267)
#define HDA_CODEC_ALC268 HDA_CODEC_CONSTRUCT(REALTEK, 0x0268)
+#define HDA_CODEC_ALC269 HDA_CODEC_CONSTRUCT(REALTEK, 0x0269)
+#define HDA_CODEC_ALC272 HDA_CODEC_CONSTRUCT(REALTEK, 0x0272)
#define HDA_CODEC_ALC660 HDA_CODEC_CONSTRUCT(REALTEK, 0x0660)
+#define HDA_CODEC_ALC662 HDA_CODEC_CONSTRUCT(REALTEK, 0x0662)
+#define HDA_CODEC_ALC663 HDA_CODEC_CONSTRUCT(REALTEK, 0x0663)
#define HDA_CODEC_ALC861 HDA_CODEC_CONSTRUCT(REALTEK, 0x0861)
#define HDA_CODEC_ALC861VD HDA_CODEC_CONSTRUCT(REALTEK, 0x0862)
#define HDA_CODEC_ALC880 HDA_CODEC_CONSTRUCT(REALTEK, 0x0880)
@@ -535,16 +583,26 @@ static const struct {
#define HDA_CODEC_ALC883 HDA_CODEC_CONSTRUCT(REALTEK, 0x0883)
#define HDA_CODEC_ALC885 HDA_CODEC_CONSTRUCT(REALTEK, 0x0885)
#define HDA_CODEC_ALC888 HDA_CODEC_CONSTRUCT(REALTEK, 0x0888)
+#define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889)
#define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff)
/* Analog Devices */
#define ANALOGDEVICES_VENDORID 0x11d4
+#define HDA_CODEC_AD1884A HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x184a)
+#define HDA_CODEC_AD1882 HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1882)
+#define HDA_CODEC_AD1883 HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1883)
+#define HDA_CODEC_AD1884 HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1884)
+#define HDA_CODEC_AD1984A HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x194a)
+#define HDA_CODEC_AD1984B HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x194b)
#define HDA_CODEC_AD1981HD HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1981)
#define HDA_CODEC_AD1983 HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1983)
#define HDA_CODEC_AD1984 HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1984)
#define HDA_CODEC_AD1986A HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1986)
+#define HDA_CODEC_AD1987 HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1987)
#define HDA_CODEC_AD1988 HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1988)
#define HDA_CODEC_AD1988B HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x198b)
+#define HDA_CODEC_AD1882A HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x882a)
+#define HDA_CODEC_AD1989B HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x989b)
#define HDA_CODEC_ADXXXX HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0xffff)
/* CMedia */
@@ -554,29 +612,77 @@ static const struct {
/* Sigmatel */
#define SIGMATEL_VENDORID 0x8384
+#define HDA_CODEC_STAC9230X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7612)
+#define HDA_CODEC_STAC9230D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7613)
+#define HDA_CODEC_STAC9229X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7614)
+#define HDA_CODEC_STAC9229D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7615)
+#define HDA_CODEC_STAC9228X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7616)
+#define HDA_CODEC_STAC9228D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7617)
+#define HDA_CODEC_STAC9227X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7618)
+#define HDA_CODEC_STAC9227D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7619)
+#define HDA_CODEC_STAC9274 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7620)
+#define HDA_CODEC_STAC9274D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7621)
+#define HDA_CODEC_STAC9273X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7622)
+#define HDA_CODEC_STAC9273D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7623)
+#define HDA_CODEC_STAC9272X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7624)
+#define HDA_CODEC_STAC9272D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7625)
+#define HDA_CODEC_STAC9271X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7626)
+#define HDA_CODEC_STAC9271D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7627)
+#define HDA_CODEC_STAC9274X5NH HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7628)
+#define HDA_CODEC_STAC9274D5NH HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7629)
+#define HDA_CODEC_STAC9250 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7634)
+#define HDA_CODEC_STAC9251 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7636)
+#define HDA_CODEC_IDT92HD700X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7638)
+#define HDA_CODEC_IDT92HD700D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7639)
+#define HDA_CODEC_IDT92HD206X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7645)
+#define HDA_CODEC_IDT92HD206D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7646)
+#define HDA_CODEC_STAC9872AK HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7662)
#define HDA_CODEC_STAC9221 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7680)
+#define HDA_CODEC_STAC922XD HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7681)
+#define HDA_CODEC_STAC9221_A2 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7682)
#define HDA_CODEC_STAC9221D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7683)
#define HDA_CODEC_STAC9220 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7690)
-#define HDA_CODEC_STAC922XD HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7681)
-#define HDA_CODEC_STAC9227 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7618)
-#define HDA_CODEC_STAC9271D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7627)
-#define HDA_CODEC_STAC9205 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a0)
-#define HDA_CODEC_STAC9872AK HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7662)
+#define HDA_CODEC_STAC9200D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7691)
+#define HDA_CODEC_IDT92HD005 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7698)
+#define HDA_CODEC_IDT92HD005D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7699)
+#define HDA_CODEC_STAC9205X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a0)
+#define HDA_CODEC_STAC9205D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a1)
+#define HDA_CODEC_STAC9204X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a2)
+#define HDA_CODEC_STAC9204D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a3)
+#define HDA_CODEC_STAC9220_A2 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7880)
+#define HDA_CODEC_STAC9220_A1 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7882)
#define HDA_CODEC_STACXXXX HDA_CODEC_CONSTRUCT(SIGMATEL, 0xffff)
-/*
- * Conexant
- *
- * Ok, the truth is, I don't have any idea at all whether
- * it is "Venice" or "Waikiki" or other unnamed CXyadayada. The only
- * place that tell me it is "Venice" is from its Windows driver INF.
- *
- * Venice - CX?????
- * Waikiki - CX20551-22
- */
+/* IDT */
+#define IDT_VENDORID 0x111d
+#define HDA_CODEC_IDT92HD75BX HDA_CODEC_CONSTRUCT(IDT, 0x7603)
+#define HDA_CODEC_IDT92HD83C1X HDA_CODEC_CONSTRUCT(IDT, 0x7604)
+#define HDA_CODEC_IDT92HD81B1X HDA_CODEC_CONSTRUCT(IDT, 0x7605)
+#define HDA_CODEC_IDT92HD75B3 HDA_CODEC_CONSTRUCT(IDT, 0x7608)
+#define HDA_CODEC_IDT92HD73D1 HDA_CODEC_CONSTRUCT(IDT, 0x7674)
+#define HDA_CODEC_IDT92HD73C1 HDA_CODEC_CONSTRUCT(IDT, 0x7675)
+#define HDA_CODEC_IDT92HD73E1 HDA_CODEC_CONSTRUCT(IDT, 0x7676)
+#define HDA_CODEC_IDT92HD71B8 HDA_CODEC_CONSTRUCT(IDT, 0x76b0)
+#define HDA_CODEC_IDT92HD71B7 HDA_CODEC_CONSTRUCT(IDT, 0x76b2)
+#define HDA_CODEC_IDT92HD71B5 HDA_CODEC_CONSTRUCT(IDT, 0x76b6)
+#define HDA_CODEC_IDT92HD83C1C HDA_CODEC_CONSTRUCT(IDT, 0x76d4)
+#define HDA_CODEC_IDT92HD81B1C HDA_CODEC_CONSTRUCT(IDT, 0x76d5)
+#define HDA_CODEC_IDTXXXX HDA_CODEC_CONSTRUCT(IDT, 0xffff)
+
+/* Silicon Image */
+#define SII_VENDORID 0x1095
+#define HDA_CODEC_SII1392 HDA_CODEC_CONSTRUCT(SII, 0x1392)
+#define HDA_CODEC_SIIXXXX HDA_CODEC_CONSTRUCT(SII, 0xffff)
+
+/* Lucent/Agere */
+#define AGERE_VENDORID 0x11c1
+#define HDA_CODEC_AGEREXXXX HDA_CODEC_CONSTRUCT(AGERE, 0xffff)
+
+/* Conexant */
#define CONEXANT_VENDORID 0x14f1
-#define HDA_CODEC_CXVENICE HDA_CODEC_CONSTRUCT(CONEXANT, 0x5045)
-#define HDA_CODEC_CXWAIKIKI HDA_CODEC_CONSTRUCT(CONEXANT, 0x5047)
+#define HDA_CODEC_CX20549 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5045)
+#define HDA_CODEC_CX20551 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5047)
+#define HDA_CODEC_CX20561 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5051)
#define HDA_CODEC_CXXXXX HDA_CODEC_CONSTRUCT(CONEXANT, 0xffff)
/* VIA */
@@ -592,8 +698,28 @@ static const struct {
#define HDA_CODEC_VT1709_5 HDA_CODEC_CONSTRUCT(VIA, 0xe715)
#define HDA_CODEC_VT1709_6 HDA_CODEC_CONSTRUCT(VIA, 0xe716)
#define HDA_CODEC_VT1709_7 HDA_CODEC_CONSTRUCT(VIA, 0xe717)
+#define HDA_CODEC_VT1708B_0 HDA_CODEC_CONSTRUCT(VIA, 0xe720)
+#define HDA_CODEC_VT1708B_1 HDA_CODEC_CONSTRUCT(VIA, 0xe721)
+#define HDA_CODEC_VT1708B_2 HDA_CODEC_CONSTRUCT(VIA, 0xe722)
+#define HDA_CODEC_VT1708B_3 HDA_CODEC_CONSTRUCT(VIA, 0xe723)
+#define HDA_CODEC_VT1708B_4 HDA_CODEC_CONSTRUCT(VIA, 0xe724)
+#define HDA_CODEC_VT1708B_5 HDA_CODEC_CONSTRUCT(VIA, 0xe725)
+#define HDA_CODEC_VT1708B_6 HDA_CODEC_CONSTRUCT(VIA, 0xe726)
+#define HDA_CODEC_VT1708B_7 HDA_CODEC_CONSTRUCT(VIA, 0xe727)
#define HDA_CODEC_VTXXXX HDA_CODEC_CONSTRUCT(VIA, 0xffff)
+/* ATI */
+#define HDA_CODEC_ATIRS600_1 HDA_CODEC_CONSTRUCT(ATI, 0x793c)
+#define HDA_CODEC_ATIRS600_2 HDA_CODEC_CONSTRUCT(ATI, 0x7919)
+#define HDA_CODEC_ATIRS690 HDA_CODEC_CONSTRUCT(ATI, 0x791a)
+#define HDA_CODEC_ATIR6XX HDA_CODEC_CONSTRUCT(ATI, 0xaa01)
+#define HDA_CODEC_ATIXXXX HDA_CODEC_CONSTRUCT(ATI, 0xffff)
+
+/* NVIDIA */
+#define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff)
+
+/* INTEL */
+#define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff)
/* Codecs */
static const struct {
@@ -602,8 +728,13 @@ static const struct {
} hdac_codecs[] = {
{ HDA_CODEC_ALC260, "Realtek ALC260" },
{ HDA_CODEC_ALC262, "Realtek ALC262" },
+ { HDA_CODEC_ALC267, "Realtek ALC267" },
{ HDA_CODEC_ALC268, "Realtek ALC268" },
+ { HDA_CODEC_ALC269, "Realtek ALC269" },
+ { HDA_CODEC_ALC272, "Realtek ALC272" },
{ HDA_CODEC_ALC660, "Realtek ALC660" },
+ { HDA_CODEC_ALC662, "Realtek ALC662" },
+ { HDA_CODEC_ALC663, "Realtek ALC663" },
{ HDA_CODEC_ALC861, "Realtek ALC861" },
{ HDA_CODEC_ALC861VD, "Realtek ALC861-VD" },
{ HDA_CODEC_ALC880, "Realtek ALC880" },
@@ -611,23 +742,77 @@ static const struct {
{ HDA_CODEC_ALC883, "Realtek ALC883" },
{ HDA_CODEC_ALC885, "Realtek ALC885" },
{ HDA_CODEC_ALC888, "Realtek ALC888" },
+ { HDA_CODEC_ALC889, "Realtek ALC889" },
+ { HDA_CODEC_AD1882, "Analog Devices AD1882" },
+ { HDA_CODEC_AD1882A, "Analog Devices AD1882A" },
+ { HDA_CODEC_AD1883, "Analog Devices AD1883" },
+ { HDA_CODEC_AD1884, "Analog Devices AD1884" },
+ { HDA_CODEC_AD1884A, "Analog Devices AD1884A" },
{ HDA_CODEC_AD1981HD, "Analog Devices AD1981HD" },
{ HDA_CODEC_AD1983, "Analog Devices AD1983" },
{ HDA_CODEC_AD1984, "Analog Devices AD1984" },
+ { HDA_CODEC_AD1984A, "Analog Devices AD1984A" },
+ { HDA_CODEC_AD1984B, "Analog Devices AD1984B" },
{ HDA_CODEC_AD1986A, "Analog Devices AD1986A" },
- { HDA_CODEC_AD1988, "Analog Devices AD1988" },
+ { HDA_CODEC_AD1987, "Analog Devices AD1987" },
+ { HDA_CODEC_AD1988, "Analog Devices AD1988A" },
{ HDA_CODEC_AD1988B, "Analog Devices AD1988B" },
+ { HDA_CODEC_AD1989B, "Analog Devices AD1989B" },
{ HDA_CODEC_CMI9880, "CMedia CMI9880" },
+ { HDA_CODEC_STAC9200D, "Sigmatel STAC9200D" },
+ { HDA_CODEC_STAC9204X, "Sigmatel STAC9204X" },
+ { HDA_CODEC_STAC9204D, "Sigmatel STAC9204D" },
+ { HDA_CODEC_STAC9205X, "Sigmatel STAC9205X" },
+ { HDA_CODEC_STAC9205D, "Sigmatel STAC9205D" },
+ { HDA_CODEC_STAC9220, "Sigmatel STAC9220" },
+ { HDA_CODEC_STAC9220_A1, "Sigmatel STAC9220_A1" },
+ { HDA_CODEC_STAC9220_A2, "Sigmatel STAC9220_A2" },
{ HDA_CODEC_STAC9221, "Sigmatel STAC9221" },
+ { HDA_CODEC_STAC9221_A2, "Sigmatel STAC9221_A2" },
{ HDA_CODEC_STAC9221D, "Sigmatel STAC9221D" },
- { HDA_CODEC_STAC9220, "Sigmatel STAC9220" },
{ HDA_CODEC_STAC922XD, "Sigmatel STAC9220D/9223D" },
- { HDA_CODEC_STAC9227, "Sigmatel STAC9227" },
+ { HDA_CODEC_STAC9227X, "Sigmatel STAC9227X" },
+ { HDA_CODEC_STAC9227D, "Sigmatel STAC9227D" },
+ { HDA_CODEC_STAC9228X, "Sigmatel STAC9228X" },
+ { HDA_CODEC_STAC9228D, "Sigmatel STAC9228D" },
+ { HDA_CODEC_STAC9229X, "Sigmatel STAC9229X" },
+ { HDA_CODEC_STAC9229D, "Sigmatel STAC9229D" },
+ { HDA_CODEC_STAC9230X, "Sigmatel STAC9230X" },
+ { HDA_CODEC_STAC9230D, "Sigmatel STAC9230D" },
+ { HDA_CODEC_STAC9250, "Sigmatel STAC9250" },
+ { HDA_CODEC_STAC9251, "Sigmatel STAC9251" },
+ { HDA_CODEC_STAC9271X, "Sigmatel STAC9271X" },
{ HDA_CODEC_STAC9271D, "Sigmatel STAC9271D" },
- { HDA_CODEC_STAC9205, "Sigmatel STAC9205" },
- { HDA_CODEC_STAC9872AK,"Sigmatel STAC9872AK" },
- { HDA_CODEC_CXVENICE, "Conexant Venice" },
- { HDA_CODEC_CXWAIKIKI, "Conexant Waikiki" },
+ { HDA_CODEC_STAC9272X, "Sigmatel STAC9272X" },
+ { HDA_CODEC_STAC9272D, "Sigmatel STAC9272D" },
+ { HDA_CODEC_STAC9273X, "Sigmatel STAC9273X" },
+ { HDA_CODEC_STAC9273D, "Sigmatel STAC9273D" },
+ { HDA_CODEC_STAC9274, "Sigmatel STAC9274" },
+ { HDA_CODEC_STAC9274D, "Sigmatel STAC9274D" },
+ { HDA_CODEC_STAC9274X5NH, "Sigmatel STAC9274X5NH" },
+ { HDA_CODEC_STAC9274D5NH, "Sigmatel STAC9274D5NH" },
+ { HDA_CODEC_STAC9872AK, "Sigmatel STAC9872AK" },
+ { HDA_CODEC_IDT92HD005, "IDT 92HD005" },
+ { HDA_CODEC_IDT92HD005D, "IDT 92HD005D" },
+ { HDA_CODEC_IDT92HD206X, "IDT 92HD206X" },
+ { HDA_CODEC_IDT92HD206D, "IDT 92HD206D" },
+ { HDA_CODEC_IDT92HD700X, "IDT 92HD700X" },
+ { HDA_CODEC_IDT92HD700D, "IDT 92HD700D" },
+ { HDA_CODEC_IDT92HD71B5, "IDT 92HD71B5" },
+ { HDA_CODEC_IDT92HD71B7, "IDT 92HD71B7" },
+ { HDA_CODEC_IDT92HD71B8, "IDT 92HD71B8" },
+ { HDA_CODEC_IDT92HD73C1, "IDT 92HD73C1" },
+ { HDA_CODEC_IDT92HD73D1, "IDT 92HD73D1" },
+ { HDA_CODEC_IDT92HD73E1, "IDT 92HD73E1" },
+ { HDA_CODEC_IDT92HD75B3, "IDT 92HD75B3" },
+ { HDA_CODEC_IDT92HD75BX, "IDT 92HD75BX" },
+ { HDA_CODEC_IDT92HD81B1C, "IDT 92HD81B1C" },
+ { HDA_CODEC_IDT92HD81B1X, "IDT 92HD81B1X" },
+ { HDA_CODEC_IDT92HD83C1C, "IDT 92HD83C1C" },
+ { HDA_CODEC_IDT92HD83C1X, "IDT 92HD83C1X" },
+ { HDA_CODEC_CX20549, "Conexant CX20549 (Venice)" },
+ { HDA_CODEC_CX20551, "Conexant CX20551 (Waikiki)" },
+ { HDA_CODEC_CX20561, "Conexant CX20561 (Hermosa)" },
{ HDA_CODEC_VT1708_8, "VIA VT1708_8" },
{ HDA_CODEC_VT1708_9, "VIA VT1708_9" },
{ HDA_CODEC_VT1708_A, "VIA VT1708_A" },
@@ -640,136 +825,41 @@ static const struct {
{ HDA_CODEC_VT1709_5, "VIA VT1709_5" },
{ HDA_CODEC_VT1709_6, "VIA VT1709_6" },
{ HDA_CODEC_VT1709_7, "VIA VT1709_7" },
+ { HDA_CODEC_VT1708B_0, "VIA VT1708B_0" },
+ { HDA_CODEC_VT1708B_1, "VIA VT1708B_1" },
+ { HDA_CODEC_VT1708B_2, "VIA VT1708B_2" },
+ { HDA_CODEC_VT1708B_3, "VIA VT1708B_3" },
+ { HDA_CODEC_VT1708B_4, "VIA VT1708B_4" },
+ { HDA_CODEC_VT1708B_5, "VIA VT1708B_5" },
+ { HDA_CODEC_VT1708B_6, "VIA VT1708B_6" },
+ { HDA_CODEC_VT1708B_7, "VIA VT1708B_7" },
+ { HDA_CODEC_ATIRS600_1,"ATI RS600 HDMI" },
+ { HDA_CODEC_ATIRS600_2,"ATI RS600 HDMI" },
+ { HDA_CODEC_ATIRS690, "ATI RS690/780 HDMI" },
+ { HDA_CODEC_ATIR6XX, "ATI R6xx HDMI" },
+ { HDA_CODEC_SII1392, "Silicon Image SiI1392 HDMI" },
/* Unknown codec */
{ HDA_CODEC_ALCXXXX, "Realtek (Unknown)" },
{ HDA_CODEC_ADXXXX, "Analog Devices (Unknown)" },
{ HDA_CODEC_CMIXXXX, "CMedia (Unknown)" },
{ HDA_CODEC_STACXXXX, "Sigmatel (Unknown)" },
+ { HDA_CODEC_SIIXXXX, "Silicon Image (Unknown)" },
+ { HDA_CODEC_AGEREXXXX, "Lucent/Agere Systems (Unknown)" },
{ HDA_CODEC_CXXXXX, "Conexant (Unknown)" },
{ HDA_CODEC_VTXXXX, "VIA (Unknown)" },
+ { HDA_CODEC_ATIXXXX, "ATI (Unknown)" },
+ { HDA_CODEC_NVIDIAXXXX,"NVidia (Unknown)" },
+ { HDA_CODEC_INTELXXXX, "Intel (Unknown)" },
+ { HDA_CODEC_IDTXXXX, "IDT (Unknown)" },
};
#define HDAC_CODECS_LEN (sizeof(hdac_codecs) / sizeof(hdac_codecs[0]))
-enum {
- HDAC_HP_SWITCH_CTL,
- HDAC_HP_SWITCH_CTRL,
- HDAC_HP_SWITCH_DEBUG
-};
-
-static const struct {
- uint32_t model;
- uint32_t id;
- int type;
- int inverted;
- int polling;
- int execsense;
- nid_t hpnid;
- nid_t spkrnid[8];
- nid_t eapdnid;
-} hdac_hp_switch[] = {
- /* Specific OEM models */
- { HP_V3000_SUBVENDOR, HDA_CODEC_CXVENICE, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 17, { 16, -1 }, 16 },
- /* { HP_XW4300_SUBVENDOR, HDA_CODEC_ALC260, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 21, { 16, 17, -1 }, -1 } */
- /* { HP_3010_SUBVENDOR, HDA_CODEC_ALC260, HDAC_HP_SWITCH_DEBUG,
- 0, 1, 0, 16, { 15, 18, 19, 20, 21, -1 }, -1 }, */
- { HP_NX7400_SUBVENDOR, HDA_CODEC_AD1981HD, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 6, { 5, -1 }, 5 },
- { HP_NX6310_SUBVENDOR, HDA_CODEC_AD1981HD, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 6, { 5, -1 }, 5 },
- { HP_NX6325_SUBVENDOR, HDA_CODEC_AD1981HD, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 6, { 5, -1 }, 5 },
- /* { HP_DC7700_SUBVENDOR, HDA_CODEC_ALC262, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 21, { 22, 27, -1 }, -1 }, */
- { TOSHIBA_U200_SUBVENDOR, HDA_CODEC_AD1981HD, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 6, { 5, -1 }, -1 },
- { TOSHIBA_A135_SUBVENDOR, HDA_CODEC_ALC861VD, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 27, { 20, -1 }, -1 },
- { DELL_D820_SUBVENDOR, HDA_CODEC_STAC9220, HDAC_HP_SWITCH_CTRL,
- 0, 0, -1, 13, { 14, -1 }, -1 },
- { DELL_I1300_SUBVENDOR, HDA_CODEC_STAC9220, HDAC_HP_SWITCH_CTRL,
- 0, 0, -1, 13, { 14, -1 }, -1 },
- { DELL_OPLX745_SUBVENDOR, HDA_CODEC_AD1983, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 6, { 5, 7, -1 }, -1 },
- { DELL_D630_SUBVENDOR, HDA_CODEC_STAC9205, HDAC_HP_SWITCH_CTRL,
- 0, 0, -1, 10, { 13, -1 }, -1 },
- { DELL_V1500_SUBVENDOR, HDA_CODEC_STAC9205, HDAC_HP_SWITCH_CTRL,
- 0, 0, -1, 10, { 13, -1 }, -1 },
- { APPLE_MB3_SUBVENDOR, HDA_CODEC_ALC885, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 21, { 20, 22, -1 }, -1 },
- { APPLE_INTEL_MAC, HDA_CODEC_STAC9221, HDAC_HP_SWITCH_CTRL,
- 0, 0, -1, 10, { 13, -1 }, -1 },
- { LENOVO_3KN100_SUBVENDOR, HDA_CODEC_AD1986A, HDAC_HP_SWITCH_CTL,
- 1, 0, -1, 26, { 27, -1 }, -1 },
- { LENOVO_3KN200_SUBVENDOR, HDA_CODEC_ALC861VD, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 27, { 20, -1 }, -1 },
- /* { LENOVO_TCA55_SUBVENDOR, HDA_CODEC_AD1986A, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 26, { 27, 28, 29, 30, -1 }, -1 }, */
- { LG_LW20_SUBVENDOR, HDA_CODEC_ALC880, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 27, { 20, -1 }, -1 },
- { ACER_A5050_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 20, { 21, -1 }, -1 },
- { ACER_3681WXM_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 20, { 21, -1 }, -1 },
- { ACER_A4520_SUBVENDOR, HDA_CODEC_ALC268, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 20, { 21, -1 }, -1 },
- { ACER_A4710_SUBVENDOR, HDA_CODEC_ALC268, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 20, { 21, -1 }, -1 },
- { ACER_A4715_SUBVENDOR, HDA_CODEC_ALC268, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 20, { 21, -1 }, -1 },
- { UNIWILL_9080_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 20, { 21, -1 }, -1 },
- { MSI_MS1034_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 20, { 27, -1 }, -1 },
- { MSI_MS034A_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 20, { 27, -1 }, -1 },
- { FS_SI1848_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 20, { 21, -1 }, -1 },
- { FL_S7020D_SUBVENDOR, HDA_CODEC_ALC260, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 20, { 16, -1 }, -1 },
- { FL_U1010_SUBVENDOR, HDA_CODEC_ALC262, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 20, { 21, -1 }, -1 },
- /*
- * All models that at least come from the same vendor with
- * simmilar codec.
- */
- { HP_ALL_SUBVENDOR, HDA_CODEC_CXVENICE, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 17, { 16, -1 }, 16 },
- { HP_ALL_SUBVENDOR, HDA_CODEC_AD1981HD, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 6, { 5, -1 }, 5 },
- { TOSHIBA_ALL_SUBVENDOR, HDA_CODEC_AD1981HD, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 6, { 5, -1 }, -1 },
- { DELL_ALL_SUBVENDOR, HDA_CODEC_STAC9220, HDAC_HP_SWITCH_CTRL,
- 0, 0, -1, 13, { 14, -1 }, -1 },
-#if 0
- { LENOVO_ALL_SUBVENDOR, HDA_CODEC_AD1986A, HDAC_HP_SWITCH_CTL,
- 1, 0, -1, 26, { 27, -1 }, -1 },
- { ACER_ALL_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
- 0, 0, -1, 20, { 21, -1 }, -1 },
-#endif
-};
-#define HDAC_HP_SWITCH_LEN \
- (sizeof(hdac_hp_switch) / sizeof(hdac_hp_switch[0]))
-
-static const struct {
- uint32_t model;
- uint32_t id;
- nid_t eapdnid;
- int hp_switch;
-} hdac_eapd_switch[] = {
- { HP_V3000_SUBVENDOR, HDA_CODEC_CXVENICE, 16, 1 },
- { HP_NX7400_SUBVENDOR, HDA_CODEC_AD1981HD, 5, 1 },
- { HP_NX6310_SUBVENDOR, HDA_CODEC_AD1981HD, 5, 1 },
-};
-#define HDAC_EAPD_SWITCH_LEN \
- (sizeof(hdac_eapd_switch) / sizeof(hdac_eapd_switch[0]))
/****************************************************************************
* Function prototypes
****************************************************************************/
static void hdac_intr_handler(void *);
-static int hdac_reset(struct hdac_softc *);
+static int hdac_reset(struct hdac_softc *, int);
static int hdac_get_capabilities(struct hdac_softc *);
static void hdac_dma_cb(void *, bus_dma_segment_t *, int, int);
static int hdac_dma_alloc(struct hdac_softc *,
@@ -783,10 +873,10 @@ static void hdac_corb_init(struct hdac_s
static void hdac_rirb_init(struct hdac_softc *);
static void hdac_corb_start(struct hdac_softc *);
static void hdac_rirb_start(struct hdac_softc *);
-static void hdac_scan_codecs(struct hdac_softc *, int);
-static int hdac_probe_codec(struct hdac_codec *);
-static struct hdac_devinfo *hdac_probe_function(struct hdac_codec *, nid_t);
-static void hdac_add_child(struct hdac_softc *, struct hdac_devinfo *);
+static void hdac_scan_codecs(struct hdac_softc *);
+static void hdac_probe_codec(struct hdac_codec *);
+static void hdac_probe_function(struct hdac_codec *, nid_t);
+static int hdac_pcmchannel_setup(struct hdac_chan *);
static void hdac_attach2(void *);
@@ -798,34 +888,37 @@ static void hdac_command_send_internal(s
static int hdac_probe(device_t);
static int hdac_attach(device_t);
static int hdac_detach(device_t);
+static int hdac_suspend(device_t);
+static int hdac_resume(device_t);
static void hdac_widget_connection_select(struct hdac_widget *, uint8_t);
static void hdac_audio_ctl_amp_set(struct hdac_audio_ctl *,
uint32_t, int, int);
static struct hdac_audio_ctl *hdac_audio_ctl_amp_get(struct hdac_devinfo *,
- nid_t, int, int);
+ nid_t, int, int, int);
static void hdac_audio_ctl_amp_set_internal(struct hdac_softc *,
nid_t, nid_t, int, int, int, int, int, int);
-static int hdac_audio_ctl_ossmixer_getnextdev(struct hdac_devinfo *);
static struct hdac_widget *hdac_widget_get(struct hdac_devinfo *, nid_t);
static int hdac_rirb_flush(struct hdac_softc *sc);
static int hdac_unsolq_flush(struct hdac_softc *sc);
+static void hdac_dump_pin_config(struct hdac_widget *w, uint32_t conf);
+
#define hdac_command(a1, a2, a3) \
hdac_command_sendone_internal(a1, a2, a3)
-#define hdac_codec_id(d) \
- ((uint32_t)((d == NULL) ? 0x00000000 : \
- ((((uint32_t)(d)->vendor_id & 0x0000ffff) << 16) | \
- ((uint32_t)(d)->device_id & 0x0000ffff))))
+#define hdac_codec_id(c) \
+ ((uint32_t)((c == NULL) ? 0x00000000 : \
+ ((((uint32_t)(c)->vendor_id & 0x0000ffff) << 16) | \
+ ((uint32_t)(c)->device_id & 0x0000ffff))))
static char *
-hdac_codec_name(struct hdac_devinfo *devinfo)
+hdac_codec_name(struct hdac_codec *codec)
{
uint32_t id;
int i;
- id = hdac_codec_id(devinfo);
+ id = hdac_codec_id(codec);
for (i = 0; i < HDAC_CODECS_LEN; i++) {
if (HDA_DEV_MATCH(hdac_codecs[i].id, id))
@@ -836,20 +929,6 @@ hdac_codec_name(struct hdac_devinfo *dev
}
static char *
-hdac_audio_ctl_ossmixer_mask2name(uint32_t devmask)
-{
- static char *ossname[] = SOUND_DEVICE_NAMES;
- static char *unknown = "???";
- int i;
-
- for (i = SOUND_MIXER_NRDEVICES - 1; i >= 0; i--) {
- if (devmask & (1 << i))
- return (ossname[i]);
- }
- return (unknown);
-}
-
-static void
hdac_audio_ctl_ossmixer_mask2allname(uint32_t mask, char *buf, size_t len)
{
static char *ossname[] = SOUND_DEVICE_NAMES;
@@ -864,6 +943,7 @@ hdac_audio_ctl_ossmixer_mask2allname(uin
first = 0;
}
}
+ return (buf);
}
static struct hdac_audio_ctl *
@@ -879,48 +959,46 @@ hdac_audio_ctl_each(struct hdac_devinfo
}
static struct hdac_audio_ctl *
-hdac_audio_ctl_amp_get(struct hdac_devinfo *devinfo, nid_t nid,
+hdac_audio_ctl_amp_get(struct hdac_devinfo *devinfo, nid_t nid, int dir,
int index, int cnt)
{
- struct hdac_audio_ctl *ctl, *retctl = NULL;
- int i, at, atindex, found = 0;
+ struct hdac_audio_ctl *ctl;
+ int i, found = 0;
if (devinfo == NULL || devinfo->function.audio.ctl == NULL)
return (NULL);
- at = cnt;
- if (at == 0)
- at = 1;
- else if (at < 0)
- at = -1;
- atindex = index;
- if (atindex < 0)
- atindex = -1;
-
i = 0;
while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) {
- if (ctl->enable == 0 || ctl->widget == NULL)
+ if (ctl->enable == 0)
continue;
- if (!(ctl->widget->nid == nid && (atindex == -1 ||
- ctl->index == atindex)))
+ if (ctl->widget->nid != nid)
+ continue;
+ if (dir && ctl->ndir != dir)
+ continue;
+ if (index >= 0 && ctl->ndir == HDA_CTL_IN &&
+ ctl->dir == ctl->ndir && ctl->index != index)
continue;
found++;
- if (found == cnt)
+ if (found == cnt || cnt <= 0)
return (ctl);
- retctl = ctl;
}
- return ((at == -1) ? retctl : NULL);
+ return (NULL);
}
+/*
+ * Jack detection (Speaker/HP redirection) event handler.
+ */
static void
hdac_hp_switch_handler(struct hdac_devinfo *devinfo)
{
+ struct hdac_audio_as *as;
struct hdac_softc *sc;
struct hdac_widget *w;
struct hdac_audio_ctl *ctl;
- uint32_t val, id, res;
- int i = 0, j, timeout, forcemute;
+ uint32_t val, res;
+ int i, j;
nid_t cad;
if (devinfo == NULL || devinfo->codec == NULL ||
@@ -929,84 +1007,47 @@ hdac_hp_switch_handler(struct hdac_devin
sc = devinfo->codec->sc;
cad = devinfo->codec->cad;
- id = hdac_codec_id(devinfo);
- for (i = 0; i < HDAC_HP_SWITCH_LEN; i++) {
- if (HDA_DEV_MATCH(hdac_hp_switch[i].model,
- sc->pci_subvendor) &&
- hdac_hp_switch[i].id == id)
- break;
- }
-
- if (i >= HDAC_HP_SWITCH_LEN)
- return;
-
- forcemute = 0;
- if (hdac_hp_switch[i].eapdnid != -1) {
- w = hdac_widget_get(devinfo, hdac_hp_switch[i].eapdnid);
- if (w != NULL && w->param.eapdbtl != HDAC_INVALID)
- forcemute = (w->param.eapdbtl &
- HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD) ? 0 : 1;
- }
-
- if (hdac_hp_switch[i].execsense != -1)
- hdac_command(sc,
- HDA_CMD_SET_PIN_SENSE(cad, hdac_hp_switch[i].hpnid,
- hdac_hp_switch[i].execsense), cad);
+ as = devinfo->function.audio.as;
+ for (i = 0; i < devinfo->function.audio.ascnt; i++) {
+ if (as[i].hpredir < 0)
+ continue;
+
+ w = hdac_widget_get(devinfo, as[i].pins[15]);
+ if (w == NULL || w->enable == 0 || w->type !=
+ HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX)
+ continue;
- timeout = 10000;
- do {
res = hdac_command(sc,
- HDA_CMD_GET_PIN_SENSE(cad, hdac_hp_switch[i].hpnid),
- cad);
- if (hdac_hp_switch[i].execsense == -1 || res != 0x7fffffff)
- break;
- DELAY(10);
- } while (--timeout != 0);
+ HDA_CMD_GET_PIN_SENSE(cad, as[i].pins[15]), cad);
- HDA_BOOTVERBOSE(
- device_printf(sc->dev,
- "HDA_DEBUG: Pin sense: nid=%d timeout=%d res=0x%08x\n",
- hdac_hp_switch[i].hpnid, timeout, res);
- );
+ HDA_BOOTVERBOSE(
+ device_printf(sc->dev,
+ "Pin sense: nid=%d res=0x%08x\n",
+ as[i].pins[15], res);
+ );
- res = HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT(res);
- res ^= hdac_hp_switch[i].inverted;
+ res = HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT(res);
+ if (devinfo->function.audio.quirks & HDA_QUIRK_SENSEINV)
+ res ^= 1;
- switch (hdac_hp_switch[i].type) {
- case HDAC_HP_SWITCH_CTL:
+ /* (Un)Mute headphone pin. */
ctl = hdac_audio_ctl_amp_get(devinfo,
- hdac_hp_switch[i].hpnid, 0, 1);
- if (ctl != NULL) {
- val = (res != 0 && forcemute == 0) ?
- HDA_AMP_MUTE_NONE : HDA_AMP_MUTE_ALL;
- if (val != ctl->muted) {
- ctl->muted = val;
+ as[i].pins[15], HDA_CTL_IN, -1, 1);
+ if (ctl != NULL && ctl->mute) {
+ /* If pin has muter - use it. */
+ val = (res != 0) ? 0 : 1;
+ if (val != ctl->forcemute) {
+ ctl->forcemute = val;
hdac_audio_ctl_amp_set(ctl,
- HDA_AMP_MUTE_DEFAULT, ctl->left,
- ctl->right);
+ HDA_AMP_MUTE_DEFAULT,
+ HDA_AMP_VOL_DEFAULT, HDA_AMP_VOL_DEFAULT);
}
- }
- for (j = 0; hdac_hp_switch[i].spkrnid[j] != -1; j++) {
- ctl = hdac_audio_ctl_amp_get(devinfo,
- hdac_hp_switch[i].spkrnid[j], 0, 1);
- if (ctl == NULL)
- continue;
- val = (res != 0 || forcemute == 1) ?
- HDA_AMP_MUTE_ALL : HDA_AMP_MUTE_NONE;
- if (val == ctl->muted)
- continue;
- ctl->muted = val;
- hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_DEFAULT,
- ctl->left, ctl->right);
- }
- break;
- case HDAC_HP_SWITCH_CTRL:
- if (res != 0) {
- /* HP in */
- w = hdac_widget_get(devinfo, hdac_hp_switch[i].hpnid);
+ } else {
+ /* If there is no muter - disable pin output. */
+ w = hdac_widget_get(devinfo, as[i].pins[15]);
if (w != NULL && w->type ==
HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) {
- if (forcemute == 0)
+ if (res != 0)
val = w->wclass.pin.ctrl |
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From bz at FreeBSD.org Wed Jan 7 15:31:48 2009
From: bz at FreeBSD.org (Bjoern A. Zeeb)
Date: Wed Jan 7 15:32:00 2009
Subject: svn commit: r186863 - in stable/7: etc etc/defaults etc/rc.d
share/man/man5
Message-ID: <200901071531.n07FVlNx090816@svn.freebsd.org>
Author: bz
Date: Wed Jan 7 15:31:46 2009
New Revision: 186863
URL: http://svn.freebsd.org/changeset/base/186863
Log:
MFC: r183100
Allow a jail to be started with a specific route fib.
Modified:
stable/7/etc/ (props changed)
stable/7/etc/defaults/rc.conf
stable/7/etc/rc.d/jail
stable/7/share/man/man5/ (props changed)
stable/7/share/man/man5/rc.conf.5
Modified: stable/7/etc/defaults/rc.conf
==============================================================================
--- stable/7/etc/defaults/rc.conf Wed Jan 7 15:28:47 2009 (r186862)
+++ stable/7/etc/defaults/rc.conf Wed Jan 7 15:31:46 2009 (r186863)
@@ -622,6 +622,7 @@ jail_sysvipc_allow="NO" # Allow SystemV
#jail_example_hostname="default.domain.com" # Jail's hostname
#jail_example_ip="192.168.0.10" # Jail's IP number
#jail_example_interface="" # Interface to create the IP alias on
+#jail_example_fib="0" # routing table for setfib(1)
#jail_example_exec_start="/bin/sh /etc/rc" # command to execute in jail for starting
#jail_example_exec_afterstart0="/bin/sh command" # command to execute after the one for
# starting the jail. More than one can be
Modified: stable/7/etc/rc.d/jail
==============================================================================
--- stable/7/etc/rc.d/jail Wed Jan 7 15:28:47 2009 (r186862)
+++ stable/7/etc/rc.d/jail Wed Jan 7 15:31:46 2009 (r186863)
@@ -83,6 +83,7 @@ init_variables()
[ -z "${_flags}" ] && _flags="-l -U root"
eval _consolelog=\"\${jail_${_j}_consolelog:-${jail_consolelog}}\"
[ -z "${_consolelog}" ] && _consolelog="/var/log/jail_${_j}_console.log"
+ eval _fib=\"\${jail_${_j}_fib:-${jail_fib}}\"
# Debugging aid
#
@@ -93,6 +94,7 @@ init_variables()
debug "$_j hostname: $_hostname"
debug "$_j ip: $_ip"
debug "$_j interface: $_interface"
+ debug "$_j fib: $_fib"
debug "$_j root: $_rootdir"
debug "$_j devdir: $_devdir"
debug "$_j fdescdir: $_fdescdir"
@@ -297,6 +299,11 @@ jail_start()
if [ -n "${_interface}" ]; then
ifconfig ${_interface} alias ${_ip} netmask 255.255.255.255
fi
+ if [ -n "${_fib}" ]; then
+ _setfib="setfib -F '${_fib}'"
+ else
+ _setfib=""
+ fi
if checkyesno _mount; then
info "Mounting fstab for jail ${_jail} (${_fstab})"
if [ ! -f "${_fstab}" ]; then
@@ -350,7 +357,7 @@ jail_start()
fi
fi
_tmp_jail=${_tmp_dir}/jail.$$
- eval jail ${_flags} -i ${_rootdir} ${_hostname} \
+ eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \
${_ip} ${_exec_start} > ${_tmp_jail} 2>&1
if [ "$?" -eq 0 ] ; then
Modified: stable/7/share/man/man5/rc.conf.5
==============================================================================
--- stable/7/share/man/man5/rc.conf.5 Wed Jan 7 15:28:47 2009 (r186862)
+++ stable/7/share/man/man5/rc.conf.5 Wed Jan 7 15:31:46 2009 (r186863)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 6, 2008
+.Dd September 16, 2008
.Dt RC.CONF 5
.Os
.Sh NAME
@@ -3412,6 +3412,11 @@ These are flags to pass to
Unset by default.
When set, sets the interface to use when setting IP address alias.
Note that the alias is created at jail startup and removed at jail shutdown.
+.It Va jail_ Ns Ao Ar jname Ac Ns Va _fib
+.Pq Vt str
+Unset by default.
+When set, the jail is started with the specified routing table via
+.Xr setfib 1 .
.It Va jail_ Ns Ao Ar jname Ac Ns Va _fstab
.Pq Vt str
Set to
From mav at FreeBSD.org Wed Jan 7 16:15:18 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Wed Jan 7 16:15:36 2009
Subject: svn commit: r186866 - stable/7/share/man/man4
Message-ID: <200901071615.n07GFHxE091777@svn.freebsd.org>
Author: mav
Date: Wed Jan 7 16:15:17 2009
New Revision: 186866
URL: http://svn.freebsd.org/changeset/base/186866
Log:
Sync snd_hda and snd_ich man pages with CURRENT.
Modified:
stable/7/share/man/man4/snd_hda.4
stable/7/share/man/man4/snd_ich.4
Modified: stable/7/share/man/man4/snd_hda.4
==============================================================================
--- stable/7/share/man/man4/snd_hda.4 Wed Jan 7 16:06:09 2009 (r186865)
+++ stable/7/share/man/man4/snd_hda.4 Wed Jan 7 16:15:17 2009 (r186866)
@@ -1,4 +1,5 @@
-.\" Copyright (c) 2006 Joel Dahl
+.\" Copyright (c) 2006-2008 Joel Dahl
+.\" Copyright (c) 2008 Alexander Motin
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 14, 2007
+.Dd January 7, 2009
.Dt SND_HDA 4
.Os
.Sh NAME
@@ -45,40 +46,52 @@ following line in
snd_hda_load="YES"
.Ed
.Sh DESCRIPTION
+The High Definition (HD) Audio specification was developed by Intel as the
+logical successor of the old AC'97 specification and has several advantages,
+such as higher bandwidth which allows more channels and more detailed formats,
+support for several logical audio devices, and general purpose DMA channels.
+.Pp
The
.Nm
-bridge device driver allows the generic audio driver,
+driver is a HDA bus controller driver and HDA codecs audio functions bridge
+driver that allows the generic audio driver,
.Xr sound 4 ,
-to attach to Intel High Definition Audio devices.
+to be used with this hardware.
+Only audio functions are supported by
+.Nm .
+Modem, HDMI and other possible functions are not implemented.
+.Pp
The
.Nm
driver supports hardware that conforms with revision 1.0 of the Intel High
Definition Audio specification and tries to behave much like the Microsoft
Universal Audio Architecture (UAA) draft (revision 0.7b) for handling audio
devices.
-HDA acts like a primary bus, similar to
-.Xr miibus 4 ,
-for handling various child buses such as audio, modem and HDMI (High Definition
-Multimedia Interface).
-Only audio is implemented in the
-.Nm
-driver.
.Pp
-The High Definition (HD) Audio specification was developed by Intel as the
-logical successor of the old AC'97 specification and has several advantages,
-such as higher bandwidth which allows more channels and more detailed formats,
-support for several logical audio devices, and general purpose DMA channels.
+According to HDA and UAA specifications, depending on the number of HDA buses
+and codecs present in system, their audio capabilities and BIOS provided
+configuration, the
+.Nm
+driver often provides several PCM audio devices.
+For example, one device for main rear 7.1 output and inputs, one device
+for independent headset connectors at front and one device for SPDIF or
+HDMI audio input/output.
+The assignment of audio inputs and outputs may be tuned with
+.Xr device.hints 5 .
+The driver's verbose boot messages provide a lot of information about
+the operation of the driver and present audio setup.
.Pp
-The HDA specification defines the register-level interface, physical link
-characteristics, codec programming models, and codec architectural components.
-This specification is intended for both device driver developers and hardware
-component designers.
+The default audio device may be tuned by setting the
+.Ar hw.snd.default_unit
+sysctl, as described in
+.Xr sound 4 ,
+or explicitly specified in application settings.
.Ss Boot-time Configuration
The following variables are available at boot-time through the
.Xr device.hints 5
file:
-.Bl -tag -width ".Va hint.pcm.%d.config" -offset indent
-.It Va hint.pcm.%d.config
+.Bl -tag -width ".Va hint.hdac.%d.config"-offset indent
+.It Va hint.hdac.%d.config
Configures a range of possible options.
Possible values are:
.Dq Li dmapos ,
@@ -102,6 +115,7 @@ Possible values are:
.Dq Li ovref50 ,
.Dq Li ovref80 ,
.Dq Li ovref100 ,
+.Dq Li senseinv ,
.Dq Li softpcmvol ,
and
.Dq Li vref .
@@ -111,6 +125,145 @@ such as
.Dq Li nofixedrate ,
will do the opposite and takes precedence.
Options can be separated by whitespace and commas.
+.Dq Li GPIO Ns s
+are a codec's General Purpose I/O pins which system integrators sometimes
+use to control external muters, amplifiers and so on.
+If you have no sound, or sound volume is not adequate, you may have to
+experiment a bit with the GPIO setup to find the optimal setup for your
+system.
+The
+.Dq Li ivref Ns Ar X
+and
+.Dq Li ovref Ns Ar X
+options control the voltage used to power external microphones.
+.It Va hint.hdac.%d.msi
+Controls MSI (Message Signaled Interrupts) support.
+.It Va hint.hdac.%d.cad%d.nid%d.config
+Overrides codec pin configuration set by BIOS.
+May be specified as a 32-bit hexadecimal value with a leading
+.Dq 0x ,
+or as a set of space-separated
+.Dq Ar option Ns = Ns Ar value
+pairs.
+.El
+.Pp
+Pin configuration is the UAA driver's main source of information about codec
+usage.
+This information is usually provided by the codec manufacturer and tuned
+by system integrators for specific system requirements.
+The
+.Nm
+driver allows users to override it to fix integrator mistakes or to use the
+available codec in alternative ways (for example to get stereo output and 2
+inputs instead of a single 5.1 output).
+.Pp
+The following options are supported:
+.Bl -tag -width ".Va device=" -offset indent
+.It Va as
+Association number.
+Associations are used to group individual pins to form a complex multi-pin
+device.
+For example, to group 4 connectors for 7.1 output, or to treat several
+input connectors as sources for the same input device.
+Association numbers can be specified as numeric values from 0 to 15.
+A value of 0 means disabled pin.
+A value of 15 is a set of independent unassociated pins.
+Each association includes only pins of the same direction (in/out) and is
+detected atomically (all pins or none).
+A separate PCM audio device is created for every pair of input and
+output associations.
+.It Va seq
+Sequence number.
+A unique, per-association number used to order pins inside the
+particular association.
+Sequence numbers can be specified as numeric values from 0 to 15.
+.Pp
+The sequence number 15 has a special meaning for output associations.
+Output pins with this number and device type
+.Dq Ar Headphones
+will duplicate (with automatic mute if jack detection is supported) the
+first pin in that association.
+.It Va device
+Device type.
+Can be specified as a number from 0 to 15 or as a name:
+.Dq Li Line-out ,
+.Dq Li Speaker ,
+.Dq Li Headphones,
+.Dq Li CD ,
+.Dq Li SPDIF-out ,
+.Dq Li Digital-out ,
+.Dq Li Modem-line ,
+.Dq Li Modem-handset ,
+.Dq Li Line-in ,
+.Dq Li AUX ,
+.Dq Li Mic ,
+.Dq Li Telephony ,
+.Dq Li SPDIF-in ,
+.Dq Li Digital-in ,
+.Dq Li Res.E ,
+or
+.Dq Li Other .
+The device type also describes the pin direction (in/out).
+For example,
+.Dq Li CD
+always means an input pin, while
+.Dq Li Headphones
+always means an output.
+.It Va conn
+Connection type.
+Can be specified as a number from 0 to 3.
+The connection type can also be specified as one of the special names
+.Dq Li Jack ,
+.Dq Li None ,
+.Dq Li Fixed ,
+or
+.Dq Li Both .
+Pins with a connection type of
+.Dq Li None
+are disabled.
+.It Va ctype
+Connector physical type.
+Can be specified as a number from 0 to 15.
+This is a reference only value.
+It is ignored by the
+.Nm
+driver.
+.It Va color
+Connector color.
+Can be specified as a number from 0 to 15 or as one of the names
+.Dq Li Unknown ,
+.Dq Li Black ,
+.Dq Li Grey ,
+.Dq Li Blue ,
+.Dq Li Green ,
+.Dq Li Red ,
+.Dq Li Orange ,
+.Dq Li Yellow ,
+.Dq Li Purple ,
+.Dq Li Pink ,
+.Dq Li Res.A ,
+.Dq Li Res.B ,
+.Dq Li Res.C ,
+.Dq Li Res.D ,
+.Dq Li White ,
+or
+.Dq Li Other .
+This is a reference only value.
+It is ignored by the
+.Nm
+driver.
+.It Va loc
+Connector physical location.
+Can be specified as a number from 0 to 63.
+This is a reference only value.
+It is ignored by the
+.Nm
+driver.
+.It Va misc
+Misc bits.
+Can be specified as a number from 0 to 15.
+Bit 0 has a special meaning. When set it means that jack detection is
+not implemented in hardware.
.El
.Ss Runtime Configuration
The following
@@ -118,19 +271,192 @@ The following
variables are available in addition to those available to all
.Xr sound 4
devices:
-.Bl -tag -width ".Va dev.pcm.%d.polling" -offset indent
-.It Va dev.pcm.%d.polling
-Experimental polling mode, where the driver operates by querying the device
-state on each tick using
-.Xr callout 9 .
+.Bl -tag -width ".Va dev.hdac.%d.polling" -offset indent
+.It Va dev.hdac.%d.polling
+Enables polling mode.
+In this mode the driver operates by querying the device state on timer
+ticks using
+.Xr callout 9
+instead of interrupts.
Polling is disabled by default.
Do not enable it unless you are facing weird interrupt problems or if the
device cannot generate interrupts at all.
+.It Va dev.hdac.%d.polling_interval
+Controller/Jack Sense polling interval (1-1000 ms)
+.It Va dev.hdac.%d.pindump
+Setting this to a non-zero value dumps the current pin configuration, main
+capabilities and jack sense status to console and syslog.
.El
+.Sh EXAMPLES
+Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example.
+This system has two audio connectors on a front side, three audio connectors
+on a rear side and one internal speaker.
+According to verbose driver output and the codec datasheet,
+this codec has five stereo DACs and two stereo ADCs, all of them are routable to
+any codec pin (external connector).
+All codec pins are reversible (could be configured either as input or output).
+.Pp
+So high codec uniformity and flexibility allow driver to configure it in many
+different ways, depending on requested pins usage decribed by pins configuration.
+Driver reports such default pin configuration when verbose messages enabled:
+.Bd -literal
+hdac0: nid 20 0x01014020 as 2 seq 0 Line-out Jack jack 1 loc 1 color Green misc 0
+hdac0: nid 21 0x99130110 as 1 seq 0 Speaker Fixed jack 3 loc 25 color Unknown misc 1
+hdac0: nid 22 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1
+hdac0: nid 23 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1
+hdac0: nid 24 0x01a19830 as 3 seq 0 Mic Jack jack 1 loc 1 color Pink misc 8
+hdac0: nid 25 0x02a1983f as 3 seq 15 Mic Jack jack 1 loc 2 color Pink misc 8
+hdac0: nid 26 0x01813031 as 3 seq 1 Line-in Jack jack 1 loc 1 color Blue misc 0
+hdac0: nid 27 0x0221401f as 1 seq 15 Headphones Jack jack 1 loc 2 color Green misc 0
+hdac0: nid 28 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1
+hdac0: nid 30 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1
+hdac0: nid 31 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1
+.Ed
+.Pp
+Here we can see, that the nodes with ID (nid) 25 and 27 are front pannel
+connectors (Jack, loc 2), nids 20, 24 and 26 are rear pannel connectors
+(Jack, loc 1) and nid 21 is a built-in speaker (Fixed, loc 25).
+Pins with nids 22, 23, 28, 30 and 31 will be disabled by driver due to "None"
+connectivity. So the pin count and description matches to connectors that
+we have.
+.Pp
+Using association (as) and sequence (seq) fields values pins are grouped into
+3 associations:
+.Bd -literal
+hdac0: Association 0 (1) out:
+hdac0: Pin nid=21 seq=0
+hdac0: Pin nid=27 seq=15
+hdac0: Association 1 (2) out:
+hdac0: Pin nid=20 seq=0
+hdac0: Association 2 (3) in:
+hdac0: Pin nid=24 seq=0
+hdac0: Pin nid=26 seq=1
+hdac0: Pin nid=25 seq=15
+.Ed
+.Pp
+Each
+.Xr pcm 4
+device uses two associations: one for playback and one for recording.
+Associations processed and assigned to
+.Xr pcm 4
+devices in increasing numerical order.
+In this case association #0 (1) will become
+.Li pcm0
+device playback, using the internal speakers and
+.Ar Headphones
+jack with speaker automute on the headphones jack connection.
+Association #1 (2) will become
+.Li pcm1
+playback, using the
+.Ar Line-out
+jack.
+Association #2 (3) will become
+.Li pcm0
+recording, using the external microphones and the
+.Ar Line-in
+jack.
+.Pp
+The
+.Nm
+driver provides extensive verbose messages to diagnose its operation
+logic and describe its current codec configuration.
+.Pp
+Using
+.Xr device.hints 5
+it is possible to modify the configuration of the existing pins,
+allowing a broad range of different audio setups.
+Here are a few examples of some setups possible for this particular
+hardware:
+.Ss Example 1
+Setting the
+.Xr device.hints 5
+options
+.Bd -literal
+hint.hdac.0.cad0.nid20.config="as=1"
+hint.hdac.0.cad0.nid21.config="as=2"
+.Ed
+.Pp
+will swap line-out and speaker functions.
+So the
+.Li pcm0
+device will play to the line-out and headphones jacks. Line-out will
+be muted on the headphones jack connection.
+Recording on
+.Li pcm0
+will go from two external microphones and line-in jacks.
+.Li pcm1
+playback will go to the internal speaker.
+.Pp
+.Ss Example 2
+Setting the
+.Xr device.hints 5
+options
+.Bd -literal
+hint.hdac.0.cad0.nid20.config="as=1 seq=15 device=Headphones"
+hint.hdac.0.cad0.nid27.config="as=2 seq=0"
+hint.hdac.0.cad0.nid25.config="as=4 seq=0"
+.Ed
+.Pp
+will split the headphones and one of the microphones to a separate device.
+The
+.Li pcm0
+device will play to the internal speaker and to the line-out jack, with
+speaker automute on the line-out jack connection.
+Recording on
+.Li pcm0
+will use input from one external microphone and the line-in jacks.
+The
+.Li pcm1
+device will be completely dedicated to a headset (headphones and mic)
+connected to the front connectors.
+.Pp
+.Ss Example 3
+Setting the
+.Xr device.hints 5
+options
+.Bd -literal
+hint.hdac.0.cad0.nid20.config="as=1 seq=0"
+hint.hdac.0.cad0.nid26.config="as=2 seq=0"
+hint.hdac.0.cad0.nid27.config="as=3 seq=0"
+hint.hdac.0.cad0.nid25.config="as=4 seq=0"
+hint.hdac.0.cad0.nid24.config="as=5 seq=0 device=Line-out"
+hint.hdac.0.cad0.nid21.config="as=6 seq=0"
+.Ed
+.Pp
+will give 4 independent devices:
+.Li pcm0
+.Pq line-out and line-in ,
+.Li pcm1
+.Pq headphones and mic ,
+.Li pcm2
+.Pq additional line-out via retasked rear mic jack ,
+and
+.Li pcm3
+.Pq internal speaker .
+.Pp
+.Ss Example 4
+Setting the
+.Xr device.hints 5
+options
+.Bd -literal
+hint.hdac.0.cad0.nid20.config="as=1 seq=0"
+hint.hdac.0.cad0.nid24.config="as=1 seq=1 device=Line-out"
+hint.hdac.0.cad0.nid26.config="as=1 seq=2 device=Line-out"
+hint.hdac.0.cad0.nid21.config="as=2 seq=0"
+.Ed
+.Pp
+will give 2 devices:
+.Li pcm0
+for 5.1 playback via 3 rear connectors (line-out and retasked
+mic and line-in) and headset (headphones and mic) at front connectors.
+.Li pcm1
+for internal speaker playback.
+On headphones connection rear connectors will be muted.
.Sh HARDWARE
The
.Nm
-driver supports the following audio chipsets:
+driver supports many Intel HDA compatible audio chipsets including the
+following:
.Pp
.Bl -bullet -compact
.It
@@ -140,13 +466,17 @@ ATI SB600
.It
Intel 631x/632xESB
.It
-Intel 82801F
+Intel 82801F (ICH6)
+.It
+Intel 82801G (ICH7)
.It
-Intel 82801G
+Intel 82801H (ICH8)
.It
-Intel 82801H
+Intel 82801I (ICH9)
.It
-Intel 82801I
+Intel 82801J (ICH10)
+.It
+Intel US15W (SCH)
.It
nVidia MCP51
.It
@@ -156,18 +486,26 @@ nVidia MCP61A
.It
nVidia MCP61B
.It
+nVidia MCP63
+.It
nVidia MCP65A
.It
nVidia MCP65B
.It
+nVidia MCP67A
+.It
+nVidia MCP67B
+.It
+nVidia MCP68
+.It
+nVidia MCP69
+.It
SiS 966
.It
VIA VT8251/8237A
.El
.Pp
-Generic audio chipsets compatible with the Intel HDA specification should work,
-but have not been verified yet.
-The following codecs have been verified to work:
+The following and many other codecs have been verified to work:
.Pp
.Bl -bullet -compact
.It
@@ -175,6 +513,8 @@ Analog Devices AD1981HD
.It
Analog Devices AD1983
.It
+Analog Devices AD1984
+.It
Analog Devices AD1986A
.It
Analog Devices AD1988
@@ -183,9 +523,11 @@ Analog Devices AD1988B
.It
CMedia CMI9880
.It
-Conexant Venice
+Conexant CX20549 (Venice)
.It
-Conexant Waikiki
+Conexant CX20551 (Waikiki)
+.It
+Conexant CX20561 (Hermosa)
.It
Realtek ALC260
.It
@@ -209,24 +551,47 @@ Realtek ALC885
.It
Realtek ALC888
.It
+Realtek ALC889
+.It
+Sigmatel STAC9205
+.It
Sigmatel STAC9220
.It
-Sigmatel STAC9220D/9223D
+Sigmatel STAC9220D / 9223D
.It
Sigmatel STAC9221
.It
Sigmatel STAC9221D
.It
-Sigmatel STAC9227
+Sigmatel STAC9227D
+.It
+Sigmatel STAC9227X
+.It
+Sigmatel STAC9228D
+.It
+Sigmatel STAC9228X
+.It
+Sigmatel STAC9229D
+.It
+Sigmatel STAC9229X
+.It
+Sigmatel STAC9230D
+.It
+Sigmatel STAC9230X
.It
Sigmatel STAC9271D
.It
+Sigmatel STAC9872AK
+.It
VIA VT1708
.It
+VIA VT1708B
+.It
VIA VT1709
.El
.Sh SEE ALSO
.Xr sound 4 ,
+.Xr snd_ich 4 ,
.Xr device.hints 5 ,
.Xr loader.conf 5 ,
.Xr sysctl 8
@@ -240,18 +605,26 @@ device driver first appeared in
The
.Nm
driver was written by
-.An Stephane E. Potvin Aq sepotvin@videotron.ca
+.An Stephane E. Potvin Aq sepotvin@videotron.ca ,
+.An Ariff Abdullah Aq ariff@FreeBSD.org
and
-.An Ariff Abdullah Aq ariff@FreeBSD.org .
+.An Alexander Motin Aq mav@FreeBSD.org .
This manual page was written by
-.An Joel Dahl Aq joel@FreeBSD.org .
+.An Joel Dahl Aq joel@FreeBSD.org ,
+.An Alexander Motin Aq mav@FreeBSD.org
+and
+.An Giorgos Keramidas Aq keramida@FreeBSD.org .
.Sh BUGS
-There are a couple of missing features, such as support for Digital
-S/PDIF and multichannel output.
-.Pp
A few Hardware/OEM vendors tend to screw up BIOS settings, thus
rendering the
.Nm
driver useless, which usually results in a state where the
.Nm
-driver seems to attach and work, but without any sound.
+driver seems to attach and work, but without any sound. Some of
+that cases can be solved by tuning loader.conf variables. But before
+trying to fix problem that way, make sure that problem is really exists
+and the PCM audio device you are using really corresponds to expected
+audio connector.
+.Pp
+Due to OSS limitation multichannel (not multidevice) playback is not
+supported.
Modified: stable/7/share/man/man4/snd_ich.4
==============================================================================
--- stable/7/share/man/man4/snd_ich.4 Wed Jan 7 16:06:09 2009 (r186865)
+++ stable/7/share/man/man4/snd_ich.4 Wed Jan 7 16:15:17 2009 (r186866)
@@ -24,12 +24,12 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 15, 2005
+.Dd January 6, 2009
.Dt SND_ICH 4
.Os
.Sh NAME
.Nm snd_ich
-.Nd "Intel ICH PCI and compatible bridge device driver"
+.Nd "Intel ICH AC'97 and compatible bridge device driver"
.Sh SYNOPSIS
To compile this driver into the kernel, place the following lines in your
kernel configuration file:
@@ -49,7 +49,12 @@ The
.Nm
bridge driver allows the generic audio driver
.Xr sound 4
-to attach to Intel ICH and compatible audio devices.
+to attach to Intel ICH AC'97 and compatible audio devices.
+.Pp
+Some later chips, like ICH6/ICH7, depending on wiring can instead implement
+newer Intel HD Audio specification, which is supported by
+.Xr snd_hda 4
+driver.
.Sh HARDWARE
The
.Nm
@@ -94,7 +99,8 @@ NVIDIA nForce4
SiS 7012
.El
.Sh SEE ALSO
-.Xr sound 4
+.Xr sound 4 ,
+.Xr snd_hda 4
.Sh HISTORY
The
.Nm
From mav at FreeBSD.org Wed Jan 7 16:21:05 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Wed Jan 7 16:21:22 2009
Subject: svn commit: r186867 - in stable/7/sys: . conf contrib/pf dev/cxgb
Message-ID: <200901071621.n07GL48I091953@svn.freebsd.org>
Author: mav
Date: Wed Jan 7 16:21:04 2009
New Revision: 186867
URL: http://svn.freebsd.org/changeset/base/186867
Log:
MFC rev. 186828
Add small hint that snd_ich is the AC'97 controller driver.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/conf/NOTES
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/conf/NOTES
==============================================================================
--- stable/7/sys/conf/NOTES Wed Jan 7 16:15:17 2009 (r186866)
+++ stable/7/sys/conf/NOTES Wed Jan 7 16:21:04 2009 (r186867)
@@ -2010,7 +2010,7 @@ device sound
# snd_gusc: Gravis UltraSound ISA PnP/non-PnP.
# snd_hda: Intel High Definition Audio (Controller) and
# compatible.
-# snd_ich: Intel ICH PCI and some more audio controllers
+# snd_ich: Intel ICH AC'97 and some more audio controllers
# embedded in a chipset, for example nVidia
# nForce controllers.
# snd_maestro: ESS Technology Maestro-1/2x PCI.
From mav at FreeBSD.org Wed Jan 7 16:36:04 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Wed Jan 7 16:36:22 2009
Subject: svn commit: r186868 - stable/7
Message-ID: <200901071635.n07GZxei092373@svn.freebsd.org>
Author: mav
Date: Wed Jan 7 16:35:59 2009
New Revision: 186868
URL: http://svn.freebsd.org/changeset/base/186868
Log:
snd_hda(4) driver was updated to version 20081226_0122.
Modified:
stable/7/UPDATING
Modified: stable/7/UPDATING
==============================================================================
--- stable/7/UPDATING Wed Jan 7 16:21:04 2009 (r186867)
+++ stable/7/UPDATING Wed Jan 7 16:35:59 2009 (r186868)
@@ -8,6 +8,17 @@ Items affecting the ports and packages s
/usr/ports/UPDATING. Please read that file before running
portupgrade.
+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.
+
20080903:
ntpd has been upgraded to 4.2.4p5.
From maxim at FreeBSD.org Wed Jan 7 18:02:37 2009
From: maxim at FreeBSD.org (Maxim Konovalov)
Date: Wed Jan 7 18:02:44 2009
Subject: svn commit: r186869 - stable/7/share/misc
Message-ID: <200901071802.n07I2a4q094380@svn.freebsd.org>
Author: maxim
Date: Wed Jan 7 18:02:36 2009
New Revision: 186869
URL: http://svn.freebsd.org/changeset/base/186869
Log:
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.
Modified:
stable/7/share/misc/bsd-family-tree
Modified: stable/7/share/misc/bsd-family-tree
==============================================================================
--- stable/7/share/misc/bsd-family-tree Wed Jan 7 16:35:59 2009 (r186868)
+++ stable/7/share/misc/bsd-family-tree Wed Jan 7 18:02:36 2009 (r186869)
@@ -169,8 +169,8 @@ FreeBSD 4.0 | | | | | NetBSD 1.
| FreeBSD 4.10 | | | |
| | | | | |
| FreeBSD 4.11 | | | |
- | | | | | |
- | v `-|------|-----------------|---------------------.
+ | | | | |
+ | `-|------|-----------------|---------------------.
| | | | \
FreeBSD 5.0 | | | |
| | | | |
@@ -212,12 +212,24 @@ FreeBSD 5.2 | |
| | | | | DragonFly 1.8.0
| | | | OpenBSD 4.1 |
| | | | | DragonFly 1.10.0
+ | | Mac OS X | | |
+ | | 10.5 | | |
| | | | OpenBSD 4.2 |
| | | NetBSD 4.0 | |
| FreeBSD 6.3 | | | |
+ | \ | | | |
+ *--FreeBSD | | | | DragonFly 1.12.0
+ | 7.0 | | | | |
+ | | | | | OpenBSD 4.3 |
+ | | | | | | DragonFly 2.0.0
+ | | FreeBSD | | OpenBSD 4.4 |
+ | | 6.4 | | | |
+ | | | | | |
+ | FreeBSD 7.1 | | | |
+ | | | | | |
+ | V | | | |
| | | | |
- | | | | |
-FreeBSD 7 -current | NetBSD -current OpenBSD -current |
+FreeBSD 8 -current | NetBSD -current OpenBSD -current |
| | | | |
v v v v v
@@ -472,9 +484,17 @@ FreeBSD 6.2 2007-01-15 [FBD]
DragonFly 1.8.0 2007-01-30 [DFB]
OpenBSD 4.1 2007-05-01 [OBD]
DragonFly 1.10.0 2007-08-06 [DFB]
+Mac OS X 10.5 2007-10-26 [APL]
OpenBSD 4.2 2007-11-01 [OBD]
NetBSD 4.0 2007-12-19 [NBD]
FreeBSD 6.3 2008-01-18 [FBD]
+DragonFly 1.12.0 2008-02-26 [DFB]
+FreeBSD 7.0 2008-02-27 [FBD]
+OpenBSD 4.3 2008-05-01 [OBD]
+DragonFly 2.0.0 2008-07-21 [DFB]
+OpenBSD 4.4 2008-11-01 [OBD]
+FreeBSD 6.4 2008-11-28 [FBD]
+FreeBSD 7.1 2009-01-04 [FBD]
Bibliography
------------------------
From simon at FreeBSD.org Wed Jan 7 20:17:58 2009
From: simon at FreeBSD.org (Simon L. Nielsen)
Date: Wed Jan 7 20:18:26 2009
Subject: svn commit: r186872 - head/contrib/lukemftpd/src
head/crypto/openssl/apps head/crypto/openssl/ssl releng/6.3
releng/6.3/contrib/lukemftpd/src
releng/6.3/crypto/openssl/apps releng/6.3/crypto/openss...
Message-ID: <200901072017.n07KHtNq098443@svn.freebsd.org>
Author: simon
Date: Wed Jan 7 20:17:55 2009
New Revision: 186872
URL: http://svn.freebsd.org/changeset/base/186872
Log:
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)
Modified:
stable/7/contrib/lukemftpd/src/extern.h
stable/7/contrib/lukemftpd/src/ftpcmd.y
stable/7/contrib/lukemftpd/src/ftpd.c
stable/7/crypto/openssl/apps/speed.c
stable/7/crypto/openssl/apps/spkac.c
stable/7/crypto/openssl/apps/verify.c
stable/7/crypto/openssl/apps/x509.c
stable/7/crypto/openssl/ssl/s2_clnt.c
stable/7/crypto/openssl/ssl/s2_srvr.c
stable/7/crypto/openssl/ssl/s3_clnt.c
stable/7/crypto/openssl/ssl/s3_srvr.c
stable/7/crypto/openssl/ssl/ssltest.c
Changes in other areas also in this revision:
Modified:
head/contrib/lukemftpd/src/extern.h
head/contrib/lukemftpd/src/ftpcmd.y
head/contrib/lukemftpd/src/ftpd.c
head/crypto/openssl/apps/speed.c
head/crypto/openssl/apps/spkac.c
head/crypto/openssl/apps/verify.c
head/crypto/openssl/apps/x509.c
head/crypto/openssl/ssl/s2_clnt.c
head/crypto/openssl/ssl/s2_srvr.c
head/crypto/openssl/ssl/s3_clnt.c
head/crypto/openssl/ssl/s3_srvr.c
head/crypto/openssl/ssl/ssltest.c
releng/6.3/UPDATING
releng/6.3/contrib/lukemftpd/src/extern.h
releng/6.3/contrib/lukemftpd/src/ftpcmd.y
releng/6.3/contrib/lukemftpd/src/ftpd.c
releng/6.3/crypto/openssl/apps/speed.c
releng/6.3/crypto/openssl/apps/spkac.c
releng/6.3/crypto/openssl/apps/verify.c
releng/6.3/crypto/openssl/apps/x509.c
releng/6.3/crypto/openssl/ssl/s2_clnt.c
releng/6.3/crypto/openssl/ssl/s2_srvr.c
releng/6.3/crypto/openssl/ssl/s3_clnt.c
releng/6.3/crypto/openssl/ssl/s3_srvr.c
releng/6.3/sys/conf/newvers.sh
releng/6.4/UPDATING
releng/6.4/contrib/lukemftpd/src/extern.h
releng/6.4/contrib/lukemftpd/src/ftpcmd.y
releng/6.4/contrib/lukemftpd/src/ftpd.c
releng/6.4/crypto/openssl/apps/speed.c
releng/6.4/crypto/openssl/apps/spkac.c
releng/6.4/crypto/openssl/apps/verify.c
releng/6.4/crypto/openssl/apps/x509.c
releng/6.4/crypto/openssl/ssl/s2_clnt.c
releng/6.4/crypto/openssl/ssl/s2_srvr.c
releng/6.4/crypto/openssl/ssl/s3_clnt.c
releng/6.4/crypto/openssl/ssl/s3_srvr.c
releng/6.4/sys/conf/newvers.sh
releng/7.0/UPDATING
releng/7.0/contrib/lukemftpd/src/extern.h
releng/7.0/contrib/lukemftpd/src/ftpcmd.y
releng/7.0/contrib/lukemftpd/src/ftpd.c
releng/7.0/crypto/openssl/apps/speed.c
releng/7.0/crypto/openssl/apps/spkac.c
releng/7.0/crypto/openssl/apps/verify.c
releng/7.0/crypto/openssl/apps/x509.c
releng/7.0/crypto/openssl/ssl/s2_clnt.c
releng/7.0/crypto/openssl/ssl/s2_srvr.c
releng/7.0/crypto/openssl/ssl/s3_clnt.c
releng/7.0/crypto/openssl/ssl/s3_srvr.c
releng/7.0/crypto/openssl/ssl/ssltest.c
releng/7.0/sys/conf/newvers.sh
releng/7.1/UPDATING
releng/7.1/contrib/lukemftpd/src/extern.h
releng/7.1/contrib/lukemftpd/src/ftpcmd.y
releng/7.1/contrib/lukemftpd/src/ftpd.c
releng/7.1/crypto/openssl/apps/speed.c
releng/7.1/crypto/openssl/apps/spkac.c
releng/7.1/crypto/openssl/apps/verify.c
releng/7.1/crypto/openssl/apps/x509.c
releng/7.1/crypto/openssl/ssl/s2_clnt.c
releng/7.1/crypto/openssl/ssl/s2_srvr.c
releng/7.1/crypto/openssl/ssl/s3_clnt.c
releng/7.1/crypto/openssl/ssl/s3_srvr.c
releng/7.1/crypto/openssl/ssl/ssltest.c
releng/7.1/sys/conf/newvers.sh
stable/6/contrib/lukemftpd/src/extern.h
stable/6/contrib/lukemftpd/src/ftpcmd.y
stable/6/contrib/lukemftpd/src/ftpd.c
Modified: stable/7/contrib/lukemftpd/src/extern.h
==============================================================================
--- stable/7/contrib/lukemftpd/src/extern.h Wed Jan 7 18:37:07 2009 (r186871)
+++ stable/7/contrib/lukemftpd/src/extern.h Wed Jan 7 20:17:55 2009 (r186872)
@@ -139,7 +139,7 @@ void feat(void);
void format_path(char *, const char *);
int ftpd_pclose(FILE *);
FILE *ftpd_popen(char *[], const char *, int);
-char *getline(char *, int, FILE *);
+int getline(char *, int, FILE *);
void init_curclass(void);
void logxfer(const char *, off_t, const char *, const char *,
const struct timeval *, const char *);
Modified: stable/7/contrib/lukemftpd/src/ftpcmd.y
==============================================================================
--- stable/7/contrib/lukemftpd/src/ftpcmd.y Wed Jan 7 18:37:07 2009 (r186871)
+++ stable/7/contrib/lukemftpd/src/ftpcmd.y Wed Jan 7 20:17:55 2009 (r186872)
@@ -1363,8 +1363,12 @@ lookup(struct tab *p, const char *cmd)
/*
* getline - a hacked up version of fgets to ignore TELNET escape codes.
+ * `s' is the buffer to read into.
+ * `n' is the 1 less than the size of the buffer, to allow trailing NUL
+ * `iop' is the FILE to read from.
+ * Returns 0 on success, -1 on EOF, -2 if the command was too long.
*/
-char *
+int
getline(char *s, int n, FILE *iop)
{
int c;
@@ -1379,7 +1383,7 @@ getline(char *s, int n, FILE *iop)
if (ftpd_debug)
syslog(LOG_DEBUG, "command: %s", s);
tmpline[0] = '\0';
- return(s);
+ return(0);
}
if (c == 0)
tmpline[0] = '\0';
@@ -1418,11 +1422,25 @@ getline(char *s, int n, FILE *iop)
}
}
*cs++ = c;
- if (--n <= 0 || c == '\n')
+ if (--n <= 0) {
+ /*
+ * If command doesn't fit into buffer, discard the
+ * rest of the command and indicate truncation.
+ * This prevents the command to be split up into
+ * multiple commands.
+ */
+ if (ftpd_debug)
+ syslog(LOG_DEBUG,
+ "command too long, last char: %d", c);
+ while (c != '\n' && (c = getc(iop)) != EOF)
+ continue;
+ return (-2);
+ }
+ if (c == '\n')
break;
}
if (c == EOF && cs == s)
- return (NULL);
+ return (-1);
*cs++ = '\0';
if (ftpd_debug) {
if ((curclass.type != CLASS_GUEST &&
@@ -1444,7 +1462,7 @@ getline(char *s, int n, FILE *iop)
syslog(LOG_DEBUG, "command: %.*s", len, s);
}
}
- return (s);
+ return (0);
}
void
@@ -1458,15 +1476,20 @@ ftp_handle_line(char *cp)
void
ftp_loop(void)
{
+ int ret;
while (1) {
(void) alarm(curclass.timeout);
- if (getline(cbuf, sizeof(cbuf)-1, stdin) == NULL) {
+ ret = getline(cbuf, sizeof(cbuf)-1, stdin);
+ (void) alarm(0);
+ if (ret == -1) {
reply(221, "You could at least say goodbye.");
dologout(0);
+ } else if (ret == -2) {
+ reply(500, "Command too long.");
+ } else {
+ ftp_handle_line(cbuf);
}
- (void) alarm(0);
- ftp_handle_line(cbuf);
}
/*NOTREACHED*/
}
Modified: stable/7/contrib/lukemftpd/src/ftpd.c
==============================================================================
--- stable/7/contrib/lukemftpd/src/ftpd.c Wed Jan 7 18:37:07 2009 (r186871)
+++ stable/7/contrib/lukemftpd/src/ftpd.c Wed Jan 7 20:17:55 2009 (r186872)
@@ -1,4 +1,4 @@
-/* $NetBSD: ftpd.c,v 1.176 2006/05/09 20:18:06 mrg Exp $ */
+/* $NetBSD: ftpd.c,v 1.187 2008/09/13 03:30:35 lukem Exp $ */
/*
* Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -2896,6 +2896,7 @@ static int
handleoobcmd()
{
char *cp;
+ int ret;
if (!urgflag)
return (0);
@@ -2904,9 +2905,14 @@ handleoobcmd()
if (!transflag)
return (0);
cp = tmpline;
- if (getline(cp, sizeof(tmpline), stdin) == NULL) {
+ ret = getline(cp, sizeof(tmpline)-1, stdin);
+ if (ret == -1) {
reply(221, "You could at least say goodbye.");
dologout(0);
+ } else if (ret == -2) {
+ /* Ignore truncated command */
+ /* XXX: abort xfer with "500 command too long", & return 1 ? */
+ return 0;
}
/*
* Manually parse OOB commands, because we can't
Modified: stable/7/crypto/openssl/apps/speed.c
==============================================================================
--- stable/7/crypto/openssl/apps/speed.c Wed Jan 7 18:37:07 2009 (r186871)
+++ stable/7/crypto/openssl/apps/speed.c Wed Jan 7 20:17:55 2009 (r186872)
@@ -2038,7 +2038,7 @@ int MAIN(int argc, char **argv)
{
ret=RSA_verify(NID_md5_sha1, buf,36, buf2,
rsa_num, rsa_key[j]);
- if (ret == 0)
+ if (ret <= 0)
{
BIO_printf(bio_err,
"RSA verify failure\n");
Modified: stable/7/crypto/openssl/apps/spkac.c
==============================================================================
--- stable/7/crypto/openssl/apps/spkac.c Wed Jan 7 18:37:07 2009 (r186871)
+++ stable/7/crypto/openssl/apps/spkac.c Wed Jan 7 20:17:55 2009 (r186872)
@@ -285,7 +285,7 @@ bad:
pkey = NETSCAPE_SPKI_get_pubkey(spki);
if(verify) {
i = NETSCAPE_SPKI_verify(spki, pkey);
- if(i) BIO_printf(bio_err, "Signature OK\n");
+ if (i > 0) BIO_printf(bio_err, "Signature OK\n");
else {
BIO_printf(bio_err, "Signature Failure\n");
ERR_print_errors(bio_err);
Modified: stable/7/crypto/openssl/apps/verify.c
==============================================================================
--- stable/7/crypto/openssl/apps/verify.c Wed Jan 7 18:37:07 2009 (r186871)
+++ stable/7/crypto/openssl/apps/verify.c Wed Jan 7 20:17:55 2009 (r186872)
@@ -266,7 +266,7 @@ static int check(X509_STORE *ctx, char *
ret=0;
end:
- if (i)
+ if (i > 0)
{
fprintf(stdout,"OK\n");
ret=1;
@@ -367,4 +367,3 @@ static int MS_CALLBACK cb(int ok, X509_S
ERR_clear_error();
return(ok);
}
-
Modified: stable/7/crypto/openssl/apps/x509.c
==============================================================================
--- stable/7/crypto/openssl/apps/x509.c Wed Jan 7 18:37:07 2009 (r186871)
+++ stable/7/crypto/openssl/apps/x509.c Wed Jan 7 20:17:55 2009 (r186872)
@@ -1144,7 +1144,7 @@ static int x509_certify(X509_STORE *ctx,
/* NOTE: this certificate can/should be self signed, unless it was
* a certificate request in which case it is not. */
X509_STORE_CTX_set_cert(&xsc,x);
- if (!reqfile && !X509_verify_cert(&xsc))
+ if (!reqfile && X509_verify_cert(&xsc) <= 0)
goto end;
if (!X509_check_private_key(xca,pkey))
Modified: stable/7/crypto/openssl/ssl/s2_clnt.c
==============================================================================
--- stable/7/crypto/openssl/ssl/s2_clnt.c Wed Jan 7 18:37:07 2009 (r186871)
+++ stable/7/crypto/openssl/ssl/s2_clnt.c Wed Jan 7 20:17:55 2009 (r186872)
@@ -1044,7 +1044,7 @@ int ssl2_set_certificate(SSL *s, int typ
i=ssl_verify_cert_chain(s,sk);
- if ((s->verify_mode != SSL_VERIFY_NONE) && (!i))
+ if ((s->verify_mode != SSL_VERIFY_NONE) && (i <= 0))
{
SSLerr(SSL_F_SSL2_SET_CERTIFICATE,SSL_R_CERTIFICATE_VERIFY_FAILED);
goto err;
Modified: stable/7/crypto/openssl/ssl/s2_srvr.c
==============================================================================
--- stable/7/crypto/openssl/ssl/s2_srvr.c Wed Jan 7 18:37:07 2009 (r186871)
+++ stable/7/crypto/openssl/ssl/s2_srvr.c Wed Jan 7 20:17:55 2009 (r186872)
@@ -1054,7 +1054,7 @@ static int request_certificate(SSL *s)
i=ssl_verify_cert_chain(s,sk);
- if (i) /* we like the packet, now check the chksum */
+ if (i > 0) /* we like the packet, now check the chksum */
{
EVP_MD_CTX ctx;
EVP_PKEY *pkey=NULL;
@@ -1083,7 +1083,7 @@ static int request_certificate(SSL *s)
EVP_PKEY_free(pkey);
EVP_MD_CTX_cleanup(&ctx);
- if (i)
+ if (i > 0)
{
if (s->session->peer != NULL)
X509_free(s->session->peer);
Modified: stable/7/crypto/openssl/ssl/s3_clnt.c
==============================================================================
--- stable/7/crypto/openssl/ssl/s3_clnt.c Wed Jan 7 18:37:07 2009 (r186871)
+++ stable/7/crypto/openssl/ssl/s3_clnt.c Wed Jan 7 20:17:55 2009 (r186872)
@@ -883,7 +883,7 @@ int ssl3_get_server_certificate(SSL *s)
}
i=ssl_verify_cert_chain(s,sk);
- if ((s->verify_mode != SSL_VERIFY_NONE) && (!i)
+ if ((s->verify_mode != SSL_VERIFY_NONE) && (i <= 0)
#ifndef OPENSSL_NO_KRB5
&& (s->s3->tmp.new_cipher->algorithms & (SSL_MKEY_MASK|SSL_AUTH_MASK))
!= (SSL_aKRB5|SSL_kKRB5)
@@ -1368,7 +1368,7 @@ int ssl3_get_key_exchange(SSL *s)
EVP_VerifyUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE);
EVP_VerifyUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE);
EVP_VerifyUpdate(&md_ctx,param,param_len);
- if (!EVP_VerifyFinal(&md_ctx,p,(int)n,pkey))
+ if (EVP_VerifyFinal(&md_ctx,p,(int)n,pkey) <= 0)
{
/* bad signature */
al=SSL_AD_DECRYPT_ERROR;
@@ -1386,7 +1386,7 @@ int ssl3_get_key_exchange(SSL *s)
EVP_VerifyUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE);
EVP_VerifyUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE);
EVP_VerifyUpdate(&md_ctx,param,param_len);
- if (!EVP_VerifyFinal(&md_ctx,p,(int)n,pkey))
+ if (EVP_VerifyFinal(&md_ctx,p,(int)n,pkey) <= 0)
{
/* bad signature */
al=SSL_AD_DECRYPT_ERROR;
Modified: stable/7/crypto/openssl/ssl/s3_srvr.c
==============================================================================
--- stable/7/crypto/openssl/ssl/s3_srvr.c Wed Jan 7 18:37:07 2009 (r186871)
+++ stable/7/crypto/openssl/ssl/s3_srvr.c Wed Jan 7 20:17:55 2009 (r186872)
@@ -2481,7 +2481,7 @@ int ssl3_get_client_certificate(SSL *s)
else
{
i=ssl_verify_cert_chain(s,sk);
- if (!i)
+ if (i <= 0)
{
al=ssl_verify_alarm_type(s->verify_result);
SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE,SSL_R_NO_CERTIFICATE_RETURNED);
Modified: stable/7/crypto/openssl/ssl/ssltest.c
==============================================================================
--- stable/7/crypto/openssl/ssl/ssltest.c Wed Jan 7 18:37:07 2009 (r186871)
+++ stable/7/crypto/openssl/ssl/ssltest.c Wed Jan 7 20:17:55 2009 (r186872)
@@ -2072,7 +2072,7 @@ static int MS_CALLBACK app_verify_callba
if (cb_arg->proxy_auth)
{
- if (ok)
+ if (ok > 0)
{
const char *cond_end = NULL;
From scf at FreeBSD.org Thu Jan 8 02:41:41 2009
From: scf at FreeBSD.org (Sean Farley)
Date: Thu Jan 8 02:41:58 2009
Subject: svn commit: r186883 - stable/7/lib/libutil
Message-ID: <200901080241.n082feiC006419@svn.freebsd.org>
Author: scf
Date: Thu Jan 8 02:41:40 2009
New Revision: 186883
URL: http://svn.freebsd.org/changeset/base/186883
Log:
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
Modified:
stable/7/lib/libutil/ (props changed)
stable/7/lib/libutil/gr_util.c
Modified: stable/7/lib/libutil/gr_util.c
==============================================================================
--- stable/7/lib/libutil/gr_util.c Thu Jan 8 00:45:47 2009 (r186882)
+++ stable/7/lib/libutil/gr_util.c Thu Jan 8 02:41:40 2009 (r186883)
@@ -28,18 +28,21 @@
__FBSDID("$FreeBSD$");
#include
+
#include
#include
+#include
#include
#include
#include
#include
-#include
-
-
-static const char GroupLineFormat[] = "%s:%s:%ju:";
+struct group_storage {
+ struct group gr;
+ char *members[];
+};
+static const char group_line_format[] = "%s:%s:%ju:";
/*
* Compares two struct group's.
@@ -47,41 +50,50 @@ static const char GroupLineFormat[] = "%
int
gr_equal(const struct group *gr1, const struct group *gr2)
{
+ int gr1_ndx;
+ int gr2_ndx;
bool found;
- bool equal;
- int gr1Ndx;
- int gr2Ndx;
/* Check that the non-member information is the same. */
- equal = strcmp(gr1->gr_name, gr2->gr_name) == 0 &&
- strcmp(gr1->gr_passwd, gr2->gr_passwd) == 0 &&
- gr1->gr_gid == gr2->gr_gid;
+ if (gr1->gr_name == NULL || gr2->gr_name == NULL) {
+ if (gr1->gr_name != gr2->gr_name)
+ return (false);
+ } else if (strcmp(gr1->gr_name, gr2->gr_name) != 0)
+ return (false);
+ if (gr1->gr_passwd == NULL || gr2->gr_passwd == NULL) {
+ if (gr1->gr_passwd != gr2->gr_passwd)
+ return (false);
+ } else if (strcmp(gr1->gr_passwd, gr2->gr_passwd) != 0)
+ return (false);
+ if (gr1->gr_gid != gr2->gr_gid)
+ return (false);
/* Check all members in both groups. */
- if (equal) {
- for (found = false, gr1Ndx = 0; gr1->gr_mem[gr1Ndx] != NULL;
- gr1Ndx++) {
- for (gr2Ndx = 0; gr2->gr_mem[gr2Ndx] != NULL; gr2Ndx++)
- if (strcmp(gr1->gr_mem[gr1Ndx],
- gr2->gr_mem[gr2Ndx]) == 0) {
+ if (gr1->gr_mem == NULL || gr2->gr_mem == NULL) {
+ if (gr1->gr_mem != gr2->gr_mem)
+ return (false);
+ } else {
+ for (found = false, gr1_ndx = 0; gr1->gr_mem[gr1_ndx] != NULL;
+ gr1_ndx++) {
+ for (gr2_ndx = 0; gr2->gr_mem[gr2_ndx] != NULL;
+ gr2_ndx++)
+ if (strcmp(gr1->gr_mem[gr1_ndx],
+ gr2->gr_mem[gr2_ndx]) == 0) {
found = true;
break;
}
- if (! found) {
- equal = false;
- break;
- }
+ if (!found)
+ return (false);
}
/* Check that group2 does not have more members than group1. */
- if (gr2->gr_mem[gr1Ndx] != NULL)
- equal = false;
+ if (gr2->gr_mem[gr1_ndx] != NULL)
+ return (false);
}
- return (equal);
+ return (true);
}
-
/*
* Make a group line out of a struct group.
*/
@@ -89,82 +101,84 @@ char *
gr_make(const struct group *gr)
{
char *line;
+ size_t line_size;
int ndx;
- size_t lineSize;
/* Calculate the length of the group line. */
- lineSize = snprintf(NULL, 0, GroupLineFormat, gr->gr_name,
+ line_size = snprintf(NULL, 0, group_line_format, gr->gr_name,
gr->gr_passwd, (uintmax_t)gr->gr_gid) + 1;
- for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++)
- lineSize += strlen(gr->gr_mem[ndx]) + 1;
- if (ndx > 0)
- lineSize--;
+ if (gr->gr_mem != NULL) {
+ for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++)
+ line_size += strlen(gr->gr_mem[ndx]) + 1;
+ if (ndx > 0)
+ line_size--;
+ }
/* Create the group line and fill it. */
- if ((line = malloc(lineSize)) == NULL)
+ if ((line = malloc(line_size)) == NULL)
return (NULL);
- lineSize = snprintf(line, lineSize, GroupLineFormat, gr->gr_name,
+ line_size = snprintf(line, line_size, group_line_format, gr->gr_name,
gr->gr_passwd, (uintmax_t)gr->gr_gid);
- for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++) {
- strcat(line, gr->gr_mem[ndx]);
- if (gr->gr_mem[ndx + 1] != NULL)
- strcat(line, ",");
- }
+ if (gr->gr_mem != NULL)
+ for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++) {
+ strcat(line, gr->gr_mem[ndx]);
+ if (gr->gr_mem[ndx + 1] != NULL)
+ strcat(line, ",");
+ }
return (line);
}
-
/*
* Duplicate a struct group.
*/
struct group *
gr_dup(const struct group *gr)
{
- int ndx;
- int numMem;
+ char *dst;
size_t len;
- struct group *ngr;
+ struct group_storage *gs;
+ int ndx;
+ int num_mem;
- /* Calculate size of group. */
- len = sizeof(*gr) +
- (gr->gr_name != NULL ? strlen(gr->gr_name) + 1 : 0) +
- (gr->gr_passwd != NULL ? strlen(gr->gr_passwd) + 1 : 0);
- numMem = 0;
+ /* Calculate size of the group. */
+ len = sizeof(*gs);
+ if (gr->gr_name != NULL)
+ len += strlen(gr->gr_name) + 1;
+ if (gr->gr_passwd != NULL)
+ len += strlen(gr->gr_passwd) + 1;
if (gr->gr_mem != NULL) {
- for (; gr->gr_mem[numMem] != NULL; numMem++)
- len += strlen(gr->gr_mem[numMem]) + 1;
- len += (numMem + 1) * sizeof(*(gr->gr_mem));
- }
+ for (num_mem = 0; gr->gr_mem[num_mem] != NULL; num_mem++)
+ len += strlen(gr->gr_mem[num_mem]) + 1;
+ len += (num_mem + 1) * sizeof(*gr->gr_mem);
+ } else
+ num_mem = -1;
/* Create new group and copy old group into it. */
- if ((ngr = calloc(1, len)) == NULL)
+ if ((gs = calloc(1, len)) == NULL)
return (NULL);
- len = sizeof(*ngr);
- ngr->gr_gid = gr->gr_gid;
+ dst = (char *)&gs->members[num_mem + 1];
if (gr->gr_name != NULL) {
- ngr->gr_name = (char *)ngr + len;
- len += sprintf(ngr->gr_name, "%s", gr->gr_name) + 1;
+ gs->gr.gr_name = dst;
+ dst = stpcpy(gs->gr.gr_name, gr->gr_name) + 1;
}
if (gr->gr_passwd != NULL) {
- ngr->gr_passwd = (char *)ngr + len;
- len += sprintf(ngr->gr_passwd, "%s", gr->gr_passwd) + 1;
+ gs->gr.gr_passwd = dst;
+ dst = stpcpy(gs->gr.gr_passwd, gr->gr_passwd) + 1;
}
+ gs->gr.gr_gid = gr->gr_gid;
if (gr->gr_mem != NULL) {
- ngr->gr_mem = (char **)((char *)ngr + len);
- len += (numMem + 1) * sizeof(*(ngr->gr_mem));
- for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++) {
- ngr->gr_mem[ndx] = (char *)ngr + len;
- len += sprintf(ngr->gr_mem[ndx], "%s",
- gr->gr_mem[ndx]) + 1;
+ gs->gr.gr_mem = gs->members;
+ for (ndx = 0; ndx < num_mem; ndx++) {
+ gs->gr.gr_mem[ndx] = dst;
+ dst = stpcpy(gs->gr.gr_mem[ndx], gr->gr_mem[ndx]) + 1;
}
- ngr->gr_mem[ndx] = NULL;
+ gs->gr.gr_mem[ndx] = NULL;
}
- return (ngr);
+ return (&gs->gr);
}
-
/*
* Scan a line and place it into a group structure.
*/
@@ -180,14 +194,14 @@ __gr_scan(char *line, struct group *gr)
return (false);
*loc = '\0';
gr->gr_passwd = loc + 1;
- if (*(gr->gr_passwd) == ':')
- *(gr->gr_passwd) = '\0';
+ if (*gr->gr_passwd == ':')
+ *gr->gr_passwd = '\0';
else {
if ((loc = strchr(loc + 1, ':')) == NULL)
return (false);
*loc = '\0';
}
- if (sscanf(loc + 1, "%u", &(gr->gr_gid)) != 1)
+ if (sscanf(loc + 1, "%u", &gr->gr_gid) != 1)
return (false);
/* Assign member information to structure. */
@@ -195,40 +209,42 @@ __gr_scan(char *line, struct group *gr)
return (false);
line = loc + 1;
gr->gr_mem = NULL;
- if (*line != '\0') {
- ndx = 0;
+ ndx = 0;
+ do {
+ gr->gr_mem = reallocf(gr->gr_mem, sizeof(*gr->gr_mem) *
+ (ndx + 1));
+ if (gr->gr_mem == NULL)
+ return (false);
+
+ /* Skip locations without members (i.e., empty string). */
do {
- if ((gr->gr_mem = reallocf(gr->gr_mem,
- sizeof(*(gr->gr_mem)) * (ndx + 1))) == NULL)
- return (false);
gr->gr_mem[ndx] = strsep(&line, ",");
- } while (gr->gr_mem[ndx++] != NULL);
- }
+ } while (gr->gr_mem[ndx] != NULL && *gr->gr_mem[ndx] == '\0');
+ } while (gr->gr_mem[ndx++] != NULL);
return (true);
}
-
/*
* Create a struct group from a line.
*/
struct group *
gr_scan(const char *line)
{
- char *lineCopy;
- struct group *newGr;
struct group gr;
+ char *line_copy;
+ struct group *new_gr;
- if ((lineCopy = strdup(line)) == NULL)
+ if ((line_copy = strdup(line)) == NULL)
return (NULL);
- if (!__gr_scan(lineCopy, &gr)) {
- free(lineCopy);
+ if (!__gr_scan(line_copy, &gr)) {
+ free(line_copy);
return (NULL);
}
- newGr = gr_dup(&gr);
- free(lineCopy);
+ new_gr = gr_dup(&gr);
+ free(line_copy);
if (gr.gr_mem != NULL)
free(gr.gr_mem);
- return (newGr);
+ return (new_gr);
}
From kib at FreeBSD.org Thu Jan 8 09:50:22 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Thu Jan 8 09:50:29 2009
Subject: svn commit: r186890 - in stable/7: gnu/usr.bin/cc
gnu/usr.bin/cc/libiberty gnu/usr.bin/sort include kerberos5
kerberos5/include lib/bind lib/bind/bind lib/libc
lib/libc/string lib/libmagic usr.bin/...
Message-ID: <200901080950.n089oKxr014752@svn.freebsd.org>
Author: kib
Date: Thu Jan 8 09:50:20 2009
New Revision: 186890
URL: http://svn.freebsd.org/changeset/base/186890
Log:
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.
Added:
stable/7/lib/libc/string/strndup.c
- copied unchanged from r185690, head/lib/libc/string/strndup.c
Modified:
stable/7/gnu/usr.bin/cc/ (props changed)
stable/7/gnu/usr.bin/cc/libiberty/config.h
stable/7/gnu/usr.bin/sort/ (props changed)
stable/7/gnu/usr.bin/sort/config.h
stable/7/include/ (props changed)
stable/7/include/string.h
stable/7/kerberos5/ (props changed)
stable/7/kerberos5/include/config.h
stable/7/lib/bind/ (props changed)
stable/7/lib/bind/bind/port_after.h
stable/7/lib/libc/ (props changed)
stable/7/lib/libc/string/Makefile.inc
stable/7/lib/libc/string/Symbol.map
stable/7/lib/libc/string/ffsll.c (props changed)
stable/7/lib/libc/string/flsll.c (props changed)
stable/7/lib/libc/string/strdup.3
stable/7/lib/libmagic/ (props changed)
stable/7/lib/libmagic/config.h
stable/7/usr.bin/file/ (props changed)
stable/7/usr.bin/file/config.h
Modified: stable/7/gnu/usr.bin/cc/libiberty/config.h
==============================================================================
--- stable/7/gnu/usr.bin/cc/libiberty/config.h Thu Jan 8 09:38:18 2009 (r186889)
+++ stable/7/gnu/usr.bin/cc/libiberty/config.h Thu Jan 8 09:50:20 2009 (r186890)
@@ -235,7 +235,7 @@
#define HAVE_STRNCASECMP 1
/* Define to 1 if you have the `strndup' function. */
-/* #undef HAVE_STRNDUP */
+#define HAVE_STRNDUP 1
/* Define to 1 if you have the `strrchr' function. */
#define HAVE_STRRCHR 1
Modified: stable/7/gnu/usr.bin/sort/config.h
==============================================================================
--- stable/7/gnu/usr.bin/sort/config.h Thu Jan 8 09:38:18 2009 (r186889)
+++ stable/7/gnu/usr.bin/sort/config.h Thu Jan 8 09:50:20 2009 (r186890)
@@ -759,7 +759,7 @@
#define HAVE_STRNCASECMP 1
/* Define to 1 if you have the `strndup' function. */
-/* #undef HAVE_STRNDUP */
+#define HAVE_STRNDUP 1
/* Define to 1 if you have the `strpbrk' function. */
#define HAVE_STRPBRK 1
Modified: stable/7/include/string.h
==============================================================================
--- stable/7/include/string.h Thu Jan 8 09:38:18 2009 (r186889)
+++ stable/7/include/string.h Thu Jan 8 09:50:20 2009 (r186890)
@@ -96,6 +96,7 @@ char *strncat(char * __restrict, const c
int strncmp(const char *, const char *, size_t) __pure;
char *strncpy(char * __restrict, const char * __restrict, size_t);
#if __BSD_VISIBLE
+char *strndup(const char *, size_t);
char *strnstr(const char *, const char *, size_t) __pure;
#endif
char *strpbrk(const char *, const char *) __pure;
Modified: stable/7/kerberos5/include/config.h
==============================================================================
--- stable/7/kerberos5/include/config.h Thu Jan 8 09:38:18 2009 (r186889)
+++ stable/7/kerberos5/include/config.h Thu Jan 8 09:50:20 2009 (r186890)
@@ -747,7 +747,7 @@ static /**/const char *const rcsid[] = {
#define HAVE_STRNCASECMP 1
/* Define if you have the function `strndup'. */
-/* #undef HAVE_STRNDUP */
+#define HAVE_STRNDUP 1
/* Define if you have the function `strnlen'. */
/* #undef HAVE_STRNLEN */
Modified: stable/7/lib/bind/bind/port_after.h
==============================================================================
--- stable/7/lib/bind/bind/port_after.h Thu Jan 8 09:38:18 2009 (r186889)
+++ stable/7/lib/bind/bind/port_after.h Thu Jan 8 09:50:20 2009 (r186890)
@@ -30,7 +30,7 @@
#undef HAS_IN_ADDR6
#define HAVE_SOCKADDR_STORAGE 1
#undef NEED_GETTIMEOFDAY
-#undef HAVE_STRNDUP
+#define HAVE_STRNDUP 1
#undef USE_FIONBIO_IOCTL
#undef USE_SYSERROR_LIST
#undef INNETGR_ARGS
Modified: stable/7/lib/libc/string/Makefile.inc
==============================================================================
--- stable/7/lib/libc/string/Makefile.inc Thu Jan 8 09:38:18 2009 (r186889)
+++ stable/7/lib/libc/string/Makefile.inc Thu Jan 8 09:50:20 2009 (r186890)
@@ -9,9 +9,9 @@ CFLAGS+= -I${.CURDIR}/locale
MISRCS+=bcmp.c bcopy.c bzero.c ffs.c ffsl.c ffsll.c fls.c flsl.c flsll.c \
index.c memccpy.c memchr.c memrchr.c memcmp.c \
memcpy.c memmem.c memmove.c memset.c rindex.c stpcpy.c strcasecmp.c \
- strcat.c strchr.c strcmp.c strcoll.c strcpy.c strcspn.c strdup.c \
- strerror.c strlcat.c strlcpy.c strlen.c strmode.c strncat.c strncmp.c \
- strncpy.c strcasestr.c strnstr.c \
+ strcat.c strcasestr.c strchr.c strcmp.c strcoll.c strcpy.c strcspn.c \
+ strdup.c strerror.c strlcat.c strlcpy.c strlen.c strmode.c strncat.c \
+ strncmp.c strncpy.c strndup.c strnstr.c \
strpbrk.c strrchr.c strsep.c strsignal.c strspn.c strstr.c strtok.c \
strxfrm.c swab.c wcscat.c wcschr.c wcscmp.c wcscoll.c wcscpy.c \
wcscspn.c wcsdup.c \
@@ -47,6 +47,7 @@ MLINKS+=strcat.3 strncat.3
MLINKS+=strchr.3 strrchr.3
MLINKS+=strcmp.3 strncmp.3
MLINKS+=strcpy.3 stpcpy.3
+MLINKS+=strdup.3 strndup.3
MLINKS+=strcpy.3 strncpy.3
MLINKS+=strerror.3 perror.3 strerror.3 sys_errlist.3 strerror.3 sys_nerr.3
MLINKS+=strerror.3 strerror_r.3
Modified: stable/7/lib/libc/string/Symbol.map
==============================================================================
--- stable/7/lib/libc/string/Symbol.map Thu Jan 8 09:38:18 2009 (r186889)
+++ stable/7/lib/libc/string/Symbol.map Thu Jan 8 09:50:20 2009 (r186890)
@@ -81,6 +81,7 @@ FBSD_1.1 {
ffsll;
flsll;
memrchr;
+ strndup;
};
FBSDprivate_1.0 {
Modified: stable/7/lib/libc/string/strdup.3
==============================================================================
--- stable/7/lib/libc/string/strdup.3 Thu Jan 8 09:38:18 2009 (r186889)
+++ stable/7/lib/libc/string/strdup.3 Thu Jan 8 09:50:20 2009 (r186890)
@@ -28,11 +28,12 @@
.\" @(#)strdup.3 8.1 (Berkeley) 6/9/93
.\" $FreeBSD$
.\"
-.Dd June 9, 1993
+.Dd Dec 5, 2008
.Dt STRDUP 3
.Os
.Sh NAME
-.Nm strdup
+.Nm strdup ,
+.Nm strndup
.Nd save a copy of a string
.Sh LIBRARY
.Lb libc
@@ -40,6 +41,8 @@
.In string.h
.Ft char *
.Fn strdup "const char *str"
+.Ft char *
+.Fn strndup "const char *str" "size_t len"
.Sh DESCRIPTION
The
.Fn strdup
@@ -56,6 +59,16 @@ If insufficient memory is available, NUL
.Va errno
is set to
.Er ENOMEM .
+.Pp
+The
+.Fn strndup
+function copies at most
+.Fa len
+characters from the string
+.Fa str
+always
+.Dv NUL
+terminating the copied string.
.Sh SEE ALSO
.Xr free 3 ,
.Xr malloc 3
@@ -64,3 +77,7 @@ The
.Fn strdup
function first appeared in
.Bx 4.4 .
+The
+.Fn strndup
+function was added in
+.Fx 8.0 .
Copied: stable/7/lib/libc/string/strndup.c (from r185690, head/lib/libc/string/strndup.c)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/lib/libc/string/strndup.c Thu Jan 8 09:50:20 2009 (r186890, copy of r185690, head/lib/libc/string/strndup.c)
@@ -0,0 +1,53 @@
+/* $NetBSD: strndup.c,v 1.3 2007/01/14 23:41:24 cbiere Exp $ */
+
+/*
+ * Copyright (c) 1988, 1993
+ * The Regents of the University of California. 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.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
+ */
+
+#include
+__FBSDID("$FreeBSD$");
+
+#include
+#include
+#include
+
+char *
+strndup(const char *str, size_t n)
+{
+ size_t len;
+ char *copy;
+
+ for (len = 0; len < n && str[len]; len++)
+ continue;
+
+ if ((copy = malloc(len + 1)) == NULL)
+ return (NULL);
+ memcpy(copy, str, len);
+ copy[len] = '\0';
+ return (copy);
+}
Modified: stable/7/lib/libmagic/config.h
==============================================================================
--- stable/7/lib/libmagic/config.h Thu Jan 8 09:38:18 2009 (r186889)
+++ stable/7/lib/libmagic/config.h Thu Jan 8 09:50:20 2009 (r186890)
@@ -77,7 +77,7 @@
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strndup' function. */
-/* #undef HAVE_STRNDUP */
+#define HAVE_STRNDUP 1
/* Define to 1 if you have the `strtof' function. */
#define HAVE_STRTOF 1
Modified: stable/7/usr.bin/file/config.h
==============================================================================
--- stable/7/usr.bin/file/config.h Thu Jan 8 09:38:18 2009 (r186889)
+++ stable/7/usr.bin/file/config.h Thu Jan 8 09:50:20 2009 (r186890)
@@ -77,7 +77,7 @@
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strndup' function. */
-/* #undef HAVE_STRNDUP */
+#define HAVE_STRNDUP 1
/* Define to 1 if you have the `strtof' function. */
#define HAVE_STRTOF 1
From sam at FreeBSD.org Thu Jan 8 18:34:37 2009
From: sam at FreeBSD.org (Sam Leffler)
Date: Thu Jan 8 18:34:43 2009
Subject: svn commit: r186910 - stable/7/sys/dev/ath/ath_hal
Message-ID: <200901081834.n08IYJoc030540@svn.freebsd.org>
Author: sam
Date: Thu Jan 8 18:34:19 2009
New Revision: 186910
URL: http://svn.freebsd.org/changeset/base/186910
Log:
mfc ath hal source code
Added:
stable/7/sys/dev/ath/ath_hal/ (props changed)
- copied from r186909, head/sys/dev/ath/ath_hal/
From piso at FreeBSD.org Thu Jan 8 22:32:37 2009
From: piso at FreeBSD.org (Paolo Pisati)
Date: Thu Jan 8 22:32:49 2009
Subject: svn commit: r186915 - stable/7/sbin/ipfw
Message-ID: <200901082232.n08MWaqw035249@svn.freebsd.org>
Author: piso
Date: Thu Jan 8 22:32:35 2009
New Revision: 186915
URL: http://svn.freebsd.org/changeset/base/186915
Log:
MFC r186297 and r186298:
Honor the quiet (-q) option while adding a nat rule.
Modified:
stable/7/sbin/ipfw/ (props changed)
stable/7/sbin/ipfw/ipfw.8
stable/7/sbin/ipfw/ipfw2.c
Modified: stable/7/sbin/ipfw/ipfw.8
==============================================================================
--- stable/7/sbin/ipfw/ipfw.8 Thu Jan 8 21:46:55 2009 (r186914)
+++ stable/7/sbin/ipfw/ipfw.8 Thu Jan 8 22:32:35 2009 (r186915)
@@ -65,6 +65,7 @@
.Op Ar number ...
.Pp
.Nm
+.Op Fl q
.Cm nat
.Ar number
.Cm config
@@ -231,6 +232,7 @@ Try to resolve addresses and service nam
.It Fl q
While
.Cm add Ns ing ,
+.Cm nat Ns ing ,
.Cm zero Ns ing ,
.Cm resetlog Ns ging
or
Modified: stable/7/sbin/ipfw/ipfw2.c
==============================================================================
--- stable/7/sbin/ipfw/ipfw2.c Thu Jan 8 21:46:55 2009 (r186914)
+++ stable/7/sbin/ipfw/ipfw2.c Thu Jan 8 22:32:35 2009 (r186915)
@@ -4067,10 +4067,12 @@ config_nat(int ac, char **av)
if (i)
err(1, "setsockopt(%s)", "IP_FW_NAT_CFG");
- /* After every modification, we show the resultant rule. */
- int _ac = 3;
- char *_av[] = {"show", "config", id};
- show_nat(_ac, _av);
+ if (!do_quiet) {
+ /* After every modification, we show the resultant rule. */
+ int _ac = 3;
+ char *_av[] = {"show", "config", id};
+ show_nat(_ac, _av);
+ }
}
static void
From murray at FreeBSD.org Fri Jan 9 03:42:43 2009
From: murray at FreeBSD.org (Murray Stokely)
Date: Fri Jan 9 03:43:01 2009
Subject: svn commit: r186920 - in stable/7: lib/libfetch usr.bin/fetch
Message-ID: <200901090342.n093gfug041855@svn.freebsd.org>
Author: murray
Date: Fri Jan 9 03:42:41 2009
New Revision: 186920
URL: http://svn.freebsd.org/changeset/base/186920
Log:
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.
_M usr.bin/fetch
M usr.bin/fetch/fetch.1
M usr.bin/fetch/fetch.c
_M lib/libfetch
M lib/libfetch/fetch.h
M lib/libfetch/http.c
M lib/libfetch/fetch.3
M lib/libfetch/fetch.c
Modified:
stable/7/lib/libfetch/ (props changed)
stable/7/lib/libfetch/fetch.3
stable/7/lib/libfetch/fetch.c
stable/7/lib/libfetch/fetch.h
stable/7/lib/libfetch/http.c
stable/7/usr.bin/fetch/ (props changed)
stable/7/usr.bin/fetch/fetch.1
stable/7/usr.bin/fetch/fetch.c
Modified: stable/7/lib/libfetch/fetch.3
==============================================================================
--- stable/7/lib/libfetch/fetch.3 Fri Jan 9 02:31:51 2009 (r186919)
+++ stable/7/lib/libfetch/fetch.3 Fri Jan 9 03:42:41 2009 (r186920)
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 18, 2007
+.Dd December 14, 2008
.Dt FETCH 3
.Os
.Sh NAME
@@ -165,9 +165,16 @@ struct url {
char *doc;
off_t offset;
size_t length;
+ time_t ims_time;
};
.Ed
.Pp
+The
+.Va ims_time
+field stores the time value for
+.Li If-Modified-Since
+HTTP requests.
+.Pp
The pointer returned by
.Fn fetchMakeURL
or
@@ -353,6 +360,22 @@ and
.Fn fetchPutHTTP
will use a direct connection even if a proxy server is defined.
.Pp
+If the
+.Ql i
+(if-modified-since) flag is specified, and
+the
+.Va ims_time
+field is set in
+.Vt "struct url" ,
+then
+.Fn fetchXGetHTTP
+and
+.Fn fetchGetHTTP
+will send a conditional
+.Li If-Modified-Since
+HTTP header to only fetch the content if it is newer than
+.Va ims_time .
+.Pp
Since there seems to be no good way of implementing the HTTP PUT
method in a manner consistent with the rest of the
.Nm fetch
Modified: stable/7/lib/libfetch/fetch.c
==============================================================================
--- stable/7/lib/libfetch/fetch.c Fri Jan 9 02:31:51 2009 (r186919)
+++ stable/7/lib/libfetch/fetch.c Fri Jan 9 03:42:41 2009 (r186920)
@@ -74,9 +74,7 @@ static struct fetcherr url_errlist[] = {
FILE *
fetchXGet(struct url *URL, struct url_stat *us, const char *flags)
{
- int direct;
- direct = CHECK_FLAG('d');
if (us != NULL) {
us->size = -1;
us->atime = us->mtime = 0;
@@ -110,9 +108,7 @@ fetchGet(struct url *URL, const char *fl
FILE *
fetchPut(struct url *URL, const char *flags)
{
- int direct;
- direct = CHECK_FLAG('d');
if (strcasecmp(URL->scheme, SCHEME_FILE) == 0)
return (fetchPutFile(URL, flags));
else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0)
@@ -132,9 +128,7 @@ fetchPut(struct url *URL, const char *fl
int
fetchStat(struct url *URL, struct url_stat *us, const char *flags)
{
- int direct;
- direct = CHECK_FLAG('d');
if (us != NULL) {
us->size = -1;
us->atime = us->mtime = 0;
@@ -158,9 +152,7 @@ fetchStat(struct url *URL, struct url_st
struct url_ent *
fetchList(struct url *URL, const char *flags)
{
- int direct;
- direct = CHECK_FLAG('d');
if (strcasecmp(URL->scheme, SCHEME_FILE) == 0)
return (fetchListFile(URL, flags));
else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0)
Modified: stable/7/lib/libfetch/fetch.h
==============================================================================
--- stable/7/lib/libfetch/fetch.h Fri Jan 9 02:31:51 2009 (r186919)
+++ stable/7/lib/libfetch/fetch.h Fri Jan 9 03:42:41 2009 (r186920)
@@ -46,6 +46,7 @@ struct url {
char *doc;
off_t offset;
size_t length;
+ time_t ims_time;
};
struct url_stat {
Modified: stable/7/lib/libfetch/http.c
==============================================================================
--- stable/7/lib/libfetch/http.c Fri Jan 9 02:31:51 2009 (r186919)
+++ stable/7/lib/libfetch/http.c Fri Jan 9 03:42:41 2009 (r186920)
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
#include
#include
+#include
#include
#include
@@ -92,6 +93,7 @@ __FBSDID("$FreeBSD$");
#define HTTP_MOVED_PERM 301
#define HTTP_MOVED_TEMP 302
#define HTTP_SEE_OTHER 303
+#define HTTP_NOT_MODIFIED 304
#define HTTP_TEMP_REDIRECT 307
#define HTTP_NEED_AUTH 401
#define HTTP_NEED_PROXY_AUTH 407
@@ -797,20 +799,23 @@ FILE *
http_request(struct url *URL, const char *op, struct url_stat *us,
struct url *purl, const char *flags)
{
+ char timebuf[80];
+ char hbuf[MAXHOSTNAMELEN + 7], *host;
conn_t *conn;
struct url *url, *new;
- int chunked, direct, need_auth, noredirect, verbose;
+ int chunked, direct, ims, need_auth, noredirect, verbose;
int e, i, n, val;
off_t offset, clength, length, size;
time_t mtime;
const char *p;
FILE *f;
hdr_t h;
- char hbuf[MAXHOSTNAMELEN + 7], *host;
+ struct tm *timestruct;
direct = CHECK_FLAG('d');
noredirect = CHECK_FLAG('A');
verbose = CHECK_FLAG('v');
+ ims = CHECK_FLAG('i');
if (direct && purl) {
fetchFreeURL(purl);
@@ -879,6 +884,14 @@ http_request(struct url *URL, const char
op, url->doc);
}
+ if (ims && url->ims_time) {
+ timestruct = gmtime((time_t *)&url->ims_time);
+ (void)strftime(timebuf, 80, "%a, %d %b %Y %T GMT",
+ timestruct);
+ if (verbose)
+ fetch_info("If-Modified-Since: %s", timebuf);
+ http_cmd(conn, "If-Modified-Since: %s", timebuf);
+ }
/* virtual host */
http_cmd(conn, "Host: %s", host);
@@ -940,6 +953,7 @@ http_request(struct url *URL, const char
switch (http_get_reply(conn)) {
case HTTP_OK:
case HTTP_PARTIAL:
+ case HTTP_NOT_MODIFIED:
/* fine */
break;
case HTTP_MOVED_PERM:
@@ -1074,7 +1088,10 @@ http_request(struct url *URL, const char
}
/* we have a hit or an error */
- if (conn->err == HTTP_OK || conn->err == HTTP_PARTIAL || HTTP_ERROR(conn->err))
+ if (conn->err == HTTP_OK
+ || conn->err == HTTP_NOT_MODIFIED
+ || conn->err == HTTP_PARTIAL
+ || HTTP_ERROR(conn->err))
break;
/* all other cases: we got a redirect */
@@ -1102,6 +1119,11 @@ http_request(struct url *URL, const char
(long long)offset, (long long)length,
(long long)size, (long long)clength));
+ if (conn->err == HTTP_NOT_MODIFIED) {
+ http_seterr(HTTP_NOT_MODIFIED);
+ return (NULL);
+ }
+
/* check for inconsistencies */
if (clength != -1 && length != -1 && clength != length) {
http_seterr(HTTP_PROTOCOL_ERROR);
Modified: stable/7/usr.bin/fetch/fetch.1
==============================================================================
--- stable/7/usr.bin/fetch/fetch.1 Fri Jan 9 02:31:51 2009 (r186919)
+++ stable/7/usr.bin/fetch/fetch.1 Fri Jan 9 03:42:41 2009 (r186920)
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 11, 2003
+.Dd December 14, 2008
.Dt FETCH 1
.Os
.Sh NAME
@@ -37,17 +37,25 @@
.Nd retrieve a file by Uniform Resource Locator
.Sh SYNOPSIS
.Nm
-.Op Fl 146AFMPRUadlmnpqrsv
+.Op Fl 146AadFlMmnPpqRrsUv
.Op Fl B Ar bytes
+.Op Fl i Ar file
+.Op Fl N Ar file
+.Op Fl o Ar file
.Op Fl S Ar bytes
.Op Fl T Ar seconds
+.Op Fl w Ar seconds
+.Ar URL ...
+.Nm
+.Op Fl 146AadFlMmnPpqRrsUv
+.Op Fl B Ar bytes
+.Op Fl i Ar file
.Op Fl N Ar file
.Op Fl o Ar file
+.Op Fl S Ar bytes
+.Op Fl T Ar seconds
.Op Fl w Ar seconds
-.Op Fl h Ar host
-.Op Fl c Ar dir
-.Op Fl f Ar file
-.Op Ar URL ...
+.Fl h Ar host Fl f Ar file Oo Fl c Ar dir Oc
.Sh DESCRIPTION
The
.Nm
@@ -59,7 +67,7 @@ command line.
.Pp
The following options are available:
.Bl -tag -width Fl
-.It Fl \&1
+.It Fl 1
Stop and return exit code 0 at the first successfully retrieved file.
.It Fl 4
Forces
@@ -110,6 +118,12 @@ The file to retrieve is located on the h
.Ar host .
This option is deprecated and is provided for backward compatibility
only.
+.It Fl i Ar file
+If-Modified-Since mode: the remote file will only be retrieved if it
+is newer than
+.Ar file
+on the local host.
+(HTTP only)
.It Fl l
If the target is a file-scheme URL, make a symbolic link to the target
rather than trying to copy it.
@@ -243,6 +257,12 @@ If multiple URLs are listed on the comma
.Nm
will attempt to retrieve each one of them in turn, and will return
zero only if they were all successfully retrieved.
+.Pp
+If the
+.Fl i
+argument is used and the remote file is not newer than the
+specified file then the command will still return success,
+although no file is transferred.
.Sh SEE ALSO
.Xr fetch 3
.Sh HISTORY
Modified: stable/7/usr.bin/fetch/fetch.c
==============================================================================
--- stable/7/usr.bin/fetch/fetch.c Fri Jan 9 02:31:51 2009 (r186919)
+++ stable/7/usr.bin/fetch/fetch.c Fri Jan 9 03:42:41 2009 (r186920)
@@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
-#include
#include
#include
@@ -60,6 +59,8 @@ int d_flag; /* -d: direct connection
int F_flag; /* -F: restart without checking mtime */
char *f_filename; /* -f: file to fetch */
char *h_hostname; /* -h: host to fetch from */
+int i_flag; /* -i: specify input file for mtime comparison */
+char *i_filename; /* name of input file */
int l_flag; /* -l: link rather than copy file: URLs */
int m_flag; /* -[Mm]: mirror mode */
char *N_filename; /* -N: netrc file name */
@@ -381,6 +382,14 @@ fetch(char *URL, const char *path)
if (A_flag)
strcat(flags, "A");
timeout = T_secs ? T_secs : http_timeout;
+ if (i_flag) {
+ if (stat(i_filename, &sb)) {
+ warn("%s: stat()", i_filename);
+ goto failure;
+ }
+ url->ims_time = sb.st_mtime;
+ strcat(flags, "i");
+ }
}
/* set the protocol timeout. */
@@ -448,7 +457,14 @@ fetch(char *URL, const char *path)
goto signal;
if (f == NULL) {
warnx("%s: %s", URL, fetchLastErrString);
- goto failure;
+ if (i_flag && strcmp(url->scheme, SCHEME_HTTP) == 0
+ && fetchLastErrCode == FETCH_OK
+ && strcmp(fetchLastErrString, "Not Modified") == 0) {
+ /* HTTP Not Modified Response, return OK. */
+ r = 0;
+ goto done;
+ } else
+ goto failure;
}
if (sigint)
goto signal;
@@ -710,10 +726,11 @@ fetch(char *URL, const char *path)
static void
usage(void)
{
- fprintf(stderr, "%s\n%s\n%s\n",
- "usage: fetch [-146AFMPRUadlmnpqrsv] [-N netrc] [-o outputfile]",
- " [-S bytes] [-B bytes] [-T seconds] [-w seconds]",
- " [-h host -f file [-c dir] | URL ...]");
+ fprintf(stderr, "%s\n%s\n%s\n%s\n",
+"usage: fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [-N file] [-o file] [-S bytes]",
+" [-T seconds] [-w seconds] [-i file] URL ...",
+" fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [-N file] [-o file] [-S bytes]",
+" [-T seconds] [-w seconds] [-i file] -h host -f file [-c dir]");
}
@@ -730,7 +747,7 @@ main(int argc, char *argv[])
int c, e, r;
while ((c = getopt(argc, argv,
- "146AaB:bc:dFf:Hh:lMmN:nPpo:qRrS:sT:tUvw:")) != -1)
+ "146AaB:bc:dFf:Hh:i:lMmN:nPpo:qRrS:sT:tUvw:")) != -1)
switch (c) {
case '1':
once_flag = 1;
@@ -775,6 +792,10 @@ main(int argc, char *argv[])
case 'h':
h_hostname = optarg;
break;
+ case 'i':
+ i_flag = 1;
+ i_filename = optarg;
+ break;
case 'l':
l_flag = 1;
break;
@@ -842,7 +863,7 @@ main(int argc, char *argv[])
break;
default:
usage();
- exit(EX_USAGE);
+ exit(1);
}
argc -= optind;
@@ -851,7 +872,7 @@ main(int argc, char *argv[])
if (h_hostname || f_filename || c_dirname) {
if (!h_hostname || !f_filename || argc) {
usage();
- exit(EX_USAGE);
+ exit(1);
}
/* XXX this is a hack. */
if (strcspn(h_hostname, "@:/") != strlen(h_hostname))
@@ -864,7 +885,7 @@ main(int argc, char *argv[])
if (!argc) {
usage();
- exit(EX_USAGE);
+ exit(1);
}
/* allocate buffer */
@@ -905,10 +926,10 @@ main(int argc, char *argv[])
} else if (stat(o_filename, &sb) == -1) {
if (errno == ENOENT) {
if (argc > 1)
- errx(EX_USAGE, "%s is not a directory",
+ errx(1, "%s is not a directory",
o_filename);
} else {
- err(EX_IOERR, "%s", o_filename);
+ err(1, "%s", o_filename);
}
} else {
if (sb.st_mode & S_IFDIR)
From kib at FreeBSD.org Fri Jan 9 11:09:59 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Fri Jan 9 11:10:07 2009
Subject: svn commit: r186936 - in stable/7/sys: . amd64/amd64 amd64/linux32
arm/arm compat/ia32 compat/svr4 contrib/pf dev/cxgb i386/i386
i386/ibcs2 i386/linux ia64/ia64 kern powerpc/powerpc sparc64/sparc64
Message-ID: <200901091109.n09B9v5V054804@svn.freebsd.org>
Author: kib
Date: Fri Jan 9 11:09:57 2009
New Revision: 186936
URL: http://svn.freebsd.org/changeset/base/186936
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/elf_machdep.c
stable/7/sys/amd64/linux32/linux32_sysvec.c
stable/7/sys/arm/arm/elf_machdep.c
stable/7/sys/compat/ia32/ia32_sysvec.c
stable/7/sys/compat/svr4/svr4_sysvec.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/i386/i386/elf_machdep.c
stable/7/sys/i386/ibcs2/ibcs2_sysvec.c
stable/7/sys/i386/linux/linux_sysvec.c
stable/7/sys/ia64/ia64/elf_machdep.c
stable/7/sys/kern/imgact_aout.c
stable/7/sys/kern/init_main.c
stable/7/sys/powerpc/powerpc/elf_machdep.c
stable/7/sys/sparc64/sparc64/elf_machdep.c
Modified: stable/7/sys/amd64/amd64/elf_machdep.c
==============================================================================
--- stable/7/sys/amd64/amd64/elf_machdep.c Fri Jan 9 10:58:59 2009 (r186935)
+++ stable/7/sys/amd64/amd64/elf_machdep.c Fri Jan 9 11:09:57 2009 (r186936)
@@ -46,59 +46,60 @@ __FBSDID("$FreeBSD$");
#include
struct sysentvec elf64_freebsd_sysvec = {
- SYS_MAXSYSCALL,
- sysent,
- 0,
- 0,
- NULL,
- 0,
- NULL,
- NULL,
- __elfN(freebsd_fixup),
- sendsig,
- sigcode,
- &szsigcode,
- NULL,
- "FreeBSD ELF64",
- __elfN(coredump),
- NULL,
- MINSIGSTKSZ,
- PAGE_SIZE,
- VM_MIN_ADDRESS,
- VM_MAXUSER_ADDRESS,
- USRSTACK,
- PS_STRINGS,
- VM_PROT_ALL,
- exec_copyout_strings,
- exec_setregs,
- NULL
+ .sv_size = SYS_MAXSYSCALL,
+ .sv_table = sysent,
+ .sv_mask = 0,
+ .sv_sigsize = 0,
+ .sv_sigtbl = NULL,
+ .sv_errsize = 0,
+ .sv_errtbl = NULL,
+ .sv_transtrap = NULL,
+ .sv_fixup = __elfN(freebsd_fixup),
+ .sv_sendsig = sendsig,
+ .sv_sigcode = sigcode,
+ .sv_szsigcode = &szsigcode,
+ .sv_prepsyscall = NULL,
+ .sv_name = "FreeBSD ELF64",
+ .sv_coredump = __elfN(coredump),
+ .sv_imgact_try = NULL,
+ .sv_minsigstksz = MINSIGSTKSZ,
+ .sv_pagesize = PAGE_SIZE,
+ .sv_minuser = VM_MIN_ADDRESS,
+ .sv_maxuser = VM_MAXUSER_ADDRESS,
+ .sv_usrstack = USRSTACK,
+ .sv_psstrings = PS_STRINGS,
+ .sv_stackprot = VM_PROT_ALL,
+ .sv_copyout_strings = exec_copyout_strings,
+ .sv_setregs = exec_setregs,
+ .sv_fixlimit = NULL,
+ .sv_maxssiz = NULL
};
static Elf64_Brandinfo freebsd_brand_info = {
- ELFOSABI_FREEBSD,
- EM_X86_64,
- "FreeBSD",
- NULL,
- "/libexec/ld-elf.so.1",
- &elf64_freebsd_sysvec,
- NULL,
- BI_CAN_EXEC_DYN,
- };
+ .brand = ELFOSABI_FREEBSD,
+ .machine = EM_X86_64,
+ .compat_3_brand = "FreeBSD",
+ .emul_path = NULL,
+ .interp_path = "/libexec/ld-elf.so.1",
+ .sysvec = &elf64_freebsd_sysvec,
+ .interp_newpath = NULL,
+ .flags = BI_CAN_EXEC_DYN,
+};
SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
(sysinit_cfunc_t) elf64_insert_brand_entry,
&freebsd_brand_info);
static Elf64_Brandinfo freebsd_brand_oinfo = {
- ELFOSABI_FREEBSD,
- EM_X86_64,
- "FreeBSD",
- NULL,
- "/usr/libexec/ld-elf.so.1",
- &elf64_freebsd_sysvec,
- NULL,
- BI_CAN_EXEC_DYN,
- };
+ .brand = ELFOSABI_FREEBSD,
+ .machine = EM_X86_64,
+ .compat_3_brand = "FreeBSD",
+ .emul_path = NULL,
+ .interp_path = "/usr/libexec/ld-elf.so.1",
+ .sysvec = &elf64_freebsd_sysvec,
+ .interp_newpath = NULL,
+ .flags = BI_CAN_EXEC_DYN,
+};
SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,
(sysinit_cfunc_t) elf64_insert_brand_entry,
Modified: stable/7/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/7/sys/amd64/linux32/linux32_sysvec.c Fri Jan 9 10:58:59 2009 (r186935)
+++ stable/7/sys/amd64/linux32/linux32_sysvec.c Fri Jan 9 11:09:57 2009 (r186936)
@@ -1001,62 +1001,62 @@ linux32_fixlimit(struct rlimit *rl, int
}
struct sysentvec elf_linux_sysvec = {
- LINUX_SYS_MAXSYSCALL,
- linux_sysent,
- 0,
- LINUX_SIGTBLSZ,
- bsd_to_linux_signal,
- ELAST + 1,
- bsd_to_linux_errno,
- translate_traps,
- elf_linux_fixup,
- linux_sendsig,
- linux_sigcode,
- &linux_szsigcode,
- linux_prepsyscall,
- "Linux ELF32",
- elf32_coredump,
- exec_linux_imgact_try,
- LINUX_MINSIGSTKSZ,
- PAGE_SIZE,
- VM_MIN_ADDRESS,
- LINUX32_USRSTACK,
- LINUX32_USRSTACK,
- LINUX32_PS_STRINGS,
- VM_PROT_ALL,
- linux_copyout_strings,
- exec_linux_setregs,
- linux32_fixlimit,
- &linux32_maxssiz,
+ .sv_size = LINUX_SYS_MAXSYSCALL,
+ .sv_table = linux_sysent,
+ .sv_mask = 0,
+ .sv_sigsize = LINUX_SIGTBLSZ,
+ .sv_sigtbl = bsd_to_linux_signal,
+ .sv_errsize = ELAST + 1,
+ .sv_errtbl = bsd_to_linux_errno,
+ .sv_transtrap = translate_traps,
+ .sv_fixup = elf_linux_fixup,
+ .sv_sendsig = linux_sendsig,
+ .sv_sigcode = linux_sigcode,
+ .sv_szsigcode = &linux_szsigcode,
+ .sv_prepsyscall = linux_prepsyscall,
+ .sv_name = "Linux ELF32",
+ .sv_coredump = elf32_coredump,
+ .sv_imgact_try = exec_linux_imgact_try,
+ .sv_minsigstksz = LINUX_MINSIGSTKSZ,
+ .sv_pagesize = PAGE_SIZE,
+ .sv_minuser = VM_MIN_ADDRESS,
+ .sv_maxuser = LINUX32_USRSTACK,
+ .sv_usrstack = LINUX32_USRSTACK,
+ .sv_psstrings = LINUX32_PS_STRINGS,
+ .sv_stackprot = VM_PROT_ALL,
+ .sv_copyout_strings = linux_copyout_strings,
+ .sv_setregs = exec_linux_setregs,
+ .sv_fixlimit = linux32_fixlimit,
+ .sv_maxssiz = &linux32_maxssiz,
};
static Elf32_Brandinfo linux_brand = {
- ELFOSABI_LINUX,
- EM_386,
- "Linux",
- "/compat/linux",
- "/lib/ld-linux.so.1",
- &elf_linux_sysvec,
- NULL,
- BI_CAN_EXEC_DYN,
- };
+ .brand = ELFOSABI_LINUX,
+ .machine = EM_386,
+ .compat_3_brand = "Linux",
+ .emul_path = "/compat/linux",
+ .interp_path = "/lib/ld-linux.so.1",
+ .sysvec = &elf_linux_sysvec,
+ .interp_newpath = NULL,
+ .flags = BI_CAN_EXEC_DYN,
+};
static Elf32_Brandinfo linux_glibc2brand = {
- ELFOSABI_LINUX,
- EM_386,
- "Linux",
- "/compat/linux",
- "/lib/ld-linux.so.2",
- &elf_linux_sysvec,
- NULL,
- BI_CAN_EXEC_DYN,
- };
+ .brand = ELFOSABI_LINUX,
+ .machine = EM_386,
+ .compat_3_brand = "Linux",
+ .emul_path = "/compat/linux",
+ .interp_path = "/lib/ld-linux.so.2",
+ .sysvec = &elf_linux_sysvec,
+ .interp_newpath = NULL,
+ .flags = BI_CAN_EXEC_DYN,
+};
Elf32_Brandinfo *linux_brandlist[] = {
- &linux_brand,
- &linux_glibc2brand,
- NULL
- };
+ &linux_brand,
+ &linux_glibc2brand,
+ NULL
+};
static int
linux_elf_modevent(module_t mod, int type, void *data)
Modified: stable/7/sys/arm/arm/elf_machdep.c
==============================================================================
--- stable/7/sys/arm/arm/elf_machdep.c Fri Jan 9 10:58:59 2009 (r186935)
+++ stable/7/sys/arm/arm/elf_machdep.c Fri Jan 9 11:09:57 2009 (r186936)
@@ -46,59 +46,60 @@ __FBSDID("$FreeBSD$");
#include
struct sysentvec elf32_freebsd_sysvec = {
- SYS_MAXSYSCALL,
- sysent,
- 0,
- 0,
- NULL,
- 0,
- NULL,
- NULL,
- __elfN(freebsd_fixup),
- sendsig,
- sigcode,
- &szsigcode,
- NULL,
- "FreeBSD ELF32",
- __elfN(coredump),
- NULL,
- MINSIGSTKSZ,
- PAGE_SIZE,
- VM_MIN_ADDRESS,
- VM_MAXUSER_ADDRESS,
- USRSTACK,
- PS_STRINGS,
- VM_PROT_ALL,
- exec_copyout_strings,
- exec_setregs,
- NULL
+ .sv_size = SYS_MAXSYSCALL,
+ .sv_table = sysent,
+ .sv_mask = 0,
+ .sv_sigsize = 0,
+ .sv_sigtbl = NULL,
+ .sv_errsize = 0,
+ .sv_errtbl = NULL,
+ .sv_transtrap = NULL,
+ .sv_fixup = __elfN(freebsd_fixup),
+ .sv_sendsig = sendsig,
+ .sv_sigcode = sigcode,
+ .sv_szsigcode = &szsigcode,
+ .sv_prepsyscall = NULL,
+ .sv_name = "FreeBSD ELF32",
+ .sv_coredump = __elfN(coredump),
+ .sv_imgact_try = NULL,
+ .sv_minsigstksz = MINSIGSTKSZ,
+ .sv_pagesize = PAGE_SIZE,
+ .sv_minuser = VM_MIN_ADDRESS,
+ .sv_maxuser = VM_MAXUSER_ADDRESS,
+ .sv_usrstack = USRSTACK,
+ .sv_psstrings = PS_STRINGS,
+ .sv_stackprot = VM_PROT_ALL,
+ .sv_copyout_strings = exec_copyout_strings,
+ .sv_setregs = exec_setregs,
+ .sv_fixlimit = NULL,
+ .sv_maxssiz = NULL
};
static Elf32_Brandinfo freebsd_brand_info = {
- ELFOSABI_FREEBSD,
- EM_ARM,
- "FreeBSD",
- NULL,
- "/libexec/ld-elf.so.1",
- &elf32_freebsd_sysvec,
- NULL,
- BI_CAN_EXEC_DYN,
- };
+ .brand = ELFOSABI_FREEBSD,
+ .machine = EM_ARM,
+ .compat_3_brand = "FreeBSD",
+ .emul_path = NULL,
+ .interp_path = "/libexec/ld-elf.so.1",
+ .sysvec = &elf32_freebsd_sysvec,
+ .interp_newpath = NULL,
+ .flags = BI_CAN_EXEC_DYN,
+};
SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
(sysinit_cfunc_t) elf32_insert_brand_entry,
&freebsd_brand_info);
static Elf32_Brandinfo freebsd_brand_oinfo = {
- ELFOSABI_FREEBSD,
- EM_ARM,
- "FreeBSD",
- NULL,
- "/usr/libexec/ld-elf.so.1",
- &elf32_freebsd_sysvec,
- NULL,
- BI_CAN_EXEC_DYN,
- };
+ .brand = ELFOSABI_FREEBSD,
+ .machine = EM_ARM,
+ .compat_3_brand = "FreeBSD",
+ .emul_path = NULL,
+ .interp_path = "/usr/libexec/ld-elf.so.1",
+ .sysvec = &elf32_freebsd_sysvec,
+ .interp_newpath = NULL,
+ .flags = BI_CAN_EXEC_DYN,
+};
SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY,
(sysinit_cfunc_t) elf32_insert_brand_entry,
Modified: stable/7/sys/compat/ia32/ia32_sysvec.c
==============================================================================
--- stable/7/sys/compat/ia32/ia32_sysvec.c Fri Jan 9 10:58:59 2009 (r186935)
+++ stable/7/sys/compat/ia32/ia32_sysvec.c Fri Jan 9 11:09:57 2009 (r186936)
@@ -111,61 +111,61 @@ SYSCTL_ULONG(_compat_ia32, OID_AUTO, max
TUNABLE_ULONG("compat.ia32.maxvmem", &ia32_maxvmem);
struct sysentvec ia32_freebsd_sysvec = {
- FREEBSD32_SYS_MAXSYSCALL,
- freebsd32_sysent,
- 0,
- 0,
- NULL,
- 0,
- NULL,
- NULL,
- elf32_freebsd_fixup,
- ia32_sendsig,
- ia32_sigcode,
- &sz_ia32_sigcode,
- NULL,
- "FreeBSD ELF32",
- elf32_coredump,
- NULL,
- MINSIGSTKSZ,
- IA32_PAGE_SIZE,
- 0,
- FREEBSD32_USRSTACK,
- FREEBSD32_USRSTACK,
- FREEBSD32_PS_STRINGS,
- VM_PROT_ALL,
- ia32_copyout_strings,
- ia32_setregs,
- ia32_fixlimit,
- &ia32_maxssiz
+ .sv_size = FREEBSD32_SYS_MAXSYSCALL,
+ .sv_table = freebsd32_sysent,
+ .sv_mask = 0,
+ .sv_sigsize = 0,
+ .sv_sigtbl = NULL,
+ .sv_errsize = 0,
+ .sv_errtbl = NULL,
+ .sv_transtrap = NULL,
+ .sv_fixup = elf32_freebsd_fixup,
+ .sv_sendsig = ia32_sendsig,
+ .sv_sigcode = ia32_sigcode,
+ .sv_szsigcode = &sz_ia32_sigcode,
+ .sv_prepsyscall = NULL,
+ .sv_name = "FreeBSD ELF32",
+ .sv_coredump = elf32_coredump,
+ .sv_imgact_try = NULL,
+ .sv_minsigstksz = MINSIGSTKSZ,
+ .sv_pagesize = IA32_PAGE_SIZE,
+ .sv_minuser = 0,
+ .sv_maxuser = FREEBSD32_USRSTACK,
+ .sv_usrstack = FREEBSD32_USRSTACK,
+ .sv_psstrings = FREEBSD32_PS_STRINGS,
+ .sv_stackprot = VM_PROT_ALL,
+ .sv_copyout_strings = ia32_copyout_strings,
+ .sv_setregs = ia32_setregs,
+ .sv_fixlimit = ia32_fixlimit,
+ .sv_maxssiz = &ia32_maxssiz
};
static Elf32_Brandinfo ia32_brand_info = {
- ELFOSABI_FREEBSD,
- EM_386,
- "FreeBSD",
- NULL,
- "/libexec/ld-elf.so.1",
- &ia32_freebsd_sysvec,
- "/libexec/ld-elf32.so.1",
- BI_CAN_EXEC_DYN,
- };
+ .brand = ELFOSABI_FREEBSD,
+ .machine = EM_386,
+ .compat_3_brand = "FreeBSD",
+ .emul_path = NULL,
+ .interp_path = "/libexec/ld-elf.so.1",
+ .sysvec = &ia32_freebsd_sysvec,
+ .interp_newpath = "/libexec/ld-elf32.so.1",
+ .flags = BI_CAN_EXEC_DYN
+};
SYSINIT(ia32, SI_SUB_EXEC, SI_ORDER_ANY,
(sysinit_cfunc_t) elf32_insert_brand_entry,
&ia32_brand_info);
static Elf32_Brandinfo ia32_brand_oinfo = {
- ELFOSABI_FREEBSD,
- EM_386,
- "FreeBSD",
- NULL,
- "/usr/libexec/ld-elf.so.1",
- &ia32_freebsd_sysvec,
- "/libexec/ld-elf32.so.1",
- BI_CAN_EXEC_DYN,
- };
+ .brand = ELFOSABI_FREEBSD,
+ .machine = EM_386,
+ .compat_3_brand = "FreeBSD",
+ .emul_path = NULL,
+ .interp_path = "/usr/libexec/ld-elf.so.1",
+ .sysvec = &ia32_freebsd_sysvec,
+ .interp_newpath = "/libexec/ld-elf32.so.1",
+ .flags = BI_CAN_EXEC_DYN,
+};
SYSINIT(oia32, SI_SUB_EXEC, SI_ORDER_ANY,
(sysinit_cfunc_t) elf32_insert_brand_entry,
Modified: stable/7/sys/compat/svr4/svr4_sysvec.c
==============================================================================
--- stable/7/sys/compat/svr4/svr4_sysvec.c Fri Jan 9 10:58:59 2009 (r186935)
+++ stable/7/sys/compat/svr4/svr4_sysvec.c Fri Jan 9 11:09:57 2009 (r186936)
@@ -167,44 +167,46 @@ extern int svr4_szsigcode;
extern char svr4_sigcode[];
struct sysentvec svr4_sysvec = {
- SVR4_SYS_MAXSYSCALL,
- svr4_sysent,
- 0xff,
- SVR4_NSIG-1, /* NB: signal trans table indexed with signno-1 */
- bsd_to_svr4_sig+1,
- ELAST, /* ELAST */
- bsd_to_svr4_errno,
- NULL,
- svr4_fixup,
- svr4_sendsig,
- svr4_sigcode,
- &svr4_szsigcode,
- NULL,
- "SVR4",
- elf32_coredump,
- NULL,
- SVR4_MINSIGSTKSZ,
- PAGE_SIZE,
- VM_MIN_ADDRESS,
- VM_MAXUSER_ADDRESS,
- USRSTACK,
- PS_STRINGS,
- VM_PROT_ALL,
- exec_copyout_strings,
- exec_setregs,
- NULL
+ .sv_size = SVR4_SYS_MAXSYSCALL,
+ .sv_table = svr4_sysent,
+ .sv_mask = 0xff,
+ .sv_sigsize = SVR4_NSIG-1, /* NB: signal trans table indexed with signno-1 */
+ .sv_sigtbl = bsd_to_svr4_sig+1,
+ .sv_errsize = ELAST, /* ELAST */
+ .sv_errtbl = bsd_to_svr4_errno,
+ .sv_transtrap = NULL,
+ .sv_fixup = svr4_fixup,
+ .sv_sendsig = svr4_sendsig,
+ .sv_sigcode = svr4_sigcode,
+ .sv_szsigcode = &svr4_szsigcode,
+ .sv_prepsyscall = NULL,
+ .sv_name = "SVR4",
+ .sv_coredump = elf32_coredump,
+ .sv_imgact_try = NULL,
+ .sv_minsigstksz = SVR4_MINSIGSTKSZ,
+ .sv_pagesize = PAGE_SIZE,
+ .sv_minuser = VM_MIN_ADDRESS,
+ .sv_maxuser = VM_MAXUSER_ADDRESS,
+ .sv_usrstack = USRSTACK,
+ .sv_psstrings = PS_STRINGS,
+ .sv_stackprot = VM_PROT_ALL,
+ .sv_copyout_strings = exec_copyout_strings,
+ .sv_setregs = exec_setregs,
+ .sv_fixlimit = NULL,
+ .sv_maxssiz = NULL
};
const char svr4_emul_path[] = "/compat/svr4";
Elf32_Brandinfo svr4_brand = {
- ELFOSABI_SYSV,
- EM_386, /* XXX only implemented for x86 so far. */
- "SVR4",
- svr4_emul_path,
- "/lib/libc.so.1",
- &svr4_sysvec,
- NULL,
+ .brand = ELFOSABI_SYSV,
+ .machine = EM_386, /* XXX only implemented for x86 so far. */
+ .compat_3_brand = "SVR4",
+ .emul_path = svr4_emul_path,
+ .interp_path = "/lib/libc.so.1",
+ .sysvec = &svr4_sysvec,
+ .interp_newpath = NULL,
+ .flags = 0
};
static int
Modified: stable/7/sys/i386/i386/elf_machdep.c
==============================================================================
--- stable/7/sys/i386/i386/elf_machdep.c Fri Jan 9 10:58:59 2009 (r186935)
+++ stable/7/sys/i386/i386/elf_machdep.c Fri Jan 9 11:09:57 2009 (r186936)
@@ -46,59 +46,60 @@ __FBSDID("$FreeBSD$");
#include
struct sysentvec elf32_freebsd_sysvec = {
- SYS_MAXSYSCALL,
- sysent,
- 0,
- 0,
- NULL,
- 0,
- NULL,
- NULL,
- __elfN(freebsd_fixup),
- sendsig,
- sigcode,
- &szsigcode,
- NULL,
- "FreeBSD ELF32",
- __elfN(coredump),
- NULL,
- MINSIGSTKSZ,
- PAGE_SIZE,
- VM_MIN_ADDRESS,
- VM_MAXUSER_ADDRESS,
- USRSTACK,
- PS_STRINGS,
- VM_PROT_ALL,
- exec_copyout_strings,
- exec_setregs,
- NULL
+ .sv_size = SYS_MAXSYSCALL,
+ .sv_table = sysent,
+ .sv_mask = 0,
+ .sv_sigsize = 0,
+ .sv_sigtbl = NULL,
+ .sv_errsize = 0,
+ .sv_errtbl = NULL,
+ .sv_transtrap = NULL,
+ .sv_fixup = __elfN(freebsd_fixup),
+ .sv_sendsig = sendsig,
+ .sv_sigcode = sigcode,
+ .sv_szsigcode = &szsigcode,
+ .sv_prepsyscall = NULL,
+ .sv_name = "FreeBSD ELF32",
+ .sv_coredump = __elfN(coredump),
+ .sv_imgact_try = NULL,
+ .sv_minsigstksz = MINSIGSTKSZ,
+ .sv_pagesize = PAGE_SIZE,
+ .sv_minuser = VM_MIN_ADDRESS,
+ .sv_maxuser = VM_MAXUSER_ADDRESS,
+ .sv_usrstack = USRSTACK,
+ .sv_psstrings = PS_STRINGS,
+ .sv_stackprot = VM_PROT_ALL,
+ .sv_copyout_strings = exec_copyout_strings,
+ .sv_setregs = exec_setregs,
+ .sv_fixlimit = NULL,
+ .sv_maxssiz = NULL
};
static Elf32_Brandinfo freebsd_brand_info = {
- ELFOSABI_FREEBSD,
- EM_386,
- "FreeBSD",
- NULL,
- "/libexec/ld-elf.so.1",
- &elf32_freebsd_sysvec,
- NULL,
- BI_CAN_EXEC_DYN,
- };
+ .brand = ELFOSABI_FREEBSD,
+ .machine = EM_386,
+ .compat_3_brand = "FreeBSD",
+ .emul_path = NULL,
+ .interp_path = "/libexec/ld-elf.so.1",
+ .sysvec = &elf32_freebsd_sysvec,
+ .interp_newpath = NULL,
+ .flags = BI_CAN_EXEC_DYN,
+};
SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
(sysinit_cfunc_t) elf32_insert_brand_entry,
&freebsd_brand_info);
static Elf32_Brandinfo freebsd_brand_oinfo = {
- ELFOSABI_FREEBSD,
- EM_386,
- "FreeBSD",
- NULL,
- "/usr/libexec/ld-elf.so.1",
- &elf32_freebsd_sysvec,
- NULL,
- BI_CAN_EXEC_DYN,
- };
+ .brand = ELFOSABI_FREEBSD,
+ .machine = EM_386,
+ .compat_3_brand = "FreeBSD",
+ .emul_path = NULL,
+ .interp_path = "/usr/libexec/ld-elf.so.1",
+ .sysvec = &elf32_freebsd_sysvec,
+ .interp_newpath = NULL,
+ .flags = BI_CAN_EXEC_DYN,
+};
SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY,
(sysinit_cfunc_t) elf32_insert_brand_entry,
Modified: stable/7/sys/i386/ibcs2/ibcs2_sysvec.c
==============================================================================
--- stable/7/sys/i386/ibcs2/ibcs2_sysvec.c Fri Jan 9 10:58:59 2009 (r186935)
+++ stable/7/sys/i386/ibcs2/ibcs2_sysvec.c Fri Jan 9 11:09:57 2009 (r186936)
@@ -59,32 +59,33 @@ extern char sigcode[];
static int ibcs2_fixup(register_t **, struct image_params *);
struct sysentvec ibcs2_svr3_sysvec = {
- sizeof (ibcs2_sysent) / sizeof (ibcs2_sysent[0]),
- ibcs2_sysent,
- 0xFF,
- IBCS2_SIGTBLSZ,
- bsd_to_ibcs2_sig,
- ELAST + 1,
- bsd_to_ibcs2_errno,
- NULL, /* trap-to-signal translation function */
- ibcs2_fixup, /* fixup */
- sendsig,
- sigcode, /* use generic trampoline */
- &szsigcode, /* use generic trampoline size */
- NULL, /* prepsyscall */
- "IBCS2 COFF",
- NULL, /* we don't have a COFF coredump function */
- NULL,
- IBCS2_MINSIGSTKSZ,
- PAGE_SIZE,
- VM_MIN_ADDRESS,
- VM_MAXUSER_ADDRESS,
- USRSTACK,
- PS_STRINGS,
- VM_PROT_ALL,
- exec_copyout_strings,
- exec_setregs,
- NULL
+ .sv_size = sizeof (ibcs2_sysent) / sizeof (ibcs2_sysent[0]),
+ .sv_table = ibcs2_sysent,
+ .sv_mask = 0xff,
+ .sv_sigsize = IBCS2_SIGTBLSZ,
+ .sv_sigtbl = bsd_to_ibcs2_sig,
+ .sv_errsize = ELAST + 1,
+ .sv_errtbl = bsd_to_ibcs2_errno,
+ .sv_transtrap = NULL,
+ .sv_fixup = ibcs2_fixup,
+ .sv_sendsig = sendsig,
+ .sv_sigcode = sigcode, /* use generic trampoline */
+ .sv_szsigcode = &szsigcode,
+ .sv_prepsyscall = NULL,
+ .sv_name = "IBCS2 COFF",
+ .sv_coredump = NULL, /* we don't have a COFF coredump function */
+ .sv_imgact_try = NULL,
+ .sv_minsigstksz = IBCS2_MINSIGSTKSZ,
+ .sv_pagesize = PAGE_SIZE,
+ .sv_minuser = VM_MIN_ADDRESS,
+ .sv_maxuser = VM_MAXUSER_ADDRESS,
+ .sv_usrstack = USRSTACK,
+ .sv_psstrings = PS_STRINGS,
+ .sv_stackprot = VM_PROT_ALL,
+ .sv_copyout_strings = exec_copyout_strings,
+ .sv_setregs = exec_setregs,
+ .sv_fixlimit = NULL,
+ .sv_maxssiz = NULL
};
static int
Modified: stable/7/sys/i386/linux/linux_sysvec.c
==============================================================================
--- stable/7/sys/i386/linux/linux_sysvec.c Fri Jan 9 10:58:59 2009 (r186935)
+++ stable/7/sys/i386/linux/linux_sysvec.c Fri Jan 9 11:09:57 2009 (r186936)
@@ -813,90 +813,92 @@ exec_linux_setregs(struct thread *td, u_
}
struct sysentvec linux_sysvec = {
- LINUX_SYS_MAXSYSCALL,
- linux_sysent,
- 0,
- LINUX_SIGTBLSZ,
- bsd_to_linux_signal,
- ELAST + 1,
- bsd_to_linux_errno,
- translate_traps,
- linux_fixup,
- linux_sendsig,
- linux_sigcode,
- &linux_szsigcode,
- linux_prepsyscall,
- "Linux a.out",
- NULL,
- exec_linux_imgact_try,
- LINUX_MINSIGSTKSZ,
- PAGE_SIZE,
- VM_MIN_ADDRESS,
- VM_MAXUSER_ADDRESS,
- USRSTACK,
- PS_STRINGS,
- VM_PROT_ALL,
- exec_copyout_strings,
- exec_linux_setregs,
- NULL
+ .sv_size = LINUX_SYS_MAXSYSCALL,
+ .sv_table = linux_sysent,
+ .sv_mask = 0,
+ .sv_sigsize = LINUX_SIGTBLSZ,
+ .sv_sigtbl = bsd_to_linux_signal,
+ .sv_errsize = ELAST + 1,
+ .sv_errtbl = bsd_to_linux_errno,
+ .sv_transtrap = translate_traps,
+ .sv_fixup = linux_fixup,
+ .sv_sendsig = linux_sendsig,
+ .sv_sigcode = linux_sigcode,
+ .sv_szsigcode = &linux_szsigcode,
+ .sv_prepsyscall = linux_prepsyscall,
+ .sv_name = "Linux a.out",
+ .sv_coredump = NULL,
+ .sv_imgact_try = exec_linux_imgact_try,
+ .sv_minsigstksz = LINUX_MINSIGSTKSZ,
+ .sv_pagesize = PAGE_SIZE,
+ .sv_minuser = VM_MIN_ADDRESS,
+ .sv_maxuser = VM_MAXUSER_ADDRESS,
+ .sv_usrstack = USRSTACK,
+ .sv_psstrings = PS_STRINGS,
+ .sv_stackprot = VM_PROT_ALL,
+ .sv_copyout_strings = exec_copyout_strings,
+ .sv_setregs = exec_linux_setregs,
+ .sv_fixlimit = NULL,
+ .sv_maxssiz = NULL
};
struct sysentvec elf_linux_sysvec = {
- LINUX_SYS_MAXSYSCALL,
- linux_sysent,
- 0,
- LINUX_SIGTBLSZ,
- bsd_to_linux_signal,
- ELAST + 1,
- bsd_to_linux_errno,
- translate_traps,
- elf_linux_fixup,
- linux_sendsig,
- linux_sigcode,
- &linux_szsigcode,
- linux_prepsyscall,
- "Linux ELF",
- elf32_coredump,
- exec_linux_imgact_try,
- LINUX_MINSIGSTKSZ,
- PAGE_SIZE,
- VM_MIN_ADDRESS,
- VM_MAXUSER_ADDRESS,
- USRSTACK,
- PS_STRINGS,
- VM_PROT_ALL,
- exec_copyout_strings,
- exec_linux_setregs,
- NULL
+ .sv_size = LINUX_SYS_MAXSYSCALL,
+ .sv_table = linux_sysent,
+ .sv_mask = 0,
+ .sv_sigsize = LINUX_SIGTBLSZ,
+ .sv_sigtbl = bsd_to_linux_signal,
+ .sv_errsize = ELAST + 1,
+ .sv_errtbl = bsd_to_linux_errno,
+ .sv_transtrap = translate_traps,
+ .sv_fixup = elf_linux_fixup,
+ .sv_sendsig = linux_sendsig,
+ .sv_sigcode = linux_sigcode,
+ .sv_szsigcode = &linux_szsigcode,
+ .sv_prepsyscall = linux_prepsyscall,
+ .sv_name = "Linux ELF",
+ .sv_coredump = elf32_coredump,
+ .sv_imgact_try = exec_linux_imgact_try,
+ .sv_minsigstksz = LINUX_MINSIGSTKSZ,
+ .sv_pagesize = PAGE_SIZE,
+ .sv_minuser = VM_MIN_ADDRESS,
+ .sv_maxuser = VM_MAXUSER_ADDRESS,
+ .sv_usrstack = USRSTACK,
+ .sv_psstrings = PS_STRINGS,
+ .sv_stackprot = VM_PROT_ALL,
+ .sv_copyout_strings = exec_copyout_strings,
+ .sv_setregs = exec_linux_setregs,
+ .sv_fixlimit = NULL,
+ .sv_maxssiz = NULL
};
static Elf32_Brandinfo linux_brand = {
- ELFOSABI_LINUX,
- EM_386,
- "Linux",
- "/compat/linux",
- "/lib/ld-linux.so.1",
- &elf_linux_sysvec,
- NULL,
- BI_CAN_EXEC_DYN,
- };
+ .brand = ELFOSABI_LINUX,
+ .machine = EM_386,
+ .compat_3_brand = "Linux",
+ .emul_path = "/compat/linux",
+ .interp_path = "/lib/ld-linux.so.1",
+ .sysvec = &elf_linux_sysvec,
+ .interp_newpath = NULL,
+ .flags = BI_CAN_EXEC_DYN,
+};
static Elf32_Brandinfo linux_glibc2brand = {
- ELFOSABI_LINUX,
- EM_386,
- "Linux",
- "/compat/linux",
- "/lib/ld-linux.so.2",
- &elf_linux_sysvec,
- NULL,
- BI_CAN_EXEC_DYN,
- };
+ .brand = ELFOSABI_LINUX,
+ .machine = EM_386,
+ .compat_3_brand = "Linux",
+ .emul_path = "/compat/linux",
+ .interp_path = "/lib/ld-linux.so.2",
+ .sysvec = &elf_linux_sysvec,
+ .interp_newpath = NULL,
+ .flags = BI_CAN_EXEC_DYN,
+};
Elf32_Brandinfo *linux_brandlist[] = {
- &linux_brand,
- &linux_glibc2brand,
- NULL
- };
+ &linux_brand,
+ &linux_glibc2brand,
+ NULL
+};
static int
linux_elf_modevent(module_t mod, int type, void *data)
Modified: stable/7/sys/ia64/ia64/elf_machdep.c
==============================================================================
--- stable/7/sys/ia64/ia64/elf_machdep.c Fri Jan 9 10:58:59 2009 (r186935)
+++ stable/7/sys/ia64/ia64/elf_machdep.c Fri Jan 9 11:09:57 2009 (r186936)
@@ -54,56 +54,57 @@ Elf_Addr link_elf_get_gp(linker_file_t);
extern Elf_Addr fptr_storage[];
struct sysentvec elf64_freebsd_sysvec = {
- SYS_MAXSYSCALL,
- sysent,
- 0,
- 0,
- NULL,
- 0,
- NULL,
- NULL,
- __elfN(freebsd_fixup),
- sendsig,
- NULL, /* sigcode */
- NULL, /* &szsigcode */
- NULL,
- "FreeBSD ELF64",
- __elfN(coredump),
- NULL,
- MINSIGSTKSZ,
- PAGE_SIZE,
- VM_MIN_ADDRESS,
- VM_MAXUSER_ADDRESS,
- USRSTACK,
- PS_STRINGS,
- VM_PROT_READ|VM_PROT_WRITE,
- exec_copyout_strings,
- exec_setregs,
- NULL
+ .sv_size = SYS_MAXSYSCALL,
+ .sv_table = sysent,
+ .sv_mask = 0,
+ .sv_sigsize = 0,
+ .sv_sigtbl = NULL,
+ .sv_errsize = 0,
+ .sv_errtbl = NULL,
+ .sv_transtrap = NULL,
+ .sv_fixup = __elfN(freebsd_fixup),
+ .sv_sendsig = sendsig,
+ .sv_sigcode = NULL,
+ .sv_szsigcode = NULL,
+ .sv_prepsyscall = NULL,
+ .sv_name = "FreeBSD ELF64",
+ .sv_coredump = __elfN(coredump),
+ .sv_imgact_try = NULL,
+ .sv_minsigstksz = MINSIGSTKSZ,
+ .sv_pagesize = PAGE_SIZE,
+ .sv_minuser = VM_MIN_ADDRESS,
+ .sv_maxuser = VM_MAXUSER_ADDRESS,
+ .sv_usrstack = USRSTACK,
+ .sv_psstrings = PS_STRINGS,
+ .sv_stackprot = VM_PROT_READ|VM_PROT_WRITE,
+ .sv_copyout_strings = exec_copyout_strings,
+ .sv_setregs = exec_setregs,
+ .sv_fixlimit = NULL,
+ .sv_maxssiz = NULL
};
static Elf64_Brandinfo freebsd_brand_info = {
- ELFOSABI_FREEBSD,
- EM_IA_64,
- "FreeBSD",
- NULL,
- "/libexec/ld-elf.so.1",
- &elf64_freebsd_sysvec,
- NULL,
- BI_CAN_EXEC_DYN,
+ .brand = ELFOSABI_FREEBSD,
+ .machine = EM_IA_64,
+ .compat_3_brand = "FreeBSD",
+ .emul_path = NULL,
+ .interp_path = "/libexec/ld-elf.so.1",
+ .sysvec = &elf64_freebsd_sysvec,
+ .interp_newpath = NULL,
+ .flags = BI_CAN_EXEC_DYN,
};
SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
(sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info);
static Elf64_Brandinfo freebsd_brand_oinfo = {
- ELFOSABI_FREEBSD,
- EM_IA_64,
- "FreeBSD",
- NULL,
- "/usr/libexec/ld-elf.so.1",
- &elf64_freebsd_sysvec,
- NULL,
- BI_CAN_EXEC_DYN,
+ .brand = ELFOSABI_FREEBSD,
+ .machine = EM_IA_64,
+ .compat_3_brand = "FreeBSD",
+ .emul_path = NULL,
+ .interp_path = "/usr/libexec/ld-elf.so.1",
+ .sysvec = &elf64_freebsd_sysvec,
+ .interp_newpath = NULL,
+ .flags = BI_CAN_EXEC_DYN,
};
SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,
(sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo);
Modified: stable/7/sys/kern/imgact_aout.c
==============================================================================
--- stable/7/sys/kern/imgact_aout.c Fri Jan 9 10:58:59 2009 (r186935)
+++ stable/7/sys/kern/imgact_aout.c Fri Jan 9 11:09:57 2009 (r186936)
@@ -56,32 +56,33 @@ static int exec_aout_imgact(struct image
static int aout_fixup(register_t **stack_base, struct image_params *imgp);
struct sysentvec aout_sysvec = {
- SYS_MAXSYSCALL,
- sysent,
- 0,
- 0,
- NULL,
- 0,
- NULL,
- NULL,
- aout_fixup,
- sendsig,
- sigcode,
- &szsigcode,
- NULL,
- "FreeBSD a.out",
- NULL,
- NULL,
- MINSIGSTKSZ,
- PAGE_SIZE,
- VM_MIN_ADDRESS,
- VM_MAXUSER_ADDRESS,
- USRSTACK,
- PS_STRINGS,
- VM_PROT_ALL,
- exec_copyout_strings,
- exec_setregs,
- NULL
+ .sv_size = SYS_MAXSYSCALL,
+ .sv_table = sysent,
+ .sv_mask = 0,
+ .sv_sigsize = 0,
+ .sv_sigtbl = NULL,
+ .sv_errsize = 0,
+ .sv_errtbl = NULL,
+ .sv_transtrap = NULL,
+ .sv_fixup = aout_fixup,
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From dougb at FreeBSD.org Fri Jan 9 11:20:52 2009
From: dougb at FreeBSD.org (Doug Barton)
Date: Fri Jan 9 11:21:00 2009
Subject: svn commit: r186937 - stable/7/usr.sbin/mergemaster
Message-ID: <200901091120.n09BKpRX055098@svn.freebsd.org>
Author: dougb
Date: Fri Jan 9 11:20:51 2009
New Revision: 186937
URL: http://svn.freebsd.org/changeset/base/186937
Log:
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
Modified:
stable/7/usr.sbin/mergemaster/ (props changed)
stable/7/usr.sbin/mergemaster/mergemaster.8
stable/7/usr.sbin/mergemaster/mergemaster.sh
Modified: stable/7/usr.sbin/mergemaster/mergemaster.8
==============================================================================
--- stable/7/usr.sbin/mergemaster/mergemaster.8 Fri Jan 9 11:09:57 2009 (r186936)
+++ stable/7/usr.sbin/mergemaster/mergemaster.8 Fri Jan 9 11:20:51 2009 (r186937)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1998-2003 Douglas Barton
+.\" Copyright (c) 1998-2009 Douglas Barton
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 4, 2006
+.Dd January 2, 2009
.Dt MERGEMASTER 8
.Os
.Sh NAME
@@ -32,14 +32,14 @@
.Nd merge configuration files, et al during an upgrade
.Sh SYNOPSIS
.Nm
-.Op Fl scrvahipCPU
+.Op Fl achiprsvCPU
+.Op Fl A Ar Target architecture
+.Op Fl D Ar /destdir/path
.Op Fl m Ar /path/to/sources
.Op Fl t Ar /path/to/temp/root
.Op Fl d
.Op Fl u Ar N
.Op Fl w Ar N
-.Op Fl A Ar architecture
-.Op Fl D Ar /path
.Sh DESCRIPTION
The
.Nm
@@ -54,7 +54,7 @@ recommended that you back up your
directory before beginning this process.
.Pp
The script uses
-.Pa /usr/src/etc/Makefile
+.Pa /usr/src/Makefile
to build a temporary root environment from
.Pa /
down, populating that environment with the various
@@ -218,6 +218,14 @@ Specify the path to the directory where
.Xr make 1 .
(In other words, where your sources are, but -s was already
taken.)
+In previous versions of
+.Nm
+you needed to specify the path all the way to
+.Pa src/etc .
+Starting with r186678 you only need to specify the path to
+.Pa src .
+.Nm
+will convert the path for you if you use the old method.
.It Fl t Ar /path/to/temp/root
Create the temporary root environment in
.Pa /path/to/temp/root
@@ -236,7 +244,7 @@ Supply an alternate screen width to the
.Xr sdiff 1
command in numbers of columns.
The default is 80.
-.It Fl A Ar architecture
+.It Fl A Ar Target architecture
Specify an alternative
.Ev TARGET_ARCH
architecture name.
@@ -294,24 +302,33 @@ with all values commented out:
# These are options for mergemaster, with their default values listed
# The following options have command line overrides
#
+# The target architecture (unset by default)
+#ARCHSTRING='TARGET_ARCH='
+#
+# Sourcedir is the directory to do the 'make' in (where the new files are)
+#SOURCEDIR='/usr/src'
+#
# Directory to install the temporary root environment into
#TEMPROOT='/var/tmp/temproot'
#
+# Specify the destination directory for the installed files
+#DESTDIR=
+#
# Strict comparison bypasses the CVS $Id tests and compares every file
#STRICT=no
#
# Type of diff, such as unified, context, etc.
#DIFF_FLAG='-u'
#
-# Additional options for diff. This will get unset when using -s.
-#DIFF_OPTIONS='-I$\&FreeBSD:.*[$]' # Ignores CVS Id tags
-#
# Verbose mode includes more details and additional checks
#VERBOSE=
#
# Automatically install files that do not exist on the system already
#AUTO_INSTALL=
#
+# Automatically upgrade files that have not been user modified
+#AUTO_UPGRADE=
+#
# Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf
#COMP_CONFS=yes
#
@@ -319,25 +336,26 @@ with all values commented out:
#PRESERVE_FILES=yes
#PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S`
#
-# Sourcedir is the directory to do the 'make' in (where the new files are)
-#SOURCEDIR='/usr/src/etc'
-#
# The umask for mergemaster to compare the default file's modes to
#NEW_UMASK=022
#
-# Specify the destination directory for the installed files
-#DESTDIR=
-#
# The following options have no command line overrides
+#
+# Files to always avoid comparing
+#IGNORE_FILES='/etc/motd /etc/printcap foo bar'
+#
+# Additional options for diff. This will get unset when using -s.
+#DIFF_OPTIONS='-I$\&FreeBSD:.*[$]' # Ignores CVS Id tags
+#
+# Location to store the list of mtree values for AUTO_UPGRADE purposes
+#MTREEDB='/var/db'
+#
# For those who just cannot stand including the full path to PAGER
#DONT_CHECK_PAGER=
#
# If you set 'yes' above, make sure to include the PATH to your pager
#PATH=/bin:/usr/bin:/usr/sbin
#
-# Don't compare the old and new motd files
-#IGNORE_MOTD=yes
-#
# Specify the path to scripts to run before the comparison starts,
# and/or after the script has finished its work
#MM_PRE_COMPARE_SCRIPT=
@@ -354,6 +372,11 @@ Invalid command line option
Failure to create the temporary root environment
.Pp
Failure to populate the temporary root
+.Pp
+Presence of the 'nodev' option in
+.Pa /etc/fstab
+.Pp
+Failure to install a file
.Sh EXAMPLES
Typically all you will need to do is type
.Nm
Modified: stable/7/usr.sbin/mergemaster/mergemaster.sh
==============================================================================
--- stable/7/usr.sbin/mergemaster/mergemaster.sh Fri Jan 9 11:09:57 2009 (r186936)
+++ stable/7/usr.sbin/mergemaster/mergemaster.sh Fri Jan 9 11:20:51 2009 (r186937)
@@ -5,7 +5,7 @@
# Compare files created by /usr/src/etc/Makefile (or the directory
# the user specifies) with the currently installed copies.
-# Copyright 1998-2004 Douglas Barton
+# Copyright 1998-2009 Douglas Barton
# DougB@FreeBSD.org
# $FreeBSD$
@@ -244,10 +244,6 @@ press_to_continue () {
#
TEMPROOT='/var/tmp/temproot'
-# Assign the location of the mtree database
-#
-MTREEDB='/var/db/mergemaster.mtree'
-
# Read /etc/mergemaster.rc first so the one in $HOME can override
#
if [ -r /etc/mergemaster.rc ]; then
@@ -260,12 +256,17 @@ if [ -r "$HOME/.mergemasterrc" ]; then
. "$HOME/.mergemasterrc"
fi
+# Assign the location of the mtree database
+#
+MTREEDB=${MTREEDB:-/var/db}
+MTREEFILE="${MTREEDB}/mergemaster.mtree"
+
# Check the command line options
#
while getopts ":ascrvhipCPm:t:du:w:D:A:U" COMMAND_LINE_ARGUMENT ; do
case "${COMMAND_LINE_ARGUMENT}" in
A)
- ARCHSTRING='MACHINE_ARCH='${OPTARG}
+ ARCHSTRING='TARGET_ARCH='${OPTARG}
;;
U)
AUTO_UPGRADE=yes
@@ -338,10 +339,30 @@ if [ -n "${PRESERVE_FILES}" -a -z "${PRE
PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S`
fi
-# Check the for the mtree database in DESTDIR.
-if [ ! -f ${DESTDIR}${MTREEDB} ]; then
- echo "*** Unable to find mtree database. Skipping auto-upgrade."
- unset AUTO_UPGRADE
+# Check for the mtree database in DESTDIR
+case "${AUTO_UPGRADE}" in
+'') ;; # If the option is not set no need to run the test or warn the user
+*)
+ if [ ! -f "${DESTDIR}${MTREEFILE}" ]; then
+ echo ''
+ echo "*** Unable to find mtree database. Skipping auto-upgrade."
+ echo ''
+ press_to_continue
+ unset AUTO_UPGRADE
+ fi
+ ;;
+esac
+
+if [ -e "${DESTDIR}/etc/fstab" ]; then
+ if grep -q nodev ${DESTDIR}/etc/fstab; then
+ echo ''
+ echo "*** You have the deprecated 'nodev' option in ${DESTDIR}/etc/fstab."
+ echo " This can prevent the filesystem from being mounted on reboot."
+ echo " Please update your fstab before continuing."
+ echo " See fstab(5) for more information."
+ echo ''
+ exit 1
+ fi
fi
echo ''
@@ -350,7 +371,8 @@ echo ''
#
case "${DONT_CHECK_PAGER}" in
'')
- while ! type "${PAGER%% *}" >/dev/null && [ -n "${PAGER}" ]; do
+check_pager () {
+ while ! type "${PAGER%% *}" >/dev/null; do
echo " *** Your PAGER environment variable specifies '${PAGER}', but"
echo " due to the limited PATH that I use for security reasons,"
echo " I cannot execute it. So, what would you like to do?"
@@ -392,6 +414,10 @@ case "${DONT_CHECK_PAGER}" in
esac
echo ''
done
+}
+ if [ -n "${PAGER}" ]; then
+ check_pager
+ fi
;;
esac
@@ -412,14 +438,25 @@ DIFF_FLAG=${DIFF_FLAG:--u}
# Assign the source directory
#
-SOURCEDIR=${SOURCEDIR:-/usr/src/etc}
+SOURCEDIR=${SOURCEDIR:-/usr/src}
+if [ ! -f ${SOURCEDIR}/Makefile.inc1 -a \
+ -f ${SOURCEDIR}/../Makefile.inc1 ]; then
+ echo " *** The source directory you specified (${SOURCEDIR})"
+ echo " will be reset to ${SOURCEDIR}/.."
+ echo ''
+ sleep 3
+ SOURCEDIR=${SOURCEDIR}/..
+fi
+
+# Setup make to use system files from SOURCEDIR
+MM_MAKE="make ${ARCHSTRING} -m ${SOURCEDIR}/share/mk"
# Check DESTDIR against the mergemaster mtree database to see what
# files the user changed from the reference files.
#
CHANGED=
-if [ -n "${AUTO_UPGRADE}" -a -f "${DESTDIR}${MTREEDB}" ]; then
- for file in `mtree -eq -f ${DESTDIR}${MTREEDB} -p ${DESTDIR}/ \
+if [ -n "${AUTO_UPGRADE}" -a -f "${DESTDIR}${MTREEFILE}" ]; then
+ for file in `mtree -eq -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \
2>/dev/null | awk '($2 == "changed") {print $1}'`; do
if [ -f "${DESTDIR}/$file" ]; then
CHANGED="${CHANGED} ${DESTDIR}/$file"
@@ -552,14 +589,14 @@ case "${RERUN}" in
case "${DESTDIR}" in
'') ;;
*)
- make DESTDIR=${DESTDIR} ${ARCHSTRING} distrib-dirs
+ ${MM_MAKE} DESTDIR=${DESTDIR} distrib-dirs
;;
esac
- make DESTDIR=${TEMPROOT} ${ARCHSTRING} distrib-dirs &&
- MAKEOBJDIRPREFIX=${TEMPROOT}/usr/obj make ${ARCHSTRING} obj &&
- MAKEOBJDIRPREFIX=${TEMPROOT}/usr/obj make ${ARCHSTRING} all &&
- MAKEOBJDIRPREFIX=${TEMPROOT}/usr/obj make ${ARCHSTRING} \
- DESTDIR=${TEMPROOT} distribution;} ||
+ od=${TEMPROOT}/usr/obj
+ ${MM_MAKE} DESTDIR=${TEMPROOT} distrib-dirs &&
+ MAKEOBJDIRPREFIX=$od ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc &&
+ MAKEOBJDIRPREFIX=$od ${MM_MAKE} everything SUBDIR_OVERRIDE=etc &&
+ MAKEOBJDIRPREFIX=$od ${MM_MAKE} DESTDIR=${TEMPROOT} distribution;} ||
{ echo '';
echo " *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to";
echo " the temproot environment";
@@ -569,8 +606,8 @@ case "${RERUN}" in
*)
# Only set up files that are crucial to {build|install}world
{ mkdir -p ${TEMPROOT}/etc &&
- cp -p ${SOURCEDIR}/master.passwd ${TEMPROOT}/etc &&
- cp -p ${SOURCEDIR}/group ${TEMPROOT}/etc;} ||
+ cp -p ${SOURCEDIR}/etc/master.passwd ${TEMPROOT}/etc &&
+ cp -p ${SOURCEDIR}/etc/group ${TEMPROOT}/etc;} ||
{ echo '';
echo ' *** FATAL ERROR: Cannot copy files to the temproot environment';
echo '';
@@ -599,17 +636,23 @@ case "${RERUN}" in
esac
# Avoid comparing the motd if the user specifies it in .mergemasterrc
+ # Compatibility shim to be removed in FreeBSD 9.x
case "${IGNORE_MOTD}" in
'') ;;
- *) rm -f ${TEMPROOT}/etc/motd
+ *) IGNORE_FILES="${IGNORE_FILES} /etc/motd"
+ echo ''
+ echo "*** You have the IGNORE_MOTD option set in your mergemaster rc file."
+ echo " This option is deprecated in favor of the IGNORE_FILES option."
+ echo " Please update your rc file accordingly."
+ echo ''
+ press_to_continue
;;
esac
- # Avoid trying to update MAKEDEV if /dev is on a devfs
- if /sbin/sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
- rm -f ${TEMPROOT}/dev/MAKEDEV ${TEMPROOT}/dev/MAKEDEV.local
- fi
-
+ # Avoid comparing the following user specified files
+ for file in ${IGNORE_FILES}; do
+ test -e ${TEMPROOT}/${file} && unlink ${TEMPROOT}/${file}
+ done
;; # End of the "RERUN" test
esac
@@ -626,9 +669,9 @@ find ${TEMPROOT}/usr/obj -type f -delete
find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null
# Build the mtree database in a temporary location.
-# TODO: Possibly use mktemp instead for security reasons?
+MTREENEW=`mktemp -t mergemaster.mtree`
case "${PRE_WORLD}" in
-'') mtree -ci -p ${TEMPROOT} -k size,md5digest > ${DESTDIR}${MTREEDB}.new 2>/dev/null
+'') mtree -ci -p ${TEMPROOT} -k size,md5digest > ${DESTDIR}${MTREENEW} 2>/dev/null
;;
*) # We don't want to mess with the mtree database on a pre-world run.
;;
@@ -647,7 +690,7 @@ if [ -z "${NEW_UMASK}" -a -z "${AUTO_RUN
echo ''
echo " *** Your umask is currently set to ${USER_UMASK}. By default, this script"
echo " installs all files with the same user, group and modes that"
- echo " they are created with by ${SOURCEDIR}/Makefile, compared to"
+ echo " they are created with by ${SOURCEDIR}/etc/Makefile, compared to"
echo " a umask of 022. This umask allows world read permission when"
echo " the file's default permissions have it."
echo ''
@@ -714,6 +757,12 @@ esac
# Use the umask/mode information to install the files
# Create directories as needed
#
+install_error () {
+ echo "*** FATAL ERROR: Unable to install ${1} to ${2}"
+ echo ''
+ exit 1
+}
+
do_install_and_rm () {
case "${PRESERVE_FILES}" in
[Yy][Ee][Ss])
@@ -724,8 +773,15 @@ do_install_and_rm () {
;;
esac
- install -m "${1}" "${2}" "${3}" &&
- rm -f "${2}"
+ if [ ! -d "${3}/${2##*/}" ]; then
+ if install -m ${1} ${2} ${3}; then
+ unlink ${2}
+ else
+ install_error ${2} ${3}
+ fi
+ else
+ install_error ${2} ${3}
+ fi
}
# 4095 = "obase=10;ibase=8;07777" | bc
@@ -828,11 +884,6 @@ mm_install () {
;;
esac
else # File matched -x
- case "${1#.}" in
- /dev/MAKEDEV)
- NEED_MAKEDEV=yes
- ;;
- esac
do_install_and_rm "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}"
fi
return $?
@@ -904,7 +955,7 @@ if [ -r "${MM_PRE_COMPARE_SCRIPT}" ]; th
fi
# Using -size +0 avoids uselessly checking the empty log files created
-# by ${SOURCEDIR}/Makefile and the device entries in ./dev, but does
+# by ${SOURCEDIR}/etc/Makefile and the device entries in ./dev, but does
# check the scripts in ./dev, as we'd like (assuming no devfs of course).
#
for COMPFILE in `find . -type f -size +0`; do
@@ -986,9 +1037,10 @@ done # This is for the do way up there a
echo ''
echo "*** Comparison complete"
-if [ -f "${DESTDIR}${MTREEDB}.new" ]; then
+if [ -f "${DESTDIR}${MTREENEW}" ]; then
echo "*** Saving mtree database for future upgrades"
- mv -f ${DESTDIR}${MTREEDB}.new ${DESTDIR}${MTREEDB} 2>/dev/null
+ test -e "${MTREEFILE}" && unlink ${MTREEFILE}
+ mv ${DESTDIR}${MTREENEW} ${DESTDIR}${MTREEFILE}
fi
echo ''
@@ -1096,16 +1148,6 @@ run_it_now () {
esac
}
-case "${NEED_MAKEDEV}" in
-'') ;;
-*)
- echo ''
- echo "*** You installed a new ${DESTDIR}/dev/MAKEDEV script, so make sure that you run"
- echo " 'cd ${DESTDIR}/dev && /bin/sh MAKEDEV all' to rebuild your devices"
- run_it_now "cd ${DESTDIR}/dev && /bin/sh MAKEDEV all"
- ;;
-esac
-
case "${NEED_NEWALIASES}" in
'') ;;
*)
@@ -1187,7 +1229,7 @@ esac
case "${PRE_WORLD}" in
'') ;;
*)
- MAKE_CONF="${SOURCEDIR%etc}share/examples/etc/make.conf"
+ MAKE_CONF="${SOURCEDIR}/share/examples/etc/make.conf"
(echo ''
echo '*** Comparing make variables'
From mav at FreeBSD.org Fri Jan 9 11:36:31 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Fri Jan 9 11:36:37 2009
Subject: svn commit: r186939 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb kern
Message-ID: <200901091136.n09BaU39055481@svn.freebsd.org>
Author: mav
Date: Fri Jan 9 11:36:30 2009
New Revision: 186939
URL: http://svn.freebsd.org/changeset/base/186939
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/kern/kern_cpu.c
Modified: stable/7/sys/kern/kern_cpu.c
==============================================================================
--- stable/7/sys/kern/kern_cpu.c Fri Jan 9 11:21:25 2009 (r186938)
+++ stable/7/sys/kern/kern_cpu.c Fri Jan 9 11:36:30 2009 (r186939)
@@ -144,7 +144,9 @@ static int
cpufreq_attach(device_t dev)
{
struct cpufreq_softc *sc;
+ struct pcpu *pc;
device_t parent;
+ uint64_t rate;
int numdevs;
CF_DEBUG("initializing %s\n", device_get_nameunit(dev));
@@ -156,7 +158,12 @@ cpufreq_attach(device_t dev)
CF_MTX_INIT(&sc->lock);
sc->curr_level.total_set.freq = CPUFREQ_VAL_UNKNOWN;
SLIST_INIT(&sc->saved_freq);
- sc->max_mhz = CPUFREQ_VAL_UNKNOWN;
+ /* Try to get current CPU freq to use it as maximum later if needed */
+ pc = cpu_get_pcpu(dev);
+ if (cpu_est_clockrate(pc->pc_cpuid, &rate) == 0)
+ sc->max_mhz = rate / 1000000;
+ else
+ sc->max_mhz = CPUFREQ_VAL_UNKNOWN;
/*
* Only initialize one set of sysctls for all CPUs. In the future,
From pho at FreeBSD.org Fri Jan 9 13:53:46 2009
From: pho at FreeBSD.org (Peter Holm)
Date: Fri Jan 9 13:53:53 2009
Subject: svn commit: r186950 - in stable/7/sys: . contrib/pf dev/cxgb kern
Message-ID: <200901091353.n09DriYq058568@svn.freebsd.org>
Author: pho
Date: Fri Jan 9 13:53:44 2009
New Revision: 186950
URL: http://svn.freebsd.org/changeset/base/186950
Log:
MFC r186510:
Prevent overflow of uio_resid.
Approved by: kib
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/kern/vfs_syscalls.c
Modified: stable/7/sys/kern/vfs_syscalls.c
==============================================================================
--- stable/7/sys/kern/vfs_syscalls.c Fri Jan 9 13:18:13 2009 (r186949)
+++ stable/7/sys/kern/vfs_syscalls.c Fri Jan 9 13:53:44 2009 (r186950)
@@ -3800,6 +3800,8 @@ kern_getdirentries(struct thread *td, in
int error, eofflag;
AUDIT_ARG(fd, fd);
+ if (count > INT_MAX)
+ return (EINVAL);
if ((error = getvnode(td->td_proc->p_fd, fd, &fp)) != 0)
return (error);
if ((fp->f_flag & FREAD) == 0) {
From ru at FreeBSD.org Fri Jan 9 16:24:12 2009
From: ru at FreeBSD.org (Ruslan Ermilov)
Date: Fri Jan 9 16:24:34 2009
Subject: svn commit: r186957 - head/lib/libc/string stable/7/lib/libc/string
Message-ID: <200901091624.n09GOAcu061659@svn.freebsd.org>
Author: ru
Date: Fri Jan 9 16:24:10 2009
New Revision: 186957
URL: http://svn.freebsd.org/changeset/base/186957
Log:
Sort MLINKS.
Modified:
stable/7/lib/libc/string/Makefile.inc
Changes in other areas also in this revision:
Modified:
head/lib/libc/string/Makefile.inc
Modified: stable/7/lib/libc/string/Makefile.inc
==============================================================================
--- stable/7/lib/libc/string/Makefile.inc Fri Jan 9 16:22:32 2009 (r186956)
+++ stable/7/lib/libc/string/Makefile.inc Fri Jan 9 16:24:10 2009 (r186957)
@@ -35,34 +35,45 @@ MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 f
strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 wcscoll.3 wcstok.3 \
wcswidth.3 wcsxfrm.3 wmemchr.3
-MLINKS+=ffs.3 ffsl.3
-MLINKS+=ffs.3 fls.3
-MLINKS+=ffs.3 flsl.3
-MLINKS+=ffs.3 ffsll.3
-MLINKS+=ffs.3 flsll.3
+MLINKS+=ffs.3 ffsl.3 \
+ ffs.3 ffsll.3 \
+ ffs.3 fls.3 \
+ ffs.3 flsl.3 \
+ ffs.3 flsll.3
MLINKS+=index.3 rindex.3
MLINKS+=memchr.3 memrchr.3
MLINKS+=strcasecmp.3 strncasecmp.3
MLINKS+=strcat.3 strncat.3
MLINKS+=strchr.3 strrchr.3
MLINKS+=strcmp.3 strncmp.3
-MLINKS+=strcpy.3 stpcpy.3
+MLINKS+=strcpy.3 stpcpy.3 \
+ strcpy.3 strncpy.3
MLINKS+=strdup.3 strndup.3
-MLINKS+=strcpy.3 strncpy.3
-MLINKS+=strerror.3 perror.3 strerror.3 sys_errlist.3 strerror.3 sys_nerr.3
-MLINKS+=strerror.3 strerror_r.3
+MLINKS+=strerror.3 perror.3 \
+ strerror.3 strerror_r.3 \
+ strerror.3 sys_errlist.3 \
+ strerror.3 sys_nerr.3
MLINKS+=strlcpy.3 strlcat.3
+MLINKS+=strstr.3 strcasestr.3 \
+ strstr.3 strnstr.3
MLINKS+=strtok.3 strtok_r.3
-MLINKS+=strstr.3 strcasestr.3
-MLINKS+=strstr.3 strnstr.3
-MLINKS+=wmemchr.3 wmemcmp.3 wmemchr.3 wmemcpy.3 \
- wmemchr.3 wmemmove.3 wmemchr.3 wmemset.3 \
- wmemchr.3 wcscat.3 wmemchr.3 wcschr.3 \
- wmemchr.3 wcscmp.3 wmemchr.3 wcscpy.3 \
- wmemchr.3 wcscspn.3 wmemchr.3 wcsdup.3 \
+MLINKS+=wmemchr.3 wcscat.3 \
+ wmemchr.3 wcschr.3 \
+ wmemchr.3 wcscmp.3 \
+ wmemchr.3 wcscpy.3 \
+ wmemchr.3 wcscspn.3 \
+ wmemchr.3 wcsdup.3 \
wmemchr.3 wcslcat.3 \
- wmemchr.3 wcslcpy.3 wmemchr.3 wcslen.3 \
- wmemchr.3 wcsncat.3 wmemchr.3 wcsncmp.3 \
- wmemchr.3 wcsncpy.3 wmemchr.3 wcspbrk.3 \
- wmemchr.3 wcsrchr.3 wmemchr.3 wcsspn.3 \
- wmemchr.3 wcsstr.3
+ wmemchr.3 wcslcpy.3 \
+ wmemchr.3 wcslen.3 \
+ wmemchr.3 wcsncat.3 \
+ wmemchr.3 wcsncmp.3 \
+ wmemchr.3 wcsncpy.3 \
+ wmemchr.3 wcspbrk.3 \
+ wmemchr.3 wcsrchr.3 \
+ wmemchr.3 wcsspn.3 \
+ wmemchr.3 wcsstr.3 \
+ wmemchr.3 wmemcmp.3 \
+ wmemchr.3 wmemcpy.3 \
+ wmemchr.3 wmemmove.3 \
+ wmemchr.3 wmemset.3
From ru at FreeBSD.org Fri Jan 9 16:37:31 2009
From: ru at FreeBSD.org (Ruslan Ermilov)
Date: Fri Jan 9 16:37:57 2009
Subject: svn commit: r186958 - in stable/7/gnu/usr.bin/cvs: . contrib
Message-ID: <200901091637.n09GbTn5061954@svn.freebsd.org>
Author: ru
Date: Fri Jan 9 16:37:29 2009
New Revision: 186958
URL: http://svn.freebsd.org/changeset/base/186958
Log:
MFC: Instead of using .POSIX:, use the cool looking "@:" rule.
Modified:
stable/7/gnu/usr.bin/cvs/ (props changed)
stable/7/gnu/usr.bin/cvs/contrib/Makefile
Modified: stable/7/gnu/usr.bin/cvs/contrib/Makefile
==============================================================================
--- stable/7/gnu/usr.bin/cvs/contrib/Makefile Fri Jan 9 16:24:10 2009 (r186957)
+++ stable/7/gnu/usr.bin/cvs/contrib/Makefile Fri Jan 9 16:37:29 2009 (r186958)
@@ -1,7 +1,5 @@
# $FreeBSD$
-.POSIX:
-
.include "../Makefile.inc"
.PATH: ${CVSDIR}/contrib
@@ -21,6 +19,10 @@ CLEANFILES+= $(SCRIPTS)
.SUFFIXES: .sh .pl .in
+# Prevent Makefile.in from overwriting Makefile through the suffix rules.
+Makefile:
+ @:
+
.sh:
cp ${.IMPSRC} ${.TARGET}
From sam at FreeBSD.org Fri Jan 9 18:08:52 2009
From: sam at FreeBSD.org (Sam Leffler)
Date: Fri Jan 9 18:09:11 2009
Subject: svn commit: r186962 - in stable/7/tools/tools/nanobsd: . Files/root
Message-ID: <200901091808.n09I8oFr064442@svn.freebsd.org>
Author: sam
Date: Fri Jan 9 18:08:50 2009
New Revision: 186962
URL: http://svn.freebsd.org/changeset/base/186962
Log:
sync with HEAD
OK'd by: phk
Added:
stable/7/tools/tools/nanobsd/Files/root/save_cfg
- copied unchanged from r181082, head/tools/tools/nanobsd/Files/root/save_cfg
Modified:
stable/7/tools/tools/nanobsd/ (props changed)
stable/7/tools/tools/nanobsd/FlashDevice.sub
stable/7/tools/tools/nanobsd/nanobsd.sh
Copied: stable/7/tools/tools/nanobsd/Files/root/save_cfg (from r181082, head/tools/tools/nanobsd/Files/root/save_cfg)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/tools/nanobsd/Files/root/save_cfg Fri Jan 9 18:08:50 2009 (r186962, copy of r181082, head/tools/tools/nanobsd/Files/root/save_cfg)
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 Mathieu Arnold
+# 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 THE 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 THE 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$
+#
+
+set -e
+
+trap "umount /cfg" 1 2 15 EXIT
+mount /cfg
+(
+cd /cfg
+for i in "$@" `find * -type f`
+do
+ cmp -s /etc/$i /cfg/$i || cp -pfv /etc/$i /cfg/$i
+done
+)
+umount /cfg
+trap 1 2 15 EXIT
Modified: stable/7/tools/tools/nanobsd/FlashDevice.sub
==============================================================================
--- stable/7/tools/tools/nanobsd/FlashDevice.sub Fri Jan 9 17:21:22 2009 (r186961)
+++ stable/7/tools/tools/nanobsd/FlashDevice.sub Fri Jan 9 18:08:50 2009 (r186962)
@@ -117,7 +117,7 @@ sub_FlashDevice () {
NANO_SECTS=63
;;
4096|4096mb|4g)
- NANO_MEDIASIZE=`expr 4097802240 / 512`
+ NANO_MEDIASIZE=`expr -e 4097802240 / 512`
NANO_HEADS=16
NANO_SECTS=63
;;
@@ -128,9 +128,9 @@ sub_FlashDevice () {
esac
;;
siliconsystems)
- case $2 in
+ case $a2 in
4096|4g)
- NANO_MEDIASIZE=`expr 4224761856 / 512`
+ NANO_MEDIASIZE=`expr -e 4224761856 / 512`
NANO_HEADS=16
NANO_SECTS=63
;;
@@ -141,7 +141,7 @@ sub_FlashDevice () {
esac
;;
soekris)
- case $2 in
+ case $a2 in
net4526 | 4526 | net4826 | 4826 | 64 | 64mb)
NANO_MEDIASIZE=125056
NANO_HEADS=4
@@ -154,7 +154,7 @@ sub_FlashDevice () {
esac
;;
transcend)
- case $2 in
+ case $a2 in
dom064m)
NANO_MEDIASIZE=125184
NANO_HEADS=4
Modified: stable/7/tools/tools/nanobsd/nanobsd.sh
==============================================================================
--- stable/7/tools/tools/nanobsd/nanobsd.sh Fri Jan 9 17:21:22 2009 (r186961)
+++ stable/7/tools/tools/nanobsd/nanobsd.sh Fri Jan 9 18:08:50 2009 (r186962)
@@ -47,15 +47,23 @@ NANO_TOOLS=tools/tools/nanobsd
# Where cust_pkg() finds packages to install
NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg
+NANO_PACKAGE_LIST="*"
# Object tree directory
# default is subdir of /usr/obj
# XXX: MAKEOBJDIRPREFIX handling... ?
#NANO_OBJ=""
+# The directory to put the final images
+# default is ${NANO_OBJ}
+#NANO_DISKIMGDIR=""
+
# Parallel Make
NANO_PMAKE="make -j 3"
+# The default name for any image we create.
+NANO_IMGNAME="_.disk.full"
+
# Options to put in make.conf during buildworld only
CONF_BUILD=' '
@@ -71,6 +79,9 @@ NANO_KERNEL=GENERIC
# Customize commands.
NANO_CUSTOMIZE=""
+# Late customize commands.
+NANO_LATE_CUSTOMIZE=""
+
# Newfs paramters to use
NANO_NEWFS="-b 4096 -f 512 -i 8192 -O1 -U"
@@ -78,7 +89,7 @@ NANO_NEWFS="-b 4096 -f 512 -i 8192 -O1 -
NANO_DRIVE=ad0
# Target media size in 512 bytes sectors
-NANO_MEDIASIZE=1000000
+NANO_MEDIASIZE=1200000
# Number of code images on media (1 or 2)
NANO_IMAGES=2
@@ -114,6 +125,13 @@ NANO_HEADS=16
NANO_BOOT0CFG="-o packet -s 1 -m 3"
NANO_BOOTLOADER="boot/boot0sio"
+# Backing type of md(4) device
+# Can be "file" or "swap"
+NANO_MD_BACKING="file"
+
+# Progress Print level
+PPLEVEL=3
+
#######################################################################
# Not a variable at this time
@@ -127,7 +145,7 @@ NANO_ARCH=i386
#######################################################################
clean_build ( ) (
- echo "## Clean and create object directory (${MAKEOBJDIRPREFIX})"
+ pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})"
if rm -rf ${MAKEOBJDIRPREFIX} > /dev/null 2>&1 ; then
true
@@ -140,24 +158,25 @@ clean_build ( ) (
)
make_conf_build ( ) (
- echo "## Construct build make.conf ($NANO_MAKE_CONF)"
+ pprint 2 "Construct build make.conf ($NANO_MAKE_CONF)"
echo "${CONF_WORLD}" > ${NANO_MAKE_CONF}
echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF}
)
build_world ( ) (
- echo "## run buildworld"
- echo "### log: ${MAKEOBJDIRPREFIX}/_.bw"
+ pprint 2 "run buildworld"
+ pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bw"
cd ${NANO_SRC}
- ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF} buildworld \
+ env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} \
+ __MAKE_CONF=${NANO_MAKE_CONF} buildworld \
> ${MAKEOBJDIRPREFIX}/_.bw 2>&1
)
build_kernel ( ) (
- echo "## build kernel ($NANO_KERNEL)"
- echo "### log: ${MAKEOBJDIRPREFIX}/_.bk"
+ pprint 2 "build kernel ($NANO_KERNEL)"
+ pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bk"
if [ -f ${NANO_KERNEL} ] ; then
cp ${NANO_KERNEL} ${NANO_SRC}/sys/${NANO_ARCH}/conf
@@ -168,14 +187,14 @@ build_kernel ( ) (
# when cross-building
unset TARGET_CPUTYPE
unset TARGET_BIG_ENDIAN
- ${NANO_PMAKE} buildkernel \
+ env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \
__MAKE_CONF=${NANO_MAKE_CONF} KERNCONF=`basename ${NANO_KERNEL}` \
> ${MAKEOBJDIRPREFIX}/_.bk 2>&1
)
)
clean_world ( ) (
- echo "## Clean and create world directory (${NANO_WORLDDIR})"
+ pprint 2 "Clean and create world directory (${NANO_WORLDDIR})"
if rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then
true
else
@@ -186,17 +205,18 @@ clean_world ( ) (
)
make_conf_install ( ) (
- echo "## Construct install make.conf ($NANO_MAKE_CONF)"
+ pprint 2 "Construct install make.conf ($NANO_MAKE_CONF)"
echo "${CONF_WORLD}" > ${NANO_MAKE_CONF}
echo "${CONF_INSTALL}" >> ${NANO_MAKE_CONF}
)
install_world ( ) (
- echo "## installworld"
- echo "### log: ${MAKEOBJDIRPREFIX}/_.iw"
+ pprint 2 "installworld"
+ pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.iw"
cd ${NANO_SRC}
+ env TARGET_ARCH=${NANO_ARCH} \
${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF} installworld \
DESTDIR=${NANO_WORLDDIR} \
> ${MAKEOBJDIRPREFIX}/_.iw 2>&1
@@ -205,21 +225,22 @@ install_world ( ) (
install_etc ( ) (
- echo "## install /etc"
- echo "### log: ${MAKEOBJDIRPREFIX}/_.etc"
+ pprint 2 "install /etc"
+ pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.etc"
cd ${NANO_SRC}
+ env TARGET_ARCH=${NANO_ARCH} \
${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF} distribution \
DESTDIR=${NANO_WORLDDIR} \
> ${MAKEOBJDIRPREFIX}/_.etc 2>&1
)
install_kernel ( ) (
- echo "## install kernel"
- echo "### log: ${MAKEOBJDIRPREFIX}/_.ik"
+ pprint 2 "install kernel"
+ pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.ik"
cd ${NANO_SRC}
- ${NANO_PMAKE} installkernel \
+ env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} installkernel \
DESTDIR=${NANO_WORLDDIR} \
__MAKE_CONF=${NANO_MAKE_CONF} KERNCONF=`basename ${NANO_KERNEL}` \
> ${MAKEOBJDIRPREFIX}/_.ik 2>&1
@@ -227,19 +248,31 @@ install_kernel ( ) (
run_customize() (
- echo "## run customize scripts"
+ pprint 2 "run customize scripts"
for c in $NANO_CUSTOMIZE
do
- echo "## customize \"$c\""
- echo "### log: ${MAKEOBJDIRPREFIX}/_.cust.$c"
- echo "### `type $c`"
+ pprint 2 "customize \"$c\""
+ pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.cust.$c"
+ pprint 4 "`type $c`"
( $c ) > ${MAKEOBJDIRPREFIX}/_.cust.$c 2>&1
done
)
+run_late_customize() (
+
+ pprint 2 "run late customize scripts"
+ for c in $NANO_LATE_CUSTOMIZE
+ do
+ pprint 2 "late customize \"$c\""
+ pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.late_cust.$c"
+ pprint 4 "`type $c`"
+ ( $c ) > ${MAKEOBJDIRPREFIX}/_.late_cust.$c 2>&1
+ done
+)
+
setup_nanobsd ( ) (
- echo "## configure nanobsd setup"
- echo "### log: ${MAKEOBJDIRPREFIX}/_.dl"
+ pprint 2 "configure nanobsd setup"
+ pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.dl"
(
cd ${NANO_WORLDDIR}
@@ -249,7 +282,7 @@ setup_nanobsd ( ) (
# have hardcoded paths under ${prefix}/etc are not tweakable.
if [ -d usr/local/etc ] ; then
(
- mkdir etc/local
+ mkdir -p etc/local
cd usr/local/etc
find . -print | cpio -dumpl ../../../etc/local
cd ..
@@ -283,7 +316,7 @@ setup_nanobsd ( ) (
)
setup_nanobsd_etc ( ) (
- echo "## configure nanobsd /etc"
+ pprint 2 "configure nanobsd /etc"
(
cd ${NANO_WORLDDIR}
@@ -314,8 +347,8 @@ prune_usr() (
)
create_i386_diskimage ( ) (
- echo "## build diskimage"
- echo "### log: ${MAKEOBJDIRPREFIX}/_.di"
+ pprint 2 "build diskimage"
+ pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.di"
(
echo $NANO_MEDIASIZE $NANO_IMAGES \
@@ -372,24 +405,34 @@ create_i386_diskimage ( ) (
# Data partition (if any) starts at cylinder boundary.
if ($7 > 0) {
print "p 4 165 " c, dsl * cs
- } else if ($7 < 0 && $1 > $c) {
- print "p 4 165 " c, $1 - $c
+ } else if ($7 < 0 && $1 > c) {
+ print "p 4 165 " c, $1 - c
} else if ($1 < c) {
print "Disk space overcommitted by", \
c - $1, "sectors" > "/dev/stderr"
exit 2
}
+
+ # Force slice 1 to be marked active. This is necessary
+ # for booting the image from a USB device to work.
+ print "a 1"
}
' > ${MAKEOBJDIRPREFIX}/_.fdisk
- IMG=${MAKEOBJDIRPREFIX}/_.disk.full
+ IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME}
MNT=${MAKEOBJDIRPREFIX}/_.mnt
mkdir -p ${MNT}
- dd if=/dev/zero of=${IMG} bs=${NANO_SECTS}b \
- count=`expr ${NANO_MEDIASIZE} / ${NANO_SECTS}`
-
- MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} -y ${NANO_HEADS}`
+ if [ "${NANO_MD_BACKING}" = "swap" ] ; then
+ MD=`mdconfig -a -t swap -s ${NANO_MEDIASIZE} -x ${NANO_SECTS} \
+ -y ${NANO_HEADS}`
+ else
+ echo "Creating md backing file..."
+ dd if=/dev/zero of=${IMG} bs=${NANO_SECTS}b \
+ count=`expr ${NANO_MEDIASIZE} / ${NANO_SECTS}`
+ MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \
+ -y ${NANO_HEADS}`
+ fi
trap "df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT
@@ -405,14 +448,17 @@ create_i386_diskimage ( ) (
newfs ${NANO_NEWFS} /dev/${MD}s1a
mount /dev/${MD}s1a ${MNT}
df -i ${MNT}
+ echo "Copying worlddir..."
( cd ${NANO_WORLDDIR} && find . -print | cpio -dump ${MNT} )
df -i ${MNT}
+ echo "Generating mtree..."
( cd ${MNT} && mtree -c ) > ${MAKEOBJDIRPREFIX}/_.mtree
( cd ${MNT} && du -k ) > ${MAKEOBJDIRPREFIX}/_.du
umount ${MNT}
if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then
# Duplicate to second image (if present)
+ echo "Duplicating to second image..."
dd if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k
mount /dev/${MD}s2a ${MNT}
for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab
@@ -433,7 +479,13 @@ create_i386_diskimage ( ) (
# XXX: fill from where ?
fi
- dd if=/dev/${MD}s1 of=${MAKEOBJDIRPREFIX}/_.disk.image bs=64k
+ if [ "${NANO_MD_BACKING}" = "swap" ] ; then
+ echo "Writing out _.disk.full..."
+ dd if=/dev/${MD} of=${IMG} bs=64k
+ fi
+
+ echo "Writing out _.disk.image..."
+ dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k
mdconfig -d -u $MD
) > ${MAKEOBJDIRPREFIX}/_.di 2>&1
)
@@ -464,13 +516,52 @@ FlashDevice () {
sub_FlashDevice $1 $2
}
+#######################################################################
+# USB device geometries
+#
+# Usage:
+# UsbDevice Generic 1000 # a generic flash key sold as having 1GB
+#
+# This function will set NANO_MEDIASIZE, NANO_HEADS and NANO_SECTS for you.
+#
+# Note that the capacity of a flash key is usually advertised in MB or
+# GB, *not* MiB/GiB. As such, the precise number of cylinders available
+# for C/H/S geometry may vary depending on the actual flash geometry.
+#
+# The following generic device layouts are understood:
+# generic An alias for generic-hdd.
+# generic-hdd 255H 63S/T xxxxC with no MBR restrictions.
+# generic-fdd 64H 32S/T xxxxC with no MBR restrictions.
+#
+# The generic-hdd device is preferred for flash devices larger than 1GB.
+#
+
+UsbDevice () {
+ a1=`echo $1 | tr '[:upper:]' '[:lower:]'`
+ case $a1 in
+ generic-fdd)
+ NANO_HEADS=64
+ NANO_SECTS=32
+ NANO_MEDIASIZE=$(( $2 * 1000 * 1000 / 512 ))
+ ;;
+ generic|generic-hdd)
+ NANO_HEADS=255
+ NANO_SECTS=63
+ NANO_MEDIASIZE=$(( $2 * 1000 * 1000 / 512 ))
+ ;;
+ *)
+ echo "Unknown USB flash device"
+ exit 2
+ ;;
+ esac
+}
#######################################################################
# Setup serial console
cust_comconsole () (
# Enable getty on console
- sed -i "" -e /ttyd0/s/off/on/ ${NANO_WORLDDIR}/etc/ttys
+ sed -i "" -e /tty[du]0/s/off/on/ ${NANO_WORLDDIR}/etc/ttys
# Disable getty on syscons devices
sed -i "" -e '/^ttyv[0-8]/s/ on/ off/' ${NANO_WORLDDIR}/etc/ttys
@@ -492,7 +583,7 @@ cust_allow_ssh_root () (
cust_install_files () (
cd ${NANO_TOOLS}/Files
- find . -print | grep -v /CVS | cpio -dumpv ${NANO_WORLDDIR}
+ find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${NANO_WORLDDIR}
)
#######################################################################
@@ -502,7 +593,11 @@ cust_pkg () (
# Copy packages into chroot
mkdir -p ${NANO_WORLDDIR}/Pkg
- cp ${NANO_PACKAGE_DIR}/* ${NANO_WORLDDIR}/Pkg
+ (
+ cd ${NANO_PACKAGE_DIR}
+ find ${NANO_PACKAGE_LIST} -print |
+ cpio -dumpv ${NANO_WORLDDIR}/Pkg
+ )
# Count & report how many we have to install
todo=`ls ${NANO_WORLDDIR}/Pkg | wc -l`
@@ -511,7 +606,7 @@ cust_pkg () (
echo "==="
while true
do
- # Record how may we have now
+ # Record how many we have now
have=`ls ${NANO_WORLDDIR}/var/db/pkg | wc -l`
# Attempt to install more packages
@@ -547,16 +642,37 @@ customize_cmd () {
}
#######################################################################
+# Convenience function:
+# Register $1 as late customize function to run just before
+# image creation.
+
+late_customize_cmd () {
+ NANO_LATE_CUSTOMIZE="$NANO_LATE_CUSTOMIZE $1"
+}
+
+#######################################################################
#
# All set up to go...
#
#######################################################################
+# Progress Print
+# Print $2 at level $1.
+pprint() {
+ if [ "$1" -le $PPLEVEL ]; then
+ printf "%.${1}s %s\n" "#####" "$2"
+ fi
+}
+
usage () {
(
- echo "Usage: $0 [-b/-k/-w] [-c config_file]"
+ echo "Usage: $0 [-bikqvw] [-c config_file]"
echo " -b suppress builds (both kernel and world)"
+ echo " -i suppress disk image build"
echo " -k suppress buildkernel"
+ echo " -n add -DNO_CLEAN to buildworld, buildkernel, etc"
+ echo " -q make output more quite"
+ echo " -v make output more verbose"
echo " -w suppress buildworld"
echo " -c specify config file"
) 1>&2
@@ -566,11 +682,13 @@ usage () {
#######################################################################
# Parse arguments
+do_clean=true
do_kernel=true
do_world=true
+do_image=true
set +e
-args=`getopt bc:hkw $*`
+args=`getopt bc:hiknqvw $*`
if [ $? -ne 0 ] ; then
usage
exit 2
@@ -583,29 +701,45 @@ do
case "$i"
in
-b)
- shift;
do_world=false
do_kernel=false
+ shift
;;
-k)
- shift;
do_kernel=false
+ shift
;;
-c)
. "$2"
- shift;
- shift;
+ shift
+ shift
;;
-h)
usage
;;
+ -i)
+ do_image=false
+ shift
+ ;;
+ -n)
+ do_clean=false
+ shift
+ ;;
+ -q)
+ PPLEVEL=$(($PPLEVEL - 1))
+ shift
+ ;;
+ -v)
+ PPLEVEL=$(($PPLEVEL + 1))
+ shift
+ ;;
-w)
- shift;
do_world=false
+ shift
;;
--)
- shift;
- break;
+ shift
+ break
esac
done
@@ -624,6 +758,10 @@ else
MAKEOBJDIRPREFIX=${NANO_OBJ}
fi
+if [ "x${NANO_DISKIMGDIR}" = "x" ] ; then
+ NANO_DISKIMGDIR=${MAKEOBJDIRPREFIX}
+fi
+
NANO_WORLDDIR=${MAKEOBJDIRPREFIX}/_.w
NANO_MAKE_CONF=${MAKEOBJDIRPREFIX}/make.conf
@@ -636,6 +774,12 @@ else
exit 1
fi
+if $do_clean ; then
+ true
+else
+ NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN"
+fi
+
export MAKEOBJDIRPREFIX
export NANO_ARCH
@@ -646,6 +790,7 @@ export NANO_DATASIZE
export NANO_DRIVE
export NANO_HEADS
export NANO_IMAGES
+export NANO_IMGNAME
export NANO_MAKE_CONF
export NANO_MEDIASIZE
export NANO_NAME
@@ -662,18 +807,24 @@ export NANO_BOOTLOADER
#######################################################################
# And then it is as simple as that...
+pprint 1 "NanoBSD image ${NANO_NAME} build starting"
+
if $do_world ; then
- clean_build
+ if $do_clean ; then
+ clean_build
+ else
+ pprint 2 "Using existing build tree (as instructed)"
+ fi
make_conf_build
build_world
else
- echo "## Skipping buildworld (as instructed)"
+ pprint 2 "Skipping buildworld (as instructed)"
fi
if $do_kernel ; then
build_kernel
else
- echo "## Skipping buildkernel (as instructed)"
+ pprint 2 "Skipping buildkernel (as instructed)"
fi
clean_world
@@ -686,7 +837,13 @@ install_kernel
run_customize
setup_nanobsd
prune_usr
-create_${NANO_ARCH}_diskimage
+run_late_customize
+if $do_image ; then
+ create_${NANO_ARCH}_diskimage
+ echo "# Created NanoBSD disk image: ${MAKEOBJDIRPREFIX}/${NANO_IMGNAME}"
+else
+ pprint 2 "Skipping image build (as instructed)"
+fi
last_orders
-echo "# NanoBSD image completed"
+pprint 1 "NanoBSD image ${NANO_NAME} completed"
From gnn at FreeBSD.org Fri Jan 9 20:28:44 2009
From: gnn at FreeBSD.org (George V. Neville-Neil)
Date: Fri Jan 9 20:28:57 2009
Subject: svn commit: r186966 - stable/7/sys/conf
Message-ID: <200901092028.n09KShDU067488@svn.freebsd.org>
Author: gnn
Date: Fri Jan 9 20:28:43 2009
New Revision: 186966
URL: http://svn.freebsd.org/changeset/base/186966
Log:
Make it so that debug builds with CTF (i.e. DTrace) have proper debugging
symbols in the kernel.
Reviewed by: jhb
Modified:
stable/7/sys/conf/kern.pre.mk
Modified: stable/7/sys/conf/kern.pre.mk
==============================================================================
--- stable/7/sys/conf/kern.pre.mk Fri Jan 9 19:49:32 2009 (r186965)
+++ stable/7/sys/conf/kern.pre.mk Fri Jan 9 20:28:43 2009 (r186966)
@@ -26,6 +26,7 @@ COPTFLAGS?= -O
.else
. if defined(DEBUG)
_MINUS_O= -O
+CTFFLAGS+= -g
. else
_MINUS_O= -O2
. endif
From mav at FreeBSD.org Fri Jan 9 20:33:08 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Fri Jan 9 20:33:24 2009
Subject: svn commit: r186967 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb dev/pci
Message-ID: <200901092033.n09KX7oW067624@svn.freebsd.org>
Author: mav
Date: Fri Jan 9 20:33:07 2009
New Revision: 186967
URL: http://svn.freebsd.org/changeset/base/186967
Log:
MFC rev. 184139, 184141, 184937
Add "SD host controller" subclass.
Add HDA multimedia subclass.
Add ADMA, SATA and SAS mass storage subclasses.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/pci/pci.c
stable/7/sys/dev/pci/pcireg.h
Modified: stable/7/sys/dev/pci/pci.c
==============================================================================
--- stable/7/sys/dev/pci/pci.c Fri Jan 9 20:28:43 2009 (r186966)
+++ stable/7/sys/dev/pci/pci.c Fri Jan 9 20:33:07 2009 (r186967)
@@ -2948,6 +2948,9 @@ static struct
{PCIC_STORAGE, PCIS_STORAGE_FLOPPY, "floppy disk"},
{PCIC_STORAGE, PCIS_STORAGE_IPI, "IPI"},
{PCIC_STORAGE, PCIS_STORAGE_RAID, "RAID"},
+ {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"},
+ {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"},
+ {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"},
{PCIC_NETWORK, -1, "network"},
{PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"},
{PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"},
@@ -2962,6 +2965,7 @@ static struct
{PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_VIDEO, "video"},
{PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_AUDIO, "audio"},
{PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_TELE, "telephony"},
+ {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_HDA, "HDA"},
{PCIC_MEMORY, -1, "memory"},
{PCIC_MEMORY, PCIS_MEMORY_RAM, "RAM"},
{PCIC_MEMORY, PCIS_MEMORY_FLASH, "flash"},
@@ -2986,6 +2990,7 @@ static struct
{PCIC_BASEPERIPH, PCIS_BASEPERIPH_TIMER, "timer"},
{PCIC_BASEPERIPH, PCIS_BASEPERIPH_RTC, "realtime clock"},
{PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug controller"},
+ {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, "SD host controller"},
{PCIC_INPUTDEV, -1, "input device"},
{PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, "keyboard"},
{PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,"digitizer"},
Modified: stable/7/sys/dev/pci/pcireg.h
==============================================================================
--- stable/7/sys/dev/pci/pcireg.h Fri Jan 9 20:28:43 2009 (r186966)
+++ stable/7/sys/dev/pci/pcireg.h Fri Jan 9 20:33:07 2009 (r186967)
@@ -255,6 +255,7 @@
#define PCIS_MULTIMEDIA_VIDEO 0x00
#define PCIS_MULTIMEDIA_AUDIO 0x01
#define PCIS_MULTIMEDIA_TELE 0x02
+#define PCIS_MULTIMEDIA_HDA 0x03
#define PCIS_MULTIMEDIA_OTHER 0x80
#define PCIC_MEMORY 0x05
From mav at FreeBSD.org Fri Jan 9 20:34:33 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Fri Jan 9 20:34:45 2009
Subject: svn commit: r186968 - stable/7/usr.sbin/pciconf
Message-ID: <200901092034.n09KYWTk067688@svn.freebsd.org>
Author: mav
Date: Fri Jan 9 20:34:32 2009
New Revision: 186968
URL: http://svn.freebsd.org/changeset/base/186968
Log:
MFC rev. 184140, 184142, 184936
Add "SD host controller" subclass.
Add HDA multimedia subclass.
Add ADMA, SATA and SAS mass storage subclasses.
Modified:
stable/7/usr.sbin/pciconf/ (props changed)
stable/7/usr.sbin/pciconf/pciconf.c
Modified: stable/7/usr.sbin/pciconf/pciconf.c
==============================================================================
--- stable/7/usr.sbin/pciconf/pciconf.c Fri Jan 9 20:33:07 2009 (r186967)
+++ stable/7/usr.sbin/pciconf/pciconf.c Fri Jan 9 20:34:32 2009 (r186968)
@@ -272,6 +272,9 @@ static struct
{PCIC_STORAGE, PCIS_STORAGE_FLOPPY, "floppy disk"},
{PCIC_STORAGE, PCIS_STORAGE_IPI, "IPI"},
{PCIC_STORAGE, PCIS_STORAGE_RAID, "RAID"},
+ {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"},
+ {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"},
+ {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"},
{PCIC_NETWORK, -1, "network"},
{PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"},
{PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"},
@@ -286,6 +289,7 @@ static struct
{PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_VIDEO, "video"},
{PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_AUDIO, "audio"},
{PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_TELE, "telephony"},
+ {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_HDA, "HDA"},
{PCIC_MEMORY, -1, "memory"},
{PCIC_MEMORY, PCIS_MEMORY_RAM, "RAM"},
{PCIC_MEMORY, PCIS_MEMORY_FLASH, "flash"},
@@ -310,6 +314,7 @@ static struct
{PCIC_BASEPERIPH, PCIS_BASEPERIPH_TIMER, "timer"},
{PCIC_BASEPERIPH, PCIS_BASEPERIPH_RTC, "realtime clock"},
{PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug controller"},
+ {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, "SD host controller"},
{PCIC_INPUTDEV, -1, "input device"},
{PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, "keyboard"},
{PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,"digitizer"},
From mav at FreeBSD.org Fri Jan 9 20:38:22 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Fri Jan 9 20:38:39 2009
Subject: svn commit: r186969 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb netgraph
Message-ID: <200901092038.n09KcLDf067835@svn.freebsd.org>
Author: mav
Date: Fri Jan 9 20:38:21 2009
New Revision: 186969
URL: http://svn.freebsd.org/changeset/base/186969
Log:
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)
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/netgraph/ng_base.c
Modified: stable/7/sys/netgraph/ng_base.c
==============================================================================
--- stable/7/sys/netgraph/ng_base.c Fri Jan 9 20:34:32 2009 (r186968)
+++ stable/7/sys/netgraph/ng_base.c Fri Jan 9 20:38:21 2009 (r186969)
@@ -2847,8 +2847,7 @@ ng_generic_msg(node_p here, item_p item,
*/
out:
NG_RESPOND_MSG(error, here, item, resp);
- if (msg)
- NG_FREE_MSG(msg);
+ NG_FREE_MSG(msg);
return (error);
}
From mav at FreeBSD.org Fri Jan 9 20:40:21 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Fri Jan 9 20:40:35 2009
Subject: svn commit: r186970 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb netgraph
Message-ID: <200901092040.n09KeJtY067940@svn.freebsd.org>
Author: mav
Date: Fri Jan 9 20:40:19 2009
New Revision: 186970
URL: http://svn.freebsd.org/changeset/base/186970
Log:
MFC rev. 185182
Fix typo. Clear session stats instead of config and part of stats.
Found with: Coverity Prevent(tm)
CID: 2472
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/netgraph/ng_l2tp.c
Modified: stable/7/sys/netgraph/ng_l2tp.c
==============================================================================
--- stable/7/sys/netgraph/ng_l2tp.c Fri Jan 9 20:38:21 2009 (r186969)
+++ stable/7/sys/netgraph/ng_l2tp.c Fri Jan 9 20:40:19 2009 (r186970)
@@ -733,7 +733,7 @@ ng_l2tp_reset_session(hook_p hook, void
if (hpriv != NULL) {
hpriv->conf.control_dseq = 0;
hpriv->conf.enable_dseq = 0;
- bzero(&hpriv->conf, sizeof(struct ng_l2tp_session_stats));
+ bzero(&hpriv->stats, sizeof(struct ng_l2tp_session_stats));
hpriv->nr = 0;
hpriv->ns = 0;
}
From mav at FreeBSD.org Fri Jan 9 20:42:00 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Fri Jan 9 20:42:07 2009
Subject: svn commit: r186971 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb netgraph
Message-ID: <200901092041.n09KfwwJ068041@svn.freebsd.org>
Author: mav
Date: Fri Jan 9 20:41:58 2009
New Revision: 186971
URL: http://svn.freebsd.org/changeset/base/186971
Log:
MFC rev. 185183
Remove unused variable.
Found with: Coverity Prevent(tm)
CID: 3682
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/netgraph/ng_socket.c
Modified: stable/7/sys/netgraph/ng_socket.c
==============================================================================
--- stable/7/sys/netgraph/ng_socket.c Fri Jan 9 20:40:19 2009 (r186970)
+++ stable/7/sys/netgraph/ng_socket.c Fri Jan 9 20:41:58 2009 (r186971)
@@ -259,9 +259,8 @@ ngc_send(struct socket *so, int flags, s
if (msg->header.typecookie == NGM_GENERIC_COOKIE &&
msg->header.cmd == NGM_MKPEER) {
struct ngm_mkpeer *const mkp = (struct ngm_mkpeer *) msg->data;
- struct ng_type *type;
- if ((type = ng_findtype(mkp->type)) == NULL) {
+ if (ng_findtype(mkp->type) == NULL) {
char filename[NG_TYPESIZ + 3];
int fileid;
@@ -275,7 +274,7 @@ ngc_send(struct socket *so, int flags, s
}
/* See if type has been loaded successfully. */
- if ((type = ng_findtype(mkp->type)) == NULL) {
+ if (ng_findtype(mkp->type) == NULL) {
free(msg, M_NETGRAPH_MSG);
(void)kern_kldunload(curthread, fileid,
LINKER_UNLOAD_NORMAL);
From gnn at FreeBSD.org Fri Jan 9 20:43:09 2009
From: gnn at FreeBSD.org (George V. Neville-Neil)
Date: Fri Jan 9 20:43:20 2009
Subject: svn commit: r186972 - stable/7/sys/conf
Message-ID: <200901092043.n09Kh6xl068111@svn.freebsd.org>
Author: gnn
Date: Fri Jan 9 20:43:06 2009
New Revision: 186972
URL: http://svn.freebsd.org/changeset/base/186972
Log:
Revert the last checkin as it's supposed to go against HEAD first.
Modified:
stable/7/sys/conf/kern.pre.mk
Modified: stable/7/sys/conf/kern.pre.mk
==============================================================================
--- stable/7/sys/conf/kern.pre.mk Fri Jan 9 20:41:58 2009 (r186971)
+++ stable/7/sys/conf/kern.pre.mk Fri Jan 9 20:43:06 2009 (r186972)
@@ -26,7 +26,6 @@ COPTFLAGS?= -O
.else
. if defined(DEBUG)
_MINUS_O= -O
-CTFFLAGS+= -g
. else
_MINUS_O= -O2
. endif
From mav at FreeBSD.org Fri Jan 9 20:55:27 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Fri Jan 9 20:55:39 2009
Subject: svn commit: r186973 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb netgraph/netflow
Message-ID: <200901092055.n09KtQpv068452@svn.freebsd.org>
Author: mav
Date: Fri Jan 9 20:55:26 2009
New Revision: 186973
URL: http://svn.freebsd.org/changeset/base/186973
Log:
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
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/netgraph/netflow/netflow.c
stable/7/sys/netgraph/netflow/ng_netflow.c
stable/7/sys/netgraph/netflow/ng_netflow.h
Modified: stable/7/sys/netgraph/netflow/netflow.c
==============================================================================
--- stable/7/sys/netgraph/netflow/netflow.c Fri Jan 9 20:43:06 2009 (r186972)
+++ stable/7/sys/netgraph/netflow/netflow.c Fri Jan 9 20:55:26 2009 (r186973)
@@ -395,8 +395,7 @@ ng_netflow_cache_flush(priv_p priv)
/* Insert packet from into flow cache. */
int
-ng_netflow_flow_add(priv_p priv, struct ip *ip, iface_p iface,
- struct ifnet *ifp)
+ng_netflow_flow_add(priv_p priv, struct ip *ip, unsigned int src_if_index)
{
register struct flow_entry *fle, *fle1;
struct flow_hash_entry *hsh;
@@ -427,12 +426,7 @@ ng_netflow_flow_add(priv_p priv, struct
r.r_ip_p = ip->ip_p;
r.r_tos = ip->ip_tos;
- /* Configured in_ifx overrides mbuf's */
- if (iface->info.ifinfo_index == 0) {
- if (ifp != NULL)
- r.r_i_ifx = ifp->if_index;
- } else
- r.r_i_ifx = iface->info.ifinfo_index;
+ r.r_i_ifx = src_if_index;
/*
* XXX NOTE: only first fragment of fragmented TCP, UDP and
Modified: stable/7/sys/netgraph/netflow/ng_netflow.c
==============================================================================
--- stable/7/sys/netgraph/netflow/ng_netflow.c Fri Jan 9 20:43:06 2009 (r186972)
+++ stable/7/sys/netgraph/netflow/ng_netflow.c Fri Jan 9 20:55:26 2009 (r186973)
@@ -106,6 +106,14 @@ static const struct ng_parse_type ng_net
&ng_netflow_settimeouts_type_fields
};
+/* Parse type for ng_netflow_setconfig */
+static const struct ng_parse_struct_field ng_netflow_setconfig_type_fields[]
+ = NG_NETFLOW_SETCONFIG_TYPE;
+static const struct ng_parse_type ng_netflow_setconfig_type = {
+ &ng_parse_struct_type,
+ &ng_netflow_setconfig_type_fields
+};
+
/* List of commands and how to convert arguments to/from ASCII */
static const struct ng_cmdlist ng_netflow_cmds[] = {
{
@@ -143,6 +151,13 @@ static const struct ng_cmdlist ng_netflo
&ng_netflow_settimeouts_type,
NULL
},
+ {
+ NGM_NETFLOW_COOKIE,
+ NGM_NETFLOW_SETCONFIG,
+ "setconfig",
+ &ng_netflow_setconfig_type,
+ NULL
+ },
{ 0 }
};
@@ -167,7 +182,7 @@ static int
ng_netflow_constructor(node_p node)
{
priv_p priv;
- int error = 0;
+ int error = 0, i;
/* Initialize private data */
MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT);
@@ -183,6 +198,10 @@ ng_netflow_constructor(node_p node)
priv->info.nfinfo_inact_t = INACTIVE_TIMEOUT;
priv->info.nfinfo_act_t = ACTIVE_TIMEOUT;
+ /* Set default config */
+ for (i = 0; i < NG_NETFLOW_MAXIFACES; i++)
+ priv->ifaces[i].info.conf = NG_NETFLOW_CONF_INGRESS;
+
/* Initialize callout handle */
callout_init(&priv->exp_callout, CALLOUT_MPSAFE);
@@ -399,6 +418,22 @@ ng_netflow_rcvmsg (node_p node, item_p i
break;
}
+ case NGM_NETFLOW_SETCONFIG:
+ {
+ struct ng_netflow_setconfig *set;
+
+ if (msg->header.arglen != sizeof(struct ng_netflow_settimeouts))
+ ERROUT(EINVAL);
+
+ set = (struct ng_netflow_setconfig *)msg->data;
+
+ if (set->iface >= NG_NETFLOW_MAXIFACES)
+ ERROUT(EINVAL);
+
+ priv->ifaces[set->iface].info.conf = set->conf;
+
+ break;
+ }
case NGM_NETFLOW_SHOW:
{
uint32_t *last;
@@ -445,10 +480,13 @@ ng_netflow_rcvdata (hook_p hook, item_p
const node_p node = NG_HOOK_NODE(hook);
const priv_p priv = NG_NODE_PRIVATE(node);
const iface_p iface = NG_HOOK_PRIVATE(hook);
+ hook_p out;
struct mbuf *m = NULL;
struct ip *ip;
+ struct m_tag *mtag;
int pullup_len = 0;
- int error = 0;
+ int error = 0, bypass = 0;
+ unsigned int src_if_index;
if (hook == priv->export) {
/*
@@ -459,16 +497,48 @@ ng_netflow_rcvdata (hook_p hook, item_p
ERROUT(EINVAL);
};
- if (hook == iface->out) {
- /*
- * Data arrived on out hook. Bypass it.
- */
- if (iface->hook == NULL)
+ if (hook == iface->hook) {
+ if ((iface->info.conf & NG_NETFLOW_CONF_INGRESS) == 0)
+ bypass = 1;
+ out = iface->out;
+ } else if (hook == iface->out) {
+ if ((iface->info.conf & NG_NETFLOW_CONF_EGRESS) == 0)
+ bypass = 1;
+ out = iface->hook;
+ } else
+ ERROUT(EINVAL);
+
+ if ((!bypass) &&
+ (iface->info.conf & (NG_NETFLOW_CONF_ONCE | NG_NETFLOW_CONF_THISONCE))) {
+ mtag = m_tag_locate(NGI_M(item), MTAG_NETFLOW,
+ MTAG_NETFLOW_CALLED, NULL);
+ while (mtag != NULL) {
+ if ((iface->info.conf & NG_NETFLOW_CONF_ONCE) ||
+ ((ng_ID_t *)(mtag + 1))[0] == NG_NODE_ID(node)) {
+ bypass = 1;
+ break;
+ }
+ mtag = m_tag_locate(NGI_M(item), MTAG_NETFLOW,
+ MTAG_NETFLOW_CALLED, mtag);
+ }
+ }
+
+ if (bypass) {
+ if (out == NULL)
ERROUT(ENOTCONN);
- NG_FWD_ITEM_HOOK(error, item, iface->hook);
+ NG_FWD_ITEM_HOOK(error, item, out);
return (error);
}
+
+ if (iface->info.conf & (NG_NETFLOW_CONF_ONCE | NG_NETFLOW_CONF_THISONCE)) {
+ mtag = m_tag_alloc(MTAG_NETFLOW, MTAG_NETFLOW_CALLED,
+ sizeof(ng_ID_t), M_NOWAIT);
+ if (mtag) {
+ ((ng_ID_t *)(mtag + 1))[0] = NG_NODE_ID(node);
+ m_tag_prepend(NGI_M(item), mtag);
+ }
+ }
NGI_GET_M(item, m);
@@ -592,12 +662,20 @@ ng_netflow_rcvdata (hook_p hook, item_p
#undef M_CHECK
- error = ng_netflow_flow_add(priv, ip, iface, m->m_pkthdr.rcvif);
+ /* Determine packet input interface. Prefer configured. */
+ src_if_index = 0;
+ if (hook == iface->out || iface->info.ifinfo_index == 0) {
+ if (m->m_pkthdr.rcvif != NULL)
+ src_if_index = m->m_pkthdr.rcvif->if_index;
+ } else
+ src_if_index = iface->info.ifinfo_index;
+
+ error = ng_netflow_flow_add(priv, ip, src_if_index);
bypass:
- if (iface->out != NULL) {
+ if (out != NULL) {
/* XXX: error gets overwritten here */
- NG_FWD_NEW_DATA(error, item, iface->out, m);
+ NG_FWD_NEW_DATA(error, item, out, m);
return (error);
}
done:
Modified: stable/7/sys/netgraph/netflow/ng_netflow.h
==============================================================================
--- stable/7/sys/netgraph/netflow/ng_netflow.h Fri Jan 9 20:43:06 2009 (r186972)
+++ stable/7/sys/netgraph/netflow/ng_netflow.h Fri Jan 9 20:55:26 2009 (r186973)
@@ -50,6 +50,7 @@ enum {
NGM_NETFLOW_SETDLT = 4, /* set data-link type */
NGM_NETFLOW_SETIFINDEX = 5, /* set interface index */
NGM_NETFLOW_SETTIMEOUTS = 6, /* set active/inactive flow timeouts */
+ NGM_NETFLOW_SETCONFIG = 7, /* set flow generation options */
};
/* This structure is returned by the NGM_NETFLOW_INFO message */
@@ -71,6 +72,7 @@ struct ng_netflow_ifinfo {
uint8_t ifinfo_dlt; /* Data Link Type, DLT_XXX */
#define MAXDLTNAMELEN 20
u_int16_t ifinfo_index; /* connected iface index */
+ uint32_t conf;
};
@@ -92,6 +94,17 @@ struct ng_netflow_settimeouts {
uint32_t active_timeout; /* flow active timeout */
};
+#define NG_NETFLOW_CONF_INGRESS 1
+#define NG_NETFLOW_CONF_EGRESS 2
+#define NG_NETFLOW_CONF_ONCE 4
+#define NG_NETFLOW_CONF_THISONCE 8
+
+/* This structure is passed to NGM_NETFLOW_SETCONFIG */
+struct ng_netflow_setconfig {
+ u_int16_t iface; /* which iface config change */
+ u_int32_t conf; /* new config */
+};
+
/* This is unique data, which identifies flow */
struct flow_rec {
struct in_addr r_src;
@@ -182,6 +195,7 @@ struct flow_entry {
{ "packets", &ng_parse_uint32_type }, \
{ "data link type", &ng_parse_uint8_type }, \
{ "index", &ng_parse_uint16_type }, \
+ { "conf", &ng_parse_uint32_type }, \
{ NULL } \
}
@@ -206,6 +220,13 @@ struct flow_entry {
{ NULL } \
}
+/* Parse the setifindex structure */
+#define NG_NETFLOW_SETCONFIG_TYPE { \
+ { "iface", &ng_parse_uint16_type }, \
+ { "conf", &ng_parse_uint32_type }, \
+ { NULL } \
+}
+
/* Private hook data */
struct ng_netflow_iface {
hook_p hook; /* NULL when disconnected */
@@ -263,12 +284,15 @@ struct flow_hash_entry {
#define ERROUT(x) { error = (x); goto done; }
+#define MTAG_NETFLOW 1221656444
+#define MTAG_NETFLOW_CALLED 0
+
/* Prototypes for netflow.c */
int ng_netflow_cache_init(priv_p);
void ng_netflow_cache_flush(priv_p);
void ng_netflow_copyinfo(priv_p, struct ng_netflow_info *);
timeout_t ng_netflow_expire;
-int ng_netflow_flow_add(priv_p, struct ip *, iface_p, struct ifnet *);
+int ng_netflow_flow_add(priv_p, struct ip *, unsigned int src_if_index);
int ng_netflow_flow_show(priv_p, uint32_t last, struct ng_mesg *);
#endif /* _KERNEL */
From mav at FreeBSD.org Fri Jan 9 20:57:02 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Fri Jan 9 20:57:08 2009
Subject: svn commit: r186974 - stable/7/share/man/man4
Message-ID: <200901092057.n09Kv12s068547@svn.freebsd.org>
Author: mav
Date: Fri Jan 9 20:57:01 2009
New Revision: 186974
URL: http://svn.freebsd.org/changeset/base/186974
Log:
MFC rev. 183695
Document new NGM_NETFLOW_SETCONFIG control message.
Modified:
stable/7/share/man/man4/ (props changed)
stable/7/share/man/man4/igb.4 (props changed)
stable/7/share/man/man4/ng_netflow.4
Modified: stable/7/share/man/man4/ng_netflow.4
==============================================================================
--- stable/7/share/man/man4/ng_netflow.4 Fri Jan 9 20:55:26 2009 (r186973)
+++ stable/7/share/man/man4/ng_netflow.4 Fri Jan 9 20:57:01 2009 (r186974)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 2, 2006
+.Dd October 8, 2008
.Os
.Dt NG_NETFLOW 4
.Sh NAME
@@ -71,7 +71,8 @@ and the same number of hooks named
etc.,
plus a single hook named
.Va export .
-The node does NetFlow accounting of data received on
+By default (ingress NetFlow enabled) node does NetFlow accounting of data
+received on
.Va iface*
hooks.
If corresponding
@@ -81,7 +82,7 @@ If data is received on
.Va out
hook, it is bypassed to corresponding
.Va iface
-hook without any processing.
+hook without any processing (egress NetFlow disabled by default).
When full export datagram is built it is sent to the
.Va export
hook.
@@ -162,6 +163,31 @@ struct ng_netflow_settimeouts {
uint32_t active_timeout;
};
.Ed
+.It Dv NGM_NETFLOW_SETCONFIG
+Sets configuration for the specified interface.
+This message requires
+.Vt "struct ng_netflow_setconfig"
+as an argument:
+.Bd -literal -offset 4n
+struct ng_netflow_setconfig {
+ u_int16_t iface;
+ u_int32_t conf;
+#define NG_NETFLOW_CONF_INGRESS 1
+#define NG_NETFLOW_CONF_EGRESS 2
+#define NG_NETFLOW_CONF_ONCE 4
+#define NG_NETFLOW_CONF_THISONCE 8
+};
+.Ed
+.Pp
+Configuration is a bitmask of several options. Option NG_NETFLOW_CONF_INGRESS
+enabled by default enables ingress NetFlow generation (for data coming from
+ifaceX hook). Option NG_NETFLOW_CONF_EGRESS enables egress NetFlow (for data
+coming from outX hook). Option NG_NETFLOW_CONF_ONCE defines that packet should
+be accounted only once if it several times passes via netflow node. Option
+NG_NETFLOW_CONF_THISONCE defines that packet should be accounted only once
+if it several times passes via exactly this netflow node. Last two options are
+important to avoid duplicate accounting when both ingress and egress NetFlow
+are enabled.
.It Dv NGM_NETFLOW_SHOW
This control message asks a node to dump the entire contents of the flow cache.
It is called from
@@ -191,6 +217,8 @@ commands are:
.Qq Li "setifindex { iface = %u index = %u }"
.It Dv NGM_NETFLOW_SETTIMEOUTS
.Qq Li "settimeouts { inactive = %u active = %u }"
+.It Dv NGM_NETFLOW_SETCONFIG
+.Qq Li "setconfig { iface = %u conf = %u }"
.El
.Sh SHUTDOWN
This node shuts down upon receipt of a
From mav at FreeBSD.org Fri Jan 9 21:02:55 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Fri Jan 9 21:03:02 2009
Subject: svn commit: r186976 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb netgraph
Message-ID: <200901092102.n09L2sMa068794@svn.freebsd.org>
Author: mav
Date: Fri Jan 9 21:02:54 2009
New Revision: 186976
URL: http://svn.freebsd.org/changeset/base/186976
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/netgraph/ng_base.c
Modified: stable/7/sys/netgraph/ng_base.c
==============================================================================
--- stable/7/sys/netgraph/ng_base.c Fri Jan 9 20:57:43 2009 (r186975)
+++ stable/7/sys/netgraph/ng_base.c Fri Jan 9 21:02:54 2009 (r186976)
@@ -2377,19 +2377,27 @@ ng_apply_item(node_p node, item_p item,
case NGQF_FN:
case NGQF_FN2:
/*
- * We have to implicitly trust the hook,
- * as some of these are used for system purposes
- * where the hook is invalid. In the case of
- * the shutdown message we allow it to hit
+ * In the case of the shutdown message we allow it to hit
* even if the node is invalid.
*/
- if ((NG_NODE_NOT_VALID(node))
- && (NGI_FN(item) != &ng_rmnode)) {
+ if (NG_NODE_NOT_VALID(node) &&
+ NGI_FN(item) != &ng_rmnode) {
TRAP_ERROR();
error = EINVAL;
NG_FREE_ITEM(item);
break;
}
+ /* Same is about some internal functions and invalid hook. */
+ if (hook && NG_HOOK_NOT_VALID(hook) &&
+ NGI_FN2(item) != &ng_con_part2 &&
+ NGI_FN2(item) != &ng_con_part3 &&
+ NGI_FN(item) != &ng_rmhook_part2) {
+ TRAP_ERROR();
+ error = EINVAL;
+ NG_FREE_ITEM(item);
+ break;
+ }
+
if ((item->el_flags & NGQF_TYPE) == NGQF_FN) {
(*NGI_FN(item))(node, hook, NGI_ARG1(item),
NGI_ARG2(item));
From mav at FreeBSD.org Fri Jan 9 22:10:08 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Fri Jan 9 22:10:16 2009
Subject: svn commit: r186982 - stable/7/usr.sbin/powerd
Message-ID: <200901092210.n09MA7Xb070527@svn.freebsd.org>
Author: mav
Date: Fri Jan 9 22:10:07 2009
New Revision: 186982
URL: http://svn.freebsd.org/changeset/base/186982
Log:
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@
Modified:
stable/7/usr.sbin/powerd/powerd.8
stable/7/usr.sbin/powerd/powerd.c
Modified: stable/7/usr.sbin/powerd/powerd.8
==============================================================================
--- stable/7/usr.sbin/powerd/powerd.8 Fri Jan 9 22:06:48 2009 (r186981)
+++ stable/7/usr.sbin/powerd/powerd.8 Fri Jan 9 22:10:07 2009 (r186982)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 6, 2005
+.Dd December 24, 2008
.Dt POWERD 8
.Os
.Sh NAME
@@ -47,7 +47,8 @@ utility monitors the system state and se
accordingly.
It offers three modes (maximum, minimum, and adaptive) that can be
individually selected while on AC power or batteries.
-The modes maximum, minimum, and adaptive may be abbreviated max, min, adp.
+The modes maximum, minimum, adaptive and hiadaptive may be abbreviated
+max, min, adp, hadp.
.Pp
Maximum mode chooses the highest performance values.
Minimum mode selects the lowest performance values to get the most power
@@ -56,8 +57,10 @@ Adaptive mode attempts to strike a balan
the system appears idle and increasing it when the system is busy.
It offers a good balance between a small performance loss for greatly
increased power savings.
-The default mode is
-adaptive.
+Hiadaptive mode is alike adaptive mode, but tuned for systems where
+performance and interactivity are more important then power consumption.
+It rises frequency faster, drops slower and keeps twice lower CPU load.
+The default mode is adaptive for battery power and hiadaptive for the rest.
.Pp
The
.Nm
@@ -72,10 +75,9 @@ Selects the
.Ar mode
to use while on battery power.
.It Fl i Ar percent
-Specifies the CPU idle percent level when
-adaptive
+Specifies the CPU load percent level when adaptive
mode should begin to degrade performance to save power.
-The default is 90% or higher.
+The default is 50% or lower.
.It Fl n Ar mode
Selects the
.Ar mode
@@ -83,16 +85,15 @@ to use normally when the AC line state i
.It Fl p Ar ival
Specifies a different polling interval (in milliseconds) for AC line state
and system idle levels.
-The default is 500 ms.
+The default is 250 ms.
.It Fl P Ar pidfile
Specifies an alternative file in which the process ID should be stored.
The default is
.Pa /var/run/powerd.pid .
.It Fl r Ar percent
-Specifies the CPU idle percent level where
-adaptive
+Specifies the CPU load percent level where adaptive
mode should consider the CPU running and increase performance.
-The default is 65% or lower.
+The default is 75% or higher.
.It Fl v
Verbose mode.
Messages about power changes will be printed to stdout and
Modified: stable/7/usr.sbin/powerd/powerd.c
==============================================================================
--- stable/7/usr.sbin/powerd/powerd.c Fri Jan 9 22:06:48 2009 (r186981)
+++ stable/7/usr.sbin/powerd/powerd.c Fri Jan 9 22:10:07 2009 (r186982)
@@ -50,13 +50,14 @@ __FBSDID("$FreeBSD$");
#include
#endif
-#define DEFAULT_ACTIVE_PERCENT 65
-#define DEFAULT_IDLE_PERCENT 90
-#define DEFAULT_POLL_INTERVAL 500 /* Poll interval in milliseconds */
+#define DEFAULT_ACTIVE_PERCENT 75
+#define DEFAULT_IDLE_PERCENT 50
+#define DEFAULT_POLL_INTERVAL 250 /* Poll interval in milliseconds */
typedef enum {
MODE_MIN,
MODE_ADAPTIVE,
+ MODE_HIADAPTIVE,
MODE_MAX,
} modes_t;
@@ -77,7 +78,7 @@ const char *modes[] = {
#define DEVDPIPE "/var/run/devd.pipe"
#define DEVCTL_MAXBUF 1024
-static int read_usage_times(long *idle, long *total);
+static int read_usage_times(int *load);
static int read_freqs(int *numfreqs, int **freqs, int **power);
static int set_freq(int freq);
static void acline_init(void);
@@ -89,7 +90,7 @@ static void parse_mode(char *arg, int *m
static void usage(void);
/* Sysctl data structures. */
-static int cp_time_mib[2];
+static int cp_times_mib[2];
static int freq_mib[4];
static int levels_mib[4];
static int acline_mib[3];
@@ -119,27 +120,49 @@ static int devd_pipe = -1;
static struct timeval tried_devd;
static int
-read_usage_times(long *idle, long *total)
+read_usage_times(int *load)
{
- static long idle_old, total_old;
- long cp_time[CPUSTATES], i, total_new;
- size_t cp_time_len;
- int error;
+ static long *cp_times = NULL, *cp_times_old = NULL;
+ static int ncpus = 0;
+ size_t cp_times_len;
+ int error, cpu, i, total;
+
+ if (cp_times == NULL) {
+ cp_times_len = 0;
+ error = sysctl(cp_times_mib, 2, NULL, &cp_times_len, NULL, 0);
+ if (error)
+ return (error);
+ if ((cp_times = malloc(cp_times_len)) == NULL)
+ return (errno);
+ if ((cp_times_old = malloc(cp_times_len)) == NULL) {
+ free(cp_times);
+ cp_times = NULL;
+ return (errno);
+ }
+ ncpus = cp_times_len / (sizeof(long) * CPUSTATES);
+ }
- cp_time_len = sizeof(cp_time);
- error = sysctl(cp_time_mib, 2, cp_time, &cp_time_len, NULL, 0);
+ cp_times_len = sizeof(long) * CPUSTATES * ncpus;
+ error = sysctl(cp_times_mib, 2, cp_times, &cp_times_len, NULL, 0);
if (error)
return (error);
- for (total_new = 0, i = 0; i < CPUSTATES; i++)
- total_new += cp_time[i];
-
- if (idle)
- *idle = cp_time[CP_IDLE] - idle_old;
- if (total)
- *total = total_new - total_old;
+
+ if (load) {
+ *load = 0;
+ for (cpu = 0; cpu < ncpus; cpu++) {
+ total = 0;
+ for (i = 0; i < CPUSTATES; i++) {
+ total += cp_times[cpu * CPUSTATES + i] -
+ cp_times_old[cpu * CPUSTATES + i];
+ }
+ if (total == 0)
+ continue;
+ *load += 100 - (cp_times[cpu * CPUSTATES + CP_IDLE] -
+ cp_times_old[cpu * CPUSTATES + CP_IDLE]) * 100 / total;
+ }
+ }
- idle_old = cp_time[CP_IDLE];
- total_old = total_new;
+ memcpy(cp_times_old, cp_times, cp_times_len);
return (0);
}
@@ -190,6 +213,21 @@ read_freqs(int *numfreqs, int **freqs, i
}
static int
+get_freq(void)
+{
+ size_t len;
+ int curfreq;
+
+ len = sizeof(curfreq);
+ if (sysctl(freq_mib, 4, &curfreq, &len, NULL, 0) != 0) {
+ if (vflag)
+ warn("error reading current CPU frequency");
+ curfreq = 0;
+ }
+ return (curfreq);
+}
+
+static int
set_freq(int freq)
{
@@ -201,6 +239,19 @@ set_freq(int freq)
return (0);
}
+static int
+get_freq_id(int freq, int *freqs, int numfreqs)
+{
+ int i = 1;
+
+ while (i < numfreqs) {
+ if (freqs[i] < freq)
+ break;
+ i++;
+ }
+ return (i - 1);
+}
+
/*
* Try to use ACPI to find the AC line status. If this fails, fall back
* to APM. If nothing succeeds, we'll just run in default mode.
@@ -341,6 +392,8 @@ parse_mode(char *arg, int *mode, int ch)
*mode = MODE_MAX;
else if (strcmp(arg, "adaptive") == 0 || strcmp(arg, "adp") == 0)
*mode = MODE_ADAPTIVE;
+ else if (strcmp(arg, "hiadaptive") == 0 || strcmp(arg, "hadp") == 0)
+ *mode = MODE_HIADAPTIVE;
else
errx(1, "bad option: -%c %s", (char)ch, optarg);
}
@@ -369,14 +422,14 @@ main(int argc, char * argv[])
int nfds;
struct pidfh *pfh = NULL;
const char *pidfile = NULL;
- long idle, total;
- int curfreq, *freqs, i, *mwatts, numfreqs;
+ int freq, curfreq, initfreq, *freqs, i, j, *mwatts, numfreqs, load;
int ch, mode, mode_ac, mode_battery, mode_none;
uint64_t mjoules_used;
size_t len;
/* Default mode for all AC states is adaptive. */
- mode_ac = mode_battery = mode_none = MODE_ADAPTIVE;
+ mode_ac = mode_none = MODE_HIADAPTIVE;
+ mode_battery = MODE_ADAPTIVE;
cpu_running_mark = DEFAULT_ACTIVE_PERCENT;
cpu_idle_mark = DEFAULT_IDLE_PERCENT;
poll_ival = DEFAULT_POLL_INTERVAL;
@@ -387,7 +440,7 @@ main(int argc, char * argv[])
if (geteuid() != 0)
errx(1, "must be root to run");
- while ((ch = getopt(argc, argv, "a:b:i:n:p:P:r:v")) != EOF)
+ while ((ch = getopt(argc, argv, "a:b:i:n:p:P:r:v")) != -1)
switch (ch) {
case 'a':
parse_mode(optarg, &mode_ac, ch);
@@ -418,7 +471,7 @@ main(int argc, char * argv[])
break;
case 'r':
cpu_running_mark = atoi(optarg);
- if (cpu_running_mark < 0 || cpu_running_mark > 100) {
+ if (cpu_running_mark <= 0 || cpu_running_mark > 100) {
warnx("%d is not a valid percent",
cpu_running_mark);
usage();
@@ -438,8 +491,8 @@ main(int argc, char * argv[])
/* Look up various sysctl MIBs. */
len = 2;
- if (sysctlnametomib("kern.cp_time", cp_time_mib, &len))
- err(1, "lookup kern.cp_time");
+ if (sysctlnametomib("kern.cp_times", cp_times_mib, &len))
+ err(1, "lookup kern.cp_times");
len = 4;
if (sysctlnametomib("dev.cpu.0.freq", freq_mib, &len))
err(1, "lookup freq");
@@ -447,8 +500,8 @@ main(int argc, char * argv[])
if (sysctlnametomib("dev.cpu.0.freq_levels", levels_mib, &len))
err(1, "lookup freq_levels");
- /* Check if we can read the idle time and supported freqs. */
- if (read_usage_times(NULL, NULL))
+ /* Check if we can read the load and supported freqs. */
+ if (read_usage_times(NULL))
err(1, "read_usage_times");
if (read_freqs(&numfreqs, &freqs, &mwatts))
err(1, "error reading supported CPU frequencies");
@@ -483,6 +536,9 @@ main(int argc, char * argv[])
signal(SIGINT, handle_sigs);
signal(SIGTERM, handle_sigs);
+ freq = initfreq = get_freq();
+ if (freq < 1)
+ freq = 1;
/* Main loop. */
for (;;) {
FD_ZERO(&fdset);
@@ -522,37 +578,30 @@ main(int argc, char * argv[])
}
/* Read the current frequency. */
- len = sizeof(curfreq);
- if (sysctl(freq_mib, 4, &curfreq, &len, NULL, 0) != 0) {
- if (vflag)
- warn("error reading current CPU frequency");
+ if ((curfreq = get_freq()) == 0)
continue;
- }
+ i = get_freq_id(curfreq, freqs, numfreqs);
+
if (vflag) {
- for (i = 0; i < numfreqs; i++) {
- if (freqs[i] == curfreq)
- break;
- }
-
/* Keep a sum of all power actually used. */
- if (i < numfreqs && mwatts[i] != -1)
+ if (mwatts[i] != -1)
mjoules_used +=
(mwatts[i] * (poll_ival / 1000)) / 1000;
}
/* Always switch to the lowest frequency in min mode. */
if (mode == MODE_MIN) {
- if (curfreq != freqs[numfreqs - 1]) {
+ freq = freqs[numfreqs - 1];
+ if (curfreq != freq) {
if (vflag) {
printf("now operating on %s power; "
"changing frequency to %d MHz\n",
- modes[acline_status],
- freqs[numfreqs - 1]);
+ modes[acline_status], freq);
}
- if (set_freq(freqs[numfreqs - 1]) != 0) {
+ if (set_freq(freq) != 0) {
warn("error setting CPU freq %d",
- freqs[numfreqs - 1]);
+ freq);
continue;
}
}
@@ -561,16 +610,16 @@ main(int argc, char * argv[])
/* Always switch to the highest frequency in max mode. */
if (mode == MODE_MAX) {
- if (curfreq != freqs[0]) {
+ freq = freqs[0];
+ if (curfreq != freq) {
if (vflag) {
printf("now operating on %s power; "
"changing frequency to %d MHz\n",
- modes[acline_status],
- freqs[0]);
+ modes[acline_status], freq);
}
- if (set_freq(freqs[0]) != 0) {
+ if (set_freq(freq) != 0) {
warn("error setting CPU freq %d",
- freqs[0]);
+ freq);
continue;
}
}
@@ -578,46 +627,63 @@ main(int argc, char * argv[])
}
/* Adaptive mode; get the current CPU usage times. */
- if (read_usage_times(&idle, &total)) {
+ if (read_usage_times(&load)) {
if (vflag)
warn("read_usage_times() failed");
continue;
}
-
- /*
- * If we're idle less than the active mark, bump up two levels.
- * If we're idle more than the idle mark, drop down one level.
- */
- for (i = 0; i < numfreqs - 1; i++) {
- if (freqs[i] == curfreq)
- break;
- }
- if (idle < (total * cpu_running_mark) / 100 &&
- curfreq < freqs[0]) {
- i -= 2;
- if (i < 0)
- i = 0;
- if (vflag) {
- printf("idle time < %d%%, increasing clock"
- " speed from %d MHz to %d MHz\n",
- cpu_running_mark, curfreq, freqs[i]);
+
+ if (mode == MODE_ADAPTIVE) {
+ if (load > cpu_running_mark) {
+ if (load > 95 || load > cpu_running_mark * 2)
+ freq *= 2;
+ else
+ freq = freq * load / cpu_running_mark;
+ if (freq > freqs[0])
+ freq = freqs[0];
+ } else if (load < cpu_idle_mark &&
+ curfreq * load < freqs[get_freq_id(
+ freq * 7 / 8, freqs, numfreqs)] *
+ cpu_running_mark) {
+ freq = freq * 7 / 8;
+ if (freq < freqs[numfreqs - 1])
+ freq = freqs[numfreqs - 1];
}
- if (set_freq(freqs[i]))
- warn("error setting CPU frequency %d",
- freqs[i]);
- } else if (idle > (total * cpu_idle_mark) / 100 &&
- curfreq > freqs[numfreqs - 1]) {
- i++;
+ } else { /* MODE_HIADAPTIVE */
+ if (load > cpu_running_mark / 2) {
+ if (load > 95 || load > cpu_running_mark)
+ freq *= 4;
+ else
+ freq = freq * load * 2 / cpu_running_mark;
+ if (freq > freqs[0] * 2)
+ freq = freqs[0] * 2;
+ } else if (load < cpu_idle_mark / 2 &&
+ curfreq * load < freqs[get_freq_id(
+ freq * 31 / 32, freqs, numfreqs)] *
+ cpu_running_mark / 2) {
+ freq = freq * 31 / 32;
+ if (freq < freqs[numfreqs - 1])
+ freq = freqs[numfreqs - 1];
+ }
+ }
+ if (vflag) {
+ printf("load %3d%%, current freq %4d MHz (%2d), wanted freq %4d MHz\n",
+ load, curfreq, i, freq);
+ }
+ j = get_freq_id(freq, freqs, numfreqs);
+ if (i != j) {
if (vflag) {
- printf("idle time > %d%%, decreasing clock"
+ printf("changing clock"
" speed from %d MHz to %d MHz\n",
- cpu_idle_mark, curfreq, freqs[i]);
+ freqs[i], freqs[j]);
}
- if (set_freq(freqs[i]) != 0)
+ if (set_freq(freqs[j]))
warn("error setting CPU frequency %d",
- freqs[i]);
+ freqs[j]);
}
}
+ if (set_freq(initfreq))
+ warn("error setting CPU frequency %d", initfreq);
free(freqs);
free(mwatts);
devd_close();
From mav at FreeBSD.org Fri Jan 9 22:19:50 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Fri Jan 9 22:20:02 2009
Subject: svn commit: r186983 - stable/7
Message-ID: <200901092219.n09MJm8F070743@svn.freebsd.org>
Author: mav
Date: Fri Jan 9 22:19:48 2009
New Revision: 186983
URL: http://svn.freebsd.org/changeset/base/186983
Log:
powerd(8) was updated to get better SMP support.
Meanings of the -i and -r command line options were changed.
Modified:
stable/7/UPDATING
Modified: stable/7/UPDATING
==============================================================================
--- stable/7/UPDATING Fri Jan 9 22:10:07 2009 (r186982)
+++ stable/7/UPDATING Fri Jan 9 22:19:48 2009 (r186983)
@@ -8,6 +8,10 @@ Items affecting the ports and packages s
/usr/ports/UPDATING. Please read that file before running
portupgrade.
+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.
From rwatson at FreeBSD.org Fri Jan 9 23:14:14 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Fri Jan 9 23:14:26 2009
Subject: svn commit: r186982 - stable/7/usr.sbin/powerd
In-Reply-To: <200901092210.n09MA7Xb070527@svn.freebsd.org>
References: <200901092210.n09MA7Xb070527@svn.freebsd.org>
Message-ID:
On Fri, 9 Jan 2009, Alexander Motin wrote:
> Modified:
> stable/7/usr.sbin/powerd/powerd.8
> stable/7/usr.sbin/powerd/powerd.c
I notice that you didn't use svn merge for this MFC, so there's no tracking of
what revs were merged. Was it just everything to date?
Robert N M Watson
Computer Laboratory
University of Cambridge
From mav at FreeBSD.org Sat Jan 10 00:31:13 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Sat Jan 10 00:31:29 2009
Subject: svn commit: r186982 - stable/7/usr.sbin/powerd
In-Reply-To:
References: <200901092210.n09MA7Xb070527@svn.freebsd.org>
Message-ID: <4967DE41.20109@FreeBSD.org>
Robert Watson wrote:
>
> On Fri, 9 Jan 2009, Alexander Motin wrote:
>
>> Modified:
>> stable/7/usr.sbin/powerd/powerd.8
>> stable/7/usr.sbin/powerd/powerd.c
>
> I notice that you didn't use svn merge for this MFC, so there's no
> tracking of what revs were merged. Was it just everything to date?
I just copied files completely, so everything is merged now.
AFAIK it was decided that merge info is not mandatory before 9.x
branching. I'm just not very good with this merge stuff yet.
--
Alexander Motin
From dougb at FreeBSD.org Sat Jan 10 00:40:44 2009
From: dougb at FreeBSD.org (Doug Barton)
Date: Sat Jan 10 00:40:55 2009
Subject: svn commit: r186982 - stable/7/usr.sbin/powerd
In-Reply-To: <4967DE41.20109@FreeBSD.org>
References: <200901092210.n09MA7Xb070527@svn.freebsd.org>
<4967DE41.20109@FreeBSD.org>
Message-ID: <4967E849.8070100@FreeBSD.org>
Alexander Motin wrote:
> Robert Watson wrote:
>>
>> On Fri, 9 Jan 2009, Alexander Motin wrote:
>>
>>> Modified:
>>> stable/7/usr.sbin/powerd/powerd.8
>>> stable/7/usr.sbin/powerd/powerd.c
>>
>> I notice that you didn't use svn merge for this MFC, so there's no
>> tracking of what revs were merged. Was it just everything to date?
>
> I just copied files completely, so everything is merged now.
>
> AFAIK it was decided that merge info is not mandatory before 9.x
> branching. I'm just not very good with this merge stuff yet.
For something like this it's quite simple, just do the merge in
usr.sbin/powerd. Let's say you want to merge all the changes starting
with r185050:
Set REPO to something useful like svn+ssh://svn.freebsd.org/base/
svn merge -r 185050:186476 $REPO/head/usr.sbin/powerd .
If you want to cherry-pick individual changes, use for example '-c
185050' instead of the -r option above.
And the good news is that it's not too late to record your merge info.
Figure out the range of changes that you have incorporated into the
latest update, and use -r and the --record only option to merge.
hth,
Doug
--
This .signature sanitized for your protection
From mav at FreeBSD.org Sat Jan 10 00:41:31 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Sat Jan 10 00:41:49 2009
Subject: svn commit: r186991 - stable/7/usr.sbin/powerd
Message-ID: <200901100041.n0A0fUp3073999@svn.freebsd.org>
Author: mav
Date: Sat Jan 10 00:41:30 2009
New Revision: 186991
URL: http://svn.freebsd.org/changeset/base/186991
Log:
Mark that powerd is completely merged.
Modified:
stable/7/usr.sbin/powerd/ (props changed)
From mav at FreeBSD.org Sat Jan 10 01:22:25 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Sat Jan 10 01:22:37 2009
Subject: svn commit: r186992 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb
Message-ID: <200901100122.n0A1MOhc075371@svn.freebsd.org>
Author: mav
Date: Sat Jan 10 01:22:23 2009
New Revision: 186992
URL: http://svn.freebsd.org/changeset/base/186992
Log:
Mark all snd_hda commits up to 186511 as merged.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
From dougb at FreeBSD.org Sat Jan 10 03:00:23 2009
From: dougb at FreeBSD.org (Doug Barton)
Date: Sat Jan 10 03:00:38 2009
Subject: svn commit: r186996 - in stable/7/contrib/bind9: . bin/check
bin/dig bin/dnssec bin/named bin/named/include/named
bin/named/unix bin/named/unix/include/named bin/nsupdate
bin/rndc doc/arm doc/misc ...
Message-ID: <200901100300.n0A30M5b077529@svn.freebsd.org>
Author: dougb
Date: Sat Jan 10 03:00:21 2009
New Revision: 186996
URL: http://svn.freebsd.org/changeset/base/186996
Log:
MFC the BIND 9.4.3 and 9.4.3-P1 updates
Added:
stable/7/contrib/bind9/aclocal.m4
- copied unchanged from r186462, head/contrib/bind9/aclocal.m4
stable/7/contrib/bind9/bin/nsupdate/nsupdate.1
- copied unchanged from r186462, head/contrib/bind9/bin/nsupdate/nsupdate.1
stable/7/contrib/bind9/config.h.in
- copied unchanged from r186462, head/contrib/bind9/config.h.in
stable/7/contrib/bind9/doc/misc/sort-options.pl
- copied unchanged from r186462, head/contrib/bind9/doc/misc/sort-options.pl
stable/7/contrib/bind9/doc/rfc/rfc4648.txt
- copied unchanged from r186462, head/contrib/bind9/doc/rfc/rfc4648.txt
stable/7/contrib/bind9/doc/rfc/rfc4701.txt
- copied unchanged from r186462, head/contrib/bind9/doc/rfc/rfc4701.txt
stable/7/contrib/bind9/doc/rfc/rfc5155.txt
- copied unchanged from r186462, head/contrib/bind9/doc/rfc/rfc5155.txt
stable/7/contrib/bind9/lib/bind/aclocal.m4
- copied unchanged from r186462, head/contrib/bind9/lib/bind/aclocal.m4
stable/7/contrib/bind9/lib/bind/config.h.in
- copied unchanged from r186462, head/contrib/bind9/lib/bind/config.h.in
stable/7/contrib/bind9/lib/bind/include/isc/platform.h.in
- copied unchanged from r186462, head/contrib/bind9/lib/bind/include/isc/platform.h.in
stable/7/contrib/bind9/lib/isc/include/isc/portset.h
- copied unchanged from r186462, head/contrib/bind9/lib/isc/include/isc/portset.h
stable/7/contrib/bind9/lib/isc/portset.c
- copied unchanged from r186462, head/contrib/bind9/lib/isc/portset.c
Deleted:
stable/7/contrib/bind9/bin/nsupdate/nsupdate.8
Modified:
stable/7/contrib/bind9/ (props changed)
stable/7/contrib/bind9/CHANGES
stable/7/contrib/bind9/COPYRIGHT
stable/7/contrib/bind9/FAQ
stable/7/contrib/bind9/FAQ.xml
stable/7/contrib/bind9/README
stable/7/contrib/bind9/bin/check/check-tool.c
stable/7/contrib/bind9/bin/check/named-checkconf.c
stable/7/contrib/bind9/bin/check/named-checkzone.c
stable/7/contrib/bind9/bin/dig/dig.1
stable/7/contrib/bind9/bin/dig/dig.c
stable/7/contrib/bind9/bin/dig/dig.docbook
stable/7/contrib/bind9/bin/dig/dig.html
stable/7/contrib/bind9/bin/dig/dighost.c
stable/7/contrib/bind9/bin/dig/host.1
stable/7/contrib/bind9/bin/dig/host.docbook
stable/7/contrib/bind9/bin/dig/host.html
stable/7/contrib/bind9/bin/dnssec/dnssec-keygen.8
stable/7/contrib/bind9/bin/dnssec/dnssec-keygen.docbook
stable/7/contrib/bind9/bin/dnssec/dnssec-keygen.html
stable/7/contrib/bind9/bin/dnssec/dnssec-signzone.8
stable/7/contrib/bind9/bin/dnssec/dnssec-signzone.c
stable/7/contrib/bind9/bin/dnssec/dnssec-signzone.docbook
stable/7/contrib/bind9/bin/dnssec/dnssec-signzone.html
stable/7/contrib/bind9/bin/named/client.c
stable/7/contrib/bind9/bin/named/config.c
stable/7/contrib/bind9/bin/named/controlconf.c
stable/7/contrib/bind9/bin/named/include/named/globals.h
stable/7/contrib/bind9/bin/named/interfacemgr.c
stable/7/contrib/bind9/bin/named/lwaddr.c
stable/7/contrib/bind9/bin/named/lwdgnba.c
stable/7/contrib/bind9/bin/named/lwdnoop.c
stable/7/contrib/bind9/bin/named/lwresd.8
stable/7/contrib/bind9/bin/named/lwresd.c
stable/7/contrib/bind9/bin/named/lwresd.docbook
stable/7/contrib/bind9/bin/named/lwresd.html
stable/7/contrib/bind9/bin/named/main.c
stable/7/contrib/bind9/bin/named/named.8
stable/7/contrib/bind9/bin/named/named.conf.5
stable/7/contrib/bind9/bin/named/named.conf.docbook
stable/7/contrib/bind9/bin/named/named.conf.html
stable/7/contrib/bind9/bin/named/named.docbook
stable/7/contrib/bind9/bin/named/named.html
stable/7/contrib/bind9/bin/named/query.c
stable/7/contrib/bind9/bin/named/server.c
stable/7/contrib/bind9/bin/named/unix/include/named/os.h
stable/7/contrib/bind9/bin/named/unix/os.c
stable/7/contrib/bind9/bin/named/update.c
stable/7/contrib/bind9/bin/nsupdate/Makefile.in
stable/7/contrib/bind9/bin/nsupdate/nsupdate.c
stable/7/contrib/bind9/bin/nsupdate/nsupdate.docbook
stable/7/contrib/bind9/bin/nsupdate/nsupdate.html
stable/7/contrib/bind9/bin/rndc/rndc-confgen.c
stable/7/contrib/bind9/bin/rndc/rndc.8
stable/7/contrib/bind9/bin/rndc/rndc.c
stable/7/contrib/bind9/bin/rndc/rndc.docbook
stable/7/contrib/bind9/bin/rndc/rndc.html
stable/7/contrib/bind9/configure.in
stable/7/contrib/bind9/doc/arm/Bv9ARM-book.xml
stable/7/contrib/bind9/doc/arm/Bv9ARM.ch01.html
stable/7/contrib/bind9/doc/arm/Bv9ARM.ch02.html
stable/7/contrib/bind9/doc/arm/Bv9ARM.ch03.html
stable/7/contrib/bind9/doc/arm/Bv9ARM.ch04.html
stable/7/contrib/bind9/doc/arm/Bv9ARM.ch05.html
stable/7/contrib/bind9/doc/arm/Bv9ARM.ch06.html
stable/7/contrib/bind9/doc/arm/Bv9ARM.ch07.html
stable/7/contrib/bind9/doc/arm/Bv9ARM.ch08.html
stable/7/contrib/bind9/doc/arm/Bv9ARM.ch09.html
stable/7/contrib/bind9/doc/arm/Bv9ARM.ch10.html
stable/7/contrib/bind9/doc/arm/Bv9ARM.html
stable/7/contrib/bind9/doc/arm/Bv9ARM.pdf
stable/7/contrib/bind9/doc/arm/man.dig.html
stable/7/contrib/bind9/doc/arm/man.dnssec-keygen.html
stable/7/contrib/bind9/doc/arm/man.dnssec-signzone.html
stable/7/contrib/bind9/doc/arm/man.host.html
stable/7/contrib/bind9/doc/arm/man.named-checkconf.html
stable/7/contrib/bind9/doc/arm/man.named-checkzone.html
stable/7/contrib/bind9/doc/arm/man.named.html
stable/7/contrib/bind9/doc/arm/man.rndc-confgen.html
stable/7/contrib/bind9/doc/arm/man.rndc.conf.html
stable/7/contrib/bind9/doc/arm/man.rndc.html
stable/7/contrib/bind9/doc/misc/Makefile.in
stable/7/contrib/bind9/doc/misc/format-options.pl
stable/7/contrib/bind9/doc/misc/migration
stable/7/contrib/bind9/doc/misc/options
stable/7/contrib/bind9/doc/rfc/index
stable/7/contrib/bind9/lib/bind/api
stable/7/contrib/bind9/lib/bind/bsd/Makefile.in
stable/7/contrib/bind9/lib/bind/bsd/strerror.c
stable/7/contrib/bind9/lib/bind/bsd/strtoul.c
stable/7/contrib/bind9/lib/bind/configure.in
stable/7/contrib/bind9/lib/bind/dst/Makefile.in
stable/7/contrib/bind9/lib/bind/dst/dst_api.c
stable/7/contrib/bind9/lib/bind/dst/hmac_link.c
stable/7/contrib/bind9/lib/bind/dst/support.c
stable/7/contrib/bind9/lib/bind/include/Makefile.in
stable/7/contrib/bind9/lib/bind/include/arpa/nameser.h
stable/7/contrib/bind9/lib/bind/include/isc/assertions.h
stable/7/contrib/bind9/lib/bind/include/isc/eventlib.h
stable/7/contrib/bind9/lib/bind/include/isc/misc.h
stable/7/contrib/bind9/lib/bind/include/netdb.h
stable/7/contrib/bind9/lib/bind/include/resolv.h
stable/7/contrib/bind9/lib/bind/inet/Makefile.in
stable/7/contrib/bind9/lib/bind/inet/inet_net_pton.c
stable/7/contrib/bind9/lib/bind/inet/inet_network.c
stable/7/contrib/bind9/lib/bind/irs/Makefile.in
stable/7/contrib/bind9/lib/bind/irs/dns_ho.c
stable/7/contrib/bind9/lib/bind/irs/getnetgrent.c
stable/7/contrib/bind9/lib/bind/irs/getnetgrent_r.c
stable/7/contrib/bind9/lib/bind/irs/irp.c
stable/7/contrib/bind9/lib/bind/isc/Makefile.in
stable/7/contrib/bind9/lib/bind/isc/assertions.c
stable/7/contrib/bind9/lib/bind/isc/bitncmp.c
stable/7/contrib/bind9/lib/bind/isc/ctl_clnt.c
stable/7/contrib/bind9/lib/bind/isc/ctl_srvr.c
stable/7/contrib/bind9/lib/bind/isc/logging.c
stable/7/contrib/bind9/lib/bind/nameser/Makefile.in
stable/7/contrib/bind9/lib/bind/port_after.h.in
stable/7/contrib/bind9/lib/bind/port_before.h.in
stable/7/contrib/bind9/lib/bind/resolv/Makefile.in
stable/7/contrib/bind9/lib/bind/resolv/res_debug.c
stable/7/contrib/bind9/lib/bind/resolv/res_mkquery.c
stable/7/contrib/bind9/lib/bind/resolv/res_query.c
stable/7/contrib/bind9/lib/bind/resolv/res_send.c
stable/7/contrib/bind9/lib/bind9/api
stable/7/contrib/bind9/lib/bind9/check.c
stable/7/contrib/bind9/lib/dns/acache.c
stable/7/contrib/bind9/lib/dns/adb.c
stable/7/contrib/bind9/lib/dns/api
stable/7/contrib/bind9/lib/dns/cache.c
stable/7/contrib/bind9/lib/dns/dispatch.c
stable/7/contrib/bind9/lib/dns/dst_parse.c
stable/7/contrib/bind9/lib/dns/dst_parse.h
stable/7/contrib/bind9/lib/dns/include/dns/dispatch.h
stable/7/contrib/bind9/lib/dns/journal.c
stable/7/contrib/bind9/lib/dns/master.c
stable/7/contrib/bind9/lib/dns/masterdump.c
stable/7/contrib/bind9/lib/dns/message.c
stable/7/contrib/bind9/lib/dns/openssldsa_link.c
stable/7/contrib/bind9/lib/dns/opensslrsa_link.c
stable/7/contrib/bind9/lib/dns/rbt.c
stable/7/contrib/bind9/lib/dns/rbtdb.c
stable/7/contrib/bind9/lib/dns/rdata/generic/nsec_47.c
stable/7/contrib/bind9/lib/dns/rdata/generic/nsec_47.h
stable/7/contrib/bind9/lib/dns/rdata/generic/txt_16.c
stable/7/contrib/bind9/lib/dns/rdata/in_1/apl_42.c
stable/7/contrib/bind9/lib/dns/rdata/in_1/naptr_35.c
stable/7/contrib/bind9/lib/dns/request.c
stable/7/contrib/bind9/lib/dns/resolver.c
stable/7/contrib/bind9/lib/dns/rootns.c
stable/7/contrib/bind9/lib/dns/sdb.c
stable/7/contrib/bind9/lib/dns/tkey.c
stable/7/contrib/bind9/lib/dns/tsig.c
stable/7/contrib/bind9/lib/dns/validator.c
stable/7/contrib/bind9/lib/dns/view.c
stable/7/contrib/bind9/lib/dns/xfrin.c
stable/7/contrib/bind9/lib/dns/zone.c
stable/7/contrib/bind9/lib/isc/Makefile.in
stable/7/contrib/bind9/lib/isc/api
stable/7/contrib/bind9/lib/isc/assertions.c
stable/7/contrib/bind9/lib/isc/include/isc/assertions.h
stable/7/contrib/bind9/lib/isc/include/isc/lex.h
stable/7/contrib/bind9/lib/isc/include/isc/mem.h
stable/7/contrib/bind9/lib/isc/include/isc/msgs.h
stable/7/contrib/bind9/lib/isc/include/isc/platform.h.in
stable/7/contrib/bind9/lib/isc/include/isc/resource.h
stable/7/contrib/bind9/lib/isc/include/isc/socket.h
stable/7/contrib/bind9/lib/isc/include/isc/timer.h
stable/7/contrib/bind9/lib/isc/include/isc/types.h
stable/7/contrib/bind9/lib/isc/mem.c
stable/7/contrib/bind9/lib/isc/print.c
stable/7/contrib/bind9/lib/isc/pthreads/mutex.c
stable/7/contrib/bind9/lib/isc/timer.c
stable/7/contrib/bind9/lib/isc/unix/app.c
stable/7/contrib/bind9/lib/isc/unix/include/isc/net.h
stable/7/contrib/bind9/lib/isc/unix/net.c
stable/7/contrib/bind9/lib/isc/unix/resource.c
stable/7/contrib/bind9/lib/isc/unix/socket.c
stable/7/contrib/bind9/lib/isc/unix/socket_p.h
stable/7/contrib/bind9/lib/isc/unix/time.c
stable/7/contrib/bind9/lib/isccfg/api
stable/7/contrib/bind9/lib/isccfg/namedconf.c
stable/7/contrib/bind9/lib/lwres/api
stable/7/contrib/bind9/make/rules.in
stable/7/contrib/bind9/version
Modified: stable/7/contrib/bind9/CHANGES
==============================================================================
--- stable/7/contrib/bind9/CHANGES Sat Jan 10 02:33:31 2009 (r186995)
+++ stable/7/contrib/bind9/CHANGES Sat Jan 10 03:00:21 2009 (r186996)
@@ -1,14 +1,166 @@
- --- 9.4.2-P2 released ---
+ --- 9.4.3-P1 released ---
-2406. [bug] Some operating systems have FD_SETSIZE set to a
- low value by default, which can cause resource
- exhaustion when many simultaneous connections are
- open. Linux in particular makes it difficult to
- increase this value. To use more sockets with
- select(), set ISC_SOCKET_FDSETSIZE. Example:
- STD_CDEFINES="-DISC_SOCKET_FDSETSIZE=4096" ./configure
- (This should not be necessary in most cases, and
- never for an authoritative-only server.) [RT #18328]
+2522. [security] Handle -1 from DSA_do_verify().
+
+2498. [bug] Removed a bogus function argument used with
+ ISC_SOCKET_USE_POLLWATCH: it could cause compiler
+ warning or crash named with the debug 1 level
+ of logging. [RT #18917]
+
+ --- 9.4.3 released ---
+
+2490. [port] aix: work around a kernel bug where IPV6_RECVPKTINFO
+ is cleared when IPV6_V6ONLY is set. [RT #18785]
+
+2489. [port] solaris: Workaround Solaris's kernel bug about
+ /dev/poll:
+ http://bugs.opensolaris.org/view_bug.do?bug_id=6724237
+ Define ISC_SOCKET_USE_POLLWATCH at build time to enable
+ this workaround. [RT #18870]
+
+ --- 9.4.3rc1 released ---
+
+2473. [port] linux: raise the limit on open files to the possible
+ maximum value before spawning threads; 'files'
+ specified in named.conf doesn't seem to work with
+ threads as expected. [RT #18784]
+
+2472. [port] linux: check the number of available cpu's before
+ calling chroot as it depends on "/proc". [RT #16923]
+
+2471. [bug] named-checkzone was not reporting missing manditory
+ glue when sibling checks were disabled. [RT #18768]
+
+2469. [port] solaris: Work around Solaris's select() limitations.
+ [RT #18769]
+
+2468. [bug] Resolver could try unreachable servers multiple times.
+ [RT #18739]
+
+2467. [bug] Failure of fcntl(F_DUPFD) wasn't logged. [RT #18740]
+
+2466. [doc] ARM: explain max-cache-ttl 0 SERVFAIL issue.
+ [RT #18302]
+
+2465. [bug] Adb's handling of lame addresses was different
+ for IPv4 and IPv6. [RT #18738]
+
+2463. [port] linux: POSIX doesn't include the IPv6 Advanced Socket
+ API and glibc hides parts of the IPv6 Advanced Socket
+ API as a result. This is stupid as it breaks how the
+ two halves (Basic and Advanced) of the IPv6 Socket API were designed to be used but we have to live with it.
+ Define _GNU_SOURCE to pull in the IPv6 Advanced Socket
+ API. [RT #18388]
+
+2462. [doc] Document -m (enable memory usage debugging)
+ option for dig. [RT #18757]
+
+2461. [port] sunos: Change #2363 was not complete. [RT #17513]
+
+2458. [doc] ARM: update and correction for max-cache-size.
+ [RT #18294]
+
+2455. [bug] Stop metadata being transfered via axfr/ixfr.
+ [RT #18639]
+
+2453. [bug] Remove NULL pointer dereference in dns_journal_print().
+ [RT #18316]
+
+2449. [bug] libbind: Out of bounds reference in dns_ho.c:addrsort.
+ [RT #18044]
+
+2445. [doc] ARM out-of-date on empty reverse zones (list includes
+ RFC1918 address, but these are not yet compiled in).
+ [RT #18578]
+
+2444. [port] Linux, FreeBSD, AIX: Turn off path mtu discovery
+ (clear DF) for UDP responses and requests.
+
+ --- 9.4.3b3 released ---
+
+2443. [bug] win32: UDP connect() would not generate an event,
+ and so connected UDP sockets would never clean up.
+ Fix this by doing an immediate WSAConnect() rather
+ than an io completion port type for UDP.
+
+2438. [bug] Timeouts could be logged incorrectly under win32.
+ [RT #18617]
+
+2437. [bug] Sockets could be closed too early, leading to
+ inconsistent states in the socket module. [RT #18298]
+
+2436. [security] win32: UDP client handler can be shutdown. [RT #18576]
+
+2433. [tuning] Set initial timeout to 800ms.
+
+2432. [bug] More Windows socket handling improvements. Stop
+ using I/O events and use IO Completion Ports
+ throughout. Rewrite the receive path logic to make
+ it easier to support multiple simultaneous
+ requestrs in the future. Add stricter consistency
+ checking as a compile-time option (define
+ ISC_SOCKET_CONSISTENCY_CHECKS; defaults to off).
+
+2430. [bug] win32: isc_interval_set() could round down to
+ zero if the input was less than NS_INTERVAL
+ nanoseconds. Round up instead. [RT #18549]
+
+2429. [doc] nsupdate should be in section 1 of the man pages.
+ [RT #18283]
+
+2426. [bug] libbind: inet_net_pton() can sometimes return the
+ wrong value if excessively large netmasks are
+ supplied. [RT #18512]
+
+2425. [bug] named didn't detect unavailable query source addresses
+ at load time. [RT #18536]
+
+2424. [port] configure now probes for a working epoll
+ implementation. Allow the use of kqueue,
+ epoll and /dev/poll to be selected at compile
+ time. [RT #18277]
+
+2422. [bug] Handle the special return value of a empty node as
+ if it was a NXRRSET in the validator. [RT #18447]
+
+2421. [func] Add new command line option '-S' for named to specify
+ the max number of sockets. [RT #18493]
+ Use caution: this option may not work for some
+ operating systems without rebuilding named.
+
+2420. [bug] Windows socket handling cleanup. Let the io
+ completion event send out cancelled read/write
+ done events, which keeps us from writing to memeory
+ we no longer have ownership of. Add debugging
+ socket_log() function. Rework TCP socket handling
+ to not leak sockets.
+
+2417. [bug] Connecting UDP sockets for outgoing queries could
+ unexpectedly fail with an 'address already in use'
+ error. [RT #18411]
+
+2416. [func] Log file descriptors that cause exceeding the
+ internal maximum. [RT #18460]
+
+2414. [bug] A masterdump context held the database lock too long,
+ causing various troubles such as dead lock and
+ recursive lock acquisition. [RT #18311, #18456]
+
+2413. [bug] Fixed an unreachable code path in socket.c. [RT #18442]
+
+2412. [bug] win32: address a resourse leak. [RT #18374]
+
+2411. [bug] Allow using a larger number of sockets than FD_SETSIZE
+ for select(). To enable this, set ISC_SOCKET_MAXSOCKETS
+ at compilation time. [RT #18433]
+
+2410. [bug] Correctly delete m_versionInfo. [RT #18432]
+
+2408. [bug] A duplicate TCP dispatch event could be sent, which
+ could then trigger an assertion failure in
+ resquery_response(). [RT #18275]
+
+2407. [port] hpux: test for sys/dyntune.h. [RT #18421]
2404. [port] hpux: files unlimited support.
@@ -39,15 +191,271 @@
2392. [bug] remove 'grep -q' from acl test script, some platforms
don't support it. [RT #18253]
+2391 [port] hpux: cover additional recvmsg() error codes.
+ [RT #18301]
+
+2390 [bug] dispatch.c could make a false warning on 'odd socket'.
+ [RT #18301].
+
+2389 [bug] Move the "working directory writable" check to after
+ the ns_os_changeuser() call. [RT #18326]
+
+2386. [func] Add warning about too small 'open files' limit.
+ [RT #18269]
+
+ --- 9.4.3b2 released ---
+
+2385. [bug] A condition variable in socket.c could leak in
+ rare error handling [RT #17968].
+
+2384. [security] Additional support for query port randomization (change
+ #2375) including performance improvement and port range
+ specification. [RT #17949, #18098]
+
+2383. [bug] named could double queries when they resulted in
+ SERVFAIL due to overkilling EDNS0 failure detection.
+ [RT #18182]
+
+2382. [doc] Add descriptions of IPSECKEY, SPF and SSHFP to ARM.
+
+2381. [port] dlz/mysql: support multiple install layouts for
+ mysql. /include/{,mysql/}mysql.h and
+ /lib/{,mysql/}. [RT #18152]
+
+2380. [bug] dns_view_find() was not returning NXDOMAIN/NXRRSET
+ proofs which, in turn, caused validation failures
+ for insecure zones immediately below a secure zone
+ the server was authoritative for. [RT #18112]
+
+2379. [contrib] queryperf/gen-data-queryperf.py: removed redundant
+ TLDs and supported RRs with TTLs [RT #17972]
+
+2377. [bug] Address race condition in dnssec-signzone. [RT #18142]
+
+2376. [bug] Change #2144 was not complete.
+
+2375. [security] Fully randomize UDP query ports to improve
+ forgery resilience. [RT #17949]
+
+2372. [bug] fixed incorrect TAG_HMACSHA256_BITS value [RT #18047]
+
+2369. [bug] libbind: Array bounds overrun on read in bitncmp().
+ [RT #18054]
+
+2364. [bug] named could trigger a assertion when serving a
+ malformed signed zone. [RT #17828]
+
+2363. [port] sunos: pre-set "lt_cv_sys_max_cmd_len=4096;".
+ [RT #17513]
+
+2361. [bug] "recursion" statistics counter could be counted
+ multiple times for a single query. [RT #17990]
+
+ --- 9.4.3b1 released ---
+
+2358. [doc] Update host's default query description. [RT #17934]
+
+2356. [bug] Built in mutex profiler was not scalable enough.
+ [RT #17436]
+
+2353. [func] libbind: nsid support. [RT #17091]
+
+2350. [port] win32: IPv6 support. [RT #17797]
+
+2347. [bug] Delete now traverses the RB tree in the canonical
+ order. [RT #17451]
+
+2345. [bug] named-checkconf failed to detect when forwarders
+ were set at both the options/view level and in
+ a root zone. [RT #17671]
+
+2344. [bug] Improve "logging{ file ...; };" documentation.
+ [RT #17888]
+
+2343. [bug] (Seemingly) duplicate IPv6 entries could be
+ created in ADB. [RT #17837]
+
+2341. [bug] libbind: add missing -I../include for off source
+ tree builds. [RT #17606]
+
+2340. [port] openbsd: interface configuration. [RT #17700]
+
+2339. [port] tru64: support for libbind. [RT #17589]
+
+2338. [bug] check_ds() could be called with a non DS rdataset.
+ [RT #17598]
+
+2337. [bug] BUILD_LDFLAGS was not being correctly set. [RT #17614]
+
+2335. [port] sunos: libbind and *printf() support for long long.
+ [RT #17513]
+
+2334. [bug] Bad REQUIRES in fromstruct_in_naptr(), off by one
+ bug in fromstruct_txt(). [RT #17609]
+
+2333. [bug] Fix off by one error in isc_time_nowplusinterval().
+ [RT #17608]
+
+2332. [contrib] query-loc-0.4.0. [RT #17602]
+
+2331. [bug] Failure to regenerate any signatures was not being
+ reported nor being past back to the UPDATE client.
+ [RT #17570]
+
+2330. [bug] Remove potential race condition when handling
+ over memory events. [RT #17572]
+
+ WARNING: API CHANGE: over memory callback
+ function now needs to call isc_mem_waterack().
+ See for details.
+
+2329. [bug] Clearer help text for dig's '-x' and '-i' options.
+
+2328. [maint] Add AAAA addresses for A.ROOT-SERVERS.NET,
+ F.ROOT-SERVERS.NET, H.ROOT-SERVERS.NET,
+ J.ROOT-SERVERS.NET, K.ROOT-SERVERS.NET and
+ M.ROOT-SERVERS.NET.
+
+2326. [bug] It was possible to trigger a INSIST in the acache
+ processing.
+
+2325. [port] Linux: use capset() function if available. [RT #17557]
+
+2323. [port] tru64: namespace clash. [RT #17547]
+
2322. [port] MacOS: work around the limitation of setrlimit()
for RLIMIT_NOFILE. [RT #17526]
- --- 9.4.2-P1 released ---
+2319. [bug] Silence Coverity warnings in
+ lib/dns/rdata/in_1/apl_42.c. [RT #17469]
-2375. [security] Fully randomize UDP query ports to improve
- forgery resilience. [RT #17949]
+2318. [port] sunos fixes for libbind. [RT #17514]
+
+2314. [bug] Uninitialized memory use on error path in
+ bin/named/lwdnoop.c. [RT #17476]
+
+2313. [cleanup] Silence Coverity warnings. Handle private stacks.
+ [RT #17447] [RT #17478]
+
+2312. [cleanup] Silence Coverity warning in lib/isc/unix/socket.c.
+ [RT #17458]
+
+2311. [func] Update ACL regression test. [RT #17462]
+
+2310. [bug] dig, host, nslookup: flush stdout before emitting
+ debug/fatal messages. [RT #17501]
+
+2308. [cleanup] Silence Coverity warning in bin/named/controlconf.c.
+ [RT #17495]
+
+2307. [bug] Remove infinite loop from lib/dns/sdb.c. [RT #17496]
+
+2306. [bug] Remove potential race from lib/dns/resolver.c.
+ [RT #17470]
+
+2305. [security] inet_network() buffer overflow. CVE-2008-0122.
+
+2304. [bug] Check returns from all dns_rdata_tostruct() calls.
+ [RT #17460]
+
+2303. [bug] Remove unnecessary code from bin/named/lwdgnba.c.
+ [RT #17471]
+
+2302. [bug] Fix memset() calls in lib/tests/t_api.c. [RT #17472]
+
+2301. [bug] Remove resource leak and fix error messages in
+ bin/tests/system/lwresd/lwtest.c. [RT #17474]
+
+2300. [bug] Fixed failure to close open file in
+ bin/tests/names/t_names.c. [RT #17473]
+
+2299. [bug] Remove unnecessary NULL check in
+ bin/nsupdate/nsupdate.c. [RT #17475]
+
+2298. [bug] isc_mutex_lock() failure not caught in
+ bin/tests/timers/t_timers.c. [RT #17468]
+
+2297. [bug] isc_entropy_createfilesource() failure not caught in
+ bin/tests/dst/t_dst.c. [RT #17467]
+
+2296. [port] Allow docbook stylesheet location to be specified to
+ configure. [RT #17457]
+
+2295. [bug] Silence static overrun error in bin/named/lwaddr.c.
+ [RT #17459]
+
+2293. [func] Add ACL regression test. [RT #17375]
+
+2292. [bug] Log if the working directory is not writable.
+ [RT #17312]
+
+2291. [bug] PR_SET_DUMPABLE may be set too late. Also report
+ failure to set PR_SET_DUMPABLE. [RT #17312]
+
+2290. [bug] Let AD in the query signal that the client wants AD
+ set in the response. [RT #17301]
+
+2288. [port] win32: mark service as running when we have finished
+ loading. [RT #17441]
+
+2287. [bug] Use 'volatile' if the compiler supports it. [RT #17413]
+
+2284. [bug] Memory leak in UPDATE prerequisite processing.
+ [RT #17377]
+
+2283. [bug] TSIG keys were not attaching to the memory
+ context. TSIG keys should use the rings
+ memory context rather than the clients memory
+ context. [RT #17377]
+
+2279. [bug] Use setsockopt(SO_NOSIGPIPE), when available,
+ to protect applications from receiving spurious
+ SIGPIPE signals when using the resolver.
+
+2278. [bug] win32: handle the case where Windows returns no
+ search list or DNS suffix. [RT #17354]
+
+2277. [bug] Empty zone names were not correctly being caught at
+ in the post parse checks. [RT #17357]
+
+2273. [bug] Adjust log level to WARNING when saving inconsistent
+ stub/slave master and journal files. [RT# 17279]
+
+2272. [bug] Handle illegal dnssec-lookaside trust-anchor names.
+ [RT #17262]
+
+2270. [bug] dns_db_closeversion() version->writer could be reset
+ before it is tested. [RT #17290]
+
+2269. [contrib] dbus memory leaks and missing va_end calls. [RT #17232]
+
+2268. [bug] 0.IN-ADDR.ARPA was missing from the empty zones
+ list.
+
+2266. [bug] client.c:get_clientmctx() returned the same mctx
+ once the pool of mctx's was filled. [RT #17218]
+
+2265. [bug] Test that the memory context's basic_table is non NULL
+ before freeing. [RT #17265]
+
+2264. [bug] Server prefix length was being ignored. [RT #17308]
+
+2263. [bug] "named-checkconf -z" failed to set default value
+ for "check-integrity". [RT #17306]
+
+2262. [bug] Error status from all but the last view could be
+ lost. [RT #17292]
+
+2260. [bug] Reported wrong clients-per-query when increasing the
+ value. [RT #17236]
+
+2247. [doc] Sort doc/misc/options. [RT #17067]
+
+2246. [bug] Make the startup of test servers (ans.pl) more
+ robust. [RT #17147]
--- 9.4.2 released ---
+
--- 9.4.2rc2 released ---
2259. [bug] Reverse incorrect LIBINTERFACE bump of libisc
@@ -63,7 +471,7 @@
2256. [bug] win32: Correctly register the installation location of
bindevt.dll. [RT #17159]
-2255. [bug] L.ROOT-SERVERS.NET is now 199.7.83.42.
+2255. [maint] L.ROOT-SERVERS.NET is now 199.7.83.42.
2254. [bug] timer.c:dispatch() failed to lock timer->lock
when reading timer->idle allowing it to see
@@ -76,16 +484,16 @@
reality. Note there is behaviour change for BIND 9.5.
[RT #17113]
-2249. [bug] Only set Authentic Data bit if client requested
+2249. [bug] Only set Authentic Data bit if client requested
DNSSEC, per RFC 3655 [RT #17175]
-2248. [cleanup] Fix several errors reported by Coverity. [RT #17160]
+2248. [cleanup] Fix several errors reported by Coverity. [RT #17160]
2245. [bug] Validating lack of DS records at trust anchors wasn't
working. [RT #17151]
2238. [bug] It was possible to trigger a REQUIRE when a
- validation was cancelled. [RT #17106]
+ validation was canceled. [RT #17106]
2237. [bug] libbind: res_init() was not thread aware. [RT #17123]
@@ -94,8 +502,8 @@
2235. [bug] was not being installed. [RT #17135]
-2234. [port] Correct some compiler warnings on SCO OSr5 [RT #17134]
-
+2234. [port] Correct some compiler warnings on SCO OSr5 [RT #17134]
+
2232. [bug] dns_adb_findaddrinfo() could fail and return
ISC_R_SUCCESS. [RT #17137]
@@ -110,7 +518,7 @@
2227. [cleanup] Tidied up the FAQ. [RT #17121]
2225. [bug] More support for systems with no IPv4 addresses.
- [RT #17111]
+ [RT #17111]
2224. [bug] Defer journal compaction if a xfrin is in progress.
[RT #17119]
@@ -124,15 +532,15 @@
2220. [bug] win32: Address a race condition in final shutdown of
the Windows socket code. [RT #17028]
-
-2219. [bug] Apply zone consistancy checks to additions, not
+
+2219. [bug] Apply zone consistency checks to additions, not
removals, when updating. [RT #17049]
2218. [bug] Remove unnecessary REQUIRE from dns_validator_create().
[RT #16976]
2216. [cleanup] Fix a number of errors reported by Coverity.
- [RT #17094]
+ [RT #17094]
2215. [bug] Bad REQUIRE check isc_hmacsha1_verify(). [RT #17094]
@@ -175,13 +583,13 @@
localhost;) is used.
[RT #16987]
-
+
2205. [bug] libbind: change #2119 broke thread support. [RT #16982]
2203. [security] Query id generation was cryptographically weak.
[RT # 16915]
-2202. [security] The default acls for allow-query-cache and
+2202. [security] The default acls for allow-query-cache and
allow-recursion were not being applied. [RT #16960]
2200. [bug] The search for cached NSEC records was stopping to
@@ -216,7 +624,7 @@
2187. [bug] query_addds(), query_addwildcardproof() and
query_addnxrrsetnsec() should take a version
- arguement. [RT #16368]
+ argument. [RT #16368]
2186. [port] cygwin: libbind: check for struct sockaddr_storage
independently of IPv6. [RT #16482]
@@ -243,7 +651,7 @@
debug level 10+. [RT #16798]
2176. [contrib] dbus update to handle race condition during
- initialisation (Bugzilla 235809). [RT #16842]
+ initialization (Bugzilla 235809). [RT #16842]
2175. [bug] win32: windows broadcast condition variable support
was broken. [RT #16592]
@@ -274,7 +682,7 @@
a server address as a name to be looked up, causing
unexpected output. [RT #16743]
-2164. [bug] The code to determine how named-checkzone /
+2164. [bug] The code to determine how named-checkzone /
named-compilezone was called failed under windows.
[RT #16764]
@@ -288,7 +696,7 @@
2159. [bug] Array bounds overrun in acache processing. [RT #16710]
-2158. [bug] ns_client_isself() failed to initialise key
+2158. [bug] ns_client_isself() failed to initialize key
leading to a REQUIRE failure. [RT #16688]
2156. [bug] Fix node reference leaks in lookup.c:lookup_find(),
@@ -363,7 +771,7 @@
2136. [bug] nslookup/host looped if there was no search list
and the host didn't exist. [RT #16657]
-2135. [bug] Uninitialised rdataset in sdlz.c. [RT# 16656]
+2135. [bug] Uninitialized rdataset in sdlz.c. [RT# 16656]
2133. [port] powerpc: Support both IBM and MacOS Power PC
assembler syntaxes. [RT #16647]
@@ -379,7 +787,7 @@
2127. [port] Improved OpenSSL 0.9.8 support. [RT #16563]
-2126. [security] Serialise validation of type ANY responses. [RT #16555]
+2126. [security] Serialize validation of type ANY responses. [RT #16555]
2125. [bug] dns_zone_getzeronosoattl() REQUIRE failure if DLZ
was defined. [RT #16574]
@@ -419,7 +827,7 @@
2111. [bug] Fix a number of errors reported by Coverity.
[RT #16507]
-2110. [bug] "minimal-response yes;" interacted badly with BIND 8
+2110. [bug] "minimal-responses yes;" interacted badly with BIND 8
priming queries. [RT #16491]
2109. [port] libbind: silence aix 5.3 compiler warnings. [RT #16502]
@@ -431,7 +839,7 @@
2103. [port] Add /usr/sfw to list of locations for OpenSSL
under Solaris.
-2102. [port] Silence solaris 10 warnings.
+2102. [port] Silence Solaris 10 warnings.
--- 9.4.0b4 released ---
@@ -441,7 +849,7 @@
2100. [port] win32: copy libeay32.dll to Build\Debug.
Copy Debug\named-checkzone to Debug\named-compilezone.
-2099. [port] win32: more manifiest issues.
+2099. [port] win32: more manifest issues.
2098. [bug] Race in rbtdb.c:no_references(), which occasionally
triggered an INSIST failure about the node lock
@@ -457,14 +865,14 @@
2095. [port] libbind: alway prototype inet_cidr_ntop_ipv6() and
net_cidr_ntop_ipv6(). [RT #16388]
-
+
2094. [contrib] Update named-bootconf. [RT# 16404]
2093. [bug] named-checkzone -s was broken.
2092. [bug] win32: dig, host, nslookup. Use registry config
if resolv.conf does not exist or no nameservers
- listed. [RT #15877]
+ listed. [RT #15877]
2091. [port] dighost.c: race condition on cleanup. [RT #16417]
@@ -507,7 +915,7 @@
2078. [bug] dnssec-checkzone output style "default" was badly
named. It is now called "relative". [RT #16326]
-2077. [bug] 'dnssec-signzone -O raw' wasn't outputing the
+2077. [bug] 'dnssec-signzone -O raw' wasn't outputting the
complete signed zone. [RT #16326]
2076. [bug] Several files were missing #include
@@ -592,7 +1000,7 @@
[RT #16287]
2049. [bug] Restore SOA before AXFR when falling back from
- a attempted IXFR when transfering in a zone.
+ a attempted IXFR when transferring in a zone.
Allow a initial SOA query before attempting
a AXFR to be requested. [RT #16156]
@@ -601,7 +1009,7 @@
the OS always returned the same local port.
[RT #16182]
-2047. [bug] Failed to initialise the interface flags to zero.
+2047. [bug] Failed to initialize the interface flags to zero.
[RT #16245]
2046. [bug] rbtdb.c:rdataset_setadditional() could cause duplicate
@@ -641,7 +1049,7 @@
2034. [bug] gcc: set -fno-strict-aliasing. [RT #16124]
-2033. [bug] We wern't creating multiple client memory contexts
+2033. [bug] We weren't creating multiple client memory contexts
on demand as expected. [RT #16095]
--- 9.4.0a6 released ---
@@ -657,7 +1065,7 @@
2029. [bug] host printed out the server multiple times when
specified on the command line. [RT #15992]
-2028. [port] linux: socket.c compatability for old systems.
+2028. [port] linux: socket.c compatibility for old systems.
[RT #16015]
2027. [port] libbind: Solaris x86 support. [RT #16020]
@@ -667,7 +1075,7 @@
2025. [func] Update "zone serial unchanged" message. [RT #16026]
-2024. [bug] named emited spurious "zone serial unchanged"
+2024. [bug] named emitted spurious "zone serial unchanged"
messages on reload. [RT #16027]
2023. [bug] "make install" should create ${localstatedir}/run and
@@ -695,7 +1103,7 @@
--- 9.4.0a5 released ---
2015. [cleanup] use-additional-cache is now acache-enable for
- consistancy. Default acache-enable off in BIND 9.4
+ consistency. Default acache-enable off in BIND 9.4
as it requires memory usage to be configured.
It may be enabled by default in BIND 9.5 once we
have more experience with it.
@@ -715,9 +1123,9 @@
--- 9.4.0a4 released ---
-2009. [bug] libbind: coverity fixes. [RT #15808]
+2009. [bug] libbind: Coverity fixes. [RT #15808]
-2008. [func] It is now posssible to enable/disable DNSSEC
+2008. [func] It is now possible to enable/disable DNSSEC
validation from rndc. This is useful for the
mobile hosts where the current connection point
breaks DNSSEC (firewall/proxy). [RT #15592]
@@ -729,7 +1137,7 @@
be changed to yes in 9.5.0. [RT #15674]
2006. [security] Allow-query-cache and allow-recursion now default
- to the builtin acls "localnets" and "localhost".
+ to the built in acls "localnets" and "localhost".
This is being done to make caching servers less
attractive as reflective amplifying targets for
@@ -777,7 +1185,7 @@
1994. [port] OpenSSL 0.9.8 support. [RT #15694]
-1993. [bug] Log messsage, via syslog, were missing the space
+1993. [bug] Log messages, via syslog, were missing the space
after the timestamp if "print-time yes" was specified.
[RT #15844]
@@ -785,11 +1193,11 @@
view. [RT #15825]
1991. [cleanup] The configuration data, once read, should be treated
- as readonly. Expand the use of const to enforce this
+ as read only. Expand the use of const to enforce this
at compile time. [RT #15813]
1990. [bug] libbind: isc's override of broken gettimeofday()
- implementions was not always effective.
+ implementations was not always effective.
[RT #15709]
1989. [bug] win32: don't check the service password when
@@ -811,7 +1219,7 @@
server for the zone. Also any zones that contain
DLV records should be removed when upgrading a slave
zone. You do not however have to upgrade all
- servers for a zone with DLV records simultaniously.
+ servers for a zone with DLV records simultaneously.
1984. [func] dig, nslookup and host now advertise a 4096 byte
EDNS UDP buffer size by default. [RT #15855]
@@ -848,7 +1256,7 @@
1973. [func] TSIG HMACSHA1, HMACSHA224, HMACSHA256, HMACSHA384 and
HMACSHA512 support. [RT #13606]
-1972. [contrib] DBUS dynamic forwarders integation from
+1972. [contrib] DBUS dynamic forwarders integration from
Jason Vas Dias .
1971. [port] linux: make detection of missing IF_NAMESIZE more
@@ -872,7 +1280,7 @@
1964. [func] Separate out MX and SRV to CNAME checks. [RT #15723]
-1963. [port] Tru64 4.0E doesn't support send() and recv().
+1963. [port] Tru64 4.0E doesn't support send() and recv().
[RT #15586]
1962. [bug] Named failed to clear old update-policy when it
@@ -898,7 +1306,7 @@
by native compiler. See README for additional
cross compile support information. [RT #15148]
-1955. [bug] Pre-allocate the cache cleaning interator. [RT #14998]
+1955. [bug] Pre-allocate the cache cleaning iterator. [RT #14998]
1954. [func] Named now falls back to advertising EDNS with a
512 byte receive buffer if the initial EDNS queries
@@ -915,7 +1323,7 @@
1951. [security] Drop queries from particular well known ports.
Don't return FORMERR to queries from particular
well known ports. [RT #15636]
-
+
1950. [port] Solaris 2.5.1 and earlier cannot bind() then connect()
a TCP socket. This prevents the source address being
set for TCP connections. [RT #15628]
@@ -934,10 +1342,10 @@
1946. [bug] resume_dslookup() could trigger a REQUIRE failure
when using forwarders. [RT #15549]
-1945. [cleanup] dnssec-keygen: RSA (RSAMD5) is nolonger recommended.
+1945. [cleanup] dnssec-keygen: RSA (RSAMD5) is no longer recommended.
To generate a RSAMD5 key you must explicitly request
RSAMD5. [RT #13780]
-
+
1944. [cleanup] isc_hash_create() does not need a read/write lock.
[RT #15522]
@@ -1028,15 +1436,15 @@
1917. [doc] funcsynopsisinfo wasn't being treated as verbatim
when generating man pages. [RT #15385]
-1916. [func] Integrate contibuted IDN code from JPNIC. [RT #15383]
+1916. [func] Integrate contributed IDN code from JPNIC. [RT #15383]
1915. [bug] dig +ndots was broken. [RT #15215]
1914. [protocol] DS is required to accept mnemonic algorithms
(RFC 4034). Still emit numeric algorithms for
- compatability with RFC 3658. [RT #15354]
+ compatibility with RFC 3658. [RT #15354]
-1913. [func] Integrate contibuted DLZ code into named. [RT #11382]
+1913. [func] Integrate contributed DLZ code into named. [RT #11382]
1912. [port] aix: atomic locking for powerpc. [RT #15020]
@@ -1059,7 +1467,7 @@
[RT #15034]
1905. [bug] Strings returned from cfg_obj_asstring() should be
- treated as read-only. The prototype for
+ treated as read-only. The prototype for
cfg_obj_asstring() has been updated to reflect this.
[RT #15256]
@@ -1108,7 +1516,7 @@
1891. [port] freebsd: pthread_mutex_init can fail if it runs out
of memory. [RT #14995]
-1890. [func] Raise the UDP recieve buffer size to 32k if it is
+1890. [func] Raise the UDP receive buffer size to 32k if it is
less than 32k. [RT #14953]
1889. [port] sunos: non blocking i/o support. [RT #14951]
@@ -1148,7 +1556,7 @@
[RT #2471]
1877. [bug] Fix unreasonably low quantum on call to
- dns_rbt_destroy2(). Remove unnecessay unhash_node()
+ dns_rbt_destroy2(). Remove unnecessary unhash_node()
call. [RT #14919]
1876. [func] Additional memory debugging support to track size
@@ -1189,10 +1597,10 @@
1863. [bug] rrset-order "fixed" error messages not complete.
1862. [func] Add additional zone data constancy checks.
- named-checkzone has extended checking of NS, MX and
+ named-checkzone has extended checking of NS, MX and
SRV record and the hosts they reference.
named has extended post zone load checks.
- New zone options: check-mx and integrity-check.
+ New zone options: check-mx and integrity-check.
[RT #4940]
1861. [bug] dig could trigger a INSIST on certain malformed
@@ -1230,24 +1638,24 @@
1850. [bug] Memory leak in lwres_getipnodebyaddr(). [RT #14591]
1849. [doc] All forms of the man pages (docbook, man, html) should
- have consistant copyright dates.
+ have consistent copyright dates.
1848. [bug] Improve SMF integration. [RT #13238]
1847. [bug] isc_ondestroy_init() is called too late in
- dns_rbtdb_create()/dns_rbtdb64_create().
+ dns_rbtdb_create()/dns_rbtdb64_create().
[RT #13661]
-
+
1846. [contrib] query-loc-0.3.0 from Stephane Bortzmeyer
.
-1845. [bug] Improve error reporting to distingish between
+1845. [bug] Improve error reporting to distinguish between
accept()/fcntl() and socket()/fcntl() errors.
[RT #13745]
1844. [bug] inet_pton() accepted more that 4 hexadecimal digits
for each 16 bit piece of the IPv6 address. The text
- representation of a IPv6 address has been tighted
+ representation of a IPv6 address has been tightened
to disallow this (draft-ietf-ipv6-addr-arch-v4-02.txt).
[RT #5662]
@@ -1475,7 +1883,7 @@
1765. [bug] configure --with-openssl=auto failed. [RT #12937]
1764. [bug] dns_zone_replacedb failed to emit a error message
- if there was no SOA record in the replacment db.
+ if there was no SOA record in the replacement db.
[RT #13016]
1763. [func] Perform sanity checks on NS records which refer to
@@ -1503,7 +1911,7 @@
1755. [func] allow-update is now settable at the options / view
level. [RT #6636]
-1754. [bug] We wern't always attempting to query the parent
+1754. [bug] We weren't always attempting to query the parent
server for the DS records at the zone cut.
[RT #12774]
@@ -1523,8 +1931,8 @@
[RT #12866]
1748. [func] dig now returns the byte count for axfr/ixfr.
-
-1747. [bug] BIND 8 compatability: named/named-checkconf failed
+
+1747. [bug] BIND 8 compatibility: named/named-checkconf failed
to parse "host-statistics-max" in named.conf.
1746. [func] Make public the function to read a key file,
@@ -1541,7 +1949,7 @@
requested number of worker threads then destruction
of the manager would trigger an INSIST() failure.
[RT #12790]
-
+
1742. [bug] Deleting all records at a node then adding a
previously existing record, in a single UPDATE
transaction, failed to leave / regenerate the
@@ -1552,7 +1960,7 @@
1740. [bug] Replace rbt's hash algorithm as it performed badly
with certain zones. [RT #12729]
-
+
NOTE: a hash context now needs to be established
via isc_hash_create() if the application was not
already doing this.
@@ -1567,7 +1975,7 @@
1736. [bug] dst_key_fromnamedfile() could fail to read a
public key. [RT #12687]
-
+
1735. [bug] 'dig +sigtrace' could die with a REQUIRE failure.
[RE #12688]
@@ -1607,7 +2015,7 @@
[RT #12519]
1721. [bug] Error message from the journal processing were not
- always identifing the relevent journal. [RT #12519]
+ always identifying the relevant journal. [RT #12519]
1720. [bug] 'dig +chase' did not terminate on a RFC 2308 Type 1
negative response. [RT #12506]
@@ -1664,7 +2072,7 @@
1703. [bug] named would loop sending NOTIFY messages when it
failed to receive a response. [RT #12322]
-1702. [bug] also-notify should not be applied to builtin zones.
+1702. [bug] also-notify should not be applied to built in zones.
[RT #12323]
1701. [doc] A minimal named.conf man page.
@@ -1744,7 +2152,7 @@
1675. [bug] named would sometimes add extra NSEC records to
the authority section.
-
+
1674. [port] linux: increase buffer size used to scan
/proc/net/if_inet6.
@@ -1816,7 +2224,7 @@
1648. [func] Update dnssec-lookaside named.conf syntax to support
multiple dnssec-lookaside namespaces (not yet
- implemented).
+ implemented).
1647. [bug] It was possible trigger a INSIST when chasing a DS
record that required walking back over a empty node.
@@ -1829,7 +2237,7 @@
masters with keys are specified.
1644. [bug] Update the journal modification time after a
- sucessfull refresh query. [RT #11436]
+ successful refresh query. [RT #11436]
1643. [bug] dns_db_closeversion() could leak memory / node
references. [RT #11163]
@@ -1846,11 +2254,11 @@
1638. [bug] "ixfr-from-differences" could generate a REQUIRE
failure if the journal open failed. [RT #11347]
-
+
1637. [bug] Node reference leak on error in addnoqname().
1636. [bug] The dump done callback could get ISC_R_SUCCESS even if
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From dougb at FreeBSD.org Sat Jan 10 03:01:20 2009
From: dougb at FreeBSD.org (Doug Barton)
Date: Sat Jan 10 03:01:27 2009
Subject: svn commit: r186997 - in stable/7: lib/bind lib/bind/bind
lib/bind/dns lib/bind/dns/dns lib/bind/isc lib/bind/isc/isc
share/doc/bind9 usr.bin/nsupdate
Message-ID: <200901100301.n0A31IwY077698@svn.freebsd.org>
Author: dougb
Date: Sat Jan 10 03:01:18 2009
New Revision: 186997
URL: http://svn.freebsd.org/changeset/base/186997
Log:
MFC the BIND 9.4.3 and 9.4.3-P1 updates
Modified:
stable/7/lib/bind/ (props changed)
stable/7/lib/bind/bind/config.h
stable/7/lib/bind/bind/port_after.h
stable/7/lib/bind/bind/port_before.h
stable/7/lib/bind/config.h
stable/7/lib/bind/dns/code.h
stable/7/lib/bind/dns/dns/enumclass.h
stable/7/lib/bind/dns/dns/enumtype.h
stable/7/lib/bind/dns/dns/rdatastruct.h
stable/7/lib/bind/isc/Makefile
stable/7/lib/bind/isc/isc/platform.h
stable/7/share/doc/bind9/Makefile
stable/7/usr.bin/nsupdate/Makefile
Modified: stable/7/lib/bind/bind/config.h
==============================================================================
--- stable/7/lib/bind/bind/config.h Sat Jan 10 03:00:21 2009 (r186996)
+++ stable/7/lib/bind/bind/config.h Sat Jan 10 03:01:18 2009 (r186997)
@@ -1,6 +1,6 @@
/* $FreeBSD$ */
-/* config.h. Generated by configure. */
+/* config.h. Generated from config.h.in by configure. */
/* #undef _SOCKADDR_LEN */
#define HAVE_FCNTL_H 1
#define HAVE_PATHS_H 1
@@ -8,6 +8,7 @@
/* #undef HAVE_STROPTS_H */
#define HAVE_SYS_TIMERS_H 1
#define HAVE_SYS_SELECT_H 1
+#define HAVE_MEMORY_H 1
/* #undef SYS_CDEFS_H */
/* #undef _POSIX_PTHREAD_SEMANTICS */
/* #undef POSIX_GETPWUID_R */
@@ -16,14 +17,20 @@
/* #undef POSIX_GETGRNAM_R */
#define HAVE_MEMMOVE 1
#define HAVE_MEMCHR 1
+/* #undef SPRINTF_CHAR */
+/* #undef VSPRINTF_CHAR */
+#define USE_SYSERROR_LIST 1
+/* #undef NEED_STRTOUL */
+/* #undef NEED_SUN4PROTOS */
+/* #undef REENABLE_SEND */
/* #undef NEED_SETGROUPENT */
/* #undef NEED_GETGROUPLIST */
/* define if prototype for getgrnam_r() is required */
-/* #undef NEED_GETGRNAM_R */
-/* #undef NEED_GETGRGID_R */
-/* #undef NEED_GETGRENT_R */
+/* #undef NEED_GETGRNAM_R */
+/* #undef NEED_GETGRGID_R */
+/* #undef NEED_GETGRENT_R */
#define NEED_SETGRENT_R 1
#define NEED_ENDGRENT_R 1
@@ -46,7 +53,7 @@
/* #undef ssize_t */
/* #undef uintptr_t */
-/* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */
+/* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */
/* #undef SHUTUP_SPUTAUX */
#ifdef SHUTUP_SPUTAUX
struct __sFILE;
Modified: stable/7/lib/bind/bind/port_after.h
==============================================================================
--- stable/7/lib/bind/bind/port_after.h Sat Jan 10 03:00:21 2009 (r186996)
+++ stable/7/lib/bind/bind/port_after.h Sat Jan 10 03:01:18 2009 (r186997)
@@ -18,12 +18,20 @@
#include
#endif /* HAVE_SYS_SELECT_H */
+#ifdef REENABLE_SEND
+#undef send
+#endif
+
#undef NEED_PSELECT
#define HAVE_SA_LEN 1
#define HAVE_MINIMUM_IFREQ 1
#undef NEED_DAEMON
#undef NEED_STRSEP
#undef NEED_STRERROR
+#ifdef NEED_STRERROR
+const char *isc_strerror(int);
+#define strerror isc_strerror
+#endif
#define HAS_INET6_STRUCTS 1
#define HAVE_SIN6_SCOPE_ID 1
#undef NEED_IN6ADDR_ANY
@@ -32,12 +40,18 @@
#undef NEED_GETTIMEOFDAY
#define HAVE_STRNDUP 1
#undef USE_FIONBIO_IOCTL
-#undef USE_SYSERROR_LIST
#undef INNETGR_ARGS
#undef SETNETGRENT_ARGS
#define USE_IFNAMELINKID 1
#define PORT_NONBLOCK O_NONBLOCK
+#ifndef _POSIX_PATH_MAX
+#define _POSIX_PATH_MAX 255
+#endif
+#ifndef PATH_MAX
+#define PATH_MAX _POSIX_PATH_MAX
+#endif
+
/*
* We need to know the IPv6 address family number even on IPv4-only systems.
* Note that this is NOT a protocol constant, and that if the system has its
@@ -311,16 +325,16 @@ innetgr_r(const char *, const char *, co
#endif
#ifdef NEED_SETNETGRENT_R
-#ifdef NGR_R_ENT_ARGS
-NGR_R_SET_RETURN setnetgrent_r(const char *netgroup, NGR_R_ENT_ARGS);
+#ifdef NGR_R_SET_ARGS
+NGR_R_SET_RETURN setnetgrent_r(NGR_R_SET_CONST char *netgroup, NGR_R_SET_ARGS);
#else
-NGR_R_SET_RETURN setnetgrent_r(const char *netgroup);
+NGR_R_SET_RETURN setnetgrent_r(NGR_R_SET_CONST char *netgroup);
#endif
#endif
#ifdef NEED_ENDNETGRENT_R
-#ifdef NGR_R_ENT_ARGS
-NGR_R_END_RETURN endnetgrent_r(NGR_R_ENT_ARGS);
+#ifdef NGR_R_END_ARGS
+NGR_R_END_RETURN endnetgrent_r(NGR_R_END_ARGS);
#else
NGR_R_END_RETURN endnetgrent_r(void);
#endif
@@ -386,10 +400,12 @@ int isc__gettimeofday(struct timeval *tv
int isc__gettimeofday(struct timeval *tp, struct timezone *tzp);
#endif
-int getnetgrent(char **machinep, char **userp, char **domainp);
+int getnetgrent(NGR_R_CONST char **machinep, NGR_R_CONST char **userp,
+ NGR_R_CONST char **domainp);
#ifdef NGR_R_ARGS
-int getnetgrent_r(char **machinep, char **userp, char **domainp, NGR_R_ARGS);
+int getnetgrent_r(NGR_R_CONST char **machinep, NGR_R_CONST char **userp,
+ NGR_R_CONST char **domainp, NGR_R_ARGS);
#endif
#ifdef SETNETGRENT_ARGS
@@ -407,11 +423,87 @@ int innetgr(const char *netgroup, const
const char *user, const char *domain);
#endif
-#ifdef NGR_R_ENT_ARGS
+#ifdef NGR_R_SET_ARGS
NGR_R_SET_RETURN
-setnetgrent_r(const char *netgroup, NGR_R_ENT_ARGS);
+setnetgrent_r(NGR_R_SET_CONST char *netgroup, NGR_R_SET_ARGS);
#else
NGR_R_SET_RETURN
-setnetgrent_r(const char *netgroup);
+setnetgrent_r(NGR_R_SET_CONST char *netgroup);
+#endif
+
+#ifdef NEED_STRTOUL
+unsigned long strtoul(const char *, char **, int);
#endif
+
+#ifdef NEED_SUN4PROTOS
+#include
+#ifndef __SIZE_TYPE__
+#define __SIZE_TYPE__ int
+#endif
+struct sockaddr;
+struct iovec;
+struct timeval;
+struct timezone;
+int fprintf(FILE *, const char *, ...);
+int getsockname(int, struct sockaddr *, int *);
+int getpeername(int, struct sockaddr *, int *);
+int socket(int, int, int);
+int connect(int, const struct sockaddr *, int);
+int writev(int, struct iovec *, int);
+int readv(int, struct iovec *, int);
+int send(int, const char *, int, int);
+void bzero(char *, int);
+int recvfrom(int, char *, int, int, struct sockaddr *, int *);
+int syslog(int, const char *, ... );
+int printf(const char *, ...);
+__SIZE_TYPE__ fread(void *, __SIZE_TYPE__, __SIZE_TYPE__, FILE *);
+__SIZE_TYPE__ fwrite(const void *, __SIZE_TYPE__, __SIZE_TYPE__, FILE *);
+int fclose(FILE *);
+int ungetc(int, FILE *);
+int scanf(const char *, ...);
+int sscanf(const char *, const char *, ... );
+int tolower(int);
+int toupper(int);
+int strcasecmp(const char *, const char *);
+int strncasecmp(const char *, const char *, int);
+int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+#ifdef gettimeofday
+#undef gettimeofday
+int gettimeofday(struct timeval *, struct timezone *);
+#define gettimeofday isc__gettimeofday
+#else
+int gettimeofday(struct timeval *, struct timezone *);
+#endif
+long strtol(const char*, char **, int);
+int fseek(FILE *, long, int);
+int setsockopt(int, int, int, const char *, int);
+int bind(int, const struct sockaddr *, int);
+void bcopy(char *, char *, int);
+int fputc(char, FILE *);
+int listen(int, int);
+int accept(int, struct sockaddr *, int *);
+int getsockopt(int, int, int, char *, int *);
+int vfprintf(FILE *, const char *, va_list);
+int fflush(FILE *);
+int fgetc(FILE *);
+int fputs(const char *, FILE *);
+int fchown(int, int, int);
+void setbuf(FILE *, char *);
+int gethostname(char *, int);
+int rename(const char *, const char *);
+time_t time(time_t *);
+int fscanf(FILE *, const char *, ...);
+int sscanf(const char *, const char *, ...);
+int ioctl(int, int, caddr_t);
+void perror(const char *);
+
+#if !defined(__USE_FIXED_PROTOTYPES__) && !defined(__cplusplus) && !defined(__STRICT_ANSI__)
+/*
+ * 'gcc -ansi' changes the prototype for vsprintf().
+ * Use this prototype when 'gcc -ansi' is not in effect.
+ */
+char *vsprintf(char *, const char *, va_list);
+#endif
+#endif
+
#endif
Modified: stable/7/lib/bind/bind/port_before.h
==============================================================================
--- stable/7/lib/bind/bind/port_before.h Sat Jan 10 03:00:21 2009 (r186996)
+++ stable/7/lib/bind/bind/port_before.h Sat Jan 10 03:01:18 2009 (r186997)
@@ -4,6 +4,10 @@
#define port_before_h
#include
+#ifdef NEED_SUN4PROTOS
+#define _PARAMS(x) x
+#endif
+
struct group; /* silence warning */
struct passwd; /* silence warning */
struct timeval; /* silence warning */
@@ -83,15 +87,22 @@ struct timespec {
#define NGR_R_BAD (0)
#define NGR_R_COPY buf, buflen
#define NGR_R_COPY_ARGS NGR_R_ARGS
+#define NGR_R_CONST
#define NGR_R_END_RESULT(x) /*empty*/
#define NGR_R_END_RETURN void
-#undef NGR_R_ENT_ARGS /*empty*/
+#undef NGR_R_END_ARGS /*empty*/
#define NGR_R_OK 1
#define NGR_R_RETURN int
+#define NGR_R_SET_CONST const
#undef NGR_R_SET_RESULT /*empty*/
#define NGR_R_SET_RETURN void
+#undef NGR_R_SET_ARGS
+#if !defined(NGR_R_SET_ARGS) && defined(NGR_R_END_ARGS)
+#define NGR_R_SET_ARGS NGR_R_END_ARGS
+#endif
+
#define PROTO_R_ARGS char *buf, size_t buflen, struct protoent **answerp
#define PROTO_R_BAD ERANGE
#define PROTO_R_COPY buf, buflen
Modified: stable/7/lib/bind/config.h
==============================================================================
--- stable/7/lib/bind/config.h Sat Jan 10 03:00:21 2009 (r186996)
+++ stable/7/lib/bind/config.h Sat Jan 10 03:01:18 2009 (r186997)
@@ -160,6 +160,12 @@ int sigwait(const unsigned int *set, int
/* Define if you cannot bind() before connect() for TCP sockets. */
/* #undef BROKEN_TCP_BIND_BEFORE_CONNECT */
+/* Solaris hack to get select_large_fdset. */
+/* #undef FD_SETSIZE */
+
+/* Define to 1 if you have the `capset' function. */
+/* #undef HAVE_CAPSET */
+
/* Define to 1 if you have the header file. */
/* #undef HAVE_DLFCN_H */
@@ -217,6 +223,15 @@ int sigwait(const unsigned int *set, int
/* Define to 1 if you have the header file. */
#define HAVE_STRING_H 1
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_SYS_CAPABILITY_H */
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_SYS_DEVPOLL_H */
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_SYS_DYNTUNE_H */
+
/* Define to 1 if you have the header file. */
#define HAVE_SYS_PARAM_H 1
@@ -303,7 +318,7 @@ int sigwait(const unsigned int *set, int
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
-#define inline
+#define inline /**/
#endif
/* Define to `unsigned int' if does not define. */
@@ -314,3 +329,7 @@ int sigwait(const unsigned int *set, int
/* Define to `unsigned long' if does not define. */
/* #undef uintptr_t */
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+/* #undef volatile */
Modified: stable/7/lib/bind/dns/code.h
==============================================================================
--- stable/7/lib/bind/dns/code.h Sat Jan 10 03:00:21 2009 (r186996)
+++ stable/7/lib/bind/dns/code.h Sat Jan 10 03:01:18 2009 (r186997)
@@ -1,7 +1,7 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
Modified: stable/7/lib/bind/dns/dns/enumclass.h
==============================================================================
--- stable/7/lib/bind/dns/dns/enumclass.h Sat Jan 10 03:00:21 2009 (r186996)
+++ stable/7/lib/bind/dns/dns/enumclass.h Sat Jan 10 03:01:18 2009 (r186997)
@@ -1,7 +1,7 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
Modified: stable/7/lib/bind/dns/dns/enumtype.h
==============================================================================
--- stable/7/lib/bind/dns/dns/enumtype.h Sat Jan 10 03:00:21 2009 (r186996)
+++ stable/7/lib/bind/dns/dns/enumtype.h Sat Jan 10 03:01:18 2009 (r186997)
@@ -1,7 +1,7 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
Modified: stable/7/lib/bind/dns/dns/rdatastruct.h
==============================================================================
--- stable/7/lib/bind/dns/dns/rdatastruct.h Sat Jan 10 03:00:21 2009 (r186996)
+++ stable/7/lib/bind/dns/dns/rdatastruct.h Sat Jan 10 03:01:18 2009 (r186997)
@@ -1,7 +1,7 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -1608,10 +1608,10 @@ typedef struct dns_rdata_rrsig {
#endif /* GENERIC_DNSSIG_46_H */
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2003 Internet Software Consortium.
*
- * Permission to use, copy, modify, and distribute this software for any
+ * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@@ -1627,10 +1627,10 @@ typedef struct dns_rdata_rrsig {
#ifndef GENERIC_NSEC_47_H
#define GENERIC_NSEC_47_H 1
-/* $Id: nsec_47.h,v 1.4.20.2 2005/04/29 00:16:37 marka Exp $ */
+/* $Id: nsec_47.h,v 1.4.20.4 2008/07/15 23:46:14 tbox Exp $ */
/*!
- * \brief Per draft-ietf-dnsext-nsec-rdata-01.txt */
+ * \brief Per RFC 3845 */
typedef struct dns_rdata_nsec {
dns_rdatacommon_t common;
Modified: stable/7/lib/bind/isc/Makefile
==============================================================================
--- stable/7/lib/bind/isc/Makefile Sat Jan 10 03:00:21 2009 (r186996)
+++ stable/7/lib/bind/isc/Makefile Sat Jan 10 03:01:18 2009 (r186997)
@@ -32,7 +32,7 @@ SRCS+= inet_pton.c \
hash.c heap.c hex.c hmacmd5.c hmacsha.c \
lex.c lfsr.c lib.c log.c md5.c \
mem.c mutexblock.c netaddr.c netscope.c ondestroy.c \
- parseint.c print.c quota.c random.c \
+ parseint.c portset.c print.c quota.c random.c \
ratelimiter.c refcount.c region.c result.c rwlock.c \
serial.c sha1.c sha2.c sockaddr.c string.c strtoul.c \
symtab.c task.c taskpool.c timer.c version.c
@@ -84,6 +84,7 @@ INCS= ${SRCDIR}/include/isc/app.h \
${SRCDIR}/include/isc/ondestroy.h \
${SRCDIR}/include/isc/os.h \
${SRCDIR}/include/isc/parseint.h \
+ ${SRCDIR}/include/isc/portset.h \
${SRCDIR}/include/isc/print.h \
${SRCDIR}/include/isc/quota.h \
${SRCDIR}/include/isc/random.h \
Modified: stable/7/lib/bind/isc/isc/platform.h
==============================================================================
--- stable/7/lib/bind/isc/isc/platform.h Sat Jan 10 03:00:21 2009 (r186996)
+++ stable/7/lib/bind/isc/isc/platform.h Sat Jan 10 03:01:18 2009 (r186997)
@@ -1,7 +1,7 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -17,7 +17,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: platform.h.in,v 1.34.18.9 2007/09/13 05:04:01 each Exp $ */
+/* $Id: platform.h.in,v 1.34.18.11 2008/06/24 23:45:55 tbox Exp $ */
#ifndef ISC_PLATFORM_H
#define ISC_PLATFORM_H 1
@@ -142,6 +142,21 @@
*/
#undef ISC_PLATFORM_FIXIN6ISADDR
+/*! \brief
+ * Define if the system supports kqueue multiplexing
+ */
+#define ISC_PLATFORM_HAVEKQUEUE 1
+
+/*! \brief
+ * Define if the system supports epoll multiplexing
+ */
+#undef ISC_PLATFORM_HAVEEPOLL
+
+/*! \brief
+ * Define if the system supports /dev/poll multiplexing
+ */
+#undef ISC_PLATFORM_HAVEDEVPOLL
+
/*
*** Printing.
***/
@@ -226,19 +241,19 @@
/*
* If the "xadd" operation is available on this architecture,
- * ISC_PLATFORM_HAVEXADD will be defined.
+ * ISC_PLATFORM_HAVEXADD will be defined.
*/
#define ISC_PLATFORM_HAVEXADD 1
/*
* If the "atomic swap" operation is available on this architecture,
- * ISC_PLATFORM_HAVEATOMICSTORE" will be defined.
+ * ISC_PLATFORM_HAVEATOMICSTORE" will be defined.
*/
#define ISC_PLATFORM_HAVEATOMICSTORE 1
/*
* If the "compare-and-exchange" operation is available on this architecture,
- * ISC_PLATFORM_HAVECMPXCHG will be defined.
+ * ISC_PLATFORM_HAVECMPXCHG will be defined.
*/
#define ISC_PLATFORM_HAVECMPXCHG 1
Modified: stable/7/share/doc/bind9/Makefile
==============================================================================
--- stable/7/share/doc/bind9/Makefile Sat Jan 10 03:00:21 2009 (r186996)
+++ stable/7/share/doc/bind9/Makefile Sat Jan 10 03:01:18 2009 (r186997)
@@ -20,7 +20,7 @@ ARM= Bv9ARM.ch01.html Bv9ARM.ch02.html
man.rndc.html
ARMDIR= ${TOPDIR}/arm
MISC= dnssec format-options.pl ipv6 migration migration-4to9 \
- options rfc-compliance roadmap sdb
+ options rfc-compliance roadmap sdb sort-options.pl
MISCDIR= ${TOPDIR}/misc
.include
Modified: stable/7/usr.bin/nsupdate/Makefile
==============================================================================
--- stable/7/usr.bin/nsupdate/Makefile Sat Jan 10 03:00:21 2009 (r186996)
+++ stable/7/usr.bin/nsupdate/Makefile Sat Jan 10 03:01:18 2009 (r186997)
@@ -18,7 +18,7 @@ CFLAGS+= -I${BIND_DIR}/lib/isc/${ISC_ATO
DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
-MAN= nsupdate.8
+MAN= nsupdate.1
MANFILTER= sed -e "s@/etc/named\.conf@/etc/namedb/named.conf@g" \
-e "s@^\.HP [0-9]* @@"
From dougb at FreeBSD.org Sat Jan 10 03:04:22 2009
From: dougb at FreeBSD.org (Doug Barton)
Date: Sat Jan 10 03:04:39 2009
Subject: svn commit: r186998 - in stable/7: share/doc/bind9 usr.bin/nsupdate
Message-ID: <200901100304.n0A34LDl077818@svn.freebsd.org>
Author: dougb
Date: Sat Jan 10 03:04:21 2009
New Revision: 186998
URL: http://svn.freebsd.org/changeset/base/186998
Log:
MFC the BIND 9.4.3 and 9.4.3-P1 updates
Modified:
stable/7/share/doc/bind9/ (props changed)
stable/7/usr.bin/nsupdate/ (props changed)
From dougb at FreeBSD.org Sat Jan 10 03:07:26 2009
From: dougb at FreeBSD.org (Doug Barton)
Date: Sat Jan 10 03:07:43 2009
Subject: svn commit: r186998 - in stable/7: share/doc/bind9
usr.bin/nsupdate
In-Reply-To: <200901100304.n0A34LDl077818@svn.freebsd.org>
References: <200901100304.n0A34LDl077818@svn.freebsd.org>
Message-ID: <496810EA.9080508@FreeBSD.org>
Doug Barton wrote:
> Author: dougb
> Date: Sat Jan 10 03:04:21 2009
> New Revision: 186998
> URL: http://svn.freebsd.org/changeset/base/186998
>
> Log:
> MFC the BIND 9.4.3 and 9.4.3-P1 updates
>
> Modified:
> stable/7/share/doc/bind9/ (props changed)
> stable/7/usr.bin/nsupdate/ (props changed)
In case someone is curious, when I listed the non-contrib changes on
the command line I inadvertently left out these mergeinfo updates on
the directories.
Doug
--
This .signature sanitized for your protection
From dougb at FreeBSD.org Sat Jan 10 03:11:20 2009
From: dougb at FreeBSD.org (Doug Barton)
Date: Sat Jan 10 03:11:27 2009
Subject: svn commit: r186996 - in stable/7/contrib/bind9: . bin/check
bin/dig bin/dnssec bin/named bin/named/include/named bin/named/unix
bin/named/unix/include/named
bin/nsupdate bin/rndc doc/arm doc/misc ...
In-Reply-To: <200901100300.n0A30M5b077529@svn.freebsd.org>
References: <200901100300.n0A30M5b077529@svn.freebsd.org>
Message-ID: <496811D6.5010700@FreeBSD.org>
Doug Barton wrote:
> Author: dougb
> Date: Sat Jan 10 03:00:21 2009
> New Revision: 186996
> URL: http://svn.freebsd.org/changeset/base/186996
>
> Log:
> MFC the BIND 9.4.3 and 9.4.3-P1 updates
In case anyone is curious, 9.4.3 has been in HEAD for > 2 weeks. The
changes for -P1 only touch a few files in contrib/bind9, are only
relevant to those who verify signatures with DNSSEC, and have been
requested by the security team. Thus the uncustomarily short MFC.
Doug
--
This .signature sanitized for your protection
From antoine at FreeBSD.org Sat Jan 10 10:25:26 2009
From: antoine at FreeBSD.org (Antoine Brodin)
Date: Sat Jan 10 10:25:33 2009
Subject: svn commit: r187015 - in stable/7: . tools/build/mk
Message-ID: <200901101025.n0AAPP5b086546@svn.freebsd.org>
Author: antoine
Date: Sat Jan 10 10:25:25 2009
New Revision: 187015
URL: http://svn.freebsd.org/changeset/base/187015
Log:
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
Modified:
stable/7/ObsoleteFiles.inc
stable/7/tools/build/mk/OptionalObsoleteFiles.inc
Modified: stable/7/ObsoleteFiles.inc
==============================================================================
--- stable/7/ObsoleteFiles.inc Sat Jan 10 09:17:16 2009 (r187014)
+++ stable/7/ObsoleteFiles.inc Sat Jan 10 10:25:25 2009 (r187015)
@@ -3531,7 +3531,6 @@ 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/wi/wi_hostap.h
@@ -3941,10 +3940,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
@@ -3959,7 +3956,6 @@ OLD_FILES+=usr/share/man/man3/setruneloc
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
@@ -3975,7 +3971,6 @@ OLD_FILES+=usr/share/man/man3/setinvalid
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
Modified: stable/7/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- stable/7/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 10 09:17:16 2009 (r187014)
+++ stable/7/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 10 10:25:25 2009 (r187015)
@@ -402,9 +402,13 @@ OLD_FILES+=usr/share/man/man1/gcov.1.gz
# to be filled in
#.endif
-#.if ${MK_HESIOD} == no
-# to be filled in
-#.endif
+.if ${MK_HESIOD} == no
+OLD_FILES+=usr/bin/hesinfo
+OLD_FILES+=usr/include/hesiod.h
+OLD_FILES+=usr/share/man/man1/hesinfo.1.gz
+OLD_FILES+=usr/share/man/man3/hesiod.3.gz
+OLD_FILES+=usr/share/man/man5/hesiod.conf.5.gz
+.endif
#.if ${MK_HTML} == no
# to be filled in
From rwatson at FreeBSD.org Sat Jan 10 10:30:01 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Sat Jan 10 10:30:12 2009
Subject: svn commit: r186991 - stable/7/usr.sbin/powerd
In-Reply-To: <200901100041.n0A0fUp3073999@svn.freebsd.org>
References: <200901100041.n0A0fUp3073999@svn.freebsd.org>
Message-ID:
On Sat, 10 Jan 2009, Alexander Motin wrote:
> Author: mav
> Date: Sat Jan 10 00:41:30 2009
> New Revision: 186991
> URL: http://svn.freebsd.org/changeset/base/186991
>
> Log:
> Mark that powerd is completely merged.
Thanks! This does make it a lot easier to inspect the merge history and look
for missing merges.
Robert N M Watson
Computer Laboratory
University of Cambridge
From antoine at FreeBSD.org Sat Jan 10 11:45:48 2009
From: antoine at FreeBSD.org (Antoine Brodin)
Date: Sat Jan 10 11:46:00 2009
Subject: svn commit: r187017 - in stable/7: contrib/telnet
contrib/telnet/arpa include include/arpa
Message-ID: <200901101145.n0ABjlKg096426@svn.freebsd.org>
Author: antoine
Date: Sat Jan 10 11:45:47 2009
New Revision: 187017
URL: http://svn.freebsd.org/changeset/base/187017
Log:
MFC r183004 to stable/7:
Fix TELOPT(opt) when opt > TELOPT_TN3270E.
PR: 127194
Submitted by: Joost Bekkers
MFC after: 1 month
Modified:
stable/7/contrib/telnet/ (props changed)
stable/7/contrib/telnet/arpa/telnet.h
stable/7/include/ (props changed)
stable/7/include/arpa/telnet.h
Modified: stable/7/contrib/telnet/arpa/telnet.h
==============================================================================
--- stable/7/contrib/telnet/arpa/telnet.h Sat Jan 10 10:58:41 2009 (r187016)
+++ stable/7/contrib/telnet/arpa/telnet.h Sat Jan 10 11:45:47 2009 (r187017)
@@ -140,8 +140,8 @@ const char *telopts[NTELOPTS+1] = {
"TACACS UID", "OUTPUT MARKING", "TTYLOC",
"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
- "ENCRYPT", "NEW-ENVIRON", "TN3270E", "CHARSET", "COM-PORT",
- "KERMIT",
+ "ENCRYPT", "NEW-ENVIRON", "TN3270E", "XAUTH", "CHARSET",
+ "RSP", "COM-PORT", "SLE", "STARTTLS", "KERMIT",
0
};
#define TELOPT_FIRST TELOPT_BINARY
Modified: stable/7/include/arpa/telnet.h
==============================================================================
--- stable/7/include/arpa/telnet.h Sat Jan 10 10:58:41 2009 (r187016)
+++ stable/7/include/arpa/telnet.h Sat Jan 10 11:45:47 2009 (r187017)
@@ -140,8 +140,8 @@ const char *telopts[NTELOPTS+1] = {
"TACACS UID", "OUTPUT MARKING", "TTYLOC",
"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
- "ENCRYPT", "NEW-ENVIRON", "TN3270E", "CHARSET", "COM-PORT",
- "KERMIT",
+ "ENCRYPT", "NEW-ENVIRON", "TN3270E", "XAUTH", "CHARSET",
+ "RSP", "COM-PORT", "SLE", "STARTTLS", "KERMIT",
0
};
#define TELOPT_FIRST TELOPT_BINARY
From rnoland at FreeBSD.org Sat Jan 10 14:53:49 2009
From: rnoland at FreeBSD.org (Robert Noland)
Date: Sat Jan 10 14:53:55 2009
Subject: svn commit: r187021 - in stable/7/sys: . conf dev/drm
modules/drm/i915
Message-ID: <200901101453.n0AErmLq000261@svn.freebsd.org>
Author: rnoland
Date: Sat Jan 10 14:53:47 2009
New Revision: 187021
URL: http://svn.freebsd.org/changeset/base/187021
Log:
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
Added:
stable/7/sys/dev/drm/drm_internal.h
- copied unchanged from r182080, head/sys/dev/drm/drm_internal.h
stable/7/sys/dev/drm/i915_suspend.c
- copied, changed from r182080, head/sys/dev/drm/i915_suspend.c
stable/7/sys/dev/drm/radeon_microcode.h
- copied unchanged from r182080, head/sys/dev/drm/radeon_microcode.h
Modified:
stable/7/sys/ (props changed)
stable/7/sys/conf/files
stable/7/sys/dev/drm/ati_pcigart.c
stable/7/sys/dev/drm/drm-subprocess.pl
stable/7/sys/dev/drm/drm.h
stable/7/sys/dev/drm/drmP.h
stable/7/sys/dev/drm/drm_agpsupport.c
stable/7/sys/dev/drm/drm_atomic.h
stable/7/sys/dev/drm/drm_auth.c
stable/7/sys/dev/drm/drm_bufs.c
stable/7/sys/dev/drm/drm_context.c
stable/7/sys/dev/drm/drm_dma.c
stable/7/sys/dev/drm/drm_drawable.c
stable/7/sys/dev/drm/drm_drv.c
stable/7/sys/dev/drm/drm_fops.c
stable/7/sys/dev/drm/drm_ioctl.c
stable/7/sys/dev/drm/drm_irq.c
stable/7/sys/dev/drm/drm_linux_list.h
stable/7/sys/dev/drm/drm_lock.c
stable/7/sys/dev/drm/drm_memory.c
stable/7/sys/dev/drm/drm_pci.c
stable/7/sys/dev/drm/drm_pciids.h
stable/7/sys/dev/drm/drm_sarea.h
stable/7/sys/dev/drm/drm_scatter.c
stable/7/sys/dev/drm/drm_sysctl.c
stable/7/sys/dev/drm/drm_vm.c
stable/7/sys/dev/drm/i915_dma.c
stable/7/sys/dev/drm/i915_drm.h
stable/7/sys/dev/drm/i915_drv.c
stable/7/sys/dev/drm/i915_drv.h
stable/7/sys/dev/drm/i915_irq.c
stable/7/sys/dev/drm/i915_mem.c
stable/7/sys/dev/drm/mach64_dma.c
stable/7/sys/dev/drm/mach64_drm.h
stable/7/sys/dev/drm/mach64_drv.c
stable/7/sys/dev/drm/mach64_drv.h
stable/7/sys/dev/drm/mach64_irq.c
stable/7/sys/dev/drm/mach64_state.c
stable/7/sys/dev/drm/mga_dma.c
stable/7/sys/dev/drm/mga_drm.h
stable/7/sys/dev/drm/mga_drv.c
stable/7/sys/dev/drm/mga_drv.h
stable/7/sys/dev/drm/mga_irq.c
stable/7/sys/dev/drm/mga_state.c
stable/7/sys/dev/drm/mga_warp.c
stable/7/sys/dev/drm/r128_cce.c
stable/7/sys/dev/drm/r128_drm.h
stable/7/sys/dev/drm/r128_drv.c
stable/7/sys/dev/drm/r128_drv.h
stable/7/sys/dev/drm/r128_irq.c
stable/7/sys/dev/drm/r128_state.c
stable/7/sys/dev/drm/r300_cmdbuf.c
stable/7/sys/dev/drm/r300_reg.h
stable/7/sys/dev/drm/radeon_cp.c
stable/7/sys/dev/drm/radeon_drm.h
stable/7/sys/dev/drm/radeon_drv.c
stable/7/sys/dev/drm/radeon_drv.h
stable/7/sys/dev/drm/radeon_irq.c
stable/7/sys/dev/drm/radeon_mem.c
stable/7/sys/dev/drm/radeon_state.c
stable/7/sys/dev/drm/savage_bci.c
stable/7/sys/dev/drm/savage_drm.h
stable/7/sys/dev/drm/savage_drv.c
stable/7/sys/dev/drm/savage_drv.h
stable/7/sys/dev/drm/savage_state.c
stable/7/sys/dev/drm/sis_drv.c
stable/7/sys/dev/drm/sis_drv.h
stable/7/sys/dev/drm/sis_mm.c
stable/7/sys/dev/drm/tdfx_drv.c
stable/7/sys/modules/drm/i915/Makefile
Modified: stable/7/sys/conf/files
==============================================================================
--- stable/7/sys/conf/files Sat Jan 10 14:14:00 2009 (r187020)
+++ stable/7/sys/conf/files Sat Jan 10 14:53:47 2009 (r187021)
@@ -576,6 +576,7 @@ dev/drm/i915_dma.c optional i915drm
dev/drm/i915_drv.c optional i915drm
dev/drm/i915_irq.c optional i915drm
dev/drm/i915_mem.c optional i915drm
+dev/drm/i915_suspend.c optional i915drm
dev/drm/mach64_dma.c optional mach64drm
dev/drm/mach64_drv.c optional mach64drm
dev/drm/mach64_irq.c optional mach64drm
Modified: stable/7/sys/dev/drm/ati_pcigart.c
==============================================================================
--- stable/7/sys/dev/drm/ati_pcigart.c Sat Jan 10 14:14:00 2009 (r187020)
+++ stable/7/sys/dev/drm/ati_pcigart.c Sat Jan 10 14:53:47 2009 (r187021)
@@ -1,6 +1,3 @@
-/* ati_pcigart.h -- ATI PCI GART support -*- linux-c -*-
- * Created: Wed Dec 13 21:52:19 2000 by gareth@valinux.com
- */
/*-
* Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
* All Rights Reserved.
@@ -32,72 +29,194 @@
#include
__FBSDID("$FreeBSD$");
+/** @file ati_pcigart.c
+ * Implementation of ATI's PCIGART, which provides an aperture in card virtual
+ * address space with addresses remapped to system memory.
+ */
+
#include "dev/drm/drmP.h"
#define ATI_PCIGART_PAGE_SIZE 4096 /* PCI GART page size */
-#define ATI_MAX_PCIGART_PAGES 8192 /* 32 MB aperture, 4K pages */
-#define ATI_PCIGART_TABLE_SIZE 32768
+#define ATI_PCIGART_PAGE_MASK (~(ATI_PCIGART_PAGE_SIZE-1))
+
+#define ATI_PCIE_WRITE 0x4
+#define ATI_PCIE_READ 0x8
-int drm_ati_pcigart_init(drm_device_t *dev, drm_ati_pcigart_info *gart_info)
+static void
+drm_ati_alloc_pcigart_table_cb(void *arg, bus_dma_segment_t *segs,
+ int nsegs, int error)
{
- unsigned long pages;
- u32 *pci_gart = NULL, page_base;
- int i, j;
+ struct drm_dma_handle *dmah = arg;
- if (dev->sg == NULL) {
- DRM_ERROR( "no scatter/gather memory!\n" );
- return 0;
+ if (error != 0)
+ return;
+
+ KASSERT(nsegs == 1,
+ ("drm_ati_alloc_pcigart_table_cb: bad dma segment count"));
+
+ dmah->busaddr = segs[0].ds_addr;
+}
+
+static int
+drm_ati_alloc_pcigart_table(struct drm_device *dev,
+ struct drm_ati_pcigart_info *gart_info)
+{
+ struct drm_dma_handle *dmah;
+ int flags, ret;
+
+ dmah = malloc(sizeof(struct drm_dma_handle), DRM_MEM_DMA,
+ M_ZERO | M_NOWAIT);
+ if (dmah == NULL)
+ return ENOMEM;
+
+ DRM_UNLOCK();
+ ret = bus_dma_tag_create(NULL, PAGE_SIZE, 0, /* tag, align, boundary */
+ gart_info->table_mask, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */
+ NULL, NULL, /* filtfunc, filtfuncargs */
+ gart_info->table_size, 1, /* maxsize, nsegs */
+ gart_info->table_size, /* maxsegsize */
+ BUS_DMA_ALLOCNOW, NULL, NULL, /* flags, lockfunc, lockfuncargs */
+ &dmah->tag);
+ if (ret != 0) {
+ free(dmah, DRM_MEM_DMA);
+ return ENOMEM;
}
- if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
- /* GART table in system memory */
- dev->sg->dmah = drm_pci_alloc(dev, ATI_PCIGART_TABLE_SIZE, 0,
- 0xfffffffful);
- if (dev->sg->dmah == NULL) {
- DRM_ERROR("cannot allocate PCI GART table!\n");
- return 0;
- }
+ flags = BUS_DMA_NOWAIT | BUS_DMA_ZERO;
+ if (gart_info->gart_reg_if == DRM_ATI_GART_IGP)
+ flags |= BUS_DMA_NOCACHE;
- gart_info->addr = (void *)dev->sg->dmah->vaddr;
- gart_info->bus_addr = dev->sg->dmah->busaddr;
- pci_gart = (u32 *)dev->sg->dmah->vaddr;
- } else {
- /* GART table in framebuffer memory */
- pci_gart = gart_info->addr;
+ ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, flags, &dmah->map);
+ if (ret != 0) {
+ bus_dma_tag_destroy(dmah->tag);
+ free(dmah, DRM_MEM_DMA);
+ return ENOMEM;
}
-
- pages = DRM_MIN(dev->sg->pages, ATI_MAX_PCIGART_PAGES);
+ DRM_LOCK();
- bzero(pci_gart, ATI_PCIGART_TABLE_SIZE);
+ ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr,
+ gart_info->table_size, drm_ati_alloc_pcigart_table_cb, dmah, 0);
+ if (ret != 0) {
+ bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
+ bus_dma_tag_destroy(dmah->tag);
+ free(dmah, DRM_MEM_DMA);
+ return ENOMEM;
+ }
- KASSERT(PAGE_SIZE >= ATI_PCIGART_PAGE_SIZE, ("page size too small"));
+ dev->sg->dmah = dmah;
- for ( i = 0 ; i < pages ; i++ ) {
- page_base = (u32) dev->sg->busaddr[i];
+ return 0;
+}
- for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) {
- if (gart_info->is_pcie)
- *pci_gart = (cpu_to_le32(page_base) >> 8) | 0xc;
- else
- *pci_gart = cpu_to_le32(page_base);
- pci_gart++;
- page_base += ATI_PCIGART_PAGE_SIZE;
- }
+static void
+drm_ati_free_pcigart_table(struct drm_device *dev,
+ struct drm_ati_pcigart_info *gart_info)
+{
+ struct drm_dma_handle *dmah = dev->sg->dmah;
+
+ bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
+ bus_dma_tag_destroy(dmah->tag);
+ free(dmah, DRM_MEM_DMA);
+ dev->sg->dmah = NULL;
+}
+
+int
+drm_ati_pcigart_cleanup(struct drm_device *dev,
+ struct drm_ati_pcigart_info *gart_info)
+{
+ /* we need to support large memory configurations */
+ if (dev->sg == NULL) {
+ DRM_ERROR("no scatter/gather memory!\n");
+ return 0;
}
- DRM_MEMORYBARRIER();
+ if (gart_info->bus_addr) {
+ if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
+ gart_info->bus_addr = 0;
+ if (dev->sg->dmah)
+ drm_ati_free_pcigart_table(dev, gart_info);
+ }
+ }
return 1;
}
-int drm_ati_pcigart_cleanup(drm_device_t *dev, drm_ati_pcigart_info *gart_info)
+int
+drm_ati_pcigart_init(struct drm_device *dev,
+ struct drm_ati_pcigart_info *gart_info)
{
+ void *address = NULL;
+ unsigned long pages;
+ u32 *pci_gart, page_base;
+ dma_addr_t bus_address = 0;
+ dma_addr_t entry_addr;
+ int i, j, ret = 0;
+ int max_pages;
+
+ /* we need to support large memory configurations */
if (dev->sg == NULL) {
- DRM_ERROR( "no scatter/gather memory!\n" );
- return 0;
+ DRM_ERROR("no scatter/gather memory!\n");
+ goto done;
}
- drm_pci_free(dev, dev->sg->dmah);
+ if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
+ DRM_DEBUG("PCI: no table in VRAM: using normal RAM\n");
- return 1;
+ ret = drm_ati_alloc_pcigart_table(dev, gart_info);
+ if (ret) {
+ DRM_ERROR("cannot allocate PCI GART page!\n");
+ goto done;
+ }
+
+ address = (void *)dev->sg->dmah->vaddr;
+ bus_address = dev->sg->dmah->busaddr;
+ } else {
+ address = gart_info->addr;
+ bus_address = gart_info->bus_addr;
+ DRM_DEBUG("PCI: Gart Table: VRAM %08X mapped at %08lX\n",
+ (unsigned int)bus_address, (unsigned long)address);
+ }
+
+ pci_gart = (u32 *) address;
+
+ max_pages = (gart_info->table_size / sizeof(u32));
+ pages = (dev->sg->pages <= max_pages)
+ ? dev->sg->pages : max_pages;
+
+ memset(pci_gart, 0, max_pages * sizeof(u32));
+
+ KASSERT(PAGE_SIZE >= ATI_PCIGART_PAGE_SIZE, ("page size too small"));
+
+ for (i = 0; i < pages; i++) {
+ entry_addr = dev->sg->busaddr[i];
+ for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) {
+ page_base = (u32) entry_addr & ATI_PCIGART_PAGE_MASK;
+ switch(gart_info->gart_reg_if) {
+ case DRM_ATI_GART_IGP:
+ page_base |=
+ (upper_32_bits(entry_addr) & 0xff) << 4;
+ page_base |= 0xc;
+ break;
+ case DRM_ATI_GART_PCIE:
+ page_base >>= 8;
+ page_base |=
+ (upper_32_bits(entry_addr) & 0xff) << 24;
+ page_base |= ATI_PCIE_READ | ATI_PCIE_WRITE;
+ break;
+ default:
+ case DRM_ATI_GART_PCI:
+ break;
+ }
+ *pci_gart = cpu_to_le32(page_base);
+ pci_gart++;
+ entry_addr += ATI_PCIGART_PAGE_SIZE;
+ }
+ }
+
+ ret = 1;
+
+ done:
+ gart_info->addr = address;
+ gart_info->bus_addr = bus_address;
+ return ret;
}
Modified: stable/7/sys/dev/drm/drm-subprocess.pl
==============================================================================
--- stable/7/sys/dev/drm/drm-subprocess.pl Sat Jan 10 14:14:00 2009 (r187020)
+++ stable/7/sys/dev/drm/drm-subprocess.pl Sat Jan 10 14:53:47 2009 (r187021)
@@ -37,6 +37,7 @@ while (<>) {
s/#include "(.*)_drm.h/#include "dev\/drm\/\1_drm.h/;
s/#include "mga_ucode.h/#include "dev\/drm\/mga_ucode.h/;
s/#include "r300_reg.h/#include "dev\/drm\/r300_reg.h/;
+ s/#include "radeon_microcode.h/#include "dev\/drm\/radeon_microcode.h/;
s/#include "sis_ds.h/#include "dev\/drm\/sis_ds.h/;
s/#include "drm/#include "dev\/drm\/drm/;
print;
@@ -47,4 +48,4 @@ while (<>) {
# if we never found the copyright header, then we're still a line behind.
if (!$foundopening) {
print $lastline;
-}
\ No newline at end of file
+}
Modified: stable/7/sys/dev/drm/drm.h
==============================================================================
--- stable/7/sys/dev/drm/drm.h Sat Jan 10 14:14:00 2009 (r187020)
+++ stable/7/sys/dev/drm/drm.h Sat Jan 10 14:53:47 2009 (r187021)
@@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$");
#ifndef __user
#define __user
#endif
+#ifndef __iomem
+#define __iomem
+#endif
#ifdef __GNUC__
# define DEPRECATED __attribute__ ((deprecated))
@@ -72,9 +75,6 @@ __FBSDID("$FreeBSD$");
#endif
#if defined(__linux__)
-#if defined(__KERNEL__)
-#include
-#endif
#include /* For _IO* macros */
#define DRM_IOCTL_NR(n) _IOC_NR(n)
#define DRM_IOC_VOID _IOC_NONE
@@ -83,14 +83,7 @@ __FBSDID("$FreeBSD$");
#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE
#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
-#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(IN_MODULE)
-/* Prevent name collision when including sys/ioccom.h */
-#undef ioctl
-#include
-#define ioctl(a,b,c) xf86ioctl(a,b,c)
-#else
#include
-#endif /* __FreeBSD__ && xf86ioctl */
#define DRM_IOCTL_NR(n) ((n) & 0xff)
#define DRM_IOC_VOID IOC_VOID
#define DRM_IOC_READ IOC_OUT
@@ -99,24 +92,6 @@ __FBSDID("$FreeBSD$");
#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
#endif
-#define XFREE86_VERSION(major,minor,patch,snap) \
- ((major << 16) | (minor << 8) | patch)
-
-#ifndef CONFIG_XFREE86_VERSION
-#define CONFIG_XFREE86_VERSION XFREE86_VERSION(4,1,0,0)
-#endif
-
-#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0)
-#define DRM_PROC_DEVICES "/proc/devices"
-#define DRM_PROC_MISC "/proc/misc"
-#define DRM_PROC_DRM "/proc/drm"
-#define DRM_DEV_DRM "/dev/drm"
-#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)
-#define DRM_DEV_UID 0
-#define DRM_DEV_GID 0
-#endif
-
-#if CONFIG_XFREE86_VERSION >= XFREE86_VERSION(4,1,0,0)
#ifdef __OpenBSD__
#define DRM_MAJOR 81
#endif
@@ -124,7 +99,7 @@ __FBSDID("$FreeBSD$");
#define DRM_MAJOR 226
#endif
#define DRM_MAX_MINOR 15
-#endif
+
#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */
#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */
#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */
@@ -139,6 +114,7 @@ __FBSDID("$FreeBSD$");
#if defined(__linux__)
typedef unsigned int drm_handle_t;
#else
+#include
typedef unsigned long drm_handle_t; /**< To mapped regions */
#endif
typedef unsigned int drm_context_t; /**< GLXContext handle */
@@ -154,23 +130,23 @@ typedef unsigned int drm_magic_t; /**< M
* \note KW: Actually it's illegal to change either for
* backwards-compatibility reasons.
*/
-typedef struct drm_clip_rect {
+struct drm_clip_rect {
unsigned short x1;
unsigned short y1;
unsigned short x2;
unsigned short y2;
-} drm_clip_rect_t;
+};
/**
* Texture region,
*/
-typedef struct drm_tex_region {
+struct drm_tex_region {
unsigned char next;
unsigned char prev;
unsigned char in_use;
unsigned char padding;
unsigned int age;
-} drm_tex_region_t;
+};
/**
* Hardware lock.
@@ -179,10 +155,10 @@ typedef struct drm_tex_region {
* processor bus contention on a multiprocessor system, there should not be any
* other data stored in the same cache line.
*/
-typedef struct drm_hw_lock {
+struct drm_hw_lock {
__volatile__ unsigned int lock; /**< lock variable */
char padding[60]; /**< Pad to cache line */
-} drm_hw_lock_t;
+};
/* This is beyond ugly, and only works on GCC. However, it allows me to use
* drm.h in places (i.e., in the X-server) where I can't use size_t. The real
@@ -205,7 +181,7 @@ typedef struct drm_hw_lock {
*
* \sa drmGetVersion().
*/
-typedef struct drm_version {
+struct drm_version {
int version_major; /**< Major version */
int version_minor; /**< Minor version */
int version_patchlevel; /**< Patch level */
@@ -215,35 +191,35 @@ typedef struct drm_version {
char __user *date; /**< User-space buffer to hold date */
DRM_SIZE_T desc_len; /**< Length of desc buffer */
char __user *desc; /**< User-space buffer to hold desc */
-} drm_version_t;
+};
/**
* DRM_IOCTL_GET_UNIQUE ioctl argument type.
*
* \sa drmGetBusid() and drmSetBusId().
*/
-typedef struct drm_unique {
+struct drm_unique {
DRM_SIZE_T unique_len; /**< Length of unique */
char __user *unique; /**< Unique name for driver instantiation */
-} drm_unique_t;
+};
#undef DRM_SIZE_T
-typedef struct drm_list {
+struct drm_list {
int count; /**< Length of user-space structures */
- drm_version_t __user *version;
-} drm_list_t;
+ struct drm_version __user *version;
+};
-typedef struct drm_block {
+struct drm_block {
int unused;
-} drm_block_t;
+};
/**
* DRM_IOCTL_CONTROL ioctl argument type.
*
* \sa drmCtlInstHandler() and drmCtlUninstHandler().
*/
-typedef struct drm_control {
+struct drm_control {
enum {
DRM_ADD_COMMAND,
DRM_RM_COMMAND,
@@ -251,37 +227,39 @@ typedef struct drm_control {
DRM_UNINST_HANDLER
} func;
int irq;
-} drm_control_t;
+};
/**
* Type of memory to map.
*/
-typedef enum drm_map_type {
+enum drm_map_type {
_DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */
_DRM_REGISTERS = 1, /**< no caching, no core dump */
_DRM_SHM = 2, /**< shared, cached */
_DRM_AGP = 3, /**< AGP/GART */
_DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */
- _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */
-} drm_map_type_t;
+ _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */
+ _DRM_TTM = 6
+};
/**
* Memory mapping flags.
*/
-typedef enum drm_map_flags {
+enum drm_map_flags {
_DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */
_DRM_READ_ONLY = 0x02,
_DRM_LOCKED = 0x04, /**< shared, cached, locked */
_DRM_KERNEL = 0x08, /**< kernel requires access */
_DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */
_DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */
- _DRM_REMOVABLE = 0x40 /**< Removable mapping */
-} drm_map_flags_t;
+ _DRM_REMOVABLE = 0x40, /**< Removable mapping */
+ _DRM_DRIVER = 0x80 /**< Managed by driver */
+};
-typedef struct drm_ctx_priv_map {
+struct drm_ctx_priv_map {
unsigned int ctx_id; /**< Context requesting private mapping */
void *handle; /**< Handle of map */
-} drm_ctx_priv_map_t;
+};
/**
* DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
@@ -289,30 +267,30 @@ typedef struct drm_ctx_priv_map {
*
* \sa drmAddMap().
*/
-typedef struct drm_map {
+struct drm_map {
unsigned long offset; /**< Requested physical address (0 for SAREA)*/
unsigned long size; /**< Requested physical size (bytes) */
- drm_map_type_t type; /**< Type of memory to map */
- drm_map_flags_t flags; /**< Flags */
+ enum drm_map_type type; /**< Type of memory to map */
+ enum drm_map_flags flags; /**< Flags */
void *handle; /**< User-space: "Handle" to pass to mmap() */
/**< Kernel-space: kernel-virtual address */
int mtrr; /**< MTRR slot used */
/* Private data */
-} drm_map_t;
+};
/**
* DRM_IOCTL_GET_CLIENT ioctl argument type.
*/
-typedef struct drm_client {
+struct drm_client {
int idx; /**< Which client desired? */
int auth; /**< Is client authenticated? */
unsigned long pid; /**< Process ID */
unsigned long uid; /**< User ID */
unsigned long magic; /**< Magic */
unsigned long iocs; /**< Ioctl count */
-} drm_client_t;
+};
-typedef enum {
+enum drm_stat_type {
_DRM_STAT_LOCK,
_DRM_STAT_OPENS,
_DRM_STAT_CLOSES,
@@ -330,23 +308,23 @@ typedef enum {
_DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */
_DRM_STAT_MISSED /**< Missed DMA opportunity */
/* Add to the *END* of the list */
-} drm_stat_type_t;
+};
/**
* DRM_IOCTL_GET_STATS ioctl argument type.
*/
-typedef struct drm_stats {
+struct drm_stats {
unsigned long count;
struct {
unsigned long value;
- drm_stat_type_t type;
+ enum drm_stat_type type;
} data[15];
-} drm_stats_t;
+};
/**
* Hardware locking flags.
*/
-typedef enum drm_lock_flags {
+enum drm_lock_flags {
_DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */
_DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */
_DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */
@@ -356,17 +334,17 @@ typedef enum drm_lock_flags {
full-screen DGA-like mode. */
_DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */
_DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */
-} drm_lock_flags_t;
+};
/**
* DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.
*
* \sa drmGetLock() and drmUnlock().
*/
-typedef struct drm_lock {
+struct drm_lock {
int context;
- drm_lock_flags_t flags;
-} drm_lock_t;
+ enum drm_lock_flags flags;
+};
/**
* DMA flags
@@ -376,7 +354,7 @@ typedef struct drm_lock {
*
* \sa drm_dma.
*/
-typedef enum drm_dma_flags {
+enum drm_dma_flags {
/* Flags for DMA buffer dispatch */
_DRM_DMA_BLOCK = 0x01, /**<
* Block until buffer dispatched.
@@ -395,14 +373,14 @@ typedef enum drm_dma_flags {
_DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */
_DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */
_DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */
-} drm_dma_flags_t;
+};
/**
* DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.
*
* \sa drmAddBufs().
*/
-typedef struct drm_buf_desc {
+struct drm_buf_desc {
int count; /**< Number of buffers of this size */
int size; /**< Size in bytes */
int low_mark; /**< Low water mark */
@@ -411,54 +389,55 @@ typedef struct drm_buf_desc {
_DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */
_DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */
_DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */
- _DRM_FB_BUFFER = 0x08 /**< Buffer is in frame buffer */
+ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */
+ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */
} flags;
unsigned long agp_start; /**<
* Start address of where the AGP buffers are
* in the AGP aperture
*/
-} drm_buf_desc_t;
+};
/**
* DRM_IOCTL_INFO_BUFS ioctl argument type.
*/
-typedef struct drm_buf_info {
+struct drm_buf_info {
int count; /**< Number of buffers described in list */
- drm_buf_desc_t __user *list; /**< List of buffer descriptions */
-} drm_buf_info_t;
+ struct drm_buf_desc __user *list; /**< List of buffer descriptions */
+};
/**
* DRM_IOCTL_FREE_BUFS ioctl argument type.
*/
-typedef struct drm_buf_free {
+struct drm_buf_free {
int count;
int __user *list;
-} drm_buf_free_t;
+};
/**
* Buffer information
*
* \sa drm_buf_map.
*/
-typedef struct drm_buf_pub {
+struct drm_buf_pub {
int idx; /**< Index into the master buffer list */
int total; /**< Buffer size */
int used; /**< Amount of buffer in use (for DMA) */
void __user *address; /**< Address of buffer */
-} drm_buf_pub_t;
+};
/**
* DRM_IOCTL_MAP_BUFS ioctl argument type.
*/
-typedef struct drm_buf_map {
+struct drm_buf_map {
int count; /**< Length of the buffer list */
#if defined(__cplusplus)
void __user *c_virtual;
#else
void __user *virtual; /**< Mmap'd area in user-virtual */
#endif
- drm_buf_pub_t __user *list; /**< Buffer information */
-} drm_buf_map_t;
+ struct drm_buf_pub __user *list; /**< Buffer information */
+};
/**
* DRM_IOCTL_DMA ioctl argument type.
@@ -467,84 +446,103 @@ typedef struct drm_buf_map {
*
* \sa drmDMA().
*/
-typedef struct drm_dma {
+struct drm_dma {
int context; /**< Context handle */
int send_count; /**< Number of buffers to send */
int __user *send_indices; /**< List of handles to buffers */
int __user *send_sizes; /**< Lengths of data to send */
- drm_dma_flags_t flags; /**< Flags */
+ enum drm_dma_flags flags; /**< Flags */
int request_count; /**< Number of buffers requested */
int request_size; /**< Desired size for buffers */
int __user *request_indices; /**< Buffer information */
int __user *request_sizes;
int granted_count; /**< Number of buffers granted */
-} drm_dma_t;
+};
-typedef enum {
+enum drm_ctx_flags {
_DRM_CONTEXT_PRESERVED = 0x01,
_DRM_CONTEXT_2DONLY = 0x02
-} drm_ctx_flags_t;
+};
/**
* DRM_IOCTL_ADD_CTX ioctl argument type.
*
* \sa drmCreateContext() and drmDestroyContext().
*/
-typedef struct drm_ctx {
+struct drm_ctx {
drm_context_t handle;
- drm_ctx_flags_t flags;
-} drm_ctx_t;
+ enum drm_ctx_flags flags;
+};
/**
* DRM_IOCTL_RES_CTX ioctl argument type.
*/
-typedef struct drm_ctx_res {
+struct drm_ctx_res {
int count;
- drm_ctx_t __user *contexts;
-} drm_ctx_res_t;
+ struct drm_ctx __user *contexts;
+};
/**
* DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.
*/
-typedef struct drm_draw {
+struct drm_draw {
drm_drawable_t handle;
-} drm_draw_t;
+};
+
+/**
+ * DRM_IOCTL_UPDATE_DRAW ioctl argument type.
+ */
+typedef enum {
+ DRM_DRAWABLE_CLIPRECTS,
+} drm_drawable_info_type_t;
+
+struct drm_update_draw {
+ drm_drawable_t handle;
+ unsigned int type;
+ unsigned int num;
+ unsigned long long data;
+};
/**
* DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
*/
-typedef struct drm_auth {
+struct drm_auth {
drm_magic_t magic;
-} drm_auth_t;
+};
/**
* DRM_IOCTL_IRQ_BUSID ioctl argument type.
*
* \sa drmGetInterruptFromBusID().
*/
-typedef struct drm_irq_busid {
+struct drm_irq_busid {
int irq; /**< IRQ number */
int busnum; /**< bus number */
int devnum; /**< device number */
int funcnum; /**< function number */
-} drm_irq_busid_t;
+};
-typedef enum {
+enum drm_vblank_seq_type {
_DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */
_DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
+ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */
+ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */
+ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */
_DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */
-} drm_vblank_seq_type_t;
+};
-#define _DRM_VBLANK_FLAGS_MASK _DRM_VBLANK_SIGNAL
+#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
+#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_SIGNAL | _DRM_VBLANK_SECONDARY | \
+ _DRM_VBLANK_NEXTONMISS)
struct drm_wait_vblank_request {
- drm_vblank_seq_type_t type;
+ enum drm_vblank_seq_type type;
unsigned int sequence;
unsigned long signal;
};
struct drm_wait_vblank_reply {
- drm_vblank_seq_type_t type;
+ enum drm_vblank_seq_type type;
unsigned int sequence;
long tval_sec;
long tval_usec;
@@ -555,41 +553,55 @@ struct drm_wait_vblank_reply {
*
* \sa drmWaitVBlank().
*/
-typedef union drm_wait_vblank {
+union drm_wait_vblank {
struct drm_wait_vblank_request request;
struct drm_wait_vblank_reply reply;
-} drm_wait_vblank_t;
+};
+
+
+#define _DRM_PRE_MODESET 1
+#define _DRM_POST_MODESET 2
+
+/**
+ * DRM_IOCTL_MODESET_CTL ioctl argument type
+ *
+ * \sa drmModesetCtl().
+ */
+struct drm_modeset_ctl {
+ uint32_t crtc;
+ uint32_t cmd;
+};
/**
* DRM_IOCTL_AGP_ENABLE ioctl argument type.
*
* \sa drmAgpEnable().
*/
-typedef struct drm_agp_mode {
+struct drm_agp_mode {
unsigned long mode; /**< AGP mode */
-} drm_agp_mode_t;
+};
/**
* DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.
*
* \sa drmAgpAlloc() and drmAgpFree().
*/
-typedef struct drm_agp_buffer {
+struct drm_agp_buffer {
unsigned long size; /**< In bytes -- will round to page boundary */
unsigned long handle; /**< Used for binding / unbinding */
unsigned long type; /**< Type of memory to allocate */
unsigned long physical; /**< Physical used by i810 */
-} drm_agp_buffer_t;
+};
/**
* DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.
*
* \sa drmAgpBind() and drmAgpUnbind().
*/
-typedef struct drm_agp_binding {
+struct drm_agp_binding {
unsigned long handle; /**< From drm_agp_buffer */
unsigned long offset; /**< In bytes -- will round to page boundary */
-} drm_agp_binding_t;
+};
/**
* DRM_IOCTL_AGP_INFO ioctl argument type.
@@ -598,7 +610,7 @@ typedef struct drm_agp_binding {
* drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(),
* drmAgpVendorId() and drmAgpDeviceId().
*/
-typedef struct drm_agp_info {
+struct drm_agp_info {
int agp_version_major;
int agp_version_minor;
unsigned long mode;
@@ -612,25 +624,368 @@ typedef struct drm_agp_info {
unsigned short id_vendor;
unsigned short id_device;
/*@} */
-} drm_agp_info_t;
+};
/**
* DRM_IOCTL_SG_ALLOC ioctl argument type.
*/
-typedef struct drm_scatter_gather {
+struct drm_scatter_gather {
unsigned long size; /**< In bytes -- will round to page boundary */
unsigned long handle; /**< Used for mapping / unmapping */
-} drm_scatter_gather_t;
+};
/**
* DRM_IOCTL_SET_VERSION ioctl argument type.
*/
-typedef struct drm_set_version {
+struct drm_set_version {
int drm_di_major;
int drm_di_minor;
int drm_dd_major;
int drm_dd_minor;
-} drm_set_version_t;
+};
+
+
+#define DRM_FENCE_FLAG_EMIT 0x00000001
+#define DRM_FENCE_FLAG_SHAREABLE 0x00000002
+/**
+ * On hardware with no interrupt events for operation completion,
+ * indicates that the kernel should sleep while waiting for any blocking
+ * operation to complete rather than spinning.
+ *
+ * Has no effect otherwise.
+ */
+#define DRM_FENCE_FLAG_WAIT_LAZY 0x00000004
+#define DRM_FENCE_FLAG_NO_USER 0x00000010
+
+/* Reserved for driver use */
+#define DRM_FENCE_MASK_DRIVER 0xFF000000
+
+#define DRM_FENCE_TYPE_EXE 0x00000001
+
+struct drm_fence_arg {
+ unsigned int handle;
+ unsigned int fence_class;
+ unsigned int type;
+ unsigned int flags;
+ unsigned int signaled;
+ unsigned int error;
+ unsigned int sequence;
+ unsigned int pad64;
+ uint64_t expand_pad[2]; /*Future expansion */
+};
+
+/* Buffer permissions, referring to how the GPU uses the buffers.
+ * these translate to fence types used for the buffers.
+ * Typically a texture buffer is read, A destination buffer is write and
+ * a command (batch-) buffer is exe. Can be or-ed together.
+ */
+
+#define DRM_BO_FLAG_READ (1ULL << 0)
+#define DRM_BO_FLAG_WRITE (1ULL << 1)
+#define DRM_BO_FLAG_EXE (1ULL << 2)
+
+/*
+ * All of the bits related to access mode
+ */
+#define DRM_BO_MASK_ACCESS (DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_EXE)
+/*
+ * Status flags. Can be read to determine the actual state of a buffer.
+ * Can also be set in the buffer mask before validation.
+ */
+
+/*
+ * Mask: Never evict this buffer. Not even with force. This type of buffer is only
+ * available to root and must be manually removed before buffer manager shutdown
+ * or lock.
+ * Flags: Acknowledge
+ */
+#define DRM_BO_FLAG_NO_EVICT (1ULL << 4)
+
+/*
+ * Mask: Require that the buffer is placed in mappable memory when validated.
+ * If not set the buffer may or may not be in mappable memory when validated.
+ * Flags: If set, the buffer is in mappable memory.
+ */
+#define DRM_BO_FLAG_MAPPABLE (1ULL << 5)
+
+/* Mask: The buffer should be shareable with other processes.
+ * Flags: The buffer is shareable with other processes.
+ */
+#define DRM_BO_FLAG_SHAREABLE (1ULL << 6)
+
+/* Mask: If set, place the buffer in cache-coherent memory if available.
+ * If clear, never place the buffer in cache coherent memory if validated.
+ * Flags: The buffer is currently in cache-coherent memory.
+ */
+#define DRM_BO_FLAG_CACHED (1ULL << 7)
+
+/* Mask: Make sure that every time this buffer is validated,
+ * it ends up on the same location provided that the memory mask is the same.
+ * The buffer will also not be evicted when claiming space for
+ * other buffers. Basically a pinned buffer but it may be thrown out as
+ * part of buffer manager shutdown or locking.
+ * Flags: Acknowledge.
+ */
+#define DRM_BO_FLAG_NO_MOVE (1ULL << 8)
+
+/* Mask: Make sure the buffer is in cached memory when mapped. In conjunction
+ * with DRM_BO_FLAG_CACHED it also allows the buffer to be bound into the GART
+ * with unsnooped PTEs instead of snooped, by using chipset-specific cache
+ * flushing at bind time. A better name might be DRM_BO_FLAG_TT_UNSNOOPED,
+ * as the eviction to local memory (TTM unbind) on map is just a side effect
+ * to prevent aggressive cache prefetch from the GPU disturbing the cache
+ * management that the DRM is doing.
+ *
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From danger at FreeBSD.org Sat Jan 10 16:01:22 2009
From: danger at FreeBSD.org (Daniel Gerzo)
Date: Sat Jan 10 16:01:34 2009
Subject: svn commit: r187022 - in stable/7: bin bin/chio bin/cp bin/sh
bin/test sbin sbin/atacontrol sbin/ddb sbin/devfs
sbin/dhclient sbin/fdisk sbin/fsck_ffs sbin/geom
sbin/geom/class/part sbin/geom/misc ...
Message-ID: <200901101601.n0AG1KkC002515@svn.freebsd.org>
Author: danger (doc committer)
Date: Sat Jan 10 16:01:20 2009
New Revision: 187022
URL: http://svn.freebsd.org/changeset/base/187022
Log:
MFC r186843 - r186849
- rename the RETURN VALUES section to EXIT STATUS
- convert to .Ex macro
Modified:
stable/7/bin/ (props changed)
stable/7/bin/chio/ (props changed)
stable/7/bin/cp/ (props changed)
stable/7/bin/sh/ (props changed)
stable/7/bin/test/test.1
stable/7/sbin/ (props changed)
stable/7/sbin/atacontrol/ (props changed)
stable/7/sbin/ddb/ (props changed)
stable/7/sbin/devfs/ (props changed)
stable/7/sbin/dhclient/ (props changed)
stable/7/sbin/fdisk/ (props changed)
stable/7/sbin/fsck_ffs/ (props changed)
stable/7/sbin/geom/ (props changed)
stable/7/sbin/geom/class/part/ (props changed)
stable/7/sbin/geom/misc/ (props changed)
stable/7/sbin/ifconfig/ (props changed)
stable/7/sbin/init/ (props changed)
stable/7/sbin/ipfw/ (props changed)
stable/7/sbin/md5/ (props changed)
stable/7/sbin/mdconfig/ (props changed)
stable/7/sbin/mksnap_ffs/ (props changed)
stable/7/sbin/mount/ (props changed)
stable/7/sbin/natd/ (props changed)
stable/7/sbin/ping/ping.8
stable/7/sbin/ping6/ (props changed)
stable/7/sbin/sconfig/ (props changed)
stable/7/usr.sbin/ (props changed)
stable/7/usr.sbin/adduser/ (props changed)
stable/7/usr.sbin/bsnmpd/modules/snmp_pf/ (props changed)
stable/7/usr.sbin/cdcontrol/ (props changed)
stable/7/usr.sbin/config/ (props changed)
stable/7/usr.sbin/cron/ (props changed)
stable/7/usr.sbin/cron/cron/ (props changed)
stable/7/usr.sbin/extattr/ (props changed)
stable/7/usr.sbin/freebsd-update/ (props changed)
stable/7/usr.sbin/fwcontrol/ (props changed)
stable/7/usr.sbin/iostat/ (props changed)
stable/7/usr.sbin/mergemaster/ (props changed)
stable/7/usr.sbin/mld6query/mld6query.8
stable/7/usr.sbin/mountd/ (props changed)
stable/7/usr.sbin/mtree/ (props changed)
stable/7/usr.sbin/ndiscvt/ (props changed)
stable/7/usr.sbin/newsyslog/newsyslog.conf.5 (props changed)
stable/7/usr.sbin/nscd/ (props changed)
stable/7/usr.sbin/ntp/ (props changed)
stable/7/usr.sbin/pciconf/ (props changed)
stable/7/usr.sbin/pkg_install/ (props changed)
stable/7/usr.sbin/pmcstat/ (props changed)
stable/7/usr.sbin/portsnap/ (props changed)
stable/7/usr.sbin/powerd/ (props changed)
stable/7/usr.sbin/pw/ (props changed)
stable/7/usr.sbin/rpc.lockd/ (props changed)
stable/7/usr.sbin/rpc.statd/ (props changed)
stable/7/usr.sbin/rpc.yppasswdd/ (props changed)
stable/7/usr.sbin/rrenumd/rrenumd.8
stable/7/usr.sbin/rtadvd/rtadvd.8
stable/7/usr.sbin/rtsold/rtsold.8
stable/7/usr.sbin/setfib/ (props changed)
stable/7/usr.sbin/sysinstall/ (props changed)
stable/7/usr.sbin/syslogd/ (props changed)
stable/7/usr.sbin/traceroute/ (props changed)
stable/7/usr.sbin/traceroute6/traceroute6.8
stable/7/usr.sbin/tzsetup/ (props changed)
stable/7/usr.sbin/wpa/wpa_supplicant/ (props changed)
Modified: stable/7/bin/test/test.1
==============================================================================
--- stable/7/bin/test/test.1 Sat Jan 10 14:53:47 2009 (r187021)
+++ stable/7/bin/test/test.1 Sat Jan 10 16:01:20 2009 (r187022)
@@ -310,7 +310,7 @@ are evaluated consistently according to
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:
Modified: stable/7/sbin/ping/ping.8
==============================================================================
--- stable/7/sbin/ping/ping.8 Sat Jan 10 14:53:47 2009 (r187021)
+++ stable/7/sbin/ping/ping.8 Sat Jan 10 16:01:20 2009 (r187022)
@@ -503,7 +503,7 @@ packets that they use for
packets, for example either 30 or 60.
Others may use completely wild values.
.El
-.Sh RETURN VALUES
+.Sh EXIT STATUS
The
.Nm
utility returns an exit status of zero if at least one response was
Modified: stable/7/usr.sbin/mld6query/mld6query.8
==============================================================================
--- stable/7/usr.sbin/mld6query/mld6query.8 Sat Jan 10 14:53:47 2009 (r187021)
+++ stable/7/usr.sbin/mld6query/mld6query.8 Sat Jan 10 16:01:20 2009 (r187022)
@@ -75,7 +75,7 @@ similarly, MLD report packet will be tra
.Fl dr
options are for debugging purposes only.
.\"
-.Sh RETURN VALUES
+.Sh EXIT STATUS
The program exits with 0 on success, non-zero on failures.
.\"
.\" .Sh SEE ALSO
Modified: stable/7/usr.sbin/rrenumd/rrenumd.8
==============================================================================
--- stable/7/usr.sbin/rrenumd/rrenumd.8 Sat Jan 10 14:53:47 2009 (r187021)
+++ stable/7/usr.sbin/rrenumd/rrenumd.8 Sat Jan 10 16:01:20 2009 (r187022)
@@ -82,7 +82,7 @@ Configuration information is obtained fr
.It Fl c Ar conf_file
Specify a configuration file where configuration information is kept.
.El
-.Sh RETURN VALUES
+.Sh EXIT STATUS
The program exits with 0 on success, and non-zero on failures.
.Sh SEE ALSO
.Xr rrenumd.conf 5 ,
Modified: stable/7/usr.sbin/rtadvd/rtadvd.8
==============================================================================
--- stable/7/usr.sbin/rtadvd/rtadvd.8 Sat Jan 10 14:53:47 2009 (r187021)
+++ stable/7/usr.sbin/rtadvd/rtadvd.8 Sat Jan 10 16:01:20 2009 (r187022)
@@ -162,10 +162,8 @@ In this case,
will transmit router advertisement with router lifetime 0
to all the interfaces
.Pq in accordance with RFC2461 6.2.5 .
-.Sh RETURN VALUES
-The
-.Nm
-program exits 0 on success, and >0 on failures.
+.Sh EXIT STATUS
+.Ex -std
.Sh FILES
.Bl -tag -width Pa -compact
.It Pa /etc/rtadvd.conf
Modified: stable/7/usr.sbin/rtsold/rtsold.8
==============================================================================
--- stable/7/usr.sbin/rtsold/rtsold.8 Sat Jan 10 14:53:47 2009 (r187021)
+++ stable/7/usr.sbin/rtsold/rtsold.8 Sat Jan 10 16:01:20 2009 (r187022)
@@ -220,10 +220,8 @@ must be the absolute path from root to t
file, and be created by the same owner who runs
.Nm .
.El
-.Sh RETURN VALUES
-The
-.Nm
-program exits 0 on success, and >0 on failures.
+.Sh EXIT STATUS
+.Ex -std
.\"
.Sh FILES
.Bl -tag -width /var/run/rtsold.dump -compact
Modified: stable/7/usr.sbin/traceroute6/traceroute6.8
==============================================================================
--- stable/7/usr.sbin/traceroute6/traceroute6.8 Sat Jan 10 14:53:47 2009 (r187021)
+++ stable/7/usr.sbin/traceroute6/traceroute6.8 Sat Jan 10 16:01:20 2009 (r187022)
@@ -162,7 +162,7 @@ This was more interesting in the IPv4 ca
where some IP stack bugs could be identified by this behaviour.
.El
.\"
-.Sh RETURN VALUES
+.Sh EXIT STATUS
The
.Nm
utility will exit with 0 on success, and non-zero on errors.
From kib at FreeBSD.org Sat Jan 10 16:19:40 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Sat Jan 10 16:19:57 2009
Subject: svn commit: r187023 - stable/7/sys/sys
Message-ID: <200901101619.n0AGJcU7002927@svn.freebsd.org>
Author: kib
Date: Sat Jan 10 16:19:38 2009
New Revision: 187023
URL: http://svn.freebsd.org/changeset/base/187023
Log:
Bump __FreeBSD_version after the strndup() merge to stable/7.
Requested by: Florian Smeets
Modified:
stable/7/sys/sys/param.h
Modified: stable/7/sys/sys/param.h
==============================================================================
--- stable/7/sys/sys/param.h Sat Jan 10 16:01:20 2009 (r187022)
+++ stable/7/sys/sys/param.h Sat Jan 10 16:19:38 2009 (r187023)
@@ -57,7 +57,7 @@
* is created, otherwise 1.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 701100 /* Master, propagated to newvers */
+#define __FreeBSD_version 701101 /* Master, propagated to newvers */
#ifndef LOCORE
#include
From rnoland at FreeBSD.org Sat Jan 10 08:42:15 2009
From: rnoland at FreeBSD.org (Robert Noland)
Date: Sat Jan 10 08:42:33 2009
Subject: svn commit: r187025 - in stable/7/sys: . contrib/pf dev/cxgb dev/drm
Message-ID: <200901101642.n0AGgD02003429@svn.freebsd.org>
Author: rnoland
Date: Sat Jan 10 16:42:13 2009
New Revision: 187025
URL: http://svn.freebsd.org/changeset/base/187025
Log:
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
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/drm/drmP.h
stable/7/sys/dev/drm/drm_drv.c
stable/7/sys/dev/drm/drm_scatter.c
stable/7/sys/dev/drm/radeon_irq.c
Modified: stable/7/sys/dev/drm/drmP.h
==============================================================================
--- stable/7/sys/dev/drm/drmP.h Sat Jan 10 16:24:58 2009 (r187024)
+++ stable/7/sys/dev/drm/drmP.h Sat Jan 10 16:42:13 2009 (r187025)
@@ -87,6 +87,7 @@ struct drm_file;
#include
#include
#include
+#include
#include
#include
@@ -211,15 +212,6 @@ enum {
#define DRM_MTRR_WC MDF_WRITECOMBINE
#define jiffies ticks
-/* Capabilities taken from src/sys/dev/pci/pcireg.h. */
-#ifndef PCIY_AGP
-#define PCIY_AGP 0x02
-#endif
-
-#ifndef PCIY_EXPRESS
-#define PCIY_EXPRESS 0x10
-#endif
-
typedef unsigned long dma_addr_t;
typedef u_int64_t u64;
typedef u_int32_t u32;
@@ -308,16 +300,16 @@ for ( ret = 0 ; !ret && !(condition) ; )
DRM_LOCK(); \
}
-#define DRM_ERROR(fmt, arg...) \
+#define DRM_ERROR(fmt, ...) \
printf("error: [" DRM_NAME ":pid%d:%s] *ERROR* " fmt, \
- DRM_CURRENTPID, __func__ , ## arg)
+ DRM_CURRENTPID, __func__ , ##__VA_ARGS__)
-#define DRM_INFO(fmt, arg...) printf("info: [" DRM_NAME "] " fmt , ## arg)
+#define DRM_INFO(fmt, ...) printf("info: [" DRM_NAME "] " fmt , ##__VA_ARGS__)
-#define DRM_DEBUG(fmt, arg...) do { \
+#define DRM_DEBUG(fmt, ...) do { \
if (drm_debug_flag) \
printf("[" DRM_NAME ":pid%d:%s] " fmt, DRM_CURRENTPID, \
- __func__ , ## arg); \
+ __func__ , ##__VA_ARGS__); \
} while (0)
typedef struct drm_pci_id_list
@@ -473,11 +465,13 @@ typedef struct drm_agp_head {
} drm_agp_head_t;
typedef struct drm_sg_mem {
- unsigned long handle;
- void *virtual;
- int pages;
- dma_addr_t *busaddr;
- drm_dma_handle_t *dmah; /* Handle to PCI memory for ATI PCIGART table */
+ unsigned long handle;
+ void *virtual;
+ int pages;
+ dma_addr_t *busaddr;
+ struct drm_dma_handle *sg_dmah; /* Handle for sg_pages */
+ struct drm_dma_handle *dmah; /* Handle to PCI memory */
+ /* for ATI PCIGART table */
} drm_sg_mem_t;
typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t;
Modified: stable/7/sys/dev/drm/drm_drv.c
==============================================================================
--- stable/7/sys/dev/drm/drm_drv.c Sat Jan 10 16:24:58 2009 (r187024)
+++ stable/7/sys/dev/drm/drm_drv.c Sat Jan 10 16:42:13 2009 (r187025)
@@ -152,6 +152,10 @@ int drm_probe(device_t dev, drm_pci_id_l
device = pci_get_device(dev);
#endif
+ if (pci_get_class(dev) != PCIC_DISPLAY
+ || pci_get_subclass(dev) != PCIS_DISPLAY_VGA)
+ return ENXIO;
+
id_entry = drm_find_description(vendor, device, idlist);
if (id_entry != NULL) {
device_set_desc(dev, id_entry->name);
Modified: stable/7/sys/dev/drm/drm_scatter.c
==============================================================================
--- stable/7/sys/dev/drm/drm_scatter.c Sat Jan 10 16:24:58 2009 (r187024)
+++ stable/7/sys/dev/drm/drm_scatter.c Sat Jan 10 16:42:13 2009 (r187025)
@@ -39,20 +39,16 @@ __FBSDID("$FreeBSD$");
#include "dev/drm/drmP.h"
-#define DEBUG_SCATTER 0
+static void drm_sg_alloc_cb(void *arg, bus_dma_segment_t *segs,
+ int nsegs, int error);
-void drm_sg_cleanup(drm_sg_mem_t *entry)
+int
+drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather *request)
{
- free((void *)entry->handle, DRM_MEM_PAGES);
- free(entry->busaddr, DRM_MEM_PAGES);
- free(entry, DRM_MEM_SGLISTS);
-}
-
-int drm_sg_alloc(struct drm_device * dev, struct drm_scatter_gather * request)
-{
- drm_sg_mem_t *entry;
+ struct drm_sg_mem *entry;
+ struct drm_dma_handle *dmah;
unsigned long pages;
- int i;
+ int ret;
if (dev->sg)
return EINVAL;
@@ -69,21 +65,56 @@ int drm_sg_alloc(struct drm_device * dev
entry->busaddr = malloc(pages * sizeof(*entry->busaddr), DRM_MEM_PAGES,
M_WAITOK | M_ZERO);
if (!entry->busaddr) {
- drm_sg_cleanup(entry);
+ free(entry, DRM_MEM_SGLISTS);
return ENOMEM;
}
- entry->handle = (long)malloc(pages << PAGE_SHIFT, DRM_MEM_PAGES,
- M_WAITOK | M_ZERO);
- if (entry->handle == 0) {
- drm_sg_cleanup(entry);
+ dmah = malloc(sizeof(struct drm_dma_handle), DRM_MEM_DMA,
+ M_ZERO | M_NOWAIT);
+ if (dmah == NULL) {
+ free(entry->busaddr, DRM_MEM_PAGES);
+ free(entry, DRM_MEM_SGLISTS);
+ return ENOMEM;
+ }
+
+ ret = bus_dma_tag_create(NULL, PAGE_SIZE, 0, /* tag, align, boundary */
+ BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */
+ NULL, NULL, /* filtfunc, filtfuncargs */
+ request->size, pages, /* maxsize, nsegs */
+ PAGE_SIZE, 0, /* maxsegsize, flags */
+ NULL, NULL, /* lockfunc, lockfuncargs */
+ &dmah->tag);
+ if (ret != 0) {
+ free(dmah, DRM_MEM_DMA);
+ free(entry->busaddr, DRM_MEM_PAGES);
+ free(entry, DRM_MEM_SGLISTS);
return ENOMEM;
}
- for (i = 0; i < pages; i++) {
- entry->busaddr[i] = vtophys(entry->handle + i * PAGE_SIZE);
+ ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr,
+ BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map);
+ if (ret != 0) {
+ bus_dma_tag_destroy(dmah->tag);
+ free(dmah, DRM_MEM_DMA);
+ free(entry->busaddr, DRM_MEM_PAGES);
+ free(entry, DRM_MEM_SGLISTS);
+ return ENOMEM;
}
+ ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr,
+ request->size, drm_sg_alloc_cb, entry, 0);
+ if (ret != 0) {
+ bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
+ bus_dma_tag_destroy(dmah->tag);
+ free(dmah, DRM_MEM_DMA);
+ free(entry->busaddr, DRM_MEM_PAGES);
+ free(entry, DRM_MEM_SGLISTS);
+ return ENOMEM;
+ }
+
+ entry->sg_dmah = dmah;
+ entry->handle = (unsigned long)dmah->vaddr;
+
DRM_DEBUG("sg alloc handle = %08lx\n", entry->handle);
entry->virtual = (void *)entry->handle;
@@ -101,22 +132,49 @@ int drm_sg_alloc(struct drm_device * dev
return 0;
}
-int drm_sg_alloc_ioctl(struct drm_device *dev, void *data,
- struct drm_file *file_priv)
+static void
+drm_sg_alloc_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
+{
+ struct drm_sg_mem *entry = arg;
+ int i;
+
+ if (error != 0)
+ return;
+
+ for(i = 0 ; i < nsegs ; i++) {
+ entry->busaddr[i] = segs[i].ds_addr;
+ }
+}
+
+int
+drm_sg_alloc_ioctl(struct drm_device *dev, void *data,
+ struct drm_file *file_priv)
{
struct drm_scatter_gather *request = data;
- int ret;
- DRM_DEBUG("%s\n", __FUNCTION__);
+ DRM_DEBUG("\n");
+
+ return drm_sg_alloc(dev, request);
+}
- ret = drm_sg_alloc(dev, request);
- return ret;
+void
+drm_sg_cleanup(struct drm_sg_mem *entry)
+{
+ struct drm_dma_handle *dmah = entry->sg_dmah;
+
+ bus_dmamap_unload(dmah->tag, dmah->map);
+ bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
+ bus_dma_tag_destroy(dmah->tag);
+ free(dmah, DRM_MEM_DMA);
+ free(entry->busaddr, DRM_MEM_PAGES);
+ free(entry, DRM_MEM_SGLISTS);
}
-int drm_sg_free(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int
+drm_sg_free(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
struct drm_scatter_gather *request = data;
- drm_sg_mem_t *entry;
+ struct drm_sg_mem *entry;
DRM_LOCK();
entry = dev->sg;
Modified: stable/7/sys/dev/drm/radeon_irq.c
==============================================================================
--- stable/7/sys/dev/drm/radeon_irq.c Sat Jan 10 16:24:58 2009 (r187024)
+++ stable/7/sys/dev/drm/radeon_irq.c Sat Jan 10 16:42:13 2009 (r187025)
@@ -47,7 +47,8 @@ void radeon_irq_set_state(struct drm_dev
else
dev_priv->irq_enable_reg &= ~mask;
- RADEON_WRITE(RADEON_GEN_INT_CNTL, dev_priv->irq_enable_reg);
+ if (dev->irq_enabled)
+ RADEON_WRITE(RADEON_GEN_INT_CNTL, dev_priv->irq_enable_reg);
}
static void r500_vbl_irq_set_state(struct drm_device *dev, u32 mask, int state)
@@ -59,7 +60,8 @@ static void r500_vbl_irq_set_state(struc
else
dev_priv->r500_disp_irq_reg &= ~mask;
- RADEON_WRITE(R500_DxMODE_INT_MASK, dev_priv->r500_disp_irq_reg);
+ if (dev->irq_enabled)
+ RADEON_WRITE(R500_DxMODE_INT_MASK, dev_priv->r500_disp_irq_reg);
}
int radeon_enable_vblank(struct drm_device *dev, int crtc)
From antoine at FreeBSD.org Sat Jan 10 09:56:53 2009
From: antoine at FreeBSD.org (Antoine Brodin)
Date: Sat Jan 10 09:57:04 2009
Subject: svn commit: r187029 - in stable/7/sys: . conf contrib/pf
dev/ath/ath_hal dev/cxgb dev/hptiop
Message-ID: <200901101756.n0AHuof9005002@svn.freebsd.org>
Author: antoine
Date: Sat Jan 10 17:56:50 2009
New Revision: 187029
URL: http://svn.freebsd.org/changeset/base/187029
Log:
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
Modified:
stable/7/sys/ (props changed)
stable/7/sys/conf/files
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/hptiop/hptiop.h
Modified: stable/7/sys/conf/files
==============================================================================
--- stable/7/sys/conf/files Sat Jan 10 17:22:49 2009 (r187028)
+++ stable/7/sys/conf/files Sat Jan 10 17:56:50 2009 (r187029)
@@ -685,7 +685,7 @@ dev/hifn/hifn7751.c optional hifn
dev/hme/if_hme.c optional hme
dev/hme/if_hme_pci.c optional hme pci
dev/hme/if_hme_sbus.c optional hme sbus
-dev/hptiop/hptiop.c optional hptiop cam
+dev/hptiop/hptiop.c optional hptiop scbus
dev/hwpmc/hwpmc_logging.c optional hwpmc
dev/hwpmc/hwpmc_mod.c optional hwpmc
dev/ichsmb/ichsmb.c optional ichsmb
Modified: stable/7/sys/dev/hptiop/hptiop.h
==============================================================================
--- stable/7/sys/dev/hptiop/hptiop.h Sat Jan 10 17:22:49 2009 (r187028)
+++ stable/7/sys/dev/hptiop/hptiop.h Sat Jan 10 17:56:50 2009 (r187029)
@@ -32,8 +32,8 @@ __FBSDID("$FreeBSD$");
#define DBG 0
#ifdef DBG
-int hpt_dbg_level = 0;
-#define KdPrint(x) do { if (hpt_dbg_level) printf x; } while (0)
+int hpt_iop_dbg_level = 0;
+#define KdPrint(x) do { if (hpt_iop_dbg_level) printf x; } while (0)
#define HPT_ASSERT(x) assert(x)
#else
#define KdPrint(x)
From antoine at FreeBSD.org Sat Jan 10 11:00:20 2009
From: antoine at FreeBSD.org (Antoine Brodin)
Date: Sat Jan 10 11:00:59 2009
Subject: svn commit: r187031 - in stable/7/etc: . periodic/security
Message-ID: <200901101900.n0AJ0Hv1006281@svn.freebsd.org>
Author: antoine
Date: Sat Jan 10 19:00:17 2009
New Revision: 187031
URL: http://svn.freebsd.org/changeset/base/187031
Log:
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
Modified:
stable/7/etc/ (props changed)
stable/7/etc/periodic/security/550.ipfwlimit
Modified: stable/7/etc/periodic/security/550.ipfwlimit
==============================================================================
--- stable/7/etc/periodic/security/550.ipfwlimit Sat Jan 10 18:19:22 2009 (r187030)
+++ stable/7/etc/periodic/security/550.ipfwlimit Sat Jan 10 19:00:17 2009 (r187031)
@@ -42,19 +42,16 @@ rc=0
case "$daily_status_security_ipfwlimit_enable" in
[Yy][Ee][Ss])
- IPFW_LOG_LIMIT=`sysctl -n net.inet.ip.fw.verbose_limit 2> /dev/null`
- if [ $? -ne 0 ]; then
+ IPFW_VERBOSE=`sysctl -n net.inet.ip.fw.verbose 2> /dev/null`
+ if [ $? -ne 0 ] || [ "$IPFW_VERBOSE" -eq 0 ]; then
exit 0
fi
TMP=`mktemp -t security`
ipfw -a list | grep " log " | \
grep '^[[:digit:]]\+[[:space:]]\+[[:digit:]]\+' | \
- awk -v limit="$IPFW_LOG_LIMIT" \
+ awk \
'{if ($6 == "logamount") {
if ($2 > $7)
- {print $0}
- } else {
- if ($2 > limit)
{print $0}}
}' > ${TMP}
From chinsan at FreeBSD.org Sat Jan 10 21:59:40 2009
From: chinsan at FreeBSD.org (Chin-San Huang)
Date: Sat Jan 10 22:00:00 2009
Subject: svn commit: r187044 - stable/7/usr.sbin/pkg_install/add
Message-ID: <200901110559.n0B5xdcG018831@svn.freebsd.org>
Author: chinsan (doc,ports committer)
Date: Sun Jan 11 05:59:39 2009
New Revision: 187044
URL: http://svn.freebsd.org/changeset/base/187044
Log:
Synchronize pkg_install(1) with HEAD: fix typo
Modified:
stable/7/usr.sbin/pkg_install/add/pkg_add.1
Modified: stable/7/usr.sbin/pkg_install/add/pkg_add.1
==============================================================================
--- stable/7/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 05:59:27 2009 (r187043)
+++ stable/7/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 05:59:39 2009 (r187044)
@@ -15,7 +15,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 30, 2008
+.Dd Jan 4, 2009
.Dt PKG_ADD 1
.Os
.Sh NAME
@@ -90,7 +90,7 @@ if it is defined or in current directory
.It Fl i , -no-deps
Install the package without fetching and installing
dependencies.
-.It Fl I , -no-scripts
+.It Fl I , -no-script
If any installation scripts (pre-install or post-install) exist for a given
package, do not execute them.
.It Fl n , -dry-run
From maxim at FreeBSD.org Sun Jan 11 00:31:03 2009
From: maxim at FreeBSD.org (Maxim Konovalov)
Date: Sun Jan 11 00:31:19 2009
Subject: svn commit: r187045 - stable/7/usr.sbin/nscd
Message-ID: <200901110831.n0B8V2Fc021646@svn.freebsd.org>
Author: maxim
Date: Sun Jan 11 08:31:01 2009
New Revision: 187045
URL: http://svn.freebsd.org/changeset/base/187045
Log:
MFC r186394: correct a database name.
Modified:
stable/7/usr.sbin/nscd/nscd.conf.5
Modified: stable/7/usr.sbin/nscd/nscd.conf.5
==============================================================================
--- stable/7/usr.sbin/nscd/nscd.conf.5 Sun Jan 11 05:59:39 2009 (r187044)
+++ stable/7/usr.sbin/nscd/nscd.conf.5 Sun Jan 11 08:31:01 2009 (r187045)
@@ -53,7 +53,7 @@ and a
.Ar value .
Usual cachenames are
.Dq Li passwd ,
-.Dq Li groups ,
+.Dq Li group ,
.Dq Li hosts ,
.Dq Li services ,
.Dq Li protocols
@@ -125,7 +125,7 @@ will act similarly to the NSCD.
.Sy NOTE :
this feature is currently experimental \[em] it supports only
.Dq Li passwd ,
-.Dq Li groups
+.Dq Li group
and
.Dq Li services
cachenames.
From maxim at FreeBSD.org Sun Jan 11 00:34:52 2009
From: maxim at FreeBSD.org (Maxim Konovalov)
Date: Sun Jan 11 00:34:59 2009
Subject: svn commit: r187046 - stable/7/usr.bin/netstat
Message-ID: <200901110834.n0B8Yp0Q021780@svn.freebsd.org>
Author: maxim
Date: Sun Jan 11 08:34:51 2009
New Revision: 187046
URL: http://svn.freebsd.org/changeset/base/187046
Log:
MFC r186498: fix typo.
Modified:
stable/7/usr.bin/netstat/inet6.c
Modified: stable/7/usr.bin/netstat/inet6.c
==============================================================================
--- stable/7/usr.bin/netstat/inet6.c Sun Jan 11 08:31:01 2009 (r187045)
+++ stable/7/usr.bin/netstat/inet6.c Sun Jan 11 08:34:51 2009 (r187046)
@@ -1058,7 +1058,7 @@ rip6_stats(u_long off, const char *name,
#define p(f, m) if (rip6stat.f || sflag <= 1) \
printf(m, (uintmax_t)rip6stat.f, plural(rip6stat.f))
p(rip6s_ipackets, "\t%ju message%s received\n");
- p(rip6s_isum, "\t%ju checksum calcuration%s on inbound\n");
+ p(rip6s_isum, "\t%ju checksum calculation%s on inbound\n");
p(rip6s_badsum, "\t%ju message%s with bad checksum\n");
p(rip6s_nosock, "\t%ju message%s dropped due to no socket\n");
p(rip6s_nosockmcast,
From maxim at FreeBSD.org Sun Jan 11 00:40:27 2009
From: maxim at FreeBSD.org (Maxim Konovalov)
Date: Sun Jan 11 00:40:38 2009
Subject: svn commit: r187047 - stable/7/usr.sbin/sysinstall
Message-ID: <200901110840.n0B8eQxD021928@svn.freebsd.org>
Author: maxim
Date: Sun Jan 11 08:40:26 2009
New Revision: 187047
URL: http://svn.freebsd.org/changeset/base/187047
Log:
MFC r186274: sync comment and example.
Modified:
stable/7/usr.sbin/sysinstall/config.c
Modified: stable/7/usr.sbin/sysinstall/config.c
==============================================================================
--- stable/7/usr.sbin/sysinstall/config.c Sun Jan 11 08:34:51 2009 (r187046)
+++ stable/7/usr.sbin/sysinstall/config.c Sun Jan 11 08:40:26 2009 (r187047)
@@ -845,7 +845,7 @@ configNFSServer(dialogMenuItem *self)
"kinds of access to your local file systems.\n"
"Press [ENTER] now to invoke an editor on /etc/exports\n");
vsystem("echo '#The following examples export /usr to 3 machines named after ducks,' > /etc/exports");
- vsystem("echo '#/usr/src and /usr/ports read-only to machines named after trouble makers' >> /etc/exports");
+ vsystem("echo '#/usr/src and /usr/obj read-only to machines named after trouble makers,' >> /etc/exports");
vsystem("echo '#/home and all directories under it to machines named after dead rock stars' >> /etc/exports");
vsystem("echo '#and, /a to a network of privileged machines allowed to write on it as root.' >> /etc/exports");
vsystem("echo '#/usr huey louie dewie' >> /etc/exports");
From maxim at FreeBSD.org Sun Jan 11 02:50:14 2009
From: maxim at FreeBSD.org (Maxim Konovalov)
Date: Sun Jan 11 02:50:20 2009
Subject: svn commit: r187048 - stable/7/sbin/ipfw
Message-ID: <200901111050.n0BAoDA2026211@svn.freebsd.org>
Author: maxim
Date: Sun Jan 11 10:50:13 2009
New Revision: 187048
URL: http://svn.freebsd.org/changeset/base/187048
Log:
Manually merge r183889:183890: do nothing in show_nat() for a test mode (-n).
Modified:
stable/7/sbin/ipfw/ipfw2.c
Modified: stable/7/sbin/ipfw/ipfw2.c
==============================================================================
--- stable/7/sbin/ipfw/ipfw2.c Sun Jan 11 08:40:26 2009 (r187047)
+++ stable/7/sbin/ipfw/ipfw2.c Sun Jan 11 10:50:13 2009 (r187048)
@@ -5983,6 +5983,9 @@ show_nat(int ac, char **av) {
lrule = IPFW_DEFAULT_RULE; /* max ipfw rule number */
ac--; av++;
+ if (test_only)
+ return;
+
/* Parse parameters. */
for (cmd = IP_FW_NAT_GET_LOG, do_cfg = 0; ac != 0; ac--, av++) {
if (!strncmp(av[0], "config", strlen(av[0]))) {
From maxim at FreeBSD.org Sun Jan 11 03:00:57 2009
From: maxim at FreeBSD.org (Maxim Konovalov)
Date: Sun Jan 11 03:01:04 2009
Subject: svn commit: r187049 - stable/7/sbin/ipfw
Message-ID: <200901111100.n0BB0uG3026538@svn.freebsd.org>
Author: maxim
Date: Sun Jan 11 11:00:56 2009
New Revision: 187049
URL: http://svn.freebsd.org/changeset/base/187049
Log:
Record merge r183889:183890.
Modified:
stable/7/sbin/ipfw/ (props changed)
From mav at FreeBSD.org Sun Jan 11 03:51:19 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Sun Jan 11 03:51:30 2009
Subject: svn commit: r187051 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb netgraph
Message-ID: <200901111151.n0BBpIcA027596@svn.freebsd.org>
Author: mav
Date: Sun Jan 11 11:51:18 2009
New Revision: 187051
URL: http://svn.freebsd.org/changeset/base/187051
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/netgraph/ng_vjc.c
Modified: stable/7/sys/netgraph/ng_vjc.c
==============================================================================
--- stable/7/sys/netgraph/ng_vjc.c Sun Jan 11 11:36:00 2009 (r187050)
+++ stable/7/sys/netgraph/ng_vjc.c Sun Jan 11 11:51:18 2009 (r187051)
@@ -249,6 +249,9 @@ ng_vjc_constructor(node_p node)
NG_NODE_SET_PRIVATE(node, priv);
+ /* slcompress is not thread-safe. Protect it's state here. */
+ NG_NODE_FORCE_WRITER(node);
+
/* Done */
return (0);
}
From chinsan at FreeBSD.org Sun Jan 11 05:56:10 2009
From: chinsan at FreeBSD.org (Chin-San Huang)
Date: Sun Jan 11 05:56:26 2009
Subject: svn commit: r187055 - stable/7/usr.sbin/pkg_install/add
Message-ID: <200901111356.n0BDu8ce030047@svn.freebsd.org>
Author: chinsan (doc,ports committer)
Date: Sun Jan 11 13:56:08 2009
New Revision: 187055
URL: http://svn.freebsd.org/changeset/base/187055
Log:
Use full name (noticed by: ru@
Modified:
stable/7/usr.sbin/pkg_install/add/pkg_add.1
Modified: stable/7/usr.sbin/pkg_install/add/pkg_add.1
==============================================================================
--- stable/7/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 13:55:31 2009 (r187054)
+++ stable/7/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 13:56:08 2009 (r187055)
@@ -15,7 +15,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd Jan 4, 2009
+.Dd January 4, 2009
.Dt PKG_ADD 1
.Os
.Sh NAME
From wilko at FreeBSD.org Sun Jan 11 08:21:34 2009
From: wilko at FreeBSD.org (Wilko Bulte)
Date: Sun Jan 11 08:21:46 2009
Subject: svn commit: r187057 - stable/7/sys/pci
Message-ID: <200901111621.n0BGLXVt032972@svn.freebsd.org>
Author: wilko
Date: Sun Jan 11 16:21:33 2009
New Revision: 187057
URL: http://svn.freebsd.org/changeset/base/187057
Log:
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
Modified:
stable/7/sys/pci/if_rl.c
Modified: stable/7/sys/pci/if_rl.c
==============================================================================
--- stable/7/sys/pci/if_rl.c Sun Jan 11 13:56:55 2009 (r187056)
+++ stable/7/sys/pci/if_rl.c Sun Jan 11 16:21:33 2009 (r187057)
@@ -857,9 +857,15 @@ rl_attach(device_t dev)
}
if (sc->rl_type == 0) {
- device_printf(dev, "unknown device ID: %x\n", rl_did);
- error = ENXIO;
- goto fail;
+ device_printf(dev, "unknown device ID: %x assuming 8139\n",
+ rl_did);
+ sc->rl_type = RL_8139;
+ /*
+ * Read RL_IDR register to get ethernet address as accessing
+ * EEPROM may not extract correct address.
+ */
+ for (i = 0; i < ETHER_ADDR_LEN; i++)
+ eaddr[i] = CSR_READ_1(sc, RL_IDR0 + i);
}
/*
From sam at FreeBSD.org Sun Jan 11 13:45:25 2009
From: sam at FreeBSD.org (Sam Leffler)
Date: Sun Jan 11 13:45:43 2009
Subject: svn commit: r187065 - in stable/7/sys: . dev/acpi_support dev/cxgb
dev/led geom geom/concat geom/part geom/stripe kern
security/mac_portacl sys
Message-ID: <200901112145.n0BLjNGb039206@svn.freebsd.org>
Author: sam
Date: Sun Jan 11 21:45:23 2009
New Revision: 187065
URL: http://svn.freebsd.org/changeset/base/187065
Log:
MFC r181463: add sbuf_new_auto
Modified:
stable/7/sys/ (props changed)
stable/7/sys/dev/acpi_support/acpi_asus.c
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/led/led.c
stable/7/sys/geom/concat/g_concat.c
stable/7/sys/geom/geom_ccd.c
stable/7/sys/geom/geom_ctl.c
stable/7/sys/geom/geom_disk.c
stable/7/sys/geom/geom_kern.c
stable/7/sys/geom/geom_slice.c
stable/7/sys/geom/geom_subr.c
stable/7/sys/geom/part/g_part.c
stable/7/sys/geom/stripe/g_stripe.c
stable/7/sys/kern/vfs_mount.c
stable/7/sys/security/mac_portacl/mac_portacl.c
stable/7/sys/sys/sbuf.h
Modified: stable/7/sys/dev/acpi_support/acpi_asus.c
==============================================================================
--- stable/7/sys/dev/acpi_support/acpi_asus.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/dev/acpi_support/acpi_asus.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -552,7 +552,7 @@ acpi_asus_probe(device_t dev)
}
}
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
if (sb == NULL)
return (ENOMEM);
Modified: stable/7/sys/dev/led/led.c
==============================================================================
--- stable/7/sys/dev/led/led.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/dev/led/led.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -141,7 +141,7 @@ led_write(struct cdev *dev, struct uio *
return(error);
}
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
if (sb == NULL) {
free(s2, M_DEVBUF);
return (ENOMEM);
Modified: stable/7/sys/geom/concat/g_concat.c
==============================================================================
--- stable/7/sys/geom/concat/g_concat.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/geom/concat/g_concat.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -748,7 +748,7 @@ g_concat_ctl_create(struct gctl_req *req
}
sc = gp->softc;
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name);
for (attached = 0, no = 1; no < *nargs; no++) {
snprintf(param, sizeof(param), "arg%u", no);
Modified: stable/7/sys/geom/geom_ccd.c
==============================================================================
--- stable/7/sys/geom/geom_ccd.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/geom/geom_ccd.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -790,7 +790,7 @@ g_ccd_create(struct gctl_req *req, struc
pp->sectorsize = sc->sc_secsize;
g_error_provider(pp, 0);
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
sbuf_printf(sb, "ccd%d: %d components ", sc->sc_unit, *nprovider);
for (i = 0; i < *nprovider; i++) {
sbuf_printf(sb, "%s%s",
@@ -840,7 +840,7 @@ g_ccd_list(struct gctl_req *req, struct
up = gctl_get_paraml(req, "unit", sizeof (int));
unit = *up;
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
LIST_FOREACH(gp, &mp->geom, geom) {
cs = gp->softc;
if (cs == NULL || (unit >= 0 && unit != cs->sc_unit))
Modified: stable/7/sys/geom/geom_ctl.c
==============================================================================
--- stable/7/sys/geom/geom_ctl.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/geom/geom_ctl.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -464,7 +464,7 @@ g_ctl_ioctl_ctl(struct cdev *dev, u_long
req = (void *)data;
req->nerror = 0;
- req->serror = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ req->serror = sbuf_new_auto();
/* It is an error if we cannot return an error text */
if (req->lerror < 2)
return (EINVAL);
Modified: stable/7/sys/geom/geom_disk.c
==============================================================================
--- stable/7/sys/geom/geom_disk.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/geom/geom_disk.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -516,7 +516,7 @@ sysctl_disks(SYSCTL_HANDLER_ARGS)
int error;
struct sbuf *sb;
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
g_waitfor_event(g_kern_disks, sb, M_WAITOK, NULL);
error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
sbuf_delete(sb);
Modified: stable/7/sys/geom/geom_kern.c
==============================================================================
--- stable/7/sys/geom/geom_kern.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/geom/geom_kern.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -180,7 +180,7 @@ sysctl_kern_geom_conftxt(SYSCTL_HANDLER_
int error;
struct sbuf *sb;
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
g_waitfor_event(g_conftxt, sb, M_WAITOK, NULL);
error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
sbuf_delete(sb);
@@ -193,7 +193,7 @@ sysctl_kern_geom_confdot(SYSCTL_HANDLER_
int error;
struct sbuf *sb;
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
g_waitfor_event(g_confdot, sb, M_WAITOK, NULL);
error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
sbuf_delete(sb);
@@ -206,7 +206,7 @@ sysctl_kern_geom_confxml(SYSCTL_HANDLER_
int error;
struct sbuf *sb;
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
g_waitfor_event(g_confxml, sb, M_WAITOK, NULL);
error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
sbuf_delete(sb);
Modified: stable/7/sys/geom/geom_slice.c
==============================================================================
--- stable/7/sys/geom/geom_slice.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/geom/geom_slice.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -385,7 +385,7 @@ g_slice_config(struct g_geom *gp, u_int
pp->mediasize = gsl->length;
return (0);
}
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
va_start(ap, fmt);
sbuf_vprintf(sb, fmt, ap);
va_end(ap);
Modified: stable/7/sys/geom/geom_subr.c
==============================================================================
--- stable/7/sys/geom/geom_subr.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/geom/geom_subr.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -324,7 +324,7 @@ g_new_geomf(struct g_class *mp, const ch
g_topology_assert();
G_VALID_CLASS(mp);
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
va_start(ap, fmt);
sbuf_vprintf(sb, fmt, ap);
va_end(ap);
@@ -564,7 +564,7 @@ g_new_providerf(struct g_geom *gp, const
KASSERT(!(gp->flags & G_GEOM_WITHER),
("new provider on WITHERing geom(%s) (class %s)",
gp->name, gp->class->name));
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
va_start(ap, fmt);
sbuf_vprintf(sb, fmt, ap);
va_end(ap);
Modified: stable/7/sys/geom/part/g_part.c
==============================================================================
--- stable/7/sys/geom/part/g_part.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/geom/part/g_part.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -506,7 +506,7 @@ g_part_ctl_add(struct gctl_req *req, str
/* Provide feedback if so requested. */
if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
sbuf_printf(sb, "%s%s added\n", gp->name,
G_PART_NAME(table, entry, buf, sizeof(buf)));
sbuf_finish(sb);
@@ -545,7 +545,7 @@ g_part_ctl_bootcode(struct gctl_req *req
/* Provide feedback if so requested. */
if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
sbuf_printf(sb, "%s has bootcode\n", gp->name);
sbuf_finish(sb);
gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
@@ -749,7 +749,7 @@ g_part_ctl_create(struct gctl_req *req,
/* Provide feedback if so requested. */
if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
sbuf_printf(sb, "%s created\n", gp->name);
sbuf_finish(sb);
gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
@@ -821,7 +821,7 @@ g_part_ctl_delete(struct gctl_req *req,
/* Provide feedback if so requested. */
if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
sbuf_printf(sb, "%s%s deleted\n", gp->name,
G_PART_NAME(table, entry, buf, sizeof(buf)));
sbuf_finish(sb);
@@ -877,7 +877,7 @@ g_part_ctl_destroy(struct gctl_req *req,
/* Provide feedback if so requested. */
if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
sbuf_printf(sb, "%s destroyed\n", gp->name);
sbuf_finish(sb);
gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
@@ -924,7 +924,7 @@ g_part_ctl_modify(struct gctl_req *req,
/* Provide feedback if so requested. */
if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
sbuf_printf(sb, "%s%s modified\n", gp->name,
G_PART_NAME(table, entry, buf, sizeof(buf)));
sbuf_finish(sb);
@@ -991,7 +991,7 @@ g_part_ctl_setunset(struct gctl_req *req
/* Provide feedback if so requested. */
if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
sbuf_printf(sb, "%s%s has %s %sset\n", gp->name,
G_PART_NAME(table, entry, buf, sizeof(buf)),
gpp->gpp_attrib, (set) ? "" : "un");
Modified: stable/7/sys/geom/stripe/g_stripe.c
==============================================================================
--- stable/7/sys/geom/stripe/g_stripe.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/geom/stripe/g_stripe.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -1069,7 +1069,7 @@ g_stripe_ctl_create(struct gctl_req *req
}
sc = gp->softc;
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name);
for (attached = 0, no = 1; no < *nargs; no++) {
snprintf(param, sizeof(param), "arg%u", no);
Modified: stable/7/sys/kern/vfs_mount.c
==============================================================================
--- stable/7/sys/kern/vfs_mount.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/kern/vfs_mount.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -2177,7 +2177,7 @@ mount_argf(struct mntarg *ma, const char
ma->v[ma->len].iov_len = strlen(name) + 1;
ma->len++;
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
va_start(ap, fmt);
sbuf_vprintf(sb, fmt, ap);
va_end(ap);
Modified: stable/7/sys/security/mac_portacl/mac_portacl.c
==============================================================================
--- stable/7/sys/security/mac_portacl/mac_portacl.c Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/security/mac_portacl/mac_portacl.c Sun Jan 11 21:45:23 2009 (r187065)
@@ -306,7 +306,7 @@ rules_to_string(void)
int needcomma;
char *temp;
- sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ sb = sbuf_new_auto();
needcomma = 0;
mtx_lock(&rule_mtx);
for (rule = TAILQ_FIRST(&rule_head); rule != NULL;
Modified: stable/7/sys/sys/sbuf.h
==============================================================================
--- stable/7/sys/sys/sbuf.h Sun Jan 11 21:27:28 2009 (r187064)
+++ stable/7/sys/sys/sbuf.h Sun Jan 11 21:45:23 2009 (r187065)
@@ -56,6 +56,8 @@ __BEGIN_DECLS
* API functions
*/
struct sbuf *sbuf_new(struct sbuf *, char *, int, int);
+#define sbuf_new_auto() \
+ sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND)
void sbuf_clear(struct sbuf *);
int sbuf_setpos(struct sbuf *, int);
int sbuf_bcat(struct sbuf *, const void *, size_t);
From delphij at FreeBSD.org Sun Jan 11 16:39:23 2009
From: delphij at FreeBSD.org (Xin LI)
Date: Sun Jan 11 16:39:35 2009
Subject: svn commit: r187069 - stable/7/sbin/fsck_ffs
Message-ID: <200901120039.n0C0dMKX043214@svn.freebsd.org>
Author: delphij
Date: Mon Jan 12 00:39:22 2009
New Revision: 187069
URL: http://svn.freebsd.org/changeset/base/187069
Log:
MFC revisions 178088 and 179656: Catastrophic recovery mode.
Modified:
stable/7/sbin/fsck_ffs/ (props changed)
stable/7/sbin/fsck_ffs/fsck.h
stable/7/sbin/fsck_ffs/fsck_ffs.8
stable/7/sbin/fsck_ffs/fsutil.c
stable/7/sbin/fsck_ffs/inode.c
stable/7/sbin/fsck_ffs/main.c
Modified: stable/7/sbin/fsck_ffs/fsck.h
==============================================================================
--- stable/7/sbin/fsck_ffs/fsck.h Sun Jan 11 23:19:17 2009 (r187068)
+++ stable/7/sbin/fsck_ffs/fsck.h Mon Jan 12 00:39:22 2009 (r187069)
@@ -270,6 +270,7 @@ char yflag; /* assume a yes response *
int bkgrdflag; /* use a snapshot to run on an active system */
int bflag; /* location of alternate super block */
int debug; /* output debugging info */
+char catastrophicflag; /* run in catastrophic mode */
int cvtlevel; /* convert to newer file system format */
int bkgrdcheck; /* determine if background check is possible */
int bkgrdsumadj; /* whether the kernel have ability to adjust superblock summary */
@@ -335,6 +336,7 @@ void cacheino(union dinode *dp, ino_t i
void catch(int);
void catchquit(int);
int changeino(ino_t dir, const char *name, ino_t newnum);
+void check_cgmagic(int cg, struct cg *cgp);
int chkrange(ufs2_daddr_t blk, int cnt);
void ckfini(int markclean);
int ckinode(union dinode *dp, struct inodesc *);
Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8
==============================================================================
--- stable/7/sbin/fsck_ffs/fsck_ffs.8 Sun Jan 11 23:19:17 2009 (r187068)
+++ stable/7/sbin/fsck_ffs/fsck_ffs.8 Mon Jan 12 00:39:22 2009 (r187069)
@@ -29,7 +29,7 @@
.\" @(#)fsck.8 8.4 (Berkeley) 5/9/95
.\" $FreeBSD$
.\"
-.Dd April 24, 2001
+.Dd April 10, 2008
.Dt FSCK_FFS 8
.Os
.Sh NAME
@@ -38,7 +38,7 @@
.Nd file system consistency check and interactive repair
.Sh SYNOPSIS
.Nm
-.Op Fl BFpfny
+.Op Fl BCFpfny
.Op Fl b Ar block
.Op Fl c Ar level
.Op Fl m Ar mode
@@ -175,6 +175,26 @@ Use the block specified immediately afte
the super block for the file system.
An alternate super block is usually located at block 32 for UFS1,
and block 160 for UFS2.
+.It Fl C
+Run
+.Nm
+in 'catastrophic recovery' mode, which will enable certain aggressive
+operations that can make
+.Nm
+to survive with file systems that has very serious data damage, which
+is an useful last resort when on disk data damage is very serious
+and causes
+.Nm
+to crash otherwise. Be
+.Em very careful
+using this flag, is dangerous if there are data transmission hazards
+because a false positive cylinder group magic number mismatch could
+cause
+.Em irrevertible data loss!
+.Pp
+This option implies the
+.Fl f
+flag.
.It Fl c
Convert the file system to the specified level.
Note that the level of a file system can only be raised.
Modified: stable/7/sbin/fsck_ffs/fsutil.c
==============================================================================
--- stable/7/sbin/fsck_ffs/fsutil.c Sun Jan 11 23:19:17 2009 (r187068)
+++ stable/7/sbin/fsck_ffs/fsutil.c Mon Jan 12 00:39:22 2009 (r187069)
@@ -418,6 +418,35 @@ blwrite(int fd, char *buf, ufs2_daddr_t
}
/*
+ * Check cg's magic number. If catastrophic mode is enabled and the cg's
+ * magic number is bad, offer an option to clear the whole cg.
+ */
+void
+check_cgmagic(int cg, struct cg *cgp)
+{
+
+ if (!cg_chkmagic(cgp)) {
+ pwarn("CG %d: BAD MAGIC NUMBER\n", cg);
+ if (catastrophicflag) {
+ if (reply("CLEAR CG")) {
+ memset(cgp, 0, (size_t)sblock.fs_cgsize);
+ cgp->cg_initediblk = sblock.fs_ipg;
+ cgp->cg_old_niblk = sblock.fs_ipg;
+ cgp->cg_old_ncyl = sblock.fs_old_cpg;
+ cgp->cg_cgx = cg;
+ cgp->cg_niblk = sblock.fs_ipg;
+ cgp->cg_ndblk = sblock.fs_size - cgbase(&sblock, cg);
+ cgp->cg_magic = CG_MAGIC;
+ cgdirty();
+ printf("PLEASE RERUN FSCK.\n");
+ rerun = 1;
+ }
+ } else
+ printf("YOU MAY NEED TO RERUN FSCK WITH -C IF IT CRASHED.\n");
+ }
+}
+
+/*
* allocate a data block with the specified number of fragments
*/
ufs2_daddr_t
@@ -441,8 +470,7 @@ allocblk(long frags)
}
cg = dtog(&sblock, i + j);
getblk(&cgblk, cgtod(&sblock, cg), sblock.fs_cgsize);
- if (!cg_chkmagic(cgp))
- pfatal("CG %d: BAD MAGIC NUMBER\n", cg);
+ check_cgmagic(cg, cgp);
baseblk = dtogd(&sblock, i + j);
for (k = 0; k < frags; k++) {
setbmap(i + j + k);
Modified: stable/7/sbin/fsck_ffs/inode.c
==============================================================================
--- stable/7/sbin/fsck_ffs/inode.c Sun Jan 11 23:19:17 2009 (r187068)
+++ stable/7/sbin/fsck_ffs/inode.c Mon Jan 12 00:39:22 2009 (r187069)
@@ -617,8 +617,7 @@ allocino(ino_t request, int type)
return (0);
cg = ino_to_cg(&sblock, ino);
getblk(&cgblk, cgtod(&sblock, cg), sblock.fs_cgsize);
- if (!cg_chkmagic(cgp))
- pfatal("CG %d: BAD MAGIC NUMBER\n", cg);
+ check_cgmagic(cg, cgp);
setbit(cg_inosused(cgp), ino % sblock.fs_ipg);
cgp->cg_cs.cs_nifree--;
switch (type & IFMT) {
Modified: stable/7/sbin/fsck_ffs/main.c
==============================================================================
--- stable/7/sbin/fsck_ffs/main.c Sun Jan 11 23:19:17 2009 (r187068)
+++ stable/7/sbin/fsck_ffs/main.c Mon Jan 12 00:39:22 2009 (r187069)
@@ -81,7 +81,8 @@ main(int argc, char *argv[])
sync();
skipclean = 1;
- while ((ch = getopt(argc, argv, "b:Bc:dfFm:npy")) != -1) {
+ catastrophicflag = 0;
+ while ((ch = getopt(argc, argv, "b:Bc:CdfFm:npy")) != -1) {
switch (ch) {
case 'b':
skipclean = 0;
@@ -105,6 +106,10 @@ main(int argc, char *argv[])
debug++;
break;
+ case 'C':
+ catastrophicflag = 1;
+ /* FALLTHROUGH */
+
case 'f':
skipclean = 0;
break;
@@ -610,7 +615,7 @@ static void
usage(void)
{
(void) fprintf(stderr,
- "usage: %s [-BFpfny] [-b block] [-c level] [-m mode] "
+ "usage: %s [-BCFpfny] [-b block] [-c level] [-m mode] "
"filesystem ...\n",
getprogname());
exit(1);
From yongari at FreeBSD.org Sun Jan 11 18:08:00 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 18:08:21 2009
Subject: svn commit: r187072 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb dev/mii
Message-ID: <200901120207.n0C27v8t045057@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 02:07:57 2009
New Revision: 187072
URL: http://svn.freebsd.org/changeset/base/187072
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/mii/ciphy.c
Modified: stable/7/sys/dev/mii/ciphy.c
==============================================================================
--- stable/7/sys/dev/mii/ciphy.c Mon Jan 12 01:36:01 2009 (r187071)
+++ stable/7/sys/dev/mii/ciphy.c Mon Jan 12 02:07:57 2009 (r187072)
@@ -262,15 +262,18 @@ setit:
if (reg & BMSR_LINK)
break;
+ /* Announce link loss right after it happens. */
+ if (++sc->mii_ticks == 0)
+ break;
/*
- * Only retry autonegotiation every 5 seconds.
+ * Only retry autonegotiation every mii_anegticks seconds.
*/
- if (++sc->mii_ticks <= MII_ANEGTICKS)
+ if (sc->mii_ticks <= sc->mii_anegticks)
break;
sc->mii_ticks = 0;
mii_phy_auto(sc);
- return (0);
+ break;
}
/* Update the media status. */
@@ -335,6 +338,8 @@ ciphy_status(struct mii_softc *sc)
if (bmsr & CIPHY_AUXCSR_FDX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
}
static void
From minimarmot at gmail.com Sun Jan 11 18:14:18 2009
From: minimarmot at gmail.com (Ben Kaduk)
Date: Sun Jan 11 18:14:23 2009
Subject: svn commit: r187069 - stable/7/sbin/fsck_ffs
In-Reply-To: <200901120039.n0C0dMKX043214@svn.freebsd.org>
References: <200901120039.n0C0dMKX043214@svn.freebsd.org>
Message-ID: <47d0403c0901111753r48b9ebc0x43dfb4389194cf2c@mail.gmail.com>
On Sun, Jan 11, 2009 at 7:39 PM, Xin LI wrote:
> Author: delphij
> Date: Mon Jan 12 00:39:22 2009
> New Revision: 187069
> URL: http://svn.freebsd.org/changeset/base/187069
>
> Log:
> MFC revisions 178088 and 179656: Catastrophic recovery mode.
>
> Modified:
> stable/7/sbin/fsck_ffs/ (props changed)
> stable/7/sbin/fsck_ffs/fsck.h
> stable/7/sbin/fsck_ffs/fsck_ffs.8
> stable/7/sbin/fsck_ffs/fsutil.c
> stable/7/sbin/fsck_ffs/inode.c
> stable/7/sbin/fsck_ffs/main.c
>
> Modified: stable/7/sbin/fsck_ffs/fsck.h
> ==============================================================================
> Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8
> ==============================================================================
> --- stable/7/sbin/fsck_ffs/fsck_ffs.8 Sun Jan 11 23:19:17 2009 (r187068)
> +++ stable/7/sbin/fsck_ffs/fsck_ffs.8 Mon Jan 12 00:39:22 2009 (r187069)
> @@ -29,7 +29,7 @@
> .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95
> .\" $FreeBSD$
> .\"
> -.Dd April 24, 2001
> +.Dd April 10, 2008
> .Dt FSCK_FFS 8
> .Os
> .Sh NAME
> @@ -38,7 +38,7 @@
> .Nd file system consistency check and interactive repair
> .Sh SYNOPSIS
> .Nm
> -.Op Fl BFpfny
> +.Op Fl BCFpfny
> .Op Fl b Ar block
> .Op Fl c Ar level
> .Op Fl m Ar mode
> @@ -175,6 +175,26 @@ Use the block specified immediately afte
> the super block for the file system.
> An alternate super block is usually located at block 32 for UFS1,
> and block 160 for UFS2.
> +.It Fl C
> +Run
> +.Nm
> +in 'catastrophic recovery' mode, which will enable certain aggressive
> +operations that can make
> +.Nm
> +to survive with file systems that has very serious data damage, which
> +is an useful last resort when on disk data damage is very serious
> +and causes
> +.Nm
> +to crash otherwise. Be
> +.Em very careful
> +using this flag, is dangerous if there are data transmission hazards
I guess I missed this in HEAD, but there seems to be a missing 'it'
before 'is dangerous'.
-Ben Kaduk
From yongari at FreeBSD.org Sun Jan 11 18:31:23 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 18:31:30 2009
Subject: svn commit: r187073 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb dev/mii
Message-ID: <200901120231.n0C2VM98045506@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 02:31:22 2009
New Revision: 187073
URL: http://svn.freebsd.org/changeset/base/187073
Log:
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
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/mii/ciphy.c
stable/7/sys/dev/mii/miidevs
Modified: stable/7/sys/dev/mii/ciphy.c
==============================================================================
--- stable/7/sys/dev/mii/ciphy.c Mon Jan 12 02:07:57 2009 (r187072)
+++ stable/7/sys/dev/mii/ciphy.c Mon Jan 12 02:31:22 2009 (r187073)
@@ -91,6 +91,7 @@ static const struct mii_phydesc ciphys[]
MII_PHY_DESC(CICADA, CS8201),
MII_PHY_DESC(CICADA, CS8201A),
MII_PHY_DESC(CICADA, CS8201B),
+ MII_PHY_DESC(CICADA, VSC8211),
MII_PHY_DESC(VITESSE, VSC8601),
MII_PHY_END
};
@@ -419,6 +420,7 @@ ciphy_fixup(struct mii_softc *sc)
}
break;
+ case MII_MODEL_CICADA_VSC8211:
case MII_MODEL_VITESSE_VSC8601:
break;
default:
Modified: stable/7/sys/dev/mii/miidevs
==============================================================================
--- stable/7/sys/dev/mii/miidevs Mon Jan 12 02:07:57 2009 (r187072)
+++ stable/7/sys/dev/mii/miidevs Mon Jan 12 02:31:22 2009 (r187073)
@@ -151,6 +151,7 @@ model BROADCOM2 BCM5906 0x0004 BCM5906
/* Cicada Semiconductor PHYs (now owned by Vitesse?) */
model CICADA CS8201 0x0001 Cicada CS8201 10/100/1000TX PHY
+model CICADA VSC8211 0x000b Cicada VSC8211 10/100/1000TX PHY
model CICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY
model CICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY
model VITESSE VSC8601 0x0002 Vitesse VSC8601 10/100/1000TX PHY
From yongari at FreeBSD.org Sun Jan 11 18:44:26 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 18:44:31 2009
Subject: svn commit: r187074 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb dev/mii
Message-ID: <200901120244.n0C2iNOS045912@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 02:44:23 2009
New Revision: 187074
URL: http://svn.freebsd.org/changeset/base/187074
Log:
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 hot dot pl >
Tested by: Krzysztof Jedruczyk < beaker hot dot pl >
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/mii/e1000phy.c
Modified: stable/7/sys/dev/mii/e1000phy.c
==============================================================================
--- stable/7/sys/dev/mii/e1000phy.c Mon Jan 12 02:31:22 2009 (r187073)
+++ stable/7/sys/dev/mii/e1000phy.c Mon Jan 12 02:44:23 2009 (r187074)
@@ -223,7 +223,7 @@ static void
e1000phy_reset(struct mii_softc *sc)
{
struct e1000phy_softc *esc;
- uint16_t reg;
+ uint16_t reg, page;
esc = (struct e1000phy_softc *)sc;
reg = PHY_READ(sc, E1000_SCR);
@@ -232,12 +232,13 @@ e1000phy_reset(struct mii_softc *sc)
PHY_WRITE(sc, E1000_SCR, reg);
if (esc->mii_model == MII_MODEL_MARVELL_E1112) {
/* Select 1000BASE-X only mode. */
+ page = PHY_READ(sc, E1000_EADR);
PHY_WRITE(sc, E1000_EADR, 2);
reg = PHY_READ(sc, E1000_SCR);
reg &= ~E1000_SCR_MODE_MASK;
reg |= E1000_SCR_MODE_1000BX;
PHY_WRITE(sc, E1000_SCR, reg);
- PHY_WRITE(sc, E1000_EADR, 1);
+ PHY_WRITE(sc, E1000_EADR, page);
}
} else {
switch (esc->mii_model) {
From thompsa at FreeBSD.org Sun Jan 11 18:45:02 2009
From: thompsa at FreeBSD.org (Andrew Thompson)
Date: Sun Jan 11 18:45:14 2009
Subject: svn commit: r187075 - stable/7/usr.sbin/config
Message-ID: <200901120245.n0C2j0ev045957@svn.freebsd.org>
Author: thompsa
Date: Mon Jan 12 02:45:00 2009
New Revision: 187075
URL: http://svn.freebsd.org/changeset/base/187075
Log:
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.
Modified:
stable/7/usr.sbin/config/ (props changed)
stable/7/usr.sbin/config/config.5
stable/7/usr.sbin/config/config.h
stable/7/usr.sbin/config/config.y
stable/7/usr.sbin/config/configvers.h
stable/7/usr.sbin/config/lang.l
stable/7/usr.sbin/config/mkmakefile.c
Modified: stable/7/usr.sbin/config/config.5
==============================================================================
--- stable/7/usr.sbin/config/config.5 Mon Jan 12 02:44:23 2009 (r187074)
+++ stable/7/usr.sbin/config/config.5 Mon Jan 12 02:45:00 2009 (r187075)
@@ -231,6 +231,7 @@ specifications.
Each option specification has the form
.Pp
.D1 Ar MakeVariableName Ns Op = Ns Ar Value
+.D1 Ar MakeVariableName Ns += Ns Ar Value
.Pp
and results in the appropriate
.Xr make 1
@@ -243,7 +244,8 @@ is assumed to be the empty string.
.Pp
Example:
.Bd -literal -offset indent -compact
-makeoptions MYMAKEOPTION="foobar"
+makeoptions MYMAKEOPTION="foo"
+makeoptions MYMAKEOPTION+="bar"
makeoptions MYNULLMAKEOPTION
.Ed
.\" -------- MAXUSERS --------
Modified: stable/7/usr.sbin/config/config.h
==============================================================================
--- stable/7/usr.sbin/config/config.h Mon Jan 12 02:44:23 2009 (r187074)
+++ stable/7/usr.sbin/config/config.h Mon Jan 12 02:45:00 2009 (r187075)
@@ -121,6 +121,7 @@ struct opt {
char *op_value;
int op_ownfile; /* true = own file, false = makefile */
SLIST_ENTRY(opt) op_next;
+ SLIST_ENTRY(opt) op_append;
};
SLIST_HEAD(opt_head, opt) opt, mkopt, rmopts;
Modified: stable/7/usr.sbin/config/config.y
==============================================================================
--- stable/7/usr.sbin/config/config.y Mon Jan 12 02:44:23 2009 (r187074)
+++ stable/7/usr.sbin/config/config.y Mon Jan 12 02:45:00 2009 (r187075)
@@ -13,6 +13,7 @@
%token NODEVICE
%token ENV
%token EQUALS
+%token PLUSEQUALS
%token HINTS
%token IDENT
%token MAXUSERS
@@ -219,7 +220,7 @@ System_spec:
System_id:
Save_id
- = { newopt(&mkopt, ns("KERNEL"), $1); };
+ = { newopt(&mkopt, ns("KERNEL"), $1, 0); };
System_parameter_list:
System_parameter_list ID
@@ -235,14 +236,14 @@ Opt_list:
Option:
Save_id
= {
- newopt(&opt, $1, NULL);
+ newopt(&opt, $1, NULL, 0);
if (strchr($1, '=') != NULL)
errx(1, "%s:%d: The `=' in options should not be "
"quoted", yyfile, yyline);
} |
Save_id EQUALS Opt_value
= {
- newopt(&opt, $1, $3);
+ newopt(&opt, $1, $3, 0);
} ;
Opt_value:
@@ -269,9 +270,11 @@ Mkopt_list:
Mkoption:
Save_id
- = { newopt(&mkopt, $1, ns("")); } |
+ = { newopt(&mkopt, $1, ns(""), 0); } |
Save_id EQUALS Opt_value
- = { newopt(&mkopt, $1, $3); } ;
+ = { newopt(&mkopt, $1, $3, 0); } |
+ Save_id PLUSEQUALS Opt_value
+ = { newopt(&mkopt, $1, $3, 1); } ;
Dev:
ID
@@ -299,7 +302,7 @@ NoDev_list:
Device:
Dev
= {
- newopt(&opt, devopt($1), ns("1"));
+ newopt(&opt, devopt($1), ns("1"), 0);
/* and the device part */
newdev($1);
}
@@ -419,9 +422,9 @@ findopt(struct opt_head *list, char *nam
* Add an option to the list of options.
*/
static void
-newopt(struct opt_head *list, char *name, char *value)
+newopt(struct opt_head *list, char *name, char *value, int append)
{
- struct opt *op;
+ struct opt *op, *op2;
/*
* Ignore inclusions listed explicitly for configuration files.
@@ -431,7 +434,8 @@ newopt(struct opt_head *list, char *name
return;
}
- if (findopt(list, name)) {
+ op2 = findopt(list, name);
+ if (op2 != NULL && !append) {
printf("WARNING: duplicate option `%s' encountered.\n", name);
return;
}
@@ -440,7 +444,12 @@ newopt(struct opt_head *list, char *name
op->op_name = name;
op->op_ownfile = 0;
op->op_value = value;
- SLIST_INSERT_HEAD(list, op, op_next);
+ if (op2 != NULL) {
+ while (SLIST_NEXT(op2, op_append) != NULL)
+ op2 = SLIST_NEXT(op2, op_append);
+ SLIST_NEXT(op2, op_append) = op;
+ } else
+ SLIST_INSERT_HEAD(list, op, op_next);
}
/*
Modified: stable/7/usr.sbin/config/configvers.h
==============================================================================
--- stable/7/usr.sbin/config/configvers.h Mon Jan 12 02:44:23 2009 (r187074)
+++ stable/7/usr.sbin/config/configvers.h Mon Jan 12 02:45:00 2009 (r187075)
@@ -49,5 +49,5 @@
*
* $FreeBSD$
*/
-#define CONFIGVERS 600006
+#define CONFIGVERS 600007
#define MAJOR_VERS(x) ((x) / 100000)
Modified: stable/7/usr.sbin/config/lang.l
==============================================================================
--- stable/7/usr.sbin/config/lang.l Mon Jan 12 02:44:23 2009 (r187074)
+++ stable/7/usr.sbin/config/lang.l Mon Jan 12 02:45:00 2009 (r187075)
@@ -156,6 +156,7 @@ PATH [./][-/.%^A-Za-z_0-9]+
";" { return SEMICOLON; }
"," { return COMMA; }
"=" { BEGIN TOEOL; return EQUALS; }
+"+=" { BEGIN TOEOL; return PLUSEQUALS; }
<> {
int tok;
Modified: stable/7/usr.sbin/config/mkmakefile.c
==============================================================================
--- stable/7/usr.sbin/config/mkmakefile.c Mon Jan 12 02:44:23 2009 (r187074)
+++ stable/7/usr.sbin/config/mkmakefile.c Mon Jan 12 02:45:00 2009 (r187075)
@@ -110,7 +110,7 @@ makefile(void)
{
FILE *ifp, *ofp;
char line[BUFSIZ];
- struct opt *op;
+ struct opt *op, *t;
int versreq;
read_files();
@@ -127,8 +127,12 @@ makefile(void)
if (ofp == 0)
err(1, "%s", path("Makefile.new"));
fprintf(ofp, "KERN_IDENT=%s\n", ident);
- SLIST_FOREACH(op, &mkopt, op_next)
- fprintf(ofp, "%s=%s\n", op->op_name, op->op_value);
+ SLIST_FOREACH_SAFE(op, &mkopt, op_next, t) {
+ fprintf(ofp, "%s=%s", op->op_name, op->op_value);
+ while ((op = SLIST_NEXT(op, op_append)) != NULL)
+ fprintf(ofp, " %s", op->op_value);
+ fprintf(ofp, "\n");
+ }
if (debugging)
fprintf(ofp, "DEBUG=-g\n");
if (profiling)
From yongari at FreeBSD.org Sun Jan 11 18:51:30 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 18:51:37 2009
Subject: svn commit: r187076 - in stable/7/sys: . contrib/pf dev/cxgb dev/jme
Message-ID: <200901120251.n0C2pTuF046119@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 02:51:29 2009
New Revision: 187076
URL: http://svn.freebsd.org/changeset/base/187076
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/jme/if_jme.c
stable/7/sys/dev/jme/if_jmereg.h
stable/7/sys/dev/jme/if_jmevar.h
Modified: stable/7/sys/dev/jme/if_jme.c
==============================================================================
--- stable/7/sys/dev/jme/if_jme.c Mon Jan 12 02:45:00 2009 (r187075)
+++ stable/7/sys/dev/jme/if_jme.c Mon Jan 12 02:51:29 2009 (r187076)
@@ -651,6 +651,13 @@ jme_attach(device_t dev)
goto fail;
}
+ if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 2) {
+ if ((sc->jme_rev & DEVICEID_JMC2XX_MASK) == DEVICEID_JMC260 &&
+ CHIPMODE_REVFM(sc->jme_chip_rev) == 2)
+ sc->jme_flags |= JME_FLAG_DMA32BIT;
+ sc->jme_flags |= JME_FLAG_TXCLK;
+ }
+
/* Reset the ethernet controller. */
jme_reset(sc);
@@ -1007,6 +1014,8 @@ jme_dma_alloc(struct jme_softc *sc)
int error, i;
lowaddr = BUS_SPACE_MAXADDR;
+ if ((sc->jme_flags & JME_FLAG_DMA32BIT) != 0)
+ lowaddr = BUS_SPACE_MAXADDR_32BIT;
again:
/* Create parent ring tag. */
@@ -1106,25 +1115,32 @@ again:
}
sc->jme_rdata.jme_rx_ring_paddr = ctx.jme_busaddr;
- /* Tx/Rx descriptor queue should reside within 4GB boundary. */
- tx_ring_end = sc->jme_rdata.jme_tx_ring_paddr + JME_TX_RING_SIZE;
- rx_ring_end = sc->jme_rdata.jme_rx_ring_paddr + JME_RX_RING_SIZE;
- if ((JME_ADDR_HI(tx_ring_end) !=
- JME_ADDR_HI(sc->jme_rdata.jme_tx_ring_paddr)) ||
- (JME_ADDR_HI(rx_ring_end) !=
- JME_ADDR_HI(sc->jme_rdata.jme_rx_ring_paddr))) {
- device_printf(sc->jme_dev, "4GB boundary crossed, "
- "switching to 32bit DMA address mode.\n");
- jme_dma_free(sc);
- /* Limit DMA address space to 32bit and try again. */
- lowaddr = BUS_SPACE_MAXADDR_32BIT;
- goto again;
+ if (lowaddr != BUS_SPACE_MAXADDR_32BIT) {
+ /* Tx/Rx descriptor queue should reside within 4GB boundary. */
+ tx_ring_end = sc->jme_rdata.jme_tx_ring_paddr +
+ JME_TX_RING_SIZE;
+ rx_ring_end = sc->jme_rdata.jme_rx_ring_paddr +
+ JME_RX_RING_SIZE;
+ if ((JME_ADDR_HI(tx_ring_end) !=
+ JME_ADDR_HI(sc->jme_rdata.jme_tx_ring_paddr)) ||
+ (JME_ADDR_HI(rx_ring_end) !=
+ JME_ADDR_HI(sc->jme_rdata.jme_rx_ring_paddr))) {
+ device_printf(sc->jme_dev, "4GB boundary crossed, "
+ "switching to 32bit DMA address mode.\n");
+ jme_dma_free(sc);
+ /* Limit DMA address space to 32bit and try again. */
+ lowaddr = BUS_SPACE_MAXADDR_32BIT;
+ goto again;
+ }
}
+ lowaddr = BUS_SPACE_MAXADDR;
+ if ((sc->jme_flags & JME_FLAG_DMA32BIT) != 0)
+ lowaddr = BUS_SPACE_MAXADDR_32BIT;
/* Create parent buffer tag. */
error = bus_dma_tag_create(bus_get_dma_tag(sc->jme_dev),/* parent */
1, 0, /* algnmnt, boundary */
- BUS_SPACE_MAXADDR, /* lowaddr */
+ lowaddr, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
BUS_SPACE_MAXSIZE_32BIT, /* maxsize */
@@ -1445,6 +1461,11 @@ jme_setwol(struct jme_softc *sc)
JME_LOCK_ASSERT(sc);
if (pci_find_extcap(sc->jme_dev, PCIY_PMG, &pmc) != 0) {
+ /* Remove Tx MAC/offload clock to save more power. */
+ if ((sc->jme_flags & JME_FLAG_TXCLK) != 0)
+ CSR_WRITE_4(sc, JME_GHC, CSR_READ_4(sc, JME_GHC) &
+ ~(GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100 |
+ GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000));
/* No PME capability, PHY power down. */
jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr,
MII_BMCR, BMCR_PDOWN);
@@ -1466,7 +1487,11 @@ jme_setwol(struct jme_softc *sc)
CSR_WRITE_4(sc, JME_PMCS, pmcs);
CSR_WRITE_4(sc, JME_GPREG0, gpr);
-
+ /* Remove Tx MAC/offload clock to save more power. */
+ if ((sc->jme_flags & JME_FLAG_TXCLK) != 0)
+ CSR_WRITE_4(sc, JME_GHC, CSR_READ_4(sc, JME_GHC) &
+ ~(GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100 |
+ GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000));
/* Request PME. */
pmstat = pci_read_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, 2);
pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE);
@@ -1941,6 +1966,7 @@ jme_mac_config(struct jme_softc *sc)
{
struct mii_data *mii;
uint32_t ghc, gpreg, rxmac, txmac, txpause;
+ uint32_t txclk;
JME_LOCK_ASSERT(sc);
@@ -1950,6 +1976,7 @@ jme_mac_config(struct jme_softc *sc)
DELAY(10);
CSR_WRITE_4(sc, JME_GHC, 0);
ghc = 0;
+ txclk = 0;
rxmac = CSR_READ_4(sc, JME_RXMAC);
rxmac &= ~RXMAC_FC_ENB;
txmac = CSR_READ_4(sc, JME_TXMAC);
@@ -1982,14 +2009,17 @@ jme_mac_config(struct jme_softc *sc)
switch (IFM_SUBTYPE(mii->mii_media_active)) {
case IFM_10_T:
ghc |= GHC_SPEED_10;
+ txclk |= GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100;
break;
case IFM_100_TX:
ghc |= GHC_SPEED_100;
+ txclk |= GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100;
break;
case IFM_1000_T:
if ((sc->jme_flags & JME_FLAG_FASTETH) != 0)
break;
ghc |= GHC_SPEED_1000;
+ txclk |= GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000;
if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) == 0)
txmac |= TXMAC_CARRIER_EXT | TXMAC_FRAME_BURST;
break;
@@ -2019,6 +2049,8 @@ jme_mac_config(struct jme_softc *sc)
0x1B, 0x0004);
}
}
+ if ((sc->jme_flags & JME_FLAG_TXCLK) != 0)
+ ghc |= txclk;
CSR_WRITE_4(sc, JME_GHC, ghc);
CSR_WRITE_4(sc, JME_RXMAC, rxmac);
CSR_WRITE_4(sc, JME_TXMAC, txmac);
@@ -2637,13 +2669,19 @@ jme_init_locked(struct jme_softc *sc)
* decrease FIFO threshold to reduce the FIFO overruns for
* frames larger than 4000 bytes.
* For best performance of standard MTU sized frames use
- * maximum allowable FIFO threshold, 128QW.
+ * maximum allowable FIFO threshold, 128QW. Note these do
+ * not hold on chip full mask verion >=2. For these
+ * controllers 64QW and 128QW are not valid value.
*/
- if ((ifp->if_mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN +
- ETHER_CRC_LEN) > JME_RX_FIFO_SIZE)
+ if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 2)
sc->jme_rxcsr |= RXCSR_FIFO_THRESH_16QW;
- else
- sc->jme_rxcsr |= RXCSR_FIFO_THRESH_128QW;
+ else {
+ if ((ifp->if_mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN +
+ ETHER_CRC_LEN) > JME_RX_FIFO_SIZE)
+ sc->jme_rxcsr |= RXCSR_FIFO_THRESH_16QW;
+ else
+ sc->jme_rxcsr |= RXCSR_FIFO_THRESH_128QW;
+ }
sc->jme_rxcsr |= sc->jme_rx_dma_size | RXCSR_RXQ_N_SEL(RXCSR_RXQ0);
sc->jme_rxcsr |= RXCSR_DESC_RT_CNT(RXCSR_DESC_RT_CNT_DEFAULT);
sc->jme_rxcsr |= RXCSR_DESC_RT_GAP_256 & RXCSR_DESC_RT_GAP_MASK;
Modified: stable/7/sys/dev/jme/if_jmereg.h
==============================================================================
--- stable/7/sys/dev/jme/if_jmereg.h Mon Jan 12 02:45:00 2009 (r187075)
+++ stable/7/sys/dev/jme/if_jmereg.h Mon Jan 12 02:51:29 2009 (r187076)
@@ -239,8 +239,8 @@
#define RXCSR_FIFO_FTHRESH_MASK 0x30000000
#define RXCSR_FIFO_THRESH_16QW 0x00000000
#define RXCSR_FIFO_THRESH_32QW 0x04000000
-#define RXCSR_FIFO_THRESH_64QW 0x08000000
-#define RXCSR_FIFO_THRESH_128QW 0x0C000000
+#define RXCSR_FIFO_THRESH_64QW 0x08000000 /* JMC250/JMC260 REVFM < 2 */
+#define RXCSR_FIFO_THRESH_128QW 0x0C000000 /* JMC250/JMC260 REVFM < 2 */
#define RXCSR_FIFO_THRESH_MASK 0x0C000000
#define RXCSR_DMA_SIZE_16 0x00000000
#define RXCSR_DMA_SIZE_32 0x01000000
@@ -357,6 +357,16 @@
#define JME_GHC 0x0054
#define GHC_LOOPBACK 0x80000000
#define GHC_RESET 0x40000000
+#define GHC_RX_DMA_PWR_DIS 0x04000000 /* JMC250 REVFM >= 2 */
+#define GHC_FIFO_RD_PWR_DIS 0x02000000 /* JMC250 REVFM >= 2 */
+#define GHC_FIFO_WR_PWR_DIS 0x01000000 /* JMC250 REVFM >= 2 */
+#define GHC_TX_OFFLD_CLK_100 0x00800000 /* JMC250/JMC260 REVFM >= 2 */
+#define GHC_TX_OFFLD_CLK_1000 0x00400000 /* JMC250/JMC260 REVFM >= 2 */
+#define GHC_TX_OFFLD_CLK_DIS 0x00000000 /* JMC250/JMC260 REVFM >= 2 */
+#define GHC_TX_MAC_CLK_100 0x00200000 /* JMC250/JMC260 REVFM >= 2 */
+#define GHC_TX_MAC_CLK_1000 0x00100000 /* JMC250/JMC260 REVFM >= 2 */
+#define GHC_TX_MAC_CLK_DIS 0x00000000 /* JMC250/JMC260 REVFM >= 2 */
+#define GHC_AUTO_PHY_STAT_DIS 0x00000080 /* JMC250/JMC260 REVFM >= 2 */
#define GHC_FULL_DUPLEX 0x00000040
#define GHC_SPEED_UNKNOWN 0x00000000
#define GHC_SPEED_10 0x00000010
@@ -755,6 +765,10 @@
#define CHIPMODE_MODE_128P_MAC 0x00000003
#define CHIPMODE_MODE_128P_DBG 0x00000002
#define CHIPMODE_MODE_128P_PHY 0x00000000
+/* Chip full mask revision. */
+#define CHIPMODE_REVFM(x) ((x) & 0x0F)
+/* Chip ECO revision. */
+#define CHIPMODE_REVECO(x) (((x) >> 4) & 0x0F)
/* Shadow status base address high/low. */
#define JME_SHBASE_ADDR_HI 0x0848
Modified: stable/7/sys/dev/jme/if_jmevar.h
==============================================================================
--- stable/7/sys/dev/jme/if_jmevar.h Mon Jan 12 02:45:00 2009 (r187075)
+++ stable/7/sys/dev/jme/if_jmevar.h Mon Jan 12 02:51:29 2009 (r187076)
@@ -181,6 +181,8 @@ struct jme_softc {
#define JME_FLAG_PMCAP 0x0020
#define JME_FLAG_FASTETH 0x0040
#define JME_FLAG_NOJUMBO 0x0080
+#define JME_FLAG_TXCLK 0x0100
+#define JME_FLAG_DMA32BIT 0x0200
#define JME_FLAG_DETACH 0x4000
#define JME_FLAG_LINK 0x8000
From yongari at FreeBSD.org Sun Jan 11 19:26:54 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 19:27:06 2009
Subject: svn commit: r187077 - in stable/7/sys: . contrib/pf dev/cxgb dev/jme
Message-ID: <200901120326.n0C3QrWV047090@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 03:26:52 2009
New Revision: 187077
URL: http://svn.freebsd.org/changeset/base/187077
Log:
MFC r185597:
Add HW MAC counter support for newer JMC250/JMC260 revisions.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/jme/if_jme.c
stable/7/sys/dev/jme/if_jmereg.h
stable/7/sys/dev/jme/if_jmevar.h
Modified: stable/7/sys/dev/jme/if_jme.c
==============================================================================
--- stable/7/sys/dev/jme/if_jme.c Mon Jan 12 02:51:29 2009 (r187076)
+++ stable/7/sys/dev/jme/if_jme.c Mon Jan 12 03:26:52 2009 (r187077)
@@ -150,6 +150,9 @@ static void jme_init_ssb(struct jme_soft
static int jme_newbuf(struct jme_softc *, struct jme_rxdesc *);
static void jme_set_vlan(struct jme_softc *);
static void jme_set_filter(struct jme_softc *);
+static void jme_stats_clear(struct jme_softc *);
+static void jme_stats_save(struct jme_softc *);
+static void jme_stats_update(struct jme_softc *);
static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int);
static int sysctl_hw_jme_tx_coal_to(SYSCTL_HANDLER_ARGS);
static int sysctl_hw_jme_tx_coal_pkt(SYSCTL_HANDLER_ARGS);
@@ -656,6 +659,7 @@ jme_attach(device_t dev)
CHIPMODE_REVFM(sc->jme_chip_rev) == 2)
sc->jme_flags |= JME_FLAG_DMA32BIT;
sc->jme_flags |= JME_FLAG_TXCLK;
+ sc->jme_flags |= JME_FLAG_HWMIB;
}
/* Reset the ethernet controller. */
@@ -887,35 +891,41 @@ jme_detach(device_t dev)
return (0);
}
+#define JME_SYSCTL_STAT_ADD32(c, h, n, p, d) \
+ SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d)
+
static void
jme_sysctl_node(struct jme_softc *sc)
{
+ struct sysctl_ctx_list *ctx;
+ struct sysctl_oid_list *child, *parent;
+ struct sysctl_oid *tree;
+ struct jme_hw_stats *stats;
int error;
- SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev),
- SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO,
- "tx_coal_to", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_to,
- 0, sysctl_hw_jme_tx_coal_to, "I", "jme tx coalescing timeout");
-
- SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev),
- SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO,
- "tx_coal_pkt", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_pkt,
- 0, sysctl_hw_jme_tx_coal_pkt, "I", "jme tx coalescing packet");
-
- SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev),
- SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO,
- "rx_coal_to", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_to,
- 0, sysctl_hw_jme_rx_coal_to, "I", "jme rx coalescing timeout");
-
- SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev),
- SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO,
- "rx_coal_pkt", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_pkt,
- 0, sysctl_hw_jme_rx_coal_pkt, "I", "jme rx coalescing packet");
-
- SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev),
- SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO,
- "process_limit", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_process_limit,
- 0, sysctl_hw_jme_proc_limit, "I",
+ stats = &sc->jme_stats;
+ ctx = device_get_sysctl_ctx(sc->jme_dev);
+ child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev));
+
+ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_to",
+ CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_to, 0,
+ sysctl_hw_jme_tx_coal_to, "I", "jme tx coalescing timeout");
+
+ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_pkt",
+ CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_pkt, 0,
+ sysctl_hw_jme_tx_coal_pkt, "I", "jme tx coalescing packet");
+
+ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_to",
+ CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_to, 0,
+ sysctl_hw_jme_rx_coal_to, "I", "jme rx coalescing timeout");
+
+ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_pkt",
+ CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_pkt, 0,
+ sysctl_hw_jme_rx_coal_pkt, "I", "jme rx coalescing packet");
+
+ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit",
+ CTLTYPE_INT | CTLFLAG_RW, &sc->jme_process_limit, 0,
+ sysctl_hw_jme_proc_limit, "I",
"max number of Rx events to process");
/* Pull in device tunables. */
@@ -984,8 +994,43 @@ jme_sysctl_node(struct jme_softc *sc)
sc->jme_rx_coal_pkt = PCCRX_COAL_PKT_DEFAULT;
}
}
+
+ if ((sc->jme_flags & JME_FLAG_HWMIB) == 0)
+ return;
+
+ tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD,
+ NULL, "JME statistics");
+ parent = SYSCTL_CHILDREN(tree);
+
+ /* Rx statistics. */
+ tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD,
+ NULL, "Rx MAC statistics");
+ child = SYSCTL_CHILDREN(tree);
+ JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames",
+ &stats->rx_good_frames, "Good frames");
+ JME_SYSCTL_STAT_ADD32(ctx, child, "crc_errs",
+ &stats->rx_crc_errs, "CRC errors");
+ JME_SYSCTL_STAT_ADD32(ctx, child, "mii_errs",
+ &stats->rx_mii_errs, "MII errors");
+ JME_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows",
+ &stats->rx_fifo_oflows, "FIFO overflows");
+ JME_SYSCTL_STAT_ADD32(ctx, child, "desc_empty",
+ &stats->rx_desc_empty, "Descriptor empty");
+ JME_SYSCTL_STAT_ADD32(ctx, child, "bad_frames",
+ &stats->rx_bad_frames, "Bad frames");
+
+ /* Tx statistics. */
+ tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD,
+ NULL, "Tx MAC statistics");
+ child = SYSCTL_CHILDREN(tree);
+ JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames",
+ &stats->tx_good_frames, "Good frames");
+ JME_SYSCTL_STAT_ADD32(ctx, child, "bad_frames",
+ &stats->tx_bad_frames, "Bad frames");
}
+#undef JME_SYSCTL_STAT_ADD32
+
struct jme_dmamap_arg {
bus_addr_t jme_busaddr;
};
@@ -2164,6 +2209,7 @@ jme_link_task(void *arg, int pending)
/* Program MAC with resolved speed/duplex/flow-control. */
if ((sc->jme_flags & JME_FLAG_LINK) != 0) {
jme_mac_config(sc);
+ jme_stats_clear(sc);
CSR_WRITE_4(sc, JME_RXCSR, sc->jme_rxcsr);
CSR_WRITE_4(sc, JME_TXCSR, sc->jme_txcsr);
@@ -2553,6 +2599,7 @@ jme_tick(void *arg)
* faster and limit the maximum delay to a hz.
*/
jme_txeof(sc);
+ jme_stats_update(sc);
jme_watchdog(sc);
callout_reset(&sc->jme_tick_ch, hz, jme_tick, sc);
}
@@ -2862,6 +2909,8 @@ jme_stop(struct jme_softc *sc)
txd->tx_ndesc = 0;
}
}
+ jme_stats_update(sc);
+ jme_stats_save(sc);
}
static void
@@ -3093,6 +3142,76 @@ jme_set_filter(struct jme_softc *sc)
CSR_WRITE_4(sc, JME_RXMAC, rxcfg);
}
+static void
+jme_stats_clear(struct jme_softc *sc)
+{
+
+ JME_LOCK_ASSERT(sc);
+
+ if ((sc->jme_flags & JME_FLAG_HWMIB) == 0)
+ return;
+
+ /* Disable and clear counters. */
+ CSR_WRITE_4(sc, JME_STATCSR, 0xFFFFFFFF);
+ /* Activate hw counters. */
+ CSR_WRITE_4(sc, JME_STATCSR, 0);
+ CSR_READ_4(sc, JME_STATCSR);
+ bzero(&sc->jme_stats, sizeof(struct jme_hw_stats));
+}
+
+static void
+jme_stats_save(struct jme_softc *sc)
+{
+
+ JME_LOCK_ASSERT(sc);
+
+ if ((sc->jme_flags & JME_FLAG_HWMIB) == 0)
+ return;
+ /* Save current counters. */
+ bcopy(&sc->jme_stats, &sc->jme_ostats, sizeof(struct jme_hw_stats));
+ /* Disable and clear counters. */
+ CSR_WRITE_4(sc, JME_STATCSR, 0xFFFFFFFF);
+}
+
+static void
+jme_stats_update(struct jme_softc *sc)
+{
+ struct jme_hw_stats *stat, *ostat;
+ uint32_t reg;
+
+ JME_LOCK_ASSERT(sc);
+
+ if ((sc->jme_flags & JME_FLAG_HWMIB) == 0)
+ return;
+ stat = &sc->jme_stats;
+ ostat = &sc->jme_ostats;
+ stat->tx_good_frames = CSR_READ_4(sc, JME_STAT_TXGOOD);
+ stat->rx_good_frames = CSR_READ_4(sc, JME_STAT_RXGOOD);
+ reg = CSR_READ_4(sc, JME_STAT_CRCMII);
+ stat->rx_crc_errs = (reg & STAT_RX_CRC_ERR_MASK) >>
+ STAT_RX_CRC_ERR_SHIFT;
+ stat->rx_mii_errs = (reg & STAT_RX_MII_ERR_MASK) >>
+ STAT_RX_MII_ERR_SHIFT;
+ reg = CSR_READ_4(sc, JME_STAT_RXERR);
+ stat->rx_fifo_oflows = (reg & STAT_RXERR_OFLOW_MASK) >>
+ STAT_RXERR_OFLOW_SHIFT;
+ stat->rx_desc_empty = (reg & STAT_RXERR_MPTY_MASK) >>
+ STAT_RXERR_MPTY_SHIFT;
+ reg = CSR_READ_4(sc, JME_STAT_FAIL);
+ stat->rx_bad_frames = (reg & STAT_FAIL_RX_MASK) >> STAT_FAIL_RX_SHIFT;
+ stat->tx_bad_frames = (reg & STAT_FAIL_TX_MASK) >> STAT_FAIL_TX_SHIFT;
+
+ /* Account for previous counters. */
+ stat->rx_good_frames += ostat->rx_good_frames;
+ stat->rx_crc_errs += ostat->rx_crc_errs;
+ stat->rx_mii_errs += ostat->rx_mii_errs;
+ stat->rx_fifo_oflows += ostat->rx_fifo_oflows;
+ stat->rx_desc_empty += ostat->rx_desc_empty;
+ stat->rx_bad_frames += ostat->rx_bad_frames;
+ stat->tx_good_frames += ostat->tx_good_frames;
+ stat->tx_bad_frames += ostat->tx_bad_frames;
+}
+
static int
sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high)
{
Modified: stable/7/sys/dev/jme/if_jmereg.h
==============================================================================
--- stable/7/sys/dev/jme/if_jmereg.h Mon Jan 12 02:51:29 2009 (r187076)
+++ stable/7/sys/dev/jme/if_jmereg.h Mon Jan 12 03:26:52 2009 (r187077)
@@ -199,6 +199,7 @@
#define TXMAC_IFG2_DEFAULT 0x40000000
#define TXMAC_IFG1_MASK 0x30000000
#define TXMAC_IFG1_DEFAULT 0x20000000
+#define TXMAC_PAUSE_CNT_MASK 0x00FF0000
#define TXMAC_THRESH_1_PKT 0x00000300
#define TXMAC_THRESH_1_2_PKT 0x00000200
#define TXMAC_THRESH_1_4_PKT 0x00000100
@@ -403,6 +404,44 @@
#define PMCS_MAGIC_FRAME_ENB 0x00000001
#define PMCS_WOL_ENB_MASK 0x0000FFFF
+/*
+ * Statistic registers control and status.
+ * These statistics registers are valid only for JMC250/JMC260 REVFM >= 2.
+ */
+#define JME_STATCSR 0x0064
+#define STATCSR_RXMPT_DIS 0x00000080
+#define STATCSR_OFLOW_DIS 0x00000040
+#define STATCSR_MIIRXER_DIS 0x00000020
+#define STATCSR_CRCERR_DIS 0x00000010
+#define STATCSR_RXBAD_DIS 0x00000008
+#define STATCSR_RXGOOD_DIS 0x00000004
+#define STATCSR_TXBAD_DIS 0x00000002
+#define STATCSR_TXGOOD_DIS 0x00000001
+
+#define JME_STAT_TXGOOD 0x0068
+
+#define JME_STAT_RXGOOD 0x006C
+
+#define JME_STAT_CRCMII 0x0070
+#define STAT_RX_CRC_ERR_MASK 0xFFFF0000
+#define STAT_RX_MII_ERR_MASK 0x0000FFFF
+#define STAT_RX_CRC_ERR_SHIFT 16
+#define STAT_RX_MII_ERR_SHIFT 0
+
+#define JME_STAT_RXERR 0x0074
+#define STAT_RXERR_OFLOW_MASK 0xFFFF0000
+#define STAT_RXERR_MPTY_MASK 0x0000FFFF
+#define STAT_RXERR_OFLOW_SHIFT 16
+#define STAT_RXERR_MPTY_SHIFT 0
+
+#define JME_STAT_RESERVED1 0x0078
+
+#define JME_STAT_FAIL 0x007C
+#define STAT_FAIL_RX_MASK 0xFFFF0000
+#define STAT_FAIL_TX_MASK 0x0000FFFF
+#define STAT_FAIL_RX_SHIFT 16
+#define STAT_FAIL_TX_SHIFT 0
+
/* Giga PHY & EEPROM registers. */
#define JME_PHY_EEPROM_BASE_ADDR 0x0400
Modified: stable/7/sys/dev/jme/if_jmevar.h
==============================================================================
--- stable/7/sys/dev/jme/if_jmevar.h Mon Jan 12 02:51:29 2009 (r187076)
+++ stable/7/sys/dev/jme/if_jmevar.h Mon Jan 12 03:26:52 2009 (r187077)
@@ -154,6 +154,18 @@ struct jme_ring_data {
(sizeof(struct jme_desc) * JME_RX_RING_CNT)
#define JME_SSB_SIZE sizeof(struct jme_ssb)
+/* Statistics counters. */
+struct jme_hw_stats {
+ uint32_t rx_good_frames;
+ uint32_t rx_crc_errs;
+ uint32_t rx_mii_errs;
+ uint32_t rx_fifo_oflows;
+ uint32_t rx_desc_empty;
+ uint32_t rx_bad_frames;
+ uint32_t tx_good_frames;
+ uint32_t tx_bad_frames;
+};
+
/*
* Software state per device.
*/
@@ -183,9 +195,12 @@ struct jme_softc {
#define JME_FLAG_NOJUMBO 0x0080
#define JME_FLAG_TXCLK 0x0100
#define JME_FLAG_DMA32BIT 0x0200
+#define JME_FLAG_HWMIB 0x0400
#define JME_FLAG_DETACH 0x4000
#define JME_FLAG_LINK 0x8000
+ struct jme_hw_stats jme_ostats;
+ struct jme_hw_stats jme_stats;
struct callout jme_tick_ch;
struct jme_chain_data jme_cdata;
struct jme_ring_data jme_rdata;
From yongari at FreeBSD.org Sun Jan 11 19:32:56 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 19:33:12 2009
Subject: svn commit: r187078 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb dev/vge
Message-ID: <200901120332.n0C3Wt9V047252@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 03:32:54 2009
New Revision: 187078
URL: http://svn.freebsd.org/changeset/base/187078
Log:
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
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/vge/if_vge.c
Modified: stable/7/sys/dev/vge/if_vge.c
==============================================================================
--- stable/7/sys/dev/vge/if_vge.c Mon Jan 12 03:26:52 2009 (r187077)
+++ stable/7/sys/dev/vge/if_vge.c Mon Jan 12 03:32:54 2009 (r187078)
@@ -2226,15 +2226,17 @@ vge_ioctl(ifp, command, data)
}
}
#endif /* DEVICE_POLLING */
- if (mask & IFCAP_HWCSUM) {
- ifp->if_capenable |= ifr->ifr_reqcap & (IFCAP_HWCSUM);
- if (ifp->if_capenable & IFCAP_TXCSUM)
- ifp->if_hwassist = VGE_CSUM_FEATURES;
+ if ((mask & IFCAP_TXCSUM) != 0 &&
+ (ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
+ ifp->if_capenable ^= IFCAP_TXCSUM;
+ if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)
+ ifp->if_hwassist |= VGE_CSUM_FEATURES;
else
- ifp->if_hwassist = 0;
- if (ifp->if_drv_flags & IFF_DRV_RUNNING)
- vge_init(sc);
+ ifp->if_hwassist &= ~VGE_CSUM_FEATURES;
}
+ if ((mask & IFCAP_RXCSUM) != 0 &&
+ (ifp->if_capabilities & IFCAP_RXCSUM) != 0)
+ ifp->if_capenable ^= IFCAP_RXCSUM;
}
break;
default:
From yongari at FreeBSD.org Sun Jan 11 19:48:26 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 19:48:45 2009
Subject: svn commit: r187080 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb pci
Message-ID: <200901120348.n0C3mPCg047667@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 03:48:25 2009
New Revision: 187080
URL: http://svn.freebsd.org/changeset/base/187080
Log:
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
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/pci/if_rl.c
stable/7/sys/pci/if_rlreg.h
Modified: stable/7/sys/pci/if_rl.c
==============================================================================
--- stable/7/sys/pci/if_rl.c Mon Jan 12 03:33:48 2009 (r187079)
+++ stable/7/sys/pci/if_rl.c Mon Jan 12 03:48:25 2009 (r187080)
@@ -182,12 +182,14 @@ static struct rl_type rl_devs[] = {
static int rl_attach(device_t);
static int rl_detach(device_t);
-static void rl_dma_map_rxbuf(void *, bus_dma_segment_t *, int, int);
-static void rl_dma_map_txbuf(void *, bus_dma_segment_t *, int, int);
+static void rl_dmamap_cb(void *, bus_dma_segment_t *, int, int);
+static int rl_dma_alloc(struct rl_softc *);
+static void rl_dma_free(struct rl_softc *);
static void rl_eeprom_putbyte(struct rl_softc *, int);
static void rl_eeprom_getword(struct rl_softc *, int, uint16_t *);
-static int rl_encap(struct rl_softc *, struct mbuf * );
+static int rl_encap(struct rl_softc *, struct mbuf **);
static int rl_list_tx_init(struct rl_softc *);
+static int rl_list_rx_init(struct rl_softc *);
static int rl_ifmedia_upd(struct ifnet *);
static void rl_ifmedia_sts(struct ifnet *, struct ifmediareq *);
static int rl_ioctl(struct ifnet *, u_long, caddr_t);
@@ -269,22 +271,6 @@ DRIVER_MODULE(miibus, rl, miibus_driver,
CSR_WRITE_1(sc, RL_EECMD, \
CSR_READ_1(sc, RL_EECMD) & ~x)
-static void
-rl_dma_map_rxbuf(void *arg, bus_dma_segment_t *segs, int nseg, int error)
-{
- struct rl_softc *sc = arg;
-
- CSR_WRITE_4(sc, RL_RXADDR, segs->ds_addr & 0xFFFFFFFF);
-}
-
-static void
-rl_dma_map_txbuf(void *arg, bus_dma_segment_t *segs, int nseg, int error)
-{
- struct rl_softc *sc = arg;
-
- CSR_WRITE_4(sc, RL_CUR_TXADDR(sc), segs->ds_addr & 0xFFFFFFFF);
-}
-
/*
* Send a read command and address to the EEPROM, check for ACK.
*/
@@ -756,6 +742,24 @@ rl_probe(device_t dev)
return (ENXIO);
}
+struct rl_dmamap_arg {
+ bus_addr_t rl_busaddr;
+};
+
+static void
+rl_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
+{
+ struct rl_dmamap_arg *ctx;
+
+ if (error != 0)
+ return;
+
+ KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs));
+
+ ctx = (struct rl_dmamap_arg *)arg;
+ ctx->rl_busaddr = segs[0].ds_addr;
+}
+
/*
* Attach the interface. Allocate softc structures, do ifmedia
* setup and ethernet/BPF attach.
@@ -868,59 +872,9 @@ rl_attach(device_t dev)
eaddr[i] = CSR_READ_1(sc, RL_IDR0 + i);
}
- /*
- * Allocate the parent bus DMA tag appropriate for PCI.
- */
-#define RL_NSEG_NEW 32
- error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
- 1, 0, /* alignment, boundary */
- BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
- BUS_SPACE_MAXADDR, /* highaddr */
- NULL, NULL, /* filter, filterarg */
- MAXBSIZE, RL_NSEG_NEW, /* maxsize, nsegments */
- BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */
- BUS_DMA_ALLOCNOW, /* flags */
- NULL, NULL, /* lockfunc, lockarg */
- &sc->rl_parent_tag);
- if (error)
+ if ((error = rl_dma_alloc(sc)) != 0)
goto fail;
- /*
- * Now allocate a tag for the DMA descriptor lists.
- * All of our lists are allocated as a contiguous block
- * of memory.
- */
- error = bus_dma_tag_create(sc->rl_parent_tag, /* parent */
- 1, 0, /* alignment, boundary */
- BUS_SPACE_MAXADDR, /* lowaddr */
- BUS_SPACE_MAXADDR, /* highaddr */
- NULL, NULL, /* filter, filterarg */
- RL_RXBUFLEN + 1518, 1, /* maxsize,nsegments */
- BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */
- BUS_DMA_ALLOCNOW, /* flags */
- NULL, NULL, /* lockfunc, lockarg */
- &sc->rl_tag);
- if (error)
- goto fail;
-
- /*
- * Now allocate a chunk of DMA-able memory based on the
- * tag we just created.
- */
- error = bus_dmamem_alloc(sc->rl_tag,
- (void **)&sc->rl_cdata.rl_rx_buf, BUS_DMA_NOWAIT | BUS_DMA_ZERO,
- &sc->rl_cdata.rl_rx_dmamap);
- if (error) {
- device_printf(dev, "no memory for list buffers!\n");
- bus_dma_tag_destroy(sc->rl_tag);
- sc->rl_tag = NULL;
- goto fail;
- }
-
- /* Leave a few bytes before the start of the RX ring buffer. */
- sc->rl_cdata.rl_rx_buf_ptr = sc->rl_cdata.rl_rx_buf;
- sc->rl_cdata.rl_rx_buf += sizeof(uint64_t);
-
ifp = sc->rl_ifp = if_alloc(IFT_ETHER);
if (ifp == NULL) {
device_printf(dev, "can not if_alloc()\n");
@@ -1019,20 +973,155 @@ rl_detach(device_t dev)
if (ifp)
if_free(ifp);
- if (sc->rl_tag) {
- bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap);
- bus_dmamem_free(sc->rl_tag, sc->rl_cdata.rl_rx_buf,
- sc->rl_cdata.rl_rx_dmamap);
- bus_dma_tag_destroy(sc->rl_tag);
- }
- if (sc->rl_parent_tag)
- bus_dma_tag_destroy(sc->rl_parent_tag);
+ rl_dma_free(sc);
mtx_destroy(&sc->rl_mtx);
return (0);
}
+static int
+rl_dma_alloc(struct rl_softc *sc)
+{
+ struct rl_dmamap_arg ctx;
+ int error, i;
+
+ /*
+ * Allocate the parent bus DMA tag appropriate for PCI.
+ */
+ error = bus_dma_tag_create(bus_get_dma_tag(sc->rl_dev), /* parent */
+ 1, 0, /* alignment, boundary */
+ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
+ BUS_SPACE_MAXADDR, /* highaddr */
+ NULL, NULL, /* filter, filterarg */
+ BUS_SPACE_MAXSIZE_32BIT, 0, /* maxsize, nsegments */
+ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
+ 0, /* flags */
+ NULL, NULL, /* lockfunc, lockarg */
+ &sc->rl_parent_tag);
+ if (error) {
+ device_printf(sc->rl_dev,
+ "failed to create parent DMA tag.\n");
+ goto fail;
+ }
+ /* Create DMA tag for Rx memory block. */
+ error = bus_dma_tag_create(sc->rl_parent_tag, /* parent */
+ RL_RX_8139_BUF_ALIGN, 0, /* alignment, boundary */
+ BUS_SPACE_MAXADDR, /* lowaddr */
+ BUS_SPACE_MAXADDR, /* highaddr */
+ NULL, NULL, /* filter, filterarg */
+ RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ, 1, /* maxsize,nsegments */
+ RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ, /* maxsegsize */
+ 0, /* flags */
+ NULL, NULL, /* lockfunc, lockarg */
+ &sc->rl_cdata.rl_rx_tag);
+ if (error) {
+ device_printf(sc->rl_dev,
+ "failed to create Rx memory block DMA tag.\n");
+ goto fail;
+ }
+ /* Create DMA tag for Tx buffer. */
+ error = bus_dma_tag_create(sc->rl_parent_tag, /* parent */
+ RL_TX_8139_BUF_ALIGN, 0, /* alignment, boundary */
+ BUS_SPACE_MAXADDR, /* lowaddr */
+ BUS_SPACE_MAXADDR, /* highaddr */
+ NULL, NULL, /* filter, filterarg */
+ MCLBYTES, 1, /* maxsize, nsegments */
+ MCLBYTES, /* maxsegsize */
+ 0, /* flags */
+ NULL, NULL, /* lockfunc, lockarg */
+ &sc->rl_cdata.rl_tx_tag);
+ if (error) {
+ device_printf(sc->rl_dev, "failed to create Tx DMA tag.\n");
+ goto fail;
+ }
+
+ /*
+ * Allocate DMA'able memory and load DMA map for Rx memory block.
+ */
+ error = bus_dmamem_alloc(sc->rl_cdata.rl_rx_tag,
+ (void **)&sc->rl_cdata.rl_rx_buf, BUS_DMA_WAITOK |
+ BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->rl_cdata.rl_rx_dmamap);
+ if (error != 0) {
+ device_printf(sc->rl_dev,
+ "failed to allocate Rx DMA memory block.\n");
+ goto fail;
+ }
+ ctx.rl_busaddr = 0;
+ error = bus_dmamap_load(sc->rl_cdata.rl_rx_tag,
+ sc->rl_cdata.rl_rx_dmamap, sc->rl_cdata.rl_rx_buf,
+ RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ, rl_dmamap_cb, &ctx,
+ BUS_DMA_NOWAIT);
+ if (error != 0 || ctx.rl_busaddr == 0) {
+ device_printf(sc->rl_dev,
+ "could not load Rx DMA memory block.\n");
+ goto fail;
+ }
+ sc->rl_cdata.rl_rx_buf_paddr = ctx.rl_busaddr;
+
+ /* Create DMA maps for Tx buffers. */
+ for (i = 0; i < RL_TX_LIST_CNT; i++) {
+ sc->rl_cdata.rl_tx_chain[i] = NULL;
+ sc->rl_cdata.rl_tx_dmamap[i] = NULL;
+ error = bus_dmamap_create(sc->rl_cdata.rl_tx_tag, 0,
+ &sc->rl_cdata.rl_tx_dmamap[i]);
+ if (error != 0) {
+ device_printf(sc->rl_dev,
+ "could not create Tx dmamap.\n");
+ goto fail;
+ }
+ }
+
+ /* Leave a few bytes before the start of the RX ring buffer. */
+ sc->rl_cdata.rl_rx_buf_ptr = sc->rl_cdata.rl_rx_buf;
+ sc->rl_cdata.rl_rx_buf += RL_RX_8139_BUF_RESERVE;
+
+fail:
+ return (error);
+}
+
+static void
+rl_dma_free(struct rl_softc *sc)
+{
+ int i;
+
+ /* Rx memory block. */
+ if (sc->rl_cdata.rl_rx_tag != NULL) {
+ if (sc->rl_cdata.rl_rx_dmamap != NULL)
+ bus_dmamap_unload(sc->rl_cdata.rl_rx_tag,
+ sc->rl_cdata.rl_rx_dmamap);
+ if (sc->rl_cdata.rl_rx_dmamap != NULL &&
+ sc->rl_cdata.rl_rx_buf_ptr != NULL)
+ bus_dmamem_free(sc->rl_cdata.rl_rx_tag,
+ sc->rl_cdata.rl_rx_buf_ptr,
+ sc->rl_cdata.rl_rx_dmamap);
+ sc->rl_cdata.rl_rx_buf_ptr = NULL;
+ sc->rl_cdata.rl_rx_buf = NULL;
+ sc->rl_cdata.rl_rx_dmamap = NULL;
+ bus_dma_tag_destroy(sc->rl_cdata.rl_rx_tag);
+ sc->rl_cdata.rl_tx_tag = NULL;
+ }
+
+ /* Tx buffers. */
+ if (sc->rl_cdata.rl_tx_tag != NULL) {
+ for (i = 0; i < RL_TX_LIST_CNT; i++) {
+ if (sc->rl_cdata.rl_tx_dmamap[i] != NULL) {
+ bus_dmamap_destroy(
+ sc->rl_cdata.rl_tx_tag,
+ sc->rl_cdata.rl_tx_dmamap[i]);
+ sc->rl_cdata.rl_tx_dmamap[i] = NULL;
+ }
+ bus_dma_tag_destroy(sc->rl_cdata.rl_tx_tag);
+ sc->rl_cdata.rl_tx_tag = NULL;
+ }
+ }
+
+ if (sc->rl_parent_tag != NULL) {
+ bus_dma_tag_destroy(sc->rl_parent_tag);
+ sc->rl_parent_tag = NULL;
+ }
+}
+
/*
* Initialize the transmit descriptors.
*/
@@ -1057,6 +1146,20 @@ rl_list_tx_init(struct rl_softc *sc)
return (0);
}
+static int
+rl_list_rx_init(struct rl_softc *sc)
+{
+
+ RL_LOCK_ASSERT(sc);
+
+ bzero(sc->rl_cdata.rl_rx_buf_ptr,
+ RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ);
+ bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, sc->rl_cdata.rl_rx_dmamap,
+ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+
+ return (0);
+}
+
/*
* A frame has been uploaded: pass the resulting mbuf chain up to
* the higher level protocols.
@@ -1093,8 +1196,8 @@ rl_rxeof(struct rl_softc *sc)
RL_LOCK_ASSERT(sc);
- bus_dmamap_sync(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap,
- BUS_DMASYNC_POSTREAD);
+ bus_dmamap_sync(sc->rl_cdata.rl_rx_tag, sc->rl_cdata.rl_rx_dmamap,
+ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
cur_rx = (CSR_READ_2(sc, RL_CURRXADDR) + 16) % RL_RXBUFLEN;
@@ -1192,6 +1295,8 @@ rl_rxeof(struct rl_softc *sc)
(*ifp->if_input)(ifp, m);
RL_LOCK(sc);
}
+
+ /* No need to sync Rx memory block as we didn't mofify it. */
}
/*
@@ -1220,8 +1325,9 @@ rl_txeof(struct rl_softc *sc)
ifp->if_collisions += (txstat & RL_TXSTAT_COLLCNT) >> 24;
- bus_dmamap_unload(sc->rl_tag, RL_LAST_DMAMAP(sc));
- bus_dmamap_destroy(sc->rl_tag, RL_LAST_DMAMAP(sc));
+ bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, RL_LAST_DMAMAP(sc),
+ BUS_DMASYNC_POSTWRITE);
+ bus_dmamap_unload(sc->rl_cdata.rl_tx_tag, RL_LAST_DMAMAP(sc));
m_freem(RL_LAST_TXMBUF(sc));
RL_LAST_TXMBUF(sc) = NULL;
/*
@@ -1369,41 +1475,64 @@ done_locked:
* pointers to the fragment pointers.
*/
static int
-rl_encap(struct rl_softc *sc, struct mbuf *m_head)
+rl_encap(struct rl_softc *sc, struct mbuf **m_head)
{
- struct mbuf *m_new = NULL;
+ struct mbuf *m;
+ bus_dma_segment_t txsegs[1];
+ int error, nsegs, padlen;
RL_LOCK_ASSERT(sc);
+ m = *m_head;
+ padlen = 0;
+ /*
+ * Hardware doesn't auto-pad, so we have to make sure
+ * pad short frames out to the minimum frame length.
+ */
+ if (m->m_pkthdr.len < RL_MIN_FRAMELEN)
+ padlen = RL_MIN_FRAMELEN - m->m_pkthdr.len;
/*
* The RealTek is brain damaged and wants longword-aligned
* TX buffers, plus we can only have one fragment buffer
* per packet. We have to copy pretty much all the time.
*/
- m_new = m_defrag(m_head, M_DONTWAIT);
-
- if (m_new == NULL) {
- m_freem(m_head);
- return (1);
+ if (m->m_next != NULL || (mtod(m, uintptr_t) & 3) != 0 ||
+ (padlen > 0 && M_TRAILINGSPACE(m) < padlen)) {
+ m = m_defrag(*m_head, M_DONTWAIT);
+ if (m == NULL) {
+ m_freem(*m_head);
+ *m_head = NULL;
+ return (ENOMEM);
+ }
}
- m_head = m_new;
+ *m_head = m;
- /* Pad frames to at least 60 bytes. */
- if (m_head->m_pkthdr.len < RL_MIN_FRAMELEN) {
+ if (padlen > 0) {
/*
* Make security concious people happy: zero out the
* bytes in the pad area, since we don't know what
* this mbuf cluster buffer's previous user might
* have left in it.
*/
- bzero(mtod(m_head, char *) + m_head->m_pkthdr.len,
- RL_MIN_FRAMELEN - m_head->m_pkthdr.len);
- m_head->m_pkthdr.len +=
- (RL_MIN_FRAMELEN - m_head->m_pkthdr.len);
- m_head->m_len = m_head->m_pkthdr.len;
+ bzero(mtod(m, char *) + m->m_pkthdr.len, padlen);
+ m->m_pkthdr.len += padlen;
+ m->m_len = m->m_pkthdr.len;
+ }
+
+ error = bus_dmamap_load_mbuf_sg(sc->rl_cdata.rl_tx_tag,
+ RL_CUR_DMAMAP(sc), m, txsegs, &nsegs, 0);
+ if (error != 0)
+ return (error);
+ if (nsegs == 0) {
+ m_freem(*m_head);
+ *m_head = NULL;
+ return (EIO);
}
- RL_CUR_TXMBUF(sc) = m_head;
+ RL_CUR_TXMBUF(sc) = m;
+ bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, RL_CUR_DMAMAP(sc),
+ BUS_DMASYNC_PREWRITE);
+ CSR_WRITE_4(sc, RL_CUR_TXADDR(sc), RL_ADDR_LO(txsegs[0].ds_addr));
return (0);
}
@@ -1436,19 +1565,18 @@ rl_start_locked(struct ifnet *ifp)
if (m_head == NULL)
break;
- if (rl_encap(sc, m_head))
+ if (rl_encap(sc, &m_head)) {
+ if (m_head == NULL)
+ break;
+ IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
+ ifp->if_drv_flags |= IFF_DRV_OACTIVE;
break;
+ }
/* Pass a copy of this mbuf chain to the bpf subsystem. */
BPF_MTAP(ifp, RL_CUR_TXMBUF(sc));
/* Transmit the frame. */
- bus_dmamap_create(sc->rl_tag, 0, &RL_CUR_DMAMAP(sc));
- bus_dmamap_load(sc->rl_tag, RL_CUR_DMAMAP(sc),
- mtod(RL_CUR_TXMBUF(sc), void *),
- RL_CUR_TXMBUF(sc)->m_pkthdr.len, rl_dma_map_txbuf, sc, 0);
- bus_dmamap_sync(sc->rl_tag, RL_CUR_DMAMAP(sc),
- BUS_DMASYNC_PREREAD);
CSR_WRITE_4(sc, RL_CUR_TXSTAT(sc),
RL_TXTHRESH(sc->rl_txthresh) |
RL_CUR_TXMBUF(sc)->m_pkthdr.len);
@@ -1507,14 +1635,13 @@ rl_init_locked(struct rl_softc *sc)
CSR_WRITE_STREAM_4(sc, RL_IDR4, eaddr[1]);
CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
- /* Init the RX buffer pointer register. */
- bus_dmamap_load(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap,
- sc->rl_cdata.rl_rx_buf, RL_RXBUFLEN, rl_dma_map_rxbuf, sc, 0);
- bus_dmamap_sync(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap,
- BUS_DMASYNC_PREWRITE);
-
+ /* Init the RX memory block pointer register. */
+ CSR_WRITE_4(sc, RL_RXADDR, sc->rl_cdata.rl_rx_buf_paddr +
+ RL_RX_8139_BUF_RESERVE);
/* Init TX descriptors. */
rl_list_tx_init(sc);
+ /* Init Rx memory block. */
+ rl_list_rx_init(sc);
/*
* Enable transmit and receive.
@@ -1718,19 +1845,21 @@ rl_stop(struct rl_softc *sc)
CSR_WRITE_1(sc, RL_COMMAND, 0x00);
CSR_WRITE_2(sc, RL_IMR, 0x0000);
- bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap);
/*
* Free the TX list buffers.
*/
for (i = 0; i < RL_TX_LIST_CNT; i++) {
if (sc->rl_cdata.rl_tx_chain[i] != NULL) {
- bus_dmamap_unload(sc->rl_tag,
- sc->rl_cdata.rl_tx_dmamap[i]);
- bus_dmamap_destroy(sc->rl_tag,
- sc->rl_cdata.rl_tx_dmamap[i]);
- m_freem(sc->rl_cdata.rl_tx_chain[i]);
- sc->rl_cdata.rl_tx_chain[i] = NULL;
+ if (sc->rl_cdata.rl_tx_chain[i] != NULL) {
+ bus_dmamap_sync(sc->rl_cdata.rl_tx_tag,
+ sc->rl_cdata.rl_tx_dmamap[i],
+ BUS_DMASYNC_POSTWRITE);
+ bus_dmamap_unload(sc->rl_cdata.rl_tx_tag,
+ sc->rl_cdata.rl_tx_dmamap[i]);
+ m_freem(sc->rl_cdata.rl_tx_chain[i]);
+ sc->rl_cdata.rl_tx_chain[i] = NULL;
+ }
CSR_WRITE_4(sc, RL_TXADDR0 + (i * sizeof(uint32_t)),
0x0000000);
}
Modified: stable/7/sys/pci/if_rlreg.h
==============================================================================
--- stable/7/sys/pci/if_rlreg.h Mon Jan 12 03:33:48 2009 (r187079)
+++ stable/7/sys/pci/if_rlreg.h Mon Jan 12 03:48:25 2009 (r187080)
@@ -502,6 +502,11 @@
#define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13))
#define RL_TX_LIST_CNT 4
#define RL_MIN_FRAMELEN 60
+#define RL_TX_8139_BUF_ALIGN 4
+#define RL_RX_8139_BUF_ALIGN 8
+#define RL_RX_8139_BUF_RESERVE sizeof(int64_t)
+#define RL_RX_8139_BUF_GUARD_SZ \
+ (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + RL_RX_8139_BUF_RESERVE)
#define RL_TXTHRESH(x) ((x) << 11)
#define RL_TX_THRESH_INIT 96
#define RL_RX_FIFOTHRESH RL_RXFIFO_NOTHRESH
@@ -523,10 +528,13 @@ struct rl_chain_data {
uint16_t cur_rx;
uint8_t *rl_rx_buf;
uint8_t *rl_rx_buf_ptr;
- bus_dmamap_t rl_rx_dmamap;
struct mbuf *rl_tx_chain[RL_TX_LIST_CNT];
bus_dmamap_t rl_tx_dmamap[RL_TX_LIST_CNT];
+ bus_dma_tag_t rl_tx_tag;
+ bus_dma_tag_t rl_rx_tag;
+ bus_dmamap_t rl_rx_dmamap;
+ bus_addr_t rl_rx_buf_paddr;
uint8_t last_tx;
uint8_t cur_tx;
};
@@ -814,7 +822,6 @@ struct rl_softc {
void *rl_intrhand[RL_MSI_MESSAGES];
device_t rl_miibus;
bus_dma_tag_t rl_parent_tag;
- bus_dma_tag_t rl_tag;
uint8_t rl_type;
int rl_eecmd_read;
int rl_eewidth;
From yongari at FreeBSD.org Sun Jan 11 19:54:35 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 19:54:52 2009
Subject: svn commit: r187081 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb pci
Message-ID: <200901120354.n0C3sYUS048251@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 03:54:33 2009
New Revision: 187081
URL: http://svn.freebsd.org/changeset/base/187081
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/pci/if_rl.c
Modified: stable/7/sys/pci/if_rl.c
==============================================================================
--- stable/7/sys/pci/if_rl.c Mon Jan 12 03:48:25 2009 (r187080)
+++ stable/7/sys/pci/if_rl.c Mon Jan 12 03:54:33 2009 (r187081)
@@ -1348,7 +1348,6 @@ rl_txeof(struct rl_softc *sc)
CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG);
oldthresh = sc->rl_txthresh;
/* error recovery */
- rl_reset(sc);
rl_init_locked(sc);
/* restore original threshold */
sc->rl_txthresh = oldthresh;
@@ -1360,8 +1359,6 @@ rl_txeof(struct rl_softc *sc)
if (RL_LAST_TXMBUF(sc) == NULL)
sc->rl_watchdog_timer = 0;
- else if (sc->rl_watchdog_timer == 0)
- sc->rl_watchdog_timer = 5;
}
static void
@@ -1417,10 +1414,8 @@ rl_poll_locked(struct ifnet *ifp, enum p
/* XXX We should check behaviour on receiver stalls. */
- if (status & RL_ISR_SYSTEM_ERR) {
- rl_reset(sc);
+ if (status & RL_ISR_SYSTEM_ERR)
rl_init_locked(sc);
- }
}
}
#endif /* DEVICE_POLLING */
@@ -1457,10 +1452,8 @@ rl_intr(void *arg)
rl_rxeof(sc);
if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR))
rl_txeof(sc);
- if (status & RL_ISR_SYSTEM_ERR) {
- rl_reset(sc);
+ if (status & RL_ISR_SYSTEM_ERR)
rl_init_locked(sc);
- }
}
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
@@ -1623,6 +1616,8 @@ rl_init_locked(struct rl_softc *sc)
*/
rl_stop(sc);
+ rl_reset(sc);
+
/*
* Init our MAC address. Even though the chipset
* documentation doesn't mention it, we need to enter "Config
@@ -1845,6 +1840,14 @@ rl_stop(struct rl_softc *sc)
CSR_WRITE_1(sc, RL_COMMAND, 0x00);
CSR_WRITE_2(sc, RL_IMR, 0x0000);
+ for (i = 0; i < RL_TIMEOUT; i++) {
+ DELAY(10);
+ if ((CSR_READ_1(sc, RL_COMMAND) &
+ (RL_CMD_RX_ENB | RL_CMD_TX_ENB)) == 0)
+ break;
+ }
+ if (i == RL_TIMEOUT)
+ device_printf(sc->rl_dev, "Unable to stop Tx/Rx MAC\n");
/*
* Free the TX list buffers.
From yongari at FreeBSD.org Sun Jan 11 20:03:26 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 20:03:43 2009
Subject: svn commit: r187082 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb pci
Message-ID: <200901120403.n0C43PHG049134@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 04:03:25 2009
New Revision: 187082
URL: http://svn.freebsd.org/changeset/base/187082
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/pci/if_rl.c
Modified: stable/7/sys/pci/if_rl.c
==============================================================================
--- stable/7/sys/pci/if_rl.c Mon Jan 12 03:54:33 2009 (r187081)
+++ stable/7/sys/pci/if_rl.c Mon Jan 12 04:03:25 2009 (r187082)
@@ -636,6 +636,34 @@ rl_miibus_writereg(device_t dev, int phy
static void
rl_miibus_statchg(device_t dev)
{
+ struct rl_softc *sc;
+ struct ifnet *ifp;
+ struct mii_data *mii;
+
+ sc = device_get_softc(dev);
+ mii = device_get_softc(sc->rl_miibus);
+ ifp = sc->rl_ifp;
+ if (mii == NULL || ifp == NULL ||
+ (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+ return;
+
+ sc->rl_flags &= ~RL_FLAG_LINK;
+ if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) ==
+ (IFM_ACTIVE | IFM_AVALID)) {
+ switch (IFM_SUBTYPE(mii->mii_media_active)) {
+ case IFM_10_T:
+ case IFM_100_TX:
+ sc->rl_flags |= RL_FLAG_LINK;
+ break;
+ default:
+ break;
+ }
+ }
+ /*
+ * RealTek controllers do not provide any interface to
+ * Tx/Rx MACs for resolved speed, duplex and flow-control
+ * parameters.
+ */
}
/*
@@ -1268,18 +1296,13 @@ rl_rxeof(struct rl_softc *sc)
if (total_len > wrap) {
m = m_devget(rxbufpos, total_len, RL_ETHER_ALIGN, ifp,
NULL);
- if (m == NULL) {
- ifp->if_ierrors++;
- } else {
+ if (m != NULL)
m_copyback(m, wrap, total_len - wrap,
sc->rl_cdata.rl_rx_buf);
- }
cur_rx = (total_len - wrap + ETHER_CRC_LEN);
} else {
m = m_devget(rxbufpos, total_len, RL_ETHER_ALIGN, ifp,
NULL);
- if (m == NULL)
- ifp->if_ierrors++;
cur_rx += total_len + 4 + ETHER_CRC_LEN;
}
@@ -1287,8 +1310,10 @@ rl_rxeof(struct rl_softc *sc)
cur_rx = (cur_rx + 3) & ~3;
CSR_WRITE_2(sc, RL_CURRXADDR, cur_rx - 16);
- if (m == NULL)
+ if (m == NULL) {
+ ifp->if_iqdrops++;
continue;
+ }
ifp->if_ipackets++;
RL_UNLOCK(sc);
@@ -1551,6 +1576,10 @@ rl_start_locked(struct ifnet *ifp)
RL_LOCK_ASSERT(sc);
+ if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
+ IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0)
+ return;
+
while (RL_CUR_TXMBUF(sc) == NULL) {
IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
@@ -1692,6 +1721,7 @@ rl_init_locked(struct rl_softc *sc)
/* Enable receiver and transmitter. */
CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB);
+ sc->rl_flags &= ~RL_FLAG_LINK;
mii_mediachg(mii);
CSR_WRITE_1(sc, RL_CFG1, RL_CFG1_DRVLOAD|RL_CFG1_FULLDUPLEX);
@@ -1837,6 +1867,7 @@ rl_stop(struct rl_softc *sc)
sc->rl_watchdog_timer = 0;
callout_stop(&sc->rl_stat_callout);
ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
+ sc->rl_flags &= ~RL_FLAG_LINK;
CSR_WRITE_1(sc, RL_COMMAND, 0x00);
CSR_WRITE_2(sc, RL_IMR, 0x0000);
From yongari at FreeBSD.org Sun Jan 11 20:10:42 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 20:10:54 2009
Subject: svn commit: r187083 - in stable/7/sys: . contrib/pf dev/cxgb pci
Message-ID: <200901120410.n0C4Aecm049744@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 04:10:40 2009
New Revision: 187083
URL: http://svn.freebsd.org/changeset/base/187083
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/pci/if_rl.c
Modified: stable/7/sys/pci/if_rl.c
==============================================================================
--- stable/7/sys/pci/if_rl.c Mon Jan 12 04:03:25 2009 (r187082)
+++ stable/7/sys/pci/if_rl.c Mon Jan 12 04:10:40 2009 (r187083)
@@ -1395,6 +1395,8 @@ rl_tick(void *xsc)
RL_LOCK_ASSERT(sc);
mii = device_get_softc(sc->rl_miibus);
mii_tick(mii);
+ if ((sc->rl_flags & RL_FLAG_LINK) == 0)
+ rl_miibus_statchg(sc->rl_dev);
rl_watchdog(sc);
From yongari at FreeBSD.org Sun Jan 11 20:15:06 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 20:15:17 2009
Subject: svn commit: r187085 - in stable/7/sys: . contrib/pf dev/age
dev/ath/ath_hal dev/cxgb
Message-ID: <200901120415.n0C4F5RZ050179@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 04:15:05 2009
New Revision: 187085
URL: http://svn.freebsd.org/changeset/base/187085
Log:
MFC r181717:
Fix a typo: jme -> age
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/age/if_age.c
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/dev/age/if_age.c
==============================================================================
--- stable/7/sys/dev/age/if_age.c Mon Jan 12 04:12:46 2009 (r187084)
+++ stable/7/sys/dev/age/if_age.c Mon Jan 12 04:15:05 2009 (r187085)
@@ -1427,7 +1427,7 @@ age_setwol(struct age_softc *sc)
MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG);
DELAY(1000);
if (aneg != 0) {
- /* Poll link state until jme(4) get a 10/100 link. */
+ /* Poll link state until age(4) get a 10/100 link. */
for (i = 0; i < MII_ANEGTICKS_GIGE; i++) {
mii_pollstat(mii);
if ((mii->mii_media_status & IFM_AVALID) != 0) {
From yongari at FreeBSD.org Sun Jan 11 20:18:23 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 20:18:40 2009
Subject: svn commit: r187086 - in stable/7/sys: . contrib/pf dev/age
dev/ath/ath_hal dev/cxgb
Message-ID: <200901120418.n0C4IMgE050478@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 04:18:22 2009
New Revision: 187086
URL: http://svn.freebsd.org/changeset/base/187086
Log:
MFC r184106:
No need to sync descriptors twice in age_rxintr()
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/age/if_age.c
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/dev/age/if_age.c
==============================================================================
--- stable/7/sys/dev/age/if_age.c Mon Jan 12 04:15:05 2009 (r187085)
+++ stable/7/sys/dev/age/if_age.c Mon Jan 12 04:18:22 2009 (r187086)
@@ -2478,9 +2478,6 @@ age_rxintr(struct age_softc *sc, int rr_
bus_dmamap_sync(sc->age_cdata.age_rr_ring_tag,
sc->age_cdata.age_rr_ring_map,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
- bus_dmamap_sync(sc->age_cdata.age_rx_ring_tag,
- sc->age_cdata.age_rx_ring_map,
- BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
for (prog = 0; rr_cons != rr_prod; prog++) {
if (count <= 0)
@@ -2513,9 +2510,6 @@ age_rxintr(struct age_softc *sc, int rr_
sc->age_cdata.age_rr_cons = rr_cons;
/* Sync descriptors. */
- bus_dmamap_sync(sc->age_cdata.age_rx_ring_tag,
- sc->age_cdata.age_rx_ring_map,
- BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
bus_dmamap_sync(sc->age_cdata.age_rr_ring_tag,
sc->age_cdata.age_rr_ring_map,
BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
From yongari at FreeBSD.org Sun Jan 11 20:20:47 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 20:20:54 2009
Subject: svn commit: r187087 - in stable/7/sys: . contrib/pf dev/age
dev/ath/ath_hal dev/cxgb
Message-ID: <200901120420.n0C4KkPT050720@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 04:20:46 2009
New Revision: 187087
URL: http://svn.freebsd.org/changeset/base/187087
Log:
MFC r184107:
Remove unused age_txdq
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/age/if_agevar.h
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/dev/age/if_agevar.h
==============================================================================
--- stable/7/sys/dev/age/if_agevar.h Mon Jan 12 04:18:22 2009 (r187086)
+++ stable/7/sys/dev/age/if_agevar.h Mon Jan 12 04:20:46 2009 (r187087)
@@ -68,8 +68,6 @@ struct age_txdesc {
struct tx_desc *tx_desc;
};
-STAILQ_HEAD(age_txdq, age_txdesc);
-
struct age_rxdesc {
struct mbuf *rx_m;
bus_dmamap_t rx_dmamap;
From yongari at FreeBSD.org Sun Jan 11 20:23:48 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 20:23:55 2009
Subject: svn commit: r187088 - in stable/7/sys: . contrib/pf dev/age
dev/ath/ath_hal dev/cxgb
Message-ID: <200901120423.n0C4NldE051044@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 04:23:47 2009
New Revision: 187088
URL: http://svn.freebsd.org/changeset/base/187088
Log:
MFC r184743:
Remove informational messages left. These messages were intended to
show up in verbose boot mode.
Reported by: pluknet ( pluknet<> gmail DOT com )
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/age/if_age.c
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/dev/age/if_age.c
==============================================================================
--- stable/7/sys/dev/age/if_age.c Mon Jan 12 04:20:46 2009 (r187087)
+++ stable/7/sys/dev/age/if_age.c Mon Jan 12 04:23:47 2009 (r187088)
@@ -429,17 +429,17 @@ age_get_macaddr(struct age_softc *sc)
ea[1] &= 0xFFFF;
if ((ea[0] == 0 && ea[1] == 0) ||
(ea[0] == 0xFFFFFFFF && ea[1] == 0xFFFF)) {
- if (1 || bootverbose)
+ if (bootverbose)
device_printf(sc->age_dev,
"invalid ethernet address "
"returned from VPD.\n");
vpd_error = EINVAL;
}
}
- if (vpd_error != 0 && (1 || bootverbose))
+ if (vpd_error != 0 && (bootverbose))
device_printf(sc->age_dev, "VPD access failure!\n");
} else {
- if (1 || bootverbose)
+ if (bootverbose)
device_printf(sc->age_dev,
"PCI VPD capability not found!\n");
}
@@ -538,7 +538,7 @@ age_attach(device_t dev)
sc->age_rev = pci_get_revid(dev);
sc->age_chip_rev = CSR_READ_4(sc, AGE_MASTER_CFG) >>
MASTER_CHIP_REV_SHIFT;
- if (1 || bootverbose) {
+ if (bootverbose) {
device_printf(dev, "PCI device revision : 0x%04x\n", sc->age_rev);
device_printf(dev, "Chip id/revision : 0x%04x\n",
sc->age_chip_rev);
@@ -565,7 +565,7 @@ age_attach(device_t dev)
/* Allocate IRQ resources. */
msixc = pci_msix_count(dev);
msic = pci_msi_count(dev);
- if (1 || bootverbose) {
+ if (bootverbose) {
device_printf(dev, "MSIX count : %d\n", msixc);
device_printf(dev, "MSI count : %d\n", msic);
}
@@ -612,7 +612,7 @@ age_attach(device_t dev)
/* Max payload size. */
sc->age_dma_wr_burst = ((burst >> 5) & 0x07) <<
DMA_CFG_WR_BURST_SHIFT;
- if (1 || bootverbose) {
+ if (bootverbose) {
device_printf(dev, "Read request size : %d bytes.\n",
128 << ((burst >> 12) & 0x07));
device_printf(dev, "TLP payload size : %d bytes.\n",
@@ -2685,7 +2685,7 @@ age_init_locked(struct age_softc *sc)
else
reg |= MASTER_ITIMER_ENB;
CSR_WRITE_4(sc, AGE_MASTER_CFG, reg);
- if (1 || bootverbose)
+ if (bootverbose)
device_printf(sc->age_dev, "interrupt moderation is %d us.\n",
sc->age_int_mod);
CSR_WRITE_2(sc, AGE_INTR_CLR_TIMER, AGE_USECS(1000));
From yongari at FreeBSD.org Sun Jan 11 20:30:28 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jan 11 20:30:40 2009
Subject: svn commit: r187089 - stable/7/share/man/man4
Message-ID: <200901120430.n0C4USin051696@svn.freebsd.org>
Author: yongari
Date: Mon Jan 12 04:30:27 2009
New Revision: 187089
URL: http://svn.freebsd.org/changeset/base/187089
Log:
MFC r183137:
Add ASUS P5KPL-C to the list of supported motherboard.
Reported by: < nikola.lecic anthesphoria dot net >
Modified:
stable/7/share/man/man4/ (props changed)
stable/7/share/man/man4/age.4
stable/7/share/man/man4/igb.4 (props changed)
Modified: stable/7/share/man/man4/age.4
==============================================================================
--- stable/7/share/man/man4/age.4 Mon Jan 12 04:23:47 2009 (r187088)
+++ stable/7/share/man/man4/age.4 Mon Jan 12 04:30:27 2009 (r187089)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 19, 2008
+.Dd September 18, 2008
.Dt AGE 4
.Os
.Sh NAME
@@ -119,6 +119,8 @@ ASUS P5K
.It
ASUS P5KC
.It
+ASUS P5KPL-C
+.It
ASUS P5KPL-VM
.It
ASUS P5K-SE
From obrien at FreeBSD.org Mon Jan 12 00:53:42 2009
From: obrien at FreeBSD.org (David O'Brien)
Date: Mon Jan 12 00:53:49 2009
Subject: svn commit: r187069 - stable/7/sbin/fsck_ffs
In-Reply-To: <200901120039.n0C0dMKX043214@svn.freebsd.org>
References: <200901120039.n0C0dMKX043214@svn.freebsd.org>
Message-ID: <20090112083144.GA69408@dragon.NUXI.org>
On Mon, Jan 12, 2009 at 12:39:22AM +0000, Xin LI wrote:
> Author: delphij
> Date: Mon Jan 12 00:39:22 2009
> New Revision: 187069
> URL: http://svn.freebsd.org/changeset/base/187069
>
> Log:
> MFC revisions 178088 and 179656: Catastrophic recovery mode.
Hi Xin,
I guess you missed my email to you about this. I was hoping to get an
answer to this before it was MFC'ed.
The use of 'C' conflicts with a Juniper Networks change Juniper wants to
push back to FreeBSD.
For Juniper the -C flag is the "clean" flag. Meaning don't do anything
if the FS is clean, other wise do as full a fsck as possible (vs. just
a "preen" fsck). It is useful as 'fsck -C -y /var' (for instance).
Do you think your functionality could live under the "-D" (damaged)
option? fsck_ffs already had a "-c" option, or Juniper would have
used that letter.
--
-- David (obrien@FreeBSD.org)
Q: Because it reverses the logical flow of conversation.
A: Why is top-posting (putting a reply at the top of the message) frowned upon?
Let's not play "Jeopardy-style quoting"
From stas at FreeBSD.org Mon Jan 12 07:48:24 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Mon Jan 12 07:48:43 2009
Subject: svn commit: r187099 - in stable/7: share/man/man4 sys
sys/amd64/amd64 sys/amd64/conf sys/amd64/include sys/conf
sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cpuctl
sys/dev/cxgb sys/i386/conf sys/i386...
Message-ID: <200901121548.n0CFmNRj069712@svn.freebsd.org>
Author: stas
Date: Mon Jan 12 15:48:22 2009
New Revision: 187099
URL: http://svn.freebsd.org/changeset/base/187099
Log:
- 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)
Added:
stable/7/share/man/man4/cpuctl.4
- copied, changed from r181430, head/share/man/man4/cpuctl.4
stable/7/sys/dev/cpuctl/
- copied from r181430, head/sys/dev/cpuctl/
stable/7/sys/modules/cpuctl/
- copied from r181430, head/sys/modules/cpuctl/
stable/7/sys/sys/cpuctl.h
- copied unchanged from r181430, head/sys/sys/cpuctl.h
stable/7/usr.sbin/cpucontrol/ (props changed)
- copied from r181430, head/usr.sbin/cpucontrol/
Modified:
stable/7/share/man/man4/ (props changed)
stable/7/share/man/man4/Makefile
stable/7/share/man/man4/igb.4 (props changed)
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/support.S
stable/7/sys/amd64/conf/NOTES
stable/7/sys/amd64/include/cpufunc.h
stable/7/sys/amd64/include/specialreg.h
stable/7/sys/conf/files.amd64
stable/7/sys/conf/files.i386
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cpuctl/cpuctl.c
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/i386/conf/NOTES
stable/7/sys/i386/i386/support.s
stable/7/sys/i386/include/cpufunc.h
stable/7/sys/i386/include/specialreg.h
stable/7/sys/modules/Makefile
stable/7/sys/sys/priv.h
stable/7/usr.sbin/ (props changed)
stable/7/usr.sbin/Makefile
stable/7/usr.sbin/adduser/ (props changed)
stable/7/usr.sbin/bsnmpd/modules/snmp_pf/ (props changed)
stable/7/usr.sbin/cdcontrol/ (props changed)
stable/7/usr.sbin/config/ (props changed)
stable/7/usr.sbin/cpucontrol/cpucontrol.8
stable/7/usr.sbin/cpucontrol/cpucontrol.c
stable/7/usr.sbin/cron/ (props changed)
stable/7/usr.sbin/cron/cron/ (props changed)
stable/7/usr.sbin/extattr/ (props changed)
stable/7/usr.sbin/freebsd-update/ (props changed)
stable/7/usr.sbin/fwcontrol/ (props changed)
stable/7/usr.sbin/iostat/ (props changed)
stable/7/usr.sbin/mergemaster/ (props changed)
stable/7/usr.sbin/mountd/ (props changed)
stable/7/usr.sbin/mtree/ (props changed)
stable/7/usr.sbin/ndiscvt/ (props changed)
stable/7/usr.sbin/newsyslog/newsyslog.conf.5 (props changed)
stable/7/usr.sbin/nscd/ (props changed)
stable/7/usr.sbin/ntp/ (props changed)
stable/7/usr.sbin/pciconf/ (props changed)
stable/7/usr.sbin/pkg_install/ (props changed)
stable/7/usr.sbin/pmcstat/ (props changed)
stable/7/usr.sbin/portsnap/ (props changed)
stable/7/usr.sbin/pw/ (props changed)
stable/7/usr.sbin/rpc.lockd/ (props changed)
stable/7/usr.sbin/rpc.statd/ (props changed)
stable/7/usr.sbin/rpc.yppasswdd/ (props changed)
stable/7/usr.sbin/setfib/ (props changed)
stable/7/usr.sbin/sysinstall/ (props changed)
stable/7/usr.sbin/syslogd/ (props changed)
stable/7/usr.sbin/traceroute/ (props changed)
stable/7/usr.sbin/tzsetup/ (props changed)
stable/7/usr.sbin/wpa/wpa_supplicant/ (props changed)
Modified: stable/7/share/man/man4/Makefile
==============================================================================
--- stable/7/share/man/man4/Makefile Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/share/man/man4/Makefile Mon Jan 12 15:48:22 2009 (r187099)
@@ -55,6 +55,7 @@ MAN= aac.4 \
cnw.4 \
coda.4 \
${_coretemp.4} \
+ ${_cpuctl.4} \
cpufreq.4 \
crypto.4 \
cue.4 \
@@ -554,6 +555,7 @@ MLINKS+=xl.4 if_xl.4
_acpi_dock.4= acpi_dock.4
_amdsmb.4= amdsmb.4
_coretemp.4= coretemp.4
+_cpuctl.4= cpuctl.4
_hptiop.4= hptiop.4
_hptmv.4= hptmv.4
_hptrr.4= hptrr.4
Copied and modified: stable/7/share/man/man4/cpuctl.4 (from r181430, head/share/man/man4/cpuctl.4)
==============================================================================
--- head/share/man/man4/cpuctl.4 Fri Aug 8 16:26:53 2008 (r181430, copy source)
+++ stable/7/share/man/man4/cpuctl.4 Mon Jan 12 15:48:22 2009 (r187099)
@@ -45,30 +45,33 @@ at boot time, place the following in
cpuctl_load="YES"
.Ed
.Sh DESCRIPTION
-The special file
+The special device
.Pa /dev/cpuctl
-presents interace to the system CPU. It provides functionality to retrieve
+presents interface to the system CPU.
+It provides functionality to retrieve
CPUID information, read/write machine specific registers (MSR) and perform
-cpu firmware updates.
+CPU firmware updates.
.Pp
-For each cpu present in the system, special file
+For each CPU present in the system, the special device
.Pa /dev/cpuctl%d
-with the appropriate index will be created. For multicore cpus the
-special file will be created for each core.
+with the appropriate index will be created.
+For multicore CPUs such a
+special device will be created for each core.
.Pp
Currently, only i386 and amd64 processors are
supported.
.Sh IOCTL INTERFACE
All of the supported operations are invoked using the
-.Fr ioctl 2
-system call. Refer to that manpage for further information about
-this interface. Currently, the following ioctls are defined:
+.Xr ioctl 2
+system call.
+Currently, the following ioctls are defined:
.Bl -tag -width CPUCTL_UPDATE
.It Dv CPUCTL_RDMSR Fa cpuctl_msr_args_t *args
.It Dv CPUCTL_WRMSR Fa cpuctl_msr_args_t *args
-Read/write cpu machine specific register. The
+Read/write CPU machine specific register.
+The
.Vt cpuctl_msr_args_t
-structure defined in
+structure is defined in
.In sys/cpuctl.h
as:
.Pp
@@ -79,7 +82,8 @@ typedef struct {
} cpuctl_msr_args_t;
.Ed
.It Dv CPUCTL_CPUID Fa cpuctl_cpuid_args_t *args
-Retrieve CPUID information. Arguments are supplied in
+Retrieve CPUID information.
+Arguments are supplied in
the following struct:
.Pp
.Bd -literal
@@ -93,9 +97,10 @@ The
.Va level
field indicates the CPUID level to retrieve information for, while the
.Va data
-used to store CPUID data received.
+field is used to store the received CPUID data.
.It Dv CPUCTL_UPDATE cpuctl_update_args_t *args
-Update cpu firmware (microcode). The structure defined in
+Update CPU firmware (microcode).
+The structure is defined in
.In sys/cpuctl.h
as:
.Pp
@@ -117,30 +122,31 @@ For additional information refer to
.Sh RETURN VALUES
.Bl -tag -width Er
.It Bq Er ENXIO
-The operation requested is not supported by device (e.g. unsupported
-architecture or cpu was disabled)
+The operation requested is not supported by the device (e.g. unsupported
+architecture or the CPU is disabled)
.It Bq Er EINVAL
Incorrect request was supplied, or microcode image is not correct.
.It Bq Er ENOMEM
No physical memory was available to complete the request.
.It Bq Er EFAULT
-The firmware image address points outside process address space.
+The firmware image address points outside the process address space.
.El
.Sh FILES
.Bl -tag -width /dev/cpuctl -compact
.It Pa /dev/cpuctl
.El
.Sh SEE ALSO
-.Xr hwpmc 4
+.Xr hwpmc 4 ,
+.Xr cpucontrol 8
.Sh HISTORY
The
.Nm
driver first appeared in
-.Fx 8.0
+.Fx 8.0 .
.Sh BUGS
Yes, probably, report if any.
.Sh AUTHORS
The
.Nm
-module and this manual page was written by
+module and this manual page were written by
.An Stanislav Sedov Aq stas@FreeBSD.org .
Modified: stable/7/sys/amd64/amd64/support.S
==============================================================================
--- stable/7/sys/amd64/amd64/support.S Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/sys/amd64/amd64/support.S Mon Jan 12 15:48:22 2009 (r187099)
@@ -716,3 +716,47 @@ NON_GPROF_ENTRY(__bb_init_func)
movq %rax,32(%rdi)
movq %rdi,bbhead
NON_GPROF_RET
+
+/*
+ * Support for reading MSRs in the safe manner.
+ */
+ENTRY(rdmsr_safe)
+/* int rdmsr_safe(u_int msr, uint64_t *data) */
+ movq PCPU(CURPCB),%r8
+ movq $msr_onfault,PCB_ONFAULT(%r8)
+ movl %edi,%ecx
+ rdmsr /* Read MSR pointed by %ecx. Returns
+ hi byte in edx, lo in %eax */
+ salq $32,%rdx /* sign-shift %rdx left */
+ cltq /* sign-extend %eax -> %rax */
+ orq %rdx,%rax
+ movq %rax,(%rsi)
+ xorq %rax,%rax
+ movq %rax,PCB_ONFAULT(%r8)
+ ret
+
+/*
+ * Support for writing MSRs in the safe manner.
+ */
+ENTRY(wrmsr_safe)
+/* int wrmsr_safe(u_int msr, uint64_t data) */
+ movq PCPU(CURPCB),%r8
+ movq $msr_onfault,PCB_ONFAULT(%r8)
+ movl %edi,%ecx
+ movl %esi,%eax
+ sarq $32,%rsi
+ movl %esi,%edx
+ wrmsr /* Write MSR pointed by %ecx. Accepts
+ hi byte in edx, lo in %eax. */
+ xorq %rax,%rax
+ movq %rax,PCB_ONFAULT(%r8)
+ ret
+
+/*
+ * MSR operations fault handler
+ */
+ ALIGN_TEXT
+msr_onfault:
+ movq $0,PCB_ONFAULT(%r8)
+ movl $EFAULT,%eax
+ ret
Modified: stable/7/sys/amd64/conf/NOTES
==============================================================================
--- stable/7/sys/amd64/conf/NOTES Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/sys/amd64/conf/NOTES Mon Jan 12 15:48:22 2009 (r187099)
@@ -575,6 +575,12 @@ options ELSA_QS1PCI
#---------------------------------------------------------------------------
#
+# CPU control pseudo-device. Provides access to MSRs, CPUID info and
+# microcode update feature.
+#
+device cpuctl
+
+#
# System Management Bus (SMB)
#
options ENABLE_ALART # Control alarm on Intel intpm driver
Modified: stable/7/sys/amd64/include/cpufunc.h
==============================================================================
--- stable/7/sys/amd64/include/cpufunc.h Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/sys/amd64/include/cpufunc.h Mon Jan 12 15:48:22 2009 (r187099)
@@ -777,4 +777,9 @@ void wrmsr(u_int msr, u_int64_t newval);
void reset_dbregs(void);
+#ifdef _KERNEL
+int rdmsr_safe(u_int msr, uint64_t *val);
+int wrmsr_safe(u_int msr, uint64_t newval);
+#endif
+
#endif /* !_MACHINE_CPUFUNC_H_ */
Modified: stable/7/sys/amd64/include/specialreg.h
==============================================================================
--- stable/7/sys/amd64/include/specialreg.h Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/sys/amd64/include/specialreg.h Mon Jan 12 15:48:22 2009 (r187099)
@@ -161,6 +161,12 @@
#define AMDID_CMP_CORES 0x000000ff
/*
+ * CPUID manufacturers identifiers
+ */
+#define INTEL_VENDOR_ID "GenuineIntel"
+#define AMD_VENDOR_ID "AuthenticAMD"
+
+/*
* Model-specific registers for the i386 family
*/
#define MSR_P5_MC_ADDR 0x000
@@ -409,5 +415,6 @@
#define MSR_IORRMASK1 0xc0010019
#define MSR_TOP_MEM 0xc001001a /* boundary for ram below 4G */
#define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */
+#define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */
#endif /* !_MACHINE_SPECIALREG_H_ */
Modified: stable/7/sys/conf/files.amd64
==============================================================================
--- stable/7/sys/conf/files.amd64 Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/sys/conf/files.amd64 Mon Jan 12 15:48:22 2009 (r187099)
@@ -149,6 +149,7 @@ dev/atkbdc/atkbdc_isa.c optional atkbdc
dev/atkbdc/atkbdc_subr.c optional atkbdc
dev/atkbdc/psm.c optional psm atkbdc
dev/coretemp/coretemp.c optional coretemp
+dev/cpuctl/cpuctl.c optional cpuctl
# There are no systems with isa slots, so all ed isa entries should go..
dev/ed/if_ed_3c503.c optional ed isa ed_3c503
dev/ed/if_ed_isa.c optional ed isa
Modified: stable/7/sys/conf/files.i386
==============================================================================
--- stable/7/sys/conf/files.i386 Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/sys/conf/files.i386 Mon Jan 12 15:48:22 2009 (r187099)
@@ -161,6 +161,7 @@ dev/cm/if_cm_isa.c optional cm isa
dev/coretemp/coretemp.c optional coretemp
dev/cp/cpddk.c optional cp
dev/cp/if_cp.c optional cp
+dev/cpuctl/cpuctl.c optional cpuctl
dev/ctau/ctau.c optional ctau
dev/ctau/ctddk.c optional ctau
dev/ctau/if_ct.c optional ctau
Modified: stable/7/sys/dev/cpuctl/cpuctl.c
==============================================================================
--- head/sys/dev/cpuctl/cpuctl.c Fri Aug 8 16:26:53 2008 (r181430)
+++ stable/7/sys/dev/cpuctl/cpuctl.c Mon Jan 12 15:48:22 2009 (r187099)
@@ -80,7 +80,7 @@ static MALLOC_DEFINE(M_CPUCTL, "cpuctl",
static struct cdevsw cpuctl_cdevsw = {
.d_version = D_VERSION,
- .d_flags = D_NEEDMINOR,
+ .d_flags = 0,
.d_open = cpuctl_open,
.d_ioctl = cpuctl_ioctl,
.d_name = "cpuctl",
Modified: stable/7/sys/i386/conf/NOTES
==============================================================================
--- stable/7/sys/i386/conf/NOTES Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/sys/i386/conf/NOTES Mon Jan 12 15:48:22 2009 (r187099)
@@ -1102,6 +1102,12 @@ device i4bcapi
#---------------------------------------------------------------------------
#
+# CPU control pseudo-device. Provides access to MSRs, CPUID info and
+# microcode update feature.
+#
+device cpuctl
+
+#
# System Management Bus (SMB)
#
options ENABLE_ALART # Control alarm on Intel intpm driver
Modified: stable/7/sys/i386/i386/support.s
==============================================================================
--- stable/7/sys/i386/i386/support.s Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/sys/i386/i386/support.s Mon Jan 12 15:48:22 2009 (r187099)
@@ -1568,3 +1568,52 @@ NON_GPROF_ENTRY(__bb_init_func)
movl %edx,16(%eax)
movl %eax,bbhead
NON_GPROF_RET
+
+/*
+ * Support for reading MSRs in the safe manner.
+ */
+ENTRY(rdmsr_safe)
+/* int rdmsr_safe(u_int msr, uint64_t *data) */
+ movl PCPU(CURPCB),%ecx
+ movl $msr_onfault,PCB_ONFAULT(%ecx)
+
+ movl 4(%esp),%ecx
+ rdmsr
+ movl 8(%esp),%ecx
+ movl %eax,(%ecx)
+ movl %edx,4(%ecx)
+ xorl %eax,%eax
+
+ movl PCPU(CURPCB),%ecx
+ movl %eax,PCB_ONFAULT(%ecx)
+
+ ret
+
+/*
+ * Support for writing MSRs in the safe manner.
+ */
+ENTRY(wrmsr_safe)
+/* int wrmsr_safe(u_int msr, uint64_t data) */
+ movl PCPU(CURPCB),%ecx
+ movl $msr_onfault,PCB_ONFAULT(%ecx)
+
+ movl 4(%esp),%ecx
+ movl 8(%esp),%eax
+ movl 12(%esp),%edx
+ wrmsr
+ xorl %eax,%eax
+
+ movl PCPU(CURPCB),%ecx
+ movl %eax,PCB_ONFAULT(%ecx)
+
+ ret
+
+/*
+ * MSR operations fault handler
+ */
+ ALIGN_TEXT
+msr_onfault:
+ movl PCPU(CURPCB),%ecx
+ movl $0,PCB_ONFAULT(%ecx)
+ movl $EFAULT,%eax
+ ret
Modified: stable/7/sys/i386/include/cpufunc.h
==============================================================================
--- stable/7/sys/i386/include/cpufunc.h Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/sys/i386/include/cpufunc.h Mon Jan 12 15:48:22 2009 (r187099)
@@ -735,4 +735,9 @@ void wrmsr(u_int msr, uint64_t newval);
void reset_dbregs(void);
+#ifdef _KERNEL
+int rdmsr_safe(u_int msr, uint64_t *val);
+int wrmsr_safe(u_int msr, uint64_t newval);
+#endif
+
#endif /* !_MACHINE_CPUFUNC_H_ */
Modified: stable/7/sys/i386/include/specialreg.h
==============================================================================
--- stable/7/sys/i386/include/specialreg.h Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/sys/i386/include/specialreg.h Mon Jan 12 15:48:22 2009 (r187099)
@@ -163,6 +163,12 @@
#define AMDID_CMP_CORES 0x000000ff
/*
+ * CPUID manufacturers identifiers
+ */
+#define INTEL_VENDOR_ID "GenuineIntel"
+#define AMD_VENDOR_ID "AuthenticAMD"
+
+/*
* Model-specific registers for the i386 family
*/
#define MSR_P5_MC_ADDR 0x000
@@ -450,6 +456,7 @@
/* AMD64 MSR's */
#define MSR_EFER 0xc0000080 /* extended features */
+#define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */
/* VIA ACE crypto featureset: for via_feature_rng */
#define VIA_HAS_RNG 1 /* cpu has RNG */
Modified: stable/7/sys/modules/Makefile
==============================================================================
--- stable/7/sys/modules/Makefile Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/sys/modules/Makefile Mon Jan 12 15:48:22 2009 (r187099)
@@ -61,6 +61,7 @@ SUBDIR= ${_3dfx} \
${_coff} \
${_coretemp} \
${_cp} \
+ ${_cpuctl} \
${_cpufreq} \
${_crypto} \
${_cryptodev} \
@@ -390,6 +391,7 @@ _cbb= cbb
_ce= ce
_coff= coff
_cp= cp
+_cpuctl= cpuctl
_cpufreq= cpufreq
_cs= cs
.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
@@ -525,6 +527,7 @@ _cbb= cbb
_cmx= cmx
_ciss= ciss
_coretemp= coretemp
+_cpuctl= cpuctl
_cpufreq= cpufreq
.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
_cyclic= cyclic
Copied: stable/7/sys/sys/cpuctl.h (from r181430, head/sys/sys/cpuctl.h)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/sys/sys/cpuctl.h Mon Jan 12 15:48:22 2009 (r187099, copy of r181430, head/sys/sys/cpuctl.h)
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2006-2008 Stanislav Sedov
+ * 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 THE 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 THE 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 _CPUCTL_H_
+#define _CPUCTL_H_
+
+typedef struct {
+ int msr; /* MSR to read */
+ uint64_t data;
+} cpuctl_msr_args_t;
+
+typedef struct {
+ int level; /* CPUID level */
+ uint32_t data[4];
+} cpuctl_cpuid_args_t;
+
+typedef struct {
+ void *data;
+ size_t size;
+} cpuctl_update_args_t;
+
+#define CPUCTL_RDMSR _IOWR('c', 1, cpuctl_msr_args_t)
+#define CPUCTL_WRMSR _IOWR('c', 2, cpuctl_msr_args_t)
+#define CPUCTL_CPUID _IOWR('c', 3, cpuctl_cpuid_args_t)
+#define CPUCTL_UPDATE _IOWR('c', 4, cpuctl_update_args_t)
+
+#endif /* _CPUCTL_H_ */
Modified: stable/7/sys/sys/priv.h
==============================================================================
--- stable/7/sys/sys/priv.h Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/sys/sys/priv.h Mon Jan 12 15:48:22 2009 (r187099)
@@ -455,9 +455,15 @@
#define PRIV_NNPFS_DEBUG 630 /* Perforn ARLA_VIOC_NNPFSDEBUG. */
/*
+ * cpuctl(4) privileges.
+ */
+#define PRIV_CPUCTL_WRMSR 640 /* Write model-specific register. */
+#define PRIV_CPUCTL_UPDATE 641 /* Update cpu microcode. */
+
+/*
* Track end of privilege list.
*/
-#define _PRIV_HIGHEST 631
+#define _PRIV_HIGHEST 642
/*
* Validate that a named privilege is known by the privilege system. Invalid
Modified: stable/7/usr.sbin/Makefile
==============================================================================
--- stable/7/usr.sbin/Makefile Mon Jan 12 13:12:02 2009 (r187098)
+++ stable/7/usr.sbin/Makefile Mon Jan 12 15:48:22 2009 (r187099)
@@ -34,6 +34,7 @@ SUBDIR= ac \
ckdist \
clear_locks \
config \
+ ${_cpucontrol} \
crashinfo \
cron \
crunch \
@@ -302,6 +303,7 @@ _apm= apm
_apmd= apmd
_asf= asf
_btxld= btxld
+_cpucontrol= cpucontrol
.if ${MK_I4B} != "no"
_i4b= i4b
.endif
@@ -340,6 +342,7 @@ _acpi= acpi
_asf= asf
_boot0cfg= boot0cfg
_btxld= btxld
+_cpucontrol= cpucontrol
_kgmon= kgmon
_lptcontrol= lptcontrol
.if ${MK_NCP} != "no"
Modified: stable/7/usr.sbin/cpucontrol/cpucontrol.8
==============================================================================
--- head/usr.sbin/cpucontrol/cpucontrol.8 Fri Aug 8 16:26:53 2008 (r181430)
+++ stable/7/usr.sbin/cpucontrol/cpucontrol.8 Mon Jan 12 15:48:22 2009 (r187099)
@@ -55,33 +55,36 @@ device.
.Sh DESCRIPTION
The
.Nm
-utility can be used to read and write an arbitrary machine-specific
-CPU registers via
+utility can be used to read and write arbitrary machine-specific
+CPU registers via the
.Xr cpuctl 4
-controlled special device and apply the CPU firmware updates.
+special device.
+It can also be used to apply CPU firmware updates.
.Pp
The following options are available:
.Bl -tag -width indent
.It Fl d Ar datadir
-Where to look for microcode images. The option can be specified multiple times.
+Where to look for microcode images.
+The option can be specified multiple times.
.It Fl m Ar msr Ns Op = Ns Ar value
-Read/write the specified MSR. Both the MSR and the value should be given as a hex number.
+Read/write the specified MSR.
+Both the MSR and the value should be given as a hex number.
.It Fl i Ar level
-Retrieve CPUID info. Level should be given as a hex number.
+Retrieve CPUID info.
+Level should be given as a hex number.
.It Fl u
-Apply CPU firmware updates. The
+Apply CPU firmware updates.
+The
.Nm
utility will walk through the configured data directories
-and will apply all firmware patches available for this CPU.
+and apply all firmware updates available for this CPU.
.It Fl v
Increase the verbosity level.
.It Fl h
Show help message.
.El
.Sh EXIT STATUS
-The
-.Nm
-utility exits 0 on success, and >0 if an error occurs.
+.Ex -std
.Sh EXAMPLES
The command
.Pp
@@ -93,20 +96,24 @@ To set the CPU 0 TSC MSR register value
.Pp
.Dq Li "cpucontrol -m 0x10=0x1 /dev/cpuctl0"
.Pp
-.Pp
The command
.Pp
.Dq Li "cpucontrol -i 0x1 /dev/cpuctl1"
.Pp
will retrieve the CPUID level 0x1 from CPU 1.
.Pp
-To perform firmware updated on CPU 0 from images located at
+To perform firmware updates on CPU 0 from images located at
.Pa /usr/local/share/cpuctl/
use the following command:
.Pp
.Dq Li "cpucontrol -d /usr/local/share/cpuctl/ -u /dev/cpuctl0"
.Sh SEE ALSO
.Xr cpuctl 4
+.Sh HISTORY
+The
+.Nm
+utility first appeared in
+.Fx 8.0 .
.Sh BUGS
Yes, probably, report if any.
.Sh AUTHORS
Modified: stable/7/usr.sbin/cpucontrol/cpucontrol.c
==============================================================================
--- head/usr.sbin/cpucontrol/cpucontrol.c Fri Aug 8 16:26:53 2008 (r181430)
+++ stable/7/usr.sbin/cpucontrol/cpucontrol.c Mon Jan 12 15:48:22 2009 (r187099)
@@ -146,12 +146,12 @@ do_cpuid(const char *cmdarg, const char
args.level = level;
fd = open(dev, O_RDONLY);
if (fd < 0) {
- WARNX(0, "error opening %s for reading", dev);
+ WARN(0, "error opening %s for reading", dev);
return (1);
}
error = ioctl(fd, CPUCTL_CPUID, &args);
if (error < 0) {
- WARNX(0, "ioctl(%s, CPUCTL_CPUID)", dev);
+ WARN(0, "ioctl(%s, CPUCTL_CPUID)", dev);
close(fd);
return (error);
}
@@ -198,13 +198,13 @@ do_msr(const char *cmdarg, const char *d
args.msr = msr;
fd = open(dev, wr == 0 ? O_RDONLY : O_WRONLY);
if (fd < 0) {
- WARNX(0, "error opening %s for %s", dev,
+ WARN(0, "error opening %s for %s", dev,
wr == 0 ? "reading" : "writing");
return (1);
}
error = ioctl(fd, wr == 0 ? CPUCTL_RDMSR : CPUCTL_WRMSR, &args);
if (error < 0) {
- WARNX(0, "ioctl(%s, %s)", dev,
+ WARN(0, "ioctl(%s, %s)", dev,
wr == 0 ? "CPUCTL_RDMSR" : "CPUCTL_WRMSR");
close(fd);
return (1);
@@ -230,7 +230,7 @@ do_update(const char *dev)
fd = open(dev, O_RDONLY);
if (fd < 0) {
- WARNX(0, "error opening %s for reading", dev);
+ WARN(0, "error opening %s for reading", dev);
return (1);
}
From sam at FreeBSD.org Mon Jan 12 09:19:20 2009
From: sam at FreeBSD.org (Sam Leffler)
Date: Mon Jan 12 09:19:29 2009
Subject: svn commit: r187106 - in stable/7: etc etc/periodic/daily
etc/periodic/monthly etc/periodic/security
etc/periodic/weekly gnu gnu/usr.bin lib libexec sbin share
share/mk tools/build tools/build/opti...
Message-ID: <200901121719.n0CHJIW0071709@svn.freebsd.org>
Author: sam
Date: Mon Jan 12 17:19:17 2009
New Revision: 187106
URL: http://svn.freebsd.org/changeset/base/187106
Log:
sync build infrastructure changes with HEAD
Reviewed by: imp
Added:
stable/7/tools/build/options/WITHOUT_ACCT
- copied unchanged from r183242, head/tools/build/options/WITHOUT_ACCT
stable/7/tools/build/options/WITHOUT_AMD
- copied unchanged from r183242, head/tools/build/options/WITHOUT_AMD
stable/7/tools/build/options/WITHOUT_APM
- copied unchanged from r183242, head/tools/build/options/WITHOUT_APM
stable/7/tools/build/options/WITHOUT_AT
- copied unchanged from r183242, head/tools/build/options/WITHOUT_AT
stable/7/tools/build/options/WITHOUT_CTM
- copied unchanged from r183242, head/tools/build/options/WITHOUT_CTM
stable/7/tools/build/options/WITHOUT_FREEBSD_UPDATE
- copied unchanged from r183242, head/tools/build/options/WITHOUT_FREEBSD_UPDATE
stable/7/tools/build/options/WITHOUT_IPFW
- copied unchanged from r183242, head/tools/build/options/WITHOUT_IPFW
stable/7/tools/build/options/WITHOUT_JAIL
- copied unchanged from r183242, head/tools/build/options/WITHOUT_JAIL
stable/7/tools/build/options/WITHOUT_LEGACY_CONSOLE
- copied unchanged from r183242, head/tools/build/options/WITHOUT_LEGACY_CONSOLE
stable/7/tools/build/options/WITHOUT_LOCATE
- copied unchanged from r183242, head/tools/build/options/WITHOUT_LOCATE
stable/7/tools/build/options/WITHOUT_MAIL
- copied unchanged from r183242, head/tools/build/options/WITHOUT_MAIL
stable/7/tools/build/options/WITHOUT_MAKE
- copied unchanged from r183242, head/tools/build/options/WITHOUT_MAKE
stable/7/tools/build/options/WITHOUT_NDIS
- copied unchanged from r183242, head/tools/build/options/WITHOUT_NDIS
stable/7/tools/build/options/WITHOUT_NETGRAPH
- copied unchanged from r183242, head/tools/build/options/WITHOUT_NETGRAPH
stable/7/tools/build/options/WITHOUT_NTP
- copied unchanged from r183242, head/tools/build/options/WITHOUT_NTP
stable/7/tools/build/options/WITHOUT_PKGTOOLS
- copied unchanged from r183242, head/tools/build/options/WITHOUT_PKGTOOLS
stable/7/tools/build/options/WITHOUT_PMC
- copied unchanged from r183242, head/tools/build/options/WITHOUT_PMC
stable/7/tools/build/options/WITHOUT_PORTSNAP
- copied unchanged from r183242, head/tools/build/options/WITHOUT_PORTSNAP
stable/7/tools/build/options/WITHOUT_PPP
- copied unchanged from r183242, head/tools/build/options/WITHOUT_PPP
stable/7/tools/build/options/WITHOUT_QUOTAS
- copied unchanged from r183242, head/tools/build/options/WITHOUT_QUOTAS
stable/7/tools/build/options/WITHOUT_ROUTED
- copied unchanged from r183242, head/tools/build/options/WITHOUT_ROUTED
stable/7/tools/build/options/WITHOUT_SLIP
- copied unchanged from r183242, head/tools/build/options/WITHOUT_SLIP
stable/7/tools/build/options/WITHOUT_SYSINSTALL
- copied unchanged from r183242, head/tools/build/options/WITHOUT_SYSINSTALL
stable/7/tools/build/options/WITHOUT_TELNET
- copied unchanged from r183242, head/tools/build/options/WITHOUT_TELNET
stable/7/tools/build/options/WITHOUT_TEXTPROC
- copied unchanged from r183242, head/tools/build/options/WITHOUT_TEXTPROC
stable/7/tools/build/options/WITHOUT_WIRELESS
- copied unchanged from r183242, head/tools/build/options/WITHOUT_WIRELESS
Modified:
stable/7/etc/ (props changed)
stable/7/etc/Makefile
stable/7/etc/periodic/daily/Makefile
stable/7/etc/periodic/monthly/Makefile
stable/7/etc/periodic/security/Makefile
stable/7/etc/periodic/weekly/Makefile
stable/7/gnu/ (props changed)
stable/7/gnu/usr.bin/Makefile
stable/7/lib/ (props changed)
stable/7/lib/Makefile
stable/7/libexec/ (props changed)
stable/7/libexec/Makefile
stable/7/sbin/ (props changed)
stable/7/sbin/Makefile
stable/7/share/ (props changed)
stable/7/share/Makefile
stable/7/share/mk/ (props changed)
stable/7/share/mk/bsd.own.mk
stable/7/tools/build/ (props changed)
stable/7/usr.bin/ (props changed)
stable/7/usr.bin/Makefile
stable/7/usr.sbin/ (props changed)
stable/7/usr.sbin/Makefile
Modified: stable/7/etc/Makefile
==============================================================================
--- stable/7/etc/Makefile Mon Jan 12 17:18:58 2009 (r187105)
+++ stable/7/etc/Makefile Mon Jan 12 17:19:17 2009 (r187106)
@@ -7,22 +7,19 @@
SUBDIR= sendmail
.endif
-BIN1= amd.map apmd.conf auth.conf \
- crontab csh.cshrc csh.login csh.logout devd.conf devfs.conf \
- ddb.conf dhclient.conf disktab fbtab freebsd-update.conf \
+BIN1= auth.conf \
+ crontab devd.conf devfs.conf \
+ ddb.conf dhclient.conf disktab fbtab \
ftpusers gettytab group \
- hosts hosts.allow hosts.equiv hosts.lpd \
+ hosts hosts.allow hosts.equiv \
inetd.conf libalias.conf login.access login.conf mac.conf motd \
netconfig network.subr networks newsyslog.conf nsswitch.conf \
- portsnap.conf pf.os phones profile protocols \
+ phones profile protocols \
rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \
rc.sendmail rc.shutdown \
rc.subr remote rpc services shells \
- snmpd.config sysctl.conf syslog.conf \
- etc.${MACHINE_ARCH}/ttys \
- ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
- ${.CURDIR}/../usr.bin/mail/misc/mail.rc \
- ${.CURDIR}/../usr.bin/locate/locate/locate.rc
+ sysctl.conf syslog.conf \
+ etc.${MACHINE_ARCH}/ttys
OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
@@ -32,12 +29,38 @@ BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/
BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
BSM_ETC_DIR= ${DESTDIR}/etc/security
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_AMD} != "no"
+BIN1+= amd.map
+.endif
+
+.if ${MK_APM} != "no"
+BIN1+= apmd.conf
+.endif
+
+.if ${MK_BSNMP} != "no"
+BIN1+= snmpd.config
+.endif
+
+.if ${MK_FREEBSD_UPDATE} != "no"
+BIN1+= freebsd-update.conf
+.endif
+
+.if ${MK_LOCATE} != "no"
+BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
+.endif
+
.if ${MK_LPR} != "no"
-BIN1+= printcap
+BIN1+= hosts.lpd printcap
.endif
-.if ${MK_NS_CACHING} != "no"
-BIN1+= nscd.conf
+.if ${MK_MAIL} != "no"
+BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
+.endif
+
+.if ${MK_MAN} != "no"
+BIN1+= ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config
.endif
.if ${MK_OPENSSH} != "no"
@@ -49,6 +72,22 @@ SSH= ${.CURDIR}/../crypto/openssh/ssh_co
SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
.endif
+.if ${MK_NS_CACHING} != "no"
+BIN1+= nscd.conf
+.endif
+
+.if ${MK_PORTSNAP} != "no"
+BIN1+= portsnap.conf
+.endif
+
+.if ${MK_PF} != "no"
+BIN1+= pf.os
+.endif
+
+.if ${MK_TCSH} != "no"
+BIN1+= csh.cshrc csh.login csh.logout
+.endif
+
# -rwxr-xr-x root:wheel, for the new cron root:wheel
BIN2= netstart pccard_ether rc.suspend rc.resume
@@ -109,10 +148,15 @@ distribution:
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
${BIN2} ${DESTDIR}/etc; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
- master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
- pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
- ${DESTDIR}/etc/master.passwd
+ master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
+.if ${MK_TCSH} == "no"
+ sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
+.endif
+ pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
+ ${DESTDIR}/etc/master.passwd
+.if ${MK_BLUETOOTH} != "no"
${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
+.endif
${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
${_+_}cd ${.CURDIR}/gss; ${MAKE} install
${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
@@ -157,18 +201,25 @@ distribution:
.endif
cd ${.CURDIR}/root; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
+ dot.profile ${DESTDIR}/root/.profile; \
+ rm -f ${DESTDIR}/.profile; \
+ ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
+.if ${MK_TCSH} != "no"
+ cd ${.CURDIR}/root; \
+ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
dot.cshrc ${DESTDIR}/root/.cshrc; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
dot.login ${DESTDIR}/root/.login; \
- ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
- dot.profile ${DESTDIR}/root/.profile; \
- rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
- ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
- ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
+ rm -f ${DESTDIR}/.cshrc; \
+ ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
+.endif
cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
${MTREE} ${DESTDIR}/etc/mtree
+.if ${MK_PPP} != "no"
cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
${PPPCNF} ${DESTDIR}/etc/ppp
+.endif
+.if ${MK_MAIL} != "no"
cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
${ETCMAIL} ${DESTDIR}/etc/mail
@if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
@@ -176,6 +227,7 @@ distribution:
set -x; \
ln -s mail/aliases ${DESTDIR}/etc/aliases; \
fi
+.endif
${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
${DESTDIR}/etc/dumpdates
${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
Modified: stable/7/etc/periodic/daily/Makefile
==============================================================================
--- stable/7/etc/periodic/daily/Makefile Mon Jan 12 17:18:58 2009 (r187105)
+++ stable/7/etc/periodic/daily/Makefile Mon Jan 12 17:19:17 2009 (r187106)
@@ -1,15 +1,11 @@
# $FreeBSD$
+.include
+
FILES= 100.clean-disks \
110.clean-tmps \
120.clean-preserve \
- 130.clean-msgs \
- 140.clean-rwho \
- 150.clean-hoststat \
200.backup-passwd \
- 210.backup-aliases \
- 300.calendar \
- 310.accounting \
330.news \
400.status-disks \
404.status-zfs \
@@ -19,13 +15,42 @@ FILES= 100.clean-disks \
408.status-gstripe \
409.status-gconcat \
420.status-network \
- 430.status-rwho \
- 440.status-mailq \
450.status-security \
- 460.status-mail-rejects \
- 470.status-named \
- 480.status-ntpd \
- 500.queuerun \
999.local
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_ACCT} != "no"
+FILES+= 310.accounting
+.endif
+
+.if ${MK_BIND_NAMED} != "no"
+FILES+= 470.status-named
+.endif
+
+.if ${MK_CALENDAR} != "no"
+FILES+= 300.calendar
+.endif
+
+.if ${MK_MAIL} != "no"
+FILES+= 130.clean-msgs
+.endif
+
+.if ${MK_NTP} != "no"
+FILES+= 480.status-ntpd
+.endif
+
+.if ${MK_RCMDS} != "no"
+FILES+= 140.clean-rwho \
+ 430.status-rwho
+.endif
+
+.if ${MK_SENDMAIL} != "no"
+FILES+= 150.clean-hoststat \
+ 210.backup-aliases \
+ 440.status-mailq \
+ 460.status-mail-rejects \
+ 500.queuerun
+.endif
+
.include
Modified: stable/7/etc/periodic/monthly/Makefile
==============================================================================
--- stable/7/etc/periodic/monthly/Makefile Mon Jan 12 17:18:58 2009 (r187105)
+++ stable/7/etc/periodic/monthly/Makefile Mon Jan 12 17:19:17 2009 (r187106)
@@ -1,6 +1,13 @@
# $FreeBSD$
-FILES= 200.accounting \
- 999.local
+.include
+
+FILES= 999.local
+
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_ACCT} != "no"
+FILES+= 200.accounting
+.endif
.include
Modified: stable/7/etc/periodic/security/Makefile
==============================================================================
--- stable/7/etc/periodic/security/Makefile Mon Jan 12 17:18:58 2009 (r187105)
+++ stable/7/etc/periodic/security/Makefile Mon Jan 12 17:19:17 2009 (r187106)
@@ -1,17 +1,30 @@
# $FreeBSD$
+.include
+
FILES= 100.chksetuid \
200.chkmounts \
300.chkuid0 \
400.passwdless \
410.logincheck \
- 500.ipfwdenied \
- 510.ipfdenied \
- 520.pfdenied \
- 550.ipfwlimit \
700.kernelmsg \
800.loginfail \
900.tcpwrap \
security.functions
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_IPFILTER} != "no"
+FILES+= 510.ipfdenied
+.endif
+
+.if ${MK_IPFW} != "no"
+FILES+= 500.ipfwdenied \
+ 550.ipfwlimit
+.endif
+
+.if ${MK_PF} != "no"
+FILES+= 520.pfdenied
+.endif
+
.include
Modified: stable/7/etc/periodic/weekly/Makefile
==============================================================================
--- stable/7/etc/periodic/weekly/Makefile Mon Jan 12 17:18:58 2009 (r187105)
+++ stable/7/etc/periodic/weekly/Makefile Mon Jan 12 17:19:17 2009 (r187106)
@@ -1,10 +1,22 @@
# $FreeBSD$
-FILES= 310.locate \
- 320.whatis \
- 330.catman \
- 340.noid \
- 400.status-pkg \
+.include
+
+FILES= 340.noid \
999.local
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_LOCATE} != "no"
+FILES+= 310.locate
+.endif
+
+.if ${MK_MAN} != "no"
+FILES+= 320.whatis 330.catman
+.endif
+
+.if ${MK_PKGTOOLS} != "no"
+FLES+= 400.status-pkg
+.endif
+
.include
Modified: stable/7/gnu/usr.bin/Makefile
==============================================================================
--- stable/7/gnu/usr.bin/Makefile Mon Jan 12 17:18:58 2009 (r187105)
+++ stable/7/gnu/usr.bin/Makefile Mon Jan 12 17:19:17 2009 (r187106)
@@ -34,12 +34,16 @@ _groff= groff
_cvs= cvs
.endif
+.if ${MK_INFO} != "no"
+_texinfo= texinfo
+.endif
+
.if ${MK_MAN} != "no"
_man= man
.endif
-.if ${MK_INFO} != "no"
-_texinfo= texinfo
+.if ${MK_RCS} != "no"
+_rcs= rcs
.endif
.if ${MK_TOOLCHAIN} != "no"
@@ -49,8 +53,5 @@ _cc= cc
_gdb= gdb
.endif
.endif
-.if ${MK_RCS} != "no"
-_rcs= rcs
-.endif
.include
Modified: stable/7/lib/Makefile
==============================================================================
--- stable/7/lib/Makefile Mon Jan 12 17:18:58 2009 (r187105)
+++ stable/7/lib/Makefile Mon Jan 12 17:19:17 2009 (r187106)
@@ -26,17 +26,17 @@
# Otherwise, the SUBDIR list should be in alphabetical order.
SUBDIR= ${_csu} libc libbsm libcom_err libcrypt libelf libkvm msun libmd \
- ncurses libnetgraph libradius librpcsvc libsbuf libtacplus libutil \
- ${_libypclnt} libalias libarchive ${_libatm} \
- libbegemot ${_libbluetooth} libbsnmp libbz2 \
+ ncurses ${_libnetgraph} libradius librpcsvc libsbuf \
+ libtacplus libutil ${_libypclnt} libalias libarchive ${_libatm} \
+ libbegemot ${_libbluetooth} ${_libbsnmp} libbz2 \
libcalendar libcam libcompat libdevinfo libdevstat libdisk \
libdwarf libedit libexpat libfetch libftpio libgeom ${_libgpib} \
${_libgssapi} libipsec \
${_libipx} libkiconv libmagic libmemstat ${_libmilter} ${_libmp} \
${_libncp} ${_libngatm} libopie libpam libpcap \
- libpmc libproc ${_libkse} librt ${_libsdp} ${_libsm} ${_libsmb} \
+ ${_libpmc} libproc ${_libkse} librt ${_libsdp} ${_libsm} ${_libsmb} \
${_libsmdb} \
- ${_libsmutil} libstand libtelnet ${_libthr} libthread_db libufs \
+ ${_libsmutil} libstand ${_libtelnet} ${_libthr} libthread_db libufs \
libugidfw ${_libusbhid} ${_libvgl} libwrap liby libz ${_bind}
.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
@@ -47,6 +47,8 @@ _csu=csu/${MACHINE_ARCH}
_csu=csu
.endif
+# NB: keep these sorted by MK_* knobs
+
.if ${MK_ATM} != "no"
_libngatm= libngatm
.endif
@@ -60,6 +62,14 @@ _libbluetooth= libbluetooth
_libsdp= libsdp
.endif
+.if ${MK_BSNMP} != "no"
+_libbsnmp= libbsnmp
+.endif
+
+.if ${MK_GPIB} != "no"
+_libgpib= libgpib
+.endif
+
.if ${MK_GSSAPI} != "no"
_libgssapi= libgssapi
.endif
@@ -68,6 +78,22 @@ _libgssapi= libgssapi
_libipx= libipx
.endif
+.if ${MK_LIBKSE} != "no"
+_libkse= libkse
+.endif
+
+.if ${MK_LIBTHR} != "no"
+_libthr= libthr
+.endif
+
+.if ${MK_NETGRAPH} != "no"
+_libnetgraph= libnetgraph
+.endif
+
+.if ${MK_NIS} != "no"
+_libypclnt= libypclnt
+.endif
+
.if ${MACHINE_ARCH} == "i386"
.if ${MK_NCP} != "no"
_libncp= libncp
@@ -80,17 +106,6 @@ _libvgl= libvgl
_libsmb= libsmb
.endif
-.if ${MK_SENDMAIL} != "no"
-_libmilter= libmilter
-_libsm= libsm
-_libsmdb= libsmdb
-_libsmutil= libsmutil
-.endif
-
-.if ${MK_OPENSSL} != "no"
-_libmp= libmp
-.endif
-
.if ${MACHINE_ARCH} == "amd64"
.if ${MK_NCP} != "no"
_libncp= libncp
@@ -102,24 +117,27 @@ _libsmb= libsmb
_libsmb= libsmb
.endif
-.if ${MK_LIBKSE} != "no"
-_libkse= libkse
+.if ${MK_OPENSSL} != "no"
+_libmp= libmp
.endif
-.if ${MK_LIBTHR} != "no"
-_libthr= libthr
+.if ${MK_PMC} != "no"
+_libpmc= libpmc
.endif
-.if ${MK_USB} != "no"
-_libusbhid= libusbhid
+.if ${MK_SENDMAIL} != "no"
+_libmilter= libmilter
+_libsm= libsm
+_libsmdb= libsmdb
+_libsmutil= libsmutil
.endif
-.if ${MK_NIS} != "no"
-_libypclnt= libypclnt
+.if ${MK_TELNET} != "no"
+_libtelnet= libtelnet
.endif
-.if ${MK_GPIB} != "no"
-_libgpib= libgpib
+.if ${MK_USB} != "no"
+_libusbhid= libusbhid
.endif
.include
Modified: stable/7/libexec/Makefile
==============================================================================
--- stable/7/libexec/Makefile Mon Jan 12 17:18:58 2009 (r187105)
+++ stable/7/libexec/Makefile Mon Jan 12 17:19:17 2009 (r187106)
@@ -3,9 +3,9 @@
.include
-SUBDIR= atrun \
+SUBDIR= ${_atrun} \
bootpd \
- comsat \
+ ${_comsat} \
fingerd \
ftpd \
getty \
@@ -13,7 +13,7 @@ SUBDIR= atrun \
${_mail.local} \
makekey \
${_mknetid} \
- pppoed \
+ ${_pppoed} \
pt_chown \
rbootd \
revnetgroup \
@@ -29,16 +29,28 @@ SUBDIR= atrun \
${_smrsh} \
talkd \
tcpd \
- telnetd \
+ ${_telnetd} \
tftpd \
${_tftp-proxy} \
${_ypxfr}
+.if ${MK_AT} != "no"
+_atrun= atrun
+.endif
+
+.if ${MK_MAIL} != "no"
+_comsat= comsat
+.endif
+
.if ${MK_NIS} != "no"
_mknetid= mknetid
_ypxfr= ypxfr
.endif
+.if ${MK_NETGRAPH} != "no"
+_pppoed= pppoed
+.endif
+
.if ${MK_PF} != "no"
_tftp-proxy= tftp-proxy
.endif
@@ -54,7 +66,11 @@ _rshd= rshd
.if ${MK_SENDMAIL} != "no"
_mail.local= mail.local
-_smrsh= smrsh
+_smrsh= smrsh
+.endif
+
+.if ${MK_TELNET} != "no"
+_telnetd= telnetd
.endif
.include
Modified: stable/7/sbin/Makefile
==============================================================================
--- stable/7/sbin/Makefile Mon Jan 12 17:18:58 2009 (r187105)
+++ stable/7/sbin/Makefile Mon Jan 12 17:19:17 2009 (r187106)
@@ -41,7 +41,7 @@ SUBDIR= adjkerntz \
ifconfig \
init \
${_ipf} \
- ipfw \
+ ${_ipfw} \
iscontrol \
kldconfig \
kldload \
@@ -62,7 +62,7 @@ SUBDIR= adjkerntz \
mount_nullfs \
mount_udf \
mount_unionfs \
- natd \
+ ${_natd} \
newfs \
newfs_msdos \
nfsiod \
@@ -71,13 +71,13 @@ SUBDIR= adjkerntz \
${_pflogd} \
ping \
${_ping6} \
- quotacheck \
+ ${_quotacheck} \
rcorder \
reboot \
recoverdisk \
restore \
route \
- routed \
+ ${_routed} \
${_rtsol} \
savecore \
${_sconfig} \
@@ -85,7 +85,7 @@ SUBDIR= adjkerntz \
shutdown \
slattach \
spppcontrol \
- startslip \
+ ${_startslip} \
sunlabel \
swapon \
sysctl \
@@ -104,6 +104,11 @@ _devd= devd
_ipf= ipf
.endif
+.if ${MK_IPFW} != "no"
+_ipfw= ipfw
+_natd= natd
+.endif
+
.if ${MK_PF} != "no"
_pfctl= pfctl
_pflogd= pflogd
@@ -114,6 +119,18 @@ _ping6= ping6
_rtsol= rtsol
.endif
+.if ${MK_QUOTAS} != "no"
+_quotacheck= quotacheck
+.endif
+
+.if ${MK_ROUTED} != "no"
+_routed= routed
+.endif
+
+.if ${MK_SLIP} != "no"
+_startslip= startslip
+.endif
+
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE} == "i386"
_fdisk= fdisk
Modified: stable/7/share/Makefile
==============================================================================
--- stable/7/share/Makefile Mon Jan 12 17:18:58 2009 (r187105)
+++ stable/7/share/Makefile Mon Jan 12 17:19:17 2009 (r187106)
@@ -13,51 +13,57 @@ SUBDIR= ${_colldef} \
${_man} \
${_me} \
misc \
- mk \
+ ${_mk} \
${_mklocale} \
${_monetdef} \
${_msgdef} \
${_numericdef} \
${_sendmail} \
skel \
- snmp \
+ ${_snmp} \
${_syscons} \
tabset \
termcap \
${_timedef} \
${_zoneinfo}
-.if ${MK_LOCALES} != "no"
-_colldef = colldef
-_mklocale = mklocale
-_monetdef = monetdef
-_msgdef = msgdef
-_numericdef = numericdef
-_timedef = timedef
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_BSNMP} != "no"
+_snmp= snmp
.endif
-.if ${MK_SYSCONS} != "no"
-_syscons= syscons
+.if ${MK_DICT} != "no"
+_dict= dict
.endif
-.if ${MK_MAN} != "no"
-_man= man
+.if ${MK_EXAMPLES} != "no"
+_examples= examples
.endif
.if ${MK_GROFF} != "no"
_me= me
.endif
-.if ${MK_EXAMPLES} != "no"
-_examples= examples
-.endif
-
.if ${MK_I4B} != "no"
_isdn= isdn
.endif
-.if ${MK_DICT} != "no"
-_dict= dict
+.if ${MK_LOCALES} != "no"
+_colldef = colldef
+_mklocale = mklocale
+_monetdef = monetdef
+_msgdef = msgdef
+_numericdef = numericdef
+_timedef = timedef
+.endif
+
+.if ${MK_MAKE} != "no"
+_mk= mk
+.endif
+
+.if ${MK_MAN} != "no"
+_man= man
.endif
.if ${MK_SENDMAIL} != "no"
@@ -68,6 +74,10 @@ _sendmail= sendmail
_doc= doc
.endif
+.if ${MK_SYSCONS} != "no"
+_syscons= syscons
+.endif
+
.if ${MK_ZONEINFO} != "no"
_zoneinfo= zoneinfo
.endif
Modified: stable/7/share/mk/bsd.own.mk
==============================================================================
--- stable/7/share/mk/bsd.own.mk Mon Jan 12 17:18:58 2009 (r187105)
+++ stable/7/share/mk/bsd.own.mk Mon Jan 12 17:19:17 2009 (r187106)
@@ -285,8 +285,12 @@ WITH_IDEA=
# MK_* options which default to "yes".
#
.for var in \
+ ACCT \
ACPI \
+ AMD \
+ APM \
ASSERT_DEBUG \
+ AT \
ATM \
AUDIT \
AUTHPF \
@@ -299,18 +303,22 @@ WITH_IDEA=
BIND_UTILS \
BLUETOOTH \
BOOT \
+ BSNMP \
BZIP2 \
CALENDAR \
CDDL \
CPP \
CRYPT \
+ CTM \
CVS \
CXX \
DICT \
DYNAMICROOT \
EXAMPLES \
+ FLOPPY \
FORTH \
FP_LIBC \
+ FREEBSD_UPDATE \
GAMES \
GCOV \
GDB \
@@ -323,41 +331,61 @@ WITH_IDEA=
INFO \
INSTALLLIB \
IPFILTER \
+ IPFW \
IPX \
+ JAIL \
KERBEROS \
KVM \
+ LEGACY_CONSOLE \
LIB32 \
LIBPTHREAD \
LIBKSE \
LIBTHR \
LOCALES \
+ LOCATE \
LPR \
+ MAIL \
MAILWRAPPER \
+ MAKE \
MAN \
NCP \
+ NDIS \
NETCAT \
+ NETGRAPH \
NIS \
NLS \
NLS_CATALOGS \
NS_CACHING \
+ NTP \
OBJC \
OPENSSH \
OPENSSL \
PAM \
PF \
+ PKGTOOLS \
+ PMC \
+ PORTSNAP \
+ PPP \
PROFILE \
+ QUOTAS \
RCMDS \
RCS \
RESCUE \
+ ROUTED \
SENDMAIL \
SETUID_LOGIN \
SHAREDOCS \
+ SLIP \
SSP \
+ SYSINSTALL \
SYMVER \
SYSCONS \
TCSH \
+ TELNET \
+ TEXTPROC \
TOOLCHAIN \
USB \
+ WIRELESS \
WPA_SUPPLICANT_EAPOL \
ZONEINFO \
ZFS
@@ -435,6 +463,11 @@ MK_KERBEROS:= no
MK_NCP:= no
.endif
+.if ${MK_MAIL} == "no"
+MK_MAILWRAPPER:= no
+MK_SENDMAIL:= no
+.endif
+
.if ${MK_OPENSSL} == "no"
MK_OPENSSH:= no
MK_KERBEROS:= no
@@ -444,6 +477,10 @@ MK_KERBEROS:= no
MK_AUTHPF:= no
.endif
+.if ${MK_TEXTPROC} == "no"
+MK_GROFF:= no
+.endif
+
.if ${MK_TOOLCHAIN} == "no"
MK_GDB:= no
.endif
@@ -463,7 +500,9 @@ MK_GDB:= no
IPX \
KERBEROS \
KVM \
- PAM
+ NETGRAPH \
+ PAM \
+ WIRELESS
.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
.endif
Copied: stable/7/tools/build/options/WITHOUT_ACCT (from r183242, head/tools/build/options/WITHOUT_ACCT)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_ACCT Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_ACCT)
@@ -0,0 +1,5 @@
+.\" $FreeBSD$
+Set to not build process accounting tools such as
+.Xr ac 8
+and
+.Xr accton 8 .
Copied: stable/7/tools/build/options/WITHOUT_AMD (from r183242, head/tools/build/options/WITHOUT_AMD)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_AMD Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_AMD)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr amd 8 ,
+and related programs.
Copied: stable/7/tools/build/options/WITHOUT_APM (from r183242, head/tools/build/options/WITHOUT_APM)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_APM Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_APM)
@@ -0,0 +1,5 @@
+.\" $FreeBSD$
+Set to not build
+.Xr apm 8 ,
+.Xr apmd 8
+and related programs.
Copied: stable/7/tools/build/options/WITHOUT_AT (from r183242, head/tools/build/options/WITHOUT_AT)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_AT Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_AT)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr at 1
+and related utilities.
Copied: stable/7/tools/build/options/WITHOUT_CTM (from r183242, head/tools/build/options/WITHOUT_CTM)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_CTM Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_CTM)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr ctm 1
+and related utilities.
Copied: stable/7/tools/build/options/WITHOUT_FREEBSD_UPDATE (from r183242, head/tools/build/options/WITHOUT_FREEBSD_UPDATE)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_FREEBSD_UPDATE Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_FREEBSD_UPDATE)
@@ -0,0 +1,3 @@
+.\" $FreeBSD$
+Set to not build
+.Xr freebsd-update 8 .
Copied: stable/7/tools/build/options/WITHOUT_IPFW (from r183242, head/tools/build/options/WITHOUT_IPFW)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_IPFW Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_IPFW)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to not build IPFW tools.
Copied: stable/7/tools/build/options/WITHOUT_JAIL (from r183242, head/tools/build/options/WITHOUT_JAIL)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_JAIL Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_JAIL)
@@ -0,0 +1,3 @@
+.\" $FreeBSD$
+Set to not build tools for the support of jails; e.g.
+.Xr jail 8 .
Copied: stable/7/tools/build/options/WITHOUT_LEGACY_CONSOLE (from r183242, head/tools/build/options/WITHOUT_LEGACY_CONSOLE)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_LEGACY_CONSOLE Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_LEGACY_CONSOLE)
@@ -0,0 +1,5 @@
+.\" $FreeBSD$
+Set to not build programs that support a legacy PC console; e.g.
+.Xr kbdcontrol 8
+and
+.Xr vidcontrol 8 .
Copied: stable/7/tools/build/options/WITHOUT_LOCATE (from r183242, head/tools/build/options/WITHOUT_LOCATE)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_LOCATE Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_LOCATE)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr locate 1
+and related programs.
Copied: stable/7/tools/build/options/WITHOUT_MAIL (from r183242, head/tools/build/options/WITHOUT_MAIL)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_MAIL Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_MAIL)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to not build any mail support (MUA or MTA).
Copied: stable/7/tools/build/options/WITHOUT_MAKE (from r183242, head/tools/build/options/WITHOUT_MAKE)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_MAKE Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_MAKE)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not install
+.Xr make 1
+and related support files.
Copied: stable/7/tools/build/options/WITHOUT_NDIS (from r183242, head/tools/build/options/WITHOUT_NDIS)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_NDIS Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_NDIS)
@@ -0,0 +1,3 @@
+.\" $FreeBSD$
+Set to not build programs and libraries
+related to NDIS emulation support.
Copied: stable/7/tools/build/options/WITHOUT_NETGRAPH (from r183242, head/tools/build/options/WITHOUT_NETGRAPH)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_NETGRAPH Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_NETGRAPH)
@@ -0,0 +1,3 @@
+.\" $FreeBSD$
+Set to not build applications to support
+.Xr netgraph 4 .
Copied: stable/7/tools/build/options/WITHOUT_NTP (from r183242, head/tools/build/options/WITHOUT_NTP)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_NTP Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_NTP)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr ntpd 8
+and related programs.
Copied: stable/7/tools/build/options/WITHOUT_PKGTOOLS (from r183242, head/tools/build/options/WITHOUT_PKGTOOLS)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_PKGTOOLS Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_PKGTOOLS)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr pkg_add 8
+and related programs.
Copied: stable/7/tools/build/options/WITHOUT_PMC (from r183242, head/tools/build/options/WITHOUT_PMC)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_PMC Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_PMC)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr pmccontrol 8
+and related programs.
Copied: stable/7/tools/build/options/WITHOUT_PORTSNAP (from r183242, head/tools/build/options/WITHOUT_PORTSNAP)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_PORTSNAP Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_PORTSNAP)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build or install
+.Xr portsnap 8
+and related files.
Copied: stable/7/tools/build/options/WITHOUT_PPP (from r183242, head/tools/build/options/WITHOUT_PPP)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_PPP Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_PPP)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr ppp 8
+and related programs.
Copied: stable/7/tools/build/options/WITHOUT_QUOTAS (from r183242, head/tools/build/options/WITHOUT_QUOTAS)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_QUOTAS Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_QUOTAS)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr quota 8
+and related programs.
Copied: stable/7/tools/build/options/WITHOUT_ROUTED (from r183242, head/tools/build/options/WITHOUT_ROUTED)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_ROUTED Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_ROUTED)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr routed 8
+utility.
Copied: stable/7/tools/build/options/WITHOUT_SLIP (from r183242, head/tools/build/options/WITHOUT_SLIP)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_SLIP Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_SLIP)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr sliplogin 8
+and related programs.
Copied: stable/7/tools/build/options/WITHOUT_SYSINSTALL (from r183242, head/tools/build/options/WITHOUT_SYSINSTALL)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_SYSINSTALL Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_SYSINSTALL)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr sysinstall 8
+and related programs.
Copied: stable/7/tools/build/options/WITHOUT_TELNET (from r183242, head/tools/build/options/WITHOUT_TELNET)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_TELNET Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_TELNET)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr telnet 8
+and related programs.
Copied: stable/7/tools/build/options/WITHOUT_TEXTPROC (from r183242, head/tools/build/options/WITHOUT_TEXTPROC)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/7/tools/build/options/WITHOUT_TEXTPROC Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_TEXTPROC)
@@ -0,0 +1,3 @@
+.\" $FreeBSD$
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From des at des.no Mon Jan 12 09:25:17 2009
From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=)
Date: Mon Jan 12 09:25:29 2009
Subject: svn commit: r186982 - stable/7/usr.sbin/powerd
In-Reply-To: <4967E849.8070100@FreeBSD.org> (Doug Barton's message of "Fri, 09
Jan 2009 16:14:01 -0800")
References: <200901092210.n09MA7Xb070527@svn.freebsd.org>
<4967DE41.20109@FreeBSD.org> <4967E849.8070100@FreeBSD.org>
Message-ID: <86k5905u3l.fsf@ds4.des.no>
Doug Barton writes:
> For something like this it's quite simple, just do the merge in
> usr.sbin/powerd. Let's say you want to merge all the changes starting
> with r185050:
>
> Set REPO to something useful like svn+ssh://svn.freebsd.org/base/
>
> svn merge -r 185050:186476 $REPO/head/usr.sbin/powerd .
This merges everything from *185051* to 186476.
Think about it in terms of diff: 'svn diff -r185050:186476' clearly
means "compare the tree as it was after r185050 was committed with the
tree as it was after r186476 was committed"
If you want to merge the change that was committed in r185050, you need
to start at r185049.
If there aren't many revisions to merge, you can also merge them
individually with -cN, which is a shortcut for -r(N-1):N.
Perhaps I should document this better on the wiki - my examples all
merge individual revisions, not ranges.
DES
--
Dag-Erling Sm?rgrav - des@des.no
From sam at FreeBSD.org Mon Jan 12 11:16:02 2009
From: sam at FreeBSD.org (Sam Leffler)
Date: Mon Jan 12 11:16:13 2009
Subject: svn commit: r187108 - in stable/7/sys: . arm/conf conf contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901121916.n0CJG0MZ073971@svn.freebsd.org>
Author: sam
Date: Mon Jan 12 19:16:00 2009
New Revision: 187108
URL: http://svn.freebsd.org/changeset/base/187108
Log:
MFC r185478: enable use of modules but disable them by adding MODULES_OVERRIDE=""
Modified:
stable/7/sys/ (props changed)
stable/7/sys/arm/conf/AVILA
stable/7/sys/arm/conf/BWCT
stable/7/sys/arm/conf/CRB
stable/7/sys/arm/conf/EP80219
stable/7/sys/arm/conf/HL200
stable/7/sys/arm/conf/IQ31244
stable/7/sys/arm/conf/KB920X
stable/7/sys/arm/conf/SIMICS
stable/7/sys/arm/conf/SKYEYE
stable/7/sys/conf/Makefile.arm
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/arm/conf/AVILA
==============================================================================
--- stable/7/sys/arm/conf/AVILA Mon Jan 12 17:26:52 2009 (r187107)
+++ stable/7/sys/arm/conf/AVILA Mon Jan 12 19:16:00 2009 (r187108)
@@ -31,6 +31,7 @@ options STARTUP_PAGETABLE_ADDR=0x1000000
include "../xscale/ixp425/std.avila"
#To statically compile in device wiring instead of /boot/device.hints
hints "AVILA.hints" #Default places to look for devices.
+makeoptions MODULES_OVERRIDE=""
makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
makeoptions CONF_CFLAGS=-mcpu=xscale
Modified: stable/7/sys/arm/conf/BWCT
==============================================================================
--- stable/7/sys/arm/conf/BWCT Mon Jan 12 17:26:52 2009 (r187107)
+++ stable/7/sys/arm/conf/BWCT Mon Jan 12 19:16:00 2009 (r187108)
@@ -28,6 +28,7 @@ include "../at91/std.kb920x"
#To statically compile in device wiring instead of /boot/device.hints
#hints "hints.at91rm9200"
hints "BWCT.hints"
+makeoptions MODULES_OVERRIDE=""
#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
options DDB
Modified: stable/7/sys/arm/conf/CRB
==============================================================================
--- stable/7/sys/arm/conf/CRB Mon Jan 12 17:26:52 2009 (r187107)
+++ stable/7/sys/arm/conf/CRB Mon Jan 12 19:16:00 2009 (r187108)
@@ -29,6 +29,7 @@ options STARTUP_PAGETABLE_ADDR=0x0000000
include "../xscale/i8134x/std.crb"
#To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" #Default places to look for devices.
+makeoptions MODULES_OVERRIDE=""
#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
makeoptions CONF_CFLAGS=-mcpu=xscale
Modified: stable/7/sys/arm/conf/EP80219
==============================================================================
--- stable/7/sys/arm/conf/EP80219 Mon Jan 12 17:26:52 2009 (r187107)
+++ stable/7/sys/arm/conf/EP80219 Mon Jan 12 19:16:00 2009 (r187108)
@@ -29,6 +29,7 @@ options STARTUP_PAGETABLE_ADDR=0xa00000
include "../xscale/i80321/std.ep80219"
#To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" #Default places to look for devices.
+makeoptions MODULES_OVERRIDE=""
makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
makeoptions CONF_CFLAGS=-mcpu=xscale
Modified: stable/7/sys/arm/conf/HL200
==============================================================================
--- stable/7/sys/arm/conf/HL200 Mon Jan 12 17:26:52 2009 (r187107)
+++ stable/7/sys/arm/conf/HL200 Mon Jan 12 19:16:00 2009 (r187108)
@@ -33,6 +33,7 @@ options KERNVIRTADDR=0xc0100000
#To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" #Default places to look for devices.
hints "KB920X.hints"
+makeoptions MODULES_OVERRIDE=""
makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
options DDB
Modified: stable/7/sys/arm/conf/IQ31244
==============================================================================
--- stable/7/sys/arm/conf/IQ31244 Mon Jan 12 17:26:52 2009 (r187107)
+++ stable/7/sys/arm/conf/IQ31244 Mon Jan 12 19:16:00 2009 (r187108)
@@ -30,6 +30,7 @@ options STARTUP_PAGETABLE_ADDR=0xa000000
include "../xscale/i80321/std.iq31244"
#To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" #Default places to look for devices.
+makeoptions MODULES_OVERRIDE=""
#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
makeoptions CONF_CFLAGS=-mcpu=xscale
Modified: stable/7/sys/arm/conf/KB920X
==============================================================================
--- stable/7/sys/arm/conf/KB920X Mon Jan 12 17:26:52 2009 (r187107)
+++ stable/7/sys/arm/conf/KB920X Mon Jan 12 19:16:00 2009 (r187108)
@@ -25,6 +25,7 @@ include "../at91/std.kb920x"
#To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" #Default places to look for devices.
hints "KB920X.hints"
+makeoptions MODULES_OVERRIDE=""
makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
options DDB
Modified: stable/7/sys/arm/conf/SIMICS
==============================================================================
--- stable/7/sys/arm/conf/SIMICS Mon Jan 12 17:26:52 2009 (r187107)
+++ stable/7/sys/arm/conf/SIMICS Mon Jan 12 19:16:00 2009 (r187108)
@@ -26,6 +26,7 @@ options PHYSADDR=0xc0000000
include "../sa11x0/std.sa11x0"
#To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" #Default places to look for devices.
+makeoptions MODULES_OVERRIDE=""
makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
makeoptions CONF_CFLAGS=-mcpu=strongarm
Modified: stable/7/sys/arm/conf/SKYEYE
==============================================================================
--- stable/7/sys/arm/conf/SKYEYE Mon Jan 12 17:26:52 2009 (r187107)
+++ stable/7/sys/arm/conf/SKYEYE Mon Jan 12 19:16:00 2009 (r187108)
@@ -27,6 +27,7 @@ options PHYSADDR=0xc0000000
include "../at91/std.kb920x"
#To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" #Default places to look for devices.
+makeoptions MODULES_OVERRIDE=""
makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
makeoptions CONF_CFLAGS=-mcpu=arm9
Modified: stable/7/sys/conf/Makefile.arm
==============================================================================
--- stable/7/sys/conf/Makefile.arm Mon Jan 12 17:26:52 2009 (r187107)
+++ stable/7/sys/conf/Makefile.arm Mon Jan 12 19:16:00 2009 (r187108)
@@ -19,9 +19,6 @@
# Which version of config(8) is required.
%VERSREQ= 600004
-# Temporary stuff while we're still embryonic
-NO_MODULES=
-
STD8X16FONT?= iso
.if !defined(S)
@@ -109,6 +106,8 @@ ${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$
rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \
inflate-tramp.o tmphack.S
+MKMODULESENV+= MACHINE=${MACHINE}
+
%BEFORE_DEPEND
%OBJS
From rpaulo at FreeBSD.org Mon Jan 12 14:37:08 2009
From: rpaulo at FreeBSD.org (Rui Paulo)
Date: Mon Jan 12 14:37:14 2009
Subject: svn commit: r187119 - in stable/7/sys: . dev/ata
Message-ID: <200901122237.n0CMb5o8078340@svn.freebsd.org>
Author: rpaulo
Date: Mon Jan 12 22:37:05 2009
New Revision: 187119
URL: http://svn.freebsd.org/changeset/base/187119
Log:
MFC r185268:
Add support for Marvell PATA M88SX6121.
PR: 129154
Submitted by: Jo?o Barros
Modified:
stable/7/sys/ (props changed)
stable/7/sys/dev/ata/ata-chipset.c
stable/7/sys/dev/ata/ata-pci.h
Modified: stable/7/sys/dev/ata/ata-chipset.c
==============================================================================
--- stable/7/sys/dev/ata/ata-chipset.c Mon Jan 12 22:01:49 2009 (r187118)
+++ stable/7/sys/dev/ata/ata-chipset.c Mon Jan 12 22:37:05 2009 (r187119)
@@ -2555,6 +2555,7 @@ ata_marvell_ident(device_t dev)
{ ATA_M88SX6041, 0, 4, MV60XX, ATA_SA300, "88SX6041" },
{ ATA_M88SX6081, 0, 8, MV60XX, ATA_SA300, "88SX6081" },
{ ATA_M88SX6101, 0, 1, MV61XX, ATA_UDMA6, "88SX6101" },
+ { ATA_M88SX6121, 0, 1, MV_61XX, ATA_UDMA6, "88SX6121" },
{ ATA_M88SX6145, 0, 2, MV61XX, ATA_UDMA6, "88SX6145" },
{ 0, 0, 0, 0, 0, 0}};
Modified: stable/7/sys/dev/ata/ata-pci.h
==============================================================================
--- stable/7/sys/dev/ata/ata-pci.h Mon Jan 12 22:01:49 2009 (r187118)
+++ stable/7/sys/dev/ata/ata-pci.h Mon Jan 12 22:37:05 2009 (r187119)
@@ -211,6 +211,7 @@ struct ata_connect_task {
#define ATA_M88SX6041 0x604111ab
#define ATA_M88SX6081 0x608111ab
#define ATA_M88SX6101 0x610111ab
+#define ATA_M88SX6121 0x612111ab
#define ATA_M88SX6145 0x614511ab
#define ATA_MICRON_ID 0x1042
From delphij at FreeBSD.org Mon Jan 12 17:39:19 2009
From: delphij at FreeBSD.org (Xin LI)
Date: Mon Jan 12 17:39:25 2009
Subject: svn commit: r187124 - stable/7/sys/dev/ata
Message-ID: <200901130139.n0D1dIVE081861@svn.freebsd.org>
Author: delphij
Date: Tue Jan 13 01:39:17 2009
New Revision: 187124
URL: http://svn.freebsd.org/changeset/base/187124
Log:
Fix build: MV_61XX is spelled as MV61XX in 7-STABLE.
Modified:
stable/7/sys/dev/ata/ata-chipset.c
Modified: stable/7/sys/dev/ata/ata-chipset.c
==============================================================================
--- stable/7/sys/dev/ata/ata-chipset.c Tue Jan 13 00:10:50 2009 (r187123)
+++ stable/7/sys/dev/ata/ata-chipset.c Tue Jan 13 01:39:17 2009 (r187124)
@@ -2555,7 +2555,7 @@ ata_marvell_ident(device_t dev)
{ ATA_M88SX6041, 0, 4, MV60XX, ATA_SA300, "88SX6041" },
{ ATA_M88SX6081, 0, 8, MV60XX, ATA_SA300, "88SX6081" },
{ ATA_M88SX6101, 0, 1, MV61XX, ATA_UDMA6, "88SX6101" },
- { ATA_M88SX6121, 0, 1, MV_61XX, ATA_UDMA6, "88SX6121" },
+ { ATA_M88SX6121, 0, 1, MV61XX, ATA_UDMA6, "88SX6121" },
{ ATA_M88SX6145, 0, 2, MV61XX, ATA_UDMA6, "88SX6145" },
{ 0, 0, 0, 0, 0, 0}};
From brueffer at FreeBSD.org Tue Jan 13 01:24:57 2009
From: brueffer at FreeBSD.org (Christian Brueffer)
Date: Tue Jan 13 01:25:08 2009
Subject: svn commit: r187136 - stable/7/share/man/man9
Message-ID: <200901130924.n0D9OtDc095625@svn.freebsd.org>
Author: brueffer
Date: Tue Jan 13 09:24:55 2009
New Revision: 187136
URL: http://svn.freebsd.org/changeset/base/187136
Log:
MFC: r186953
DEBUG_REDZONE needs DDB which needs KDB.
Modified:
stable/7/share/man/man9/ (props changed)
stable/7/share/man/man9/redzone.9
Modified: stable/7/share/man/man9/redzone.9
==============================================================================
--- stable/7/share/man/man9/redzone.9 Tue Jan 13 09:21:11 2009 (r187135)
+++ stable/7/share/man/man9/redzone.9 Tue Jan 13 09:24:55 2009 (r187136)
@@ -24,13 +24,15 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 31, 2006
+.Dd January 9, 2009
.Dt REDZONE 9
.Os
.Sh NAME
.Nm RedZone
.Nd "buffer corruptions detector"
.Sh SYNOPSIS
+.Cd "options KDB"
+.Cd "options DDB"
.Cd "options DEBUG_REDZONE"
.Sh DESCRIPTION
.Nm
From mav at FreeBSD.org Tue Jan 13 08:17:24 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Tue Jan 13 08:17:36 2009
Subject: svn commit: r187152 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb dev/sound/pci/hda
Message-ID: <200901131617.n0DGHNGi008246@svn.freebsd.org>
Author: mav
Date: Tue Jan 13 16:17:22 2009
New Revision: 187152
URL: http://svn.freebsd.org/changeset/base/187152
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/sound/pci/hda/hdac.c
Modified: stable/7/sys/dev/sound/pci/hda/hdac.c
==============================================================================
--- stable/7/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 16:15:49 2009 (r187151)
+++ stable/7/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 16:17:22 2009 (r187152)
@@ -83,7 +83,7 @@
#include "mixer_if.h"
-#define HDA_DRV_TEST_REV "20081226_0122"
+#define HDA_DRV_TEST_REV "20090110_0123"
SND_DECLARE_FILE("$FreeBSD$");
@@ -149,6 +149,7 @@ SND_DECLARE_FILE("$FreeBSD$");
#define HDA_INTEL_82801H HDA_MODEL_CONSTRUCT(INTEL, 0x284b)
#define HDA_INTEL_82801I HDA_MODEL_CONSTRUCT(INTEL, 0x293e)
#define HDA_INTEL_82801J HDA_MODEL_CONSTRUCT(INTEL, 0x3a3e)
+#define HDA_INTEL_PCH HDA_MODEL_CONSTRUCT(INTEL, 0x3b56)
#define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b)
#define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff)
@@ -178,6 +179,19 @@ SND_DECLARE_FILE("$FreeBSD$");
#define ATI_VENDORID 0x1002
#define HDA_ATI_SB450 HDA_MODEL_CONSTRUCT(ATI, 0x437b)
#define HDA_ATI_SB600 HDA_MODEL_CONSTRUCT(ATI, 0x4383)
+#define HDA_ATI_RS600 HDA_MODEL_CONSTRUCT(ATI, 0x793b)
+#define HDA_ATI_RS690 HDA_MODEL_CONSTRUCT(ATI, 0x7919)
+#define HDA_ATI_RS780 HDA_MODEL_CONSTRUCT(ATI, 0x960f)
+#define HDA_ATI_R600 HDA_MODEL_CONSTRUCT(ATI, 0xaa00)
+#define HDA_ATI_RV630 HDA_MODEL_CONSTRUCT(ATI, 0xaa08)
+#define HDA_ATI_RV610 HDA_MODEL_CONSTRUCT(ATI, 0xaa10)
+#define HDA_ATI_RV670 HDA_MODEL_CONSTRUCT(ATI, 0xaa18)
+#define HDA_ATI_RV635 HDA_MODEL_CONSTRUCT(ATI, 0xaa20)
+#define HDA_ATI_RV620 HDA_MODEL_CONSTRUCT(ATI, 0xaa28)
+#define HDA_ATI_RV770 HDA_MODEL_CONSTRUCT(ATI, 0xaa30)
+#define HDA_ATI_RV730 HDA_MODEL_CONSTRUCT(ATI, 0xaa38)
+#define HDA_ATI_RV710 HDA_MODEL_CONSTRUCT(ATI, 0xaa40)
+#define HDA_ATI_RV740 HDA_MODEL_CONSTRUCT(ATI, 0xaa48)
#define HDA_ATI_ALL HDA_MODEL_CONSTRUCT(ATI, 0xffff)
/* VIA */
@@ -469,6 +483,7 @@ static const struct {
{ HDA_INTEL_82801H, "Intel 82801H" },
{ HDA_INTEL_82801I, "Intel 82801I" },
{ HDA_INTEL_82801J, "Intel 82801J" },
+ { HDA_INTEL_PCH, "Intel PCH" },
{ HDA_INTEL_SCH, "Intel SCH" },
{ HDA_NVIDIA_MCP51, "NVidia MCP51" },
{ HDA_NVIDIA_MCP55, "NVidia MCP55" },
@@ -488,8 +503,20 @@ static const struct {
{ HDA_NVIDIA_MCP79_2, "NVidia MCP79" },
{ HDA_NVIDIA_MCP79_3, "NVidia MCP79" },
{ HDA_NVIDIA_MCP79_4, "NVidia MCP79" },
- { HDA_ATI_SB450, "ATI SB450" },
- { HDA_ATI_SB600, "ATI SB600" },
+ { HDA_ATI_SB450, "ATI SB450" },
+ { HDA_ATI_SB600, "ATI SB600" },
+ { HDA_ATI_RS600, "ATI RS600" },
+ { HDA_ATI_RS690, "ATI RS690" },
+ { HDA_ATI_RS780, "ATI RS780" },
+ { HDA_ATI_R600, "ATI R600" },
+ { HDA_ATI_RV610, "ATI RV610" },
+ { HDA_ATI_RV620, "ATI RV620" },
+ { HDA_ATI_RV630, "ATI RV630" },
+ { HDA_ATI_RV635, "ATI RV635" },
+ { HDA_ATI_RV710, "ATI RV710" },
+ { HDA_ATI_RV730, "ATI RV730" },
+ { HDA_ATI_RV740, "ATI RV740" },
+ { HDA_ATI_RV770, "ATI RV770" },
{ HDA_VIA_VT82XX, "VIA VT8251/8237A" },
{ HDA_SIS_966, "SiS 966" },
{ HDA_ULI_M5461, "ULI M5461" },
@@ -671,6 +698,7 @@ static const struct {
/* Silicon Image */
#define SII_VENDORID 0x1095
+#define HDA_CODEC_SII1390 HDA_CODEC_CONSTRUCT(SII, 0x1390)
#define HDA_CODEC_SII1392 HDA_CODEC_CONSTRUCT(SII, 0x1392)
#define HDA_CODEC_SIIXXXX HDA_CODEC_CONSTRUCT(SII, 0xffff)
@@ -706,6 +734,22 @@ static const struct {
#define HDA_CODEC_VT1708B_5 HDA_CODEC_CONSTRUCT(VIA, 0xe725)
#define HDA_CODEC_VT1708B_6 HDA_CODEC_CONSTRUCT(VIA, 0xe726)
#define HDA_CODEC_VT1708B_7 HDA_CODEC_CONSTRUCT(VIA, 0xe727)
+#define HDA_CODEC_VT1708S_0 HDA_CODEC_CONSTRUCT(VIA, 0x0397)
+#define HDA_CODEC_VT1708S_1 HDA_CODEC_CONSTRUCT(VIA, 0x1397)
+#define HDA_CODEC_VT1708S_2 HDA_CODEC_CONSTRUCT(VIA, 0x2397)
+#define HDA_CODEC_VT1708S_3 HDA_CODEC_CONSTRUCT(VIA, 0x3397)
+#define HDA_CODEC_VT1708S_4 HDA_CODEC_CONSTRUCT(VIA, 0x4397)
+#define HDA_CODEC_VT1708S_5 HDA_CODEC_CONSTRUCT(VIA, 0x5397)
+#define HDA_CODEC_VT1708S_6 HDA_CODEC_CONSTRUCT(VIA, 0x6397)
+#define HDA_CODEC_VT1708S_7 HDA_CODEC_CONSTRUCT(VIA, 0x7397)
+#define HDA_CODEC_VT1702_0 HDA_CODEC_CONSTRUCT(VIA, 0x0398)
+#define HDA_CODEC_VT1702_1 HDA_CODEC_CONSTRUCT(VIA, 0x1398)
+#define HDA_CODEC_VT1702_2 HDA_CODEC_CONSTRUCT(VIA, 0x2398)
+#define HDA_CODEC_VT1702_3 HDA_CODEC_CONSTRUCT(VIA, 0x3398)
+#define HDA_CODEC_VT1702_4 HDA_CODEC_CONSTRUCT(VIA, 0x4398)
+#define HDA_CODEC_VT1702_5 HDA_CODEC_CONSTRUCT(VIA, 0x5398)
+#define HDA_CODEC_VT1702_6 HDA_CODEC_CONSTRUCT(VIA, 0x6398)
+#define HDA_CODEC_VT1702_7 HDA_CODEC_CONSTRUCT(VIA, 0x7398)
#define HDA_CODEC_VTXXXX HDA_CODEC_CONSTRUCT(VIA, 0xffff)
/* ATI */
@@ -716,9 +760,16 @@ static const struct {
#define HDA_CODEC_ATIXXXX HDA_CODEC_CONSTRUCT(ATI, 0xffff)
/* NVIDIA */
+#define HDA_CODEC_NVIDIAMCP78 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0002)
+#define HDA_CODEC_NVIDIAMCP7A HDA_CODEC_CONSTRUCT(NVIDIA, 0x0007)
+#define HDA_CODEC_NVIDIAMCP67 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0067)
#define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff)
/* INTEL */
+#define HDA_CODEC_INTELG45_1 HDA_CODEC_CONSTRUCT(INTEL, 0x2801)
+#define HDA_CODEC_INTELG45_2 HDA_CODEC_CONSTRUCT(INTEL, 0x2802)
+#define HDA_CODEC_INTELG45_3 HDA_CODEC_CONSTRUCT(INTEL, 0x2803)
+#define HDA_CODEC_INTELG45_4 HDA_CODEC_CONSTRUCT(INTEL, 0x29fb)
#define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff)
/* Codecs */
@@ -833,10 +884,34 @@ static const struct {
{ HDA_CODEC_VT1708B_5, "VIA VT1708B_5" },
{ HDA_CODEC_VT1708B_6, "VIA VT1708B_6" },
{ HDA_CODEC_VT1708B_7, "VIA VT1708B_7" },
+ { HDA_CODEC_VT1708S_0, "VIA VT1708S_0" },
+ { HDA_CODEC_VT1708S_1, "VIA VT1708S_1" },
+ { HDA_CODEC_VT1708S_2, "VIA VT1708S_2" },
+ { HDA_CODEC_VT1708S_3, "VIA VT1708S_3" },
+ { HDA_CODEC_VT1708S_4, "VIA VT1708S_4" },
+ { HDA_CODEC_VT1708S_5, "VIA VT1708S_5" },
+ { HDA_CODEC_VT1708S_6, "VIA VT1708S_6" },
+ { HDA_CODEC_VT1708S_7, "VIA VT1708S_7" },
+ { HDA_CODEC_VT1702_0, "VIA VT1702_0" },
+ { HDA_CODEC_VT1702_1, "VIA VT1702_1" },
+ { HDA_CODEC_VT1702_2, "VIA VT1702_2" },
+ { HDA_CODEC_VT1702_3, "VIA VT1702_3" },
+ { HDA_CODEC_VT1702_4, "VIA VT1702_4" },
+ { HDA_CODEC_VT1702_5, "VIA VT1702_5" },
+ { HDA_CODEC_VT1702_6, "VIA VT1702_6" },
+ { HDA_CODEC_VT1702_7, "VIA VT1702_7" },
{ HDA_CODEC_ATIRS600_1,"ATI RS600 HDMI" },
{ HDA_CODEC_ATIRS600_2,"ATI RS600 HDMI" },
{ HDA_CODEC_ATIRS690, "ATI RS690/780 HDMI" },
{ HDA_CODEC_ATIR6XX, "ATI R6xx HDMI" },
+ { HDA_CODEC_NVIDIAMCP67, "NVidia MCP67 HDMI" },
+ { HDA_CODEC_NVIDIAMCP78, "NVidia MCP78 HDMI" },
+ { HDA_CODEC_NVIDIAMCP7A, "NVidia MCP7A HDMI" },
+ { HDA_CODEC_INTELG45_1, "Intel G45 HDMI" },
+ { HDA_CODEC_INTELG45_2, "Intel G45 HDMI" },
+ { HDA_CODEC_INTELG45_3, "Intel G45 HDMI" },
+ { HDA_CODEC_INTELG45_4, "Intel G45 HDMI" },
+ { HDA_CODEC_SII1390, "Silicon Image SiI1390 HDMI" },
{ HDA_CODEC_SII1392, "Silicon Image SiI1392 HDMI" },
/* Unknown codec */
{ HDA_CODEC_ALCXXXX, "Realtek (Unknown)" },
@@ -2443,9 +2518,10 @@ hdac_widget_pin_parse(struct hdac_widget
{
struct hdac_softc *sc = w->devinfo->codec->sc;
uint32_t config, pincap;
- const char *devstr, *connstr;
+ const char *devstr;
nid_t cad = w->devinfo->codec->cad;
nid_t nid = w->nid;
+ int conn, color;
config = hdac_widget_pin_getconfig(w);
w->wclass.pin.config = config;
@@ -2467,13 +2543,19 @@ hdac_widget_pin_parse(struct hdac_widget
devstr = HDA_DEVS[(config & HDA_CONFIG_DEFAULTCONF_DEVICE_MASK) >>
HDA_CONFIG_DEFAULTCONF_DEVICE_SHIFT];
- connstr = HDA_CONNS[(config & HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK) >>
- HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_SHIFT];
+ conn = (config & HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK) >>
+ HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_SHIFT;
+ color = (config & HDA_CONFIG_DEFAULTCONF_COLOR_MASK) >>
+ HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT;
strlcat(w->name, ": ", sizeof(w->name));
strlcat(w->name, devstr, sizeof(w->name));
strlcat(w->name, " (", sizeof(w->name));
- strlcat(w->name, connstr, sizeof(w->name));
+ if (conn == 0 && color != 0 && color != 15) {
+ strlcat(w->name, HDA_COLORS[color], sizeof(w->name));
+ strlcat(w->name, " ", sizeof(w->name));
+ }
+ strlcat(w->name, HDA_CONNS[conn], sizeof(w->name));
strlcat(w->name, ")", sizeof(w->name));
}
@@ -5472,7 +5554,7 @@ hdac_audio_disable_crossas(struct hdac_d
struct hdac_audio_ctl *ctl;
int i, j;
- /* Disable crossassociatement connections. */
+ /* Disable crossassociatement and unwanted crosschannel connections. */
/* ... using selectors */
for (i = devinfo->startnode; i < devinfo->endnode; i++) {
w = hdac_widget_get(devinfo, i);
@@ -5490,7 +5572,10 @@ hdac_audio_disable_crossas(struct hdac_d
cw = hdac_widget_get(devinfo, w->conns[j]);
if (cw == NULL || w->enable == 0)
continue;
- if (w->bindas == cw->bindas || cw->bindas == -2)
+ if (cw->bindas == -2)
+ continue;
+ if (w->bindas == cw->bindas &&
+ (w->bindseqmask & cw->bindseqmask) != 0)
continue;
w->connsenable[j] = 0;
HDA_BOOTHVERBOSE(
@@ -5509,7 +5594,8 @@ hdac_audio_disable_crossas(struct hdac_d
if (ctl->widget->bindas == -2 ||
ctl->childwidget->bindas == -2)
continue;
- if (ctl->widget->bindas != ctl->childwidget->bindas) {
+ if (ctl->widget->bindas != ctl->childwidget->bindas ||
+ (ctl->widget->bindseqmask & ctl->childwidget->bindseqmask) == 0) {
ctl->forcemute = 1;
ctl->muted = HDA_AMP_MUTE_ALL;
ctl->left = 0;
From gnn at FreeBSD.org Tue Jan 13 13:13:37 2009
From: gnn at FreeBSD.org (George V. Neville-Neil)
Date: Tue Jan 13 13:13:43 2009
Subject: svn commit: r187191 - in stable/7/sys: . conf
Message-ID: <200901132113.n0DLDZad016179@svn.freebsd.org>
Author: gnn
Date: Tue Jan 13 21:13:35 2009
New Revision: 187191
URL: http://svn.freebsd.org/changeset/base/187191
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/conf/kern.pre.mk
Modified: stable/7/sys/conf/kern.pre.mk
==============================================================================
--- stable/7/sys/conf/kern.pre.mk Tue Jan 13 21:08:43 2009 (r187190)
+++ stable/7/sys/conf/kern.pre.mk Tue Jan 13 21:13:35 2009 (r187191)
@@ -26,6 +26,7 @@ COPTFLAGS?= -O
.else
. if defined(DEBUG)
_MINUS_O= -O
+CTFFLAGS+= -g
. else
_MINUS_O= -O2
. endif
From gnn at FreeBSD.org Tue Jan 13 13:19:04 2009
From: gnn at FreeBSD.org (George V. Neville-Neil)
Date: Tue Jan 13 13:19:21 2009
Subject: svn commit: r187193 - in stable/7/sys: . dev/e1000
Message-ID: <200901132119.n0DLJ2Bj016393@svn.freebsd.org>
Author: gnn
Date: Tue Jan 13 21:19:02 2009
New Revision: 187193
URL: http://svn.freebsd.org/changeset/base/187193
Log:
MFC of average latency bug fix
Fix a cut/paste bug which prevents us from setting the average
latency tunable.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/dev/e1000/if_igb.c
Modified: stable/7/sys/dev/e1000/if_igb.c
==============================================================================
--- stable/7/sys/dev/e1000/if_igb.c Tue Jan 13 21:18:14 2009 (r187192)
+++ stable/7/sys/dev/e1000/if_igb.c Tue Jan 13 21:19:02 2009 (r187193)
@@ -281,7 +281,7 @@ TUNABLE_INT("hw.igb.enable_aim", &igb_en
static int igb_low_latency = IGB_LOW_LATENCY;
TUNABLE_INT("hw.igb.low_latency", &igb_low_latency);
static int igb_ave_latency = IGB_AVE_LATENCY;
-TUNABLE_INT("hw.igb.ave_latency", &igb_low_latency);
+TUNABLE_INT("hw.igb.ave_latency", &igb_ave_latency);
static int igb_bulk_latency = IGB_BULK_LATENCY;
TUNABLE_INT("hw.igb.bulk_latency", &igb_bulk_latency);
From simon at FreeBSD.org Tue Jan 13 13:19:29 2009
From: simon at FreeBSD.org (Simon L. Nielsen)
Date: Tue Jan 13 13:19:36 2009
Subject: svn commit: r187194 - head/contrib/ntp/ntpd releng/6.3
releng/6.3/contrib/bind9/lib/dns releng/6.3/contrib/ntp/ntpd
releng/6.3/sys/conf releng/6.4
releng/6.4/contrib/bind9/lib/dns releng/6.4/contri...
Message-ID: <200901132119.n0DLJSN6016435@svn.freebsd.org>
Author: simon
Date: Tue Jan 13 21:19:27 2009
New Revision: 187194
URL: http://svn.freebsd.org/changeset/base/187194
Log:
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)
Modified:
stable/7/contrib/ntp/ntpd/ntp_crypto.c
Changes in other areas also in this revision:
Modified:
head/contrib/ntp/ntpd/ntp_crypto.c
releng/6.3/UPDATING
releng/6.3/contrib/bind9/lib/dns/openssldsa_link.c
releng/6.3/contrib/bind9/lib/dns/opensslrsa_link.c
releng/6.3/contrib/ntp/ntpd/ntp_crypto.c
releng/6.3/sys/conf/newvers.sh
releng/6.4/UPDATING
releng/6.4/contrib/bind9/lib/dns/openssldsa_link.c
releng/6.4/contrib/bind9/lib/dns/opensslrsa_link.c
releng/6.4/contrib/ntp/ntpd/ntp_crypto.c
releng/6.4/sys/conf/newvers.sh
releng/7.0/UPDATING
releng/7.0/contrib/bind9/lib/dns/openssldsa_link.c
releng/7.0/contrib/bind9/lib/dns/opensslrsa_link.c
releng/7.0/contrib/ntp/ntpd/ntp_crypto.c
releng/7.0/sys/conf/newvers.sh
releng/7.1/UPDATING
releng/7.1/contrib/bind9/lib/dns/openssldsa_link.c
releng/7.1/contrib/bind9/lib/dns/opensslrsa_link.c
releng/7.1/contrib/ntp/ntpd/ntp_crypto.c
releng/7.1/sys/conf/newvers.sh
stable/6/contrib/ntp/ntpd/ntp_crypto.c
Modified: stable/7/contrib/ntp/ntpd/ntp_crypto.c
==============================================================================
--- stable/7/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:02 2009 (r187193)
+++ stable/7/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:27 2009 (r187194)
@@ -1612,7 +1612,7 @@ crypto_verify(
*/
EVP_VerifyInit(&ctx, peer->digest);
EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12);
- if (!EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey))
+ if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey) <= 0)
return (XEVNT_SIG);
if (peer->crypto & CRYPTO_FLAG_VRFY) {
From luigi at FreeBSD.org Tue Jan 13 14:28:51 2009
From: luigi at FreeBSD.org (Luigi Rizzo)
Date: Tue Jan 13 14:32:07 2009
Subject: svn commit: r187198 - in stable/7: sys/boot/i386/boot0
usr.sbin/boot0cfg
Message-ID: <200901132228.n0DMSnai018184@svn.freebsd.org>
Author: luigi
Date: Tue Jan 13 22:28:48 2009
New Revision: 187198
URL: http://svn.freebsd.org/changeset/base/187198
Log:
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.
Modified:
stable/7/sys/boot/i386/boot0/boot0.S
stable/7/usr.sbin/boot0cfg/boot0cfg.8
stable/7/usr.sbin/boot0cfg/boot0cfg.c
Modified: stable/7/sys/boot/i386/boot0/boot0.S
==============================================================================
--- stable/7/sys/boot/i386/boot0/boot0.S Tue Jan 13 22:15:47 2009 (r187197)
+++ stable/7/sys/boot/i386/boot0/boot0.S Tue Jan 13 22:28:48 2009 (r187198)
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2008 Luigi Rizzo (mostly documentation)
* Copyright (c) 2002 Bruce M. Simpson
* Copyright (c) 1998 Robert Nordier
* All rights reserved.
@@ -16,50 +17,166 @@
* $FreeBSD$
*/
-/* A 512-byte boot manager. */
-#ifdef SIO
-/* ... using a serial console on COM1. */
+/* build options: */
+#ifdef SIO /* use serial console on COM1. */
#endif
+#ifdef PXE /* enable PXE/INT18 booting with F6 */
+#define SAVE_MORE_MEMORY
+#endif
+
+#ifdef CHECK_DRIVE /* make sure we boot from a HD. */
+#endif
+
+#ifdef ONLY_F_KEYS /* Only F1..F6, no digits on console */
+#endif
+
+#ifdef VOLUME_SERIAL /* support Volume serial number */
+#define B0_BASE 0x1ae /* move the internal data area */
+#define SAVE_MEMORY
+#else
+#define B0_BASE 0x1b2
+#endif
+
+#ifdef TEST /* enable some test code */
+#define SAVE_MEMORY
+#define SAVE_MORE_MEMORY
+#endif
+
+/*
+ * Note - this code uses many tricks to save space and fit in one sector.
+ * This includes using side effects of certain instructions, reusing
+ * register values from previous operations, etc.
+ * Be extremely careful when changing the code, even for simple things.
+ */
+
+/*
+ * BOOT BLOCK STRUCTURE
+ *
+ * This code implements a Master Boot Record (MBR) for an Intel/PC disk.
+ * It is 512 bytes long and it is normally loaded by the BIOS (or another
+ * bootloader) at 0:0x7c00. This code depends on %cs:%ip being 0:0x7c00
+ *
+ * The initial chunk of instructions is used as a signature by external
+ * tools (e.g. boot0cfg) which can manipulate the block itself.
+ *
+ * The area at offset 0x1b2 contains a magic string ('Drive '), also
+ * used as a signature to detect the block, and some variables that can
+ * be updated by boot0cfg (and optionally written back to the disk).
+ * These variables control the operation of the bootloader itself,
+ * e.g. which partitions to enable, the timeout, the use of LBA
+ * (called 'packet') or CHS mode, whether to force a drive number,
+ * and whether to write back the user's selection back to disk.
+ *
+ * As in every Master Boot Record, the partition table is at 0x1be,
+ * made of four 16-byte entries each containing:
+ *
+ * OFF SIZE DESCRIPTION
+ * 0 1 status (0x80: bootable, 0: non bootable)
+ * 1 3 start sector CHS
+ * 8:head, 6:sector, 2:cyl bit 9..8, 8:cyl bit 7..0
+ * 4 1 partition type
+ * 5 3 end sector CHS
+ * 8 4 LBA of first sector
+ * 12 4 partition size in sectors
+ *
+ * and followed by the two bytes 0x55, 0xAA (MBR signature).
+ */
+
+
+/*
+ * BOOT BLOCK OPERATION
+ *
+ * On entry, the registers contain the following values:
+ *
+ * %cs:%ip 0:0x7c00
+ * %dl drive number (0x80, 0x81, ... )
+ * %si pointer to the partition table from which we were loaded.
+ * Some boot code (e.g. syslinux) use this info to relocate
+ * themselves, so we want to pass a valid one to the next stage.
+ * NOTE: the use of %si is not a standard.
+ *
+ * This boot block first relocates itself at a different address (0:0x600),
+ * to free the space at 0:0x7c00 for the next stage boot block.
+ *
+ * It then initializes some memory at 0:0x800 and above (pointed by %bp)
+ * to store the original drive number (%dl) passed to us, and to construct a
+ * fake partition entry. The latter is used by the disk I/O routine and,
+ * in some cases, passed in %si to the next stage boot code.
+ *
+ * The variables at 0x1b2 are accessed as negative offsets from %bp.
+ *
+ * After the relocation, the code scans the partition table printing
+ * out enabled partition or disks, and waits for user input.
+ *
+ * When a partition is selected, or a timeout expires, the currently
+ * selected partition is used to load the next stage boot code,
+ * %dl and %si are set appropriately as when we were called, and
+ * control is transferred to the newly loaded code at 0:0x7c00.
+ */
+
+/*
+ * CONSTANTS
+ *
+ * NHRDRV is the address in segment 0 where the BIOS writes the
+ * total number of hard disks in the system.
+ * LOAD is the original load address and cannot be changed.
+ * ORIGIN is the relocation address. If you change it, you also need
+ * to change the value passed to the linker in the Makefile
+ * PRT_OFF is the location of the partition table (from the MBR standard).
+ * B0_OFF is the location of the data area, known to boot0cfg so
+ * it cannot be changed. Computed as a negative offset from 0x200
+ * MAGIC is the signature of a boot block.
+ */
+
.set NHRDRV,0x475 # Number of hard drives
.set ORIGIN,0x600 # Execution address
- .set FAKE,0x800 # Partition entry
.set LOAD,0x7c00 # Load address
.set PRT_OFF,0x1be # Partition table
-
- .set TBL0SZ,0x3 # Table 0 size
- .set TBL1SZ,0xa # Table 1 size
+ .set B0_OFF,(B0_BASE-0x200) # Offset of boot0 data
.set MAGIC,0xaa55 # Magic: bootable
- .set B0MAGIC,0xbb66 # Identification
.set KEY_ENTER,0x1c # Enter key scan code
.set KEY_F1,0x3b # F1 key scan code
.set KEY_1,0x02 # #1 key scan code
- .set ASCII_BEL,0x07 # ASCII code for
+ .set ASCII_BEL,'#' # ASCII code for
.set ASCII_CR,0x0D # ASCII code for
/*
- * Addresses in the sector of embedded data values.
- * Accessed with negative offsets from the end of the relocated sector (%ebp).
- */
- .set _NXTDRV,-0x48 # Next drive
- .set _OPT,-0x47 # Default option
- .set _SETDRV,-0x46 # Drive to force
- .set _FLAGS,-0x45 # Flags
- .set _TICKS,-0x44 # Timeout ticks
- .set _FAKE,0x0 # Fake partition entry
- .set _MNUOPT,0xc # Menu options
+ * Offsets of variables in the block at B0_OFF, and in the volatile
+ * data area, computed as displacement from %bp.
+ * We need to define them as constant as the assembler cannot
+ * compute them in its single pass.
+ */
+ .set _NXTDRV, B0_OFF+6 # Next drive
+ .set _OPT, B0_OFF+7 # Default option
+ .set _SETDRV, B0_OFF+8 # Drive to force
+ .set _FLAGS, B0_OFF+9 # Flags
+ .set SETDRV, 0x20 # the 'setdrv' flag
+ .set NOUPDATE, 0x40 # the 'noupdate' flag
+ .set USEPACKET, 0x80 # the 'packet' flag
+
+ /* ticks is at a fixed position */
+ .set _TICKS, (PRT_OFF - 0x200 - 2) # Timeout ticks
+ .set _MNUOPT, 0x10 # Saved menu entries
+ .set TLEN, (desc_ofs - bootable_ids) # size of bootable ids
.globl start # Entry point
.code16 # This runs in real mode
/*
+ * MAIN ENTRY POINT
* Initialise segments and registers to known values.
* segments start at 0.
* The stack is immediately below the address we were loaded to.
+ * NOTE: the initial section of the code (up to movw $LOAD,%sp)
+ * is used by boot0cfg, together with the 'Drive ' string and
+ * the 0x55, 0xaa at the end, as an identifier for version 1.0
+ * of the boot code. Do not change it.
+ * In version 1.0 the parameter table (_NEXTDRV etc) is at 0x1b9
*/
start: cld # String ops inc
xorw %ax,%ax # Zero
@@ -69,7 +186,7 @@ start: cld # String ops inc
movw $LOAD,%sp # stack
/*
- * Copy this code to the address it was linked for
+ * Copy this code to the address it was linked for, 0x600 by default.
*/
movw %sp,%si # Source
movw $start,%di # Destination
@@ -77,248 +194,301 @@ start: cld # String ops inc
rep # Relocate
movsw # code
/*
- * Set address for variable space beyond code, and clear it.
- * Notice that this is also used to point to the values embedded in the block,
- * by using negative offsets.
+ * After the code, (i.e. at %di+0, 0x800) create a partition entry,
+ * initialized to LBA 0 / CHS 0:0:1.
+ * Set %bp to point to the partition and also, with negative offsets,
+ * to the variables embedded in the bootblock (nextdrv and so on).
*/
movw %di,%bp # Address variables
movb $0x8,%cl # Words to clear
rep # Zero
stosw # them
-/*
- * Relocate to the new copy of the code.
- */
- incb -0xe(%di) # Sector number
- jmp main-LOAD+ORIGIN # To relocated code
+ incb -0xe(%di) # Set the S field to 1
+
+ jmp main-LOAD+ORIGIN # Jump to relocated code
main:
#if defined(SIO) && COMSPEED != 0
/*
- * Initialize the serial port. bioscom preserves the driver number in DX.
+ * Init the serial port. bioscom preserves the driver number in DX.
*/
movw $COMSPEED,%ax # defined by Makefile
callw bioscom
#endif
+
/*
- * Check what flags were loaded with us, specifically if a predefined drive
- * number should be used. If what the bios gives us is bad, use the '0' in
- * the block instead.
- */
- testb $0x20,_FLAGS(%bp) # Set drive number?
- jnz main.1 # Yes
+ * If the 'setdrv' flag is set in the boot sector, use the drive
+ * number from the boot sector at 'setdrv_num'.
+ * Optionally, do the same if the BIOS gives us an invalid number
+ * (note though that the override prevents booting from a floppy
+ * or a ZIP/flash drive in floppy emulation).
+ * The test costs 4 bytes of code so it is disabled by default.
+ */
+ testb $SETDRV,_FLAGS(%bp) # Set drive number?
+#ifndef CHECK_DRIVE /* disable drive checks */
+ jz save_curdrive # no, use the default
+#else
+ jnz disable_update # Yes
testb %dl,%dl # Drive number valid?
- js main.2 # Possibly (0x80 set)
+ js save_curdrive # Possibly (0x80 set)
+#endif
/*
- * Only update the boot-sector when there is a valid drive number or
- * the drive number is set manually.
+ * Disable updates if the drive number is forced.
*/
- orb $0x40,_FLAGS(%bp) # Disable updates
-main.1: movb _SETDRV(%bp),%dl # Drive number to use
+disable_update: orb $NOUPDATE,_FLAGS(%bp) # Disable updates
+ movb _SETDRV(%bp),%dl # Use stored drive number
+
/*
- * Whatever we decided to use, now store it into the fake
- * partition entry that lives in the data space above us.
- */
-main.2: movb %dl,_FAKE(%bp) # Save drive number
- callw putn # To new line
- pushw %dx # Save drive number
+ * Whatever drive we decided to use, store it at (%bp). The byte
+ * is normally used for the state of the partition (0x80 or 0x00),
+ * but we abuse it as it is very convenient to access at offset 0.
+ * The value is read back after 'check_selection'
+ */
+save_curdrive: movb %dl, (%bp) # Save drive number
+ pushw %dx # Also in the stack
+#ifdef TEST /* test code, print internal bios drive */
+ rolb $1, %dl
+ movw $drive, %si
+ call putkey
+#endif
+ callw putn # Print a newline
/*
* Start out with a pointer to the 4th byte of the first table entry
* so that after 4 iterations it's beyond the end of the sector
- * and beyond a 256 byte boundary and has overflowed 8 bits (see next comment).
- * Remember that the table starts 2 bytes earlier than you would expect
- * as the bootable flag is after it in the block.
+ * and beyond a 256 byte boundary. We use the latter trick to check for
+ * end of the loop without using an extra register (see start.5).
*/
movw $(partbl+0x4),%bx # Partition table (+4)
xorw %dx,%dx # Item number
+
/*
* Loop around on the partition table, printing values until we
- * pass a 256 byte boundary. The end of loop test is at main.5.
+ * pass a 256 byte boundary.
*/
-main.3: movb %ch,-0x4(%bx) # Zero active flag (ch == 0)
+read_entry: movb %ch,-0x4(%bx) # Zero active flag (ch == 0)
btw %dx,_FLAGS(%bp) # Entry enabled?
- jnc main.5 # No
-/*
- * If any of the entries in the table are the same as the 'type' in the slice
- * table entry, then this is an empty or non bootable partition. Skip it.
- */
+ jnc next_entry # No
movb (%bx),%al # Load type
- movw $tables,%di # Lookup tables
- movb $TBL0SZ,%cl # Number of entries
- repne # Exclude
- scasb # partition?
- je main.5 # Yes
+ test %al, %al # skip empty partition
+ jz next_entry
/*
- * Now scan the table of known types
+ * Scan the table of bootable ids, which starts at %di and has
+ * length TLEN. On a match, %di points to the element following the
+ * match; the corresponding offset to the description is $(TLEN-1)
+ * bytes ahead. We use a count of TLEN+1 so if we don't find a match
+ * within the first TLEN entries, we hit the 'unknown' entry.
*/
- movb $TBL1SZ+1,%cl # Number of entries
+ movw $bootable_ids,%di # Lookup tables
+ movb $(TLEN+1),%cl # Number of entries
repne # Locate
scasb # type
/*
* Get the matching element in the next array.
+ * The byte at $(TLEN-1)(%di) contains the offset of the description
+ * string from %di, so we add the number and print the string.
*/
- addw $TBL1SZ-1, %di # Adjust
+ addw $(TLEN-1), %di # Adjust
movb (%di),%cl # Partition
addw %cx,%di # description
callw putx # Display it
-main.5: incw %dx # Next item
+
+next_entry: incw %dx # Next item
addb $0x10,%bl # Next entry
- jnc main.3 # Till done
+ jnc read_entry # Till done
/*
- * Passed a 256 byte boundary; the table is finished.
+ * We are past a 256 byte boundary: the partition table is finished.
* Add one to the drive number and check it is valid.
+ * Note that if we started from a floppy, %dl was 0 so we still
+ * get an entry for the next drive, which is the first Hard Disk.
*/
popw %ax # Drive number
subb $0x80-0x1,%al # Does next
cmpb NHRDRV,%al # drive exist? (from BIOS?)
- jb main.6 # Yes
+ jb print_drive # Yes
/*
* If this is the only drive, don't display it as an option.
*/
decw %ax # Already drive 0?
- jz main.7 # Yes
+ jz print_prompt # Yes
/*
* If it was illegal or we cycled through them, go back to drive 0.
*/
xorb %al,%al # Drive 0
/*
- * Whatever drive we selected, make it an ascii digit and save it back to the
- * "next drive" location in the loaded block in case we want to save it later
- * for next time. This also is part of the printed drive string so add 0x80
+ * Whatever drive we selected, make it an ascii digit and save it
+ * back to the "nxtdrv" location in case we want to save it to disk.
+ * This digit is also part of the printed drive string, so add 0x80
* to indicate end of string.
*/
-main.6: addb $'0'|0x80,%al # Save next
+print_drive: addb $'0'|0x80,%al # Save next
movb %al,_NXTDRV(%bp) # drive number
movw $drive,%di # Display
callw putx # item
/*
- * Now that we've printed the drive (if we needed to), display a prompt.
+ * Menu is complete, display a prompt followed by current selection.
+ * 'decw %si' makes the register point to the space after 'Boot: '
+ * so we do not see an extra CRLF on the screen.
*/
-main.7: movw $prompt,%si # Display
+print_prompt: movw $prompt,%si # Display
callw putstr # prompt
movb _OPT(%bp),%dl # Display
decw %si # default
callw putkey # key
- jmp main.7_1 # Skip beep
+ jmp start_input # Skip beep
+
/*
- * Users's last try was bad, beep in displeasure.
+ * Here we have the code waiting for user input or a timeout.
*/
-main.10: movb $ASCII_BEL,%al # Signal
- callw putchr # beep!
+beep: movb $ASCII_BEL,%al # Input error, print or beep
+ callw putchr
+
+start_input:
/*
- * Start of input loop. Take note of time
+ * Actual Start of input loop. Take note of time
*/
-main.7_1: xorb %ah,%ah # BIOS: Get
+ xorb %ah,%ah # BIOS: Get
int $0x1a # system time
movw %dx,%di # Ticks when
addw _TICKS(%bp),%di # timeout
+read_key:
/*
* Busy loop, looking for keystrokes but keeping one eye on the time.
*/
-main.8:
#ifndef SIO
movb $0x1,%ah # BIOS: Check
int $0x16 # for keypress
- jnz main.11 # Have one
#else /* SIO */
movb $0x03,%ah # BIOS: Read COM
call bioscom
testb $0x01,%ah # Check line status
- jnz main.11 # (bit 1 indicates input)
+ # (bit 1 indicates input)
#endif /* SIO */
- xorb %ah,%ah # BIOS: Get
- int $0x1a # system time
+ jnz got_key # Have input
+ xorb %ah,%ah # BIOS: int 0x1a, 00
+ int $0x1a # get system time
cmpw %di,%dx # Timeout?
- jb main.8 # No
+ jb read_key # No
+
/*
- * If timed out or defaulting, come here.
+ * Timed out or default selection
*/
-main.9: movb _OPT(%bp),%al # Load default
- jmp main.12 # Join common code
+use_default: movb _OPT(%bp),%al # Load default
+ orb $NOUPDATE,_FLAGS(%bp) # Disable updates
+ jmp check_selection # Join common code
+
/*
* Get the keystroke.
+ * ENTER or CR confirm the current selection (same as a timeout).
+ * Otherwise convert F1..F6 (or '1'..'6') to 0..5 and check if the
+ * selection is valid.
+ * The SIO code uses ascii chars, the console code uses scancodes.
*/
-main.11:
+got_key:
#ifndef SIO
- xorb %ah,%ah # BIOS: Get
- int $0x16 # keypress
- movb %ah,%al # Scan code
+ xorb %ah,%ah # BIOS: int 0x16, 00
+ int $0x16 # get keypress
+ movb %ah,%al # move scan code to %al
+ cmpb $KEY_ENTER,%al
#else
movb $0x02,%ah # BIOS: Receive
call bioscom
+ cmpb $ASCII_CR,%al
#endif
+ je use_default # enter -> default
/*
- * If it's CR act as if timed out.
- */
-#ifndef SIO
- cmpb $KEY_ENTER,%al # Enter pressed?
-#else
- cmpb $ASCII_CR,%al # Enter pressed?
-#endif
- je main.9 # Yes
-/*
- * Otherwise check if legal. If not ask again.
- */
-#ifndef SIO
- subb $KEY_F1,%al # Less F1 scan code
- cmpb $0x4,%al # F1..F5?
- jna main.12 # Yes
+ * Check if the key is acceptable, and loop back if not.
+ * The console (non-SIO) code looks at scancodes and accepts
+ * both F1..F6 and 1..6 (the latter costs 6 bytes of code),
+ * relying on the fact that F1..F6 have higher scancodes than 1..6
+ * The SIO code only takes 1..6
+ */
+#ifdef SIO /* SIO mode, use ascii values */
+ subb $'1',%al # Subtract '1' ascii code
+#else /* console mode -- use scancodes */
+ subb $KEY_F1,%al /* Subtract F1 scan code */
+#if !defined(ONLY_F_KEYS)
+ cmpb $0x5,%al # F1..F6
+ jna 3f # Yes
subb $(KEY_1 - KEY_F1),%al # Less #1 scan code
-#else
- subb $'1',%al # Less '1' ascii character
-#endif
- cmpb $0x4,%al # #1..#5?
- ja main.10 # No
+ 3:
+#endif /* ONLY_F_KEYS */
+#endif /* SIO */
+ cmpb $0x5,%al # F1..F6 or 1..6 ?
+#ifdef PXE /* enable PXE/INT18 using F6 */
+ jne 1f;
+ int $0x18 # found F6, try INT18
+ 1:
+#endif /* PXE */
+ jae beep # Not in F1..F5, beep
+
+check_selection:
/*
* We have a selection. If it's a bad selection go back to complain.
* The bits in MNUOPT were set when the options were printed.
* Anything not printed is not an option.
*/
-main.12: cbtw # Option
- btw %ax,_MNUOPT(%bp) # enabled?
- jnc main.10 # No
+ cbtw # Extend (%ah=0 used later)
+ btw %ax,_MNUOPT(%bp) # Option enabled?
+ jnc beep # No
/*
* Save the info in the original tables
* for rewriting to the disk.
*/
movb %al,_OPT(%bp) # Save option
- movw $FAKE,%si # Partition for write
- movb (%si),%dl # Drive number
+
+ /*
+ * Make %si and %bx point to the fake partition at LBA 0 (CHS 0:0:1).
+ * Because the correct address is already in %bp, just use it.
+ * Set %dl with the drive number saved in byte 0.
+ * If we have pressed F5 or 5, then this is a good, fake value
+ * to present to the next stage boot code.
+ */
+ movw %bp,%si # Partition for write
+ movb (%si),%dl # Drive number, saved above
movw %si,%bx # Partition for read
cmpb $0x4,%al # F5/#5 pressed?
- pushf # Save
- je main.13 # Yes
+ pushf # Save results for later
+ je 1f # Yes, F5
+
+ /*
+ * F1..F4 was pressed, so make %bx point to the currently
+ * selected partition, and leave the drive number unchanged.
+ */
shlb $0x4,%al # Point to
addw $partbl,%ax # selected
xchgw %bx,%ax # partition
movb $0x80,(%bx) # Flag active
/*
* If not asked to do a write-back (flags 0x40) don't do one.
+ * Around the call, save the partition pointer to %bx and
+ * restore to %si which is where the next stage expects it.
*/
-main.13: pushw %bx # Save
- testb $0x40,_FLAGS(%bp) # No updates?
- jnz main.14 # Yes
+ 1: pushw %bx # Save
+ testb $NOUPDATE,_FLAGS(%bp) # No updates?
+ jnz 2f # skip update
movw $start,%bx # Data to write
movb $0x3,%ah # Write sector
callw intx13 # to disk
-main.14: popw %si # Restore
- popf # Restore
+ 2: popw %si # Restore
+
/*
* If going to next drive, replace drive with selected one.
* Remember to un-ascii it. Hey 0x80 is already set, cool!
*/
- jne main.15 # If not F5/#5
+ popf # Restore %al test results
+ jne 3f # If not F5/#5
movb _NXTDRV(%bp),%dl # Next drive
subb $'0',%dl # number
/*
- * Load selected bootsector to the LOAD location in RAM.
- * If it fails to read or isn't marked bootable, treat it as a bad selection.
+ * Load selected bootsector to the LOAD location in RAM. If read
+ * fails or there is no 0x55aa marker, treat it as a bad selection.
*/
-main.15: movw $LOAD,%bx # Address for read
+ 3: movw $LOAD,%bx # Address for read
movb $0x2,%ah # Read sector
callw intx13 # from disk
- jc main.10 # If error
+ jc beep # If error
cmpw $MAGIC,0x1fe(%bx) # Bootable?
- jne main.10 # No
+ jne beep # No
pushw %si # Save ptr to selected part.
callw putn # Leave some space
popw %si # Restore, next stage uses it
@@ -326,64 +496,80 @@ main.15: movw $LOAD,%bx # Address for
/*
* Display routines
+ * putkey prints the option selected in %dl (F1..F5 or 1..5) followed by
+ * the string at %si
+ * putx: print the option in %dl followed by the string at %di
+ * also record the drive as valid.
+ * putn: print a crlf
+ * putstr: print the string at %si
+ * putchr: print the char in al
*/
-putkey:
-#ifndef SIO
- movb $'F',%al # Display
- callw putchr # 'F'
-#endif
- movb $'1',%al # Prepare
- addb %dl,%al # digit
- jmp putstr.1 # Display the rest
/*
- * Display the option and note that it is a valid option.
- * That last point is a bit tricky..
+ * Display the option and record the drive as valid in the options.
+ * That last point is done using the btsw instruction which does
+ * a test and set. We don't care for the test part.
*/
putx: btsw %dx,_MNUOPT(%bp) # Enable menu option
movw $item,%si # Display
callw putkey # key
movw %di,%si # Display the rest
-
-puts: callw putstr # Display string
+ callw putstr # Display string
putn: movw $crlf,%si # To next line
+ jmp putstr
+
+putkey:
+#ifndef SIO
+ movb $'F',%al # Display
+ callw putchr # 'F'
+#endif
+ movb $'1',%al # Prepare
+ addb %dl,%al # digit
+putstr.1: callw putchr # Display char
putstr: lodsb # Get byte
testb $0x80,%al # End of string?
- jnz putstr.2 # Yes
-putstr.1: callw putchr # Display char
- jmp putstr # Continue
-putstr.2: andb $~0x80,%al # Clear MSB
+ jz putstr.1 # No
+ andb $~0x80,%al # Clear MSB then print last
-#ifndef SIO
putchr:
+#ifndef SIO
pushw %bx # Save
movw $0x7,%bx # Page:attribute
movb $0xe,%ah # BIOS: Display
int $0x10 # character
popw %bx # Restore
- retw # To caller
#else /* SIO */
-putchr:
movb $0x01,%ah # BIOS: Send
bioscom:
pushw %dx # Save
xorw %dx,%dx # Use COM1
int $0x14 # Character
popw %dx # Restore
- retw # To caller
#endif /* SIO */
+ retw # To caller
/* One-sector disk I/O routine */
-intx13: movb 0x1(%si),%dh # Load head
+/*
+ * %dl: drive, %si partition entry, %es:%bx transfer buffer.
+ * Load the CHS values and possibly the LBA address from the block
+ * at %si, and use the appropriate method to load the sector.
+ * Don't use packet mode for a floppy.
+ */
+intx13: # Prepare CHS parameters
+ movb 0x1(%si),%dh # Load head
movw 0x2(%si),%cx # Load cylinder:sector
movb $0x1,%al # Sector count
pushw %si # Save
movw %sp,%di # Save
- testb $0x80,_FLAGS(%bp) # Use packet interface?
- jz intx13.1 # No
+#ifndef CHECK_DRIVE /* floppy support */
+ testb %dl, %dl # is this a floppy ?
+ jz 1f # Yes, use CHS mode
+#endif
+ testb $USEPACKET,_FLAGS(%bp) # Use packet interface?
+ jz 1f # No
pushl $0x0 # Set the
pushl 0x8(%si) # LBA address
pushw %es # Set the transfer
@@ -393,73 +579,104 @@ intx13: movb 0x1(%si),%dh # Load head
movw %sp,%si # Packet pointer
decw %ax # Verify off
orb $0x40,%ah # Use disk packet
-intx13.1: int $0x13 # BIOS: Disk I/O
+ 1: int $0x13 # BIOS: Disk I/O
movw %di,%sp # Restore
popw %si # Restore
retw # To caller
-/* Menu strings */
-
+/*
+ * Various menu strings. 'item' goes after 'prompt' to save space.
+ * Also use shorter versions to make room for the PXE/INT18 code.
+ */
+prompt:
+#ifdef PXE
+ .ascii "\nF6 PXE\r"
+#endif
+ .ascii "\nBoot:"
item: .ascii " "; .byte ' '|0x80
-prompt: .ascii "\nDefault:"; .byte ' '|0x80
crlf: .ascii "\r"; .byte '\n'|0x80
/* Partition type tables */
-tables:
+bootable_ids:
/*
- * These entries identify invalid or NON BOOT types and partitions.
- */
- .byte 0x0, 0x5, 0xf
+ * These values indicate bootable types we know about.
+ * Corresponding descriptions are at desc_ofs:
+ * Entries don't need to be sorted.
+ */
+ .byte 0x83, 0xa5, 0xa6, 0xa9, 0x06, 0x07, 0x0b
+#ifndef SAVE_MORE_MEMORY
+ .byte 0x05 # extended partition
+#endif
+#ifndef SAVE_MEMORY /* other DOS partitions */
+ .byte 0x01 # FAT12
+ .byte 0x04 # FAT16 < 32M
+#endif
+
+desc_ofs:
/*
- * These values indicate bootable types we know the names of.
- */
- .byte 0x1, 0x6, 0x7, 0xb, 0xc, 0xe, 0x83
- .byte 0xa5, 0xa6, 0xa9
-/*
- * These are offsets that match the known names above and point to the strings
- * that will be printed. os_misc will be used if the search of the above table
- * runs over.
- */
- .byte os_dos-. # DOS
- .byte os_dos-. # DOS
- .byte os_dos-. # Windows
- .byte os_dos-. # Windows
- .byte os_dos-. # Windows
- .byte os_dos-. # Windows
- .byte os_linux-. # Linux
- .byte os_freebsd-. # FreeBSD
- .byte os_bsd-. # OpenBSD
- .byte os_bsd-. # NetBSD
+ * Offsets that match the known types above, used to point to the
+ * actual partition name. The last entry must point to os_misc,
+ * which is used for non-matching names.
+ */
+ .byte os_linux-. # 131, Linux
+ .byte os_freebsd-. # 165, FreeBSD
+ .byte os_bsd-. # 166, OpenBSD
+ .byte os_bsd-. # 169, NetBSD
+ .byte os_dos-. # 6, FAT16 >= 32M
+ .byte os_win-. # 7, NTFS
+ .byte os_win-. # 11, FAT32
+
+#ifndef SAVE_MORE_MEMORY
+ .byte os_ext-. # 5, DOS Ext
+#endif
+#ifndef SAVE_MEMORY
+ .byte os_dos-. # 1, FAT12 DOS
+ .byte os_dos-. # 4, FAT16 <32M
+#endif
.byte os_misc-. # Unknown
+
/*
- * And here are the strings themselves. 0x80 or'd into a byte indicates
- * the end of the string. (not so great for Russians but...)
+ * And here are the strings themselves. The last byte of
+ * the string has bit 7 set.
*/
-os_misc: .ascii "?"; .byte '?'|0x80
-os_dos: .ascii "DO"; .byte 'S'|0x80
+os_misc: .byte '?'|0x80
+os_dos:
+#ifndef SAVE_MORE_MEMORY /* 'DOS' remapped to 'WIN' if no room */
+ .ascii "DO"; .byte 'S'|0x80
+#endif
+os_win: .ascii "Wi"; .byte 'n'|0x80
os_linux: .ascii "Linu"; .byte 'x'|0x80
os_freebsd: .ascii "Free"
os_bsd: .ascii "BS"; .byte 'D'|0x80
+#ifndef SAVE_MORE_MEMORY
+os_ext: .ascii "EX"; .byte 'T'|0x80
+#endif
- .org PRT_OFF-0xe,0x90
-
- .word B0MAGIC # Magic number
-
+ .org (0x200 + B0_OFF),0x90
/*
- * These values are sometimes changed before writing back to the drive
+ * The boot0 version 1.0 parameter table.
+ * Do not move it nor change the "Drive " string, boot0cfg
+ * uses its offset and content to identify the boot sector.
+ * The other fields are sometimes changed before writing back to the drive
* Be especially careful that nxtdrv: must come after drive:, as it
* is part of the same string.
*/
drive: .ascii "Drive "
nxtdrv: .byte 0x0 # Next drive number
opt: .byte 0x0 # Option
-setdrv: .byte 0x80 # Drive to force
+setdrv_num: .byte 0x80 # Drive to force
flags: .byte FLAGS # Flags
+#ifdef VOLUME_SERIAL
+ .byte 0xa8,0xa8,0xa8,0xa8 # Volume Serial Number
+#endif
ticks: .word TICKS # Delay
+ .org PRT_OFF
/*
* Here is the 64 byte partition table that fdisk would fiddle with.
*/
partbl: .fill 0x40,0x1,0x0 # Partition table
.word MAGIC # Magic number
+ .org 0x200 # again, safety check
+endblock:
Modified: stable/7/usr.sbin/boot0cfg/boot0cfg.8
==============================================================================
--- stable/7/usr.sbin/boot0cfg/boot0cfg.8 Tue Jan 13 22:15:47 2009 (r187197)
+++ stable/7/usr.sbin/boot0cfg/boot0cfg.8 Tue Jan 13 22:28:48 2009 (r187198)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 7, 2007
+.Dd January 13, 2009
.Dt BOOT0CFG 8
.Os
.Sh NAME
@@ -35,7 +35,9 @@
.Op Fl Bv
.Op Fl b Ar boot0
.Op Fl d Ar drive
+.Op Fl e Ar bell character
.Op Fl f Ar file
+.Op Fl i Ar volume-id
.Op Fl m Ar mask
.Op Fl o Ar options
.Op Fl s Ar slice
@@ -96,10 +98,17 @@ which contains the specified
Typically this will be 0x80 for the first hard drive, 0x81 for the
second hard drive, and so on; however any integer between 0 and 0xff
is acceptable here.
+.It Fl e Ar bell character
+Set the character to be printed in case of input error.
.It Fl f Ar file
Specify that a backup copy of the preexisting MBR should be written to
.Ar file .
This file is created if it does not exist, and replaced if it does.
+.It Fl i Ar volume-id
+Specifies a volume-id (in the form XXXX-XXXX) to be saved at location
+0x1b8 in the MBR. This information is sometimes used by NT, XP and Vista
+to identify the disk drive. The option is only compatible with version 2.00
+of the 512-byte boot block.
.It Fl m Ar mask
Specify slices to be enabled/disabled, where
.Ar mask
@@ -144,6 +153,21 @@ Set the timeout value to
.It Fl v
Verbose: display information about the slices defined, etc.
.El
+.Sh NOTE
+Protection mechanisms in the
+.Xr geom 4
+subsystem might prevent
+.Nm
+from being able to update the MBR on a mounted disk.
+Instructions for temporarily disabling these protection mechanisms
+can be found in the
+.Xr geom 4
+manpage. Specifically, do a
+.Pp
+.Dl sysctl kern.geom.debugflags=0x10
+.Pp
+to allow writing to the MBR, and restore it to 0 afterwards.
+.Pp
.Sh FILES
.Bl -tag -width /boot/boot0sio -compact
.It Pa /boot/boot0
@@ -177,16 +201,6 @@ to install the default MBR:
.Sh AUTHORS
.An Robert Nordier Aq rnordier@FreeBSD.org .
.Sh BUGS
-Protection mechanisms in the
-.Xr geom 4
-subsystem might prevent
-.Nm
-from being able to update the MBR on a mounted disk.
-Instructions for temporarily disabling these protection mechanisms
-can be found in the
-.Xr geom 4
-manpage.
-.Pp
Use of the
.Sq packet
option may cause
@@ -195,6 +209,6 @@ to fail, depending on the nature of BIOS
.Pp
Use of the
.Sq setdrv
-option with an incorrect -d operand may cause the MBR to be written
-to the wrong disk.
-Be careful!
+option with an incorrect -d operand may cause the boot0 code
+to write the MBR to the wrong disk, thus trashing its previous
+content. Be careful.
Modified: stable/7/usr.sbin/boot0cfg/boot0cfg.c
==============================================================================
--- stable/7/usr.sbin/boot0cfg/boot0cfg.c Tue Jan 13 22:15:47 2009 (r187197)
+++ stable/7/usr.sbin/boot0cfg/boot0cfg.c Tue Jan 13 22:28:48 2009 (r187198)
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2008 Luigi Rizzo
* Copyright (c) 1999 Robert Nordier
* All rights reserved.
*
@@ -44,13 +45,34 @@ __FBSDID("$FreeBSD$");
#define MBRSIZE 512 /* master boot record size */
-#define OFF_VERSION 0x1b0 /* offset: version number */
-#define OFF_OPT 0x1b9 /* offset: default boot option */
-#define OFF_DRIVE 0x1ba /* offset: setdrv drive */
-#define OFF_FLAGS 0x1bb /* offset: option flags */
-#define OFF_TICKS 0x1bc /* offset: clock ticks */
+#define OFF_VERSION 0x1b0 /* offset: version number, only boot0version */
+#define OFF_SERIAL 0x1b8 /* offset: volume serial number */
#define OFF_PTBL 0x1be /* offset: partition table */
#define OFF_MAGIC 0x1fe /* offset: magic number */
+/*
+ * Offsets to the parameters of the 512-byte boot block.
+ * For historical reasons they are set as macros
+ */
+struct opt_offsets {
+ int opt;
+ int drive;
+ int flags;
+ int ticks;
+};
+
+struct opt_offsets b0_ofs[] = {
+ { 0x0, 0x0, 0x0, 0x0 }, /* no boot block */
+ { 0x1b9, 0x1ba, 0x1bb, 0x1bc }, /* original block */
+ { 0x1b5, 0x1b6, 0x1b7, 0x1bc }, /* NT_SERIAL block */
+};
+
+int b0_ver; /* boot block version set by boot0bs */
+
+#define OFF_OPT (b0_ofs[b0_ver].opt) /* default boot option */
+#define OFF_DRIVE (b0_ofs[b0_ver].drive) /* setdrv drive */
+#define OFF_FLAGS (b0_ofs[b0_ver].flags) /* option flags */
+#define OFF_TICKS (b0_ofs[b0_ver].ticks) /* clock ticks */
+
#define cv2(p) ((p)[0] | (p)[1] << 010)
@@ -82,8 +104,12 @@ static int boot0bs(const u_int8_t *);
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From luigi at FreeBSD.org Tue Jan 13 14:46:26 2009
From: luigi at FreeBSD.org (Luigi Rizzo)
Date: Tue Jan 13 14:46:33 2009
Subject: svn commit: r187200 - stable/7/lib/libstand
Message-ID: <200901132246.n0DMkOUw018605@svn.freebsd.org>
Author: luigi
Date: Tue Jan 13 22:46:24 2009
New Revision: 187200
URL: http://svn.freebsd.org/changeset/base/187200
Log:
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.
Modified:
stable/7/lib/libstand/bootp.c
Modified: stable/7/lib/libstand/bootp.c
==============================================================================
--- stable/7/lib/libstand/bootp.c Tue Jan 13 22:35:26 2009 (r187199)
+++ stable/7/lib/libstand/bootp.c Tue Jan 13 22:46:24 2009 (r187200)
@@ -47,6 +47,12 @@ __FBSDID("$FreeBSD$");
#define BOOTP_DEBUGxx
#define SUPPORT_DHCP
+#define DHCP_ENV_NOVENDOR 1 /* do not parse vendor options */
+#define DHCP_ENV_PXE 10 /* assume pxe vendor options */
+#define DHCP_ENV_FREEBSD 11 /* assume freebsd vendor options
+/* set DHCP_ENV to one of the values above to export dhcp options to kenv */
+#define DHCP_ENV DHCP_ENV_NO_VENDOR
+
#include "stand.h"
#include "net.h"
#include "netif.h"
@@ -72,6 +78,13 @@ static int vend_rfc1048(u_char *, u_int)
static void vend_cmu(u_char *);
#endif
+#ifdef DHCP_ENV /* export the dhcp response to kenv */
+struct dhcp_opt;
+static void setenv_(u_char *cp, u_char *ep, struct dhcp_opt *opts);
+#else
+#define setenv_(a, b, c)
+#endif
+
#ifdef SUPPORT_DHCP
static char expected_dhcpmsgtype = -1, dhcp_ok;
struct in_addr dhcp_serverip;
@@ -351,6 +364,8 @@ vend_rfc1048(cp, len)
/* Step over magic cookie */
cp += sizeof(int);
+ setenv_(cp, ep, NULL);
+
while (cp < ep) {
tag = *cp++;
size = *cp++;
@@ -412,3 +427,316 @@ vend_cmu(cp)
}
}
#endif
+
+#ifdef DHCP_ENV
+/*
+ * Parse DHCP options and store them into kenv variables.
+ * Original code from Danny Braniss, modifications by Luigi Rizzo.
+ *
+ * The parser is driven by tables which specify the type and name of
+ * each dhcp option and how it appears in kenv.
+ * The first entry in the list contains the prefix used to set the kenv
+ * name (including the . if needed), the last entry must have a 0 tag.
+ * Entries do not need to be sorted though it helps for readability.
+ *
+ * Certain vendor-specific tables can be enabled according to DHCP_ENV.
+ * Set it to 0 if you don't want any.
+ */
+enum opt_fmt { __NONE = 0,
+ __8 = 1, __16 = 2, __32 = 4, /* Unsigned fields, value=size */
+ __IP, /* IPv4 address */
+ __TXT, /* C string */
+ __BYTES, /* byte sequence, printed %02x */
+ __INDIR, /* name=value */
+ __ILIST, /* name=value;name=value ... */
+ __VE, /* vendor specific, recurse */
+};
+
+struct dhcp_opt {
+ uint8_t tag;
+ uint8_t fmt;
+ const char *desc;
+};
+
+static struct dhcp_opt vndr_opt[] = { /* Vendor Specific Options */
+#if DHCP_ENV == DHCP_ENV_FREEBSD /* FreeBSD table in the original code */
+ {0, 0, "FreeBSD"}, /* prefix */
+ {1, __TXT, "kernel"},
+ {2, __TXT, "kernelname"},
+ {3, __TXT, "kernel_options"},
+ {4, __IP, "usr-ip"},
+ {5, __TXT, "conf-path"},
+ {6, __TXT, "rc.conf0"},
+ {7, __TXT, "rc.conf1"},
+ {8, __TXT, "rc.conf2"},
+ {9, __TXT, "rc.conf3"},
+ {10, __TXT, "rc.conf4"},
+ {11, __TXT, "rc.conf5"},
+ {12, __TXT, "rc.conf6"},
+ {13, __TXT, "rc.conf7"},
+ {14, __TXT, "rc.conf8"},
+ {15, __TXT, "rc.conf9"},
+
+ {20, __TXT, "boot.nfsroot.options"},
+
+ {245, __INDIR, ""},
+ {246, __INDIR, ""},
+ {247, __INDIR, ""},
+ {248, __INDIR, ""},
+ {249, __INDIR, ""},
+ {250, __INDIR, ""},
+ {251, __INDIR, ""},
+ {252, __INDIR, ""},
+ {253, __INDIR, ""},
+ {254, __INDIR, ""},
+
+#elif DHCP_ENV == DHCP_ENV_PXE /* some pxe options, RFC4578 */
+ {0, 0, "pxe"}, /* prefix */
+ {93, __16, "system-architecture"},
+ {94, __BYTES, "network-interface"},
+ {97, __BYTES, "machine-identifier"},
+#else /* default (empty) table */
+ {0, 0, "dhcp.vendor."}, /* prefix */
+#endif
+ {0, __TXT, "%soption-%d"}
+};
+
+static struct dhcp_opt dhcp_opt[] = {
+ /* DHCP Option names, formats and codes, from RFC2132. */
+ {0, 0, "dhcp."}, // prefix
+ {1, __IP, "subnet-mask"},
+ {2, __32, "time-offset"}, /* this is signed */
+ {3, __IP, "routers"},
+ {4, __IP, "time-servers"},
+ {5, __IP, "ien116-name-servers"},
+ {6, __IP, "domain-name-servers"},
+ {7, __IP, "log-servers"},
+ {8, __IP, "cookie-servers"},
+ {9, __IP, "lpr-servers"},
+ {10, __IP, "impress-servers"},
+ {11, __IP, "resource-location-servers"},
+ {12, __TXT, "host-name"},
+ {13, __16, "boot-size"},
+ {14, __TXT, "merit-dump"},
+ {15, __TXT, "domain-name"},
+ {16, __IP, "swap-server"},
+ {17, __TXT, "root-path"},
+ {18, __TXT, "extensions-path"},
+ {19, __8, "ip-forwarding"},
+ {20, __8, "non-local-source-routing"},
+ {21, __IP, "policy-filter"},
+ {22, __16, "max-dgram-reassembly"},
+ {23, __8, "default-ip-ttl"},
+ {24, __32, "path-mtu-aging-timeout"},
+ {25, __16, "path-mtu-plateau-table"},
+ {26, __16, "interface-mtu"},
+ {27, __8, "all-subnets-local"},
+ {28, __IP, "broadcast-address"},
+ {29, __8, "perform-mask-discovery"},
+ {30, __8, "mask-supplier"},
+ {31, __8, "perform-router-discovery"},
+ {32, __IP, "router-solicitation-address"},
+ {33, __IP, "static-routes"},
+ {34, __8, "trailer-encapsulation"},
+ {35, __32, "arp-cache-timeout"},
+ {36, __8, "ieee802-3-encapsulation"},
+ {37, __8, "default-tcp-ttl"},
+ {38, __32, "tcp-keepalive-interval"},
+ {39, __8, "tcp-keepalive-garbage"},
+ {40, __TXT, "nis-domain"},
+ {41, __IP, "nis-servers"},
+ {42, __IP, "ntp-servers"},
+ {43, __VE, "vendor-encapsulated-options"},
+ {44, __IP, "netbios-name-servers"},
+ {45, __IP, "netbios-dd-server"},
+ {46, __8, "netbios-node-type"},
+ {47, __TXT, "netbios-scope"},
+ {48, __IP, "x-font-servers"},
+ {49, __IP, "x-display-managers"},
+ {50, __IP, "dhcp-requested-address"},
+ {51, __32, "dhcp-lease-time"},
+ {52, __8, "dhcp-option-overload"},
+ {53, __8, "dhcp-message-type"},
+ {54, __IP, "dhcp-server-identifier"},
+ {55, __8, "dhcp-parameter-request-list"},
+ {56, __TXT, "dhcp-message"},
+ {57, __16, "dhcp-max-message-size"},
+ {58, __32, "dhcp-renewal-time"},
+ {59, __32, "dhcp-rebinding-time"},
+ {60, __TXT, "vendor-class-identifier"},
+ {61, __TXT, "dhcp-client-identifier"},
+ {64, __TXT, "nisplus-domain"},
+ {65, __IP, "nisplus-servers"},
+ {66, __TXT, "tftp-server-name"},
+ {67, __TXT, "bootfile-name"},
+ {68, __IP, "mobile-ip-home-agent"},
+ {69, __IP, "smtp-server"},
+ {70, __IP, "pop-server"},
+ {71, __IP, "nntp-server"},
+ {72, __IP, "www-server"},
+ {73, __IP, "finger-server"},
+ {74, __IP, "irc-server"},
+ {75, __IP, "streettalk-server"},
+ {76, __IP, "streettalk-directory-assistance-server"},
+ {77, __TXT, "user-class"},
+ {85, __IP, "nds-servers"},
+ {86, __TXT, "nds-tree-name"},
+ {87, __TXT, "nds-context"},
+ {210, __TXT, "authenticate"},
+
+ /* use the following entries for arbitrary variables */
+ {246, __ILIST, ""},
+ {247, __ILIST, ""},
+ {248, __ILIST, ""},
+ {249, __ILIST, ""},
+ {250, __INDIR, ""},
+ {251, __INDIR, ""},
+ {252, __INDIR, ""},
+ {253, __INDIR, ""},
+ {254, __INDIR, ""},
+ {0, __TXT, "%soption-%d"}
+};
+
+/*
+ * parse a dhcp response, set environment variables translating options
+ * names and values according to the tables above. Also set dhcp.tags
+ * to the list of selected tags.
+ */
+static void
+setenv_(u_char *cp, u_char *ep, struct dhcp_opt *opts)
+{
+ u_char *ncp;
+ u_char tag;
+ char tags[512], *tp; /* the list of tags */
+
+#define FLD_SEP ',' /* separator in list of elements */
+ ncp = cp;
+ tp = tags;
+ if (opts == NULL)
+ opts = dhcp_opt;
+
+ while (ncp < ep) {
+ unsigned int size; /* option size */
+ char *vp, *endv, buf[256]; /* the value buffer */
+ struct dhcp_opt *op;
+
+ tag = *ncp++; /* extract tag and size */
+ size = *ncp++;
+ cp = ncp; /* current payload */
+ ncp += size; /* point to the next option */
+
+ if (tag == TAG_END)
+ break;
+ if (tag == 0)
+ continue;
+
+ for (op = opts+1; op->tag && op->tag != tag; op++)
+ ;
+ /* if not found we end up on the default entry */
+
+ /*
+ * Copy data into the buffer. libstand does not have snprintf so we
+ * need to be careful with sprintf(). With strings, the source is
+ * always <256 char so shorter than the buffer so we are safe; with
+ * other arguments, the longest string is inet_ntoa which is 16 bytes
+ * so we make sure to have always enough room in the string before
+ * trying an sprint.
+ */
+ vp = buf;
+ *vp = '\0';
+ endv = buf + sizeof(buf) - 1 - 16; /* last valid write position */
+
+ switch(op->fmt) {
+ case __NONE:
+ break; /* should not happen */
+
+ case __VE: /* recurse, vendor specific */
+ setenv_(cp, cp+size, vndr_opt);
+ break;
+
+ case __IP: /* ip address */
+ for (; size > 0 && vp < endv; size -= 4, cp += 4) {
+ struct in_addr in_ip; /* ip addresses */
+ if (vp != buf)
+ *vp++ = FLD_SEP;
+ bcopy(cp, &in_ip.s_addr, sizeof(in_ip.s_addr));
+ sprintf(vp, "%s", inet_ntoa(in_ip));
+ vp += strlen(vp);
+ }
+ break;
+
+ case __BYTES: /* opaque byte string */
+ for (; size > 0 && vp < endv; size -= 1, cp += 1) {
+ sprintf(vp, "%02x", *cp);
+ vp += strlen(vp);
+ }
+ break;
+
+ case __TXT:
+ bcopy(cp, buf, size); /* cannot overflow */
+ buf[size] = 0;
+ break;
+
+ case __32:
+ case __16:
+ case __8: /* op->fmt is also the length of each field */
+ for (; size > 0 && vp < endv; size -= op->fmt, cp += op->fmt) {
+ uint32_t v;
+ if (op->fmt == __32)
+ v = (cp[0]<<24) + (cp[1]<<16) + (cp[2]<<8) + cp[3];
+ else if (op->fmt == __16)
+ v = (cp[0]<<8) + cp[1];
+ else
+ v = cp[0];
+ if (vp != buf)
+ *vp++ = FLD_SEP;
+ sprintf(vp, "%u", v);
+ vp += strlen(vp);
+ }
+ break;
+
+ case __INDIR: /* name=value */
+ case __ILIST: /* name=value;name=value... */
+ bcopy(cp, buf, size); /* cannot overflow */
+ buf[size] = '\0';
+ for (endv = buf; endv; endv = vp) {
+ u_char *s = NULL; /* semicolon ? */
+
+ /* skip leading whitespace */
+ while (*endv && index(" \t\n\r", *endv))
+ endv++;
+ vp = index(endv, '='); /* find name=value separator */
+ if (!vp)
+ break;
+ *vp++ = 0;
+ if (op->fmt == __ILIST && (s = index(vp, ';')))
+ *s++ = '\0';
+ setenv(endv, vp, 1);
+ vp = s; /* prepare for next round */
+ }
+ buf[0] = '\0'; /* option already done */
+ }
+
+ if (tp - tags < sizeof(tags) - 5) { /* add tag to the list */
+ if (tp != tags)
+ *tp++ = FLD_SEP;
+ sprintf(tp, "%d", tag);
+ tp += strlen(tp);
+ }
+ if (buf[0]) {
+ char env[128]; /* the string name */
+
+ if (op->tag == 0)
+ sprintf(env, op->desc, opts[0].desc, tag);
+ else
+ sprintf(env, "%s%s", opts[0].desc, op->desc);
+ setenv(env, buf, 1);
+ }
+ }
+ if (tp != tags) {
+ char env[128]; /* the string name */
+ sprintf(env, "%stags", opts[0].desc);
+ setenv(env, tags, 1);
+ }
+}
+#endif /* additional dhcp */
From luigi at FreeBSD.org Tue Jan 13 15:02:59 2009
From: luigi at FreeBSD.org (Luigi Rizzo)
Date: Tue Jan 13 15:03:18 2009
Subject: svn commit: r187201 - stable/7/usr.sbin/kldxref
Message-ID: <200901132302.n0DN2sUX019014@svn.freebsd.org>
Author: luigi
Date: Tue Jan 13 23:02:54 2009
New Revision: 187201
URL: http://svn.freebsd.org/changeset/base/187201
Log:
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.
Modified:
stable/7/usr.sbin/kldxref/Makefile
stable/7/usr.sbin/kldxref/ef_i386.c
stable/7/usr.sbin/kldxref/ef_obj.c
stable/7/usr.sbin/kldxref/fileformat
stable/7/usr.sbin/kldxref/kldxref.c
Modified: stable/7/usr.sbin/kldxref/Makefile
==============================================================================
--- stable/7/usr.sbin/kldxref/Makefile Tue Jan 13 22:46:24 2009 (r187200)
+++ stable/7/usr.sbin/kldxref/Makefile Tue Jan 13 23:02:54 2009 (r187201)
@@ -5,6 +5,7 @@ MAN= kldxref.8
SRCS= kldxref.c ef.c ef_obj.c
WARNS?= 2
+CFLAGS+=-fno-strict-aliasing
.if exists(ef_${MACHINE_ARCH}.c)
SRCS+= ef_${MACHINE_ARCH}.c
Modified: stable/7/usr.sbin/kldxref/ef_i386.c
==============================================================================
--- stable/7/usr.sbin/kldxref/ef_i386.c Tue Jan 13 22:46:24 2009 (r187200)
+++ stable/7/usr.sbin/kldxref/ef_i386.c Tue Jan 13 23:02:54 2009 (r187201)
@@ -43,12 +43,13 @@
*/
int
ef_reloc(struct elf_file *ef, const void *reldata, int reltype, Elf_Off relbase,
- Elf_Off dataoff, size_t len, void *dest)
+ Elf_Off dataoff, size_t len, void *_dest)
{
Elf_Addr *where, addr, addend;
Elf_Size rtype, symidx;
const Elf_Rel *rel;
const Elf_Rela *rela;
+ char *dest = _dest;
switch (reltype) {
case EF_RELOC_REL:
Modified: stable/7/usr.sbin/kldxref/ef_obj.c
==============================================================================
--- stable/7/usr.sbin/kldxref/ef_obj.c Tue Jan 13 22:46:24 2009 (r187200)
+++ stable/7/usr.sbin/kldxref/ef_obj.c Tue Jan 13 23:02:54 2009 (r187201)
@@ -133,7 +133,7 @@ static struct elf_file_ops ef_obj_file_o
};
static int
-ef_obj_get_type(elf_file_t ef)
+ef_obj_get_type(elf_file_t __unused ef)
{
return (EFT_KLD);
@@ -180,7 +180,7 @@ ef_obj_symaddr(elf_file_t ef, Elf_Size s
{
const Elf_Sym *sym;
- if (symidx >= ef->ddbsymcnt)
+ if (symidx >= (size_t) ef->ddbsymcnt)
return (0);
sym = ef->ddbsymtab + symidx;
Modified: stable/7/usr.sbin/kldxref/fileformat
==============================================================================
--- stable/7/usr.sbin/kldxref/fileformat Tue Jan 13 22:46:24 2009 (r187200)
+++ stable/7/usr.sbin/kldxref/fileformat Tue Jan 13 23:02:54 2009 (r187201)
@@ -1,7 +1,9 @@
$FreeBSD$
- linker.hints file consists from the one or more records. First record of
-file is special and determines its version:
+linker.hints file consists from the one or more records,
+and is processed by sys/kern/kern_linker.c::linker_hints_lookup()
+
+First record of file is special and determines its version:
int version;
@@ -16,25 +18,28 @@ struct record {
'data' determines its type:
struct data {
- int type; /* type of data. currently MTD_* values */
+ int type; /* type of data. currently MDT_* values */
};
The rest of record depends on the type.
struct string {
- int length; /* length of string */
+ uint8_t length; /* length of string */
char val[]; /* string itself (no terminating zero) */
};
struct data_mdt_version {
int type = MDT_VERSION;
struct string modname;
+ /* padding */
int version;
struct string kldname;
+ /* padding */
};
struct data_mdt_module {
- int type = MDT_VERSION;
+ int type = MDT_MODULE;
struct string modname;
struct string kldname;
+ /* padding */
};
Modified: stable/7/usr.sbin/kldxref/kldxref.c
==============================================================================
--- stable/7/usr.sbin/kldxref/kldxref.c Tue Jan 13 22:46:24 2009 (r187200)
+++ stable/7/usr.sbin/kldxref/kldxref.c Tue Jan 13 23:02:54 2009 (r187201)
@@ -57,37 +57,19 @@
#define MAXRECSIZE 1024
#define check(val) if ((error = (val)) != 0) break
-#ifndef min
-#define min(a,b) (((a)<(b)) ? (a) : (b))
-#endif
-
-struct mod_info {
- char* mi_name;
- int mi_ver;
- SLIST_ENTRY(mod_info) mi_next;
-};
-
-#ifdef notnow
-struct kld_info {
- char* k_filename;
- SLIST_HEAD(mod_list_head, mod_info) k_modules;
- SLIST_ENTRY(kld_info) k_next;
-};
+static int dflag; /* do not create a hint file, only write on stdout */
+static int verbose;
-SLIST_HEAD(kld_list_head, kld_info) kldlist;
-#endif
-
-static int dflag, verbose;
-
-FILE *fxref;
+static FILE *fxref; /* current hints file */
static const char *xref_file = "linker.hints";
+/*
+ * A record is stored in the static buffer recbuf before going to disk.
+ */
static char recbuf[MAXRECSIZE];
-static int recpos, reccnt;
-
-FILE *maketempfile(char *, const char *);
-static void usage(void);
+static int recpos; /* current write position */
+static int reccnt; /* total record written to this file so far */
static void
intalign(void)
@@ -105,7 +87,7 @@ record_start(void)
static int
record_end(void)
{
- if (dflag || recpos == 0)
+ if (recpos == 0)
return 0;
reccnt++;
intalign();
@@ -123,6 +105,9 @@ record_buf(const void *buf, int size)
return 0;
}
+/*
+ * An int is stored in host order and aligned
+ */
static int
record_int(int val)
{
@@ -130,21 +115,21 @@ record_int(int val)
return record_buf(&val, sizeof(val));
}
-static int
-record_byte(u_char val)
-{
- return record_buf(&val, sizeof(val));
-}
-
+/*
+ * A string is stored as 1-byte length plus data, no padding
+ */
static int
record_string(const char *str)
{
- int len = strlen(str);
- int error;
-
+ int len, error;
+ u_char val;
+
if (dflag)
return 0;
- error = record_byte(len);
+ val = len = strlen(str);
+ if (len > 255)
+ errx(1, "string %s too long", str);
+ error = record_buf(&val, sizeof(val));
if (error)
return error;
return record_buf(str, len);
@@ -170,21 +155,23 @@ parse_entry(struct mod_metadata *md, con
break;
case MDT_VERSION:
check(EF_SEG_READ(ef, data, sizeof(mdv), &mdv));
- record_int(MDT_VERSION);
- record_string(cval);
- record_int(mdv.mv_version);
- record_string(kldname);
- if (!dflag)
- break;
- printf(" interface %s.%d\n", cval, mdv.mv_version);
+ if (dflag) {
+ printf(" interface %s.%d\n", cval, mdv.mv_version);
+ } else {
+ record_int(MDT_VERSION);
+ record_string(cval);
+ record_int(mdv.mv_version);
+ record_string(kldname);
+ }
break;
case MDT_MODULE:
- record_int(MDT_MODULE);
- record_string(cval);
- record_string(kldname);
- if (!dflag)
- break;
- printf(" module %s\n", cval);
+ if (dflag) {
+ printf(" module %s\n", cval);
+ } else {
+ record_int(MDT_MODULE);
+ record_string(cval);
+ record_string(kldname);
+ }
break;
default:
warnx("unknown metadata record %d in file %s", md->md_type, kldname);
@@ -199,8 +186,6 @@ read_kld(char *filename, char *kldname)
{
struct mod_metadata md;
struct elf_file ef;
-/* struct kld_info *kip;
- struct mod_info *mip;*/
void **p, **orgp;
int error, eftype, nmlen;
long start, finish, entries;
@@ -224,8 +209,9 @@ read_kld(char *filename, char *kldname)
}
if (!dflag) {
cp = strrchr(kldname, '.');
- nmlen = cp ? min(MAXMODNAME, cp - kldname) :
- min(MAXMODNAME, strlen(kldname));
+ nmlen = (cp != NULL) ? cp - kldname : (int)strlen(kldname);
+ if (nmlen > MAXMODNAME)
+ nmlen = MAXMODNAME;
strlcpy(kldmodname, kldname, nmlen);
/* fprintf(fxref, "%s:%s:%d\n", kldmodname, kldname, 0);*/
}
@@ -252,25 +238,43 @@ read_kld(char *filename, char *kldname)
return error;
}
-FILE *
+/*
+ * Create a temp file in directory root, make sure we don't
+ * overflow the buffer for the destination name
+ */
+static FILE *
maketempfile(char *dest, const char *root)
{
char *p;
- int fd;
+ int n, fd;
- strlcpy(dest, root, MAXPATHLEN);
+ p = strrchr(root, '/');
+ n = p != NULL ? p - root + 1 : 0;
+ if (snprintf(dest, MAXPATHLEN, "%.*slhint.XXXXXX", n, root) >=
+ MAXPATHLEN) {
+ errno = ENAMETOOLONG;
+ return NULL;
+ }
- if ((p = strrchr(dest, '/')) != 0)
- p++;
- else
- p = dest;
- strcpy(p, "lhint.XXXXXX");
fd = mkstemp(dest);
- return ((fd == -1) ? NULL : fdopen(fd, "w+"));
+ if (fd < 0)
+ return NULL;
+ fchmod(fd, 0644); /* nothing secret in the file */
+ return fdopen(fd, "w+");
}
static char xrefname[MAXPATHLEN], tempname[MAXPATHLEN];
+static void
+usage(void)
+{
+
+ fprintf(stderr, "%s\n",
+ "usage: kldxref [-Rdv] [-f hintsfile] path ..."
+ );
+ exit(1);
+}
+
int
main(int argc, char *argv[])
{
@@ -280,20 +284,19 @@ main(int argc, char *argv[])
struct stat sb;
fts_options = FTS_PHYSICAL;
-/* SLIST_INIT(&kldlist);*/
while ((opt = getopt(argc, argv, "Rdf:v")) != -1) {
switch (opt) {
- case 'd':
+ case 'd': /* no hint file, only print on stdout */
dflag = 1;
break;
- case 'f':
+ case 'f': /* use this name instead of linker.hints */
xref_file = optarg;
break;
case 'v':
verbose++;
break;
- case 'R':
+ case 'R': /* recurse on directories */
fts_options |= FTS_COMFOLLOW;
break;
default:
@@ -319,19 +322,22 @@ main(int argc, char *argv[])
for (;;) {
p = fts_read(ftsp);
- if ((p == NULL || p->fts_info == FTS_D) && !dflag && fxref) {
+ if ((p == NULL || p->fts_info == FTS_D) && fxref) {
+ /* close and rename the current hint file */
fclose(fxref);
fxref = NULL;
if (reccnt) {
rename(tempname, xrefname);
} else {
+ /* didn't find any entry, ignore this file */
unlink(tempname);
unlink(xrefname);
}
}
if (p == NULL)
break;
- if (p && p->fts_info == FTS_D && !dflag) {
+ if (p->fts_info == FTS_D && !dflag) {
+ /* visiting a new directory, create a new hint file */
snprintf(xrefname, sizeof(xrefname), "%s/%s",
ftsp->fts_path, xref_file);
fxref = maketempfile(tempname, ftsp->fts_path);
@@ -341,6 +347,7 @@ main(int argc, char *argv[])
fwrite(&ival, sizeof(ival), 1, fxref);
reccnt = 0;
}
+ /* skip non-files or .symbols entries */
if (p->fts_info != FTS_F)
continue;
if (p->fts_namelen >= 8 &&
@@ -351,13 +358,3 @@ main(int argc, char *argv[])
fts_close(ftsp);
return 0;
}
-
-static void
-usage(void)
-{
-
- fprintf(stderr, "%s\n",
- "usage: kldxref [-Rdv] [-f hintsfile] path ..."
- );
- exit(1);
-}
From rafan at FreeBSD.org Tue Jan 13 22:50:30 2009
From: rafan at FreeBSD.org (Rong-En Fan)
Date: Tue Jan 13 22:50:47 2009
Subject: svn commit: r187209 - in stable/7/sys: . conf contrib/pf dev/cxgb
dev/sound/pci modules/sound/driver/au88x0
Message-ID: <200901140650.n0E6oSuV028189@svn.freebsd.org>
Author: rafan
Date: Wed Jan 14 06:50:28 2009
New Revision: 187209
URL: http://svn.freebsd.org/changeset/base/187209
Log:
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
Deleted:
stable/7/sys/dev/sound/pci/au88x0.c
stable/7/sys/dev/sound/pci/au88x0.h
stable/7/sys/modules/sound/driver/au88x0/
Modified:
stable/7/sys/ (props changed)
stable/7/sys/conf/NOTES
stable/7/sys/conf/files
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/conf/NOTES
==============================================================================
--- stable/7/sys/conf/NOTES Wed Jan 14 05:08:52 2009 (r187208)
+++ stable/7/sys/conf/NOTES Wed Jan 14 06:50:28 2009 (r187209)
@@ -1990,8 +1990,6 @@ device sound
# snd_ad1816: Analog Devices AD1816 ISA PnP/non-PnP.
# snd_als4000: Avance Logic ALS4000 PCI.
# snd_atiixp: ATI IXP 200/300/400 PCI.
-# snd_au88x0 Aureal Vortex 1/2/Advantage PCI. This driver
-# lacks support for playback and recording.
# snd_audiocs: Crystal Semiconductor CS4231 SBus/EBus. Only
# for sparc64.
# snd_cmi: CMedia CMI8338/CMI8738 PCI.
@@ -2035,7 +2033,6 @@ device sound
device snd_ad1816
device snd_als4000
device snd_atiixp
-#device snd_au88x0
#device snd_audiocs
device snd_cmi
device snd_cs4281
Modified: stable/7/sys/conf/files
==============================================================================
--- stable/7/sys/conf/files Wed Jan 14 05:08:52 2009 (r187208)
+++ stable/7/sys/conf/files Wed Jan 14 06:50:28 2009 (r187209)
@@ -965,7 +965,6 @@ dev/sound/isa/sbc.c optional snd_sbc is
dev/sound/isa/sndbuf_dma.c optional sound isa
dev/sound/pci/als4000.c optional snd_als4000 pci
dev/sound/pci/atiixp.c optional snd_atiixp pci
-#dev/sound/pci/au88x0.c optional snd_au88x0 pci
dev/sound/pci/cmi.c optional snd_cmi pci
dev/sound/pci/cs4281.c optional snd_cs4281 pci
dev/sound/pci/csa.c optional snd_csa pci \
From ume at FreeBSD.org Wed Jan 14 01:11:14 2009
From: ume at FreeBSD.org (Hajimu UMEMOTO)
Date: Wed Jan 14 01:11:32 2009
Subject: svn commit: r187211 - stable/7/etc/periodic/weekly
Message-ID: <200901140911.n0E9BDX1030983@svn.freebsd.org>
Author: ume
Date: Wed Jan 14 09:11:13 2009
New Revision: 187211
URL: http://svn.freebsd.org/changeset/base/187211
Log:
MFC r187210: Fix typo to install 400.status-pkg, again.
Modified:
stable/7/etc/periodic/weekly/ (props changed)
stable/7/etc/periodic/weekly/Makefile
Modified: stable/7/etc/periodic/weekly/Makefile
==============================================================================
--- stable/7/etc/periodic/weekly/Makefile Wed Jan 14 09:00:30 2009 (r187210)
+++ stable/7/etc/periodic/weekly/Makefile Wed Jan 14 09:11:13 2009 (r187211)
@@ -16,7 +16,7 @@ FILES+= 320.whatis 330.catman
.endif
.if ${MK_PKGTOOLS} != "no"
-FLES+= 400.status-pkg
+FILES+= 400.status-pkg
.endif
.include
From danger at FreeBSD.org Wed Jan 14 02:02:48 2009
From: danger at FreeBSD.org (Daniel Gerzo)
Date: Wed Jan 14 02:03:00 2009
Subject: svn commit: r187212 - in stable/7/sbin: . atacontrol ddb devfs
dhclient fdisk fsck_ffs geom geom/class/part geom/misc
ifconfig init ipfw md5 mdconfig mksnap_ffs mount natd ping
ping6 sconfig
Message-ID: <200901141002.n0EA2lmJ032114@svn.freebsd.org>
Author: danger (doc committer)
Date: Wed Jan 14 10:02:47 2009
New Revision: 187212
URL: http://svn.freebsd.org/changeset/base/187212
Log:
MFC r187067:
Reviewed by: trhodes, keramida
Modified:
stable/7/sbin/ (props changed)
stable/7/sbin/atacontrol/ (props changed)
stable/7/sbin/ddb/ (props changed)
stable/7/sbin/devfs/ (props changed)
stable/7/sbin/dhclient/ (props changed)
stable/7/sbin/fdisk/ (props changed)
stable/7/sbin/fsck_ffs/ (props changed)
stable/7/sbin/geom/ (props changed)
stable/7/sbin/geom/class/part/ (props changed)
stable/7/sbin/geom/misc/ (props changed)
stable/7/sbin/ifconfig/ (props changed)
stable/7/sbin/init/ (props changed)
stable/7/sbin/ipfw/ (props changed)
stable/7/sbin/md5/ (props changed)
stable/7/sbin/mdconfig/ (props changed)
stable/7/sbin/mksnap_ffs/ (props changed)
stable/7/sbin/mount/ (props changed)
stable/7/sbin/natd/ (props changed)
stable/7/sbin/ping/ping.8
stable/7/sbin/ping6/ (props changed)
stable/7/sbin/sconfig/ (props changed)
Modified: stable/7/sbin/ping/ping.8
==============================================================================
--- stable/7/sbin/ping/ping.8 Wed Jan 14 09:11:13 2009 (r187211)
+++ stable/7/sbin/ping/ping.8 Wed Jan 14 10:02:47 2009 (r187212)
@@ -506,14 +506,18 @@ Others may use completely wild values.
.Sh EXIT STATUS
The
.Nm
-utility returns an exit status of zero if at least one response was
-heard from the specified
-.Ar host ;
-a status of two if the transmission was successful but no responses
-were received; or another value
-(from
-.In sysexits.h )
-if an error occurred.
+utility exits with one of the following values:
+.Bl -tag -width indent
+.It 0
+At least one response was heard from the specified
+.Ar host .
+.It 2
+The transmission was successful but no responses were received.
+.It any other value
+An error occurred.
+These values are defined in
+.In sysexits.h .
+.El
.Sh SEE ALSO
.Xr netstat 1 ,
.Xr ifconfig 8 ,
From danger at FreeBSD.org Wed Jan 14 02:23:45 2009
From: danger at FreeBSD.org (Daniel Gerzo)
Date: Wed Jan 14 02:24:00 2009
Subject: svn commit: r187212 - in stable/7/sbin: . atacontrol ddb devfs
dhclient fdisk fsck_ffs geom geom/class/part geom/misc
ifconfig init ipfw md5 mdconfig mksnap_ffs mount natd ping
ping6 sconfig
In-Reply-To: <200901141002.n0EA2lmJ032114@svn.freebsd.org>
References: <200901141002.n0EA2lmJ032114@svn.freebsd.org>
Message-ID: <08225540.20090114110614@rulez.sk>
Hello,
Wednesday, January 14, 2009, 11:02:47 AM, you wrote:
> Author: danger (doc committer)
> Date: Wed Jan 14 10:02:47 2009
> New Revision: 187212
> URL: http://svn.freebsd.org/changeset/base/187212
> Log:
> MFC r187067:
This should also include:
- improve readability
Sorry for omitting it :(
--
Best regards,
Daniel mailto:danger@FreeBSD.org
From luigi at FreeBSD.org Wed Jan 14 06:55:12 2009
From: luigi at FreeBSD.org (Luigi Rizzo)
Date: Wed Jan 14 06:55:25 2009
Subject: svn commit: r187222 - in stable/7/sys/boot: common forth
Message-ID: <200901141455.n0EEtAjf046147@svn.freebsd.org>
Author: luigi
Date: Wed Jan 14 14:55:10 2009
New Revision: 187222
URL: http://svn.freebsd.org/changeset/base/187222
Log:
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.
Modified:
stable/7/sys/boot/common/interp.c
stable/7/sys/boot/forth/loader.4th
stable/7/sys/boot/forth/pnp.4th
stable/7/sys/boot/forth/support.4th
Modified: stable/7/sys/boot/common/interp.c
==============================================================================
--- stable/7/sys/boot/common/interp.c Wed Jan 14 14:20:08 2009 (r187221)
+++ stable/7/sys/boot/common/interp.c Wed Jan 14 14:55:10 2009 (r187222)
@@ -92,7 +92,7 @@ perform(int argc, char *argv[])
void
interact(void)
{
- char input[256]; /* big enough? */
+ static char input[256]; /* big enough? */
#ifndef BOOT_FORTH
int argc;
char **argv;
@@ -178,14 +178,21 @@ command_include(int argc, char *argv[])
return(res);
}
+/*
+ * Header prepended to each line. The text immediately follows the header.
+ * We try to make this short in order to save memory -- the loader has
+ * limited memory available, and some of the forth files are very long.
+ */
struct includeline
{
- char *text;
+ struct includeline *next;
+#ifndef BOOT_FORTH
int flags;
int line;
#define SL_QUIET (1<<0)
#define SL_IGNOREERR (1<<1)
- struct includeline *next;
+#endif
+ char text[0];
};
int
@@ -236,13 +243,14 @@ include(const char *filename)
}
#endif
/* Allocate script line structure and copy line, flags */
+ if (*cp == '\0')
+ continue; /* ignore empty line, save memory */
sp = malloc(sizeof(struct includeline) + strlen(cp) + 1);
- sp->text = (char *)sp + sizeof(struct includeline);
strcpy(sp->text, cp);
#ifndef BOOT_FORTH
sp->flags = flags;
-#endif
sp->line = line;
+#endif
sp->next = NULL;
if (script == NULL) {
Modified: stable/7/sys/boot/forth/loader.4th
==============================================================================
--- stable/7/sys/boot/forth/loader.4th Wed Jan 14 14:20:08 2009 (r187221)
+++ stable/7/sys/boot/forth/loader.4th Wed Jan 14 14:55:10 2009 (r187222)
@@ -93,6 +93,7 @@ only forth definitions also support-func
\
\ If a password was defined, execute autoboot and ask for
\ password if autoboot returns.
+\ Do not exit unless the right password is given.
: check-password
password .addr @ if
@@ -150,8 +151,7 @@ only forth definitions also support-func
\ line, if interpreted, or given on the stack, if compiled in.
: (read-conf) ( addr len -- )
- conf_files .addr @ ?dup if free abort" Fatal error freeing memory" then
- strdup conf_files .len ! conf_files .addr !
+ conf_files string=
include_conf_files \ Will recurse on new loader_conf_files definitions
;
@@ -165,110 +165,26 @@ only forth definitions also support-func
then
; immediate
-\ ***** enable-module
-\
-\ Turn a module loading on.
+\ show, enable, disable, toggle module loading. They all take module from
+\ the next word
-: enable-module ( -- )
- bl parse module_options @ >r
- begin
- r@
- while
- 2dup
- r@ module.name dup .addr @ swap .len @
- compare 0= if
- 2drop
- r@ module.name dup .addr @ swap .len @ type
- true r> module.flag !
- ." will be loaded." cr
- exit
- then
- r> module.next @ >r
- repeat
- r> drop
- type ." wasn't found." cr
+: set-module-flag ( module_addr val -- ) \ set and print flag
+ over module.flag !
+ dup module.name strtype
+ module.flag @ if ." will be loaded" else ." will not be loaded" then cr
;
-\ ***** disable-module
-\
-\ Turn a module loading off.
-
-: disable-module ( -- )
- bl parse module_options @ >r
- begin
- r@
- while
- 2dup
- r@ module.name dup .addr @ swap .len @
- compare 0= if
- 2drop
- r@ module.name dup .addr @ swap .len @ type
- false r> module.flag !
- ." will not be loaded." cr
- exit
- then
- r> module.next @ >r
- repeat
- r> drop
- type ." wasn't found." cr
-;
+: enable-module find-module ?dup if true set-module-flag then ;
-\ ***** toggle-module
-\
-\ Turn a module loading on/off.
+: disable-module find-module ?dup if false set-module-flag then ;
-: toggle-module ( -- )
- bl parse module_options @ >r
- begin
- r@
- while
- 2dup
- r@ module.name dup .addr @ swap .len @
- compare 0= if
- 2drop
- r@ module.name dup .addr @ swap .len @ type
- r@ module.flag @ 0= dup r> module.flag !
- if
- ." will be loaded." cr
- else
- ." will not be loaded." cr
- then
- exit
- then
- r> module.next @ >r
- repeat
- r> drop
- type ." wasn't found." cr
-;
+: toggle-module find-module ?dup if dup module.flag @ 0= set-module-flag then ;
\ ***** show-module
\
\ Show loading information about a module.
-: show-module ( -- )
- bl parse module_options @ >r
- begin
- r@
- while
- 2dup
- r@ module.name dup .addr @ swap .len @
- compare 0= if
- 2drop
- ." Name: " r@ module.name dup .addr @ swap .len @ type cr
- ." Path: " r@ module.loadname dup .addr @ swap .len @ type cr
- ." Type: " r@ module.type dup .addr @ swap .len @ type cr
- ." Flags: " r@ module.args dup .addr @ swap .len @ type cr
- ." Before load: " r@ module.beforeload dup .addr @ swap .len @ type cr
- ." After load: " r@ module.afterload dup .addr @ swap .len @ type cr
- ." Error: " r@ module.loaderror dup .addr @ swap .len @ type cr
- ." Status: " r> module.flag @ if ." Load" else ." Don't load" then cr
- exit
- then
- r> module.next @ >r
- repeat
- r> drop
- type ." wasn't found." cr
-;
+: show-module ( -- ) find-module ?dup if show-one-module then ;
\ Words to be used inside configuration files
Modified: stable/7/sys/boot/forth/pnp.4th
==============================================================================
--- stable/7/sys/boot/forth/pnp.4th Wed Jan 14 14:20:08 2009 (r187221)
+++ stable/7/sys/boot/forth/pnp.4th Wed Jan 14 14:55:10 2009 (r187222)
@@ -24,6 +24,39 @@
\
\ $FreeBSD$
+
+\ The following pnp code is used in pnp.4th and pnp.c
+structure: STAILQ_HEAD
+ ptr stqh_first \ type*
+ ptr stqh_last \ type**
+;structure
+
+structure: STAILQ_ENTRY
+ ptr stqe_next \ type*
+;structure
+
+structure: pnphandler
+ ptr pnph.name
+ ptr pnph.enumerate
+;structure
+
+structure: pnpident
+ ptr pnpid.ident \ char*
+ sizeof STAILQ_ENTRY cells member: pnpid.link \ pnpident
+;structure
+
+structure: pnpinfo \ sync with sys/boot/config/bootstrap.h
+ ptr pnpi.desc
+ int pnpi.revision
+ ptr pnpi.module \ (char*) module args
+ int pnpi.argc
+ ptr pnpi.argv
+ ptr pnpi.handler \ pnphandler
+ sizeof STAILQ_HEAD member: pnpi.ident \ pnpident
+ sizeof STAILQ_ENTRY member: pnpi.link \ pnpinfo
+;structure
+\ end of pnp support
+
pnpdevices drop
: enumerate
Modified: stable/7/sys/boot/forth/support.4th
==============================================================================
--- stable/7/sys/boot/forth/support.4th Wed Jan 14 14:20:08 2009 (r187221)
+++ stable/7/sys/boot/forth/support.4th Wed Jan 14 14:55:10 2009 (r187222)
@@ -26,7 +26,6 @@
\ Loader.rc support functions:
\
-\ initialize_support ( -- ) initialize global variables
\ initialize ( addr len -- ) as above, plus load_conf_files
\ load_conf ( addr len -- ) load conf file given
\ include_conf_files ( -- ) load all conf files in load_conf_files
@@ -61,24 +60,23 @@
\ value any_conf_read? indicates if a conf file was succesfully read
\
\ Other exported words:
-\
+\ note, strlen is internal
\ strdup ( addr len -- addr' len) similar to strdup(3)
\ strcat ( addr len addr' len' -- addr len+len' ) similar to strcat(3)
-\ strlen ( addr -- len ) similar to strlen(3)
\ s' ( | string' -- addr len | ) similar to s"
\ rudimentary structure support
\ Exception values
-1 constant syntax_error
-2 constant out_of_memory
-3 constant free_error
-4 constant set_error
-5 constant read_error
-6 constant open_error
-7 constant exec_error
-8 constant before_load_error
-9 constant after_load_error
+1 constant ESYNTAX
+2 constant ENOMEM
+3 constant EFREE
+4 constant ESETERROR \ error setting environment variable
+5 constant EREAD \ error reading
+6 constant EOPEN
+7 constant EEXEC \ XXX never catched
+8 constant EBEFORELOAD
+9 constant EAFTERLOAD
\ I/O constants
@@ -132,7 +130,8 @@ structure: module
ptr module.next
;structure
-\ Internal loader structures
+\ Internal loader structures (preloaded_file, kernel_module, file_metadata)
+\ must be in sync with the C struct in sys/boot/common/bootstrap.h
structure: preloaded_file
ptr pf.name
ptr pf.type
@@ -159,51 +158,7 @@ structure: file_metadata
0 member: md.data \ variable size
;structure
-structure: config_resource
- ptr cf.name
- int cf.type
-0 constant RES_INT
-1 constant RES_STRING
-2 constant RES_LONG
- 2 cells member: u
-;structure
-
-structure: config_device
- ptr cd.name
- int cd.unit
- int cd.resource_count
- ptr cd.resources \ config_resource
-;structure
-
-structure: STAILQ_HEAD
- ptr stqh_first \ type*
- ptr stqh_last \ type**
-;structure
-
-structure: STAILQ_ENTRY
- ptr stqe_next \ type*
-;structure
-
-structure: pnphandler
- ptr pnph.name
- ptr pnph.enumerate
-;structure
-
-structure: pnpident
- ptr pnpid.ident \ char*
- sizeof STAILQ_ENTRY cells member: pnpid.link \ pnpident
-;structure
-
-structure: pnpinfo
- ptr pnpi.desc
- int pnpi.revision
- ptr pnpi.module \ (char*) module args
- int pnpi.argc
- ptr pnpi.argv
- ptr pnpi.handler \ pnphandler
- sizeof STAILQ_HEAD member: pnpi.ident \ pnpident
- sizeof STAILQ_ENTRY member: pnpi.link \ pnpinfo
-;structure
+\ end of structures
\ Global variables
@@ -216,11 +171,9 @@ create last_module_option sizeof module.
0 value nextboot?
\ Support string functions
-
-: strdup ( addr len -- addr' len )
- >r r@ allocate if out_of_memory throw then
- tuck r@ move
- r>
+: strdup { addr len -- addr' len' }
+ len allocate if ENOMEM throw then
+ addr over len move len
;
: strcat { addr len addr' len' -- addr len+len' }
@@ -228,29 +181,27 @@ create last_module_option sizeof module.
addr len len' +
;
-: strlen ( addr -- len )
- 0 >r
+: strchr { addr len c -- addr' len' }
begin
- dup c@ while
- 1+ r> 1+ >r repeat
- drop r>
+ len
+ while
+ addr c@ c = if addr len exit then
+ addr 1 + to addr
+ len 1 - to len
+ repeat
+ 0 0
;
-: s'
+: s' \ same as s", allows " in the string
[char] ' parse
- state @ if
- postpone sliteral
- then
+ state @ if postpone sliteral then
; immediate
: 2>r postpone >r postpone >r ; immediate
: 2r> postpone r> postpone r> ; immediate
: 2r@ postpone 2r> postpone 2dup postpone 2>r ; immediate
-: getenv?
- getenv
- -1 = if false else drop true then
-;
+: getenv? getenv -1 = if false else drop true then ;
\ Private definitions
@@ -271,22 +222,45 @@ only forth also support-functions defini
\ Standard suffixes
-: load_module_suffix s" _load" ;
-: module_loadname_suffix s" _name" ;
-: module_type_suffix s" _type" ;
-: module_args_suffix s" _flags" ;
-: module_beforeload_suffix s" _before" ;
-: module_afterload_suffix s" _after" ;
-: module_loaderror_suffix s" _error" ;
+: load_module_suffix s" _load" ;
+: module_loadname_suffix s" _name" ;
+: module_type_suffix s" _type" ;
+: module_args_suffix s" _flags" ;
+: module_beforeload_suffix s" _before" ;
+: module_afterload_suffix s" _after" ;
+: module_loaderror_suffix s" _error" ;
\ Support operators
: >= < 0= ;
: <= > 0= ;
-\ Assorted support funcitons
+\ Assorted support functions
+
+: free-memory free if EFREE throw then ;
+
+: strget { var -- addr len } var .addr @ var .len @ ;
+
+\ assign addr len to variable.
+: strset { addr len var -- } addr var .addr ! len var .len ! ;
-: free-memory free if free_error throw then ;
+\ free memory and reset fields
+: strfree { var -- } var .addr @ ?dup if free-memory 0 0 var strset then ;
+
+\ free old content, make a copy of the string and assign to variable
+: string= { addr len var -- } var strfree addr len strdup var strset ;
+
+: strtype ( str -- ) strget type ;
+
+\ assign a reference to what is on the stack
+: strref { addr len var -- addr len }
+ addr var .addr ! len var .len ! addr len
+;
+
+\ unquote a string
+: unquote ( addr len -- addr len )
+ over c@ [char] " = if 2 chars - swap char+ swap then
+;
\ Assignment data temporary storage
@@ -355,16 +329,16 @@ line-reading definitions
line_buffer .len @ if
line_buffer .addr @
line_buffer .len @ r@ +
- resize if out_of_memory throw then
+ resize if ENOMEM throw then
else
- r@ allocate if out_of_memory throw then
+ r@ allocate if ENOMEM throw then
then
line_buffer .addr !
r>
;
: append_to_line_buffer ( addr len -- )
- line_buffer .addr @ line_buffer .len @
+ line_buffer strget
2swap strcat
line_buffer .len !
drop
@@ -384,23 +358,15 @@ line-reading definitions
: refill_buffer
0 to read_buffer_ptr
read_buffer .addr @ 0= if
- read_buffer_size allocate if out_of_memory throw then
+ read_buffer_size allocate if ENOMEM throw then
read_buffer .addr !
then
fd @ read_buffer .addr @ read_buffer_size fread
- dup -1 = if read_error throw then
+ dup -1 = if EREAD throw then
dup 0= if true to end_of_file? then
read_buffer .len !
;
-: reset_line_buffer
- line_buffer .addr @ ?dup if
- free-memory
- then
- 0 line_buffer .addr !
- 0 line_buffer .len !
-;
-
support-functions definitions
: reset_line_reading
@@ -408,7 +374,7 @@ support-functions definitions
;
: read_line
- reset_line_buffer
+ line_buffer strfree
skip_newlines
begin
read_from_buffer
@@ -448,9 +414,9 @@ also parser definitions also
0 value parsing_function
0 value end_of_line
-: end_of_line?
- line_pointer end_of_line =
-;
+: end_of_line? line_pointer end_of_line = ;
+
+\ classifiers for various character classes in the input line
: letter?
line_pointer c@ >r
@@ -469,70 +435,46 @@ also parser definitions also
or
;
-: quote?
- line_pointer c@ [char] " =
-;
+: quote? line_pointer c@ [char] " = ;
-: assignment_sign?
- line_pointer c@ [char] = =
-;
+: assignment_sign? line_pointer c@ [char] = = ;
-: comment?
- line_pointer c@ [char] # =
-;
+: comment? line_pointer c@ [char] # = ;
-: space?
- line_pointer c@ bl =
- line_pointer c@ tab = or
-;
+: space? line_pointer c@ bl = line_pointer c@ tab = or ;
-: backslash?
- line_pointer c@ [char] \ =
-;
+: backslash? line_pointer c@ [char] \ = ;
-: underscore?
- line_pointer c@ [char] _ =
-;
+: underscore? line_pointer c@ [char] _ = ;
-: dot?
- line_pointer c@ [char] . =
-;
+: dot? line_pointer c@ [char] . = ;
-: skip_character
- line_pointer char+ to line_pointer
-;
+\ manipulation of input line
+: skip_character line_pointer char+ to line_pointer ;
-: skip_to_end_of_line
- end_of_line to line_pointer
-;
+: skip_to_end_of_line end_of_line to line_pointer ;
: eat_space
begin
- space?
+ end_of_line? if 0 else space? then
while
skip_character
- end_of_line? if exit then
repeat
;
: parse_name ( -- addr len )
line_pointer
begin
- letter? digit? underscore? dot? or or or
+ end_of_line? if 0 else letter? digit? underscore? dot? or or or then
while
skip_character
- end_of_line? if
- line_pointer over -
- strdup
- exit
- then
repeat
line_pointer over -
strdup
;
: remove_backslashes { addr len | addr' len' -- addr' len' }
- len allocate if out_of_memory throw then
+ len allocate if ENOMEM throw then
to addr'
addr >r
begin
@@ -550,16 +492,16 @@ also parser definitions also
: parse_quote ( -- addr len )
line_pointer
skip_character
- end_of_line? if syntax_error throw then
+ end_of_line? if ESYNTAX throw then
begin
quote? 0=
while
backslash? if
skip_character
- end_of_line? if syntax_error throw then
+ end_of_line? if ESYNTAX throw then
then
skip_character
- end_of_line? if syntax_error throw then
+ end_of_line? if ESYNTAX throw then
repeat
skip_character
line_pointer over -
@@ -568,8 +510,7 @@ also parser definitions also
: read_name
parse_name ( -- addr len )
- name_buffer .len !
- name_buffer .addr !
+ name_buffer strset
;
: read_value
@@ -578,8 +519,7 @@ also parser definitions also
else
parse_name ( -- addr len )
then
- value_buffer .len !
- value_buffer .addr !
+ value_buffer strset
;
: comment
@@ -589,7 +529,7 @@ also parser definitions also
: white_space_4
eat_space
comment? if ['] comment to parsing_function exit then
- end_of_line? 0= if syntax_error throw then
+ end_of_line? 0= if ESYNTAX throw then
;
: variable_value
@@ -602,7 +542,7 @@ also parser definitions also
letter? digit? quote? or or if
['] variable_value to parsing_function exit
then
- syntax_error throw
+ ESYNTAX throw
;
: assignment_sign
@@ -613,7 +553,7 @@ also parser definitions also
: white_space_2
eat_space
assignment_sign? if ['] assignment_sign to parsing_function exit then
- syntax_error throw
+ ESYNTAX throw
;
: variable_name
@@ -625,13 +565,13 @@ also parser definitions also
eat_space
letter? if ['] variable_name to parsing_function exit then
comment? if ['] comment to parsing_function exit then
- end_of_line? 0= if syntax_error throw then
+ end_of_line? 0= if ESYNTAX throw then
;
file-processing definitions
: get_assignment
- line_buffer .addr @ line_buffer .len @ + to end_of_line
+ line_buffer strget + to end_of_line
line_buffer .addr @ to line_pointer
['] white_space_1 to parsing_function
begin
@@ -642,7 +582,7 @@ file-processing definitions
parsing_function ['] comment =
parsing_function ['] white_space_1 =
parsing_function ['] white_space_4 =
- or or 0= if syntax_error throw then
+ or or 0= if ESYNTAX throw then
;
only forth also support-functions also file-processing definitions also
@@ -650,7 +590,7 @@ only forth also support-functions also f
\ Process line
: assignment_type? ( addr len -- flag )
- name_buffer .addr @ name_buffer .len @
+ name_buffer strget
compare 0=
;
@@ -660,82 +600,56 @@ only forth also support-functions also f
over compare 0=
;
-: loader_conf_files?
- s" loader_conf_files" assignment_type?
-;
+: loader_conf_files? s" loader_conf_files" assignment_type? ;
-: nextboot_flag?
- s" nextboot_enable" assignment_type?
-;
+: nextboot_flag? s" nextboot_enable" assignment_type? ;
-: nextboot_conf?
- s" nextboot_conf" assignment_type?
-;
+: nextboot_conf? s" nextboot_conf" assignment_type? ;
-: verbose_flag?
- s" verbose_loading" assignment_type?
-;
+: verbose_flag? s" verbose_loading" assignment_type? ;
-: execute?
- s" exec" assignment_type?
-;
+: execute? s" exec" assignment_type? ;
-: password?
- s" password" assignment_type?
-;
+: password? s" password" assignment_type? ;
-: module_load?
- load_module_suffix suffix_type?
-;
+: module_load? load_module_suffix suffix_type? ;
-: module_loadname?
- module_loadname_suffix suffix_type?
-;
+: module_loadname? module_loadname_suffix suffix_type? ;
-: module_type?
- module_type_suffix suffix_type?
-;
+: module_type? module_type_suffix suffix_type? ;
-: module_args?
- module_args_suffix suffix_type?
-;
+: module_args? module_args_suffix suffix_type? ;
-: module_beforeload?
- module_beforeload_suffix suffix_type?
-;
+: module_beforeload? module_beforeload_suffix suffix_type? ;
-: module_afterload?
- module_afterload_suffix suffix_type?
-;
+: module_afterload? module_afterload_suffix suffix_type? ;
-: module_loaderror?
- module_loaderror_suffix suffix_type?
-;
+: module_loaderror? module_loaderror_suffix suffix_type? ;
-: set_conf_files
- conf_files .addr @ ?dup if
- free-memory
- then
- value_buffer .addr @ c@ [char] " = if
- value_buffer .addr @ char+ value_buffer .len @ 2 chars -
+\ build a 'set' statement and execute it
+: set_environment_variable
+ name_buffer .len @ value_buffer .len @ + 5 chars + \ size of result string
+ allocate if ENOMEM throw then
+ dup 0 \ start with an empty string and append the pieces
+ s" set " strcat
+ name_buffer strget strcat
+ s" =" strcat
+ value_buffer strget strcat
+ ['] evaluate catch if
+ 2drop free drop
+ ESETERROR throw
else
- value_buffer .addr @ value_buffer .len @
+ free-memory
then
- strdup
- conf_files .len ! conf_files .addr !
;
-: set_nextboot_conf
- nextboot_conf_file .addr @ ?dup if
- free-memory
- then
- value_buffer .addr @ c@ [char] " = if
- value_buffer .addr @ char+ value_buffer .len @ 2 chars -
- else
- value_buffer .addr @ value_buffer .len @
- then
- strdup
- nextboot_conf_file .len ! nextboot_conf_file .addr !
+: set_conf_files
+ set_environment_variable
+ s" loader_conf_files" getenv conf_files string=
+;
+
+: set_nextboot_conf \ XXX maybe do as set_conf_files ?
+ value_buffer strget unquote nextboot_conf_file string=
;
: append_to_module_options_list ( addr -- )
@@ -748,35 +662,32 @@ only forth also support-functions also f
then
;
-: set_module_name ( addr -- )
- name_buffer .addr @ name_buffer .len @
- strdup
- >r over module.name .addr !
- r> swap module.name .len !
+: set_module_name { addr -- } \ check leaks
+ name_buffer strget addr module.name string=
;
: yes_value?
- value_buffer .addr @ value_buffer .len @
+ value_buffer strget \ XXX could use unquote
2dup s' "YES"' compare >r
2dup s' "yes"' compare >r
2dup s" YES" compare >r
s" yes" compare r> r> r> and and and 0=
;
-: find_module_option ( -- addr | 0 )
+: find_module_option ( -- addr | 0 ) \ return ptr to entry matching name_buffer
module_options @
begin
dup
while
- dup module.name dup .addr @ swap .len @
- name_buffer .addr @ name_buffer .len @
+ dup module.name strget
+ name_buffer strget
compare 0= if exit then
module.next @
repeat
;
: new_module_option ( -- addr )
- sizeof module allocate if out_of_memory throw then
+ sizeof module allocate if ENOMEM throw then
dup sizeof module erase
dup append_to_module_options_list
dup set_module_name
@@ -794,98 +705,38 @@ only forth also support-functions also f
: set_module_args
name_buffer .len @ module_args_suffix nip - name_buffer .len !
- get_module_option module.args
- dup .addr @ ?dup if free-memory then
- value_buffer .addr @ value_buffer .len @
- over c@ [char] " = if
- 2 chars - swap char+ swap
- then
- strdup
- >r over .addr !
- r> swap .len !
+ value_buffer strget unquote
+ get_module_option module.args string=
;
: set_module_loadname
name_buffer .len @ module_loadname_suffix nip - name_buffer .len !
- get_module_option module.loadname
- dup .addr @ ?dup if free-memory then
- value_buffer .addr @ value_buffer .len @
- over c@ [char] " = if
- 2 chars - swap char+ swap
- then
- strdup
- >r over .addr !
- r> swap .len !
+ value_buffer strget unquote
+ get_module_option module.loadname string=
;
: set_module_type
name_buffer .len @ module_type_suffix nip - name_buffer .len !
- get_module_option module.type
- dup .addr @ ?dup if free-memory then
- value_buffer .addr @ value_buffer .len @
- over c@ [char] " = if
- 2 chars - swap char+ swap
- then
- strdup
- >r over .addr !
- r> swap .len !
+ value_buffer strget unquote
+ get_module_option module.type string=
;
: set_module_beforeload
name_buffer .len @ module_beforeload_suffix nip - name_buffer .len !
- get_module_option module.beforeload
- dup .addr @ ?dup if free-memory then
- value_buffer .addr @ value_buffer .len @
- over c@ [char] " = if
- 2 chars - swap char+ swap
- then
- strdup
- >r over .addr !
- r> swap .len !
+ value_buffer strget unquote
+ get_module_option module.beforeload string=
;
: set_module_afterload
name_buffer .len @ module_afterload_suffix nip - name_buffer .len !
- get_module_option module.afterload
- dup .addr @ ?dup if free-memory then
- value_buffer .addr @ value_buffer .len @
- over c@ [char] " = if
- 2 chars - swap char+ swap
- then
- strdup
- >r over .addr !
- r> swap .len !
+ value_buffer strget unquote
+ get_module_option module.afterload string=
;
: set_module_loaderror
name_buffer .len @ module_loaderror_suffix nip - name_buffer .len !
- get_module_option module.loaderror
- dup .addr @ ?dup if free-memory then
- value_buffer .addr @ value_buffer .len @
- over c@ [char] " = if
- 2 chars - swap char+ swap
- then
- strdup
- >r over .addr !
- r> swap .len !
-;
-
-: set_environment_variable
- name_buffer .len @
- value_buffer .len @ +
- 5 chars +
- allocate if out_of_memory throw then
- dup 0 ( addr -- addr addr len )
- s" set " strcat
- name_buffer .addr @ name_buffer .len @ strcat
- s" =" strcat
- value_buffer .addr @ value_buffer .len @ strcat
- ['] evaluate catch if
- 2drop free drop
- set_error throw
- else
- free-memory
- then
+ value_buffer strget unquote
+ get_module_option module.loaderror string=
;
: set_nextboot_flag
@@ -897,23 +748,12 @@ only forth also support-functions also f
;
: execute_command
- value_buffer .addr @ value_buffer .len @
- over c@ [char] " = if
- 2 - swap char+ swap
- then
- ['] evaluate catch if exec_error throw then
+ value_buffer strget unquote
+ ['] evaluate catch if EEXEC throw then
;
: set_password
- password .addr @ ?dup if free if free_error throw then then
- value_buffer .addr @ c@ [char] " = if
- value_buffer .addr @ char+ value_buffer .len @ 2 - strdup
- value_buffer .addr @ free if free_error throw then
- else
- value_buffer .addr @ value_buffer .len @
- then
- password .len ! password .addr !
- 0 value_buffer .addr !
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From luigi at FreeBSD.org Wed Jan 14 08:13:54 2009
From: luigi at FreeBSD.org (Luigi Rizzo)
Date: Wed Jan 14 08:14:15 2009
Subject: svn commit: r187225 - stable/7/sys/boot/common
Message-ID: <200901141613.n0EGDp6o047742@svn.freebsd.org>
Author: luigi
Date: Wed Jan 14 16:13:51 2009
New Revision: 187225
URL: http://svn.freebsd.org/changeset/base/187225
Log:
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.
Modified:
stable/7/sys/boot/common/interp.c
Modified: stable/7/sys/boot/common/interp.c
==============================================================================
--- stable/7/sys/boot/common/interp.c Wed Jan 14 16:03:10 2009 (r187224)
+++ stable/7/sys/boot/common/interp.c Wed Jan 14 16:13:51 2009 (r187225)
@@ -46,7 +46,7 @@ extern FICL_VM *bf_vm;
#define RETURN(x) return(x)
#endif
-#define MAXARGS 20 /* maximum number of arguments allowed */
+#define MAXARGS 20 /* maximum number of arguments allowed */
static void prompt(void);
From kensmith at FreeBSD.org Wed Jan 14 08:27:05 2009
From: kensmith at FreeBSD.org (Ken Smith)
Date: Wed Jan 14 08:27:11 2009
Subject: svn commit: r187226 - stable/7
Message-ID: <200901141627.n0EGR4Jj048040@svn.freebsd.org>
Author: kensmith
Date: Wed Jan 14 16:27:04 2009
New Revision: 187226
URL: http://svn.freebsd.org/changeset/base/187226
Log:
Oops, forgot to mention 7.1-RELEASE in stable/7...
Submitted by: Florian Smeets
Modified:
stable/7/UPDATING
Modified: stable/7/UPDATING
==============================================================================
--- stable/7/UPDATING Wed Jan 14 16:13:51 2009 (r187225)
+++ stable/7/UPDATING Wed Jan 14 16:27:04 2009 (r187226)
@@ -23,6 +23,9 @@ portupgrade.
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.
From sam at FreeBSD.org Wed Jan 14 10:23:17 2009
From: sam at FreeBSD.org (Sam Leffler)
Date: Wed Jan 14 10:23:35 2009
Subject: svn commit: r187229 - in stable/7/usr.bin: calendar cksum comm
cpuset fetch file gzip ipcrm ipcs kdump ktrace ldd lockf
logger make netstat nsupdate procstat sed shar su tar top
truncate truss unit...
Message-ID: <200901141823.n0EINDgS050409@svn.freebsd.org>
Author: sam
Date: Wed Jan 14 18:23:13 2009
New Revision: 187229
URL: http://svn.freebsd.org/changeset/base/187229
Log:
bring in bits missed in r187106: sync build infrastructure changes with HEAD
Noticed by: attilio
Modified:
stable/7/usr.bin/calendar/ (props changed)
stable/7/usr.bin/cksum/ (props changed)
stable/7/usr.bin/comm/ (props changed)
stable/7/usr.bin/cpuset/ (props changed)
stable/7/usr.bin/fetch/ (props changed)
stable/7/usr.bin/file/ (props changed)
stable/7/usr.bin/gzip/ (props changed)
stable/7/usr.bin/ipcrm/ (props changed)
stable/7/usr.bin/ipcs/ (props changed)
stable/7/usr.bin/kdump/ (props changed)
stable/7/usr.bin/ktrace/ (props changed)
stable/7/usr.bin/ldd/ (props changed)
stable/7/usr.bin/lockf/ (props changed)
stable/7/usr.bin/logger/ (props changed)
stable/7/usr.bin/make/ (props changed)
stable/7/usr.bin/netstat/ (props changed)
stable/7/usr.bin/netstat/Makefile
stable/7/usr.bin/netstat/main.c
stable/7/usr.bin/netstat/netstat.h
stable/7/usr.bin/nsupdate/ (props changed)
stable/7/usr.bin/procstat/ (props changed)
stable/7/usr.bin/sed/ (props changed)
stable/7/usr.bin/shar/ (props changed)
stable/7/usr.bin/su/ (props changed)
stable/7/usr.bin/tar/ (props changed)
stable/7/usr.bin/top/ (props changed)
stable/7/usr.bin/truncate/ (props changed)
stable/7/usr.bin/truss/ (props changed)
stable/7/usr.bin/units/ (props changed)
stable/7/usr.bin/vmstat/ (props changed)
stable/7/usr.bin/whereis/ (props changed)
stable/7/usr.bin/window/ (props changed)
stable/7/usr.bin/xargs/ (props changed)
Modified: stable/7/usr.bin/netstat/Makefile
==============================================================================
--- stable/7/usr.bin/netstat/Makefile Wed Jan 14 18:19:06 2009 (r187228)
+++ stable/7/usr.bin/netstat/Makefile Wed Jan 14 18:23:13 2009 (r187229)
@@ -5,7 +5,7 @@
PROG= netstat
SRCS= if.c inet.c main.c mbuf.c mcast.c mroute.c route.c \
- unix.c atalk.c netgraph.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c
+ unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c
WARNS?= 3
CFLAGS+=-fno-strict-aliasing
@@ -20,8 +20,15 @@ CFLAGS+=-DINET6
BINGRP= kmem
BINMODE=2555
-DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBNETGRAPH} ${LIBUTIL}
-LDADD= -lkvm -lmemstat -lnetgraph -lutil
+DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBUTIL}
+LDADD= -lkvm -lmemstat -lutil
+
+.if ${MK_NETGRAPH_SUPPORT} != "no"
+SRCS+= netgraph.c
+DPADD+= ${LIBNETGRAPH}
+LDADD+= -lnetgraph
+CFLAGS+=-DNETGRAPH
+.endif
.if ${MK_IPX_SUPPORT} != "no"
SRCS+= ipx.c
Modified: stable/7/usr.bin/netstat/main.c
==============================================================================
--- stable/7/usr.bin/netstat/main.c Wed Jan 14 18:19:06 2009 (r187228)
+++ stable/7/usr.bin/netstat/main.c Wed Jan 14 18:23:13 2009 (r187229)
@@ -54,7 +54,9 @@ __FBSDID("$FreeBSD$");
#include
+#ifdef NETGRAPH
#include
+#endif
#include
#include
@@ -272,7 +274,7 @@ struct protox atalkprotox[] = {
{ -1, -1, 0, NULL,
NULL, NULL, NULL, 0, 0 }
};
-
+#ifdef NETGRAPH
struct protox netgraphprotox[] = {
{ N_NGSOCKS, -1, 1, netgraphprotopr,
NULL, NULL, "ctrl", 0, 0 },
@@ -281,7 +283,7 @@ struct protox netgraphprotox[] = {
{ -1, -1, 0, NULL,
NULL, NULL, NULL, 0, 0 }
};
-
+#endif
#ifdef IPX
struct protox ipxprotox[] = {
{ N_IPX, N_IPXSTAT, 1, ipxprotopr,
@@ -383,9 +385,11 @@ main(int argc, char *argv[])
af = AF_UNIX;
else if (strcmp(optarg, "atalk") == 0)
af = AF_APPLETALK;
+#ifdef NETGRAPH
else if (strcmp(optarg, "ng") == 0
|| strcmp(optarg, "netgraph") == 0)
af = AF_NETGRAPH;
+#endif
else if (strcmp(optarg, "link") == 0)
af = AF_LINK;
else {
@@ -580,9 +584,11 @@ main(int argc, char *argv[])
if (af == AF_APPLETALK || af == AF_UNSPEC)
for (tp = atalkprotox; tp->pr_name; tp++)
printproto(tp, tp->pr_name);
+#ifdef NETGRAPH
if (af == AF_NETGRAPH || af == AF_UNSPEC)
for (tp = netgraphprotox; tp->pr_name; tp++)
printproto(tp, tp->pr_name);
+#endif /* NETGRAPH */
if ((af == AF_UNIX || af == AF_UNSPEC) && !Lflag && !sflag)
unixpr(nl[N_UNP_COUNT].n_value, nl[N_UNP_GENCNT].n_value,
nl[N_UNP_DHEAD].n_value, nl[N_UNP_SHEAD].n_value);
Modified: stable/7/usr.bin/netstat/netstat.h
==============================================================================
--- stable/7/usr.bin/netstat/netstat.h Wed Jan 14 18:19:06 2009 (r187228)
+++ stable/7/usr.bin/netstat/netstat.h Wed Jan 14 18:23:13 2009 (r187229)
@@ -144,7 +144,9 @@ void nserr_stats(u_long, const char *, i
void atalkprotopr(u_long, const char *, int, int);
void ddp_stats(u_long, const char *, int, int);
+#ifdef NETGRAPH
void netgraphprotopr(u_long, const char *, int, int);
+#endif
void unixpr(u_long, u_long, u_long, u_long);
From bra at fsn.hu Wed Jan 14 11:39:24 2009
From: bra at fsn.hu (Attila Nagy)
Date: Wed Jan 14 11:39:30 2009
Subject: svn commit: r187229 - in stable/7/usr.bin: calendar cksum comm
cpuset fetch file gzip ipcrm ipcs kdump ktrace ldd lockf logger
make netstat
nsupdate procstat sed shar su tar top truncate truss unit...
In-Reply-To: <200901141823.n0EINDgS050409@svn.freebsd.org>
References: <200901141823.n0EINDgS050409@svn.freebsd.org>
Message-ID: <496E3B17.1030403@fsn.hu>
Hello,
Sam Leffler wrote:
> Author: sam
> Date: Wed Jan 14 18:23:13 2009
> New Revision: 187229
> URL: http://svn.freebsd.org/changeset/base/187229
>
> Log:
> bring in bits missed in r187106: sync build infrastructure changes with HEAD
>
> Noticed by: attilio
>
Cool nick, thanks, but I think it's already taken. ;)
From marius at FreeBSD.org Wed Jan 14 13:04:24 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Wed Jan 14 13:04:36 2009
Subject: svn commit: r187240 - in stable/7/sys: . contrib/pf dev/cxgb
dev/dcons
Message-ID: <200901142104.n0EL4NFm053847@svn.freebsd.org>
Author: marius
Date: Wed Jan 14 21:04:23 2009
New Revision: 187240
URL: http://svn.freebsd.org/changeset/base/187240
Log:
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
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/dcons/dcons_crom.c
Modified: stable/7/sys/dev/dcons/dcons_crom.c
==============================================================================
--- stable/7/sys/dev/dcons/dcons_crom.c Wed Jan 14 20:53:46 2009 (r187239)
+++ stable/7/sys/dev/dcons/dcons_crom.c Wed Jan 14 21:04:23 2009 (r187240)
@@ -229,7 +229,7 @@ dcons_crom_attach(device_t dev)
/*lockarg*/&Giant,
#endif
&sc->dma_tag);
- bus_dmamap_create(sc->dma_tag, 0, &sc->dma_map);
+ bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map);
bus_dmamap_load(sc->dma_tag, sc->dma_map,
(void *)dcons_conf->buf, dcons_conf->size,
dmamap_cb, sc, 0);
From marius at FreeBSD.org Wed Jan 14 14:10:53 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Wed Jan 14 14:11:04 2009
Subject: svn commit: r187249 - in stable/7/sys: . contrib/pf dev/cxgb
dev/dcons
Message-ID: <200901142210.n0EMAptA055448@svn.freebsd.org>
Author: marius
Date: Wed Jan 14 22:10:51 2009
New Revision: 187249
URL: http://svn.freebsd.org/changeset/base/187249
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/dcons/dcons_crom.c
stable/7/sys/dev/dcons/dcons_os.c
Modified: stable/7/sys/dev/dcons/dcons_crom.c
==============================================================================
--- stable/7/sys/dev/dcons/dcons_crom.c Wed Jan 14 22:05:51 2009 (r187248)
+++ stable/7/sys/dev/dcons/dcons_crom.c Wed Jan 14 22:10:51 2009 (r187249)
@@ -205,7 +205,10 @@ dcons_crom_attach(device_t dev)
return (-1);
#else
struct dcons_crom_softc *sc;
+ int error;
+ if (dcons_conf->buf == NULL)
+ return (ENXIO);
sc = (struct dcons_crom_softc *) device_get_softc(dev);
sc->fd.fc = device_get_ivars(dev);
sc->fd.dev = dev;
@@ -213,7 +216,7 @@ dcons_crom_attach(device_t dev)
sc->fd.post_busreset = (void *) dcons_crom_post_busreset;
/* map dcons buffer */
- bus_dma_tag_create(
+ error = bus_dma_tag_create(
/*parent*/ sc->fd.fc->dmat,
/*alignment*/ sizeof(u_int32_t),
/*boundary*/ 0,
@@ -229,10 +232,16 @@ dcons_crom_attach(device_t dev)
/*lockarg*/&Giant,
#endif
&sc->dma_tag);
- bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map);
- bus_dmamap_load(sc->dma_tag, sc->dma_map,
+ if (error != 0)
+ return (error);
+ error = bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map);
+ if (error != 0)
+ return (error);
+ error = bus_dmamap_load(sc->dma_tag, sc->dma_map,
(void *)dcons_conf->buf, dcons_conf->size,
dmamap_cb, sc, 0);
+ if (error != 0)
+ return (error);
sc->ehand = EVENTHANDLER_REGISTER(dcons_poll, dcons_crom_poll,
(void *)sc, 0);
return (0);
Modified: stable/7/sys/dev/dcons/dcons_os.c
==============================================================================
--- stable/7/sys/dev/dcons/dcons_os.c Wed Jan 14 22:05:51 2009 (r187248)
+++ stable/7/sys/dev/dcons/dcons_os.c Wed Jan 14 22:10:51 2009 (r187249)
@@ -557,6 +557,8 @@ dcons_drv_init(int stage)
*/
dg.buf = (struct dcons_buf *) contigmalloc(dg.size,
M_DEVBUF, 0, 0x10000, 0xffffffff, PAGE_SIZE, 0ul);
+ if (dg.buf == NULL)
+ return (-1);
dcons_init(dg.buf, dg.size, sc);
}
@@ -680,9 +682,9 @@ dcons_modevent(module_t mode, int type,
switch (type) {
case MOD_LOAD:
ret = dcons_drv_init(1);
- dcons_attach();
#if __FreeBSD_version >= 500000
if (ret == 0) {
+ dcons_attach();
dcons_cnprobe(&dcons_consdev);
dcons_cninit(&dcons_consdev);
cnadd(&dcons_consdev);
@@ -691,24 +693,26 @@ dcons_modevent(module_t mode, int type,
break;
case MOD_UNLOAD:
printf("dcons: unload\n");
- callout_stop(&dcons_callout);
+ if (drv_init == 1) {
+ callout_stop(&dcons_callout);
#if __FreeBSD_version < 502122
#if defined(DDB) && DCONS_FORCE_GDB
#if CONS_NODEV
- gdb_arg = NULL;
+ gdb_arg = NULL;
#else
- gdbdev = NULL;
+ gdbdev = NULL;
#endif
#endif
#endif
#if __FreeBSD_version >= 500000
- cnremove(&dcons_consdev);
+ cnremove(&dcons_consdev);
#endif
- dcons_detach(DCONS_CON);
- dcons_detach(DCONS_GDB);
- dg.buf->magic = 0;
+ dcons_detach(DCONS_CON);
+ dcons_detach(DCONS_GDB);
+ dg.buf->magic = 0;
- contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF);
+ contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF);
+ }
break;
case MOD_SHUTDOWN:
From delphij at FreeBSD.org Wed Jan 14 16:33:19 2009
From: delphij at FreeBSD.org (Xin LI)
Date: Wed Jan 14 16:33:35 2009
Subject: svn commit: r187256 - stable/7/sbin/fsck_ffs
Message-ID: <200901150033.n0F0XIt3058291@svn.freebsd.org>
Author: delphij
Date: Thu Jan 15 00:33:17 2009
New Revision: 187256
URL: http://svn.freebsd.org/changeset/base/187256
Log:
MFC r187079:
Fix typo.
Submitted by: Ben Kaduk
Modified:
stable/7/sbin/fsck_ffs/ (props changed)
stable/7/sbin/fsck_ffs/fsck_ffs.8
Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8
==============================================================================
--- stable/7/sbin/fsck_ffs/fsck_ffs.8 Wed Jan 14 23:53:06 2009 (r187255)
+++ stable/7/sbin/fsck_ffs/fsck_ffs.8 Thu Jan 15 00:33:17 2009 (r187256)
@@ -187,7 +187,7 @@ and causes
.Nm
to crash otherwise. Be
.Em very careful
-using this flag, is dangerous if there are data transmission hazards
+using this flag, it is dangerous if there are data transmission hazards
because a false positive cylinder group magic number mismatch could
cause
.Em irrevertible data loss!
From keramida at FreeBSD.org Wed Jan 14 18:54:41 2009
From: keramida at FreeBSD.org (Giorgos Keramidas)
Date: Wed Jan 14 18:54:48 2009
Subject: svn commit: r187263 - stable/7/sbin/mdconfig
Message-ID: <200901150254.n0F2seon061282@svn.freebsd.org>
Author: keramida (doc committer)
Date: Thu Jan 15 02:54:40 2009
New Revision: 187263
URL: http://svn.freebsd.org/changeset/base/187263
Log:
MFC 173507 from /head.
Instead of hardcoding md10 as the device node in the cd9660
example, use a trick submitted by Ruslan.
Modified:
stable/7/sbin/mdconfig/ (props changed)
stable/7/sbin/mdconfig/mdconfig.8
Modified: stable/7/sbin/mdconfig/mdconfig.8
==============================================================================
--- stable/7/sbin/mdconfig/mdconfig.8 Thu Jan 15 02:52:31 2009 (r187262)
+++ stable/7/sbin/mdconfig/mdconfig.8 Thu Jan 15 02:54:40 2009 (r187263)
@@ -41,7 +41,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 5, 2008
+.Dd November 9, 2007
.Dt MDCONFIG 8
.Os
.Sh NAME
@@ -230,8 +230,7 @@ mount /dev/md0c /mnt
.Pp
To mount an ISO 9660 CD image file:
.Bd -literal -offset indent
-mdconfig -a -t vnode -u 10 -f cdimage.iso
-mount_cd9660 /dev/md10 /mnt
+mount -t cd9660 /dev/`mdconfig -a -t vnode -f cdimage.iso` /mnt
.Ed
.Sh SEE ALSO
.Xr md 4 ,
From keramida at FreeBSD.org Wed Jan 14 18:57:08 2009
From: keramida at FreeBSD.org (Giorgos Keramidas)
Date: Wed Jan 14 18:57:25 2009
Subject: svn commit: r187264 - stable/7/sbin/mdconfig
Message-ID: <200901150257.n0F2v77w061383@svn.freebsd.org>
Author: keramida (doc committer)
Date: Thu Jan 15 02:57:07 2009
New Revision: 187264
URL: http://svn.freebsd.org/changeset/base/187264
Log:
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.
Modified:
stable/7/sbin/mdconfig/ (props changed)
stable/7/sbin/mdconfig/mdconfig.8
Modified: stable/7/sbin/mdconfig/mdconfig.8
==============================================================================
--- stable/7/sbin/mdconfig/mdconfig.8 Thu Jan 15 02:54:40 2009 (r187263)
+++ stable/7/sbin/mdconfig/mdconfig.8 Thu Jan 15 02:57:07 2009 (r187264)
@@ -41,7 +41,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 9, 2007
+.Dd November 11, 2007
.Dt MDCONFIG 8
.Os
.Sh NAME
@@ -97,7 +97,7 @@ panic a system.
.It Cm vnode
A file specified with
.Fl f Ar file
-becomes the backingstore for this memory disk.
+becomes the backing store for this memory disk.
.It Cm swap
Storage for this type of memory disk is allocated from buffer
memory.
@@ -197,7 +197,7 @@ To create a disk named
.Pa /dev/md4
with
.Pa /tmp/boot.flp
-as backing:
+as backing storage:
.Pp
.Dl mdconfig -a -t vnode -f /tmp/boot.flp -u 4
.Pp
@@ -206,7 +206,9 @@ To detach and free all resources used by
.Pp
.Dl mdconfig -d -u 4
.Pp
-To create and mount a 128MByte swap backed file system on
+To create a 128MByte swap backed disk, initialize an
+.Xr ffs 7
+file system on it, and mount it on
.Pa /tmp :
.Bd -literal -offset indent
mdconfig -a -t swap -s 128M -u 10
@@ -215,10 +217,10 @@ mount /dev/md10 /tmp
chmod 1777 /tmp
.Ed
.Pp
-To create a 5MB file-backed disk (
-.Fl -a
+To create a 5MB file-backed disk
+.Ns ( Fl a
and
-.Fl -t Ar vnode
+.Fl t Ar vnode
are implied):
.Bd -literal -offset indent
dd if=/dev/zero of=somebackingfile bs=1k count=5k
@@ -228,12 +230,21 @@ newfs md0c
mount /dev/md0c /mnt
.Ed
.Pp
-To mount an ISO 9660 CD image file:
+To create an
+.Xr md 4
+device out of an ISO 9660 CD image file
+.Ns ( Fl a
+and
+.Fl t Ar vnode
+are implied), using the first available
+.Xr md 4
+device, and then mount the new memory disk:
.Bd -literal -offset indent
-mount -t cd9660 /dev/`mdconfig -a -t vnode -f cdimage.iso` /mnt
+mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt
.Ed
.Sh SEE ALSO
.Xr md 4 ,
+.Xr ffs 7 ,
.Xr bsdlabel 8 ,
.Xr fdisk 8 ,
.Xr mdmfs 8 ,
From keramida at FreeBSD.org Wed Jan 14 19:12:47 2009
From: keramida at FreeBSD.org (Giorgos Keramidas)
Date: Wed Jan 14 19:12:58 2009
Subject: svn commit: r187265 - stable/7/usr.sbin/iostat
Message-ID: <200901150312.n0F3Cj9F062006@svn.freebsd.org>
Author: keramida (doc committer)
Date: Thu Jan 15 03:12:45 2009
New Revision: 187265
URL: http://svn.freebsd.org/changeset/base/187265
Log:
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.
Modified:
stable/7/usr.sbin/iostat/ (props changed)
stable/7/usr.sbin/iostat/iostat.c
Modified: stable/7/usr.sbin/iostat/iostat.c
==============================================================================
--- stable/7/usr.sbin/iostat/iostat.c Thu Jan 15 02:57:07 2009 (r187264)
+++ stable/7/usr.sbin/iostat/iostat.c Thu Jan 15 03:12:45 2009 (r187265)
@@ -113,6 +113,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -129,17 +130,23 @@ struct nlist namelist[] = {
{ NULL },
};
+#define IOSTAT_DEFAULT_ROWS 20 /* Traditional default `wrows' */
+
struct statinfo cur, last;
int num_devices;
struct device_selection *dev_select;
int maxshowdevs;
volatile sig_atomic_t headercount;
+volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */
+unsigned short wrows; /* Current number of tty rows. */
int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0;
int xflag = 0, zflag = 0;
/* local function declarations */
static void usage(void);
static void needhdr(int signo);
+static void needresize(int signo);
+static void doresize(void);
static void phdr(void);
static void devstats(int perf_select, long double etime, int havelast);
static void cpustats(void);
@@ -424,6 +431,20 @@ main(int argc, char **argv)
*/
(void)signal(SIGCONT, needhdr);
+ /*
+ * If our standard output is a tty, then install a SIGWINCH handler
+ * and set wresized so that our first iteration through the main
+ * iostat loop will peek at the terminal's current rows to find out
+ * how many lines can fit in a screenful of output.
+ */
+ if (isatty(fileno(stdout)) != 0) {
+ wresized = 1;
+ (void)signal(SIGWINCH, needresize);
+ } else {
+ wresized = 0;
+ wrows = IOSTAT_DEFAULT_ROWS;
+ }
+
for (headercount = 1;;) {
struct devinfo *tmp_dinfo;
long tmp;
@@ -457,7 +478,9 @@ main(int argc, char **argv)
if (!--headercount) {
phdr();
- headercount = 20;
+ if (wresized != 0)
+ doresize();
+ headercount = wrows;
}
tmp_dinfo = last.dinfo;
@@ -499,7 +522,9 @@ main(int argc, char **argv)
break;
case 1:
phdr();
- headercount = 20;
+ if (wresized != 0)
+ doresize();
+ headercount = wrows;
break;
default:
break;
@@ -534,7 +559,9 @@ main(int argc, char **argv)
break;
case 1:
phdr();
- headercount = 20;
+ if (wresized != 0)
+ doresize();
+ headercount = wrows;
break;
default:
break;
@@ -595,6 +622,47 @@ needhdr(int signo)
headercount = 1;
}
+/*
+ * When the terminal is resized, force an update of the maximum number of rows
+ * printed between each header repetition. Then force a new header to be
+ * prepended to the next output.
+ */
+void
+needresize(int signo)
+{
+
+ wresized = 1;
+ headercount = 1;
+}
+
+/*
+ * Update the global `wrows' count of terminal rows.
+ */
+void
+doresize(void)
+{
+ int status;
+ struct winsize w;
+
+ for (;;) {
+ status = ioctl(fileno(stdout), TIOCGWINSZ, &w);
+ if (status == -1 && errno == EINTR)
+ continue;
+ else if (status == -1)
+ err(1, "ioctl");
+ if (w.ws_row > 3)
+ wrows = w.ws_row - 3;
+ else
+ wrows = IOSTAT_DEFAULT_ROWS;
+ break;
+ }
+
+ /*
+ * Inhibit doresize() calls until we are rescheduled by SIGWINCH.
+ */
+ wresized = 0;
+}
+
static void
phdr(void)
{
From keramida at FreeBSD.org Wed Jan 14 19:48:50 2009
From: keramida at FreeBSD.org (Giorgos Keramidas)
Date: Wed Jan 14 19:49:07 2009
Subject: svn commit: r187272 - stable/7/usr.bin/du
Message-ID: <200901150348.n0F3mnsH063031@svn.freebsd.org>
Author: keramida (doc committer)
Date: Thu Jan 15 03:48:49 2009
New Revision: 187272
URL: http://svn.freebsd.org/changeset/base/187272
Log:
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.
Modified:
stable/7/usr.bin/du/ (props changed)
stable/7/usr.bin/du/du.1
stable/7/usr.bin/du/du.c
Modified: stable/7/usr.bin/du/du.1
==============================================================================
--- stable/7/usr.bin/du/du.1 Thu Jan 15 03:46:14 2009 (r187271)
+++ stable/7/usr.bin/du/du.1 Thu Jan 15 03:48:49 2009 (r187272)
@@ -32,7 +32,7 @@
.\" @(#)du.1 8.2 (Berkeley) 4/1/94
.\" $FreeBSD$
.\"
-.Dd May 6, 2006
+.Dd February 25, 2008
.Dt DU 1
.Os
.Sh NAME
@@ -43,6 +43,7 @@
.Op Fl H | L | P
.Op Fl a | s | d Ar depth
.Op Fl c
+.Op Fl l
.Op Fl h | k | m
.Op Fl n
.Op Fl x
@@ -94,6 +95,15 @@ directories deep.
Display a grand total.
.It Fl k
Display block counts in 1024-byte (1-Kbyte) blocks.
+.It Fl l
+If a file has multiple hard links, count its size many times.
+The default behavior of
+.Nm
+is to count files with multiple hard links only once.
+When the
+.Fl l
+option is specified, the hard link checks are disabled, and these files
+are counted (and displayed) as many times as they are found.
.It Fl m
Display block counts in 1048576-byte (1-Mbyte) blocks.
.It Fl n
@@ -120,11 +130,6 @@ or
.Fl L
options are specified, storage used by any symbolic links which are
followed is not counted or displayed.
-.Pp
-Files having multiple hard links are counted (and displayed) a single
-time per
-.Nm
-execution.
.Sh ENVIRONMENT
.Bl -tag -width BLOCKSIZE
.It Ev BLOCKSIZE
Modified: stable/7/usr.bin/du/du.c
==============================================================================
--- stable/7/usr.bin/du/du.c Thu Jan 15 03:46:14 2009 (r187271)
+++ stable/7/usr.bin/du/du.c Thu Jan 15 03:48:49 2009 (r187272)
@@ -90,20 +90,22 @@ main(int argc, char *argv[])
int ftsoptions;
int listall;
int depth;
- int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag, hflag, ch, notused, rval;
+ int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag;
+ int hflag, lflag, ch, notused, rval;
char **save;
static char dot[] = ".";
setlocale(LC_ALL, "");
- Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = 0;
+ Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag =
+ lflag = 0;
save = argv;
ftsoptions = 0;
depth = INT_MAX;
SLIST_INIT(&ignores);
- while ((ch = getopt(argc, argv, "HI:LPasd:chkmnrx")) != -1)
+ while ((ch = getopt(argc, argv, "HI:LPasd:chklmnrx")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
@@ -147,6 +149,9 @@ main(int argc, char *argv[])
hflag = 0;
setenv("BLOCKSIZE", "1024", 1);
break;
+ case 'l':
+ lflag = 1;
+ break;
case 'm':
hflag = 0;
setenv("BLOCKSIZE", "1048576", 1);
@@ -257,7 +262,8 @@ main(int argc, char *argv[])
if (ignorep(p))
break;
- if (p->fts_statp->st_nlink > 1 && linkchk(p))
+ if (lflag == 0 &&
+ p->fts_statp->st_nlink > 1 && linkchk(p))
break;
if (listall || p->fts_level == 0) {
@@ -443,7 +449,8 @@ static void
usage(void)
{
(void)fprintf(stderr,
- "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m] [-n] [-x] [-I mask] [file ...]\n");
+ "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] "
+ "[-l] [-h | -k | -m] [-n] [-x] [-I mask] [file ...]\n");
exit(EX_USAGE);
}
From keramida at FreeBSD.org Wed Jan 14 20:31:56 2009
From: keramida at FreeBSD.org (Giorgos Keramidas)
Date: Wed Jan 14 20:32:02 2009
Subject: svn commit: r187278 - in stable/7/lib/libc: . regex string
Message-ID: <200901150431.n0F4Vtvq064272@svn.freebsd.org>
Author: keramida (doc committer)
Date: Thu Jan 15 04:31:55 2009
New Revision: 187278
URL: http://svn.freebsd.org/changeset/base/187278
Log:
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
Modified:
stable/7/lib/libc/ (props changed)
stable/7/lib/libc/regex/re_format.7
stable/7/lib/libc/string/ffsll.c (props changed)
stable/7/lib/libc/string/flsll.c (props changed)
Modified: stable/7/lib/libc/regex/re_format.7
==============================================================================
--- stable/7/lib/libc/regex/re_format.7 Thu Jan 15 04:29:02 2009 (r187277)
+++ stable/7/lib/libc/regex/re_format.7 Thu Jan 15 04:31:55 2009 (r187278)
@@ -288,6 +288,14 @@ These stand for the character classes de
A locale may provide others.
A character class may not be used as an endpoint of a range.
.Pp
+A bracketed expression like
+.Ql [[:class:]]
+can be used to match a single character that belongs to a character
+class.
+The reverse, matching any character that does not belong to a specific
+class, the negation operator of bracket expressions may be used:
+.Ql [^[:class:]] .
+.Pp
There are two special cases\(dd of bracket expressions:
the bracket expressions
.Ql [[:<:]]
From keramida at FreeBSD.org Wed Jan 14 20:39:45 2009
From: keramida at FreeBSD.org (Giorgos Keramidas)
Date: Wed Jan 14 20:40:02 2009
Subject: svn commit: r187280 - stable/7/sbin/ifconfig
Message-ID: <200901150439.n0F4diG7064506@svn.freebsd.org>
Author: keramida (doc committer)
Date: Thu Jan 15 04:39:44 2009
New Revision: 187280
URL: http://svn.freebsd.org/changeset/base/187280
Log:
MFC 184057 from /head
Modified:
stable/7/sbin/ifconfig/ifconfig.8
Modified: stable/7/sbin/ifconfig/ifconfig.8
==============================================================================
--- stable/7/sbin/ifconfig/ifconfig.8 Thu Jan 15 04:32:53 2009 (r187279)
+++ stable/7/sbin/ifconfig/ifconfig.8 Thu Jan 15 04:39:44 2009 (r187280)
@@ -28,7 +28,7 @@
.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
.\" $FreeBSD$
.\"
-.Dd June 20, 2008
+.Dd October 19, 2008
.Dt IFCONFIG 8
.Os
.Sh NAME
@@ -106,7 +106,7 @@ slash notation) to include the netmask.
That is, one can specify an address like
.Li 192.168.0.1/16 .
.Pp
-For
+For the
.Dq inet6
family, it is also possible to specify the prefix length using the slash
notation, like
@@ -906,8 +906,9 @@ This information may be updated automati
and/or with a
.Cm scan
request or through background scanning.
+The
.Cm list ap
-is another way of requesting this information.
+command is another way of requesting this information.
.It Cm list sta
When operating as an access point display the stations that are
currently associated.
From keramida at FreeBSD.org Wed Jan 14 20:48:14 2009
From: keramida at FreeBSD.org (Giorgos Keramidas)
Date: Wed Jan 14 20:48:31 2009
Subject: svn commit: r187282 - stable/7/usr.bin/vmstat
Message-ID: <200901150448.n0F4m6xl064732@svn.freebsd.org>
Author: keramida (doc committer)
Date: Thu Jan 15 04:48:06 2009
New Revision: 187282
URL: http://svn.freebsd.org/changeset/base/187282
Log:
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.
Modified:
stable/7/usr.bin/vmstat/vmstat.c
Modified: stable/7/usr.bin/vmstat/vmstat.c
==============================================================================
--- stable/7/usr.bin/vmstat/vmstat.c Thu Jan 15 04:43:09 2009 (r187281)
+++ stable/7/usr.bin/vmstat/vmstat.c Thu Jan 15 04:48:06 2009 (r187282)
@@ -133,7 +133,10 @@ static devstat_select_mode select_mode;
static struct vmmeter sum, osum;
-static int winlines = 20;
+#define VMSTAT_DEFAULT_LINES 20 /* Default number of `winlines'. */
+volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */
+static int winlines = VMSTAT_DEFAULT_LINES; /* Current number of tty rows. */
+
static int aflag;
static int nflag;
static int Pflag;
@@ -162,6 +165,8 @@ static void kread(int, void *, size_t);
static void kreado(int, void *, size_t, size_t);
static char *kgetstr(const char *);
static void needhdr(int);
+static void needresize(int);
+static void doresize(void);
static void printhdr(int, u_long);
static void usage(void);
@@ -277,8 +282,6 @@ main(int argc, char *argv[])
errx(1, "Cannot use -P with crash dumps");
if (todo & VMSTAT) {
- struct winsize winsize;
-
/*
* Make sure that the userland devstat version matches the
* kernel devstat version. If not, exit and print a
@@ -289,11 +292,6 @@ main(int argc, char *argv[])
argv = getdrivedata(argv);
- winsize.ws_row = 0;
- (void) ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&winsize);
- if (winsize.ws_row > 0)
- winlines = winsize.ws_row;
-
}
#define BACKWARD_COMPATIBILITY
@@ -578,8 +576,27 @@ dovmstat(unsigned int interval, int reps
uptime = getuptime();
halfuptime = uptime / 2;
+
+ /*
+ * If the user stops the program (control-Z) and then resumes it,
+ * print out the header again.
+ */
(void)signal(SIGCONT, needhdr);
+ /*
+ * If our standard output is a tty, then install a SIGWINCH handler
+ * and set wresized so that our first iteration through the main
+ * iostat loop will peek at the terminal's current rows to find out
+ * how many lines can fit in a screenful of output.
+ */
+ if (isatty(fileno(stdout)) != 0) {
+ wresized = 1;
+ (void)signal(SIGWINCH, needresize);
+ } else {
+ wresized = 0;
+ winlines = VMSTAT_DEFAULT_LINES;
+ }
+
if (kd != NULL) {
if (namelist[X_STATHZ].n_type != 0 &&
namelist[X_STATHZ].n_value != 0)
@@ -758,7 +775,9 @@ printhdr(int ncpus, u_long cpumask)
printf("\n");
} else
printf(" us sy id\n");
- hdrcnt = winlines - 2;
+ if (wresized != 0)
+ doresize();
+ hdrcnt = winlines;
}
/*
@@ -771,6 +790,47 @@ needhdr(int dummy __unused)
hdrcnt = 1;
}
+/*
+ * When the terminal is resized, force an update of the maximum number of rows
+ * printed between each header repetition. Then force a new header to be
+ * prepended to the next output.
+ */
+void
+needresize(int signo)
+{
+
+ wresized = 1;
+ hdrcnt = 1;
+}
+
+/*
+ * Update the global `winlines' count of terminal rows.
+ */
+void
+doresize(void)
+{
+ int status;
+ struct winsize w;
+
+ for (;;) {
+ status = ioctl(fileno(stdout), TIOCGWINSZ, &w);
+ if (status == -1 && errno == EINTR)
+ continue;
+ else if (status == -1)
+ err(1, "ioctl");
+ if (w.ws_row > 3)
+ winlines = w.ws_row - 3;
+ else
+ winlines = VMSTAT_DEFAULT_LINES;
+ break;
+ }
+
+ /*
+ * Inhibit doresize() calls until we are rescheduled by SIGWINCH.
+ */
+ wresized = 0;
+}
+
#ifdef notyet
static void
dotimes(void)
From keramida at FreeBSD.org Wed Jan 14 20:54:44 2009
From: keramida at FreeBSD.org (Giorgos Keramidas)
Date: Wed Jan 14 20:54:51 2009
Subject: svn commit: r187285 - stable/7/usr.bin/wc
Message-ID: <200901150454.n0F4shcA064976@svn.freebsd.org>
Author: keramida (doc committer)
Date: Thu Jan 15 04:54:43 2009
New Revision: 187285
URL: http://svn.freebsd.org/changeset/base/187285
Log:
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
Modified:
stable/7/usr.bin/wc/ (props changed)
stable/7/usr.bin/wc/wc.1
stable/7/usr.bin/wc/wc.c
Modified: stable/7/usr.bin/wc/wc.1
==============================================================================
--- stable/7/usr.bin/wc/wc.1 Thu Jan 15 04:49:43 2009 (r187284)
+++ stable/7/usr.bin/wc/wc.1 Thu Jan 15 04:54:43 2009 (r187285)
@@ -35,7 +35,7 @@
.\" @(#)wc.1 8.2 (Berkeley) 4/19/94
.\" $FreeBSD$
.\"
-.Dd February 23, 2005
+.Dd December 6, 2008
.Dt WC 1
.Os
.Sh NAME
@@ -43,7 +43,7 @@
.Nd word, line, character, and byte count
.Sh SYNOPSIS
.Nm
-.Op Fl clmw
+.Op Fl Lclmw
.Op Ar
.Sh DESCRIPTION
The
@@ -71,6 +71,15 @@ the last file.
.Pp
The following options are available:
.Bl -tag -width indent
+.It Fl L
+The number of characters in the longest input line
+is written to the standard output.
+When more then one
+.Ar file
+argument is specified, the longest input line of
+.Em all
+files is reported as the value of the final
+.Dq total .
.It Fl c
The number of bytes in each input file
is written to the standard output.
@@ -129,6 +138,10 @@ and
as well as the totals for both:
.Pp
.Dl "wc -mlw report1 report2"
+.Pp
+Find the longest line in a list of files:
+.Pp
+.Dl "wc -L file1 file2 file3 | fgrep total"
.Sh COMPATIBILITY
Historically, the
.Nm
@@ -154,6 +167,16 @@ in terms of the
.Xr iswspace 3
function, as required by
.St -p1003.2 .
+.Pp
+The
+.Fl L
+option is a non-standard
+.Fx
+extension, compatible with the
+.Fl L
+option of the GNU
+.Nm
+utility.
.Sh SEE ALSO
.Xr iswspace 3
.Sh STANDARDS
Modified: stable/7/usr.bin/wc/wc.c
==============================================================================
--- stable/7/usr.bin/wc/wc.c Thu Jan 15 04:49:43 2009 (r187284)
+++ stable/7/usr.bin/wc/wc.c Thu Jan 15 04:54:43 2009 (r187285)
@@ -62,8 +62,8 @@ __FBSDID("$FreeBSD$");
#include
#include
-uintmax_t tlinect, twordct, tcharct;
-int doline, doword, dochar, domulti;
+uintmax_t tlinect, twordct, tcharct, tlongline;
+int doline, doword, dochar, domulti, dolongline;
static int cnt(const char *);
static void usage(void);
@@ -75,7 +75,7 @@ main(int argc, char *argv[])
(void) setlocale(LC_CTYPE, "");
- while ((ch = getopt(argc, argv, "clmw")) != -1)
+ while ((ch = getopt(argc, argv, "clmwL")) != -1)
switch((char)ch) {
case 'l':
doline = 1;
@@ -87,6 +87,9 @@ main(int argc, char *argv[])
dochar = 1;
domulti = 0;
break;
+ case 'L':
+ dolongline = 1;
+ break;
case 'm':
domulti = 1;
dochar = 0;
@@ -99,7 +102,7 @@ main(int argc, char *argv[])
argc -= optind;
/* Wc's flags are on by default. */
- if (doline + doword + dochar + domulti == 0)
+ if (doline + doword + dochar + domulti + dolongline == 0)
doline = doword = dochar = 1;
errors = 0;
@@ -125,6 +128,8 @@ main(int argc, char *argv[])
(void)printf(" %7ju", twordct);
if (dochar || domulti)
(void)printf(" %7ju", tcharct);
+ if (dolongline)
+ (void)printf(" %7ju", tlongline);
(void)printf(" total\n");
}
exit(errors == 0 ? 0 : 1);
@@ -134,7 +139,7 @@ static int
cnt(const char *file)
{
struct stat sb;
- uintmax_t linect, wordct, charct;
+ uintmax_t linect, wordct, charct, llct, tmpll;
int fd, len, warned;
size_t clen;
short gotsp;
@@ -143,7 +148,7 @@ cnt(const char *file)
wchar_t wch;
mbstate_t mbs;
- linect = wordct = charct = 0;
+ linect = wordct = charct = llct = tmpll = 0;
if (file == NULL) {
file = "stdin";
fd = STDIN_FILENO;
@@ -168,8 +173,13 @@ cnt(const char *file)
}
charct += len;
for (p = buf; len--; ++p)
- if (*p == '\n')
+ if (*p == '\n') {
+ if (tmpll > llct)
+ llct = tmpll;
+ tmpll = 0;
++linect;
+ } else
+ tmpll++;
}
tlinect += linect;
(void)printf(" %7ju", linect);
@@ -177,6 +187,11 @@ cnt(const char *file)
tcharct += charct;
(void)printf(" %7ju", charct);
}
+ if (dolongline) {
+ if (llct > tlongline)
+ tlongline = llct;
+ (void)printf(" %7ju", tlongline);
+ }
(void)close(fd);
return (0);
}
@@ -229,10 +244,16 @@ word: gotsp = 1;
else if (clen == 0)
clen = 1;
charct++;
+ if (wch != L'\n')
+ tmpll++;
len -= clen;
p += clen;
- if (wch == L'\n')
+ if (wch == L'\n') {
+ if (tmpll > llct)
+ llct = tmpll;
+ tmpll = 0;
++linect;
+ }
if (iswspace(wch))
gotsp = 1;
else if (gotsp) {
@@ -256,6 +277,11 @@ word: gotsp = 1;
tcharct += charct;
(void)printf(" %7ju", charct);
}
+ if (dolongline) {
+ if (llct > tlongline)
+ tlongline = llct;
+ (void)printf(" %7ju", llct);
+ }
(void)close(fd);
return (0);
}
@@ -263,6 +289,6 @@ word: gotsp = 1;
static void
usage()
{
- (void)fprintf(stderr, "usage: wc [-clmw] [file ...]\n");
+ (void)fprintf(stderr, "usage: wc [-Lclmw] [file ...]\n");
exit(1);
}
From keramida at FreeBSD.org Wed Jan 14 21:01:30 2009
From: keramida at FreeBSD.org (Giorgos Keramidas)
Date: Wed Jan 14 21:01:46 2009
Subject: svn commit: r187287 - in stable/7/etc: . defaults periodic/weekly
Message-ID: <200901150501.n0F51To4065235@svn.freebsd.org>
Author: keramida (doc committer)
Date: Thu Jan 15 05:01:29 2009
New Revision: 187287
URL: http://svn.freebsd.org/changeset/base/187287
Log:
MFC 186916 from /head/etc
The description of the various securelevels has moved to the
security.7 manpage a while ago.
Modified:
stable/7/etc/ (props changed)
stable/7/etc/defaults/rc.conf
stable/7/etc/periodic/weekly/ (props changed)
Modified: stable/7/etc/defaults/rc.conf
==============================================================================
--- stable/7/etc/defaults/rc.conf Thu Jan 15 04:57:21 2009 (r187286)
+++ stable/7/etc/defaults/rc.conf Thu Jan 15 05:01:29 2009 (r187287)
@@ -568,7 +568,7 @@ ldconfig_local_dirs="/usr/local/libdata/
ldconfig_local32_dirs="/usr/local/libdata/ldconfig32"
# Local directories with 32-bit compatibility ldconfig
# configuration files.
-kern_securelevel_enable="NO" # kernel security level (see init(8)),
+kern_securelevel_enable="NO" # kernel security level (see security(7))
kern_securelevel="-1" # range: -1..3 ; `-1' is the most insecure
# Note that setting securelevel to 0 will result
# in the system booting with securelevel set to 1, as
From keramida at FreeBSD.org Wed Jan 14 21:04:33 2009
From: keramida at FreeBSD.org (Giorgos Keramidas)
Date: Wed Jan 14 21:04:39 2009
Subject: svn commit: r187288 - stable/7/share/man/man5
Message-ID: <200901150504.n0F54WiN065333@svn.freebsd.org>
Author: keramida (doc committer)
Date: Thu Jan 15 05:04:31 2009
New Revision: 187288
URL: http://svn.freebsd.org/changeset/base/187288
Log:
The description of the various securelevels has moved to the
security.7 manpage a while ago.
Noticed by: simon
Modified:
stable/7/share/man/man5/ (props changed)
stable/7/share/man/man5/rc.conf.5
Modified: stable/7/share/man/man5/rc.conf.5
==============================================================================
--- stable/7/share/man/man5/rc.conf.5 Thu Jan 15 05:01:29 2009 (r187287)
+++ stable/7/share/man/man5/rc.conf.5 Thu Jan 15 05:04:31 2009 (r187288)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 16, 2008
+.Dd January 9, 2009
.Dt RC.CONF 5
.Os
.Sh NAME
@@ -3160,7 +3160,7 @@ The allowed range of
ranges from \-1 (the compile time default) to 3 (the
most secure).
See
-.Xr init 8
+.Xr security 7
for the list of possible security levels and their effect
on system operation.
.It Va sshd_program
@@ -4021,6 +4021,7 @@ Default
.Xr motd 5 ,
.Xr newsyslog.conf 5 ,
.Xr pf.conf 5 ,
+.Xr security 7 ,
.Xr accton 8 ,
.Xr amd 8 ,
.Xr apm 8 ,
From obrien at FreeBSD.org Thu Jan 15 09:15:04 2009
From: obrien at FreeBSD.org (David E. O'Brien)
Date: Thu Jan 15 09:15:21 2009
Subject: svn commit: r187300 - stable/7/usr.sbin/fifolog/fifolog_create
Message-ID: <200901151715.n0FHF3go082402@svn.freebsd.org>
Author: obrien
Date: Thu Jan 15 17:15:03 2009
New Revision: 187300
URL: http://svn.freebsd.org/changeset/base/187300
Log:
Don't claim to be FreeBSD 8.0 when installed on FreeBSD 7.1.
Modified:
stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1
Modified: stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1
==============================================================================
--- stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Thu Jan 15 16:04:11 2009 (r187299)
+++ stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Thu Jan 15 17:15:03 2009 (r187300)
@@ -25,7 +25,7 @@
.\" $FreeBSD$
.\"
.Dd Feb 9, 2008
-.Os FreeBSD 8.0
+.Os
.Dt FIFOLOG 1
.Sh NAME
.Nm fifolog_create
From marius at FreeBSD.org Thu Jan 15 12:13:23 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Thu Jan 15 12:13:29 2009
Subject: svn commit: r187306 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/bge dev/cxgb
Message-ID: <200901152013.n0FKDMiC086112@svn.freebsd.org>
Author: marius
Date: Thu Jan 15 20:13:22 2009
New Revision: 187306
URL: http://svn.freebsd.org/changeset/base/187306
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/bge/if_bge.c
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/dev/bge/if_bge.c
==============================================================================
--- stable/7/sys/dev/bge/if_bge.c Thu Jan 15 19:57:45 2009 (r187305)
+++ stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:13:22 2009 (r187306)
@@ -134,7 +134,7 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1);
* ID burned into it, though it will always be overriden by the vendor
* ID in the EEPROM. Just to be safe, we cover all possibilities.
*/
-static struct bge_type {
+static const struct bge_type {
uint16_t bge_vid;
uint16_t bge_did;
} bge_devs[] = {
@@ -1861,7 +1861,7 @@ bge_lookup_vendor(uint16_t vid)
static int
bge_probe(device_t dev)
{
- struct bge_type *t = bge_devs;
+ const struct bge_type *t = bge_devs;
struct bge_softc *sc = device_get_softc(dev);
uint16_t vid, did;
@@ -1883,7 +1883,8 @@ bge_probe(device_t dev)
#if __FreeBSD_version > 700024
const char *pname;
- if (pci_get_vpd_ident(dev, &pname) == 0)
+ if (bge_has_eaddr(sc) &&
+ pci_get_vpd_ident(dev, &pname) == 0)
snprintf(model, 64, "%s", pname);
else
#endif
From marius at FreeBSD.org Thu Jan 15 12:19:54 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Thu Jan 15 12:20:11 2009
Subject: svn commit: r187308 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/bge dev/cxgb
Message-ID: <200901152019.n0FKJrae086327@svn.freebsd.org>
Author: marius
Date: Thu Jan 15 20:19:53 2009
New Revision: 187308
URL: http://svn.freebsd.org/changeset/base/187308
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/bge/if_bge.c
stable/7/sys/dev/bge/if_bgereg.h
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/dev/bge/if_bge.c
==============================================================================
--- stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:13:50 2009 (r187307)
+++ stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:19:53 2009 (r187308)
@@ -2387,11 +2387,7 @@ bge_attach(device_t dev)
goto fail;
}
- sc->bge_btag = rman_get_bustag(sc->bge_res);
- sc->bge_bhandle = rman_get_bushandle(sc->bge_res);
-
/* Save ASIC rev. */
-
sc->bge_chipid =
pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
BGE_PCIMISCCTL_ASICREV;
Modified: stable/7/sys/dev/bge/if_bgereg.h
==============================================================================
--- stable/7/sys/dev/bge/if_bgereg.h Thu Jan 15 20:13:50 2009 (r187307)
+++ stable/7/sys/dev/bge/if_bgereg.h Thu Jan 15 20:19:53 2009 (r187308)
@@ -1896,8 +1896,7 @@ struct bge_rcb {
};
#define RCB_WRITE_4(sc, rcb, offset, val) \
- bus_space_write_4(sc->bge_btag, sc->bge_bhandle, \
- rcb + offsetof(struct bge_rcb, offset), val)
+ bus_write_4(sc->bge_res, rcb + offsetof(struct bge_rcb, offset), val)
#define BGE_RCB_MAXLEN_FLAGS(maxlen, flags) ((maxlen) << 16 | (flags))
#define BGE_RCB_FLAG_USE_EXT_RX_BD 0x0001
@@ -2394,10 +2393,10 @@ struct bge_gib {
*/
#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->bge_btag, sc->bge_bhandle, reg, val)
+ bus_write_4(sc->bge_res, reg, val)
#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->bge_btag, sc->bge_bhandle, reg)
+ bus_read_4(sc->bge_res, reg)
#define BGE_SETBIT(sc, reg, x) \
CSR_WRITE_4(sc, reg, (CSR_READ_4(sc, reg) | (x)))
@@ -2522,8 +2521,6 @@ struct bge_softc {
device_t bge_dev;
struct mtx bge_mtx;
device_t bge_miibus;
- bus_space_handle_t bge_bhandle;
- bus_space_tag_t bge_btag;
void *bge_intrhand;
struct resource *bge_irq;
struct resource *bge_res;
From marius at FreeBSD.org Thu Jan 15 12:23:39 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Thu Jan 15 12:23:53 2009
Subject: svn commit: r187309 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/bge dev/cxgb
Message-ID: <200901152023.n0FKNcG7086452@svn.freebsd.org>
Author: marius
Date: Thu Jan 15 20:23:38 2009
New Revision: 187309
URL: http://svn.freebsd.org/changeset/base/187309
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/bge/if_bge.c
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/dev/bge/if_bge.c
==============================================================================
--- stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:19:53 2009 (r187308)
+++ stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:23:38 2009 (r187309)
@@ -2338,10 +2338,11 @@ bge_can_use_msi(struct bge_softc *sc)
int can_use_msi = 0;
switch (sc->bge_asicrev) {
+ case BGE_ASICREV_BCM5714_A0:
case BGE_ASICREV_BCM5714:
/*
- * Apparently, MSI doesn't work when this chip is configured
- * in single-port mode.
+ * Apparently, MSI doesn't work when these chips are
+ * configured in single-port mode.
*/
if (bge_has_multiple_ports(sc))
can_use_msi = 1;
@@ -2351,10 +2352,9 @@ bge_can_use_msi(struct bge_softc *sc)
sc->bge_chiprev != BGE_CHIPREV_5750_BX)
can_use_msi = 1;
break;
- case BGE_ASICREV_BCM5752:
- case BGE_ASICREV_BCM5780:
- can_use_msi = 1;
- break;
+ default:
+ if (BGE_IS_575X_PLUS(sc))
+ can_use_msi = 1;
}
return (can_use_msi);
}
From marius at FreeBSD.org Thu Jan 15 12:30:40 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Thu Jan 15 12:30:51 2009
Subject: svn commit: r187311 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb dev/sym
Message-ID: <200901152030.n0FKUcYZ086656@svn.freebsd.org>
Author: marius
Date: Thu Jan 15 20:30:38 2009
New Revision: 187311
URL: http://svn.freebsd.org/changeset/base/187311
Log:
MFC: r183895
Use xpt_register_async() in order to remove code duplication.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/sym/sym_hipd.c
Modified: stable/7/sys/dev/sym/sym_hipd.c
==============================================================================
--- stable/7/sys/dev/sym/sym_hipd.c Thu Jan 15 20:23:44 2009 (r187310)
+++ stable/7/sys/dev/sym/sym_hipd.c Thu Jan 15 20:30:38 2009 (r187311)
@@ -8974,7 +8974,6 @@ static int sym_cam_attach(hcb_p np)
struct cam_devq *devq = NULL;
struct cam_sim *sim = NULL;
struct cam_path *path = NULL;
- struct ccb_setasync csa;
int err;
/*
@@ -9021,12 +9020,9 @@ static int sym_cam_attach(hcb_p np)
/*
* Establish our async notification handler.
*/
- xpt_setup_ccb(&csa.ccb_h, np->path, 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = AC_LOST_DEVICE;
- csa.callback = sym_async;
- csa.callback_arg = np->sim;
- xpt_action((union ccb *)&csa);
+ if (xpt_register_async(AC_LOST_DEVICE, sym_async, sim, path) !=
+ CAM_REQ_CMP)
+ goto fail;
/*
* Start the chip now, without resetting the BUS, since
From marius at FreeBSD.org Thu Jan 15 12:49:18 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Thu Jan 15 12:49:32 2009
Subject: svn commit: r187313 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb dev/le
Message-ID: <200901152049.n0FKnHpA087072@svn.freebsd.org>
Author: marius
Date: Thu Jan 15 20:49:17 2009
New Revision: 187313
URL: http://svn.freebsd.org/changeset/base/187313
Log:
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).
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/le/if_le_cbus.c
stable/7/sys/dev/le/if_le_isa.c
stable/7/sys/dev/le/if_le_lebuffer.c
stable/7/sys/dev/le/if_le_pci.c
stable/7/sys/dev/le/lebuffer_sbus.c
Modified: stable/7/sys/dev/le/if_le_cbus.c
==============================================================================
--- stable/7/sys/dev/le/if_le_cbus.c Thu Jan 15 20:45:59 2009 (r187312)
+++ stable/7/sys/dev/le/if_le_cbus.c Thu Jan 15 20:49:17 2009 (r187313)
@@ -70,12 +70,8 @@ __FBSDID("$FreeBSD$");
struct le_cbus_softc {
struct am7990_softc sc_am7990; /* glue to MI code */
- int sc_rrid;
struct resource *sc_rres;
- bus_space_tag_t sc_regt;
- bus_space_handle_t sc_regh;
- int sc_irid;
struct resource *sc_ires;
void *sc_ih;
@@ -128,10 +124,9 @@ le_cbus_wrbcr(struct lance_softc *sc, ui
{
struct le_cbus_softc *lesc = (struct le_cbus_softc *)sc;
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, port);
- bus_space_barrier(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, 2,
- BUS_SPACE_BARRIER_WRITE);
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_BDP, val);
+ bus_write_2(lesc->sc_rres, CNET98S_RAP, port);
+ bus_barrier(lesc->sc_rres, CNET98S_RAP, 2, BUS_SPACE_BARRIER_WRITE);
+ bus_write_2(lesc->sc_rres, CNET98S_BDP, val);
}
#ifdef LEDEBUG
@@ -140,10 +135,9 @@ le_cbus_rdbcr(struct lance_softc *sc, ui
{
struct le_cbus_softc *lesc = (struct le_cbus_softc *)sc;
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, port);
- bus_space_barrier(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, 2,
- BUS_SPACE_BARRIER_WRITE);
- return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, CNET98S_BDP));
+ bus_write_2(lesc->sc_rres, CNET98S_RAP, port);
+ bus_barrier(lesc->sc_rres, CNET98S_RAP, 2, BUS_SPACE_BARRIER_WRITE);
+ return (bus_read_2(lesc->sc_rres, CNET98S_BDP));
}
#endif
@@ -152,10 +146,9 @@ le_cbus_wrcsr(struct lance_softc *sc, ui
{
struct le_cbus_softc *lesc = (struct le_cbus_softc *)sc;
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, port);
- bus_space_barrier(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, 2,
- BUS_SPACE_BARRIER_WRITE);
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RDP, val);
+ bus_write_2(lesc->sc_rres, CNET98S_RAP, port);
+ bus_barrier(lesc->sc_rres, CNET98S_RAP, 2, BUS_SPACE_BARRIER_WRITE);
+ bus_write_2(lesc->sc_rres, CNET98S_RDP, val);
}
static uint16_t
@@ -163,10 +156,9 @@ le_cbus_rdcsr(struct lance_softc *sc, ui
{
struct le_cbus_softc *lesc = (struct le_cbus_softc *)sc;
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, port);
- bus_space_barrier(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, 2,
- BUS_SPACE_BARRIER_WRITE);
- return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RDP));
+ bus_write_2(lesc->sc_rres, CNET98S_RAP, port);
+ bus_barrier(lesc->sc_rres, CNET98S_RAP, 2, BUS_SPACE_BARRIER_WRITE);
+ return (bus_read_2(lesc->sc_rres, CNET98S_RDP));
}
static void
@@ -179,16 +171,16 @@ le_cbus_hwreset(struct lance_softc *sc)
*/
/* Reset the chip. */
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RESET,
- bus_space_read_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RESET));
+ bus_write_2(lesc->sc_rres, CNET98S_RESET,
+ bus_read_2(lesc->sc_rres, CNET98S_RESET));
DELAY(500);
/* ISA bus configuration */
/* ISACSR0 - set Master Mode Read Active time to 300ns. */
- le_cbus_wrbcr(sc, LE_BCR0, 0x0006);
+ le_cbus_wrbcr(sc, LE_BCR0, 0x0006);
/* ISACSR1 - set Master Mode Write Active time to 300ns. */
- le_cbus_wrbcr(sc, LE_BCR1, 0x0006);
-#ifdef LEDEBUG
+ le_cbus_wrbcr(sc, LE_BCR1, 0x0006);
+#ifdef LEDEBUG
device_printf(dev, "ISACSR2=0x%x\n", le_cbus_rdbcr(sc, LE_BCR2));
#endif
/* ISACSR5 - LED1 */
@@ -215,7 +207,7 @@ le_cbus_probe(device_t dev)
{
struct le_cbus_softc *lesc;
struct lance_softc *sc;
- int error;
+ int error, i;
/*
* Skip PnP devices as some wedge when trying to probe them as
@@ -227,18 +219,16 @@ le_cbus_probe(device_t dev)
lesc = device_get_softc(dev);
sc = &lesc->sc_am7990.lsc;
- lesc->sc_rrid = 0;
- lesc->sc_rres = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &lesc->sc_rrid,
+ i = 0;
+ lesc->sc_rres = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &i,
le_ioaddr_cnet98s, CNET98S_IOSIZE, RF_ACTIVE);
if (lesc->sc_rres == NULL)
return (ENXIO);
isa_load_resourcev(lesc->sc_rres, le_ioaddr_cnet98s, CNET98S_IOSIZE);
- lesc->sc_regt = rman_get_bustag(lesc->sc_rres);
- lesc->sc_regh = rman_get_bushandle(lesc->sc_rres);
/* Reset the chip. */
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RESET,
- bus_space_read_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RESET));
+ bus_write_2(lesc->sc_rres, CNET98S_RESET,
+ bus_read_2(lesc->sc_rres, CNET98S_RESET));
DELAY(500);
/* Stop the chip and put it in a known state. */
@@ -253,7 +243,8 @@ le_cbus_probe(device_t dev)
error = BUS_PROBE_DEFAULT;
fail:
- bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres);
+ bus_release_resource(dev, SYS_RES_IOPORT,
+ rman_get_rid(lesc->sc_rres), lesc->sc_rres);
return (error);
}
@@ -269,8 +260,8 @@ le_cbus_attach(device_t dev)
LE_LOCK_INIT(sc, device_get_nameunit(dev));
- lesc->sc_rrid = 0;
- lesc->sc_rres = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &lesc->sc_rrid,
+ i = 0;
+ lesc->sc_rres = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &i,
le_ioaddr_cnet98s, CNET98S_IOSIZE, RF_ACTIVE);
if (lesc->sc_rres == NULL) {
device_printf(dev, "cannot allocate registers\n");
@@ -278,12 +269,10 @@ le_cbus_attach(device_t dev)
goto fail_mtx;
}
isa_load_resourcev(lesc->sc_rres, le_ioaddr_cnet98s, CNET98S_IOSIZE);
- lesc->sc_regt = rman_get_bustag(lesc->sc_rres);
- lesc->sc_regh = rman_get_bushandle(lesc->sc_rres);
- lesc->sc_irid = 0;
+ i = 0;
if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
+ &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
device_printf(dev, "cannot allocate interrupt\n");
error = ENXIO;
goto fail_rres;
@@ -339,7 +328,7 @@ le_cbus_attach(device_t dev)
error = bus_dmamap_load(lesc->sc_dmat, lesc->sc_dmam, sc->sc_mem,
sc->sc_memsize, le_cbus_dma_callback, sc, 0);
if (error != 0 || sc->sc_addr == 0) {
- device_printf(dev, "cannot load DMA buffer map\n");
+ device_printf(dev, "cannot load DMA buffer map\n");
goto fail_dmem;
}
@@ -350,8 +339,7 @@ le_cbus_attach(device_t dev)
* Extract the physical MAC address from the ROM.
*/
for (i = 0; i < sizeof(sc->sc_enaddr); i++)
- sc->sc_enaddr[i] = bus_space_read_1(lesc->sc_regt,
- lesc->sc_regh, i * 2);
+ sc->sc_enaddr[i] = bus_read_1(lesc->sc_rres, i * 2);
sc->sc_copytodesc = lance_copytobuf_contig;
sc->sc_copyfromdesc = lance_copyfrombuf_contig;
@@ -396,9 +384,11 @@ le_cbus_attach(device_t dev)
fail_pdtag:
bus_dma_tag_destroy(lesc->sc_pdmat);
fail_ires:
- bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires);
+ bus_release_resource(dev, SYS_RES_IRQ,
+ rman_get_rid(lesc->sc_ires), lesc->sc_ires);
fail_rres:
- bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres);
+ bus_release_resource(dev, SYS_RES_IOPORT,
+ rman_get_rid(lesc->sc_rres), lesc->sc_rres);
fail_mtx:
LE_LOCK_DESTROY(sc);
return (error);
@@ -419,8 +409,10 @@ le_cbus_detach(device_t dev)
bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam);
bus_dma_tag_destroy(lesc->sc_dmat);
bus_dma_tag_destroy(lesc->sc_pdmat);
- bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires);
- bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres);
+ bus_release_resource(dev, SYS_RES_IRQ,
+ rman_get_rid(lesc->sc_ires), lesc->sc_ires);
+ bus_release_resource(dev, SYS_RES_IOPORT,
+ rman_get_rid(lesc->sc_rres), lesc->sc_rres);
LE_LOCK_DESTROY(sc);
return (0);
Modified: stable/7/sys/dev/le/if_le_isa.c
==============================================================================
--- stable/7/sys/dev/le/if_le_isa.c Thu Jan 15 20:45:59 2009 (r187312)
+++ stable/7/sys/dev/le/if_le_isa.c Thu Jan 15 20:49:17 2009 (r187313)
@@ -109,15 +109,10 @@ struct le_isa_softc {
bus_size_t sc_rap; /* offsets to LANCE... */
bus_size_t sc_rdp; /* ...registers */
- int sc_rrid;
struct resource *sc_rres;
- bus_space_tag_t sc_regt;
- bus_space_handle_t sc_regh;
- int sc_drid;
struct resource *sc_dres;
- int sc_irid;
struct resource *sc_ires;
void *sc_ih;
@@ -184,10 +179,9 @@ le_isa_wrcsr(struct lance_softc *sc, uin
{
struct le_isa_softc *lesc = (struct le_isa_softc *)sc;
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, port);
- bus_space_barrier(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, 2,
- BUS_SPACE_BARRIER_WRITE);
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rdp, val);
+ bus_write_2(lesc->sc_rres, lesc->sc_rap, port);
+ bus_barrier(lesc->sc_rres, lesc->sc_rap, 2, BUS_SPACE_BARRIER_WRITE);
+ bus_write_2(lesc->sc_rres, lesc->sc_rdp, val);
}
static uint16_t
@@ -195,10 +189,9 @@ le_isa_rdcsr(struct lance_softc *sc, uin
{
struct le_isa_softc *lesc = (struct le_isa_softc *)sc;
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, port);
- bus_space_barrier(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, 2,
- BUS_SPACE_BARRIER_WRITE);
- return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rdp));
+ bus_write_2(lesc->sc_rres, lesc->sc_rap, port);
+ bus_barrier(lesc->sc_rres, lesc->sc_rap, 2, BUS_SPACE_BARRIER_WRITE);
+ return (bus_read_2(lesc->sc_rres, lesc->sc_rdp));
}
static void
@@ -217,18 +210,16 @@ le_isa_probe_legacy(device_t dev, const
{
struct le_isa_softc *lesc;
struct lance_softc *sc;
- int error;
+ int error, i;
lesc = device_get_softc(dev);
sc = &lesc->sc_am7990.lsc;
- lesc->sc_rrid = 0;
- lesc->sc_rres = bus_alloc_resource(dev, SYS_RES_IOPORT, &lesc->sc_rrid,
- 0, ~0, leip->iosize, RF_ACTIVE);
+ i = 0;
+ lesc->sc_rres = bus_alloc_resource(dev, SYS_RES_IOPORT, &i, 0, ~0,
+ leip->iosize, RF_ACTIVE);
if (lesc->sc_rres == NULL)
return (ENXIO);
- lesc->sc_regt = rman_get_bustag(lesc->sc_rres);
- lesc->sc_regh = rman_get_bushandle(lesc->sc_rres);
lesc->sc_rap = leip->rap;
lesc->sc_rdp = leip->rdp;
@@ -243,7 +234,8 @@ le_isa_probe_legacy(device_t dev, const
error = 0;
fail:
- bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres);
+ bus_release_resource(dev, SYS_RES_IOPORT,
+ rman_get_rid(lesc->sc_rres), lesc->sc_rres);
return (error);
}
@@ -276,18 +268,18 @@ le_isa_attach(device_t dev)
struct le_isa_softc *lesc;
struct lance_softc *sc;
bus_size_t macstart, rap, rdp;
- int error, i, macstride;
+ int error, i, j, macstride;
lesc = device_get_softc(dev);
sc = &lesc->sc_am7990.lsc;
LE_LOCK_INIT(sc, device_get_nameunit(dev));
- lesc->sc_rrid = 0;
+ j = 0;
switch (ISA_PNP_PROBE(device_get_parent(dev), dev, le_isa_ids)) {
case 0:
lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &lesc->sc_rrid, RF_ACTIVE);
+ &j, RF_ACTIVE);
rap = PCNET_RAP;
rdp = PCNET_RDP;
macstart = 0;
@@ -298,7 +290,7 @@ le_isa_attach(device_t dev)
sizeof(le_isa_params[0]); i++) {
if (le_isa_probe_legacy(dev, &le_isa_params[i]) == 0) {
lesc->sc_rres = bus_alloc_resource(dev,
- SYS_RES_IOPORT, &lesc->sc_rrid, 0, ~0,
+ SYS_RES_IOPORT, &j, 0, ~0,
le_isa_params[i].iosize, RF_ACTIVE);
rap = le_isa_params[i].rap;
rdp = le_isa_params[i].rdp;
@@ -321,22 +313,20 @@ le_isa_attach(device_t dev)
error = ENXIO;
goto fail_mtx;
}
- lesc->sc_regt = rman_get_bustag(lesc->sc_rres);
- lesc->sc_regh = rman_get_bushandle(lesc->sc_rres);
lesc->sc_rap = rap;
lesc->sc_rdp = rdp;
- lesc->sc_drid = 0;
+ i = 0;
if ((lesc->sc_dres = bus_alloc_resource_any(dev, SYS_RES_DRQ,
- &lesc->sc_drid, RF_ACTIVE)) == NULL) {
+ &i, RF_ACTIVE)) == NULL) {
device_printf(dev, "cannot allocate DMA channel\n");
error = ENXIO;
goto fail_rres;
}
- lesc->sc_irid = 0;
+ i = 0;
if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
+ &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
device_printf(dev, "cannot allocate interrupt\n");
error = ENXIO;
goto fail_dres;
@@ -392,7 +382,7 @@ le_isa_attach(device_t dev)
error = bus_dmamap_load(lesc->sc_dmat, lesc->sc_dmam, sc->sc_mem,
sc->sc_memsize, le_isa_dma_callback, sc, 0);
if (error != 0 || sc->sc_addr == 0) {
- device_printf(dev, "cannot load DMA buffer map\n");
+ device_printf(dev, "cannot load DMA buffer map\n");
goto fail_dmem;
}
@@ -405,8 +395,8 @@ le_isa_attach(device_t dev)
* Extract the physical MAC address from the ROM.
*/
for (i = 0; i < sizeof(sc->sc_enaddr); i++)
- sc->sc_enaddr[i] = bus_space_read_1(lesc->sc_regt,
- lesc->sc_regh, macstart + i * macstride);
+ sc->sc_enaddr[i] = bus_read_1(lesc->sc_rres,
+ macstart + i * macstride);
sc->sc_copytodesc = lance_copytobuf_contig;
sc->sc_copyfromdesc = lance_copyfrombuf_contig;
@@ -451,11 +441,14 @@ le_isa_attach(device_t dev)
fail_pdtag:
bus_dma_tag_destroy(lesc->sc_pdmat);
fail_ires:
- bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires);
+ bus_release_resource(dev, SYS_RES_IRQ,
+ rman_get_rid(lesc->sc_ires), lesc->sc_ires);
fail_dres:
- bus_release_resource(dev, SYS_RES_DRQ, lesc->sc_drid, lesc->sc_dres);
+ bus_release_resource(dev, SYS_RES_DRQ,
+ rman_get_rid(lesc->sc_dres), lesc->sc_dres);
fail_rres:
- bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres);
+ bus_release_resource(dev, SYS_RES_IOPORT,
+ rman_get_rid(lesc->sc_rres), lesc->sc_rres);
fail_mtx:
LE_LOCK_DESTROY(sc);
return (error);
@@ -476,9 +469,12 @@ le_isa_detach(device_t dev)
bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam);
bus_dma_tag_destroy(lesc->sc_dmat);
bus_dma_tag_destroy(lesc->sc_pdmat);
- bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires);
- bus_release_resource(dev, SYS_RES_DRQ, lesc->sc_drid, lesc->sc_dres);
- bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres);
+ bus_release_resource(dev, SYS_RES_IRQ,
+ rman_get_rid(lesc->sc_ires), lesc->sc_ires);
+ bus_release_resource(dev, SYS_RES_DRQ,
+ rman_get_rid(lesc->sc_dres), lesc->sc_dres);
+ bus_release_resource(dev, SYS_RES_IOPORT,
+ rman_get_rid(lesc->sc_rres), lesc->sc_rres);
LE_LOCK_DESTROY(sc);
return (0);
Modified: stable/7/sys/dev/le/if_le_lebuffer.c
==============================================================================
--- stable/7/sys/dev/le/if_le_lebuffer.c Thu Jan 15 20:45:59 2009 (r187312)
+++ stable/7/sys/dev/le/if_le_lebuffer.c Thu Jan 15 20:49:17 2009 (r187313)
@@ -63,17 +63,10 @@ __FBSDID("$FreeBSD$");
struct le_lebuffer_softc {
struct am7990_softc sc_am7990; /* glue to MI code */
- int sc_brid;
struct resource *sc_bres;
- bus_space_tag_t sc_buft;
- bus_space_handle_t sc_bufh;
- int sc_rrid;
struct resource *sc_rres;
- bus_space_tag_t sc_regt;
- bus_space_handle_t sc_regh;
- int sc_irid;
struct resource *sc_ires;
void *sc_ih;
};
@@ -103,6 +96,7 @@ DEFINE_CLASS_0(le, le_lebuffer_driver, l
sizeof(struct le_lebuffer_softc));
DRIVER_MODULE(le, lebuffer, le_lebuffer_driver, le_lebuffer_devclass, 0, 0);
MODULE_DEPEND(le, ether, 1, 1, 1);
+MODULE_DEPEND(le, lebuffer, 1, 1, 1);
/*
* Media types supported
@@ -126,10 +120,9 @@ le_lebuffer_wrcsr(struct lance_softc *sc
{
struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc;
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, LEREG1_RAP, port);
- bus_space_barrier(lesc->sc_regt, lesc->sc_regh, LEREG1_RAP, 2,
- BUS_SPACE_BARRIER_WRITE);
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, LEREG1_RDP, val);
+ bus_write_2(lesc->sc_rres, LEREG1_RAP, port);
+ bus_barrier(lesc->sc_rres, LEREG1_RAP, 2, BUS_SPACE_BARRIER_WRITE);
+ bus_write_2(lesc->sc_rres, LEREG1_RDP, val);
}
static uint16_t
@@ -137,10 +130,9 @@ le_lebuffer_rdcsr(struct lance_softc *sc
{
struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc;
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, LEREG1_RAP, port);
- bus_space_barrier(lesc->sc_regt, lesc->sc_regh, LEREG1_RAP, 2,
- BUS_SPACE_BARRIER_WRITE);
- return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, LEREG1_RDP));
+ bus_write_2(lesc->sc_rres, LEREG1_RAP, port);
+ bus_barrier(lesc->sc_rres, LEREG1_RAP, 2, BUS_SPACE_BARRIER_WRITE);
+ return (bus_read_2(lesc->sc_rres, LEREG1_RDP));
}
/*
@@ -163,17 +155,13 @@ le_lebuffer_copytodesc(struct lance_soft
caddr_t from = fromv;
for (; len >= 8; len -= 8, off += 8, from += 8)
- bus_space_write_8(lesc->sc_buft, lesc->sc_bufh, off,
- be64dec(from));
+ bus_write_8(lesc->sc_bres, off, be64dec(from));
for (; len >= 4; len -= 4, off += 4, from += 4)
- bus_space_write_4(lesc->sc_buft, lesc->sc_bufh, off,
- be32dec(from));
+ bus_write_4(lesc->sc_bres, off, be32dec(from));
for (; len >= 2; len -= 2, off += 2, from += 2)
- bus_space_write_2(lesc->sc_buft, lesc->sc_bufh, off,
- be16dec(from));
+ bus_write_2(lesc->sc_bres, off, be16dec(from));
if (len == 1)
- bus_space_write_1(lesc->sc_buft, lesc->sc_bufh, off,
- *from);
+ bus_write_1(lesc->sc_bres, off, *from);
}
static void
@@ -184,16 +172,15 @@ le_lebuffer_copyfromdesc(struct lance_so
for (; len >= 8; len -= 8, off += 8, to += 8)
be64enc(to,
- bus_space_read_8(lesc->sc_buft, lesc->sc_bufh, off));
+ bus_read_8(lesc->sc_bres, off));
for (; len >= 4; len -= 4, off += 4, to += 4)
be32enc(to,
- bus_space_read_4(lesc->sc_buft, lesc->sc_bufh, off));
+ bus_read_4(lesc->sc_bres, off));
for (; len >= 2; len -= 2, off += 2, to += 2)
be16enc(to,
- bus_space_read_2(lesc->sc_buft, lesc->sc_bufh, off));
+ bus_read_2(lesc->sc_bres, off));
if (len == 1)
- *to =
- bus_space_read_1(lesc->sc_buft, lesc->sc_bufh, off);
+ *to = bus_read_1(lesc->sc_bres, off);
}
static void
@@ -203,11 +190,9 @@ le_lebuffer_copytobuf(struct lance_softc
caddr_t from = fromv;
for (; len >= 2; len -= 2, off += 2, from += 2)
- bus_space_write_2(lesc->sc_buft, lesc->sc_bufh, off,
- le16dec(from));
+ bus_write_2(lesc->sc_bres, off, le16dec(from));
if (len == 1)
- bus_space_write_1(lesc->sc_buft, lesc->sc_bufh, off + 1,
- *from);
+ bus_write_1(lesc->sc_bres, off + 1, *from);
}
static void
@@ -218,10 +203,9 @@ le_lebuffer_copyfrombuf(struct lance_sof
for (; len >= 2; len -= 2, off += 2, to += 2)
le16enc(to,
- bus_space_read_2(lesc->sc_buft, lesc->sc_bufh, off));
+ bus_read_2(lesc->sc_bres, off));
if (len == 1)
- *to =
- bus_space_read_1(lesc->sc_buft, lesc->sc_bufh, off + 1);
+ *to = bus_read_1(lesc->sc_bres, off + 1);
}
static void
@@ -230,9 +214,9 @@ le_lebuffer_zerobuf(struct lance_softc *
struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc;
for (; len >= 2; len -= 2, off += 2)
- bus_space_write_2(lesc->sc_buft, lesc->sc_bufh, off, 0);
+ bus_write_2(lesc->sc_bres, off, 0);
if (len == 1)
- bus_space_write_1(lesc->sc_buft, lesc->sc_bufh, off + 1, 0);
+ bus_write_1(lesc->sc_bres, off + 1, 0);
}
static int
@@ -251,7 +235,7 @@ le_lebuffer_attach(device_t dev)
{
struct le_lebuffer_softc *lesc;
struct lance_softc *sc;
- int error;
+ int error, i;
lesc = device_get_softc(dev);
sc = &lesc->sc_am7990.lsc;
@@ -262,33 +246,29 @@ le_lebuffer_attach(device_t dev)
* The "register space" of the parent is just a buffer where the
* the LANCE descriptor rings and the RX/TX buffers can be stored.
*/
- lesc->sc_brid = 0;
+ i = 0;
lesc->sc_bres = bus_alloc_resource_any(device_get_parent(dev),
- SYS_RES_MEMORY, &lesc->sc_brid, RF_ACTIVE);
+ SYS_RES_MEMORY, &i, RF_ACTIVE);
if (lesc->sc_bres == NULL) {
device_printf(dev, "cannot allocate LANCE buffer\n");
error = ENXIO;
goto fail_mtx;
}
- lesc->sc_buft = rman_get_bustag(lesc->sc_bres);
- lesc->sc_bufh = rman_get_bushandle(lesc->sc_bres);
/* Allocate LANCE registers. */
- lesc->sc_rrid = 0;
+ i = 0;
lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
- &lesc->sc_rrid, RF_ACTIVE);
+ &i, RF_ACTIVE);
if (lesc->sc_rres == NULL) {
device_printf(dev, "cannot allocate LANCE registers\n");
error = ENXIO;
goto fail_bres;
}
- lesc->sc_regt = rman_get_bustag(lesc->sc_rres);
- lesc->sc_regh = rman_get_bushandle(lesc->sc_rres);
/* Allocate LANCE interrupt. */
- lesc->sc_irid = 0;
+ i = 0;
if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
+ &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
device_printf(dev, "cannot allocate interrupt\n");
error = ENXIO;
goto fail_rres;
@@ -352,12 +332,14 @@ le_lebuffer_attach(device_t dev)
fail_am7990:
am7990_detach(&lesc->sc_am7990);
fail_ires:
- bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires);
+ bus_release_resource(dev, SYS_RES_IRQ,
+ rman_get_rid(lesc->sc_ires), lesc->sc_ires);
fail_rres:
- bus_release_resource(dev, SYS_RES_MEMORY, lesc->sc_rrid, lesc->sc_rres);
+ bus_release_resource(dev, SYS_RES_MEMORY,
+ rman_get_rid(lesc->sc_rres), lesc->sc_rres);
fail_bres:
bus_release_resource(device_get_parent(dev), SYS_RES_MEMORY,
- lesc->sc_brid, lesc->sc_bres);
+ rman_get_rid(lesc->sc_bres), lesc->sc_bres);
fail_mtx:
LE_LOCK_DESTROY(sc);
return (error);
@@ -374,10 +356,12 @@ le_lebuffer_detach(device_t dev)
bus_teardown_intr(dev, lesc->sc_ires, lesc->sc_ih);
am7990_detach(&lesc->sc_am7990);
- bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires);
- bus_release_resource(dev, SYS_RES_MEMORY, lesc->sc_rrid, lesc->sc_rres);
+ bus_release_resource(dev, SYS_RES_IRQ,
+ rman_get_rid(lesc->sc_ires), lesc->sc_ires);
+ bus_release_resource(dev, SYS_RES_MEMORY,
+ rman_get_rid(lesc->sc_rres), lesc->sc_rres);
bus_release_resource(device_get_parent(dev), SYS_RES_MEMORY,
- lesc->sc_brid, lesc->sc_bres);
+ rman_get_rid(lesc->sc_bres), lesc->sc_bres);
LE_LOCK_DESTROY(sc);
return (0);
Modified: stable/7/sys/dev/le/if_le_pci.c
==============================================================================
--- stable/7/sys/dev/le/if_le_pci.c Thu Jan 15 20:45:59 2009 (r187312)
+++ stable/7/sys/dev/le/if_le_pci.c Thu Jan 15 20:49:17 2009 (r187313)
@@ -111,12 +111,8 @@ __FBSDID("$FreeBSD$");
struct le_pci_softc {
struct am79900_softc sc_am79900; /* glue to MI code */
- int sc_rrid;
struct resource *sc_rres;
- bus_space_tag_t sc_regt;
- bus_space_handle_t sc_regh;
- int sc_irid;
struct resource *sc_ires;
void *sc_ih;
@@ -174,10 +170,9 @@ le_pci_wrbcr(struct lance_softc *sc, uin
{
struct le_pci_softc *lesc = (struct le_pci_softc *)sc;
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, port);
- bus_space_barrier(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, 2,
- BUS_SPACE_BARRIER_WRITE);
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_BDP, val);
+ bus_write_2(lesc->sc_rres, PCNET_PCI_RAP, port);
+ bus_barrier(lesc->sc_rres, PCNET_PCI_RAP, 2, BUS_SPACE_BARRIER_WRITE);
+ bus_write_2(lesc->sc_rres, PCNET_PCI_BDP, val);
}
static uint16_t
@@ -185,10 +180,9 @@ le_pci_rdbcr(struct lance_softc *sc, uin
{
struct le_pci_softc *lesc = (struct le_pci_softc *)sc;
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, port);
- bus_space_barrier(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, 2,
- BUS_SPACE_BARRIER_WRITE);
- return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_BDP));
+ bus_write_2(lesc->sc_rres, PCNET_PCI_RAP, port);
+ bus_barrier(lesc->sc_rres, PCNET_PCI_RAP, 2, BUS_SPACE_BARRIER_WRITE);
+ return (bus_read_2(lesc->sc_rres, PCNET_PCI_BDP));
}
static void
@@ -196,10 +190,9 @@ le_pci_wrcsr(struct lance_softc *sc, uin
{
struct le_pci_softc *lesc = (struct le_pci_softc *)sc;
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, port);
- bus_space_barrier(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, 2,
- BUS_SPACE_BARRIER_WRITE);
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RDP, val);
+ bus_write_2(lesc->sc_rres, PCNET_PCI_RAP, port);
+ bus_barrier(lesc->sc_rres, PCNET_PCI_RAP, 2, BUS_SPACE_BARRIER_WRITE);
+ bus_write_2(lesc->sc_rres, PCNET_PCI_RDP, val);
}
static uint16_t
@@ -207,10 +200,9 @@ le_pci_rdcsr(struct lance_softc *sc, uin
{
struct le_pci_softc *lesc = (struct le_pci_softc *)sc;
- bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, port);
- bus_space_barrier(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, 2,
- BUS_SPACE_BARRIER_WRITE);
- return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RDP));
+ bus_write_2(lesc->sc_rres, PCNET_PCI_RAP, port);
+ bus_barrier(lesc->sc_rres, PCNET_PCI_RAP, 2, BUS_SPACE_BARRIER_WRITE);
+ return (bus_read_2(lesc->sc_rres, PCNET_PCI_RDP));
}
static int
@@ -322,20 +314,18 @@ le_pci_attach(device_t dev)
pci_enable_busmaster(dev);
pci_enable_io(dev, PCIM_CMD_PORTEN);
- lesc->sc_rrid = PCIR_BAR(0);
+ i = PCIR_BAR(0);
lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &lesc->sc_rrid, RF_ACTIVE);
+ &i, RF_ACTIVE);
if (lesc->sc_rres == NULL) {
device_printf(dev, "cannot allocate registers\n");
error = ENXIO;
goto fail_mtx;
}
- lesc->sc_regt = rman_get_bustag(lesc->sc_rres);
- lesc->sc_regh = rman_get_bushandle(lesc->sc_rres);
- lesc->sc_irid = 0;
+ i = 0;
if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
+ &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
device_printf(dev, "cannot allocate interrupt\n");
error = ENXIO;
goto fail_rres;
@@ -392,7 +382,7 @@ le_pci_attach(device_t dev)
error = bus_dmamap_load(lesc->sc_dmat, lesc->sc_dmam, sc->sc_mem,
sc->sc_memsize, le_pci_dma_callback, sc, 0);
if (error != 0 || sc->sc_addr == 0) {
- device_printf(dev, "cannot load DMA buffer map\n");
+ device_printf(dev, "cannot load DMA buffer map\n");
goto fail_dmem;
}
@@ -417,9 +407,8 @@ le_pci_attach(device_t dev)
/*
* Extract the physical MAC address from the ROM.
*/
- for (i = 0; i < sizeof(sc->sc_enaddr); i++)
- sc->sc_enaddr[i] =
- bus_space_read_1(lesc->sc_regt, lesc->sc_regh, i);
+ bus_read_region_1(lesc->sc_rres, 0, sc->sc_enaddr,
+ sizeof(sc->sc_enaddr));
sc->sc_copytodesc = lance_copytobuf_contig;
sc->sc_copyfromdesc = lance_copyfrombuf_contig;
@@ -461,9 +450,11 @@ le_pci_attach(device_t dev)
fail_pdtag:
bus_dma_tag_destroy(lesc->sc_pdmat);
fail_ires:
- bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires);
+ bus_release_resource(dev, SYS_RES_IRQ,
+ rman_get_rid(lesc->sc_ires), lesc->sc_ires);
fail_rres:
- bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres);
+ bus_release_resource(dev, SYS_RES_IOPORT,
+ rman_get_rid(lesc->sc_rres), lesc->sc_rres);
fail_mtx:
LE_LOCK_DESTROY(sc);
return (error);
@@ -484,8 +475,10 @@ le_pci_detach(device_t dev)
bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam);
bus_dma_tag_destroy(lesc->sc_dmat);
bus_dma_tag_destroy(lesc->sc_pdmat);
- bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires);
- bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres);
+ bus_release_resource(dev, SYS_RES_IRQ,
+ rman_get_rid(lesc->sc_ires), lesc->sc_ires);
+ bus_release_resource(dev, SYS_RES_IOPORT,
+ rman_get_rid(lesc->sc_rres), lesc->sc_rres);
LE_LOCK_DESTROY(sc);
return (0);
Modified: stable/7/sys/dev/le/lebuffer_sbus.c
==============================================================================
--- stable/7/sys/dev/le/lebuffer_sbus.c Thu Jan 15 20:45:59 2009 (r187312)
+++ stable/7/sys/dev/le/lebuffer_sbus.c Thu Jan 15 20:49:17 2009 (r187313)
@@ -100,6 +100,8 @@ static device_method_t lebuffer_methods[
DEFINE_CLASS_0(lebuffer, lebuffer_driver, lebuffer_methods, 1);
DRIVER_MODULE(lebuffer, sbus, lebuffer_driver, lebuffer_devclass, 0, 0);
+MODULE_DEPEND(lebuffer, sbus, 1, 1, 1);
+MODULE_VERSION(lebuffer, 1);
static int
lebuffer_probe(device_t dev)
From kib at FreeBSD.org Fri Jan 16 03:14:30 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Fri Jan 16 03:14:47 2009
Subject: svn commit: r187329 - in stable/7/lib/libc: . string
Message-ID: <200901161114.n0GBETin006816@svn.freebsd.org>
Author: kib
Date: Fri Jan 16 11:14:29 2009
New Revision: 187329
URL: http://svn.freebsd.org/changeset/base/187329
Log:
MFC r187147:
Document that ffsll(3) and flsll(3) functions first appeared in
FreeBSD 7.1.
Modified:
stable/7/lib/libc/ (props changed)
stable/7/lib/libc/string/ffs.3
stable/7/lib/libc/string/ffsll.c (props changed)
stable/7/lib/libc/string/flsll.c (props changed)
Modified: stable/7/lib/libc/string/ffs.3
==============================================================================
--- stable/7/lib/libc/string/ffs.3 Fri Jan 16 09:01:45 2009 (r187328)
+++ stable/7/lib/libc/string/ffs.3 Fri Jan 16 11:14:29 2009 (r187329)
@@ -108,4 +108,4 @@ The
and
.Fn flsll
functions appeared in
-.Fx 8.0 .
+.Fx 7.1 .
From mav at FreeBSD.org Fri Jan 16 10:00:26 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Fri Jan 16 10:00:32 2009
Subject: svn commit: r187333 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb dev/sound/pci/hda
Message-ID: <200901161800.n0GI0Pvm014546@svn.freebsd.org>
Author: mav
Date: Fri Jan 16 18:00:25 2009
New Revision: 187333
URL: http://svn.freebsd.org/changeset/base/187333
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/dev/sound/pci/hda/hdac.c
Modified: stable/7/sys/dev/sound/pci/hda/hdac.c
==============================================================================
--- stable/7/sys/dev/sound/pci/hda/hdac.c Fri Jan 16 15:47:35 2009 (r187332)
+++ stable/7/sys/dev/sound/pci/hda/hdac.c Fri Jan 16 18:00:25 2009 (r187333)
@@ -83,7 +83,7 @@
#include "mixer_if.h"
-#define HDA_DRV_TEST_REV "20090110_0123"
+#define HDA_DRV_TEST_REV "20090113_0125"
SND_DECLARE_FILE("$FreeBSD$");
@@ -4649,6 +4649,33 @@ hdac_vendor_patch_parse(struct hdac_devi
* nid: 26 = Line-in, leave it alone.
*/
break;
+ case HDA_CODEC_AD1983:
+ /*
+ * This codec has several possible usages, but none
+ * fit the parser best. Help parser to choose better.
+ */
+ /* Disable direct unmixed playback to get pcm volume. */
+ w = hdac_widget_get(devinfo, 5);
+ if (w != NULL)
+ w->connsenable[0] = 0;
+ w = hdac_widget_get(devinfo, 6);
+ if (w != NULL)
+ w->connsenable[0] = 0;
+ w = hdac_widget_get(devinfo, 11);
+ if (w != NULL)
+ w->connsenable[0] = 0;
+ /* Disable mic and line selectors. */
+ w = hdac_widget_get(devinfo, 12);
+ if (w != NULL)
+ w->connsenable[1] = 0;
+ w = hdac_widget_get(devinfo, 13);
+ if (w != NULL)
+ w->connsenable[1] = 0;
+ /* Disable recording from mono playback mix. */
+ w = hdac_widget_get(devinfo, 20);
+ if (w != NULL)
+ w->connsenable[3] = 0;
+ break;
case HDA_CODEC_AD1986A:
/*
* This codec has overcomplicated input mixing.
@@ -6111,6 +6138,29 @@ hdac_audio_prepare_pin_ctrl(struct hdac_
}
static void
+hdac_audio_ctl_commit(struct hdac_devinfo *devinfo)
+{
+ struct hdac_audio_ctl *ctl;
+ int i, z;
+
+ i = 0;
+ while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) {
+ if (ctl->enable == 0 || ctl->ossmask != 0) {
+ /* Mute disabled and mixer controllable controls.
+ * Last will be initialized by mixer_init().
+ * This expected to reduce click on startup. */
+ hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_ALL, 0, 0);
+ continue;
+ }
+ /* Init fixed controls to 0dB amplification. */
+ z = ctl->offset;
+ if (z > ctl->step)
+ z = ctl->step;
+ hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_NONE, z, z);
+ }
+}
+
+static void
hdac_audio_commit(struct hdac_devinfo *devinfo)
{
struct hdac_softc *sc = devinfo->codec->sc;
@@ -6126,11 +6176,41 @@ hdac_audio_commit(struct hdac_devinfo *d
hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid,
0x7e7, 0), cad);
+ /* Commit controls. */
+ hdac_audio_ctl_commit(devinfo);
+
+ /* Commit selectors, pins and EAPD. */
+ for (i = 0; i < devinfo->nodecnt; i++) {
+ w = &devinfo->widget[i];
+ if (w == NULL)
+ continue;
+ if (w->selconn == -1)
+ w->selconn = 0;
+ if (w->nconns > 0)
+ hdac_widget_connection_select(w, w->selconn);
+ if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) {
+ hdac_command(sc,
+ HDA_CMD_SET_PIN_WIDGET_CTRL(cad, w->nid,
+ w->wclass.pin.ctrl), cad);
+ }
+ if (w->param.eapdbtl != HDAC_INVALID) {
+ uint32_t val;
+
+ val = w->param.eapdbtl;
+ if (devinfo->function.audio.quirks &
+ HDA_QUIRK_EAPDINV)
+ val ^= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD;
+ hdac_command(sc,
+ HDA_CMD_SET_EAPD_BTL_ENABLE(cad, w->nid,
+ val), cad);
+ }
+ }
+
+ /* Commit GPIOs. */
gdata = 0;
gmask = 0;
gdir = 0;
commitgpio = 0;
-
numgpio = HDA_PARAM_GPIO_COUNT_NUM_GPIO(
devinfo->function.audio.gpio);
@@ -6185,54 +6265,6 @@ hdac_audio_commit(struct hdac_devinfo *d
HDA_CMD_SET_GPIO_DATA(cad, devinfo->nid,
gdata), cad);
}
-
- for (i = 0; i < devinfo->nodecnt; i++) {
- w = &devinfo->widget[i];
- if (w == NULL)
- continue;
- if (w->selconn == -1)
- w->selconn = 0;
- if (w->nconns > 0)
- hdac_widget_connection_select(w, w->selconn);
- if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) {
- hdac_command(sc,
- HDA_CMD_SET_PIN_WIDGET_CTRL(cad, w->nid,
- w->wclass.pin.ctrl), cad);
- }
- if (w->param.eapdbtl != HDAC_INVALID) {
- uint32_t val;
-
- val = w->param.eapdbtl;
- if (devinfo->function.audio.quirks &
- HDA_QUIRK_EAPDINV)
- val ^= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD;
- hdac_command(sc,
- HDA_CMD_SET_EAPD_BTL_ENABLE(cad, w->nid,
- val), cad);
-
- }
- }
-}
-
-static void
-hdac_audio_ctl_commit(struct hdac_devinfo *devinfo)
-{
- struct hdac_audio_ctl *ctl;
- int i, z;
-
- i = 0;
- while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) {
- if (ctl->enable == 0) {
- /* Mute disabled controls. */
- hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_ALL, 0, 0);
- continue;
- }
- /* Init controls to 0dB amplification. */
- z = ctl->offset;
- if (z > ctl->step)
- z = ctl->step;
- hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_NONE, z, z);
- }
}
static void
@@ -7477,10 +7509,6 @@ hdac_attach2(void *arg)
);
hdac_audio_commit(devinfo);
HDA_BOOTHVERBOSE(
- device_printf(sc->dev, "Ctls commit...\n");
- );
- hdac_audio_ctl_commit(devinfo);
- HDA_BOOTHVERBOSE(
device_printf(sc->dev, "HP switch init...\n");
);
hdac_hp_switch_init(devinfo);
@@ -7730,10 +7758,6 @@ hdac_resume(device_t dev)
);
hdac_audio_commit(devinfo);
HDA_BOOTHVERBOSE(
- device_printf(dev, "Ctls commit...\n");
- );
- hdac_audio_ctl_commit(devinfo);
- HDA_BOOTHVERBOSE(
device_printf(dev, "HP switch init...\n");
);
hdac_hp_switch_init(devinfo);
From silby at FreeBSD.org Fri Jan 16 22:53:59 2009
From: silby at FreeBSD.org (Mike Silbersack)
Date: Fri Jan 16 22:54:16 2009
Subject: svn commit: r187355 - in stable/7/sys: . contrib/pf dev/acpica
dev/ath/ath_hal dev/cxgb
Message-ID: <200901170653.n0H6rw6k029970@svn.freebsd.org>
Author: silby
Date: Sat Jan 17 06:53:57 2009
New Revision: 187355
URL: http://svn.freebsd.org/changeset/base/187355
Log:
Merge r186026 - add the debug.batt.batt_sleep_ms sysctl.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/acpica/acpi_smbat.c
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/dev/acpica/acpi_smbat.c
==============================================================================
--- stable/7/sys/dev/acpica/acpi_smbat.c Sat Jan 17 05:38:14 2009 (r187354)
+++ stable/7/sys/dev/acpica/acpi_smbat.c Sat Jan 17 06:53:57 2009 (r187355)
@@ -61,6 +61,23 @@ static int acpi_smbat_get_bst(device_t d
ACPI_SERIAL_DECL(smbat, "ACPI Smart Battery");
+SYSCTL_DECL(_debug_acpi);
+SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, "Battery debugging");
+
+/* On some laptops with smart batteries, enabling battery monitoring
+ * software causes keystrokes from atkbd to be lost. This has also been
+ * reported on Linux, and is apparently due to the keyboard and I2C line
+ * for the battery being routed through the same chip. Whether that's
+ * accurate or not, adding extra sleeps to the status checking code
+ * causes the problem to go away.
+ *
+ * If you experience that problem, try a value of 10ms and move up
+ * from there.
+ */
+static int batt_sleep_ms;
+SYSCTL_INT(_debug_acpi_batt, OID_AUTO, batt_sleep_ms, CTLFLAG_RW, &batt_sleep_ms, 0,
+ "Sleep during battery status updates to prevent keystroke loss.");
+
static device_method_t acpi_smbat_methods[] = {
/* device interface */
DEVMETHOD(device_probe, acpi_smbat_probe),
@@ -176,6 +193,9 @@ acpi_smbus_read_2(struct acpi_smbat_soft
ACPI_SERIAL_ASSERT(smbat);
+ if (batt_sleep_ms)
+ AcpiOsSleep(batt_sleep_ms);
+
val = addr;
error = ACPI_EC_WRITE(sc->ec_dev, sc->sb_base_addr + SMBUS_ADDR,
val, 1);
@@ -194,6 +214,9 @@ acpi_smbus_read_2(struct acpi_smbat_soft
if (error)
goto out;
+ if (batt_sleep_ms)
+ AcpiOsSleep(batt_sleep_ms);
+
for (to = SMBUS_TIMEOUT; to != 0; to--) {
error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_PRTCL,
&val, 1);
@@ -239,6 +262,9 @@ acpi_smbus_read_multi_1(struct acpi_smba
ACPI_SERIAL_ASSERT(smbat);
+ if (batt_sleep_ms)
+ AcpiOsSleep(batt_sleep_ms);
+
val = addr;
error = ACPI_EC_WRITE(sc->ec_dev, sc->sb_base_addr + SMBUS_ADDR,
val, 1);
@@ -257,6 +283,9 @@ acpi_smbus_read_multi_1(struct acpi_smba
if (error)
goto out;
+ if (batt_sleep_ms)
+ AcpiOsSleep(batt_sleep_ms);
+
for (to = SMBUS_TIMEOUT; to != 0; to--) {
error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_PRTCL,
&val, 1);
@@ -292,6 +321,9 @@ acpi_smbus_read_multi_1(struct acpi_smba
if (len > val)
len = val;
+ if (batt_sleep_ms)
+ AcpiOsSleep(batt_sleep_ms);
+
while (len--) {
error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_DATA
+ len, &val, 1);
@@ -299,6 +331,8 @@ acpi_smbus_read_multi_1(struct acpi_smba
goto out;
ptr[len] = val;
+ if (batt_sleep_ms)
+ AcpiOsSleep(1);
}
out:
From silby at FreeBSD.org Fri Jan 16 22:55:29 2009
From: silby at FreeBSD.org (Mike Silbersack)
Date: Fri Jan 16 22:55:45 2009
Subject: svn commit: r187356 - in stable/7/sys: . contrib/pf dev/acpica
dev/ath/ath_hal dev/cxgb
Message-ID: <200901170655.n0H6tSAt030078@svn.freebsd.org>
Author: silby
Date: Sat Jan 17 06:55:28 2009
New Revision: 187356
URL: http://svn.freebsd.org/changeset/base/187356
Log:
Merge r186031 - quick change to r186026
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/acpica/acpi_smbat.c
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/dev/acpica/acpi_smbat.c
==============================================================================
--- stable/7/sys/dev/acpica/acpi_smbat.c Sat Jan 17 06:53:57 2009 (r187355)
+++ stable/7/sys/dev/acpica/acpi_smbat.c Sat Jan 17 06:55:28 2009 (r187356)
@@ -332,7 +332,7 @@ acpi_smbus_read_multi_1(struct acpi_smba
ptr[len] = val;
if (batt_sleep_ms)
- AcpiOsSleep(1);
+ AcpiOsSleep(batt_sleep_ms);
}
out:
From delphij at delphij.net Sat Jan 17 02:08:58 2009
From: delphij at delphij.net (Xin LI)
Date: Sat Jan 17 02:09:05 2009
Subject: svn commit: r187069 - stable/7/sbin/fsck_ffs
In-Reply-To: <20090112083144.GA69408@dragon.NUXI.org>
References: <200901120039.n0C0dMKX043214@svn.freebsd.org>
<20090112083144.GA69408@dragon.NUXI.org>
Message-ID: <4971AE26.70406@delphij.net>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi, David,
David O'Brien wrote:
> On Mon, Jan 12, 2009 at 12:39:22AM +0000, Xin LI wrote:
>> Author: delphij
>> Date: Mon Jan 12 00:39:22 2009
>> New Revision: 187069
>> URL: http://svn.freebsd.org/changeset/base/187069
>>
>> Log:
>> MFC revisions 178088 and 179656: Catastrophic recovery mode.
>
> Hi Xin,
> I guess you missed my email to you about this. I was hoping to get an
> answer to this before it was MFC'ed.
Oops, sorry about that, I think I must have missed the e-mail...
> The use of 'C' conflicts with a Juniper Networks change Juniper wants to
> push back to FreeBSD.
>
> For Juniper the -C flag is the "clean" flag. Meaning don't do anything
> if the FS is clean, other wise do as full a fsck as possible (vs. just
> a "preen" fsck). It is useful as 'fsck -C -y /var' (for instance).
>
> Do you think your functionality could live under the "-D" (damaged)
> option? fsck_ffs already had a "-c" option, or Juniper would have
> used that letter.
I'm fine with a rename of the option, 'D' sounds a reasonable for my
functionality. I have used uppercase to imply that the option is
potentially dangerous.
One bikeshed candidate: For non-native English speakers, flag 'p' sounds
somewhat vague, and 'C' is not quite straightforward either, at the
first glance, 'preen' seems to be stronger than 'clean'. Perhaps, 'P'
would be a better candidate (a stronger 'preen') for the proposed
functionality, just my $0.02 :)
Cheers,
- --
Xin LI http://www.delphij.net/
FreeBSD - The Power to Serve!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (FreeBSD)
iEYEARECAAYFAklxriYACgkQi+vbBBjt66DwqACfWbN4XfBUcuMalw5MtuxtoeI5
V0gAoLOT/nOy6t5Vy9cP7qqv3VmZtDx9
=0lpr
-----END PGP SIGNATURE-----
From kib at FreeBSD.org Sat Jan 17 06:31:43 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Sat Jan 17 06:31:54 2009
Subject: svn commit: r187362 - in stable/7/sys: . contrib/pf dev/cxgb kern
Message-ID: <200901171431.n0HEVfcI044971@svn.freebsd.org>
Author: kib
Date: Sat Jan 17 14:31:41 2009
New Revision: 187362
URL: http://svn.freebsd.org/changeset/base/187362
Log:
MFC r186276:
Do not return success and doomed vnode from lookup. LK_UPGRADE allows
the vnode to be reclaimed.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/kern/vfs_lookup.c
Modified: stable/7/sys/kern/vfs_lookup.c
==============================================================================
--- stable/7/sys/kern/vfs_lookup.c Sat Jan 17 13:34:56 2009 (r187361)
+++ stable/7/sys/kern/vfs_lookup.c Sat Jan 17 14:31:41 2009 (r187362)
@@ -779,6 +779,10 @@ success:
if ((cnp->cn_flags & (ISLASTCN | LOCKSHARED | LOCKLEAF)) ==
(ISLASTCN | LOCKLEAF) && VOP_ISLOCKED(dp, td) != LK_EXCLUSIVE) {
vn_lock(dp, LK_UPGRADE | LK_RETRY, td);
+ if (dp->v_iflag & VI_DOOMED) {
+ error = ENOENT;
+ goto bad2;
+ }
}
if (vfslocked && dvfslocked)
VFS_UNLOCK_GIANT(dvfslocked); /* Only need one */
From kib at FreeBSD.org Sat Jan 17 06:37:55 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Sat Jan 17 06:38:02 2009
Subject: svn commit: r187363 - in stable/7/sys: . contrib/pf dev/cxgb ufs/ufs
Message-ID: <200901171437.n0HEbtXM045191@svn.freebsd.org>
Author: kib
Date: Sat Jan 17 14:37:54 2009
New Revision: 187363
URL: http://svn.freebsd.org/changeset/base/187363
Log:
MFC r186278:
Do not busy twice the mount point where a quota operation is performed.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/ufs/ufs/ufs_vfsops.c
Modified: stable/7/sys/ufs/ufs/ufs_vfsops.c
==============================================================================
--- stable/7/sys/ufs/ufs/ufs_vfsops.c Sat Jan 17 14:31:41 2009 (r187362)
+++ stable/7/sys/ufs/ufs/ufs_vfsops.c Sat Jan 17 14:37:54 2009 (r187363)
@@ -118,9 +118,6 @@ ufs_quotactl(mp, cmds, id, arg, td)
if ((u_int)type >= MAXQUOTAS)
return (EINVAL);
- if (vfs_busy(mp, LK_NOWAIT, 0, td))
- return (0);
-
switch (cmd) {
case Q_QUOTAON:
error = quotaon(td, mp, type, arg);
@@ -150,7 +147,6 @@ ufs_quotactl(mp, cmds, id, arg, td)
error = EINVAL;
break;
}
- vfs_unbusy(mp, td);
return (error);
#endif
}
From kib at FreeBSD.org Sat Jan 17 06:45:08 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Sat Jan 17 06:45:20 2009
Subject: svn commit: r187364 - in stable/7/sys: . contrib/pf dev/cxgb kern vm
Message-ID: <200901171445.n0HEj7pa045370@svn.freebsd.org>
Author: kib
Date: Sat Jan 17 14:45:07 2009
New Revision: 187364
URL: http://svn.freebsd.org/changeset/base/187364
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/kern/uipc_cow.c
stable/7/sys/vm/vm_page.c
stable/7/sys/vm/vm_page.h
Modified: stable/7/sys/kern/uipc_cow.c
==============================================================================
--- stable/7/sys/kern/uipc_cow.c Sat Jan 17 14:37:54 2009 (r187363)
+++ stable/7/sys/kern/uipc_cow.c Sat Jan 17 14:45:07 2009 (r187364)
@@ -129,7 +129,11 @@ socow_setup(struct mbuf *m0, struct uio
* set up COW
*/
vm_page_lock_queues();
- vm_page_cowsetup(pp);
+ if (vm_page_cowsetup(pp) != 0) {
+ vm_page_unhold(pp);
+ vm_page_unlock_queues();
+ return (0);
+ }
/*
* wire the page for I/O
Modified: stable/7/sys/vm/vm_page.c
==============================================================================
--- stable/7/sys/vm/vm_page.c Sat Jan 17 14:37:54 2009 (r187363)
+++ stable/7/sys/vm/vm_page.c Sat Jan 17 14:45:07 2009 (r187364)
@@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
#include
#include
@@ -2003,13 +2004,16 @@ vm_page_cowclear(vm_page_t m)
*/
}
-void
+int
vm_page_cowsetup(vm_page_t m)
{
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+ if (m->cow == USHRT_MAX - 1)
+ return (EBUSY);
m->cow++;
pmap_remove_write(m);
+ return (0);
}
#include "opt_ddb.h"
Modified: stable/7/sys/vm/vm_page.h
==============================================================================
--- stable/7/sys/vm/vm_page.h Sat Jan 17 14:37:54 2009 (r187363)
+++ stable/7/sys/vm/vm_page.h Sat Jan 17 14:45:07 2009 (r187364)
@@ -111,12 +111,12 @@ struct vm_page {
vm_paddr_t phys_addr; /* physical address of page */
struct md_page md; /* machine dependant stuff */
uint8_t queue; /* page queue index */
- int8_t segind;
+ int8_t segind;
u_short flags; /* see below */
uint8_t order; /* index of the buddy queue */
uint8_t pool;
- u_short wire_count; /* wired down maps refs (P) */
- u_int cow; /* page cow mapping count */
+ u_short cow; /* page cow mapping count */
+ u_int wire_count; /* wired down maps refs (P) */
short hold_count; /* page hold count */
u_short oflags; /* page flags (O) */
u_char act_count; /* page usage count */
@@ -346,7 +346,7 @@ void vm_page_zero_invalid(vm_page_t m, b
void vm_page_free_toq(vm_page_t m);
void vm_page_zero_idle_wakeup(void);
void vm_page_cowfault (vm_page_t);
-void vm_page_cowsetup (vm_page_t);
+int vm_page_cowsetup(vm_page_t);
void vm_page_cowclear (vm_page_t);
/*
From stas at FreeBSD.org Sat Jan 17 11:52:11 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Sat Jan 17 11:52:28 2009
Subject: svn commit: r187370 - stable/7/sys/sys
Message-ID: <200901171952.n0HJq9Pk051082@svn.freebsd.org>
Author: stas
Date: Sat Jan 17 19:52:09 2009
New Revision: 187370
URL: http://svn.freebsd.org/changeset/base/187370
Log:
- Bump __FreeBSD_version after cpuctl MFC.
Modified:
stable/7/sys/sys/param.h
Modified: stable/7/sys/sys/param.h
==============================================================================
--- stable/7/sys/sys/param.h Sat Jan 17 18:57:12 2009 (r187369)
+++ stable/7/sys/sys/param.h Sat Jan 17 19:52:09 2009 (r187370)
@@ -57,7 +57,7 @@
* is created, otherwise 1.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 701101 /* Master, propagated to newvers */
+#define __FreeBSD_version 701102 /* Master, propagated to newvers */
#ifndef LOCORE
#include
From stas at FreeBSD.org Sun Jan 18 03:17:48 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Sun Jan 18 03:18:05 2009
Subject: svn commit: r187383 - stable/7/sys/dev/ae
Message-ID: <200901181117.n0IBHkRc071630@svn.freebsd.org>
Author: stas
Date: Sun Jan 18 11:17:46 2009
New Revision: 187383
URL: http://svn.freebsd.org/changeset/base/187383
Log:
- MFC r185707:
- Eliminate unused variable. [1]
- Check for runt frames entering the stack. [2]
Suggested by: ganbold[1], yongari[2]
Modified:
stable/7/sys/dev/ae/if_ae.c
Modified: stable/7/sys/dev/ae/if_ae.c
==============================================================================
--- stable/7/sys/dev/ae/if_ae.c Sun Jan 18 09:44:33 2009 (r187382)
+++ stable/7/sys/dev/ae/if_ae.c Sun Jan 18 11:17:46 2009 (r187383)
@@ -1103,12 +1103,9 @@ ae_dmamap_cb(void *arg, bus_dma_segment_
static int
ae_alloc_rings(ae_softc_t *sc)
{
- bus_dma_tag_t bustag;
bus_addr_t busaddr;
int error;
- bustag = bus_get_dma_tag(sc->dev);
-
/*
* Create parent DMA tag.
*/
@@ -1865,8 +1862,8 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd)
if_printf(ifp, "Rx interrupt occuried.\n");
#endif
size = le16toh(rxd->len) - ETHER_CRC_LEN;
- if (size < 0) {
- if_printf(ifp, "Negative length packet received.");
+ if (size < (ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)) {
+ if_printf(ifp, "Runt frame received.");
return (EIO);
}
From stas at FreeBSD.org Sun Jan 18 03:43:25 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Sun Jan 18 03:43:36 2009
Subject: svn commit: r187385 - in stable/7/sys: . arm/arm contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901181143.n0IBhOOH072185@svn.freebsd.org>
Author: stas
Date: Sun Jan 18 11:43:23 2009
New Revision: 187385
URL: http://svn.freebsd.org/changeset/base/187385
Log:
- 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
Modified:
stable/7/sys/ (props changed)
stable/7/sys/arm/arm/busdma_machdep.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/arm/arm/busdma_machdep.c
==============================================================================
--- stable/7/sys/arm/arm/busdma_machdep.c Sun Jan 18 11:38:35 2009 (r187384)
+++ stable/7/sys/arm/arm/busdma_machdep.c Sun Jan 18 11:43:23 2009 (r187385)
@@ -671,9 +671,8 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm
bus_addr_t paddr;
if ((map->pagesneeded == 0)) {
- CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, "
- "alignment= %d", dmat->lowaddr, ptoa((vm_paddr_t)Maxmem),
- dmat->boundary, dmat->alignment);
+ CTR3(KTR_BUSDMA, "lowaddr= %d, boundary= %d, alignment= %d",
+ dmat->lowaddr, dmat->boundary, dmat->alignment);
CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d",
map, map->pagesneeded);
/*
From kib at FreeBSD.org Sun Jan 18 03:47:40 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Sun Jan 18 03:47:56 2009
Subject: svn commit: r187386 - in stable/7/sys: . contrib/pf dev/cxgb
gnu/fs/ext2fs
Message-ID: <200901181147.n0IBleOi072346@svn.freebsd.org>
Author: kib
Date: Sun Jan 18 11:47:39 2009
New Revision: 187386
URL: http://svn.freebsd.org/changeset/base/187386
Log:
MFC r186740:
Do not incorrectly add the low 5 bits of the offset to the resulting
position of the found zero bit.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/gnu/fs/ext2fs/ext2_bitops.h
Modified: stable/7/sys/gnu/fs/ext2fs/ext2_bitops.h
==============================================================================
--- stable/7/sys/gnu/fs/ext2fs/ext2_bitops.h Sun Jan 18 11:43:23 2009 (r187385)
+++ stable/7/sys/gnu/fs/ext2fs/ext2_bitops.h Sun Jan 18 11:47:39 2009 (r187386)
@@ -84,7 +84,7 @@ find_next_zero_bit(void *data, size_t sz
mask = ~0U << (ofs & 31);
bit = *p | ~mask;
if (bit != ~0U)
- return (ffs(~bit) + ofs - 1);
+ return (ffs(~bit) + (ofs & ~31U) - 1);
p++;
ofs = (ofs + 31U) & ~31U;
}
From stas at FreeBSD.org Sun Jan 18 04:09:25 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Sun Jan 18 04:09:41 2009
Subject: svn commit: r187388 - in stable/7/sys: . arm/at91 contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901181209.n0IC9OTL072871@svn.freebsd.org>
Author: stas
Date: Sun Jan 18 12:09:24 2009
New Revision: 187388
URL: http://svn.freebsd.org/changeset/base/187388
Log:
- Merge r184310:
Add stream bus_space operations.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/arm/at91/at91.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/arm/at91/at91.c
==============================================================================
--- stable/7/sys/arm/at91/at91.c Sun Jan 18 12:03:43 2009 (r187387)
+++ stable/7/sys/arm/at91/at91.c Sun Jan 18 12:09:24 2009 (r187388)
@@ -166,6 +166,42 @@ struct bus_space at91_bs_tag = {
generic_armv4_bs_c_2,
NULL,
NULL,
+
+ /* read (single) stream */
+ generic_bs_r_1,
+ generic_armv4_bs_r_2,
+ generic_bs_r_4,
+ NULL,
+
+ /* read multiple stream */
+ generic_bs_rm_1,
+ generic_armv4_bs_rm_2,
+ generic_bs_rm_4,
+ NULL,
+
+ /* read region stream */
+ generic_bs_rr_1,
+ generic_armv4_bs_rr_2,
+ generic_bs_rr_4,
+ NULL,
+
+ /* write (single) stream */
+ generic_bs_w_1,
+ generic_armv4_bs_w_2,
+ generic_bs_w_4,
+ NULL,
+
+ /* write multiple stream */
+ generic_bs_wm_1,
+ generic_armv4_bs_wm_2,
+ generic_bs_wm_4,
+ NULL,
+
+ /* write region stream */
+ NULL,
+ generic_armv4_bs_wr_2,
+ generic_bs_wr_4,
+ NULL,
};
static int
From stas at FreeBSD.org Sun Jan 18 04:12:39 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Sun Jan 18 04:12:46 2009
Subject: svn commit: r187389 - in stable/7/sys: . arm/at91 contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901181212.n0ICCcRa073047@svn.freebsd.org>
Author: stas
Date: Sun Jan 18 12:12:38 2009
New Revision: 187389
URL: http://svn.freebsd.org/changeset/base/187389
Log:
- Merge r184309:
Add a missing NULL-pointer check.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/arm/at91/at91.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/arm/at91/at91.c
==============================================================================
--- stable/7/sys/arm/at91/at91.c Sun Jan 18 12:09:24 2009 (r187388)
+++ stable/7/sys/arm/at91/at91.c Sun Jan 18 12:12:38 2009 (r187389)
@@ -577,8 +577,10 @@ at91_alloc_resource(device_t dev, device
#endif
rle->res = rman_reserve_resource(&sc->sc_mem_rman,
start, end, count, flags, child);
- rman_set_bustag(rle->res, &at91_bs_tag);
- rman_set_bushandle(rle->res, start);
+ if (rle->res != NULL) {
+ rman_set_bustag(rle->res, &at91_bs_tag);
+ rman_set_bushandle(rle->res, start);
+ }
break;
}
if (rle->res) {
From stas at FreeBSD.org Sun Jan 18 04:16:46 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Sun Jan 18 04:16:57 2009
Subject: svn commit: r187390 - in stable/7/sys: . amd64/amd64 contrib/pf
dev/ath/ath_hal dev/cxgb i386/i386
Message-ID: <200901181216.n0ICGjwc073164@svn.freebsd.org>
Author: stas
Date: Sun Jan 18 12:16:45 2009
New Revision: 187390
URL: http://svn.freebsd.org/changeset/base/187390
Log:
- Merge r183151:
Recognize SAVE and OSXSAVE extended processor features.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/identcpu.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/i386/i386/identcpu.c
Modified: stable/7/sys/amd64/amd64/identcpu.c
==============================================================================
--- stable/7/sys/amd64/amd64/identcpu.c Sun Jan 18 12:12:38 2009 (r187389)
+++ stable/7/sys/amd64/amd64/identcpu.c Sun Jan 18 12:16:45 2009 (r187390)
@@ -247,8 +247,8 @@ printcpuinfo(void)
"\030"
"\031"
"\032"
- "\033"
- "\034"
+ "\033XSAVE"
+ "\034OSXSAVE"
"\035"
"\036"
"\037"
Modified: stable/7/sys/i386/i386/identcpu.c
==============================================================================
--- stable/7/sys/i386/i386/identcpu.c Sun Jan 18 12:12:38 2009 (r187389)
+++ stable/7/sys/i386/i386/identcpu.c Sun Jan 18 12:16:45 2009 (r187390)
@@ -744,8 +744,8 @@ printcpuinfo(void)
"\030POPCNT"
"\031"
"\032"
- "\033"
- "\034"
+ "\033XSAVE"
+ "\034OSXSAVE"
"\035"
"\036"
"\037"
From stas at FreeBSD.org Sun Jan 18 04:28:46 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Sun Jan 18 04:28:58 2009
Subject: svn commit: r187391 - in stable/7/sys: . arm/at91 contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901181228.n0ICSjnT073457@svn.freebsd.org>
Author: stas
Date: Sun Jan 18 12:28:45 2009
New Revision: 187391
URL: http://svn.freebsd.org/changeset/base/187391
Log:
- 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 [1]
Modified:
stable/7/sys/ (props changed)
stable/7/sys/arm/at91/if_ate.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/arm/at91/if_ate.c
==============================================================================
--- stable/7/sys/arm/at91/if_ate.c Sun Jan 18 12:16:45 2009 (r187390)
+++ stable/7/sys/arm/at91/if_ate.c Sun Jan 18 12:28:45 2009 (r187391)
@@ -170,7 +170,8 @@ ate_attach(device_t dev)
struct sysctl_ctx_list *sctx;
struct sysctl_oid *soid;
int err;
- u_char eaddr[6];
+ u_char eaddr[ETHER_ADDR_LEN];
+ uint32_t rnd;
sc->dev = dev;
err = ate_activate(dev);
@@ -191,8 +192,23 @@ ate_attach(device_t dev)
callout_init_mtx(&sc->tick_ch, &sc->sc_mtx, 0);
if ((err = ate_get_mac(sc, eaddr)) != 0) {
- device_printf(dev, "No MAC address set\n");
- goto out;
+ /*
+ * No MAC address configured. Generate the fake one.
+ */
+ if (bootverbose)
+ device_printf(dev,
+ "Generating fake ethernet address.\n");
+ rnd = arc4random();
+
+ /*
+ * Set OUI to Atmel.
+ */
+ eaddr[0] = 0x00;
+ eaddr[1] = 0x04;
+ eaddr[2] = 0x25;
+ eaddr[3] = (rnd >> 16) & 0xff;
+ eaddr[4] = (rnd >> 8) & 0xff;
+ eaddr[5] = rnd & 0xff;
}
ate_set_mac(sc, eaddr);
@@ -586,24 +602,29 @@ ate_set_mac(struct ate_softc *sc, u_char
static int
ate_get_mac(struct ate_softc *sc, u_char *eaddr)
{
+ bus_size_t sa_low_reg[] = { ETH_SA1L, ETH_SA2L, ETH_SA3L, ETH_SA4L };
+ bus_size_t sa_high_reg[] = { ETH_SA1H, ETH_SA2H, ETH_SA3H, ETH_SA4H };
uint32_t low, high;
+ int i;
/*
* The boot loader setup the MAC with an address, if one is set in
- * the loader. The TSC loader will also set the MAC address in a
- * similar way. Grab the MAC address from the SA1[HL] registers.
+ * the loader. Grab one MAC address from the SA[1-4][HL] registers.
*/
- low = RD4(sc, ETH_SA1L);
- high = RD4(sc, ETH_SA1H);
- if ((low | (high & 0xffff)) == 0)
- return (ENXIO);
- eaddr[0] = low & 0xff;
- eaddr[1] = (low >> 8) & 0xff;
- eaddr[2] = (low >> 16) & 0xff;
- eaddr[3] = (low >> 24) & 0xff;
- eaddr[4] = high & 0xff;
- eaddr[5] = (high >> 8) & 0xff;
- return (0);
+ for (i = 0; i < 4; i++) {
+ low = RD4(sc, sa_low_reg[i]);
+ high = RD4(sc, sa_high_reg[i]);
+ if ((low | (high & 0xffff)) != 0) {
+ eaddr[0] = low & 0xff;
+ eaddr[1] = (low >> 8) & 0xff;
+ eaddr[2] = (low >> 16) & 0xff;
+ eaddr[3] = (low >> 24) & 0xff;
+ eaddr[4] = high & 0xff;
+ eaddr[5] = (high >> 8) & 0xff;
+ return (0);
+ }
+ }
+ return (ENXIO);
}
static void
From stas at FreeBSD.org Sun Jan 18 04:35:13 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Sun Jan 18 04:35:24 2009
Subject: svn commit: r187392 - in stable/7/sys: . arm/at91 contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901181235.n0ICZB8D073650@svn.freebsd.org>
Author: stas
Date: Sun Jan 18 12:35:11 2009
New Revision: 187392
URL: http://svn.freebsd.org/changeset/base/187392
Log:
- MFC r182476:
style fix.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/arm/at91/if_ate.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/arm/at91/if_ate.c
==============================================================================
--- stable/7/sys/arm/at91/if_ate.c Sun Jan 18 12:28:45 2009 (r187391)
+++ stable/7/sys/arm/at91/if_ate.c Sun Jan 18 12:35:11 2009 (r187392)
@@ -180,7 +180,7 @@ ate_attach(device_t dev)
sc->use_rmii = (RD4(sc, ETH_CFG) & ETH_CFG_RMII) == ETH_CFG_RMII;
- /*Sysctls*/
+ /* Sysctls */
sctx = device_get_sysctl_ctx(dev);
soid = device_get_sysctl_tree(dev);
SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "rmii",
From stas at FreeBSD.org Sun Jan 18 09:07:49 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Sun Jan 18 09:07:56 2009
Subject: svn commit: r187398 - in stable/7/sys: . arm/at91 contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901181707.n0IH7mHB080977@svn.freebsd.org>
Author: stas
Date: Sun Jan 18 17:07:48 2009
New Revision: 187398
URL: http://svn.freebsd.org/changeset/base/187398
Log:
- MFC r182524 and r182555:
- Set U/L bit in generate MAC address.
- Use our specific OUI instead of Atmel one.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/arm/at91/if_ate.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/arm/at91/if_ate.c
==============================================================================
--- stable/7/sys/arm/at91/if_ate.c Sun Jan 18 15:10:46 2009 (r187397)
+++ stable/7/sys/arm/at91/if_ate.c Sun Jan 18 17:07:48 2009 (r187398)
@@ -193,19 +193,21 @@ ate_attach(device_t dev)
if ((err = ate_get_mac(sc, eaddr)) != 0) {
/*
- * No MAC address configured. Generate the fake one.
+ * No MAC address configured. Generate the random one.
*/
if (bootverbose)
device_printf(dev,
- "Generating fake ethernet address.\n");
+ "Generating random ethernet address.\n");
rnd = arc4random();
/*
- * Set OUI to Atmel.
+ * Set OUI to convenient locally assigned address. 'b'
+ * is 0x62, which has the locally assigned bit set, and
+ * the broadcast/multicast bit clear.
*/
- eaddr[0] = 0x00;
- eaddr[1] = 0x04;
- eaddr[2] = 0x25;
+ eaddr[0] = 'b';
+ eaddr[1] = 's';
+ eaddr[2] = 'd';
eaddr[3] = (rnd >> 16) & 0xff;
eaddr[4] = (rnd >> 8) & 0xff;
eaddr[5] = rnd & 0xff;
From stas at FreeBSD.org Sun Jan 18 09:08:49 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Sun Jan 18 09:09:01 2009
Subject: svn commit: r187391 - in stable/7/sys: . arm/at91 contrib/pf
dev/ath/ath_hal dev/cxgb
In-Reply-To: <20090118163938.G24894@ury.york.ac.uk>
References: <200901181228.n0ICSjnT073457@svn.freebsd.org>
<20090118163938.G24894@ury.york.ac.uk>
Message-ID: <20090118200841.3c9123bc.stas@FreeBSD.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sun, 18 Jan 2009 16:42:52 +0000 (GMT)
Gavin Atkinson mentioned:
> On Sun, 18 Jan 2009, Stanislav Sedov wrote:
>
> > Author: stas
> > Date: Sun Jan 18 12:28:45 2009
> > New Revision: 187391
> > URL: http://svn.freebsd.org/changeset/base/187391
> >
> > Log:
> > - Merge r182477:
> [snip]
> > Use random MAC address if none configured instead of failing.
>
> Connected with this, I wonder if you could also merge r182524 and r182555?
> These changes fix up the merged comments, and make the random MAC address
> a locally assigned one, and not simply stolen from the range that Atmel
> own.
>
Thanks for notice! I've forgot about them.
- --
Stanislav Sedov
ST4096-RIPE
-----BEGIN PGP SIGNATURE-----
iEYEARECAAYFAklzYh0ACgkQK/VZk+smlYHLvwCfY3bRBFZYZbL4L/BHgVxpXsqb
MOwAniE6wkKaK7sf5l5Di7fnzNfakZIB
=+SVo
-----END PGP SIGNATURE-----
!DSPAM:4973621e967001735159373!
From gavin at FreeBSD.org Sun Jan 18 09:13:07 2009
From: gavin at FreeBSD.org (Gavin Atkinson)
Date: Sun Jan 18 09:13:19 2009
Subject: svn commit: r187391 - in stable/7/sys: . arm/at91 contrib/pf
dev/ath/ath_hal dev/cxgb
In-Reply-To: <200901181228.n0ICSjnT073457@svn.freebsd.org>
References: <200901181228.n0ICSjnT073457@svn.freebsd.org>
Message-ID: <20090118163938.G24894@ury.york.ac.uk>
On Sun, 18 Jan 2009, Stanislav Sedov wrote:
> Author: stas
> Date: Sun Jan 18 12:28:45 2009
> New Revision: 187391
> URL: http://svn.freebsd.org/changeset/base/187391
>
> Log:
> - Merge r182477:
[snip]
> Use random MAC address if none configured instead of failing.
Connected with this, I wonder if you could also merge r182524 and r182555?
These changes fix up the merged comments, and make the random MAC address
a locally assigned one, and not simply stolen from the range that Atmel
own.
Thanks,
Gavin
From imp at bsdimp.com Sun Jan 18 09:42:55 2009
From: imp at bsdimp.com (M. Warner Losh)
Date: Sun Jan 18 09:43:22 2009
Subject: svn commit: r187391 - in stable/7/sys: . arm/at91 contrib/pf
dev/ath/ath_hal dev/cxgb
In-Reply-To: <20090118163938.G24894@ury.york.ac.uk>
References: <200901181228.n0ICSjnT073457@svn.freebsd.org>
<20090118163938.G24894@ury.york.ac.uk>
Message-ID: <20090118.104153.1631915192.imp@bsdimp.com>
In message: <20090118163938.G24894@ury.york.ac.uk>
Gavin Atkinson writes:
: On Sun, 18 Jan 2009, Stanislav Sedov wrote:
:
: > Author: stas
: > Date: Sun Jan 18 12:28:45 2009
: > New Revision: 187391
: > URL: http://svn.freebsd.org/changeset/base/187391
: >
: > Log:
: > - Merge r182477:
: [snip]
: > Use random MAC address if none configured instead of failing.
:
: Connected with this, I wonder if you could also merge r182524 and r182555?
: These changes fix up the merged comments, and make the random MAC address
: a locally assigned one, and not simply stolen from the range that Atmel
: own.
In general, all the at91 changes from head should be safe to merge to
releng_7.
Warner
From alc at FreeBSD.org Sun Jan 18 10:26:53 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Sun Jan 18 10:27:00 2009
Subject: svn commit: r187400 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb kern
Message-ID: <200901181826.n0IIQqed082847@svn.freebsd.org>
Author: alc
Date: Sun Jan 18 18:26:52 2009
New Revision: 187400
URL: http://svn.freebsd.org/changeset/base/187400
Log:
MFC rev 179887
Enforce the mapping of kernel loadable modules in the uppermost 2GB of the
kernel virtual address space on amd64.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/kern/link_elf_obj.c
Modified: stable/7/sys/kern/link_elf_obj.c
==============================================================================
--- stable/7/sys/kern/link_elf_obj.c Sun Jan 18 17:54:03 2009 (r187399)
+++ stable/7/sys/kern/link_elf_obj.c Sun Jan 18 18:26:52 2009 (r187400)
@@ -667,6 +667,13 @@ link_elf_load_file(linker_class_t cls, c
goto out;
}
ef->address = (caddr_t) vm_map_min(kernel_map);
+
+ /*
+ * In order to satisfy amd64's architectural requirements on the
+ * location of code and data in the kernel's address space, request a
+ * mapping that is above the kernel.
+ */
+ mapbase = KERNBASE;
error = vm_map_find(kernel_map, ef->object, 0, &mapbase,
round_page(mapsize), TRUE, VM_PROT_ALL, VM_PROT_ALL, FALSE);
if (error) {
From n_hibma at FreeBSD.org Sun Jan 18 10:50:19 2009
From: n_hibma at FreeBSD.org (Nick Hibma)
Date: Sun Jan 18 10:50:32 2009
Subject: svn commit: r187401 - stable/7/sys/dev/ata
Message-ID: <200901181850.n0IIoIIV083424@svn.freebsd.org>
Author: n_hibma
Date: Sun Jan 18 18:50:18 2009
New Revision: 187401
URL: http://svn.freebsd.org/changeset/base/187401
Log:
Speling mistake.
Modified:
stable/7/sys/dev/ata/ata-all.c
Modified: stable/7/sys/dev/ata/ata-all.c
==============================================================================
--- stable/7/sys/dev/ata/ata-all.c Sun Jan 18 18:26:52 2009 (r187400)
+++ stable/7/sys/dev/ata/ata-all.c Sun Jan 18 18:50:18 2009 (r187401)
@@ -127,7 +127,7 @@ ata_attach(device_t dev)
/* reset the controller HW, the channel and device(s) */
while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch->unit)
- pause("ataatch", 1);
+ pause("attach", 1);
ATA_RESET(dev);
ATA_LOCKING(dev, ATA_LF_UNLOCK);
From n_hibma at FreeBSD.org Sun Jan 18 10:53:28 2009
From: n_hibma at FreeBSD.org (Nick Hibma)
Date: Sun Jan 18 10:53:44 2009
Subject: svn commit: r187402 - stable/7/share/man/man4
Message-ID: <200901181853.n0IIrRiQ083515@svn.freebsd.org>
Author: n_hibma
Date: Sun Jan 18 18:53:27 2009
New Revision: 187402
URL: http://svn.freebsd.org/changeset/base/187402
Log:
Speling mistake.
Modified:
stable/7/share/man/man4/textdump.4
Modified: stable/7/share/man/man4/textdump.4
==============================================================================
--- stable/7/share/man/man4/textdump.4 Sun Jan 18 18:50:18 2009 (r187401)
+++ stable/7/share/man/man4/textdump.4 Sun Jan 18 18:53:27 2009 (r187402)
@@ -93,7 +93,7 @@ sysctl.
.It Pa version.txt
Kernel version string.
My be disabled by clearing the
-.Dv dbeug.ddb.textdump.do_panic
+.Dv debug.ddb.textdump.do_panic
sysctl.
.El
.Pp
From n_hibma at FreeBSD.org Sun Jan 18 10:54:42 2009
From: n_hibma at FreeBSD.org (Nick Hibma)
Date: Sun Jan 18 10:54:48 2009
Subject: svn commit: r187403 - stable/7/share/man/man4
Message-ID: <200901181854.n0IIsfgD083579@svn.freebsd.org>
Author: n_hibma
Date: Sun Jan 18 18:54:41 2009
New Revision: 187403
URL: http://svn.freebsd.org/changeset/base/187403
Log:
Remark on the fact that a phone is supported by this driver. Just to
give people a hint.
Modified:
stable/7/share/man/man4/umodem.4
Modified: stable/7/share/man/man4/umodem.4
==============================================================================
--- stable/7/share/man/man4/umodem.4 Sun Jan 18 18:53:27 2009 (r187402)
+++ stable/7/share/man/man4/umodem.4 Sun Jan 18 18:54:41 2009 (r187403)
@@ -96,6 +96,8 @@ Sierra MC5720 Wireless Modem
Yamaha Broadband Wireless Router RTW65b
.It
ELSA MicroLink 56k USB modem
+.It
+Sony Ericsson W810i phone
.El
.Sh SEE ALSO
.Xr tty 4 ,
From alc at FreeBSD.org Sun Jan 18 11:20:11 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Sun Jan 18 11:20:18 2009
Subject: svn commit: r187404 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb vm
Message-ID: <200901181920.n0IJKA6Z084158@svn.freebsd.org>
Author: alc
Date: Sun Jan 18 19:20:10 2009
New Revision: 187404
URL: http://svn.freebsd.org/changeset/base/187404
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/vm/vm_map.c
Modified: stable/7/sys/vm/vm_map.c
==============================================================================
--- stable/7/sys/vm/vm_map.c Sun Jan 18 18:54:41 2009 (r187403)
+++ stable/7/sys/vm/vm_map.c Sun Jan 18 19:20:10 2009 (r187404)
@@ -294,7 +294,7 @@ void
vm_init2(void)
{
uma_zone_set_obj(kmapentzone, &kmapentobj, lmin(cnt.v_page_count,
- (VM_MAX_KERNEL_ADDRESS - KERNBASE) / PAGE_SIZE) / 8 +
+ (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE) / 8 +
maxproc * 2 + maxfiles);
vmspace_zone = uma_zcreate("VMSPACE", sizeof(struct vmspace), NULL,
#ifdef INVARIANTS
From alc at FreeBSD.org Sun Jan 18 11:33:56 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Sun Jan 18 11:34:03 2009
Subject: svn commit: r187406 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb vm
Message-ID: <200901181933.n0IJXthp084547@svn.freebsd.org>
Author: alc
Date: Sun Jan 18 19:33:55 2009
New Revision: 187406
URL: http://svn.freebsd.org/changeset/base/187406
Log:
MFC rev 179923
Make preparations for increasing the size of the kernel virtual address
space on the amd64 architecture.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/vm/vm_kern.c
Modified: stable/7/sys/vm/vm_kern.c
==============================================================================
--- stable/7/sys/vm/vm_kern.c Sun Jan 18 19:25:36 2009 (r187405)
+++ stable/7/sys/vm/vm_kern.c Sun Jan 18 19:33:55 2009 (r187406)
@@ -502,8 +502,12 @@ kmem_init(start, end)
/* N.B.: cannot use kgdb to debug, starting with this assignment ... */
kernel_map = m;
(void) vm_map_insert(m, NULL, (vm_ooffset_t) 0,
- VM_MIN_KERNEL_ADDRESS, start, VM_PROT_ALL, VM_PROT_ALL,
- MAP_NOFAULT);
+#ifdef __amd64__
+ KERNBASE,
+#else
+ VM_MIN_KERNEL_ADDRESS,
+#endif
+ start, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT);
/* ... and ending with the completion of the above `insert' */
vm_map_unlock(m);
}
From alc at FreeBSD.org Sun Jan 18 11:37:39 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Sun Jan 18 11:37:55 2009
Subject: svn commit: r187407 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb vm
Message-ID: <200901181937.n0IJbbYL084665@svn.freebsd.org>
Author: alc
Date: Sun Jan 18 19:37:36 2009
New Revision: 187407
URL: http://svn.freebsd.org/changeset/base/187407
Log:
MFC rev 180598
Eliminate stale comments from kmem_malloc().
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/vm/vm_kern.c
Modified: stable/7/sys/vm/vm_kern.c
==============================================================================
--- stable/7/sys/vm/vm_kern.c Sun Jan 18 19:33:55 2009 (r187406)
+++ stable/7/sys/vm/vm_kern.c Sun Jan 18 19:37:36 2009 (r187407)
@@ -267,9 +267,6 @@ kmem_suballoc(parent, min, max, size)
* We don't worry about expanding the map (adding entries) since entries
* for wired maps are statically allocated.
*
- * NOTE: This routine is not supposed to block if M_NOWAIT is set, but
- * I have not verified that it actually does not block.
- *
* `map' is ONLY allowed to be kmem_map or one of the mbuf submaps to
* which we never free.
*/
@@ -321,15 +318,6 @@ kmem_malloc(map, size, flags)
vm_map_insert(map, kmem_object, offset, addr, addr + size,
VM_PROT_ALL, VM_PROT_ALL, 0);
- /*
- * Note: if M_NOWAIT specified alone, allocate from
- * interrupt-safe queues only (just the free list). If
- * M_USE_RESERVE is also specified, we can also
- * allocate from the cache. Neither of the latter two
- * flags may be specified from an interrupt since interrupts
- * are not allowed to mess with the cache queue.
- */
-
if ((flags & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED;
else
From alc at FreeBSD.org Sun Jan 18 11:56:14 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Sun Jan 18 11:56:26 2009
Subject: svn commit: r187408 - in stable/7/sys: . amd64/amd64 contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901181956.n0IJuDWF085142@svn.freebsd.org>
Author: alc
Date: Sun Jan 18 19:56:13 2009
New Revision: 187408
URL: http://svn.freebsd.org/changeset/base/187408
Log:
MFC rev 179898
Make preparations for increasing the size of the kernel virtual
address space on the amd64 architecture.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/minidump_machdep.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/amd64/amd64/minidump_machdep.c
==============================================================================
--- stable/7/sys/amd64/amd64/minidump_machdep.c Sun Jan 18 19:37:36 2009 (r187407)
+++ stable/7/sys/amd64/amd64/minidump_machdep.c Sun Jan 18 19:56:13 2009 (r187408)
@@ -202,7 +202,7 @@ minidumpsys(struct dumperinfo *di)
/* Walk page table pages, set bits in vm_page_dump */
ptesize = 0;
pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys);
- for (va = KERNBASE; va < kernel_vm_end; va += NBPDR) {
+ for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += NBPDR) {
i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
/*
* We always write a page, even if it is zero. Each
@@ -274,7 +274,7 @@ minidumpsys(struct dumperinfo *di)
mdhdr.msgbufsize = msgbufp->msg_size;
mdhdr.bitmapsize = vm_page_dump_size;
mdhdr.ptesize = ptesize;
- mdhdr.kernbase = KERNBASE;
+ mdhdr.kernbase = VM_MIN_KERNEL_ADDRESS;
mdhdr.dmapbase = DMAP_MIN_ADDRESS;
mdhdr.dmapend = DMAP_MAX_ADDRESS;
@@ -308,7 +308,7 @@ minidumpsys(struct dumperinfo *di)
/* Dump kernel page table pages */
pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys);
- for (va = KERNBASE; va < kernel_vm_end; va += NBPDR) {
+ for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += NBPDR) {
i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
/* We always write a page, even if it is zero */
if ((pdp[i] & PG_V) == 0) {
From danger at FreeBSD.org Sun Jan 18 13:40:19 2009
From: danger at FreeBSD.org (Daniel Gerzo)
Date: Sun Jan 18 13:40:32 2009
Subject: svn commit: r187411 - in stable/7/lib/libc: . string sys
Message-ID: <200901182140.n0ILeFr4088005@svn.freebsd.org>
Author: danger (doc committer)
Date: Sun Jan 18 21:40:15 2009
New Revision: 187411
URL: http://svn.freebsd.org/changeset/base/187411
Log:
MFC r187098:
- add missing include [2]
- fix struct memeber's name [1]
PR: docs/130413 [1]
Submitted by: Thomas Mueller [1], rink@ [2]
Modified:
stable/7/lib/libc/ (props changed)
stable/7/lib/libc/string/ffsll.c (props changed)
stable/7/lib/libc/string/flsll.c (props changed)
stable/7/lib/libc/sys/timer_create.2
Modified: stable/7/lib/libc/sys/timer_create.2
==============================================================================
--- stable/7/lib/libc/sys/timer_create.2 Sun Jan 18 21:09:34 2009 (r187410)
+++ stable/7/lib/libc/sys/timer_create.2 Sun Jan 18 21:40:15 2009 (r187411)
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 11, 2000
+.Dd January 12, 2009
.Dt TIMER_CREATE 2
.Os
.Sh NAME
@@ -37,6 +37,7 @@
.Lb librt
.Sh SYNOPSIS
.In time.h
+.In signal.h
.Ft int
.Fo timer_create
.Fa "clockid_t clockid" "struct sigevent *restrict evp"
@@ -100,7 +101,7 @@ or
.Dv CLOCK_MONOTONIC .
.Pp
If
-.Fa evp->sigev_sigev_notify
+.Fa evp->sigev_notify
is
.Dv SIGEV_THREAD
and
From lulf at FreeBSD.org Sun Jan 18 13:52:03 2009
From: lulf at FreeBSD.org (Ulf Lilleengen)
Date: Sun Jan 18 13:52:20 2009
Subject: svn commit: r187412 - in stable/7/sys: . contrib/pf dev/cxgb
geom/vinum
Message-ID: <200901182152.n0ILq2B8088298@svn.freebsd.org>
Author: lulf
Date: Sun Jan 18 21:52:01 2009
New Revision: 187412
URL: http://svn.freebsd.org/changeset/base/187412
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/geom/vinum/geom_vinum_plex.c
Modified: stable/7/sys/geom/vinum/geom_vinum_plex.c
==============================================================================
--- stable/7/sys/geom/vinum/geom_vinum_plex.c Sun Jan 18 21:40:15 2009 (r187411)
+++ stable/7/sys/geom/vinum/geom_vinum_plex.c Sun Jan 18 21:52:01 2009 (r187412)
@@ -667,11 +667,21 @@ gv_plex_normal_request(struct gv_plex *p
static int
gv_plex_access(struct g_provider *pp, int dr, int dw, int de)
{
+ struct gv_plex *p;
struct g_geom *gp;
struct g_consumer *cp, *cp2;
int error;
gp = pp->geom;
+ p = gp->softc;
+ KASSERT(p != NULL, ("NULL p"));
+
+ if (p->org == GV_PLEX_RAID5) {
+ if (dw > 0 && dr == 0)
+ dr = 1;
+ else if (dw < 0 && dr == 0)
+ dr = -1;
+ }
LIST_FOREACH(cp, &gp->consumer, consumer) {
error = g_access(cp, dr, dw, de);
From alc at FreeBSD.org Sun Jan 18 15:34:19 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Sun Jan 18 15:34:25 2009
Subject: svn commit: r187414 - in stable/7/sys: . amd64/amd64 contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901182334.n0INYIFD091315@svn.freebsd.org>
Author: alc
Date: Sun Jan 18 23:34:17 2009
New Revision: 187414
URL: http://svn.freebsd.org/changeset/base/187414
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/minidump_machdep.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/amd64/amd64/minidump_machdep.c
==============================================================================
--- stable/7/sys/amd64/amd64/minidump_machdep.c Sun Jan 18 23:21:04 2009 (r187413)
+++ stable/7/sys/amd64/amd64/minidump_machdep.c Sun Jan 18 23:34:17 2009 (r187414)
@@ -202,7 +202,8 @@ minidumpsys(struct dumperinfo *di)
/* Walk page table pages, set bits in vm_page_dump */
ptesize = 0;
pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys);
- for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += NBPDR) {
+ for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR,
+ kernel_vm_end); va += NBPDR) {
i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
/*
* We always write a page, even if it is zero. Each
@@ -308,7 +309,8 @@ minidumpsys(struct dumperinfo *di)
/* Dump kernel page table pages */
pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys);
- for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += NBPDR) {
+ for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR,
+ kernel_vm_end); va += NBPDR) {
i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
/* We always write a page, even if it is zero */
if ((pdp[i] & PG_V) == 0) {
From alc at FreeBSD.org Sun Jan 18 17:03:43 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Sun Jan 18 17:04:00 2009
Subject: svn commit: r187416 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb kern
Message-ID: <200901190103.n0J13gKp093463@svn.freebsd.org>
Author: alc
Date: Mon Jan 19 01:03:42 2009
New Revision: 187416
URL: http://svn.freebsd.org/changeset/base/187416
Log:
MFC rev 180262
Correct an error in the comments for init_param3().
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/kern/kern_malloc.c
stable/7/sys/kern/subr_param.c
Modified: stable/7/sys/kern/kern_malloc.c
==============================================================================
--- stable/7/sys/kern/kern_malloc.c Sun Jan 18 23:49:02 2009 (r187415)
+++ stable/7/sys/kern/kern_malloc.c Mon Jan 19 01:03:42 2009 (r187416)
@@ -618,7 +618,7 @@ kmeminit(void *dummy)
vm_kmem_size = 2 * cnt.v_page_count * PAGE_SIZE;
/*
- * Tune settings based on the kernel map's size at this time.
+ * Tune settings based on the kmem map's size at this time.
*/
init_param3(vm_kmem_size / PAGE_SIZE);
Modified: stable/7/sys/kern/subr_param.c
==============================================================================
--- stable/7/sys/kern/subr_param.c Sun Jan 18 23:49:02 2009 (r187415)
+++ stable/7/sys/kern/subr_param.c Mon Jan 19 01:03:42 2009 (r187416)
@@ -172,14 +172,14 @@ init_param2(long physpages)
}
/*
- * Boot time overrides that are scaled against the kernel map
+ * Boot time overrides that are scaled against the kmem map
*/
void
init_param3(long kmempages)
{
/*
- * The default for maxpipekva is max(5% of the kernel map, 512KB).
+ * The default for maxpipekva is max(5% of the kmem map, 512KB).
* See sys_pipe.c for more details.
*/
maxpipekva = (kmempages / 20) * PAGE_SIZE;
From alc at FreeBSD.org Sun Jan 18 20:31:19 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Sun Jan 18 20:31:32 2009
Subject: svn commit: r187419 - in stable/7/sys: . amd64/amd64 contrib/pf
dev/ath/ath_hal dev/cxgb i386/i386
Message-ID: <200901190431.n0J4VIoP097812@svn.freebsd.org>
Author: alc
Date: Mon Jan 19 04:31:18 2009
New Revision: 187419
URL: http://svn.freebsd.org/changeset/base/187419
Log:
MFC rev 180255
Eliminate an unused declaration. (In fact, the declaration is bogus
because the variable is defined static to pmap.c.)
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/mp_machdep.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/i386/i386/mp_machdep.c
Modified: stable/7/sys/amd64/amd64/mp_machdep.c
==============================================================================
--- stable/7/sys/amd64/amd64/mp_machdep.c Mon Jan 19 02:37:10 2009 (r187418)
+++ stable/7/sys/amd64/amd64/mp_machdep.c Mon Jan 19 04:31:18 2009 (r187419)
@@ -79,7 +79,6 @@ int mcount_lock;
int mp_naps; /* # of Applications processors */
int boot_cpu_id = -1; /* designated BSP */
-extern int nkpt;
extern struct pcpu __pcpu[];
Modified: stable/7/sys/i386/i386/mp_machdep.c
==============================================================================
--- stable/7/sys/i386/i386/mp_machdep.c Mon Jan 19 02:37:10 2009 (r187418)
+++ stable/7/sys/i386/i386/mp_machdep.c Mon Jan 19 04:31:18 2009 (r187419)
@@ -131,7 +131,6 @@ int mcount_lock;
int mp_naps; /* # of Applications processors */
int boot_cpu_id = -1; /* designated BSP */
-extern int nkpt;
extern struct pcpu __pcpu[];
From alc at FreeBSD.org Sun Jan 18 21:20:53 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Sun Jan 18 21:21:05 2009
Subject: svn commit: r187420 - in stable/7/sys/amd64: amd64 include
Message-ID: <200901190520.n0J5KqTp098763@svn.freebsd.org>
Author: alc
Date: Mon Jan 19 05:20:52 2009
New Revision: 187420
URL: http://svn.freebsd.org/changeset/base/187420
Log:
MFC partial merge of rev 179886
Make preparations for increasing the size of the kernel virtual
address space on the amd64 architecture.
Modified:
stable/7/sys/amd64/amd64/mem.c
stable/7/sys/amd64/amd64/pmap.c
stable/7/sys/amd64/amd64/trap.c
stable/7/sys/amd64/include/stack.h
Modified: stable/7/sys/amd64/amd64/mem.c
==============================================================================
--- stable/7/sys/amd64/amd64/mem.c Mon Jan 19 04:31:18 2009 (r187419)
+++ stable/7/sys/amd64/amd64/mem.c Mon Jan 19 05:20:52 2009 (r187420)
@@ -119,7 +119,7 @@ kmemphys:
addr = trunc_page(v);
eaddr = round_page(v + c);
- if (addr < (vm_offset_t)KERNBASE)
+ if (addr < VM_MIN_KERNEL_ADDRESS)
return (EFAULT);
for (; addr < eaddr; addr += PAGE_SIZE)
if (pmap_extract(kernel_pmap, addr) == 0)
Modified: stable/7/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/7/sys/amd64/amd64/pmap.c Mon Jan 19 04:31:18 2009 (r187419)
+++ stable/7/sys/amd64/amd64/pmap.c Mon Jan 19 05:20:52 2009 (r187420)
@@ -1493,7 +1493,7 @@ pmap_release(pmap_t pmap)
static int
kvm_size(SYSCTL_HANDLER_ARGS)
{
- unsigned long ksize = VM_MAX_KERNEL_ADDRESS - KERNBASE;
+ unsigned long ksize = VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS;
return sysctl_handle_long(oidp, &ksize, 0, req);
}
@@ -1523,7 +1523,7 @@ pmap_growkernel(vm_offset_t addr)
mtx_assert(&kernel_map->system_mtx, MA_OWNED);
if (kernel_vm_end == 0) {
- kernel_vm_end = KERNBASE;
+ kernel_vm_end = VM_MIN_KERNEL_ADDRESS;
nkpt = 0;
while ((*pmap_pde(kernel_pmap, kernel_vm_end) & PG_V) != 0) {
kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
Modified: stable/7/sys/amd64/amd64/trap.c
==============================================================================
--- stable/7/sys/amd64/amd64/trap.c Mon Jan 19 04:31:18 2009 (r187419)
+++ stable/7/sys/amd64/amd64/trap.c Mon Jan 19 05:20:52 2009 (r187420)
@@ -610,7 +610,7 @@ trap_pfault(frame, usermode)
vm_offset_t eva = frame->tf_addr;
va = trunc_page(eva);
- if (va >= KERNBASE) {
+ if (va >= VM_MIN_KERNEL_ADDRESS) {
/*
* Don't allow user-mode faults in kernel address space.
*/
Modified: stable/7/sys/amd64/include/stack.h
==============================================================================
--- stable/7/sys/amd64/include/stack.h Mon Jan 19 04:31:18 2009 (r187419)
+++ stable/7/sys/amd64/include/stack.h Mon Jan 19 05:20:52 2009 (r187420)
@@ -33,7 +33,7 @@
* Stack trace.
*/
#define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \
- || ((va) >= KERNBASE && (va) < VM_MAX_KERNEL_ADDRESS))
+ || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS))
struct amd64_frame {
struct amd64_frame *f_frame;
From alc at FreeBSD.org Sun Jan 18 22:55:30 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Sun Jan 18 22:55:47 2009
Subject: svn commit: r187425 - in stable/7/sys: . amd64/include contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901190655.n0J6tTEr000988@svn.freebsd.org>
Author: alc
Date: Mon Jan 19 06:55:29 2009
New Revision: 187425
URL: http://svn.freebsd.org/changeset/base/187425
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/include/pmap.h
stable/7/sys/amd64/include/vmparam.h
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/amd64/include/pmap.h
==============================================================================
--- stable/7/sys/amd64/include/pmap.h Mon Jan 19 06:42:44 2009 (r187424)
+++ stable/7/sys/amd64/include/pmap.h Mon Jan 19 06:55:29 2009 (r187425)
@@ -110,7 +110,6 @@
#define NKPML4E 1 /* number of kernel PML4 slots */
#define NKPDPE 1 /* number of kernel PDP slots */
-#define NKPDE (NKPDPE*NPDEPG) /* number of kernel PD slots */
#define NUPML4E (NPML4EPG/2) /* number of userland PML4 pages */
#define NUPDPE (NUPML4E*NPDPEPG)/* number of userland PDP pages */
Modified: stable/7/sys/amd64/include/vmparam.h
==============================================================================
--- stable/7/sys/amd64/include/vmparam.h Mon Jan 19 06:42:44 2009 (r187424)
+++ stable/7/sys/amd64/include/vmparam.h Mon Jan 19 06:55:29 2009 (r187425)
@@ -147,7 +147,7 @@
* 0xffffffff80000000 KERNBASE
*/
-#define VM_MAX_KERNEL_ADDRESS KVADDR(KPML4I, NPDPEPG-1, NKPDE-1, NPTEPG-1)
+#define VM_MAX_KERNEL_ADDRESS KVADDR(KPML4I, NPDPEPG-1, NPDEPG-1, NPTEPG-1)
#define VM_MIN_KERNEL_ADDRESS KVADDR(KPML4I, KPDPI, 0, 0)
#define DMAP_MIN_ADDRESS KVADDR(DMPML4I, 0, 0, 0)
From alc at FreeBSD.org Sun Jan 18 23:44:19 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Sun Jan 18 23:44:30 2009
Subject: svn commit: r187428 - in stable/7/sys: . amd64/include contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901190744.n0J7iIwp002174@svn.freebsd.org>
Author: alc
Date: Mon Jan 19 07:44:18 2009
New Revision: 187428
URL: http://svn.freebsd.org/changeset/base/187428
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/include/pmap.h
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/amd64/include/pmap.h
==============================================================================
--- stable/7/sys/amd64/include/pmap.h Mon Jan 19 07:18:32 2009 (r187427)
+++ stable/7/sys/amd64/include/pmap.h Mon Jan 19 07:44:18 2009 (r187428)
@@ -109,7 +109,7 @@
#endif
#define NKPML4E 1 /* number of kernel PML4 slots */
-#define NKPDPE 1 /* number of kernel PDP slots */
+#define NKPDPE howmany(NKPT, NPDEPG)/* number of kernel PDP slots */
#define NUPML4E (NPML4EPG/2) /* number of userland PML4 pages */
#define NUPDPE (NUPML4E*NPDPEPG)/* number of userland PDP pages */
From ru at FreeBSD.org Mon Jan 19 02:44:17 2009
From: ru at FreeBSD.org (Ruslan Ermilov)
Date: Mon Jan 19 02:44:35 2009
Subject: svn commit: r187431 - stable/7/usr.bin/netstat
Message-ID: <200901191044.n0JAiGVF008052@svn.freebsd.org>
Author: ru
Date: Mon Jan 19 10:44:16 2009
New Revision: 187431
URL: http://svn.freebsd.org/changeset/base/187431
Log:
MFC:
- Fix crash with "netstat -m -N foo".
PR: bin/124724
- Sync usage() with SYNOPSIS.
Modified:
stable/7/usr.bin/netstat/ (props changed)
stable/7/usr.bin/netstat/main.c
Modified: stable/7/usr.bin/netstat/main.c
==============================================================================
--- stable/7/usr.bin/netstat/main.c Mon Jan 19 08:51:20 2009 (r187430)
+++ stable/7/usr.bin/netstat/main.c Mon Jan 19 10:44:16 2009 (r187431)
@@ -503,7 +503,7 @@ main(int argc, char *argv[])
exit(0);
}
if (mflag) {
- if (memf != NULL) {
+ if (!live) {
if (kread(0, NULL, 0) == 0)
mbpr(kvmd, nl[N_MBSTAT].n_value);
} else
@@ -768,15 +768,16 @@ usage(void)
(void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
"usage: netstat [-AaLnSW] [-f protocol_family | -p protocol]\n"
" [-M core] [-N system]",
-" netstat -i | -I interface [-abdhnt] [-f address_family]\n"
+" netstat -i | -I interface [-abdhntW] [-f address_family]\n"
" [-M core] [-N system]",
" netstat -w wait [-I interface] [-d] [-M core] [-N system]",
-" netstat -s [-s] [-z] [-f protocol_family | -p protocol] [-M core]",
+" netstat -s [-s] [-z] [-f protocol_family | -p protocol]\n"
+" [-M core] [-N system]",
" netstat -i | -I interface -s [-f protocol_family | -p protocol]\n"
" [-M core] [-N system]",
" netstat -m [-M core] [-N system]",
-" netstat -B [ -I interface]",
-" netstat -r [-AenW] [-f address_family] [-M core] [-N system]",
+" netstat -B [-I interface]",
+" netstat -r [-AanW] [-f address_family] [-M core] [-N system]",
" netstat -rs [-s] [-M core] [-N system]",
" netstat -g [-W] [-f address_family] [-M core] [-N system]",
" netstat -gs [-s] [-f address_family] [-M core] [-N system]");
From sobomax at FreeBSD.org Mon Jan 19 07:36:27 2009
From: sobomax at FreeBSD.org (Maxim Sobolev)
Date: Mon Jan 19 07:36:34 2009
Subject: svn commit: r187434 - stable/7/sys/amd64/conf
Message-ID: <200901191536.n0JFaPTN014129@svn.freebsd.org>
Author: sobomax
Date: Mon Jan 19 15:36:25 2009
New Revision: 187434
URL: http://svn.freebsd.org/changeset/base/187434
Log:
MFC: take NTFS option out to match i386 GENERIC.
Modified:
stable/7/sys/amd64/conf/GENERIC
Modified: stable/7/sys/amd64/conf/GENERIC
==============================================================================
--- stable/7/sys/amd64/conf/GENERIC Mon Jan 19 15:33:06 2009 (r187433)
+++ stable/7/sys/amd64/conf/GENERIC Mon Jan 19 15:36:25 2009 (r187434)
@@ -41,7 +41,6 @@ options NFSCLIENT # Network Filesystem
options NFSSERVER # Network Filesystem Server
options NFSLOCKD # Network Lock Manager
options NFS_ROOT # NFS usable as /, requires NFSCLIENT
-options NTFS # NT File System
options MSDOSFS # MSDOS Filesystem
options CD9660 # ISO 9660 Filesystem
options PROCFS # Process filesystem (requires PSEUDOFS)
From rwatson at FreeBSD.org Mon Jan 19 07:55:15 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Mon Jan 19 07:55:31 2009
Subject: svn commit: r187434 - stable/7/sys/amd64/conf
In-Reply-To: <200901191536.n0JFaPTN014129@svn.freebsd.org>
References: <200901191536.n0JFaPTN014129@svn.freebsd.org>
Message-ID:
On Mon, 19 Jan 2009, Maxim Sobolev wrote:
> Author: sobomax
> Date: Mon Jan 19 15:36:25 2009
> New Revision: 187434
> URL: http://svn.freebsd.org/changeset/base/187434
>
> Log:
> MFC: take NTFS option out to match i386 GENERIC.
Are you going to modify UPDATING to say that "options NTFS" will now be
required where it wasn't previously on amd64? Also, insta-MFC's are generally
a bad idea, even for changes believed harmless, as they often have unexpected
side effects.
Robert N M Watson
Computer Laboratory
University of Cambridge
>
> Modified:
> stable/7/sys/amd64/conf/GENERIC
>
> Modified: stable/7/sys/amd64/conf/GENERIC
> ==============================================================================
> --- stable/7/sys/amd64/conf/GENERIC Mon Jan 19 15:33:06 2009 (r187433)
> +++ stable/7/sys/amd64/conf/GENERIC Mon Jan 19 15:36:25 2009 (r187434)
> @@ -41,7 +41,6 @@ options NFSCLIENT # Network Filesystem
> options NFSSERVER # Network Filesystem Server
> options NFSLOCKD # Network Lock Manager
> options NFS_ROOT # NFS usable as /, requires NFSCLIENT
> -options NTFS # NT File System
> options MSDOSFS # MSDOS Filesystem
> options CD9660 # ISO 9660 Filesystem
> options PROCFS # Process filesystem (requires PSEUDOFS)
>
From sobomax at FreeBSD.org Mon Jan 19 09:14:04 2009
From: sobomax at FreeBSD.org (Maxim Sobolev)
Date: Mon Jan 19 09:14:11 2009
Subject: svn commit: r187440 - stable/7
Message-ID: <200901191714.n0JHE3fA016364@svn.freebsd.org>
Author: sobomax
Date: Mon Jan 19 17:14:03 2009
New Revision: 187440
URL: http://svn.freebsd.org/changeset/base/187440
Log:
MFC: mention removal of NTFS from GENERIC/amd64.
Modified:
stable/7/UPDATING
Modified: stable/7/UPDATING
==============================================================================
--- stable/7/UPDATING Mon Jan 19 17:03:46 2009 (r187439)
+++ stable/7/UPDATING Mon Jan 19 17:14:03 2009 (r187440)
@@ -8,6 +8,14 @@ Items affecting the ports and packages s
/usr/ports/UPDATING. Please read that file before running
portupgrade.
+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.
From sobomax at FreeBSD.org Mon Jan 19 09:20:23 2009
From: sobomax at FreeBSD.org (Maxim Sobolev)
Date: Mon Jan 19 09:20:43 2009
Subject: svn commit: r187434 - stable/7/sys/amd64/conf
In-Reply-To:
References: <200901191536.n0JFaPTN014129@svn.freebsd.org>
Message-ID: <4974B0FD.2060104@FreeBSD.org>
Robert Watson wrote:
>
> On Mon, 19 Jan 2009, Maxim Sobolev wrote:
>
>> Author: sobomax
>> Date: Mon Jan 19 15:36:25 2009
>> New Revision: 187434
>> URL: http://svn.freebsd.org/changeset/base/187434
>>
>> Log:
>> MFC: take NTFS option out to match i386 GENERIC.
>
> Are you going to modify UPDATING to say that "options NTFS" will now be
> required where it wasn't previously on amd64?
It should not cause any issues, as the mount_ntfs(8) auto-loads ntfs.ko
module as needed. However, I am adding UPDATING entry just in case.
-Maxim
From marius at FreeBSD.org Mon Jan 19 13:10:06 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Mon Jan 19 13:10:13 2009
Subject: svn commit: r187446 - stable/7/share/man/man4
Message-ID: <200901192110.n0JLA4PX021325@svn.freebsd.org>
Author: marius
Date: Mon Jan 19 21:10:04 2009
New Revision: 187446
URL: http://svn.freebsd.org/changeset/base/187446
Log:
- 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.
Modified:
stable/7/share/man/man4/bge.4
Modified: stable/7/share/man/man4/bge.4
==============================================================================
--- stable/7/share/man/man4/bge.4 Mon Jan 19 19:16:50 2009 (r187445)
+++ stable/7/share/man/man4/bge.4 Mon Jan 19 21:10:04 2009 (r187446)
@@ -31,12 +31,12 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 26, 2007
+.Dd January 15, 2009
.Dt BGE 4
.Os
.Sh NAME
.Nm bge
-.Nd "Broadcom BCM570x/5714/5721/5750/5751/5752/5789 PCI Gigabit Ethernet adapter driver"
+.Nd "Broadcom BCM570x/5714/5721/5722/5750/5751/5752/5789 PCI Gigabit Ethernet adapter driver"
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following lines in your
@@ -56,7 +56,7 @@ if_bge_load="YES"
The
.Nm
driver provides support for various NICs based on the Broadcom BCM570x,
-5714, 5721, 5750, 5751, 5752 and 5789 families of Gigabit Ethernet
+5714, 5721, 5722, 5750, 5751, 5752 and 5789 families of Gigabit Ethernet
controller chips.
.Pp
All of these NICs are capable of 10, 100 and 1000Mbps speeds over CAT5
@@ -82,7 +82,7 @@ copper gigabit transceivers,
which support autonegotiation of 10, 100 and 1000Mbps modes in
full or half duplex.
.Pp
-The BCM5700, BCM5701, BCM5703, BCM5704, BCM5714 and BCM5780 also support
+The BCM5700, BCM5701, BCM5702, BCM5703 and BCM5704 also support
jumbo frames, which can be configured
via the interface MTU setting.
Selecting an MTU larger than 1500 bytes with the
From marius at FreeBSD.org Mon Jan 19 13:42:55 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Mon Jan 19 13:43:06 2009
Subject: svn commit: r187448 - stable/7/share/man/man4
Message-ID: <200901192142.n0JLgsGs022250@svn.freebsd.org>
Author: marius
Date: Mon Jan 19 21:42:54 2009
New Revision: 187448
URL: http://svn.freebsd.org/changeset/base/187448
Log:
- 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.
Modified:
stable/7/share/man/man4/ (props changed)
From marius at FreeBSD.org Mon Jan 19 13:47:02 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Mon Jan 19 13:47:08 2009
Subject: svn commit: r187450 - stable/7/share/man/man4
Message-ID: <200901192147.n0JLl1YA022453@svn.freebsd.org>
Author: marius
Date: Mon Jan 19 21:47:01 2009
New Revision: 187450
URL: http://svn.freebsd.org/changeset/base/187450
Log:
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.
Modified:
stable/7/share/man/man4/ (props changed)
stable/7/share/man/man4/gem.4
stable/7/share/man/man4/hme.4
Modified: stable/7/share/man/man4/gem.4
==============================================================================
--- stable/7/share/man/man4/gem.4 Mon Jan 19 21:43:48 2009 (r187449)
+++ stable/7/share/man/man4/gem.4 Mon Jan 19 21:47:01 2009 (r187450)
@@ -33,7 +33,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 26, 2007
+.Dd January 15, 2009
.Dt GEM 4
.Os
.Sh NAME
@@ -115,7 +115,6 @@ driver fails to attach to Sun Gigabit Et
as no SBus front-end has been written so far.
.Sh SEE ALSO
.Xr altq 4 ,
-.Xr hme 4 ,
.Xr miibus 4 ,
.Xr netintro 4 ,
.Xr eeprom 8 ,
Modified: stable/7/share/man/man4/hme.4
==============================================================================
--- stable/7/share/man/man4/hme.4 Mon Jan 19 21:43:48 2009 (r187449)
+++ stable/7/share/man/man4/hme.4 Mon Jan 19 21:47:01 2009 (r187450)
@@ -36,7 +36,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 16, 2005
+.Dd January 15, 2009
.Dt HME 4
.Os
.Sh NAME
@@ -120,7 +120,6 @@ on boards equipped with more than one Et
except the single-port SBus versions.
.Sh SEE ALSO
.Xr altq 4 ,
-.Xr gem 4 ,
.Xr intro 4 ,
.Xr miibus 4 ,
.Xr netintro 4 ,
From marius at FreeBSD.org Mon Jan 19 13:49:24 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Mon Jan 19 13:49:41 2009
Subject: svn commit: r187452 - stable/7/share/man/man4
Message-ID: <200901192149.n0JLnM0g022604@svn.freebsd.org>
Author: marius
Date: Mon Jan 19 21:49:22 2009
New Revision: 187452
URL: http://svn.freebsd.org/changeset/base/187452
Log:
MFC: r187341
Update URL.
Modified:
stable/7/share/man/man4/ (props changed)
stable/7/share/man/man4/hme.4
Modified: stable/7/share/man/man4/hme.4
==============================================================================
--- stable/7/share/man/man4/hme.4 Mon Jan 19 21:47:06 2009 (r187451)
+++ stable/7/share/man/man4/hme.4 Mon Jan 19 21:49:22 2009 (r187452)
@@ -36,7 +36,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 15, 2009
+.Dd January 16, 2009
.Dt HME 4
.Os
.Sh NAME
@@ -129,7 +129,7 @@ except the single-port SBus versions.
.%T "STP2002QFP Fast Ethernet, Parallel Port, SCSI (FEPS) User's Guide"
.%D April 1996
.%A Sun Microelectronics
-.%O http://www.sun.com/oem/products/manuals/STP2002QFP-UG.pdf
+.%O http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf
.Re
.Sh HISTORY
The
From imp at bsdimp.com Mon Jan 19 17:12:12 2009
From: imp at bsdimp.com (M. Warner Losh)
Date: Mon Jan 19 17:12:35 2009
Subject: svn commit: r187434 - stable/7/sys/amd64/conf
In-Reply-To:
References: <200901191536.n0JFaPTN014129@svn.freebsd.org>
Message-ID: <20090119.181124.-1270972755.imp@bsdimp.com>
In message:
Robert Watson writes:
:
: On Mon, 19 Jan 2009, Maxim Sobolev wrote:
:
: > Author: sobomax
: > Date: Mon Jan 19 15:36:25 2009
: > New Revision: 187434
: > URL: http://svn.freebsd.org/changeset/base/187434
: >
: > Log:
: > MFC: take NTFS option out to match i386 GENERIC.
:
: Are you going to modify UPDATING to say that "options NTFS" will now be
: required where it wasn't previously on amd64? Also, insta-MFC's are generally
: a bad idea, even for changes believed harmless, as they often have unexpected
: side effects.
Especially since NTFS works very well in 6.x and I think in 7.x. It
is only in -current that there are issues exposed by other work...
Warner
From imp at bsdimp.com Mon Jan 19 17:18:19 2009
From: imp at bsdimp.com (M. Warner Losh)
Date: Mon Jan 19 17:18:35 2009
Subject: svn commit: r187434 - stable/7/sys/amd64/conf
In-Reply-To: <4974B0FD.2060104@FreeBSD.org>
References: <200901191536.n0JFaPTN014129@svn.freebsd.org>
<4974B0FD.2060104@FreeBSD.org>
Message-ID: <20090119.181519.1622466713.imp@bsdimp.com>
In message: <4974B0FD.2060104@FreeBSD.org>
Maxim Sobolev writes:
: Robert Watson wrote:
: >
: > On Mon, 19 Jan 2009, Maxim Sobolev wrote:
: >
: >> Author: sobomax
: >> Date: Mon Jan 19 15:36:25 2009
: >> New Revision: 187434
: >> URL: http://svn.freebsd.org/changeset/base/187434
: >>
: >> Log:
: >> MFC: take NTFS option out to match i386 GENERIC.
: >
: > Are you going to modify UPDATING to say that "options NTFS" will now be
: > required where it wasn't previously on amd64?
:
: It should not cause any issues, as the mount_ntfs(8) auto-loads ntfs.ko
: module as needed. However, I am adding UPDATING entry just in case.
it won't do that if you are running at a high secure level...
Warner
From sobomax at FreeBSD.org Mon Jan 19 17:45:59 2009
From: sobomax at FreeBSD.org (Maxim Sobolev)
Date: Mon Jan 19 17:46:16 2009
Subject: svn commit: r187434 - stable/7/sys/amd64/conf
In-Reply-To: <20090119.181519.1622466713.imp@bsdimp.com>
References: <200901191536.n0JFaPTN014129@svn.freebsd.org> <4974B0FD.2060104@FreeBSD.org>
<20090119.181519.1622466713.imp@bsdimp.com>
Message-ID: <49752CC7.3040000@FreeBSD.org>
M. Warner Losh wrote:
> In message: <4974B0FD.2060104@FreeBSD.org>
> Maxim Sobolev writes:
> : Robert Watson wrote:
> : >
> : > On Mon, 19 Jan 2009, Maxim Sobolev wrote:
> : >
> : >> Author: sobomax
> : >> Date: Mon Jan 19 15:36:25 2009
> : >> New Revision: 187434
> : >> URL: http://svn.freebsd.org/changeset/base/187434
> : >>
> : >> Log:
> : >> MFC: take NTFS option out to match i386 GENERIC.
> : >
> : > Are you going to modify UPDATING to say that "options NTFS" will now be
> : > required where it wasn't previously on amd64?
> :
> : It should not cause any issues, as the mount_ntfs(8) auto-loads ntfs.ko
> : module as needed. However, I am adding UPDATING entry just in case.
>
> it won't do that if you are running at a high secure level...
I know. This has been mentioned in UPDATING.
-Maxim
From sobomax at FreeBSD.org Mon Jan 19 17:46:11 2009
From: sobomax at FreeBSD.org (Maxim Sobolev)
Date: Mon Jan 19 17:46:33 2009
Subject: svn commit: r187434 - stable/7/sys/amd64/conf
In-Reply-To: <20090119.181124.-1270972755.imp@bsdimp.com>
References: <200901191536.n0JFaPTN014129@svn.freebsd.org>
<20090119.181124.-1270972755.imp@bsdimp.com>
Message-ID: <49752CD3.6020506@FreeBSD.org>
M. Warner Losh wrote:
> In message:
> Robert Watson writes:
> :
> : On Mon, 19 Jan 2009, Maxim Sobolev wrote:
> :
> : > Author: sobomax
> : > Date: Mon Jan 19 15:36:25 2009
> : > New Revision: 187434
> : > URL: http://svn.freebsd.org/changeset/base/187434
> : >
> : > Log:
> : > MFC: take NTFS option out to match i386 GENERIC.
> :
> : Are you going to modify UPDATING to say that "options NTFS" will now be
> : required where it wasn't previously on amd64? Also, insta-MFC's are generally
> : a bad idea, even for changes believed harmless, as they often have unexpected
> : side effects.
>
> Especially since NTFS works very well in 6.x and I think in 7.x. It
> is only in -current that there are issues exposed by other work...
Warner,
The point is not whether it works or not. The point is that i386 and
amd64 kernels should provide the same feature set. See the thread on
current@
-Maxim
From alc at FreeBSD.org Mon Jan 19 17:54:06 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Mon Jan 19 17:54:17 2009
Subject: svn commit: r187458 - in stable/7/sys: . amd64/amd64 contrib/pf
dev/ath/ath_hal dev/cxgb i386/i386
Message-ID: <200901200154.n0K1s5uE029065@svn.freebsd.org>
Author: alc
Date: Tue Jan 20 01:54:05 2009
New Revision: 187458
URL: http://svn.freebsd.org/changeset/base/187458
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/pmap.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/i386/i386/pmap.c
Modified: stable/7/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/7/sys/amd64/amd64/pmap.c Tue Jan 20 00:05:43 2009 (r187457)
+++ stable/7/sys/amd64/amd64/pmap.c Tue Jan 20 01:54:05 2009 (r187458)
@@ -1544,7 +1544,7 @@ pmap_growkernel(vm_offset_t addr)
nkpg = vm_page_alloc(NULL, nkpt,
VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ |
VM_ALLOC_WIRED | VM_ALLOC_ZERO);
- if (!nkpg)
+ if (nkpg == NULL)
panic("pmap_growkernel: no memory to grow kernel");
if ((nkpg->flags & PG_ZERO) == 0)
pmap_zero_page(nkpg);
@@ -1563,13 +1563,10 @@ pmap_growkernel(vm_offset_t addr)
continue;
}
- /*
- * This index is bogus, but out of the way
- */
- nkpg = vm_page_alloc(NULL, nkpt,
+ nkpg = vm_page_alloc(NULL, pmap_pde_pindex(kernel_vm_end),
VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED |
VM_ALLOC_ZERO);
- if (!nkpg)
+ if (nkpg == NULL)
panic("pmap_growkernel: no memory to grow kernel");
nkpt++;
Modified: stable/7/sys/i386/i386/pmap.c
==============================================================================
--- stable/7/sys/i386/i386/pmap.c Tue Jan 20 00:05:43 2009 (r187457)
+++ stable/7/sys/i386/i386/pmap.c Tue Jan 20 01:54:05 2009 (r187458)
@@ -1628,13 +1628,10 @@ pmap_growkernel(vm_offset_t addr)
continue;
}
- /*
- * This index is bogus, but out of the way
- */
- nkpg = vm_page_alloc(NULL, nkpt,
+ nkpg = vm_page_alloc(NULL, kernel_vm_end >> PDRSHIFT,
VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED |
VM_ALLOC_ZERO);
- if (!nkpg)
+ if (nkpg == NULL)
panic("pmap_growkernel: no memory to grow kernel");
nkpt++;
From alc at FreeBSD.org Mon Jan 19 21:51:17 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Mon Jan 19 21:51:34 2009
Subject: svn commit: r187464 - in stable/7/sys: . amd64/amd64 contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901200551.n0K5pGK0034220@svn.freebsd.org>
Author: alc
Date: Tue Jan 20 05:51:16 2009
New Revision: 187464
URL: http://svn.freebsd.org/changeset/base/187464
Log:
MFC rev 180170
Eliminate an unnecessary static variable: nkpt.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/pmap.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/7/sys/amd64/amd64/pmap.c Tue Jan 20 04:31:45 2009 (r187463)
+++ stable/7/sys/amd64/amd64/pmap.c Tue Jan 20 05:51:16 2009 (r187464)
@@ -171,7 +171,6 @@ struct pmap kernel_pmap_store;
vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */
vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */
-static int nkpt;
static int ndmpdp;
static vm_paddr_t dmaplimit;
vm_offset_t kernel_vm_end;
@@ -516,7 +515,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
kernel_pmap->pm_pml4 = (pdp_entry_t *) (KERNBASE + KPML4phys);
kernel_pmap->pm_active = -1; /* don't allow deactivation */
TAILQ_INIT(&kernel_pmap->pm_pvchunk);
- nkpt = NKPT;
/*
* Reserve some special page table entries/VA space for temporary
@@ -1524,10 +1522,8 @@ pmap_growkernel(vm_offset_t addr)
mtx_assert(&kernel_map->system_mtx, MA_OWNED);
if (kernel_vm_end == 0) {
kernel_vm_end = VM_MIN_KERNEL_ADDRESS;
- nkpt = 0;
while ((*pmap_pde(kernel_pmap, kernel_vm_end) & PG_V) != 0) {
kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
- nkpt++;
if (kernel_vm_end - 1 >= kernel_map->max_offset) {
kernel_vm_end = kernel_map->max_offset;
break;
@@ -1541,7 +1537,7 @@ pmap_growkernel(vm_offset_t addr)
pde = pmap_pde(kernel_pmap, kernel_vm_end);
if (pde == NULL) {
/* We need a new PDP entry */
- nkpg = vm_page_alloc(NULL, nkpt,
+ nkpg = vm_page_alloc(NULL, kernel_vm_end >> PDPSHIFT,
VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ |
VM_ALLOC_WIRED | VM_ALLOC_ZERO);
if (nkpg == NULL)
@@ -1568,9 +1564,6 @@ pmap_growkernel(vm_offset_t addr)
VM_ALLOC_ZERO);
if (nkpg == NULL)
panic("pmap_growkernel: no memory to grow kernel");
-
- nkpt++;
-
if ((nkpg->flags & PG_ZERO) == 0)
pmap_zero_page(nkpg);
paddr = VM_PAGE_TO_PHYS(nkpg);
From alc at FreeBSD.org Mon Jan 19 23:24:30 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Mon Jan 19 23:24:42 2009
Subject: svn commit: r187465 - in stable/7/sys: . amd64/amd64 amd64/include
contrib/pf dev/ath/ath_hal dev/cxgb
Message-ID: <200901200724.n0K7OT1I036371@svn.freebsd.org>
Author: alc
Date: Tue Jan 20 07:24:28 2009
New Revision: 187465
URL: http://svn.freebsd.org/changeset/base/187465
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/pmap.c
stable/7/sys/amd64/include/pmap.h
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/7/sys/amd64/amd64/pmap.c Tue Jan 20 05:51:16 2009 (r187464)
+++ stable/7/sys/amd64/amd64/pmap.c Tue Jan 20 07:24:28 2009 (r187465)
@@ -173,7 +173,7 @@ vm_offset_t virtual_end; /* VA of last a
static int ndmpdp;
static vm_paddr_t dmaplimit;
-vm_offset_t kernel_vm_end;
+vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS;
pt_entry_t pg_nx;
static u_int64_t KPTphys; /* phys addr of kernel level 1 */
@@ -1517,25 +1517,34 @@ pmap_growkernel(vm_offset_t addr)
vm_paddr_t paddr;
vm_page_t nkpg;
pd_entry_t *pde, newpdir;
- pdp_entry_t newpdp;
+ pdp_entry_t *pdpe;
mtx_assert(&kernel_map->system_mtx, MA_OWNED);
- if (kernel_vm_end == 0) {
- kernel_vm_end = VM_MIN_KERNEL_ADDRESS;
- while ((*pmap_pde(kernel_pmap, kernel_vm_end) & PG_V) != 0) {
- kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
- if (kernel_vm_end - 1 >= kernel_map->max_offset) {
- kernel_vm_end = kernel_map->max_offset;
- break;
- }
- }
- }
- addr = roundup2(addr, PAGE_SIZE * NPTEPG);
+
+ /*
+ * Return if "addr" is within the range of kernel page table pages
+ * that were preallocated during pmap bootstrap. Moreover, leave
+ * "kernel_vm_end" and the kernel page table as they were.
+ *
+ * The correctness of this action is based on the following
+ * argument: vm_map_findspace() allocates contiguous ranges of the
+ * kernel virtual address space. It calls this function if a range
+ * ends after "kernel_vm_end". If the kernel is mapped between
+ * "kernel_vm_end" and "addr", then the range cannot begin at
+ * "kernel_vm_end". In fact, its beginning address cannot be less
+ * than the kernel. Thus, there is no immediate need to allocate
+ * any new kernel page table pages between "kernel_vm_end" and
+ * "KERNBASE".
+ */
+ if (KERNBASE < addr && addr <= KERNBASE + NKPT * NBPDR)
+ return;
+
+ addr = roundup2(addr, NBPDR);
if (addr - 1 >= kernel_map->max_offset)
addr = kernel_map->max_offset;
while (kernel_vm_end < addr) {
- pde = pmap_pde(kernel_pmap, kernel_vm_end);
- if (pde == NULL) {
+ pdpe = pmap_pdpe(kernel_pmap, kernel_vm_end);
+ if ((*pdpe & PG_V) == 0) {
/* We need a new PDP entry */
nkpg = vm_page_alloc(NULL, kernel_vm_end >> PDPSHIFT,
VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ |
@@ -1545,13 +1554,13 @@ pmap_growkernel(vm_offset_t addr)
if ((nkpg->flags & PG_ZERO) == 0)
pmap_zero_page(nkpg);
paddr = VM_PAGE_TO_PHYS(nkpg);
- newpdp = (pdp_entry_t)
+ *pdpe = (pdp_entry_t)
(paddr | PG_V | PG_RW | PG_A | PG_M);
- *pmap_pdpe(kernel_pmap, kernel_vm_end) = newpdp;
continue; /* try again */
}
+ pde = pmap_pdpe_to_pde(pdpe, kernel_vm_end);
if ((*pde & PG_V) != 0) {
- kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
+ kernel_vm_end = (kernel_vm_end + NBPDR) & ~PDRMASK;
if (kernel_vm_end - 1 >= kernel_map->max_offset) {
kernel_vm_end = kernel_map->max_offset;
break;
@@ -1568,9 +1577,9 @@ pmap_growkernel(vm_offset_t addr)
pmap_zero_page(nkpg);
paddr = VM_PAGE_TO_PHYS(nkpg);
newpdir = (pd_entry_t) (paddr | PG_V | PG_RW | PG_A | PG_M);
- *pmap_pde(kernel_pmap, kernel_vm_end) = newpdir;
+ pde_store(pde, newpdir);
- kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
+ kernel_vm_end = (kernel_vm_end + NBPDR) & ~PDRMASK;
if (kernel_vm_end - 1 >= kernel_map->max_offset) {
kernel_vm_end = kernel_map->max_offset;
break;
Modified: stable/7/sys/amd64/include/pmap.h
==============================================================================
--- stable/7/sys/amd64/include/pmap.h Tue Jan 20 05:51:16 2009 (r187464)
+++ stable/7/sys/amd64/include/pmap.h Tue Jan 20 07:24:28 2009 (r187465)
@@ -104,8 +104,7 @@
/* Initial number of kernel page tables. */
#ifndef NKPT
-/* 240 page tables needed to map 16G (120B "struct vm_page", 2M page tables). */
-#define NKPT 240
+#define NKPT 32
#endif
#define NKPML4E 1 /* number of kernel PML4 slots */
From alc at FreeBSD.org Tue Jan 20 00:13:46 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Tue Jan 20 00:14:02 2009
Subject: svn commit: r187466 - in stable/7/sys: . amd64/include contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901200813.n0K8DjRg037348@svn.freebsd.org>
Author: alc
Date: Tue Jan 20 08:13:45 2009
New Revision: 187466
URL: http://svn.freebsd.org/changeset/base/187466
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/include/vmparam.h
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/amd64/include/vmparam.h
==============================================================================
--- stable/7/sys/amd64/include/vmparam.h Tue Jan 20 07:24:28 2009 (r187465)
+++ stable/7/sys/amd64/include/vmparam.h Tue Jan 20 08:13:45 2009 (r187466)
@@ -140,15 +140,16 @@
* 0xffff800000000000 - 0xffff804020100fff recursive page table (512GB slot)
* 0xffff804020101000 - 0xfffffeffffffffff unused
* 0xffffff0000000000 - 0xffffff7fffffffff 512GB direct map mappings
- * 0xffffff8000000000 - 0xffffffff7fffffff unused (510GB)
- * 0xffffffff80000000 - 0xffffffffffffffff 2GB kernel map
+ * 0xffffff8000000000 - 0xfffffffe7fffffff unused (506GB)
+ * 0xfffffffe80000000 - 0xffffffffffffffff 6GB kernel map
*
* Within the kernel map:
+ *
* 0xffffffff80000000 KERNBASE
*/
#define VM_MAX_KERNEL_ADDRESS KVADDR(KPML4I, NPDPEPG-1, NPDEPG-1, NPTEPG-1)
-#define VM_MIN_KERNEL_ADDRESS KVADDR(KPML4I, KPDPI, 0, 0)
+#define VM_MIN_KERNEL_ADDRESS KVADDR(KPML4I, NPDPEPG-6, 0, 0)
#define DMAP_MIN_ADDRESS KVADDR(DMPML4I, 0, 0, 0)
#define DMAP_MAX_ADDRESS KVADDR(DMPML4I+1, 0, 0, 0)
@@ -187,7 +188,8 @@
* Ceiling on amount of kmem_map kva space.
*/
#ifndef VM_KMEM_SIZE_MAX
-#define VM_KMEM_SIZE_MAX (400 * 1024 * 1024)
+#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \
+ VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5)
#endif
/* initial pagein size of beginning of executable file */
From gavin at FreeBSD.org Tue Jan 20 03:54:13 2009
From: gavin at FreeBSD.org (Gavin Atkinson)
Date: Tue Jan 20 03:54:20 2009
Subject: svn commit: r187434 - stable/7/sys/amd64/conf
In-Reply-To: <20090119.181124.-1270972755.imp@bsdimp.com>
References: <200901191536.n0JFaPTN014129@svn.freebsd.org>
<20090119.181124.-1270972755.imp@bsdimp.com>
Message-ID: <1232452445.22840.21.camel@buffy.york.ac.uk>
On Mon, 2009-01-19 at 18:11 -0700, M. Warner Losh wrote:
> In message:
> Robert Watson writes:
> :
> : On Mon, 19 Jan 2009, Maxim Sobolev wrote:
> :
> : > Author: sobomax
> : > Date: Mon Jan 19 15:36:25 2009
> : > New Revision: 187434
> : > URL: http://svn.freebsd.org/changeset/base/187434
> : >
> : > Log:
> : > MFC: take NTFS option out to match i386 GENERIC.
> :
> : Are you going to modify UPDATING to say that "options NTFS" will now be
> : required where it wasn't previously on amd64? Also, insta-MFC's are generally
> : a bad idea, even for changes believed harmless, as they often have unexpected
> : side effects.
>
> Especially since NTFS works very well in 6.x and I think in 7.x. It
> is only in -current that there are issues exposed by other work...
Do you know which other work exposed these issues? Or is it broken but
nobody knows why?
If the cause is known, this might make a good "junior kernel hacker"
task, or whatever that page is called now, especially given other file
systems have been changed and may serve as example code.
Gavin
From rwatson at FreeBSD.org Tue Jan 20 04:52:04 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Tue Jan 20 04:52:15 2009
Subject: svn commit: r187434 - stable/7/sys/amd64/conf
In-Reply-To: <1232452445.22840.21.camel@buffy.york.ac.uk>
References: <200901191536.n0JFaPTN014129@svn.freebsd.org>
<20090119.181124.-1270972755.imp@bsdimp.com>
<1232452445.22840.21.camel@buffy.york.ac.uk>
Message-ID:
On Tue, 20 Jan 2009, Gavin Atkinson wrote:
>> : Are you going to modify UPDATING to say that "options NTFS" will now be
>> : required where it wasn't previously on amd64? Also, insta-MFC's are generally
>> : a bad idea, even for changes believed harmless, as they often have unexpected
>> : side effects.
>>
>> Especially since NTFS works very well in 6.x and I think in 7.x. It is
>> only in -current that there are issues exposed by other work...
>
> Do you know which other work exposed these issues? Or is it broken but
> nobody knows why?
>
> If the cause is known, this might make a good "junior kernel hacker" task,
> or whatever that page is called now, especially given other file systems
> have been changed and may serve as example code.
I'm not sure if it's a stability issue per se, rather that as kernel
interfaces for VFS are evolved to support more parallelism, etc, file systems
without active maintenance are at risk of becoming less functional and
eventually being dropped. I think the context of the previous thread was
Attilio inquiring about expelling some of the less-recently maintained file
systems from the kernel so as to make redoing VFS interfaces easier (since
he'd have to touch fewer file systems). There may be other stability issues
as well, needless to say. One of the biggest issues will be if we want to, at
some point, remove all the scaffolding used to support non-MPSAFE file
systems, as locking down file systems requires both quite a bit of expertise
and quite a bit of time.
On a similar note, in the network stack, we jettisoned netatm and neti4b
support as they didn't have maintainers and there was no one to make them
MPSAFE. We're going to do the same for network device drivers that aren't
MPSAFE in the near future in order to remove the last bit of scaffolding there
-- I originally planned to remove IFF_NEEDSGIANT last year, but deferred it
since it seemd the usb2 project was working towards providing MPSAFE USB
network device drivers, which is seems (on the whole) to have now done, so I
should restart the removal of IFF_NEEDSGIANT for 8.0.
Robert
From imp at BSDIMP.COM Tue Jan 20 10:18:13 2009
From: imp at BSDIMP.COM (M. Warner Losh)
Date: Tue Jan 20 10:18:26 2009
Subject: svn commit: r187434 - stable/7/sys/amd64/conf
In-Reply-To: <1232452445.22840.21.camel@buffy.york.ac.uk>
References:
<20090119.181124.-1270972755.imp@bsdimp.com>
<1232452445.22840.21.camel@buffy.york.ac.uk>
Message-ID: <20090120.111657.2035877114.imp@bsdimp.com>
In message: <1232452445.22840.21.camel@buffy.york.ac.uk>
Gavin Atkinson writes:
: On Mon, 2009-01-19 at 18:11 -0700, M. Warner Losh wrote:
: > In message:
: > Robert Watson writes:
: > :
: > : On Mon, 19 Jan 2009, Maxim Sobolev wrote:
: > :
: > : > Author: sobomax
: > : > Date: Mon Jan 19 15:36:25 2009
: > : > New Revision: 187434
: > : > URL: http://svn.freebsd.org/changeset/base/187434
: > : >
: > : > Log:
: > : > MFC: take NTFS option out to match i386 GENERIC.
: > :
: > : Are you going to modify UPDATING to say that "options NTFS" will now be
: > : required where it wasn't previously on amd64? Also, insta-MFC's are generally
: > : a bad idea, even for changes believed harmless, as they often have unexpected
: > : side effects.
: >
: > Especially since NTFS works very well in 6.x and I think in 7.x. It
: > is only in -current that there are issues exposed by other work...
:
: Do you know which other work exposed these issues? Or is it broken but
: nobody knows why?
:
: If the cause is known, this might make a good "junior kernel hacker"
: task, or whatever that page is called now, especially given other file
: systems have been changed and may serve as example code.
I just know it works for me, and has been the most reliable file
system in the face of errors in the device that I've had to interact
with in the tree. You'd likely have to go read the PR database to
understand when/where it fails for people.
Warner
From jhb at FreeBSD.org Tue Jan 20 11:02:01 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Tue Jan 20 11:02:08 2009
Subject: svn commit: r187478 - in stable/7/sys: . conf contrib/pf
dev/ath/ath_hal dev/cxgb kern nfsclient ufs/ffs ufs/ufs
Message-ID: <200901201901.n0KJ1xTL053784@svn.freebsd.org>
Author: jhb
Date: Tue Jan 20 19:01:59 2009
New Revision: 187478
URL: http://svn.freebsd.org/changeset/base/187478
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/conf/options
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/kern/vfs_cache.c
stable/7/sys/kern/vfs_lookup.c
stable/7/sys/nfsclient/nfs_vnops.c
stable/7/sys/ufs/ffs/ffs_vfsops.c
stable/7/sys/ufs/ufs/dirhash.h
stable/7/sys/ufs/ufs/inode.h
stable/7/sys/ufs/ufs/ufs_dirhash.c
stable/7/sys/ufs/ufs/ufs_lookup.c
Modified: stable/7/sys/conf/options
==============================================================================
--- stable/7/sys/conf/options Tue Jan 20 18:16:31 2009 (r187477)
+++ stable/7/sys/conf/options Tue Jan 20 19:01:59 2009 (r187478)
@@ -741,9 +741,6 @@ NI4BTEL opt_i4b.h
#XXXBZ#NI4BING opt_i4b.h
#XXXBZ#NI4BISPPP opt_i4b.h
-# VFS options
-LOOKUP_SHARED opt_vfs.h
-
# HWPMC options
HWPMC_HOOKS
Modified: stable/7/sys/kern/vfs_cache.c
==============================================================================
--- stable/7/sys/kern/vfs_cache.c Tue Jan 20 18:16:31 2009 (r187477)
+++ stable/7/sys/kern/vfs_cache.c Tue Jan 20 19:01:59 2009 (r187478)
@@ -300,7 +300,9 @@ cache_zap(ncp)
* succeeds, the vnode is returned in *vpp, and a status of -1 is
* returned. If the lookup determines that the name does not exist
* (negative cacheing), a status of ENOENT is returned. If the lookup
- * fails, a status of zero is returned.
+ * fails, a status of zero is returned. If the directory vnode is
+ * recycled out from under us due to a forced unmount, a status of
+ * EBADF is returned.
*
* vpp is locked and ref'd on return. If we're looking up DOTDOT, dvp is
* unlocked. If we're looking up . an extra ref is taken, but the lock is
@@ -425,11 +427,19 @@ success:
* When we lookup "." we still can be asked to lock it
* differently...
*/
- ltype = cnp->cn_lkflags & (LK_SHARED | LK_EXCLUSIVE);
- if (ltype == VOP_ISLOCKED(*vpp, td))
- return (-1);
- else if (ltype == LK_EXCLUSIVE)
- vn_lock(*vpp, LK_UPGRADE | LK_RETRY, td);
+ ltype = cnp->cn_lkflags & LK_TYPE_MASK;
+ if (ltype != VOP_ISLOCKED(*vpp, td)) {
+ if (ltype == LK_EXCLUSIVE) {
+ vn_lock(*vpp, LK_UPGRADE | LK_RETRY, td);
+ if ((*vpp)->v_iflag & VI_DOOMED) {
+ /* forced unmount */
+ vrele(*vpp);
+ *vpp = NULL;
+ return (EBADF);
+ }
+ } else
+ vn_lock(*vpp, LK_DOWNGRADE | LK_RETRY, td);
+ }
return (-1);
}
ltype = 0; /* silence gcc warning */
@@ -442,12 +452,14 @@ success:
error = vget(*vpp, cnp->cn_lkflags | LK_INTERLOCK, td);
if (cnp->cn_flags & ISDOTDOT)
vn_lock(dvp, ltype | LK_RETRY, td);
- if ((cnp->cn_flags & ISLASTCN) && (cnp->cn_lkflags & LK_EXCLUSIVE))
- ASSERT_VOP_ELOCKED(*vpp, "cache_lookup");
if (error) {
*vpp = NULL;
goto retry;
}
+ if ((cnp->cn_flags & ISLASTCN) &&
+ (cnp->cn_lkflags & LK_TYPE_MASK) == LK_EXCLUSIVE) {
+ ASSERT_VOP_ELOCKED(*vpp, "cache_lookup");
+ }
return (-1);
}
@@ -663,9 +675,9 @@ vfs_cache_lookup(ap)
error = cache_lookup(dvp, vpp, cnp);
if (error == 0)
return (VOP_CACHEDLOOKUP(dvp, vpp, cnp));
- if (error == ENOENT)
- return (error);
- return (0);
+ if (error == -1)
+ return (0);
+ return (error);
}
Modified: stable/7/sys/kern/vfs_lookup.c
==============================================================================
--- stable/7/sys/kern/vfs_lookup.c Tue Jan 20 18:16:31 2009 (r187477)
+++ stable/7/sys/kern/vfs_lookup.c Tue Jan 20 19:01:59 2009 (r187478)
@@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$");
#include "opt_ktrace.h"
#include "opt_mac.h"
-#include "opt_vfs.h"
#include
#include
@@ -88,13 +87,10 @@ nameiinit(void *dummy __unused)
}
SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nameiinit, NULL);
-#ifdef LOOKUP_SHARED
-static int lookup_shared = 1;
-#else
static int lookup_shared = 0;
-#endif
SYSCTL_INT(_vfs, OID_AUTO, lookup_shared, CTLFLAG_RW, &lookup_shared, 0,
"Enables/Disables shared locks for path name translation");
+TUNABLE_INT("vfs.lookup_shared", &lookup_shared);
/*
* Convert a pathname into a pointer to a locked vnode.
Modified: stable/7/sys/nfsclient/nfs_vnops.c
==============================================================================
--- stable/7/sys/nfsclient/nfs_vnops.c Tue Jan 20 18:16:31 2009 (r187477)
+++ stable/7/sys/nfsclient/nfs_vnops.c Tue Jan 20 19:01:59 2009 (r187478)
@@ -868,7 +868,10 @@ nfs_lookup(struct vop_lookup_args *ap)
*vpp = NULLVP;
return (error);
}
- if ((error = cache_lookup(dvp, vpp, cnp)) && error != ENOENT) {
+ error = cache_lookup(dvp, vpp, cnp);
+ if (error > 0 && error != ENOENT)
+ return (error);
+ if (error == -1) {
struct vattr vattr;
newvp = *vpp;
Modified: stable/7/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- stable/7/sys/ufs/ffs/ffs_vfsops.c Tue Jan 20 18:16:31 2009 (r187477)
+++ stable/7/sys/ufs/ffs/ffs_vfsops.c Tue Jan 20 19:01:59 2009 (r187478)
@@ -852,7 +852,7 @@ ffs_mountfs(devvp, mp, td)
* Initialize filesystem stat information in mount struct.
*/
MNT_ILOCK(mp);
- mp->mnt_kern_flag |= MNTK_MPSAFE;
+ mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED;
MNT_IUNLOCK(mp);
#ifdef UFS_EXTATTR
#ifdef UFS_EXTATTR_AUTOSTART
Modified: stable/7/sys/ufs/ufs/dirhash.h
==============================================================================
--- stable/7/sys/ufs/ufs/dirhash.h Tue Jan 20 18:16:31 2009 (r187477)
+++ stable/7/sys/ufs/ufs/dirhash.h Tue Jan 20 19:01:59 2009 (r187478)
@@ -28,6 +28,9 @@
#ifndef _UFS_UFS_DIRHASH_H_
#define _UFS_UFS_DIRHASH_H_
+#include
+#include
+
/*
* For fast operations on large directories, we maintain a hash
* that maps the file name to the offset of the directory entry within
@@ -80,12 +83,14 @@
((dh)->dh_hash[(slot) >> DH_BLKOFFSHIFT][(slot) & DH_BLKOFFMASK])
struct dirhash {
- struct mtx dh_mtx; /* protects all fields except dh_list */
+ struct sx dh_lock; /* protects all fields except list & score */
+ int dh_refcount;
doff_t **dh_hash; /* the hash array (2-level) */
int dh_narrays; /* number of entries in dh_hash */
int dh_hlen; /* total slots in the 2-level hash array */
int dh_hused; /* entries in use */
+ int dh_memreq; /* Memory used. */
/* Free space statistics. XXX assumes DIRBLKSIZ is 512. */
u_int8_t *dh_blkfree; /* free DIRALIGN words in each dir block */
Modified: stable/7/sys/ufs/ufs/inode.h
==============================================================================
--- stable/7/sys/ufs/ufs/inode.h Tue Jan 20 18:16:31 2009 (r187477)
+++ stable/7/sys/ufs/ufs/inode.h Tue Jan 20 19:01:59 2009 (r187478)
@@ -82,8 +82,6 @@ struct inode {
doff_t i_endoff; /* End of useful stuff in directory. */
doff_t i_diroff; /* Offset in dir, where we found last entry. */
doff_t i_offset; /* Offset of free space in directory. */
- ino_t i_ino; /* Inode number of found directory. */
- u_int32_t i_reclen; /* Size of found directory entry. */
union {
struct dirhash *dirhash; /* Hashing for large directories. */
Modified: stable/7/sys/ufs/ufs/ufs_dirhash.c
==============================================================================
--- stable/7/sys/ufs/ufs/ufs_dirhash.c Tue Jan 20 18:16:31 2009 (r187477)
+++ stable/7/sys/ufs/ufs/ufs_dirhash.c Tue Jan 20 19:01:59 2009 (r187478)
@@ -46,7 +46,9 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
+#include
#include
#include
@@ -88,15 +90,16 @@ static int ufsdirhash_findslot(struct di
doff_t offset);
static doff_t ufsdirhash_getprev(struct direct *dp, doff_t offset);
static int ufsdirhash_recycle(int wanted);
+static void ufsdirhash_free_locked(struct inode *ip);
static uma_zone_t ufsdirhash_zone;
#define DIRHASHLIST_LOCK() mtx_lock(&ufsdirhash_mtx)
#define DIRHASHLIST_UNLOCK() mtx_unlock(&ufsdirhash_mtx)
-#define DIRHASH_LOCK(dh) mtx_lock(&(dh)->dh_mtx)
-#define DIRHASH_UNLOCK(dh) mtx_unlock(&(dh)->dh_mtx)
#define DIRHASH_BLKALLOC_WAITOK() uma_zalloc(ufsdirhash_zone, M_WAITOK)
#define DIRHASH_BLKFREE(ptr) uma_zfree(ufsdirhash_zone, (ptr))
+#define DIRHASH_ASSERT_LOCKED(dh) \
+ sx_assert(&(dh)->dh_lock, SA_LOCKED)
/* Dirhash list; recently-used entries are near the tail. */
static TAILQ_HEAD(, dirhash) ufsdirhash_list;
@@ -105,14 +108,199 @@ static TAILQ_HEAD(, dirhash) ufsdirhash_
static struct mtx ufsdirhash_mtx;
/*
- * Locking order:
- * ufsdirhash_mtx
- * dh_mtx
+ * Locking:
*
- * The dh_mtx mutex should be acquired either via the inode lock, or via
- * ufsdirhash_mtx. Only the owner of the inode may free the associated
- * dirhash, but anything can steal its memory and set dh_hash to NULL.
+ * The relationship between inode and dirhash is protected either by an
+ * exclusive vnode lock or the vnode interlock where a shared vnode lock
+ * may be used. The dirhash_mtx is acquired after the dirhash lock. To
+ * handle teardown races, code wishing to lock the dirhash for an inode
+ * when using a shared vnode lock must obtain a private reference on the
+ * dirhash while holding the vnode interlock. They can drop it once they
+ * have obtained the dirhash lock and verified that the dirhash wasn't
+ * recycled while they waited for the dirhash lock.
+ *
+ * ufsdirhash_build() acquires a shared lock on the dirhash when it is
+ * successful. This lock is released after a call to ufsdirhash_lookup().
+ *
+ * Functions requiring exclusive access use ufsdirhash_acquire() which may
+ * free a dirhash structure that was recycled by ufsdirhash_recycle().
+ *
+ * The dirhash lock may be held across io operations.
+ */
+
+static void
+ufsdirhash_hold(struct dirhash *dh)
+{
+
+ refcount_acquire(&dh->dh_refcount);
+}
+
+static void
+ufsdirhash_drop(struct dirhash *dh)
+{
+
+ if (refcount_release(&dh->dh_refcount)) {
+ sx_destroy(&dh->dh_lock);
+ free(dh, M_DIRHASH);
+ }
+}
+
+/*
+ * Release the lock on a dirhash.
+ */
+static void
+ufsdirhash_release(struct dirhash *dh)
+{
+
+ sx_unlock(&dh->dh_lock);
+}
+
+/*
+ * Either acquire an existing hash locked shared or create a new hash and
+ * return it exclusively locked. May return NULL if the allocation fails.
+ *
+ * The vnode interlock is used to protect the i_dirhash pointer from
+ * simultaneous access while only a shared vnode lock is held.
+ */
+static struct dirhash *
+ufsdirhash_create(struct inode *ip)
+{
+ struct dirhash *ndh;
+ struct dirhash *dh;
+ struct vnode *vp;
+ int error;
+
+ error = 0;
+ ndh = dh = NULL;
+ vp = ip->i_vnode;
+ for (;;) {
+ /* Racy check for i_dirhash to prefetch an dirhash structure. */
+ if (ip->i_dirhash == NULL && ndh == NULL) {
+ MALLOC(ndh, struct dirhash *, sizeof *dh, M_DIRHASH,
+ M_NOWAIT | M_ZERO);
+ if (ndh == NULL)
+ return (NULL);
+ refcount_init(&ndh->dh_refcount, 1);
+ sx_init(&ndh->dh_lock, "dirhash");
+ sx_xlock(&ndh->dh_lock);
+ }
+ /*
+ * Check i_dirhash. If it's NULL just try to use a
+ * preallocated structure. If none exists loop and try again.
+ */
+ VI_LOCK(vp);
+ dh = ip->i_dirhash;
+ if (dh == NULL) {
+ ip->i_dirhash = ndh;
+ VI_UNLOCK(vp);
+ if (ndh == NULL)
+ continue;
+ return (ndh);
+ }
+ ufsdirhash_hold(dh);
+ VI_UNLOCK(vp);
+
+ /* Acquire a shared lock on existing hashes. */
+ sx_slock(&dh->dh_lock);
+
+ /* The hash could've been recycled while we were waiting. */
+ VI_LOCK(vp);
+ if (ip->i_dirhash != dh) {
+ VI_UNLOCK(vp);
+ ufsdirhash_release(dh);
+ ufsdirhash_drop(dh);
+ continue;
+ }
+ VI_UNLOCK(vp);
+ ufsdirhash_drop(dh);
+
+ /* If the hash is still valid we've succeeded. */
+ if (dh->dh_hash != NULL)
+ break;
+ /*
+ * If the hash is NULL it has been recycled. Try to upgrade
+ * so we can recreate it. If we fail the upgrade, drop our
+ * lock and try again.
+ */
+ if (sx_try_upgrade(&dh->dh_lock))
+ break;
+ sx_sunlock(&dh->dh_lock);
+ }
+ /* Free the preallocated structure if it was not necessary. */
+ if (ndh) {
+ ufsdirhash_release(ndh);
+ ufsdirhash_drop(ndh);
+ }
+ return (dh);
+}
+
+/*
+ * Acquire an exclusive lock on an existing hash. Requires an exclusive
+ * vnode lock to protect the i_dirhash pointer. hashes that have been
+ * recycled are reclaimed here and NULL is returned.
+ */
+static struct dirhash *
+ufsdirhash_acquire(struct inode *ip)
+{
+ struct dirhash *dh;
+ struct vnode *vp;
+
+ ASSERT_VOP_ELOCKED(ip->i_vnode, __FUNCTION__);
+
+ vp = ip->i_vnode;
+ dh = ip->i_dirhash;
+ if (dh == NULL)
+ return (NULL);
+ sx_xlock(&dh->dh_lock);
+ if (dh->dh_hash != NULL)
+ return (dh);
+ ufsdirhash_free_locked(ip);
+ return (NULL);
+}
+
+/*
+ * Acquire exclusively and free the hash pointed to by ip. Works with a
+ * shared or exclusive vnode lock.
*/
+void
+ufsdirhash_free(struct inode *ip)
+{
+ struct dirhash *dh;
+ struct vnode *vp;
+
+ vp = ip->i_vnode;
+ for (;;) {
+ /* Grab a reference on this inode's dirhash if it has one. */
+ VI_LOCK(vp);
+ dh = ip->i_dirhash;
+ if (dh == NULL) {
+ VI_UNLOCK(vp);
+ return;
+ }
+ ufsdirhash_hold(dh);
+ VI_UNLOCK(vp);
+
+ /* Exclusively lock the dirhash. */
+ sx_xlock(&dh->dh_lock);
+
+ /* If this dirhash still belongs to this inode, then free it. */
+ VI_LOCK(vp);
+ if (ip->i_dirhash == dh) {
+ VI_UNLOCK(vp);
+ ufsdirhash_drop(dh);
+ break;
+ }
+ VI_UNLOCK(vp);
+
+ /*
+ * This inode's dirhash has changed while we were
+ * waiting for the dirhash lock, so try again.
+ */
+ ufsdirhash_release(dh);
+ ufsdirhash_drop(dh);
+ }
+ ufsdirhash_free_locked(ip);
+}
/*
* Attempt to build up a hash table for the directory contents in
@@ -128,27 +316,23 @@ ufsdirhash_build(struct inode *ip)
doff_t bmask, pos;
int dirblocks, i, j, memreqd, nblocks, narrays, nslots, slot;
- /* Check if we can/should use dirhash. */
- if (ip->i_dirhash == NULL) {
- if (ip->i_size < ufs_mindirhashsize || OFSFMT(ip->i_vnode))
+ /* Take care of a decreased sysctl value. */
+ while (ufs_dirhashmem > ufs_dirhashmaxmem)
+ if (ufsdirhash_recycle(0) != 0)
return (-1);
- } else {
- /* Hash exists, but sysctls could have changed. */
- if (ip->i_size < ufs_mindirhashsize ||
- ufs_dirhashmem > ufs_dirhashmaxmem) {
+
+ /* Check if we can/should use dirhash. */
+ if (ip->i_size < ufs_mindirhashsize || OFSFMT(ip->i_vnode) ||
+ ip->i_effnlink == 0) {
+ if (ip->i_dirhash)
ufsdirhash_free(ip);
- return (-1);
- }
- /* Check if hash exists and is intact (note: unlocked read). */
- if (ip->i_dirhash->dh_hash != NULL)
- return (0);
- /* Free the old, recycled hash and build a new one. */
- ufsdirhash_free(ip);
+ return (-1);
}
-
- /* Don't hash removed directories. */
- if (ip->i_effnlink == 0)
+ dh = ufsdirhash_create(ip);
+ if (dh == NULL)
return (-1);
+ if (dh->dh_hash != NULL)
+ return (0);
vp = ip->i_vnode;
/* Allocate 50% more entries than this dir size could ever need. */
@@ -159,7 +343,6 @@ ufsdirhash_build(struct inode *ip)
nslots = narrays * DH_NBLKOFF;
dirblocks = howmany(ip->i_size, DIRBLKSIZ);
nblocks = (dirblocks * 3 + 1) / 2;
-
memreqd = sizeof(*dh) + narrays * sizeof(*dh->dh_hash) +
narrays * DH_NBLKOFF * sizeof(**dh->dh_hash) +
nblocks * sizeof(*dh->dh_blkfree);
@@ -167,33 +350,40 @@ ufsdirhash_build(struct inode *ip)
if (memreqd + ufs_dirhashmem > ufs_dirhashmaxmem) {
DIRHASHLIST_UNLOCK();
if (memreqd > ufs_dirhashmaxmem / 2)
- return (-1);
-
+ goto fail;
/* Try to free some space. */
if (ufsdirhash_recycle(memreqd) != 0)
- return (-1);
+ goto fail;
/* Enough was freed, and list has been locked. */
}
ufs_dirhashmem += memreqd;
DIRHASHLIST_UNLOCK();
+ /* Initialise the hash table and block statistics. */
+ dh->dh_memreq = memreqd;
+ dh->dh_narrays = narrays;
+ dh->dh_hlen = nslots;
+ dh->dh_nblk = nblocks;
+ dh->dh_dirblks = dirblocks;
+ for (i = 0; i < DH_NFSTATS; i++)
+ dh->dh_firstfree[i] = -1;
+ dh->dh_firstfree[DH_NFSTATS] = 0;
+ dh->dh_hused = 0;
+ dh->dh_seqopt = 0;
+ dh->dh_seqoff = 0;
+ dh->dh_score = DH_SCOREINIT;
+
/*
* Use non-blocking mallocs so that we will revert to a linear
* lookup on failure rather than potentially blocking forever.
*/
- MALLOC(dh, struct dirhash *, sizeof *dh, M_DIRHASH, M_NOWAIT | M_ZERO);
- if (dh == NULL) {
- DIRHASHLIST_LOCK();
- ufs_dirhashmem -= memreqd;
- DIRHASHLIST_UNLOCK();
- return (-1);
- }
- mtx_init(&dh->dh_mtx, "dirhash", NULL, MTX_DEF);
MALLOC(dh->dh_hash, doff_t **, narrays * sizeof(dh->dh_hash[0]),
M_DIRHASH, M_NOWAIT | M_ZERO);
+ if (dh->dh_hash == NULL)
+ goto fail;
MALLOC(dh->dh_blkfree, u_int8_t *, nblocks * sizeof(dh->dh_blkfree[0]),
M_DIRHASH, M_NOWAIT);
- if (dh->dh_hash == NULL || dh->dh_blkfree == NULL)
+ if (dh->dh_blkfree == NULL)
goto fail;
for (i = 0; i < narrays; i++) {
if ((dh->dh_hash[i] = DIRHASH_BLKALLOC_WAITOK()) == NULL)
@@ -201,22 +391,8 @@ ufsdirhash_build(struct inode *ip)
for (j = 0; j < DH_NBLKOFF; j++)
dh->dh_hash[i][j] = DIRHASH_EMPTY;
}
-
- /* Initialise the hash table and block statistics. */
- dh->dh_narrays = narrays;
- dh->dh_hlen = nslots;
- dh->dh_nblk = nblocks;
- dh->dh_dirblks = dirblocks;
for (i = 0; i < dirblocks; i++)
dh->dh_blkfree[i] = DIRBLKSIZ / DIRALIGN;
- for (i = 0; i < DH_NFSTATS; i++)
- dh->dh_firstfree[i] = -1;
- dh->dh_firstfree[DH_NFSTATS] = 0;
- dh->dh_seqopt = 0;
- dh->dh_seqoff = 0;
- dh->dh_score = DH_SCOREINIT;
- ip->i_dirhash = dh;
-
bmask = VFSTOUFS(vp->v_mount)->um_mountp->mnt_stat.f_iosize - 1;
pos = 0;
while (pos < ip->i_size) {
@@ -254,63 +430,70 @@ ufsdirhash_build(struct inode *ip)
TAILQ_INSERT_TAIL(&ufsdirhash_list, dh, dh_list);
dh->dh_onlist = 1;
DIRHASHLIST_UNLOCK();
+ sx_downgrade(&dh->dh_lock);
return (0);
fail:
- if (dh->dh_hash != NULL) {
- for (i = 0; i < narrays; i++)
- if (dh->dh_hash[i] != NULL)
- DIRHASH_BLKFREE(dh->dh_hash[i]);
- FREE(dh->dh_hash, M_DIRHASH);
- }
- if (dh->dh_blkfree != NULL)
- FREE(dh->dh_blkfree, M_DIRHASH);
- mtx_destroy(&dh->dh_mtx);
- FREE(dh, M_DIRHASH);
- ip->i_dirhash = NULL;
- DIRHASHLIST_LOCK();
- ufs_dirhashmem -= memreqd;
- DIRHASHLIST_UNLOCK();
+ ufsdirhash_free_locked(ip);
return (-1);
}
/*
* Free any hash table associated with inode 'ip'.
*/
-void
-ufsdirhash_free(struct inode *ip)
+static void
+ufsdirhash_free_locked(struct inode *ip)
{
struct dirhash *dh;
- int i, mem;
+ struct vnode *vp;
+ int i;
- if ((dh = ip->i_dirhash) == NULL)
- return;
+ DIRHASH_ASSERT_LOCKED(ip->i_dirhash);
+
+ /*
+ * Clear the pointer in the inode to prevent new threads from
+ * finding the dead structure.
+ */
+ vp = ip->i_vnode;
+ VI_LOCK(vp);
+ dh = ip->i_dirhash;
+ ip->i_dirhash = NULL;
+ VI_UNLOCK(vp);
+
+ /*
+ * Remove the hash from the list since we are going to free its
+ * memory.
+ */
DIRHASHLIST_LOCK();
- DIRHASH_LOCK(dh);
if (dh->dh_onlist)
TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list);
- DIRHASH_UNLOCK(dh);
+ ufs_dirhashmem -= dh->dh_memreq;
DIRHASHLIST_UNLOCK();
- /* The dirhash pointed to by 'dh' is exclusively ours now. */
+ /*
+ * At this point, any waiters for the lock should hold their
+ * own reference on the dirhash structure. They will drop
+ * that reference once they grab the vnode interlock and see
+ * that ip->i_dirhash is NULL.
+ */
+ sx_xunlock(&dh->dh_lock);
- mem = sizeof(*dh);
+ /*
+ * Handle partially recycled as well as fully constructed hashes.
+ */
if (dh->dh_hash != NULL) {
for (i = 0; i < dh->dh_narrays; i++)
- DIRHASH_BLKFREE(dh->dh_hash[i]);
+ if (dh->dh_hash[i] != NULL)
+ DIRHASH_BLKFREE(dh->dh_hash[i]);
FREE(dh->dh_hash, M_DIRHASH);
- FREE(dh->dh_blkfree, M_DIRHASH);
- mem += dh->dh_narrays * sizeof(*dh->dh_hash) +
- dh->dh_narrays * DH_NBLKOFF * sizeof(**dh->dh_hash) +
- dh->dh_nblk * sizeof(*dh->dh_blkfree);
+ if (dh->dh_blkfree != NULL)
+ FREE(dh->dh_blkfree, M_DIRHASH);
}
- mtx_destroy(&dh->dh_mtx);
- FREE(dh, M_DIRHASH);
- ip->i_dirhash = NULL;
- DIRHASHLIST_LOCK();
- ufs_dirhashmem -= mem;
- DIRHASHLIST_UNLOCK();
+ /*
+ * Drop the inode's reference to the data structure.
+ */
+ ufsdirhash_drop(dh);
}
/*
@@ -323,6 +506,8 @@ ufsdirhash_free(struct inode *ip)
* prevoffp is non-NULL, the offset of the previous entry within
* the DIRBLKSIZ-sized block is stored in *prevoffp (if the entry
* is the first in a block, the start of the block is used).
+ *
+ * Must be called with the hash locked. Returns with the hash unlocked.
*/
int
ufsdirhash_lookup(struct inode *ip, char *name, int namelen, doff_t *offp,
@@ -334,48 +519,36 @@ ufsdirhash_lookup(struct inode *ip, char
struct buf *bp;
doff_t blkoff, bmask, offset, prevoff;
int i, slot;
+ int error;
- if ((dh = ip->i_dirhash) == NULL)
- return (EJUSTRETURN);
+ dh = ip->i_dirhash;
+ KASSERT(dh != NULL && dh->dh_hash != NULL,
+ ("ufsdirhash_lookup: Invalid dirhash %p\n", dh));
+ DIRHASH_ASSERT_LOCKED(dh);
/*
* Move this dirhash towards the end of the list if it has a
- * score higher than the next entry, and acquire the dh_mtx.
- * Optimise the case where it's already the last by performing
- * an unlocked read of the TAILQ_NEXT pointer.
- *
- * In both cases, end up holding just dh_mtx.
+ * score higher than the next entry, and acquire the dh_lock.
*/
+ DIRHASHLIST_LOCK();
if (TAILQ_NEXT(dh, dh_list) != NULL) {
- DIRHASHLIST_LOCK();
- DIRHASH_LOCK(dh);
/*
* If the new score will be greater than that of the next
* entry, then move this entry past it. With both mutexes
* held, dh_next won't go away, but its dh_score could
* change; that's not important since it is just a hint.
*/
- if (dh->dh_hash != NULL &&
- (dh_next = TAILQ_NEXT(dh, dh_list)) != NULL &&
+ if ((dh_next = TAILQ_NEXT(dh, dh_list)) != NULL &&
dh->dh_score >= dh_next->dh_score) {
KASSERT(dh->dh_onlist, ("dirhash: not on list"));
TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list);
TAILQ_INSERT_AFTER(&ufsdirhash_list, dh_next, dh,
dh_list);
}
- DIRHASHLIST_UNLOCK();
- } else {
- /* Already the last, though that could change as we wait. */
- DIRHASH_LOCK(dh);
- }
- if (dh->dh_hash == NULL) {
- DIRHASH_UNLOCK(dh);
- ufsdirhash_free(ip);
- return (EJUSTRETURN);
}
-
/* Update the score. */
if (dh->dh_score < DH_SCOREMAX)
dh->dh_score++;
+ DIRHASHLIST_UNLOCK();
vp = ip->i_vnode;
bmask = VFSTOUFS(vp->v_mount)->um_mountp->mnt_stat.f_iosize - 1;
@@ -410,23 +583,23 @@ restart:
slot = WRAPINCR(slot, dh->dh_hlen)) {
if (offset == DIRHASH_DEL)
continue;
- DIRHASH_UNLOCK(dh);
-
if (offset < 0 || offset >= ip->i_size)
panic("ufsdirhash_lookup: bad offset in hash array");
if ((offset & ~bmask) != blkoff) {
if (bp != NULL)
brelse(bp);
blkoff = offset & ~bmask;
- if (UFS_BLKATOFF(vp, (off_t)blkoff, NULL, &bp) != 0)
- return (EJUSTRETURN);
+ if (UFS_BLKATOFF(vp, (off_t)blkoff, NULL, &bp) != 0) {
+ error = EJUSTRETURN;
+ goto fail;
+ }
}
dp = (struct direct *)(bp->b_data + (offset & bmask));
if (dp->d_reclen == 0 || dp->d_reclen >
DIRBLKSIZ - (offset & (DIRBLKSIZ - 1))) {
/* Corrupted directory. */
- brelse(bp);
- return (EJUSTRETURN);
+ error = EJUSTRETURN;
+ goto fail;
}
if (dp->d_namlen == namelen &&
bcmp(dp->d_name, name, namelen) == 0) {
@@ -436,8 +609,8 @@ restart:
prevoff = ufsdirhash_getprev(dp,
offset);
if (prevoff == -1) {
- brelse(bp);
- return (EJUSTRETURN);
+ error = EJUSTRETURN;
+ goto fail;
}
} else
prevoff = offset;
@@ -448,20 +621,12 @@ restart:
if (dh->dh_seqopt == 0 && dh->dh_seqoff == offset)
dh->dh_seqopt = 1;
dh->dh_seqoff = offset + DIRSIZ(0, dp);
-
*bpp = bp;
*offp = offset;
+ ufsdirhash_release(dh);
return (0);
}
- DIRHASH_LOCK(dh);
- if (dh->dh_hash == NULL) {
- DIRHASH_UNLOCK(dh);
- if (bp != NULL)
- brelse(bp);
- ufsdirhash_free(ip);
- return (EJUSTRETURN);
- }
/*
* When the name doesn't match in the seqopt case, go back
* and search normally.
@@ -471,10 +636,12 @@ restart:
goto restart;
}
}
- DIRHASH_UNLOCK(dh);
+ error = ENOENT;
+fail:
+ ufsdirhash_release(dh);
if (bp != NULL)
brelse(bp);
- return (ENOENT);
+ return (error);
}
/*
@@ -502,29 +669,22 @@ ufsdirhash_findfree(struct inode *ip, in
doff_t pos, slotstart;
int dirblock, error, freebytes, i;
- if ((dh = ip->i_dirhash) == NULL)
- return (-1);
- DIRHASH_LOCK(dh);
- if (dh->dh_hash == NULL) {
- DIRHASH_UNLOCK(dh);
- ufsdirhash_free(ip);
- return (-1);
- }
+ dh = ip->i_dirhash;
+ KASSERT(dh != NULL && dh->dh_hash != NULL,
+ ("ufsdirhash_findfree: Invalid dirhash %p\n", dh));
+ DIRHASH_ASSERT_LOCKED(dh);
/* Find a directory block with the desired free space. */
dirblock = -1;
for (i = howmany(slotneeded, DIRALIGN); i <= DH_NFSTATS; i++)
if ((dirblock = dh->dh_firstfree[i]) != -1)
break;
- if (dirblock == -1) {
- DIRHASH_UNLOCK(dh);
+ if (dirblock == -1)
return (-1);
- }
KASSERT(dirblock < dh->dh_nblk &&
dh->dh_blkfree[dirblock] >= howmany(slotneeded, DIRALIGN),
("ufsdirhash_findfree: bad stats"));
- DIRHASH_UNLOCK(dh);
pos = dirblock * DIRBLKSIZ;
error = UFS_BLKATOFF(ip->i_vnode, (off_t)pos, (char **)&dp, &bp);
if (error)
@@ -582,24 +742,18 @@ ufsdirhash_enduseful(struct inode *ip)
struct dirhash *dh;
int i;
- if ((dh = ip->i_dirhash) == NULL)
- return (-1);
- DIRHASH_LOCK(dh);
- if (dh->dh_hash == NULL) {
- DIRHASH_UNLOCK(dh);
- ufsdirhash_free(ip);
- return (-1);
- }
+ dh = ip->i_dirhash;
+ DIRHASH_ASSERT_LOCKED(dh);
+ KASSERT(dh != NULL && dh->dh_hash != NULL,
+ ("ufsdirhash_enduseful: Invalid dirhash %p\n", dh));
- if (dh->dh_blkfree[dh->dh_dirblks - 1] != DIRBLKSIZ / DIRALIGN) {
- DIRHASH_UNLOCK(dh);
+ if (dh->dh_blkfree[dh->dh_dirblks - 1] != DIRBLKSIZ / DIRALIGN)
return (-1);
- }
for (i = dh->dh_dirblks - 1; i >= 0; i--)
if (dh->dh_blkfree[i] != DIRBLKSIZ / DIRALIGN)
break;
- DIRHASH_UNLOCK(dh);
+
return ((doff_t)(i + 1) * DIRBLKSIZ);
}
@@ -614,15 +768,9 @@ ufsdirhash_add(struct inode *ip, struct
struct dirhash *dh;
int slot;
- if ((dh = ip->i_dirhash) == NULL)
+ if ((dh = ufsdirhash_acquire(ip)) == NULL)
return;
- DIRHASH_LOCK(dh);
- if (dh->dh_hash == NULL) {
- DIRHASH_UNLOCK(dh);
- ufsdirhash_free(ip);
- return;
- }
-
+
KASSERT(offset < dh->dh_dirblks * DIRBLKSIZ,
("ufsdirhash_add: bad offset"));
/*
@@ -630,8 +778,7 @@ ufsdirhash_add(struct inode *ip, struct
* remove the hash entirely and let it be rebuilt later.
*/
if (dh->dh_hused >= (dh->dh_hlen * 3) / 4) {
- DIRHASH_UNLOCK(dh);
- ufsdirhash_free(ip);
+ ufsdirhash_free_locked(ip);
return;
}
@@ -645,7 +792,7 @@ ufsdirhash_add(struct inode *ip, struct
/* Update the per-block summary info. */
ufsdirhash_adjfree(dh, offset, -DIRSIZ(0, dirp));
- DIRHASH_UNLOCK(dh);
+ ufsdirhash_release(dh);
}
/*
@@ -659,14 +806,8 @@ ufsdirhash_remove(struct inode *ip, stru
struct dirhash *dh;
int slot;
- if ((dh = ip->i_dirhash) == NULL)
- return;
- DIRHASH_LOCK(dh);
- if (dh->dh_hash == NULL) {
- DIRHASH_UNLOCK(dh);
- ufsdirhash_free(ip);
+ if ((dh = ufsdirhash_acquire(ip)) == NULL)
return;
- }
KASSERT(offset < dh->dh_dirblks * DIRBLKSIZ,
("ufsdirhash_remove: bad offset"));
@@ -678,7 +819,7 @@ ufsdirhash_remove(struct inode *ip, stru
/* Update the per-block summary info. */
ufsdirhash_adjfree(dh, offset, DIRSIZ(0, dirp));
- DIRHASH_UNLOCK(dh);
+ ufsdirhash_release(dh);
}
/*
@@ -692,14 +833,8 @@ ufsdirhash_move(struct inode *ip, struct
struct dirhash *dh;
int slot;
- if ((dh = ip->i_dirhash) == NULL)
+ if ((dh = ufsdirhash_acquire(ip)) == NULL)
return;
- DIRHASH_LOCK(dh);
- if (dh->dh_hash == NULL) {
- DIRHASH_UNLOCK(dh);
- ufsdirhash_free(ip);
- return;
- }
KASSERT(oldoff < dh->dh_dirblks * DIRBLKSIZ &&
newoff < dh->dh_dirblks * DIRBLKSIZ,
@@ -707,7 +842,7 @@ ufsdirhash_move(struct inode *ip, struct
/* Find the entry, and update the offset. */
slot = ufsdirhash_findslot(dh, dirp->d_name, dirp->d_namlen, oldoff);
DH_ENTRY(dh, slot) = newoff;
- DIRHASH_UNLOCK(dh);
+ ufsdirhash_release(dh);
}
/*
@@ -720,22 +855,15 @@ ufsdirhash_newblk(struct inode *ip, doff
struct dirhash *dh;
int block;
- if ((dh = ip->i_dirhash) == NULL)
- return;
- DIRHASH_LOCK(dh);
- if (dh->dh_hash == NULL) {
- DIRHASH_UNLOCK(dh);
- ufsdirhash_free(ip);
+ if ((dh = ufsdirhash_acquire(ip)) == NULL)
return;
- }
KASSERT(offset == dh->dh_dirblks * DIRBLKSIZ,
("ufsdirhash_newblk: bad offset"));
block = offset / DIRBLKSIZ;
if (block >= dh->dh_nblk) {
/* Out of space; must rebuild. */
- DIRHASH_UNLOCK(dh);
- ufsdirhash_free(ip);
+ ufsdirhash_free_locked(ip);
return;
}
dh->dh_dirblks = block + 1;
@@ -744,7 +872,7 @@ ufsdirhash_newblk(struct inode *ip, doff
dh->dh_blkfree[block] = DIRBLKSIZ / DIRALIGN;
if (dh->dh_firstfree[DH_NFSTATS] == -1)
dh->dh_firstfree[DH_NFSTATS] = block;
- DIRHASH_UNLOCK(dh);
+ ufsdirhash_release(dh);
}
/*
@@ -756,14 +884,8 @@ ufsdirhash_dirtrunc(struct inode *ip, do
struct dirhash *dh;
int block, i;
- if ((dh = ip->i_dirhash) == NULL)
- return;
- DIRHASH_LOCK(dh);
- if (dh->dh_hash == NULL) {
- DIRHASH_UNLOCK(dh);
- ufsdirhash_free(ip);
+ if ((dh = ufsdirhash_acquire(ip)) == NULL)
return;
- }
KASSERT(offset <= dh->dh_dirblks * DIRBLKSIZ,
("ufsdirhash_dirtrunc: bad offset"));
@@ -775,8 +897,7 @@ ufsdirhash_dirtrunc(struct inode *ip, do
* if necessary.
*/
if (block < dh->dh_nblk / 8 && dh->dh_narrays > 1) {
- DIRHASH_UNLOCK(dh);
- ufsdirhash_free(ip);
+ ufsdirhash_free_locked(ip);
return;
}
@@ -794,7 +915,7 @@ ufsdirhash_dirtrunc(struct inode *ip, do
if (dh->dh_firstfree[i] >= block)
panic("ufsdirhash_dirtrunc: first free corrupt");
dh->dh_dirblks = block;
- DIRHASH_UNLOCK(dh);
+ ufsdirhash_release(dh);
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From jhb at FreeBSD.org Tue Jan 20 11:41:24 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Tue Jan 20 11:41:41 2009
Subject: svn commit: r187480 - in stable/7/sys: . amd64/amd64 amd64/include
contrib/pf dev/ath/ath_hal dev/cxgb i386/i386 i386/include
Message-ID: <200901201941.n0KJfJUc054766@svn.freebsd.org>
Author: jhb
Date: Tue Jan 20 19:41:18 2009
New Revision: 187480
URL: http://svn.freebsd.org/changeset/base/187480
Log:
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'.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/pmap.c
stable/7/sys/amd64/include/pmap.h
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/i386/i386/pmap.c
stable/7/sys/i386/include/pmap.h
Modified: stable/7/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/7/sys/amd64/amd64/pmap.c Tue Jan 20 19:06:10 2009 (r187479)
+++ stable/7/sys/amd64/amd64/pmap.c Tue Jan 20 19:41:18 2009 (r187480)
@@ -601,7 +601,6 @@ pmap_page_init(vm_page_t m)
{
TAILQ_INIT(&m->md.pv_list);
- m->md.pv_list_count = 0;
}
/*
@@ -1694,7 +1693,6 @@ pmap_collect(pmap_t locked_pmap, struct
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
if (TAILQ_EMPTY(&m->md.pv_list))
vm_page_flag_clear(m, PG_WRITEABLE);
- m->md.pv_list_count--;
free_pv_entry(pmap, pv);
if (pmap != locked_pmap)
PMAP_UNLOCK(pmap);
@@ -1842,7 +1840,6 @@ pmap_remove_entry(pmap_t pmap, vm_page_t
}
KASSERT(pv != NULL, ("pmap_remove_entry: pv not found"));
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
- m->md.pv_list_count--;
if (TAILQ_EMPTY(&m->md.pv_list))
vm_page_flag_clear(m, PG_WRITEABLE);
free_pv_entry(pmap, pv);
@@ -1862,7 +1859,6 @@ pmap_insert_entry(pmap_t pmap, vm_offset
pv = get_pv_entry(pmap, FALSE);
pv->pv_va = va;
TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
- m->md.pv_list_count++;
}
/*
@@ -1879,7 +1875,6 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm
(pv = get_pv_entry(pmap, TRUE)) != NULL) {
pv->pv_va = va;
TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
- m->md.pv_list_count++;
return (TRUE);
} else
return (FALSE);
@@ -2119,7 +2114,6 @@ pmap_remove_all(vm_page_t m)
pmap_invalidate_page(pmap, pv->pv_va);
pmap_free_zero_pages(free);
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
- m->md.pv_list_count--;
free_pv_entry(pmap, pv);
PMAP_UNLOCK(pmap);
}
@@ -3029,7 +3023,6 @@ pmap_remove_pages(pmap_t pmap)
PV_STAT(pv_entry_spare++);
pv_entry_count--;
pc->pc_map[field] |= bitmask;
- m->md.pv_list_count--;
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
if (TAILQ_EMPTY(&m->md.pv_list))
vm_page_flag_clear(m, PG_WRITEABLE);
Modified: stable/7/sys/amd64/include/pmap.h
==============================================================================
--- stable/7/sys/amd64/include/pmap.h Tue Jan 20 19:06:10 2009 (r187479)
+++ stable/7/sys/amd64/include/pmap.h Tue Jan 20 19:41:18 2009 (r187480)
@@ -229,7 +229,7 @@ struct pv_entry;
struct pv_chunk;
struct md_page {
- int pv_list_count;
+ int pv_unused;
TAILQ_HEAD(,pv_entry) pv_list;
};
Modified: stable/7/sys/i386/i386/pmap.c
==============================================================================
--- stable/7/sys/i386/i386/pmap.c Tue Jan 20 19:06:10 2009 (r187479)
+++ stable/7/sys/i386/i386/pmap.c Tue Jan 20 19:41:18 2009 (r187480)
@@ -525,7 +525,6 @@ pmap_page_init(vm_page_t m)
{
TAILQ_INIT(&m->md.pv_list);
- m->md.pv_list_count = 0;
}
#ifdef PAE
@@ -1763,7 +1762,6 @@ pmap_collect(pmap_t locked_pmap, struct
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
if (TAILQ_EMPTY(&m->md.pv_list))
vm_page_flag_clear(m, PG_WRITEABLE);
- m->md.pv_list_count--;
free_pv_entry(pmap, pv);
if (pmap != locked_pmap)
PMAP_UNLOCK(pmap);
@@ -1918,7 +1916,6 @@ pmap_remove_entry(pmap_t pmap, vm_page_t
}
KASSERT(pv != NULL, ("pmap_remove_entry: pv not found"));
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
- m->md.pv_list_count--;
if (TAILQ_EMPTY(&m->md.pv_list))
vm_page_flag_clear(m, PG_WRITEABLE);
free_pv_entry(pmap, pv);
@@ -1938,7 +1935,6 @@ pmap_insert_entry(pmap_t pmap, vm_offset
pv = get_pv_entry(pmap, FALSE);
pv->pv_va = va;
TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
- m->md.pv_list_count++;
}
/*
@@ -1955,7 +1951,6 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm
(pv = get_pv_entry(pmap, TRUE)) != NULL) {
pv->pv_va = va;
TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
- m->md.pv_list_count++;
return (TRUE);
} else
return (FALSE);
@@ -2173,7 +2168,6 @@ pmap_remove_all(vm_page_t m)
pmap_invalidate_page(pmap, pv->pv_va);
pmap_free_zero_pages(free);
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
- m->md.pv_list_count--;
free_pv_entry(pmap, pv);
PMAP_UNLOCK(pmap);
}
@@ -3114,7 +3108,6 @@ pmap_remove_pages(pmap_t pmap)
PV_STAT(pv_entry_spare++);
pv_entry_count--;
pc->pc_map[field] |= bitmask;
- m->md.pv_list_count--;
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
if (TAILQ_EMPTY(&m->md.pv_list))
vm_page_flag_clear(m, PG_WRITEABLE);
Modified: stable/7/sys/i386/include/pmap.h
==============================================================================
--- stable/7/sys/i386/include/pmap.h Tue Jan 20 19:06:10 2009 (r187479)
+++ stable/7/sys/i386/include/pmap.h Tue Jan 20 19:41:18 2009 (r187480)
@@ -316,7 +316,7 @@ struct pv_entry;
struct pv_chunk;
struct md_page {
- int pv_list_count;
+ int pv_unused;
TAILQ_HEAD(,pv_entry) pv_list;
};
From jhb at freebsd.org Tue Jan 20 11:44:06 2009
From: jhb at freebsd.org (John Baldwin)
Date: Tue Jan 20 11:44:15 2009
Subject: svn commit: r187401 - stable/7/sys/dev/ata
In-Reply-To: <200901181850.n0IIoIIV083424@svn.freebsd.org>
References: <200901181850.n0IIoIIV083424@svn.freebsd.org>
Message-ID: <200901201248.47688.jhb@freebsd.org>
On Sunday 18 January 2009 1:50:18 pm Nick Hibma wrote:
> Author: n_hibma
> Date: Sun Jan 18 18:50:18 2009
> New Revision: 187401
> URL: http://svn.freebsd.org/changeset/base/187401
>
> Log:
> Speling mistake.
>
> Modified:
> stable/7/sys/dev/ata/ata-all.c
>
> Modified: stable/7/sys/dev/ata/ata-all.c
>
==============================================================================
> --- stable/7/sys/dev/ata/ata-all.c Sun Jan 18 18:26:52 2009 (r187400)
> +++ stable/7/sys/dev/ata/ata-all.c Sun Jan 18 18:50:18 2009 (r187401)
> @@ -127,7 +127,7 @@ ata_attach(device_t dev)
>
> /* reset the controller HW, the channel and device(s) */
> while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch->unit)
> - pause("ataatch", 1);
> + pause("attach", 1);
> ATA_RESET(dev);
> ATA_LOCKING(dev, ATA_LF_UNLOCK);
Actually, I suspect this was on purpose and was short for "ata attach".
--
John Baldwin
From n_hibma at FreeBSD.org Tue Jan 20 12:32:49 2009
From: n_hibma at FreeBSD.org (Nick Hibma)
Date: Tue Jan 20 12:32:58 2009
Subject: svn commit: r187484 - stable/7/sys/dev/ata
Message-ID: <200901202032.n0KKWmVZ055926@svn.freebsd.org>
Author: n_hibma
Date: Tue Jan 20 20:32:48 2009
New Revision: 187484
URL: http://svn.freebsd.org/changeset/base/187484
Log:
revert my previous commit. It was in error. I got primed by a few other
similar typos in man-pages.
Submitted by: jhb
Modified:
stable/7/sys/dev/ata/ata-all.c
Modified: stable/7/sys/dev/ata/ata-all.c
==============================================================================
--- stable/7/sys/dev/ata/ata-all.c Tue Jan 20 20:22:28 2009 (r187483)
+++ stable/7/sys/dev/ata/ata-all.c Tue Jan 20 20:32:48 2009 (r187484)
@@ -127,7 +127,7 @@ ata_attach(device_t dev)
/* reset the controller HW, the channel and device(s) */
while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch->unit)
- pause("attach", 1);
+ pause("atatch", 1);
ATA_RESET(dev);
ATA_LOCKING(dev, ATA_LF_UNLOCK);
From alc at FreeBSD.org Tue Jan 20 12:41:43 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Tue Jan 20 12:42:00 2009
Subject: svn commit: r187485 - in stable/7/sys: . amd64/amd64 contrib/pf
dev/ath/ath_hal dev/cxgb i386/i386
Message-ID: <200901202041.n0KKffnr056112@svn.freebsd.org>
Author: alc
Date: Tue Jan 20 20:41:41 2009
New Revision: 187485
URL: http://svn.freebsd.org/changeset/base/187485
Log:
MFC rev 180600
Simplify pmap_extract()'s control flow, making it more like the related
functions pmap_extract_and_hold() and pmap_kextract().
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/pmap.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/i386/i386/pmap.c
Modified: stable/7/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/7/sys/amd64/amd64/pmap.c Tue Jan 20 20:32:48 2009 (r187484)
+++ stable/7/sys/amd64/amd64/pmap.c Tue Jan 20 20:41:41 2009 (r187485)
@@ -901,13 +901,12 @@ pmap_extract(pmap_t pmap, vm_offset_t va
if (pdep != NULL) {
pde = *pdep;
if (pde) {
- if ((pde & PG_PS) != 0) {
+ if ((pde & PG_PS) != 0)
rtval = (pde & PG_PS_FRAME) | (va & PDRMASK);
- PMAP_UNLOCK(pmap);
- return rtval;
+ else {
+ pte = pmap_pde_to_pte(pdep, va);
+ rtval = (*pte & PG_FRAME) | (va & PAGE_MASK);
}
- pte = pmap_pde_to_pte(pdep, va);
- rtval = (*pte & PG_FRAME) | (va & PAGE_MASK);
}
}
PMAP_UNLOCK(pmap);
Modified: stable/7/sys/i386/i386/pmap.c
==============================================================================
--- stable/7/sys/i386/i386/pmap.c Tue Jan 20 20:32:48 2009 (r187484)
+++ stable/7/sys/i386/i386/pmap.c Tue Jan 20 20:41:41 2009 (r187485)
@@ -981,14 +981,13 @@ pmap_extract(pmap_t pmap, vm_offset_t va
PMAP_LOCK(pmap);
pde = pmap->pm_pdir[va >> PDRSHIFT];
if (pde != 0) {
- if ((pde & PG_PS) != 0) {
+ if ((pde & PG_PS) != 0)
rtval = (pde & PG_PS_FRAME) | (va & PDRMASK);
- PMAP_UNLOCK(pmap);
- return rtval;
+ else {
+ pte = pmap_pte(pmap, va);
+ rtval = (*pte & PG_FRAME) | (va & PAGE_MASK);
+ pmap_pte_release(pte);
}
- pte = pmap_pte(pmap, va);
- rtval = (*pte & PG_FRAME) | (va & PAGE_MASK);
- pmap_pte_release(pte);
}
PMAP_UNLOCK(pmap);
return (rtval);
From emaste at FreeBSD.org Tue Jan 20 14:34:39 2009
From: emaste at FreeBSD.org (Ed Maste)
Date: Tue Jan 20 14:34:51 2009
Subject: svn commit: r187496 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb vm
Message-ID: <200901202234.n0KMYclD058827@svn.freebsd.org>
Author: emaste
Date: Tue Jan 20 22:34:38 2009
New Revision: 187496
URL: http://svn.freebsd.org/changeset/base/187496
Log:
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
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/vm/redzone.c
Modified: stable/7/sys/vm/redzone.c
==============================================================================
--- stable/7/sys/vm/redzone.c Tue Jan 20 22:26:09 2009 (r187495)
+++ stable/7/sys/vm/redzone.c Tue Jan 20 22:34:38 2009 (r187496)
@@ -54,6 +54,8 @@ static u_long
redzone_roundup(u_long n)
{
+ if (n < REDZONE_HSIZE)
+ n = REDZONE_HSIZE;
if (n <= 128)
return (128);
else if (n <= 256)
From delphij at FreeBSD.org Tue Jan 20 14:37:57 2009
From: delphij at FreeBSD.org (Xin LI)
Date: Tue Jan 20 14:38:14 2009
Subject: svn commit: r187497 - stable/7/lib/libstand
Message-ID: <200901202237.n0KMbuNf058960@svn.freebsd.org>
Author: delphij
Date: Tue Jan 20 22:37:56 2009
New Revision: 187497
URL: http://svn.freebsd.org/changeset/base/187497
Log:
MFC r185037:
Obey signedness flag in %z case.
Modified:
stable/7/lib/libstand/ (props changed)
stable/7/lib/libstand/printf.c
Modified: stable/7/lib/libstand/printf.c
==============================================================================
--- stable/7/lib/libstand/printf.c Tue Jan 20 22:34:38 2009 (r187496)
+++ stable/7/lib/libstand/printf.c Tue Jan 20 22:37:56 2009 (r187497)
@@ -381,7 +381,7 @@ handle_sign:
else if (lflag)
num = va_arg(ap, long);
else if (zflag)
- num = va_arg(ap, size_t);
+ num = va_arg(ap, ssize_t);
else
num = va_arg(ap, int);
number:
From delphij at delphij.net Tue Jan 20 14:51:36 2009
From: delphij at delphij.net (Xin LI)
Date: Tue Jan 20 14:51:53 2009
Subject: svn commit: r187069 - stable/7/sbin/fsck_ffs
In-Reply-To: <4971AE26.70406@delphij.net>
References: <200901120039.n0C0dMKX043214@svn.freebsd.org>
<20090112083144.GA69408@dragon.NUXI.org>
<4971AE26.70406@delphij.net>
Message-ID: <49765564.7000808@delphij.net>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi, David,
I have made a change to rename my 'C' to 'D' to avoid the conflict. I
will MFC my change after 1 week settle to see if there is objections.
Cheers,
- --
Xin LI http://www.delphij.net/
FreeBSD - The Power to Serve!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (FreeBSD)
iEYEARECAAYFAkl2VWMACgkQi+vbBBjt66BPHQCfYMW9AIJ5W9Q8PVVg0YoSa+FD
KfUAn27fXoHFnAqjUom2e3JGb5QeCH+j
=atXi
-----END PGP SIGNATURE-----
From delphij at FreeBSD.org Tue Jan 20 16:26:46 2009
From: delphij at FreeBSD.org (Xin LI)
Date: Tue Jan 20 16:26:51 2009
Subject: svn commit: r187506 - in stable/7/sys: . kern
Message-ID: <200901210026.n0L0Qjfe061298@svn.freebsd.org>
Author: delphij
Date: Wed Jan 21 00:26:45 2009
New Revision: 187506
URL: http://svn.freebsd.org/changeset/base/187506
Log:
MFC r185036:
Obey signedness flag in %z case.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/kern/subr_prf.c
Modified: stable/7/sys/kern/subr_prf.c
==============================================================================
--- stable/7/sys/kern/subr_prf.c Tue Jan 20 23:25:27 2009 (r187505)
+++ stable/7/sys/kern/subr_prf.c Wed Jan 21 00:26:45 2009 (r187506)
@@ -810,7 +810,7 @@ handle_sign:
else if (lflag)
num = va_arg(ap, long);
else if (zflag)
- num = va_arg(ap, size_t);
+ num = va_arg(ap, ssize_t);
else if (hflag)
num = (short)va_arg(ap, int);
else if (cflag)
From alc at FreeBSD.org Tue Jan 20 22:32:34 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Tue Jan 20 22:32:51 2009
Subject: svn commit: r187520 - in stable/7/sys: . amd64/amd64 contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901210632.n0L6WW4Y068905@svn.freebsd.org>
Author: alc
Date: Wed Jan 21 06:32:32 2009
New Revision: 187520
URL: http://svn.freebsd.org/changeset/base/187520
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/pmap.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/7/sys/amd64/amd64/pmap.c Wed Jan 21 06:30:53 2009 (r187519)
+++ stable/7/sys/amd64/amd64/pmap.c Wed Jan 21 06:32:32 2009 (r187520)
@@ -290,8 +290,6 @@ static __inline pml4_entry_t *
pmap_pml4e(pmap_t pmap, vm_offset_t va)
{
- if (!pmap)
- return NULL;
return (&pmap->pm_pml4[pmap_pml4e_index(va)]);
}
@@ -312,7 +310,7 @@ pmap_pdpe(pmap_t pmap, vm_offset_t va)
pml4_entry_t *pml4e;
pml4e = pmap_pml4e(pmap, va);
- if (pml4e == NULL || (*pml4e & PG_V) == 0)
+ if ((*pml4e & PG_V) == 0)
return NULL;
return (pmap_pml4e_to_pdpe(pml4e, va));
}
From alc at FreeBSD.org Tue Jan 20 23:33:19 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Tue Jan 20 23:33:36 2009
Subject: svn commit: r187522 - in stable/7/sys: . amd64/amd64 contrib/pf
dev/ath/ath_hal dev/cxgb i386/i386
Message-ID: <200901210733.n0L7XIsn070136@svn.freebsd.org>
Author: alc
Date: Wed Jan 21 07:33:18 2009
New Revision: 187522
URL: http://svn.freebsd.org/changeset/base/187522
Log:
MFC rev 180846
Style fixes to several function definitions.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/pmap.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/i386/i386/pmap.c
Modified: stable/7/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/7/sys/amd64/amd64/pmap.c Wed Jan 21 06:55:27 2009 (r187521)
+++ stable/7/sys/amd64/amd64/pmap.c Wed Jan 21 07:33:18 2009 (r187522)
@@ -2602,9 +2602,8 @@ pmap_kenter_temporary(vm_paddr_t pa, int
* are taken, but the code works.
*/
void
-pmap_object_init_pt(pmap_t pmap, vm_offset_t addr,
- vm_object_t object, vm_pindex_t pindex,
- vm_size_t size)
+pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_object_t object,
+ vm_pindex_t pindex, vm_size_t size)
{
vm_offset_t va;
vm_page_t p, pdpg;
@@ -2728,7 +2727,7 @@ pmap_change_wiring(pmap_t pmap, vm_offse
void
pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len,
- vm_offset_t src_addr)
+ vm_offset_t src_addr)
{
vm_page_t free;
vm_offset_t addr;
@@ -3339,10 +3338,7 @@ pmap_unmapdev(vm_offset_t va, vm_size_t
}
int
-pmap_change_attr(va, size, mode)
- vm_offset_t va;
- vm_size_t size;
- int mode;
+pmap_change_attr(vm_offset_t va, vm_size_t size, int mode)
{
vm_offset_t base, offset, tmpva;
pd_entry_t *pde;
Modified: stable/7/sys/i386/i386/pmap.c
==============================================================================
--- stable/7/sys/i386/i386/pmap.c Wed Jan 21 06:55:27 2009 (r187521)
+++ stable/7/sys/i386/i386/pmap.c Wed Jan 21 07:33:18 2009 (r187522)
@@ -2674,9 +2674,8 @@ pmap_kenter_temporary(vm_paddr_t pa, int
* are taken, but the code works.
*/
void
-pmap_object_init_pt(pmap_t pmap, vm_offset_t addr,
- vm_object_t object, vm_pindex_t pindex,
- vm_size_t size)
+pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_object_t object,
+ vm_pindex_t pindex, vm_size_t size)
{
vm_page_t p;
@@ -2781,7 +2780,7 @@ pmap_change_wiring(pmap_t pmap, vm_offse
void
pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len,
- vm_offset_t src_addr)
+ vm_offset_t src_addr)
{
vm_page_t free;
vm_offset_t addr;
@@ -3409,10 +3408,7 @@ pmap_unmapdev(vm_offset_t va, vm_size_t
}
int
-pmap_change_attr(va, size, mode)
- vm_offset_t va;
- vm_size_t size;
- int mode;
+pmap_change_attr(vm_offset_t va, vm_size_t size, int mode)
{
vm_offset_t base, offset, tmpva;
pt_entry_t *pte;
From alc at FreeBSD.org Tue Jan 20 23:41:25 2009
From: alc at FreeBSD.org (Alan Cox)
Date: Tue Jan 20 23:41:31 2009
Subject: svn commit: r187523 - in stable/7/sys: . amd64/amd64 contrib/pf
dev/ath/ath_hal dev/cxgb
Message-ID: <200901210741.n0L7fODh070343@svn.freebsd.org>
Author: alc
Date: Wed Jan 21 07:41:24 2009
New Revision: 187523
URL: http://svn.freebsd.org/changeset/base/187523
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/amd64/amd64/pmap.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/7/sys/amd64/amd64/pmap.c Wed Jan 21 07:33:18 2009 (r187522)
+++ stable/7/sys/amd64/amd64/pmap.c Wed Jan 21 07:41:24 2009 (r187523)
@@ -3091,7 +3091,7 @@ pmap_is_prefaultable(pmap_t pmap, vm_off
PMAP_LOCK(pmap);
pde = pmap_pde(pmap, addr);
if (pde != NULL && (*pde & PG_V)) {
- pte = vtopte(addr);
+ pte = pmap_pde_to_pte(pde, addr);
rv = (*pte & PG_V) == 0;
}
PMAP_UNLOCK(pmap);
From jhb at FreeBSD.org Wed Jan 21 07:01:37 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Wed Jan 21 07:01:54 2009
Subject: svn commit: r187529 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb i386/cpufreq
Message-ID: <200901211501.n0LF1agR080911@svn.freebsd.org>
Author: jhb
Date: Wed Jan 21 15:01:36 2009
New Revision: 187529
URL: http://svn.freebsd.org/changeset/base/187529
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/i386/cpufreq/est.c
Modified: stable/7/sys/i386/cpufreq/est.c
==============================================================================
--- stable/7/sys/i386/cpufreq/est.c Wed Jan 21 14:51:38 2009 (r187528)
+++ stable/7/sys/i386/cpufreq/est.c Wed Jan 21 15:01:36 2009 (r187529)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include
#include "cpufreq_if.h"
+#include
#include
#include
@@ -71,6 +72,7 @@ typedef struct {
struct est_softc {
device_t dev;
int acpi_settings;
+ int msr_settings;
freq_info *freq_list;
};
@@ -92,6 +94,8 @@ struct est_softc {
const char intel_id[] = "GenuineIntel";
const char centaur_id[] = "CentaurHauls";
+static int msr_info_enabled = 0;
+TUNABLE_INT("hw.est.msr_info", &msr_info_enabled);
/* Default bus clock value for Centrino processors. */
#define INTEL_BUS_CLK 100
@@ -898,6 +902,7 @@ static int est_detach(device_t parent);
static int est_get_info(device_t dev);
static int est_acpi_info(device_t dev, freq_info **freqs);
static int est_table_info(device_t dev, uint64_t msr, freq_info **freqs);
+static int est_msr_info(device_t dev, uint64_t msr, freq_info **freqs);
static freq_info *est_get_current(freq_info *freq_list);
static int est_settings(device_t dev, struct cf_setting *sets, int *count);
static int est_set(device_t dev, const struct cf_setting *set);
@@ -1039,7 +1044,7 @@ est_detach(device_t dev)
return (error);
sc = device_get_softc(dev);
- if (sc->acpi_settings)
+ if (sc->acpi_settings || sc->msr_settings)
free(sc->freq_list, M_DEVBUF);
return (0);
}
@@ -1063,6 +1068,8 @@ est_get_info(device_t dev)
error = est_table_info(dev, msr, &sc->freq_list);
if (error)
error = est_acpi_info(dev, &sc->freq_list);
+ if (error)
+ error = est_msr_info(dev, msr, &sc->freq_list);
if (error) {
printf(
@@ -1168,6 +1175,91 @@ est_table_info(device_t dev, uint64_t ms
return (0);
}
+static int
+bus_speed_ok(int bus)
+{
+
+ switch (bus) {
+ case 100:
+ case 133:
+ case 333:
+ return (1);
+ default:
+ return (0);
+ }
+}
+
+/*
+ * Flesh out a simple rate table containing the high and low frequencies
+ * based on the current clock speed and the upper 32 bits of the MSR.
+ */
+static int
+est_msr_info(device_t dev, uint64_t msr, freq_info **freqs)
+{
+ struct est_softc *sc;
+ freq_info *fp;
+ int bus, freq, volts;
+ uint16_t id;
+
+ if (!msr_info_enabled)
+ return (EOPNOTSUPP);
+
+ /* Figure out the bus clock. */
+ freq = tsc_freq / 1000000;
+ id = msr >> 32;
+ bus = freq / (id >> 8);
+ device_printf(dev, "Guessed bus clock (high) of %d MHz\n", bus);
+ if (!bus_speed_ok(bus)) {
+ /* We may be running on the low frequency. */
+ id = msr >> 48;
+ bus = freq / (id >> 8);
+ device_printf(dev, "Guessed bus clock (low) of %d MHz\n", bus);
+ if (!bus_speed_ok(bus))
+ return (EOPNOTSUPP);
+
+ /* Calculate high frequency. */
+ id = msr >> 32;
+ freq = ((id >> 8) & 0xff) * bus;
+ }
+
+ /* Fill out a new freq table containing just the high and low freqs. */
+ sc = device_get_softc(dev);
+ fp = malloc(sizeof(freq_info) * 3, M_DEVBUF, M_WAITOK | M_ZERO);
+
+ /* First, the high frequency. */
+ volts = id & 0xff;
+ if (volts != 0) {
+ volts <<= 4;
+ volts += 700;
+ }
+ fp[0].freq = freq;
+ fp[0].volts = volts;
+ fp[0].id16 = id;
+ fp[0].power = CPUFREQ_VAL_UNKNOWN;
+ device_printf(dev, "Guessed high setting of %d MHz @ %d Mv\n", freq,
+ volts);
+
+ /* Second, the low frequency. */
+ id = msr >> 48;
+ freq = ((id >> 8) & 0xff) * bus;
+ volts = id & 0xff;
+ if (volts != 0) {
+ volts <<= 4;
+ volts += 700;
+ }
+ fp[1].freq = freq;
+ fp[1].volts = volts;
+ fp[1].id16 = id;
+ fp[1].power = CPUFREQ_VAL_UNKNOWN;
+ device_printf(dev, "Guessed low setting of %d MHz @ %d Mv\n", freq,
+ volts);
+
+ /* Table is already terminated due to M_ZERO. */
+ sc->msr_settings = TRUE;
+ *freqs = fp;
+ return (0);
+}
+
static void
est_get_id16(uint16_t *id16_p)
{
From kib at FreeBSD.org Wed Jan 21 07:06:57 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Wed Jan 21 07:07:03 2009
Subject: svn commit: r187531 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb ufs/ufs
Message-ID: <200901211506.n0LF6rwP081130@svn.freebsd.org>
Author: kib
Date: Wed Jan 21 15:06:53 2009
New Revision: 187531
URL: http://svn.freebsd.org/changeset/base/187531
Log:
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.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
stable/7/sys/ufs/ufs/ufs_lookup.c
Modified: stable/7/sys/ufs/ufs/ufs_lookup.c
==============================================================================
--- stable/7/sys/ufs/ufs/ufs_lookup.c Wed Jan 21 15:04:06 2009 (r187530)
+++ stable/7/sys/ufs/ufs/ufs_lookup.c Wed Jan 21 15:06:53 2009 (r187531)
@@ -158,6 +158,7 @@ ufs_lookup(ap)
struct thread *td = cnp->cn_thread;
ino_t ino;
int ltype;
+ struct mount *mp;
bp = NULL;
slotoffset = -1;
@@ -579,9 +580,26 @@ found:
pdp = vdp;
if (flags & ISDOTDOT) {
ltype = VOP_ISLOCKED(pdp, td);
+ mp = pdp->v_mount;
+ for (;;) {
+ error = vfs_busy(mp, LK_NOWAIT, NULL, td);
+ if (error == 0)
+ break;
+ VOP_UNLOCK(pdp, 0, td);
+ pause("ufs_dd", 1);
+ vn_lock(pdp, ltype | LK_RETRY, td);
+ if (pdp->v_iflag & VI_DOOMED)
+ return (ENOENT);
+ }
VOP_UNLOCK(pdp, 0, td); /* race to get the inode */
- error = VFS_VGET(pdp->v_mount, ino, cnp->cn_lkflags, &tdp);
+ error = VFS_VGET(mp, ino, cnp->cn_lkflags, &tdp);
+ vfs_unbusy(mp, td);
vn_lock(pdp, ltype | LK_RETRY, td);
+ if (pdp->v_iflag & VI_DOOMED) {
+ if (error == 0)
+ vput(tdp);
+ error = ENOENT;
+ }
if (error)
return (error);
*vpp = tdp;
From jhb at FreeBSD.org Wed Jan 21 07:19:39 2009
From: jhb at FreeBSD.org