PERFORCE change 58164 for review

Robert Watson rwatson at FreeBSD.org
Sun Jul 25 12:30:34 PDT 2004


http://perforce.freebsd.org/chv.cgi?CH=58164

Change 58164 by rwatson at rwatson_tislabs on 2004/07/25 19:30:10

	Integrate netperf_socket from FreeBSD CVS:
	
	More ACPI video, etc changes. 
	Various GEOM, Vinum fixes.

Affected files ...

.. //depot/projects/netperf_socket/sys/dev/acpica/acpi_video.c#7 integrate
.. //depot/projects/netperf_socket/sys/dev/ata/ata-lowlevel.c#11 integrate
.. //depot/projects/netperf_socket/sys/geom/geom_slice.c#6 integrate
.. //depot/projects/netperf_socket/sys/geom/vinum/geom_vinum.c#6 integrate
.. //depot/projects/netperf_socket/sys/geom/vinum/geom_vinum_drive.c#6 integrate
.. //depot/projects/netperf_socket/sys/i386/acpica/acpi_asus.c#6 integrate
.. //depot/projects/netperf_socket/sys/i386/acpica/acpi_machdep.c#9 integrate
.. //depot/projects/netperf_socket/sys/i386/acpica/acpi_panasonic.c#2 integrate
.. //depot/projects/netperf_socket/sys/ia64/ia64/sal.c#2 integrate
.. //depot/projects/netperf_socket/sys/kern/vfs_bio.c#9 integrate
.. //depot/projects/netperf_socket/sys/sys/proc.h#19 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_map.c#14 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_object.c#8 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_object.h#4 integrate

Differences ...

==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_video.c#7 (text+ko) ====

@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  *
  *	$Id: acpi_vid.c,v 1.4 2003/10/13 10:07:36 taku Exp $
- *	$FreeBSD: src/sys/dev/acpica/acpi_video.c,v 1.6 2004/07/22 05:18:05 njl Exp $
+ *	$FreeBSD: src/sys/dev/acpica/acpi_video.c,v 1.7 2004/07/24 17:51:22 njl Exp $
  */
 
 #include <sys/param.h>
@@ -214,7 +214,9 @@
 	sc = device_get_softc(dev);
 
 	acpi_sc = devclass_get_softc(devclass_find("acpi"), 0);
-	if (acpi_video_sysctl_tree == NULL && acpi_sc != NULL) {
+	if (acpi_sc == NULL)
+		return (ENXIO);
+	if (acpi_video_sysctl_tree == NULL) {
 		acpi_video_sysctl_tree = SYSCTL_ADD_NODE(&acpi_video_sysctl_ctx,
 				    SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree),
 				    OID_AUTO, "video", CTLFLAG_RD, 0,
@@ -275,7 +277,7 @@
     void *context)
 {
 	struct acpi_video_softc *sc;
-	struct acpi_video_output *vo;
+	struct acpi_video_output *vo, *vo_tmp;
 	ACPI_HANDLE lasthand = NULL;
 	UINT32 dcs, dss, dss_p = 0;
 
@@ -303,7 +305,7 @@
 		STAILQ_FOREACH(vo, &sc->vid_outputs, vo_next)
 			vo->handle = NULL;
 		acpi_video_bind_outputs(sc);
-		STAILQ_FOREACH(vo, &sc->vid_outputs, vo_next) {
+		STAILQ_FOREACH_SAFE(vo, &sc->vid_outputs, vo_next, vo_tmp) {
 			if (vo->handle == NULL) {
 				STAILQ_REMOVE(&sc->vid_outputs, vo,
 					      acpi_video_output, vo_next);
@@ -689,29 +691,28 @@
 	void (*callback)(ACPI_HANDLE, UINT32, void *);
 	void *context;
 	ACPI_OBJECT *dod_pkg;
+	int count;
 };
 
 static ACPI_STATUS
 vid_enum_outputs_subr(ACPI_HANDLE handle, UINT32 level __unused,
-		      void *context, void **retp)
+		      void *context, void **retp __unused)
 {
 	ACPI_STATUS status;
-	ACPI_OBJECT *tmp;
-	UINT32 adr;
+	UINT32 adr, val;
 	struct enum_callback_arg *argset;
 	size_t i;
 
 	argset = context;
 	status = acpi_GetInteger(handle, "_ADR", &adr);
-	if (ACPI_SUCCESS(status)) {
-		for (i = 0; i < argset->dod_pkg->Package.Count; i++) {
-			tmp = &argset->dod_pkg->Package.Elements[i];
-			if (tmp != NULL && tmp->Type == ACPI_TYPE_INTEGER &&
-			    (tmp->Integer.Value & DOD_DEVID_MASK) == adr) {
-				argset->callback(handle, tmp->Integer.Value,
-						 argset->context);
-				(**(int**)retp)++;
-			}
+	if (ACPI_FAILURE(status))
+		return (AE_OK);
+
+	for (i = 0; i < argset->dod_pkg->Package.Count; i++) {
+		if (acpi_PkgInt32(argset->dod_pkg, i, &val) == 0 &&
+		    (val & DOD_DEVID_MASK) == adr) {
+			argset->callback(handle, val, argset->context);
+			argset->count++;
 		}
 	}
 
@@ -725,8 +726,6 @@
 	ACPI_STATUS status;
 	ACPI_BUFFER dod_buf;
 	ACPI_OBJECT *res;
-	int num = 0;
-	void *pnum;
 	struct enum_callback_arg argset;
 
 	dod_buf.Length = ACPI_ALLOCATE_BUFFER;
@@ -736,34 +735,33 @@
 		if (status != AE_NOT_FOUND)
 			printf("can't evaluate %s._DOD - %s\n",
 			       acpi_name(handle), AcpiFormatException(status));
-		num = -1;
+		argset.count = -1;
 		goto out;
 	}
 	res = (ACPI_OBJECT *)dod_buf.Pointer;
-	if (res == NULL || res->Type != ACPI_TYPE_PACKAGE) {
+	if (!ACPI_PKG_VALID(res, 1)) {
 		printf("evaluation of %s._DOD makes no sense\n",
 		       acpi_name(handle));
-		num = -1;
+		argset.count = -1;
 		goto out;
 	}
 	if (callback == NULL) {
-		num = res->Package.Count;
+		argset.count = res->Package.Count;
 		goto out;
 	}
 	argset.callback = callback;
 	argset.context  = context;
 	argset.dod_pkg  = res;
-	pnum = &num;
+	argset.count    = 0;
 	status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, handle, 1,
-				   vid_enum_outputs_subr, &argset,
-				   &pnum);
+	    vid_enum_outputs_subr, &argset, NULL);
 	if (ACPI_FAILURE(status))
 		printf("failed walking down %s - %s\n",
 		       acpi_name(handle), AcpiFormatException(status));
 out:
 	if (dod_buf.Pointer != NULL)
 		AcpiOsFree(dod_buf.Pointer);
-	return (num);
+	return (argset.count);
 }
 
 static int
@@ -771,7 +769,7 @@
 {
 	ACPI_STATUS status;
 	ACPI_BUFFER bcl_buf;
-	ACPI_OBJECT *res, *tmp;
+	ACPI_OBJECT *res;
 	int num = 0, i, n, *levels;
 
 	bcl_buf.Length = ACPI_ALLOCATE_BUFFER;
@@ -785,8 +783,7 @@
 		goto out;
 	}
 	res = (ACPI_OBJECT *)bcl_buf.Pointer;
-	if (res == NULL || res->Type != ACPI_TYPE_PACKAGE ||
-	    res->Package.Count < 2) {
+	if (!ACPI_PKG_VALID(res, 2)) {
 		printf("evaluation of %s._BCL makes no sense\n",
 		       acpi_name(handle));
 		num = -1;
@@ -795,16 +792,14 @@
 	num = res->Package.Count;
 	if (levelp == NULL)
 		goto out;
-	levels = AcpiOsAllocate(num * sizeof *levels);
+	levels = AcpiOsAllocate(num * sizeof(*levels));
 	if (levels == NULL) {
 		num = -1;
 		goto out;
 	}
-	for (i = 0, n = 0; i < num; i++) {
-		tmp = &res->Package.Elements[i];
-		if (tmp != NULL && tmp->Type == ACPI_TYPE_INTEGER)
-			levels[n++] = tmp->Integer.Value;
-	}
+	for (i = 0, n = 0; i < num; i++)
+		if (acpi_PkgInt32(res, i, &levels[n]) == 0)
+			n++;
 	if (n < 2) {
 		num = -1;
 		AcpiOsFree(levels);

==== //depot/projects/netperf_socket/sys/dev/ata/ata-lowlevel.c#11 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.39 2004/07/23 17:01:47 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.40 2004/07/24 19:03:28 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -110,8 +110,16 @@
 
 	    /* device reset doesn't interrupt */
 	    if (request->u.ata.command == ATA_ATAPI_RESET) {
-		DELAY(10);
-		request->status = ATA_IDX_INB(ch, ATA_STATUS);
+		int timeout = 1000000;
+		do {
+		    DELAY(10);
+		    request->status = ATA_IDX_INB(ch, ATA_STATUS);
+		} while (request->status & ATA_S_BUSY && timeout--);
+		if (timeout)
+		    printf("ATAPI_RESET time = %dus\n", (1000000-timeout)*10);
+		else
+		    printf("ATAPI_RESET timeout\n");
+
 		if (request->status & ATA_S_ERROR) {
 		    request->error = ATA_IDX_INB(ch, ATA_ERROR);
 		    //request->result = EIO;

==== //depot/projects/netperf_socket/sys/geom/geom_slice.c#6 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/geom_slice.c,v 1.54 2004/07/04 13:44:48 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/geom_slice.c,v 1.55 2004/07/25 09:41:31 le Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -76,6 +76,8 @@
 g_slice_free(struct g_slicer *gsp)
 {
 
+	if (gsp == NULL)	/* XXX: phk thinks about this */
+		return;
 	g_free(gsp->slices);
 	if (gsp->hotspot != NULL)
 		g_free(gsp->hotspot);

==== //depot/projects/netperf_socket/sys/geom/vinum/geom_vinum.c#6 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum.c,v 1.5 2004/07/05 13:24:22 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum.c,v 1.7 2004/07/24 22:26:40 le Exp $");
 
 #include <sys/param.h>
 #include <sys/bio.h>
@@ -540,6 +540,7 @@
 gv_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp)
 {
 	struct g_geom *gp2;
+	struct g_consumer *cp;
 	struct gv_softc *sc;
 	struct gv_drive *d, *d2;
 	struct gv_plex *p, *p2;
@@ -560,6 +561,9 @@
 	 */
 	LIST_FOREACH(d, &sc->drives, drive) {
 		gp2 = d->geom;
+		cp = LIST_FIRST(&gp2->consumer);
+		if (cp != NULL)
+			g_access(cp, -1, -1, -1);
 		if (gv_is_open(gp2))
 			return (EBUSY);
 	}
@@ -618,7 +622,7 @@
 static struct g_class g_vinum_class	= {
 	.name = VINUM_CLASS_NAME,
 	.taste = gv_taste,
-	.destroy_geom = gv_destroy_geom,
+	/*.destroy_geom = gv_destroy_geom,*/
 	.ctlreq = gv_config,
 };
 

==== //depot/projects/netperf_socket/sys/geom/vinum/geom_vinum_drive.c#6 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_drive.c,v 1.5 2004/06/22 18:13:43 le Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_drive.c,v 1.6 2004/07/24 22:26:40 le Exp $");
 
 #include <sys/param.h>
 #include <sys/bio.h>
@@ -181,12 +181,14 @@
 		}
 	}
 
+#if 0
 	/* On first open, grab an extra "exclusive" bit */
 	if (cp->acr == 0 && cp->acw == 0 && cp->ace == 0)
 		de++;
 	/* ... and let go of it on last close */
 	if ((cp->acr + dr) == 0 && (cp->acw + dw) == 0 && (cp->ace + de) == 1)
 		de--;
+#endif
 	error = g_access(cp, dr, dw, de);
 	if (error) {
 		printf("FOOO: g_access failed: %d\n", error);
@@ -294,6 +296,12 @@
 	g_wither_geom(gp, error);
 }
 
+static void
+gv_drive_taste_orphan(struct g_consumer *cp)
+{
+	KASSERT(1 == 0, ("gv_drive_taste_orphan called: %s", cp->geom->name));
+}
+
 static struct g_geom *
 gv_drive_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
 {
@@ -323,11 +331,7 @@
 	sc = gp2->softc;
 
 	gp = g_new_geomf(mp, "%s.vinumdrive", pp->name);
-	gp->start = gv_drive_start;
-	gp->spoiled = gv_drive_orphan;
-	gp->orphan = gv_drive_orphan;
-	gp->access = gv_drive_access;
-	gp->start = gv_drive_start;
+	gp->orphan = gv_drive_taste_orphan;
 
 	cp = g_new_consumer(gp);
 	g_attach(cp, pp);
@@ -357,6 +361,9 @@
 		 */
 		g_topology_lock();
 		g_access(cp, -1, 0, 0);
+		g_detach(cp);
+		g_wither_geom(gp, ENXIO);
+		gp = NULL;
 
 		d = gv_find_drive(sc, vhdr->label.name);
 
@@ -387,6 +394,23 @@
 			LIST_INSERT_HEAD(&sc->drives, d, drive);
 		}
 
+		gp = g_new_geomf(mp, "%s.vinumdrive", pp->name);
+		gp->start = gv_drive_start;
+		gp->orphan = gv_drive_orphan;
+		gp->access = gv_drive_access;
+		gp->start = gv_drive_start;
+
+		cp = g_new_consumer(gp);
+		g_attach(cp, pp);
+		error = g_access(cp, 1, 1, 1);
+		if (error) {
+			g_free(vhdr);
+			g_detach(cp);
+			g_destroy_consumer(cp);
+			g_destroy_geom(gp);
+			return (NULL);
+		}
+
 		gp->softc = d;
 		d->geom = gp;
 		strncpy(d->device, pp->name, GV_MAXDRIVENAME);

==== //depot/projects/netperf_socket/sys/i386/acpica/acpi_asus.c#6 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/acpica/acpi_asus.c,v 1.6 2004/06/29 19:05:20 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/acpica/acpi_asus.c,v 1.7 2004/07/24 20:39:25 njl Exp $");
 
 /*
  * Driver for extra ACPI-controlled gadgets (hotkeys, leds, etc) found on
@@ -291,9 +291,8 @@
 		sc->s_wled = led_create((led_t *)acpi_asus_wled, dev, "wled");
 
 	/* Attach brightness for GPLV/SPLV models */
-	if (sc->model->brn_get &&
-	    ACPI_SUCCESS(acpi_GetInteger(sc->handle,
-		sc->model->brn_get, &sc->s_brn)))
+	if (sc->model->brn_get && ACPI_SUCCESS(acpi_GetInteger(sc->handle,
+	    sc->model->brn_get, &sc->s_brn)))
 		SYSCTL_ADD_PROC(&sc->sysctl_ctx,
 		    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
 		    "lcd_brightness", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
@@ -301,29 +300,27 @@
 
 	/* Attach brightness for other models */
 	if (sc->model->brn_up &&
-	    ACPI_SUCCESS(AcpiEvaluateObject(sc->handle,
-		sc->model->brn_up, NULL, NULL)) &&
-	    ACPI_SUCCESS(AcpiEvaluateObject(sc->handle,
-		sc->model->brn_dn, NULL, NULL)))
+	    ACPI_SUCCESS(AcpiEvaluateObject(sc->handle, sc->model->brn_up,
+	    NULL, NULL)) &&
+	    ACPI_SUCCESS(AcpiEvaluateObject(sc->handle, sc->model->brn_dn,
+	    NULL, NULL)))
 		SYSCTL_ADD_PROC(&sc->sysctl_ctx,
 		    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
 		    "lcd_brightness", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
 		    acpi_asus_sysctl_brn, "I", "brightness of the lcd panel");
 
 	/* Attach display switching */
-	if (sc->model->disp_get &&
-	    ACPI_SUCCESS(acpi_GetInteger(sc->handle,
-		sc->model->disp_get, &sc->s_disp)))
+	if (sc->model->disp_get && ACPI_SUCCESS(acpi_GetInteger(sc->handle,
+	    sc->model->disp_get, &sc->s_disp)))
 		SYSCTL_ADD_PROC(&sc->sysctl_ctx,
 		    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
 		    "video_output", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
 		    acpi_asus_sysctl_disp, "I", "display output state");
 
 	/* Attach LCD state, easy for most models... */
-	if (sc->model->lcd_get &&
-	    strncmp(sc->model->name, "L3H", 3) != 0 &&
-	    ACPI_SUCCESS(acpi_GetInteger(sc->handle,
-		sc->model->lcd_get, &sc->s_lcd)))
+	if (sc->model->lcd_get && strncmp(sc->model->name, "L3H", 3) != 0 &&
+	    ACPI_SUCCESS(acpi_GetInteger(sc->handle, sc->model->lcd_get,
+	    &sc->s_lcd)))
 		SYSCTL_ADD_PROC(&sc->sysctl_ctx,
 		    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
 		    "lcd_backlight", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
@@ -347,7 +344,7 @@
 		Buf.Pointer = &Obj;
 
 		if (ACPI_SUCCESS(AcpiEvaluateObject(sc->handle,
-			sc->model->lcd_get, &Args, &Buf)) &&
+		    sc->model->lcd_get, &Args, &Buf)) &&
 		    Obj.Type == ACPI_TYPE_INTEGER) {
 			sc->s_lcd = Obj.Integer.Value >> 8;
 
@@ -363,8 +360,8 @@
 	AcpiEvaluateObject(sc->handle, "BSTS", NULL, NULL);
 
 	/* Handle notifies */
-	AcpiInstallNotifyHandler(sc->handle,
-	    ACPI_SYSTEM_NOTIFY, acpi_asus_notify, dev);
+	AcpiInstallNotifyHandler(sc->handle, ACPI_SYSTEM_NOTIFY,
+	    acpi_asus_notify, dev);
 	
 	return (0);
 }
@@ -389,8 +386,8 @@
 		led_destroy(sc->s_wled);
 
 	/* Remove notify handler */
-	AcpiRemoveNotifyHandler(sc->handle,
-	    ACPI_SYSTEM_NOTIFY, acpi_asus_notify);
+	AcpiRemoveNotifyHandler(sc->handle, ACPI_SYSTEM_NOTIFY,
+	    acpi_asus_notify);
 
 	/* Free sysctl tree */
 	sysctl_ctx_free(&sc->sysctl_ctx);
@@ -474,10 +471,10 @@
 	brn = sc->s_brn;
 	err = sysctl_handle_int(oidp, &brn, 0, req);
 
-	if ((err != 0) || (req->newptr == NULL))
+	if (err != 0 || req->newptr == NULL)
 		return (err);
 
-	if ((brn < 0) || (brn > 15))
+	if (brn < 0 || brn > 15)
 		return (EINVAL);
 
 	/* Keep track and update */
@@ -490,13 +487,12 @@
 	Args.Pointer = &Arg;
 
 	if (sc->model->brn_set)
-		AcpiEvaluateObject(sc->handle,
-		    sc->model->brn_set, &Args, NULL);
+		AcpiEvaluateObject(sc->handle, sc->model->brn_set, &Args, NULL);
 	else {
 		brn -= sc->s_brn;
 
 		while (brn != 0) {
-			AcpiEvaluateObject(sc->handle,(brn > 0) ?
+			AcpiEvaluateObject(sc->handle, (brn > 0) ?
 			    sc->model->brn_up : sc->model->brn_dn,
 			    NULL, NULL);
 
@@ -521,10 +517,10 @@
 	lcd = sc->s_lcd;
 	err = sysctl_handle_int(oidp, &lcd, 0, req);
 
-	if ((err != 0) || (req->newptr == NULL))
+	if (err != 0 || req->newptr == NULL)
 		return (err);
 
-	if ((lcd < 0) || (lcd > 1))
+	if (lcd < 0 || lcd > 1)
 		return (EINVAL);
 
 	/* Keep track and update */
@@ -532,8 +528,7 @@
 
 	/* Most models just need a lcd_set evaluated, the L3H is trickier */
 	if (strncmp(sc->model->name, "L3H", 3) != 0)
-		AcpiEvaluateObject(sc->handle,
-		    sc->model->lcd_set, NULL, NULL);
+		AcpiEvaluateObject(sc->handle, sc->model->lcd_set, NULL, NULL);
 	else {
 		ACPI_OBJECT		Arg;
 		ACPI_OBJECT_LIST	Args;
@@ -544,8 +539,7 @@
 		Args.Count = 1;
 		Args.Pointer = &Arg;
 
-		AcpiEvaluateObject(sc->handle,
-		    sc->model->lcd_set, &Args, NULL);
+		AcpiEvaluateObject(sc->handle, sc->model->lcd_set, &Args, NULL);
 	}
 
 	return (0);
@@ -567,10 +561,10 @@
 	disp = sc->s_disp;
 	err = sysctl_handle_int(oidp, &disp, 0, req);
 
-	if ((err != 0) || (req->newptr == NULL))
+	if (err != 0 || req->newptr == NULL)
 		return (err);
 
-	if ((disp < 0) || (disp > 7))
+	if (disp < 0 || disp > 7)
 		return (EINVAL);
 
 	/* Keep track and update */
@@ -582,8 +576,7 @@
 	Args.Count = 1;
 	Args.Pointer = &Arg;
 
-	AcpiEvaluateObject(sc->handle,
-	    sc->model->disp_set, &Args, NULL);
+	AcpiEvaluateObject(sc->handle, sc->model->disp_set, &Args, NULL);
 
 	return (0);
 }
@@ -600,10 +593,10 @@
 	acpi_sc = acpi_device_get_parent_softc(sc->dev);
 
 	if ((notify & ~0x10) <= 15) {
-		sc->s_brn = (notify & ~0x10);
+		sc->s_brn = notify & ~0x10;
 		ACPI_VPRINT(sc->dev, acpi_sc, "Brightness increased\n");
 	} else if ((notify & ~0x20) <= 15) {
-		sc->s_brn = (notify & ~0x20);
+		sc->s_brn = notify & ~0x20;
 		ACPI_VPRINT(sc->dev, acpi_sc, "Brightness decreased\n");
 	} else if (notify == 0x33) {
 		sc->s_lcd = 1;

==== //depot/projects/netperf_socket/sys/i386/acpica/acpi_machdep.c#9 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.24 2004/06/30 04:42:29 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.25 2004/07/24 22:41:30 njl Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -41,8 +41,6 @@
 #include <dev/acpica/acpivar.h>
 #include <dev/acpica/acpiio.h>
 
-static device_t	acpi_dev;
-
 /*
  * APM driver emulation 
  */
@@ -58,7 +56,7 @@
 TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video);
 
 static int intr_model = ACPI_INTR_PIC;
-static struct apm_softc	apm_softc;
+static int apm_active;
 
 static d_open_t apmopen;
 static d_close_t apmclose;
@@ -138,7 +136,7 @@
 	aip->ai_infoversion = 1;
 	aip->ai_major       = 1;
 	aip->ai_minor       = 2;
-	aip->ai_status      = apm_softc.active;
+	aip->ai_status      = apm_active;
 	aip->ai_capabilities= 0xff00;	/* unknown */
 
 	if (acpi_acad_get_acline(&acline))
@@ -213,13 +211,13 @@
 	struct apm_info info;
 	apm_info_old_t aiop;
 
-	acpi_sc = device_get_softc(acpi_dev);
+	acpi_sc = devclass_get_softc(devclass_find("acpi"), 0);
 
 	switch (cmd) {
 	case APMIO_SUSPEND:
 		if ((flag & FWRITE) == 0)
 			return (EPERM);
-		if (apm_softc.active)
+		if (apm_active)
 			acpi_SetSleepState(acpi_sc, acpi_sc->acpi_suspend_sx);
 		else
 			error = EINVAL;
@@ -227,7 +225,7 @@
 	case APMIO_STANDBY:
 		if ((flag & FWRITE) == 0)
 			return (EPERM);
-		if (apm_softc.active)
+		if (apm_active)
 			acpi_SetSleepState(acpi_sc, acpi_sc->acpi_standby_sx);
 		else
 			error = EINVAL;
@@ -254,12 +252,12 @@
 	case APMIO_ENABLE:
 		if ((flag & FWRITE) == 0)
 			return (EPERM);
-		apm_softc.active = 1;
+		apm_active = 1;
 		break;
 	case APMIO_DISABLE:
 		if ((flag & FWRITE) == 0)
 			return (EPERM);
-		apm_softc.active = 0;
+		apm_active = 0;
 		break;
 	case APMIO_HALTCPU:
 		break;
@@ -305,9 +303,7 @@
 {
 	struct	acpi_softc *sc;
 
-	acpi_dev = dev;
-	sc = device_get_softc(acpi_dev);
-
+	sc = devclass_get_softc(devclass_find("acpi"), 0);
 	acpi_capm_init(sc);
 
 	acpi_install_wakeup_handler(sc);

==== //depot/projects/netperf_socket/sys/i386/acpica/acpi_panasonic.c#2 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/acpica/acpi_panasonic.c,v 1.1 2004/07/21 14:47:53 nyan Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/acpica/acpi_panasonic.c,v 1.2 2004/07/24 20:40:02 njl Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -47,8 +47,8 @@
 #define	HKEY_GET	1
 
 /* Functions */
-#define	HKEY_REG_LCD_BRIGHTNESS	0x04
-#define	HKEY_REG_SOUND_MUTE	0x08
+#define	HKEY_REG_LCD_BRIGHTNESS		0x04
+#define	HKEY_REG_SOUND_MUTE		0x08
 
 /* Field definitions */
 #define	HKEY_LCD_BRIGHTNESS_BITS	4
@@ -69,18 +69,20 @@
 static int	acpi_panasonic_attach(device_t dev);
 static int	acpi_panasonic_detach(device_t dev);
 static int	acpi_panasonic_sysctl(SYSCTL_HANDLER_ARGS);
-static ACPI_INTEGER	acpi_panasonic_sinf(ACPI_HANDLE h, ACPI_INTEGER index);
+static ACPI_INTEGER acpi_panasonic_sinf(ACPI_HANDLE h, ACPI_INTEGER index);
 static void	acpi_panasonic_sset(ACPI_HANDLE h, ACPI_INTEGER index,
-				    ACPI_INTEGER val);
+		    ACPI_INTEGER val);
+static int	acpi_panasonic_hkey_event(struct acpi_panasonic_softc *sc,
+		    ACPI_HANDLE h, UINT32 *arg);
+static void	acpi_panasonic_hkey_action(struct acpi_panasonic_softc *sc,
+		    ACPI_HANDLE h, UINT32 key);
+static void	acpi_panasonic_notify(ACPI_HANDLE h, UINT32 notify,
+		    void *context);
+
 static hkey_fn_t	hkey_lcd_brightness_max;
 static hkey_fn_t	hkey_lcd_brightness;
 static hkey_fn_t	hkey_sound_mute;
-static int	acpi_panasonic_hkey_event(struct acpi_panasonic_softc *sc,
-					  ACPI_HANDLE h, UINT32 *arg);
-static void	acpi_panasonic_hkey_action(struct acpi_panasonic_softc *sc,
-					   ACPI_HANDLE h, UINT32 key);
-static void	acpi_panasonic_notify(ACPI_HANDLE h, UINT32 notify,
-				      void *context);
+static int		lcd_brightness_max = 255;
 
 /* Table of sysctl names and HKEY functions to call. */
 static struct {
@@ -111,11 +113,9 @@
 static devclass_t acpi_panasonic_devclass;
 
 DRIVER_MODULE(acpi_panasonic, acpi, acpi_panasonic_driver,
-	      acpi_panasonic_devclass, 0, 0);
+    acpi_panasonic_devclass, 0, 0);
 MODULE_DEPEND(acpi_panasonic, acpi, 1, 1, 1);
 
-static int lcd_brightness_max = 255;
-
 static int
 acpi_panasonic_probe(device_t dev)
 {
@@ -151,10 +151,10 @@
 	    "panasonic", CTLFLAG_RD, 0, "");
 	for (i = 0; sysctl_table[i].name != NULL; i++) {
 		SYSCTL_ADD_PROC(&sc->sysctl_ctx,
-				SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
-				sysctl_table[i].name,
-				CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY,
-				sc, i, acpi_panasonic_sysctl, "I", "");
+		    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+		    sysctl_table[i].name,
+		    CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY,
+		    sc, i, acpi_panasonic_sysctl, "I", "");
 	}
 
 #if 0
@@ -169,10 +169,10 @@
 
         /* Handle notifies */
 	status = AcpiInstallNotifyHandler(sc->handle, ACPI_DEVICE_NOTIFY,
-					  acpi_panasonic_notify, sc);
+	    acpi_panasonic_notify, sc);
 	if (ACPI_FAILURE(status)) {
 		device_printf(dev, "couldn't install notify handler - %s\n",
-			      AcpiFormatException(status));
+		    AcpiFormatException(status));
 		sysctl_ctx_free(&sc->sysctl_ctx);
 		return (ENXIO);
 	}
@@ -189,7 +189,7 @@
 
 	/* Remove notify handler */
 	AcpiRemoveNotifyHandler(sc->handle, ACPI_DEVICE_NOTIFY,
-				acpi_panasonic_notify);
+	    acpi_panasonic_notify);
 
 	/* Free sysctl tree */
 	sysctl_ctx_free(&sc->sysctl_ctx);
@@ -315,7 +315,7 @@
 
 static int
 acpi_panasonic_hkey_event(struct acpi_panasonic_softc *sc, ACPI_HANDLE h,
-			  UINT32 *arg)
+    UINT32 *arg)
 {
 	ACPI_BUFFER buf;
 	ACPI_OBJECT *res;
@@ -351,7 +351,7 @@
 
 static void
 acpi_panasonic_hkey_action(struct acpi_panasonic_softc *sc, ACPI_HANDLE h,
-			   UINT32 key)
+    UINT32 key)
 {
 	int arg;
 
@@ -404,7 +404,7 @@
 		}
 		break;
 	default:
-		device_printf(sc->dev, "unknown Notify: 0x%x\n", notify);
+		device_printf(sc->dev, "unknown notify: %#x\n", notify);
 		break;
 	}
 }

==== //depot/projects/netperf_socket/sys/ia64/ia64/sal.c#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/ia64/ia64/sal.c,v 1.12 2003/02/01 22:50:09 marcel Exp $
+ * $FreeBSD: src/sys/ia64/ia64/sal.c,v 1.13 2004/07/25 07:07:09 marcel Exp $
  */
 
 #include <sys/param.h>
@@ -112,6 +112,7 @@
 			struct sal_ap_wakeup_descriptor *dp;
 #ifdef SMP
 			struct ia64_sal_result result;
+			struct ia64_fdesc *fd;
 #endif
 
 			dp = (struct sal_ap_wakeup_descriptor*)p;
@@ -153,11 +154,10 @@
 			setup_ipi_vectors(dp->sale_vector & 0xf0);
 
 #ifdef SMP
+			fd = (struct ia64_fdesc *) os_boot_rendez;
 			result = ia64_sal_entry(SAL_SET_VECTORS,
-			    SAL_OS_BOOT_RENDEZ,
-			    ia64_tpa(FDESC_FUNC(os_boot_rendez)),
-			    ia64_tpa(FDESC_GP(os_boot_rendez)),
-			    0, 0, 0, 0);
+			    SAL_OS_BOOT_RENDEZ, ia64_tpa(fd->func),
+			    ia64_tpa(fd->gp), 0, 0, 0, 0);
 #endif
 
 			break;

==== //depot/projects/netperf_socket/sys/kern/vfs_bio.c#9 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/vfs_bio.c,v 1.442 2004/07/18 04:57:49 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/vfs_bio.c,v 1.443 2004/07/25 08:09:21 phk Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2571,8 +2571,9 @@
 			bsize = size;
 
 		if (vp->v_bsize != bsize) {
+#if 0
 			printf("WARNING: Wrong block size on vnode: %d should be %d\n", vp->v_bsize, bsize);
-			vprint("Please email phk at FreeBSD.org this info\n", vp);
+#endif
 			vp->v_bsize = bsize;
 		}
 

==== //depot/projects/netperf_socket/sys/sys/proc.h#19 (text+ko) ====

@@ -32,7 +32,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)proc.h	8.15 (Berkeley) 5/19/95
- * $FreeBSD: src/sys/sys/proc.h,v 1.387 2004/07/16 21:04:55 jhb Exp $
+ * $FreeBSD: src/sys/sys/proc.h,v 1.389 2004/07/25 00:47:11 rwatson Exp $
  */
 
 #ifndef _SYS_PROC_H_
@@ -161,7 +161,7 @@
 /*
  * Here we define the four structures used for process information.
  *
- * The first is the thread. It might be though of as a "Kernel
+ * The first is the thread. It might be thought of as a "Kernel
  * Schedulable Entity Context".
  * This structure contains all the information as to where a thread of
  * execution is now, or was when it was suspended, why it was suspended,
@@ -216,7 +216,7 @@
  * A process is the owner of all system resources allocated to a task
  * except CPU quanta.
  * All KSEGs under one process see, and have the same access to, these
- * resources (e.g. files, memory, sockets, permissions kqueues).
+ * resources (e.g. files, memory, sockets, credential, kqueues).
  * A process may compete for CPU cycles on the same basis as a
  * forked process cluster by spawning several KSEGRPs.
  */

==== //depot/projects/netperf_socket/sys/vm/vm_map.c#14 (text+ko) ====

@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_map.c,v 1.345 2004/07/24 07:40:35 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_map.c,v 1.346 2004/07/25 07:48:47 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -806,7 +806,7 @@
 		 (prev_entry->wired_count == 0) &&
 		 ((prev_entry->object.vm_object == NULL) ||
 		  vm_object_coalesce(prev_entry->object.vm_object,
-				     OFF_TO_IDX(prev_entry->offset),
+				     prev_entry->offset,
 				     (vm_size_t)(prev_entry->end - prev_entry->start),
 				     (vm_size_t)(end - prev_entry->end)))) {
 		/*
@@ -2781,7 +2781,7 @@
 		/* Grow the underlying object if applicable. */
 		if (stack_entry->object.vm_object == NULL ||
 		    vm_object_coalesce(stack_entry->object.vm_object,
-		    OFF_TO_IDX(stack_entry->offset),
+		    stack_entry->offset,
 		    (vm_size_t)(stack_entry->end - stack_entry->start),
 		    (vm_size_t)grow_amount)) {
 			map->size += (addr - stack_entry->end);

==== //depot/projects/netperf_socket/sys/vm/vm_object.c#8 (text+ko) ====

@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_object.c,v 1.326 2004/07/22 19:44:48 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_object.c,v 1.327 2004/07/25 07:48:47 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1824,17 +1824,14 @@
  *	Parameters:
  *		prev_object	First object to coalesce
  *		prev_offset	Offset into prev_object
- *		next_object	Second object into coalesce
- *		next_offset	Offset into next_object
- *
  *		prev_size	Size of reference to prev_object
- *		next_size	Size of reference to next_object
+ *		next_size	Size of reference to the second object
  *
  *	Conditions:
  *	The object must *not* be locked.
  */
 boolean_t
-vm_object_coalesce(vm_object_t prev_object, vm_pindex_t prev_pindex,
+vm_object_coalesce(vm_object_t prev_object, vm_ooffset_t prev_offset,
 	vm_size_t prev_size, vm_size_t next_size)
 {
 	vm_pindex_t next_pindex;
@@ -1865,7 +1862,7 @@
 
 	prev_size >>= PAGE_SHIFT;
 	next_size >>= PAGE_SHIFT;
-	next_pindex = prev_pindex + prev_size;
+	next_pindex = OFF_TO_IDX(prev_offset) + prev_size;
 
 	if ((prev_object->ref_count > 1) &&
 	    (prev_object->size != next_pindex)) {

==== //depot/projects/netperf_socket/sys/vm/vm_object.h#4 (text+ko) ====

@@ -57,7 +57,7 @@
  * any improvements or extensions that they make and grant Carnegie the
  * rights to redistribute these changes.
  *
- * $FreeBSD: src/sys/vm/vm_object.h,v 1.105 2004/07/22 19:44:49 alc Exp $
+ * $FreeBSD: src/sys/vm/vm_object.h,v 1.106 2004/07/25 07:48:47 alc Exp $
  */
 
 /*
@@ -200,7 +200,7 @@
 vm_object_t vm_object_allocate (objtype_t, vm_pindex_t);
 vm_object_t vm_object_allocate_wait (objtype_t, vm_pindex_t, int);
 void _vm_object_allocate (objtype_t, vm_pindex_t, vm_object_t);
-boolean_t vm_object_coalesce (vm_object_t, vm_pindex_t, vm_size_t, vm_size_t);
+boolean_t vm_object_coalesce(vm_object_t, vm_ooffset_t, vm_size_t, vm_size_t);
 void vm_object_collapse (vm_object_t);
 void vm_object_deallocate (vm_object_t);
 void vm_object_terminate (vm_object_t);


More information about the p4-projects mailing list