PERFORCE change 38424 for review
Sam Leffler
sam at FreeBSD.org
Mon Sep 22 09:20:33 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=38424
Change 38424 by sam at sam_ebb on 2003/09/22 09:19:38
IFC @ 38423
Affected files ...
.. //depot/projects/netperf/sys/alpha/conf/GENERIC#2 integrate
.. //depot/projects/netperf/sys/amd64/conf/GENERIC#4 integrate
.. //depot/projects/netperf/sys/cam/cam_periph.c#3 integrate
.. //depot/projects/netperf/sys/cam/scsi/scsi_all.c#2 integrate
.. //depot/projects/netperf/sys/compat/linprocfs/linprocfs.c#5 integrate
.. //depot/projects/netperf/sys/conf/NOTES#9 integrate
.. //depot/projects/netperf/sys/conf/files.ia64#6 integrate
.. //depot/projects/netperf/sys/contrib/dev/acpica/rsaddr.c#2 integrate
.. //depot/projects/netperf/sys/contrib/dev/acpica/rsirq.c#2 integrate
.. //depot/projects/netperf/sys/crypto/rijndael/rijndael-api-fst.c#3 integrate
.. //depot/projects/netperf/sys/dev/acpica/acpi.c#7 integrate
.. //depot/projects/netperf/sys/dev/acpica/acpi_button.c#4 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-lowlevel.c#4 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-queue.c#3 integrate
.. //depot/projects/netperf/sys/dev/ata/atapi-cam.c#6 integrate
.. //depot/projects/netperf/sys/dev/ata/atapi-cd.c#6 integrate
.. //depot/projects/netperf/sys/dev/ata/atapi-cd.h#5 integrate
.. //depot/projects/netperf/sys/dev/ed/if_ed_pccard.c#4 integrate
.. //depot/projects/netperf/sys/dev/ips/ips_disk.c#3 integrate
.. //depot/projects/netperf/sys/dev/mii/e1000phy.c#3 integrate
.. //depot/projects/netperf/sys/dev/mii/e1000phyreg.h#2 integrate
.. //depot/projects/netperf/sys/dev/mii/miidevs#3 integrate
.. //depot/projects/netperf/sys/dev/pccard/pccarddevs#6 integrate
.. //depot/projects/netperf/sys/dev/pccard/pccarddevs.h#6 integrate
.. //depot/projects/netperf/sys/dev/pccard/pccardvar.h#3 integrate
.. //depot/projects/netperf/sys/dev/puc/pucdata.c#6 integrate
.. //depot/projects/netperf/sys/dev/re/if_re.c#2 integrate
.. //depot/projects/netperf/sys/dev/sio/sio.c#6 integrate
.. //depot/projects/netperf/sys/dev/usb/if_aue.c#3 integrate
.. //depot/projects/netperf/sys/dev/usb/umass.c#5 integrate
.. //depot/projects/netperf/sys/dev/usb/usbdevs#3 integrate
.. //depot/projects/netperf/sys/dev/usb/usbdevs.h#3 integrate
.. //depot/projects/netperf/sys/dev/usb/usbdevs_data.h#3 integrate
.. //depot/projects/netperf/sys/dev/wi/if_wi_pccard.c#7 integrate
.. //depot/projects/netperf/sys/fs/nwfs/nwfs_io.c#3 integrate
.. //depot/projects/netperf/sys/fs/smbfs/smbfs_io.c#3 integrate
.. //depot/projects/netperf/sys/i386/conf/GENERIC#4 integrate
.. //depot/projects/netperf/sys/i386/conf/NOTES#4 integrate
.. //depot/projects/netperf/sys/i386/i386/pmap.c#9 integrate
.. //depot/projects/netperf/sys/i386/i386/trap.c#3 integrate
.. //depot/projects/netperf/sys/i386/include/pci_cfgreg.h#2 integrate
.. //depot/projects/netperf/sys/ia64/ia64/genassym.c#4 integrate
.. //depot/projects/netperf/sys/ia64/ia64/machdep.c#9 integrate
.. //depot/projects/netperf/sys/ia64/ia64/pmap.c#6 integrate
.. //depot/projects/netperf/sys/ia64/ia64/trap.c#5 integrate
.. //depot/projects/netperf/sys/ia64/ia64/uma_machdep.c#1 branch
.. //depot/projects/netperf/sys/ia64/include/cpu.h#7 integrate
.. //depot/projects/netperf/sys/kern/kern_malloc.c#2 integrate
.. //depot/projects/netperf/sys/kern/kern_proc.c#3 integrate
.. //depot/projects/netperf/sys/kern/linker_if.m#2 integrate
.. //depot/projects/netperf/sys/kern/sched_ule.c#5 integrate
.. //depot/projects/netperf/sys/kern/vfs_bio.c#6 integrate
.. //depot/projects/netperf/sys/kern/vfs_subr.c#3 integrate
.. //depot/projects/netperf/sys/netinet/ip_fw2.c#9 integrate
.. //depot/projects/netperf/sys/nfsclient/nfs_bio.c#2 integrate
.. //depot/projects/netperf/sys/pc98/pc98/fd.c#3 integrate
.. //depot/projects/netperf/sys/pci/if_rlreg.h#6 integrate
.. //depot/projects/netperf/sys/pci/if_sk.c#3 integrate
.. //depot/projects/netperf/sys/pci/if_skreg.h#2 integrate
.. //depot/projects/netperf/sys/pci/yukonreg.h#1 branch
.. //depot/projects/netperf/sys/powerpc/powermac/ata_macio.c#2 integrate
.. //depot/projects/netperf/sys/powerpc/powerpc/pmap.c#4 integrate
.. //depot/projects/netperf/sys/powerpc/psim/ata_iobus.c#2 integrate
.. //depot/projects/netperf/sys/sparc64/sparc64/pmap.c#6 integrate
.. //depot/projects/netperf/sys/sys/lock.h#3 integrate
.. //depot/projects/netperf/sys/sys/mutex.h#2 integrate
.. //depot/projects/netperf/sys/vm/uma.h#2 integrate
.. //depot/projects/netperf/sys/vm/uma_core.c#7 integrate
.. //depot/projects/netperf/sys/vm/uma_dbg.c#2 integrate
.. //depot/projects/netperf/sys/vm/uma_int.h#4 integrate
.. //depot/projects/netperf/sys/vm/vm_fault.c#3 integrate
.. //depot/projects/netperf/sys/vm/vm_page.c#5 integrate
.. //depot/projects/netperf/sys/vm/vm_pageout.c#6 integrate
.. //depot/projects/netperf/sys/vm/vnode_pager.c#7 integrate
Differences ...
==== //depot/projects/netperf/sys/alpha/conf/GENERIC#2 (text+ko) ====
@@ -18,7 +18,7 @@
#
# For hardware specific information check HARDWARE.TXT
#
-# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.162 2003/07/21 19:15:25 ticso Exp $
+# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.163 2003/09/19 20:04:55 joerg Exp $
machine alpha
cpu EV4
@@ -139,6 +139,11 @@
device ppi # Parallel port interface device
#device vpo # Requires scbus and da
+# If you've got a "dumb" serial or parallel PCI card that is
+# supported by the puc(4) glue driver, uncomment the following
+# line to enable it (connects to the sio and/or ppc drivers):
+#device puc
+
# PCI Ethernet NICs.
device de # DEC/Intel DC21x4x (``Tulip'')
device txp # 3Com 3cR990 (``Typhoon'')
==== //depot/projects/netperf/sys/amd64/conf/GENERIC#4 (text+ko) ====
@@ -16,7 +16,7 @@
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.395 2003/09/15 22:40:00 obrien Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.396 2003/09/19 20:04:55 joerg Exp $
machine amd64
cpu HAMMER
@@ -158,6 +158,10 @@
device ppi # Parallel port interface device
#device vpo # Requires scbus and da
+# If you've got a "dumb" serial or parallel PCI card that is
+# supported by the puc(4) glue driver, uncomment the following
+# line to enable it (connects to the sio and/or ppc drivers):
+#device puc
# PCI Ethernet NICs.
device de # DEC/Intel DC21x4x (``Tulip'')
==== //depot/projects/netperf/sys/cam/cam_periph.c#3 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.52 2003/09/10 18:23:43 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.53 2003/09/21 08:42:32 thomas Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -975,7 +975,7 @@
sense_key = saved_ccb->csio.sense_data.flags;
sense_key &= SSD_KEY;
if (sense_key != SSD_KEY_NO_SENSE) {
- saved_ccb->ccb_h.flags |=
+ saved_ccb->ccb_h.status |=
CAM_AUTOSNS_VALID;
xpt_print_path(saved_ccb->ccb_h.path);
printf("Recovered Sense\n");
==== //depot/projects/netperf/sys/cam/scsi/scsi_all.c#2 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_all.c,v 1.42 2003/06/10 18:14:04 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_all.c,v 1.43 2003/09/21 08:45:36 thomas Exp $");
#include <sys/param.h>
@@ -2408,6 +2408,7 @@
scsi_cmd = (struct scsi_request_sense *)&csio->cdb_io.cdb_bytes;
bzero(scsi_cmd, sizeof(*scsi_cmd));
scsi_cmd->opcode = REQUEST_SENSE;
+ scsi_cmd->length = dxfer_len;
}
void
==== //depot/projects/netperf/sys/compat/linprocfs/linprocfs.c#5 (text+ko) ====
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.72 2003/09/09 19:22:55 des Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.73 2003/09/22 15:52:32 des Exp $");
#include <sys/param.h>
#include <sys/queue.h>
@@ -413,18 +413,31 @@
static int
linprocfs_dostat(PFS_FILL_ARGS)
{
+ int name[2], olen, plen;
+ int i, ncpu;
+
+ name[0] = CTL_HW;
+ name[1] = HW_NCPU;
+ if (kernel_sysctl(td, name, 2, &ncpu, &olen, NULL, 0, &plen) != 0)
+ ncpu = 0;
+ sbuf_printf(sb, "cpu %ld %ld %ld %ld\n",
+ T2J(cp_time[CP_USER]),
+ T2J(cp_time[CP_NICE]),
+ T2J(cp_time[CP_SYS] /*+ cp_time[CP_INTR]*/),
+ T2J(cp_time[CP_IDLE]));
+ for (i = 0; i < ncpu; ++i)
+ sbuf_printf(sb, "cpu%d %ld %ld %ld %ld\n", i,
+ T2J(cp_time[CP_USER]) / ncpu,
+ T2J(cp_time[CP_NICE]) / ncpu,
+ T2J(cp_time[CP_SYS]) / ncpu,
+ T2J(cp_time[CP_IDLE]) / ncpu);
sbuf_printf(sb,
- "cpu %ld %ld %ld %ld\n"
"disk 0 0 0 0\n"
"page %u %u\n"
"swap %u %u\n"
"intr %u\n"
"ctxt %u\n"
"btime %lld\n",
- T2J(cp_time[CP_USER]),
- T2J(cp_time[CP_NICE]),
- T2J(cp_time[CP_SYS] /*+ cp_time[CP_INTR]*/),
- T2J(cp_time[CP_IDLE]),
cnt.v_vnodepgsin,
cnt.v_vnodepgsout,
cnt.v_swappgsin,
==== //depot/projects/netperf/sys/conf/NOTES#9 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1175 2003/09/11 23:06:41 marcel Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1176 2003/09/19 19:04:30 jhb Exp $
#
# NOTES -- Lines that can be cut/pasted into kernel and hints configs.
#
@@ -167,6 +167,13 @@
# CPU.
options ADAPTIVE_MUTEXES
+# MUTEX_NOINLINE forces mutex operations to call functions to perform each
+# operation rather than inlining the simple cases. This can be used to
+# shrink the size of the kernel text segment. Note that this behavior is
+# already implied by the INVARIANT_SUPPORT, INVARIANTS, MUTEX_PROFILING,
+# and WITNESS options.
+options MUTEX_NOINLINE
+
# SMP Debugging Options:
#
# MUTEX_DEBUG enables various extra assertions in the mutex code.
==== //depot/projects/netperf/sys/conf/files.ia64#6 (text+ko) ====
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $FreeBSD: src/sys/conf/files.ia64,v 1.58 2003/09/06 23:23:25 marcel Exp $
+# $FreeBSD: src/sys/conf/files.ia64,v 1.59 2003/09/20 19:27:48 marcel Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -118,6 +118,7 @@
ia64/ia64/sys_machdep.c standard
ia64/ia64/syscall.S standard
ia64/ia64/trap.c standard
+ia64/ia64/uma_machdep.c standard
ia64/ia64/unaligned.c standard
ia64/ia64/unwind.c standard
ia64/ia64/vm_machdep.c standard
==== //depot/projects/netperf/sys/contrib/dev/acpica/rsaddr.c#2 (text+ko) ====
@@ -168,6 +168,10 @@
Buffer += 1;
ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+ /* Check for the minimum length. */
+ if (Temp16 < 13)
+ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
+
*BytesConsumed = Temp16 + 3;
OutputStruct->Id = ACPI_RSTYPE_ADDRESS16;
@@ -275,11 +279,13 @@
/*
* This will leave us pointing to the Resource Source Index
* If it is present, then save it off and calculate the
- * pointer to where the null terminated string goes:
- * Each Interrupt takes 32-bits + the 5 bytes of the
- * stream that are default.
+ * pointer to where the null terminated string goes.
+ *
+ * Note that some buggy resources have a length that indicates the
+ * Index byte is present even though it isn't (since there is no
+ * following Resource String.) We add one to catch these.
*/
- if (*BytesConsumed > 16)
+ if (*BytesConsumed > 16 + 1)
{
/* Dereference the Index */
@@ -555,6 +561,10 @@
*/
Buffer += 1;
ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+
+ /* Check for the minimum length. */
+ if (Temp16 < 23)
+ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
*BytesConsumed = Temp16 + 3;
OutputStruct->Id = ACPI_RSTYPE_ADDRESS32;
@@ -667,9 +677,13 @@
/*
* This will leave us pointing to the Resource Source Index
* If it is present, then save it off and calculate the
- * pointer to where the null terminated string goes:
+ * pointer to where the null terminated string goes.
+ *
+ * Note that some buggy resources have a length that indicates the
+ * Index byte is present even though it isn't (since there is no
+ * following Resource String.) We add one to catch these.
*/
- if (*BytesConsumed > 26)
+ if (*BytesConsumed > 26 + 1)
{
/* Dereference the Index */
@@ -944,7 +958,11 @@
Buffer += 1;
ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+ /* Check for the minimum length. */
+ if (Temp16 < 43)
+ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
*BytesConsumed = Temp16 + 3;
+
OutputStruct->Id = ACPI_RSTYPE_ADDRESS64;
/*
@@ -1056,11 +1074,13 @@
/*
* This will leave us pointing to the Resource Source Index
* If it is present, then save it off and calculate the
- * pointer to where the null terminated string goes:
- * Each Interrupt takes 32-bits + the 5 bytes of the
- * stream that are default.
+ * pointer to where the null terminated string goes.
+ *
+ * Note that some buggy resources have a length that indicates the
+ * Index byte is present even though it isn't (since there is no
+ * following Resource String.) We add one to catch these.
*/
- if (*BytesConsumed > 46)
+ if (*BytesConsumed > 46 + 1)
{
/* Dereference the Index */
==== //depot/projects/netperf/sys/contrib/dev/acpica/rsirq.c#2 (text+ko) ====
@@ -408,7 +408,11 @@
Buffer += 1;
ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+ /* Check for the minimum length. */
+ if (Temp16 < 6)
+ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
*BytesConsumed = Temp16 + 3;
+
OutputStruct->Id = ACPI_RSTYPE_EXT_IRQ;
/*
@@ -446,6 +450,12 @@
Buffer += 1;
Temp8 = *Buffer;
+ /* Minimum number of IRQs is one. */
+ if (Temp8 < 1) {
+ *BytesConsumed = 0;
+ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
+ }
+
OutputStruct->Data.ExtendedIrq.NumberOfInterrupts = Temp8;
/*
@@ -480,7 +490,8 @@
* stream that are default.
*/
if (*BytesConsumed >
- ((ACPI_SIZE) OutputStruct->Data.ExtendedIrq.NumberOfInterrupts * 4) + 5)
+ ((ACPI_SIZE) OutputStruct->Data.ExtendedIrq.NumberOfInterrupts * 4)
+ + 5 + 1)
{
/* Dereference the Index */
==== //depot/projects/netperf/sys/crypto/rijndael/rijndael-api-fst.c#3 (text+ko) ====
@@ -16,7 +16,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/crypto/rijndael/rijndael-api-fst.c,v 1.6 2003/09/17 08:51:43 ume Exp $");
+__FBSDID("$FreeBSD: src/sys/crypto/rijndael/rijndael-api-fst.c,v 1.7 2003/09/18 17:26:56 ume Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -246,7 +246,7 @@
outBuffer += 16;
}
padLen = 16 - (inputOctets - 16*numBlocks);
- if (padLen > 0 && padLen <= 16)
+ if (padLen <= 0 || padLen > 16)
return BAD_CIPHER_STATE;
for (i = 0; i < 16 - padLen; i++) {
block[i] = input[i] ^ iv[i];
==== //depot/projects/netperf/sys/dev/acpica/acpi.c#7 (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/acpica/acpi.c,v 1.100 2003/09/15 06:29:31 njl Exp $
+ * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.102 2003/09/18 05:12:45 njl Exp $
*/
#include "opt_acpi.h"
@@ -1027,7 +1027,6 @@
acpi_enable_fixed_events(struct acpi_softc *sc)
{
static int first_time = 1;
-#define MSGFORMAT "%s button is handled as a fixed feature programming model.\n"
ACPI_ASSERTLOCK;
@@ -1039,7 +1038,7 @@
acpi_eventhandler_power_button_for_sleep,
sc);
if (first_time)
- device_printf(sc->acpi_dev, MSGFORMAT, "power");
+ device_printf(sc->acpi_dev, "Power Button (fixed)\n");
}
if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->SleepButton == 0) {
AcpiEnableEvent(ACPI_EVENT_SLEEP_BUTTON, 0);
@@ -1048,7 +1047,7 @@
acpi_eventhandler_sleep_button_for_sleep,
sc);
if (first_time)
- device_printf(sc->acpi_dev, MSGFORMAT, "sleep");
+ device_printf(sc->acpi_dev, "Sleep Button (fixed)\n");
}
first_time = 0;
==== //depot/projects/netperf/sys/dev/acpica/acpi_button.c#4 (text+ko) ====
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/acpica/acpi_button.c,v 1.13 2003/08/11 15:34:43 njl Exp $
+ * $FreeBSD: src/sys/dev/acpica/acpi_button.c,v 1.16 2003/09/22 04:50:29 njl Exp $
*/
#include "opt_acpi.h"
@@ -43,9 +43,10 @@
struct acpi_button_softc {
device_t button_dev;
ACPI_HANDLE button_handle;
- boolean_t button_type; /* Power or Sleep Button */
+ boolean_t button_type;
#define ACPI_POWER_BUTTON 0
#define ACPI_SLEEP_BUTTON 1
+ boolean_t fixed;
};
#define ACPI_NOTIFY_BUTTON_PRESSED_FOR_SLEEP 0x80
@@ -57,6 +58,8 @@
static int acpi_button_resume(device_t dev);
static void acpi_button_notify_handler(ACPI_HANDLE h, UINT32 notify,
void *context);
+static ACPI_STATUS
+ acpi_button_fixed_handler(void *context);
static void acpi_button_notify_pressed_for_sleep(void *arg);
static void acpi_button_notify_pressed_for_wakeup(void *arg);
@@ -85,23 +88,31 @@
acpi_button_probe(device_t dev)
{
struct acpi_button_softc *sc;
+ int ret = ENXIO;
sc = device_get_softc(dev);
- if (acpi_get_type(dev) == ACPI_TYPE_DEVICE) {
- if (!acpi_disabled("button")) {
- if (acpi_MatchHid(dev, "PNP0C0C")) {
- device_set_desc(dev, "Power Button");
- sc->button_type = ACPI_POWER_BUTTON;
- return (0);
- }
- if (acpi_MatchHid(dev, "PNP0C0E")) {
- device_set_desc(dev, "Sleep Button");
- sc->button_type = ACPI_SLEEP_BUTTON;
- return (0);
- }
+ if (acpi_get_type(dev) == ACPI_TYPE_DEVICE && !acpi_disabled("button")) {
+ if (acpi_MatchHid(dev, "PNP0C0C")) {
+ device_set_desc(dev, "Power Button");
+ sc->button_type = ACPI_POWER_BUTTON;
+ ret = 0;
+ } else if (acpi_MatchHid(dev, "ACPI_FPB")) {
+ device_set_desc(dev, "Power Button (fixed)");
+ sc->button_type = ACPI_POWER_BUTTON;
+ sc->fixed = 1;
+ ret = 0;
+ } else if (acpi_MatchHid(dev, "PNP0C0E")) {
+ device_set_desc(dev, "Sleep Button");
+ sc->button_type = ACPI_SLEEP_BUTTON;
+ ret = 0;
+ } else if (acpi_MatchHid(dev, "ACPI_FSB")) {
+ device_set_desc(dev, "Sleep Button (fixed)");
+ sc->button_type = ACPI_SLEEP_BUTTON;
+ sc->fixed = 1;
+ ret = 0;
}
}
- return (ENXIO);
+ return (ret);
}
static int
@@ -109,6 +120,7 @@
{
struct acpi_button_softc *sc;
ACPI_STATUS status;
+ int event;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
@@ -116,10 +128,17 @@
sc->button_dev = dev;
sc->button_handle = acpi_get_handle(dev);
- status = AcpiInstallNotifyHandler(sc->button_handle, ACPI_DEVICE_NOTIFY,
- acpi_button_notify_handler, sc);
+ if (sc->fixed) {
+ event = (sc->button_type == ACPI_SLEEP_BUTTON) ?
+ ACPI_EVENT_SLEEP_BUTTON : ACPI_EVENT_POWER_BUTTON;
+ status = AcpiInstallFixedEventHandler(event,
+ acpi_button_fixed_handler, sc);
+ } else {
+ status = AcpiInstallNotifyHandler(sc->button_handle,
+ ACPI_DEVICE_NOTIFY, acpi_button_notify_handler, sc);
+ }
if (ACPI_FAILURE(status)) {
- device_printf(sc->button_dev, "couldn't install Notify handler - %s\n",
+ device_printf(sc->button_dev, "couldn't install notify handler - %s\n",
AcpiFormatException(status));
return_VALUE (ENXIO);
}
@@ -217,3 +236,18 @@
break; /* unknown notification value */
}
}
+
+static ACPI_STATUS
+acpi_button_fixed_handler(void *context)
+{
+ struct acpi_button_softc *sc = (struct acpi_button_softc *)context;
+
+ ACPI_FUNCTION_TRACE_PTR((char *)(uintptr_t)__func__, context);
+
+ if (context == NULL)
+ return_ACPI_STATUS (AE_BAD_PARAMETER);
+
+ acpi_button_notify_handler(sc->button_handle,
+ ACPI_NOTIFY_BUTTON_PRESSED_FOR_SLEEP, sc);
+ return_ACPI_STATUS (AE_OK);
+}
==== //depot/projects/netperf/sys/dev/ata/ata-lowlevel.c#4 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.13 2003/09/16 15:21:37 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.16 2003/09/20 08:38:33 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -329,6 +329,7 @@
/* if data write command, output the data */
if (request->flags & ATA_R_WRITE) {
+
/* if we get an error here we are done with the HW */
if (ata_wait(request->device,
(ATA_S_READY | ATA_S_DSC | ATA_S_DRQ)) < 0) {
@@ -336,11 +337,10 @@
request->status = ATA_IDX_INB(ch, ATA_STATUS);
break;
}
- else {
- /* output data and return waiting for new interrupt */
- ata_pio_write(request, request->transfersize);
- return;
- }
+
+ /* output data and return waiting for new interrupt */
+ ata_pio_write(request, request->transfersize);
+ return;
}
/* if data read command, return & wait for interrupt */
@@ -543,7 +543,7 @@
"stat=0x%02x err=0x%02x lsb=0x%02x msb=0x%02x\n",
stat0, err, lsb, msb);
if (!(stat0 & ATA_S_BUSY)) {
- if (err == ATA_E_ILI) {
+ if ((err & 0x7f) == ATA_E_ILI) {
if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) {
ch->devices |= ATA_ATAPI_MASTER;
}
@@ -551,11 +551,8 @@
ch->devices |= ATA_ATA_MASTER;
}
}
- else if (err == lsb && err == msb) {
- ATA_IDX_OUTB(ch, ATA_ERROR, 0xff);
- DELAY(10);
- if (stat0 == ATA_IDX_INB(ch, ATA_STATUS))
- stat0 |= ATA_S_BUSY;
+ else if ((stat0 & 0x4f) && err == lsb && err == msb) {
+ stat0 |= ATA_S_BUSY;
}
}
}
@@ -571,7 +568,7 @@
" stat=0x%02x err=0x%02x lsb=0x%02x msb=0x%02x\n",
stat1, err, lsb, msb);
if (!(stat1 & ATA_S_BUSY)) {
- if (err == ATA_E_ILI) {
+ if ((err & 0x7f) == ATA_E_ILI) {
if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) {
ch->devices |= ATA_ATAPI_SLAVE;
}
@@ -579,11 +576,8 @@
ch->devices |= ATA_ATA_SLAVE;
}
}
- else if (err == lsb && err == msb) {
- ATA_IDX_OUTB(ch, ATA_ERROR, 0xff);
- DELAY(10);
- if (stat1 == ATA_IDX_INB(ch, ATA_STATUS))
- stat1 |= ATA_S_BUSY;
+ else if ((stat1 & 0x4f) && err == lsb && err == msb) {
+ stat1 |= ATA_S_BUSY;
}
}
}
==== //depot/projects/netperf/sys/dev/ata/ata-queue.c#3 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.4 2003/08/28 08:22:53 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.6 2003/09/19 12:46:12 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -47,7 +47,7 @@
/* prototypes */
static void ata_completed(void *, int);
static void ata_timeout(struct ata_request *);
-static char *ata_sensekey2str(u_int8_t);
+static char *ata_skey2str(u_int8_t);
/* local vars */
static MALLOC_DEFINE(M_ATA_REQ, "ATA request", "ATA request");
@@ -260,12 +260,12 @@
/* ATAPI errors */
case ATA_R_ATAPI:
- /* is result already set return */
+ /* skip if result already set */
if (request->result)
break;
- if (request->error & ATA_E_MASK) {
- switch ((request->result & ATA_SK_MASK)) {
+ if (request->error) {
+ switch ((request->error & ATA_SK_MASK)) {
case ATA_SK_RECOVERED_ERROR:
ata_prtdev(request->device, "WARNING - %s recovered error\n",
ata_cmd2str(request));
@@ -285,18 +285,20 @@
break;
default:
+ if (!(request->flags & ATA_R_QUIET))
+ ata_prtdev(request->device,
+ "FAILURE - %s status=%b sensekey=%s error=%b\n",
+ ata_cmd2str(request),
+ request->status, "\20\10BUSY\7READY\6DMA"
+ "\5DSC\4DRQ\3CORRECTABLE\2INDEX\1ERROR",
+ ata_skey2str((request->error & ATA_SK_MASK)>>4),
+ (request->error & ATA_E_MASK),
+ "\20\4MEDIA_CHANGE_REQUEST\3ABORTED"
+ "\2NO_MEDIA\1ILLEGAL_LENGTH");
request->result = EIO;
}
- if (request->result && !(request->flags & ATA_R_QUIET))
- ata_prtdev(request->device,
- "FAILURE - %s status=%b sensekey=%s error=%b\n",
- ata_cmd2str(request),
- request->status, "\20\10BUSY\7READY\6DMA"
- "\5DSC\4DRQ\3CORRECTABLE\2INDEX\1ERROR",
- ata_sensekey2str((request->error & ATA_SK_MASK)>>4),
- (request->error & ATA_E_MASK),
- "\20\4MEDIA_CHANGE_REQUEST\3ABORTED"
- "\2NO_MEDIA\1ILLEGAL_LENGTH");
+ if (request->error & ATA_E_MASK)
+ request->result = EIO;
}
break;
}
@@ -369,6 +371,7 @@
case 0x0a: return ("WRITE");
case 0x10: return ("WEOF");
case 0x11: return ("SPACE");
+ case 0x12: return ("INQUIRY");
case 0x15: return ("MODE_SELECT");
case 0x19: return ("ERASE");
case 0x1a: return ("MODE_SENSE");
@@ -449,7 +452,7 @@
}
static char *
-ata_sensekey2str(u_int8_t skey)
+ata_skey2str(u_int8_t skey)
{
switch (skey) {
case 0x00: return ("NO SENSE");
==== //depot/projects/netperf/sys/dev/ata/atapi-cam.c#6 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.22 2003/09/11 17:34:47 thomas Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.25 2003/09/21 16:49:53 thomas Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -59,7 +59,7 @@
int lun;
union ccb *ccb;
int flags;
-#define DOING_AUTOSENSE 1
+#define QUEUED 0x0001
char *dxfer_alloc;
TAILQ_ENTRY(atapi_hcb) chain;
@@ -346,8 +346,8 @@
struct ccb_trans_settings *cts = &ccb->cts;
/*
- * XXX The default CAM transport code is very scsi specific and
- * doesn't understand IDE speeds very well. Be silent about it
+ * XXX The default CAM transport code is very SCSI-specific and
+ * doesn't understand IDE speeds very well. Be silent about it
* here and let it default to what is set in XPT_PATH_INQ
*/
CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_SUBTRACE, ("GET_TRAN_SETTINGS\n"));
@@ -369,6 +369,7 @@
struct ccb_scsiio *csio = &ccb->csio;
int tid = ccb_h->target_id, lid = ccb_h->target_lun;
struct ata_device *dev = get_ata_device(softc, tid);
+ int request_flags = ATA_R_QUIET | ATA_R_ATAPI;
CAM_DEBUG(ccb_h->path, CAM_DEBUG_SUBTRACE, ("XPT_SCSI_IO\n"));
@@ -397,9 +398,24 @@
/* scatter-gather not supported */
xpt_print_path(ccb_h->path);
printf("ATAPI/CAM does not support scatter-gather yet!\n");
- break;
+ goto action_invalid;
}
+ switch (ccb_h->flags & CAM_DIR_MASK) {
+ case CAM_DIR_IN:
+ request_flags |= ATA_R_READ;
+ break;
+ case CAM_DIR_OUT:
+ request_flags |= ATA_R_WRITE;
+ break;
+ case CAM_DIR_NONE:
+ request_flags |= ATA_R_CONTROL;
+ break;
+ default:
+ ata_prtdev(dev, "unknown IO operation\n");
+ goto action_invalid;
+ }
+
if ((hcb = allocate_hcb(softc, unit, bus, ccb)) == NULL) {
printf("cannot allocate ATAPI/CAM hcb\n");
goto action_oom;
@@ -409,8 +425,6 @@
goto action_oom;
}
- ccb_h->status |= CAM_SIM_QUEUED;
-
bcopy((ccb_h->flags & CAM_CDB_POINTER) ?
csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes,
request->u.atapi.ccb, csio->cdb_len);
@@ -467,8 +481,8 @@
if ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_IN && (len & 1)) {
/* ATA always transfers an even number of bytes */
- if (!(buf = hcb->dxfer_alloc = malloc(++len, M_ATACAM,
- M_NOWAIT | M_ZERO))) {
+ if ((buf = hcb->dxfer_alloc
+ = malloc(++len, M_ATACAM, M_NOWAIT | M_ZERO)) == NULL) {
printf("cannot allocate ATAPI/CAM buffer\n");
goto action_oom;
}
@@ -481,23 +495,11 @@
request->timeout = ccb_h->timeout;
request->retries = 2;
request->callback = &atapi_cb;
- request->flags = (ATA_R_QUIET | ATA_R_ATAPI);
- switch (ccb_h->flags & CAM_DIR_MASK) {
- case CAM_DIR_IN:
- request->flags |= ATA_R_READ;
- break;
- case CAM_DIR_OUT:
- request->flags |= ATA_R_WRITE;
- break;
- case CAM_DIR_NONE:
- request->flags |= ATA_R_CONTROL;
- break;
- default:
- ata_prtdev(dev, "unknown IO operation\n");
- goto action_invalid;
- }
+ request->flags = request_flags;
TAILQ_INSERT_TAIL(&softc->pending_hcbs, hcb, chain);
+ hcb->flags |= QUEUED;
+ ccb_h->status |= CAM_SIM_QUEUED;
ata_queue_request(request);
return;
@@ -509,6 +511,8 @@
goto action_invalid;
}
+ /* NOTREACHED */
+
action_oom:
if (request != NULL)
ata_free_request(request);
@@ -523,9 +527,9 @@
return;
action_invalid:
- ccb_h->status = CAM_REQ_INVALID;
- xpt_done(ccb);
- return;
+ ccb_h->status = CAM_REQ_INVALID;
+ xpt_done(ccb);
+ return;
}
static void
@@ -540,23 +544,31 @@
{
struct atapi_hcb *hcb = (struct atapi_hcb *) request->driver;
struct ccb_scsiio *csio = &hcb->ccb->csio;
- int hcb_status = request->result;
+ u_int32_t rc;
mtx_lock(&Giant);
-
#ifdef CAMDEBUG
- if (CAM_DEBUGGED(csio->ccb_h.path, CAM_DEBUG_CDB)) {
- printf("atapi_cb: hcb@%p status = %02x: (sk = %02x%s%s%s)\n",
- hcb, hcb_status, hcb_status >> 4,
- (hcb_status & 4) ? " ABRT" : "",
- (hcb_status & 2) ? " EOM" : "",
- (hcb_status & 1) ? " ILI" : "");
- printf(" %s: cmd %02x\n",
- request->device->name, request->u.atapi.ccb[0]);
- }
+# define err (request->error)
+ if (CAM_DEBUGGED(csio->ccb_h.path, CAM_DEBUG_CDB)) {
+ printf("atapi_cb: hcb@%p error = %02x: (sk = %02x%s%s%s)\n",
+ hcb, err, err >> 4,
+ (err & 4) ? " ABRT" : "",
+ (err & 2) ? " EOM" : "",
+ (err & 1) ? " ILI" : "");
+ printf("dev %s: cmd %02x status %02x result %02x\n",
+ request->device->name, request->u.atapi.ccb[0],
+ request->status, request->result);
+ }
#endif
- if (hcb_status != 0) {
+
+ if (request->result != 0) {
+ rc = CAM_SCSI_STATUS_ERROR;
csio->scsi_status = SCSI_STATUS_CHECK_COND;
+#if 0
+ /*
+ * XXX Temporarily disable autosense, as this seems to cause
+ * a missed ATA interrupt.
+ */
if ((csio->ccb_h.flags & CAM_DIS_AUTOSENSE) == 0) {
int8_t ccb[16] = { ATAPI_REQUEST_SENSE, 0, 0, 0,
sizeof(struct atapi_sense), 0, 0, 0, 0, 0, 0,
@@ -568,17 +580,17 @@
csio->ccb_h.status |= CAM_AUTOSNS_VALID;
}
}
- free_hcb_and_ccb_done(hcb, CAM_SCSI_STATUS_ERROR);
- }
- else {
+#endif
+ } else {
+ rc = CAM_REQ_CMP;
+ csio->scsi_status = SCSI_STATUS_OK;
if (((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) &&
hcb->dxfer_alloc != NULL)
{
bcopy(hcb->dxfer_alloc, csio->data_ptr, csio->dxfer_len);
}
- csio->scsi_status = SCSI_STATUS_OK;
- free_hcb_and_ccb_done(hcb, CAM_REQ_CMP);
}
+ free_hcb_and_ccb_done(hcb, rc);
mtx_unlock(&Giant);
}
@@ -690,7 +702,8 @@
static void
free_hcb(struct atapi_hcb *hcb)
{
- TAILQ_REMOVE(&hcb->softc->pending_hcbs, hcb, chain);
+ if ((hcb->flags & QUEUED) != 0)
+ TAILQ_REMOVE(&hcb->softc->pending_hcbs, hcb, chain);
if (hcb->dxfer_alloc != NULL)
free(hcb->dxfer_alloc, M_ATACAM);
free(hcb, M_ATACAM);
==== //depot/projects/netperf/sys/dev/ata/atapi-cd.c#6 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.145 2003/09/16 14:41:44 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.146 2003/09/21 18:57:12 phk Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -243,7 +243,7 @@
free(entry, M_ACD);
}
destroy_dev(cdp->dev);
-#ifdef GONE_IN_5
+#ifdef BURN_BRIDGES
EVENTHANDLER_DEREGISTER(dev_clone, cdp->clone_evh);
#endif
devstat_remove_entry(cdp->stats);
@@ -276,7 +276,7 @@
return cdp;
}
-#ifdef GONE_IN_5
+#ifdef BURN_BRIDGES
static void
acd_clone(void *arg, char *name, int namelen, dev_t *dev)
{
@@ -288,8 +288,13 @@
return;
if (!dev_stdclone(name, &p, "acd", &unit))
return;
+#ifdef GONE_IN_5
+ if (*p != '\0')
+ return;
+#else
if (*p != '\0' && strcmp(p, "a") != 0 && strcmp(p, "c") != 0)
return;
+#endif
if (unit == cdp->lun)
*dev = makedev(acd_cdevsw.d_maj, cdp->lun);
}
@@ -305,7 +310,7 @@
dev->si_drv1 = cdp;
cdp->dev = dev;
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list