PERFORCE change 169930 for review
Alexander Motin
mav at FreeBSD.org
Thu Oct 29 16:23:54 UTC 2009
http://p4web.freebsd.org/chv.cgi?CH=169930
Change 169930 by mav at mav_mavtest on 2009/10/29 16:23:12
IFC
Affected files ...
.. //depot/projects/scottl-camlock/src/sbin/ddb/ddb_capture.c#2 integrate
.. //depot/projects/scottl-camlock/src/share/man/man9/get_cyclecount.9#2 integrate
.. //depot/projects/scottl-camlock/src/sys/conf/NOTES#39 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/aac/aac.c#15 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/aac/aacvar.h#9 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ata/ata-all.h#21 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ata/chipsets/ata-serverworks.c#7 integrate
.. //depot/projects/scottl-camlock/src/sys/kern/kern_sig.c#25 integrate
.. //depot/projects/scottl-camlock/src/sys/kern/uipc_syscalls.c#31 integrate
.. //depot/projects/scottl-camlock/src/sys/net80211/ieee80211_hwmp.c#7 integrate
.. //depot/projects/scottl-camlock/src/sys/powerpc/aim/machdep.c#8 integrate
.. //depot/projects/scottl-camlock/src/sys/sys/ata.h#13 integrate
.. //depot/projects/scottl-camlock/src/sys/sys/time.h#10 integrate
.. //depot/projects/scottl-camlock/src/usr.sbin/crashinfo/crashinfo.sh#2 integrate
Differences ...
==== //depot/projects/scottl-camlock/src/sbin/ddb/ddb_capture.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sbin/ddb/ddb_capture.c,v 1.1 2008/04/25 17:34:09 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sbin/ddb/ddb_capture.c,v 1.2 2009/10/29 13:44:58 jhb Exp $");
#include <sys/types.h>
#include <sys/sysctl.h>
@@ -95,24 +95,24 @@
static void
ddb_capture_print_kvm(kvm_t *kvm)
{
- u_int db_capture_bufsize;
+ u_int db_capture_bufoff;
char *buffer, *db_capture_buf;
if (kread_symbol(kvm, X_DB_CAPTURE_BUF, &db_capture_buf,
sizeof(db_capture_buf), 0) < 0)
errx(-1, "kvm: unable to read db_capture_buf");
- if (kread_symbol(kvm, X_DB_CAPTURE_BUFSIZE, &db_capture_bufsize,
- sizeof(db_capture_bufsize), 0) < 0)
- errx(-1, "kvm: unable to read db_capture_bufsize");
+ if (kread_symbol(kvm, X_DB_CAPTURE_BUFOFF, &db_capture_bufoff,
+ sizeof(db_capture_bufoff), 0) < 0)
+ errx(-1, "kvm: unable to read db_capture_bufoff");
- buffer = malloc(db_capture_bufsize + 1);
+ buffer = malloc(db_capture_bufoff + 1);
if (buffer == NULL)
- err(-1, "malloc: db_capture_bufsize (%u)",
- db_capture_bufsize);
- bzero(buffer, db_capture_bufsize + 1);
+ err(-1, "malloc: db_capture_bufoff (%u)",
+ db_capture_bufoff);
+ bzero(buffer, db_capture_bufoff + 1);
- if (kread(kvm, db_capture_buf, buffer, db_capture_bufsize, 0) < 0)
+ if (kread(kvm, db_capture_buf, buffer, db_capture_bufoff, 0) < 0)
errx(-1, "kvm: unable to read buffer");
printf("%s\n", buffer);
@@ -161,7 +161,7 @@
errx(-1, "kvm: unable to read db_capture_bufsize");
if (kread_symbol(kvm, X_DB_CAPTURE_INPROGRESS,
&db_capture_inprogress, sizeof(db_capture_inprogress), 0) < 0)
- err(-1, "kvm: unable to read db_capture_inpgoress");
+ err(-1, "kvm: unable to read db_capture_inprogress");
printf("%u/%u bytes used\n", db_capture_bufoff, db_capture_bufsize);
if (db_capture_inprogress)
printf("capture is on\n");
==== //depot/projects/scottl-camlock/src/share/man/man9/get_cyclecount.9#2 (text+ko) ====
@@ -22,9 +22,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man9/get_cyclecount.9,v 1.10 2004/11/16 21:22:09 jhb Exp $
+.\" $FreeBSD: src/share/man/man9/get_cyclecount.9,v 1.11 2009/10/29 09:45:05 ru Exp $
.\"
-.Dd November 20, 2000
+.Dd October 24, 2009
.Dt GET_CYCLECOUNT 9
.Os
.Sh NAME
@@ -65,10 +65,10 @@
so
.Fn get_cyclecount
on these platforms
-returns the number of nanoseconds
+returns a (non-monotonic) combination of numbers
represented by the
structure returned by
-.Xr nanotime 9 .
+.Xr binuptime 9 .
.Pp
The
.Tn Pentium
@@ -77,18 +77,12 @@
register.
.Pp
The
-.Tn Alpha
-processors use the
-.Li PCC
-register.
-.Pp
-The
.Tn IA64
processors use the
.Li AR.ITC
register.
.Sh SEE ALSO
-.Xr nanotime 9
+.Xr binuptime 9
.Sh HISTORY
The
.Fn get_cyclecount
==== //depot/projects/scottl-camlock/src/sys/conf/NOTES#39 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1559 2009/10/26 10:35:16 mav Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1560 2009/10/29 09:51:13 ru Exp $
#
# NOTES -- Lines that can be cut/pasted into kernel and hints configs.
#
@@ -402,8 +402,7 @@
options KTRACE_REQUEST_POOL=101
#
-# KTR is a kernel tracing mechanism imported from BSD/OS. Currently
-# it has no userland interface aside from a few sysctl's. It is
+# KTR is a kernel tracing facility imported from BSD/OS. It is
# enabled with the KTR option. KTR_ENTRIES defines the number of
# entries in the circular trace buffer; it must be a power of two.
# KTR_COMPILE defines the mask of events to compile into the kernel as
@@ -413,7 +412,7 @@
# events, with bit X corresponding to CPU X. KTR_VERBOSE enables
# dumping of KTR events to the console by default. This functionality
# can be toggled via the debug.ktr_verbose sysctl and defaults to off
-# if KTR_VERBOSE is not defined.
+# if KTR_VERBOSE is not defined. See ktr(4) and ktrdump(8) for details.
#
options KTR
options KTR_ENTRIES=1024
@@ -424,7 +423,7 @@
#
# ALQ(9) is a facility for the asynchronous queuing of records from the kernel
-# to a vnode, and is employed by services such as KTR(4) to produce trace
+# to a vnode, and is employed by services such as ktr(4) to produce trace
# files based on a kernel event stream. Records are written asynchronously
# in a worker thread.
#
@@ -618,9 +617,9 @@
# I have not yet commited the tools to get and print
# the logs, I will do that eventually .. before then
# if you want them send me an email rrs at freebsd.org
-# You basically must have KTR enabled for these
+# You basically must have ktr(4) enabled for these
# and you then set the sysctl to turn on/off various
-# logging bits. Use ktrdump to pull the log and run
+# logging bits. Use ktrdump(8) to pull the log and run
# it through a dispaly program.. and graphs and other
# things too.
#
==== //depot/projects/scottl-camlock/src/sys/dev/aac/aac.c#15 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.149 2009/10/28 13:50:28 emaste Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.150 2009/10/29 14:53:45 emaste Exp $");
/*
* Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters.
@@ -909,8 +909,11 @@
mtx_unlock(&sc->aac_io_lock);
}
+/*
+ * Interrupt filter for !NEW_COMM interface.
+ */
int
-aac_fast_intr(void *arg)
+aac_filter(void *arg)
{
struct aac_softc *sc;
u_int16_t reason;
@@ -2032,18 +2035,11 @@
}
} else {
if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
- INTR_TYPE_BIO, aac_fast_intr, NULL,
+ INTR_TYPE_BIO, aac_filter, NULL,
sc, &sc->aac_intr)) {
device_printf(sc->aac_dev,
- "can't set up FAST interrupt\n");
- if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
- INTR_MPSAFE|INTR_TYPE_BIO,
- NULL, (driver_intr_t *)aac_fast_intr,
- sc, &sc->aac_intr)) {
- device_printf(sc->aac_dev,
- "can't set up MPSAFE interrupt\n");
- return (EINVAL);
- }
+ "can't set up interrupt filter\n");
+ return (EINVAL);
}
}
return (0);
==== //depot/projects/scottl-camlock/src/sys/dev/aac/aacvar.h#9 (text+ko) ====
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/aac/aacvar.h,v 1.53 2009/09/09 03:41:40 emaste Exp $
+ * $FreeBSD: src/sys/dev/aac/aacvar.h,v 1.54 2009/10/29 14:53:45 emaste Exp $
*/
#include <sys/bio.h>
@@ -448,7 +448,7 @@
extern int aac_suspend(device_t dev);
extern int aac_resume(device_t dev);
extern void aac_new_intr(void *arg);
-extern int aac_fast_intr(void *arg);
+extern int aac_filter(void *arg);
extern void aac_submit_bio(struct bio *bp);
extern void aac_biodone(struct bio *bp);
extern void aac_startio(struct aac_softc *sc);
==== //depot/projects/scottl-camlock/src/sys/dev/ata/ata-all.h#21 (text+ko) ====
@@ -23,9 +23,14 @@
* (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: src/sys/dev/ata/ata-all.h,v 1.146 2009/06/24 15:38:17 raj Exp $
+ * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.147 2009/10/29 13:27:14 nwhitehorn Exp $
*/
+#if 0
+#define ATA_LEGACY_SUPPORT /* Enable obsolete features that break
+ * some modern devices */
+#endif
+
/* ATA register defines */
#define ATA_DATA 0 /* (RW) data */
@@ -81,7 +86,11 @@
#define ATA_PC98_CTLOFFSET 0x10c /* do for PC98 devices */
#define ATA_A_IDS 0x02 /* disable interrupts */
#define ATA_A_RESET 0x04 /* RESET controller */
-#define ATA_A_4BIT 0x08 /* 4 head bits */
+#ifdef ATA_LEGACY_SUPPORT
+#define ATA_A_4BIT 0x08 /* 4 head bits: obsolete 1996 */
+#else
+#define ATA_A_4BIT 0x00
+#endif
#define ATA_A_HOB 0x80 /* High Order Byte enable */
/* SATA register defines */
==== //depot/projects/scottl-camlock/src/sys/dev/ata/chipsets/ata-serverworks.c#7 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/chipsets/ata-serverworks.c,v 1.6 2009/06/24 19:49:18 mav Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/chipsets/ata-serverworks.c,v 1.7 2009/10/29 13:28:37 nwhitehorn Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -41,6 +41,9 @@
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
+#ifdef __powerpc__
+#include <machine/intr_machdep.h>
+#endif
#include <machine/stdarg.h>
#include <machine/resource.h>
#include <machine/bus.h>
@@ -106,8 +109,15 @@
ata_serverworks_status(device_t dev)
{
struct ata_channel *ch = device_get_softc(dev);
+ struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
/*
+ * Check if this interrupt belongs to our channel.
+ */
+ if (!(ATA_INL(ctlr->r_res2, 0x1f80) & (1 << ch->unit)))
+ return (0);
+
+ /*
* We need to do a 4-byte read on the status reg before the values
* will report correctly
*/
@@ -208,8 +218,29 @@
ch->hw.tf_write = ata_serverworks_tf_write;
#ifdef __powerpc__
ch->hw.status = ata_serverworks_status;
+
+ /* Make sure that our interrupt is edge triggered */
+ powerpc_config_intr(bus_get_resource_start(device_get_parent(dev),
+ SYS_RES_IRQ, 0), INTR_TRIGGER_EDGE, INTR_POLARITY_HIGH);
#endif
+ if (ctlr->chip->chipid == ATA_K2) {
+ /*
+ * The revision 1 K2 SATA controller has interesting bugs. Patch them.
+ * These magic numbers regulate interrupt delivery in the first few
+ * cases and are pure magic in the last case.
+ *
+ * Values obtained from the Darwin driver.
+ */
+
+ ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, 0x04);
+ ATA_IDX_OUTL(ch, ATA_SERROR, 0xffffffff);
+ ATA_IDX_OUTL(ch, ATA_SCONTROL, 0x00000300);
+ ATA_OUTL(ctlr->r_res2, ch_offset + 0x88, 0);
+ ATA_OUTL(ctlr->r_res2, ch_offset + 0x80,
+ ATA_INL(ctlr->r_res2, ch_offset + 0x80) & ~0x00040000);
+ }
+
/* chip does not reliably do 64K DMA transfers */
ch->dma.max_iosize = 64 * DEV_BSIZE;
==== //depot/projects/scottl-camlock/src/sys/kern/kern_sig.c#25 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.379 2009/10/27 10:47:58 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.380 2009/10/29 14:34:24 kib Exp $");
#include "opt_compat.h"
#include "opt_kdtrace.h"
@@ -1863,7 +1863,8 @@
if (!SIGISMEMBER(ps->ps_signodefer, sig)) {
SIGEMPTYSET(mask);
SIGADDSET(mask, sig);
- kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, 0);
+ kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
+ SIGPROCMASK_PROC_LOCKED);
}
if (SIGISMEMBER(ps->ps_sigreset, sig)) {
/*
==== //depot/projects/scottl-camlock/src/sys/kern/uipc_syscalls.c#31 (text+ko) ====
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.286 2009/10/01 12:50:26 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.287 2009/10/29 10:03:08 kib Exp $");
#include "opt_inet.h"
#include "opt_inet6.h"
@@ -2016,7 +2016,7 @@
* Loop and construct maximum sized mbuf chain to be bulk
* dumped into socket buffer.
*/
- while(space > loopbytes) {
+ while (space > loopbytes) {
vm_pindex_t pindex;
vm_offset_t pgoff;
struct mbuf *m0;
==== //depot/projects/scottl-camlock/src/sys/net80211/ieee80211_hwmp.c#7 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
#ifdef __FreeBSD__
-__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_hwmp.c,v 1.9 2009/10/22 17:30:22 rpaulo Exp $");
+__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_hwmp.c,v 1.10 2009/10/29 12:19:10 rpaulo Exp $");
#endif
/*
@@ -1239,15 +1239,18 @@
return;
}
hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route);
- if (HWMP_SEQ_GT(rann->rann_seq, hr->hr_seq) && rann->rann_ttl > 1 &&
- rann->rann_hopcount < hs->hs_maxhops &&
- (ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) {
- memcpy(&prann, rann, sizeof(prann));
- prann.rann_hopcount += 1;
- prann.rann_ttl -= 1;
- prann.rann_metric += ms->ms_pmetric->mpm_metric(ni);
- hwmp_send_rann(vap->iv_bss, vap->iv_myaddr, broadcastaddr,
- &prann);
+ if (HWMP_SEQ_GT(rann->rann_seq, hr->hr_seq)) {
+ hr->hr_seq = rann->rann_seq;
+ if (rann->rann_ttl > 1 &&
+ rann->rann_hopcount < hs->hs_maxhops &&
+ (ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) {
+ memcpy(&prann, rann, sizeof(prann));
+ prann.rann_hopcount += 1;
+ prann.rann_ttl -= 1;
+ prann.rann_metric += ms->ms_pmetric->mpm_metric(ni);
+ hwmp_send_rann(vap->iv_bss, vap->iv_myaddr,
+ broadcastaddr, &prann);
+ }
}
}
==== //depot/projects/scottl-camlock/src/sys/powerpc/aim/machdep.c#8 (text+ko) ====
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/powerpc/aim/machdep.c,v 1.130 2009/10/27 10:47:58 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/powerpc/aim/machdep.c,v 1.131 2009/10/29 14:22:09 nwhitehorn Exp $");
#include "opt_compat.h"
#include "opt_ddb.h"
@@ -897,8 +897,10 @@
cpu_idle(int busy)
{
uint32_t msr;
+ uint16_t vers;
msr = mfmsr();
+ vers = mfpvr() >> 16;
#ifdef INVARIANTS
if ((msr & PSL_EE) != PSL_EE) {
@@ -908,9 +910,25 @@
}
#endif
if (powerpc_pow_enabled) {
- powerpc_sync();
- mtmsr(msr | PSL_POW);
- isync();
+ switch (vers) {
+ case IBM970:
+ case IBM970FX:
+ case IBM970MP:
+ case MPC7447A:
+ case MPC7448:
+ case MPC7450:
+ case MPC7455:
+ case MPC7457:
+ __asm __volatile("\
+ dssall; sync; mtmsr %0; isync"
+ :: "r"(msr | PSL_POW));
+ break;
+ default:
+ powerpc_sync();
+ mtmsr(msr | PSL_POW);
+ isync();
+ break;
+ }
}
}
==== //depot/projects/scottl-camlock/src/sys/sys/ata.h#13 (text+ko) ====
@@ -23,7 +23,7 @@
* (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: src/sys/sys/ata.h,v 1.42 2009/09/27 20:48:10 mav Exp $
+ * $FreeBSD: src/sys/sys/ata.h,v 1.43 2009/10/29 13:52:34 mav Exp $
*/
#ifndef _SYS_ATA_H_
@@ -226,7 +226,11 @@
/*128*/ u_int16_t security_status;
u_int16_t reserved129[31];
/*160*/ u_int16_t cfa_powermode1;
- u_int16_t reserved161[15];
+ u_int16_t reserved161;
+/*162*/ u_int16_t cfa_kms_support;
+/*163*/ u_int16_t cfa_trueide_modes;
+/*164*/ u_int16_t cfa_memory_modes;
+ u_int16_t reserved165[11];
/*176*/ u_int8_t media_serial[60];
/*206*/ u_int16_t sct;
u_int16_t reserved206[2];
==== //depot/projects/scottl-camlock/src/sys/sys/time.h#10 (text+ko) ====
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*
* @(#)time.h 8.5 (Berkeley) 5/4/95
- * $FreeBSD: src/sys/sys/time.h,v 1.79 2009/03/14 19:15:13 das Exp $
+ * $FreeBSD: src/sys/sys/time.h,v 1.80 2009/10/29 09:27:09 ru Exp $
*/
#ifndef _SYS_TIME_H_
@@ -283,7 +283,7 @@
*
* Functions with the "get" prefix returns a less precise result
* much faster than the functions without "get" prefix and should
- * be used where a precision of 10 msec is acceptable or where
+ * be used where a precision of 1/hz seconds is acceptable or where
* performance is priority. (NB: "precision", _not_ "resolution" !)
*
*/
==== //depot/projects/scottl-camlock/src/usr.sbin/crashinfo/crashinfo.sh#2 (text+ko) ====
@@ -27,7 +27,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $FreeBSD: src/usr.sbin/crashinfo/crashinfo.sh,v 1.1 2008/08/05 20:41:46 jhb Exp $
+# $FreeBSD: src/usr.sbin/crashinfo/crashinfo.sh,v 1.2 2009/10/29 13:45:33 jhb Exp $
usage()
{
@@ -304,3 +304,10 @@
echo "kernel config"
echo
config -x $KERNEL
+
+echo
+echo "------------------------------------------------------------------------"
+echo "ddb capture buffer"
+echo
+
+ddb capture -M $VMCORE -N $KERNEL print
More information about the p4-projects
mailing list