Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Dec 2007 18:04:43 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 131533 for review
Message-ID:  <200712241804.lBOI4hh9085251@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=131533

Change 131533 by rwatson@rwatson_cinnamon on 2007/12/24 18:03:52

	Integrate zcopybpf.

Affected files ...

.. //depot/projects/zcopybpf/src/sys/dev/acpica/acpi_thermal.c#4 integrate
.. //depot/projects/zcopybpf/src/sys/dev/snp/snp.c#5 integrate

Differences ...

==== //depot/projects/zcopybpf/src/sys/dev/acpica/acpi_thermal.c#4 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.65 2007/10/20 23:23:13 julian Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.66 2007/12/24 16:32:14 ume Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -133,6 +133,7 @@
 static int	acpi_tz_active_sysctl(SYSCTL_HANDLER_ARGS);
 static int	acpi_tz_cooling_sysctl(SYSCTL_HANDLER_ARGS);
 static int	acpi_tz_temp_sysctl(SYSCTL_HANDLER_ARGS);
+static int	acpi_tz_passive_sysctl(SYSCTL_HANDLER_ARGS);
 static void	acpi_tz_notify_handler(ACPI_HANDLE h, UINT32 notify,
 				       void *context);
 static void	acpi_tz_signal(struct acpi_tz_softc *sc, int flags);
@@ -293,6 +294,21 @@
     SYSCTL_ADD_OPAQUE(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
 		      OID_AUTO, "_ACx", CTLFLAG_RD, &sc->tz_zone.ac,
 		      sizeof(sc->tz_zone.ac), "IK", "");
+    SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
+		    OID_AUTO, "_TC1", CTLTYPE_INT | CTLFLAG_RW,
+		    sc, offsetof(struct acpi_tz_softc, tz_zone.tc1),
+		    acpi_tz_passive_sysctl, "I",
+		    "thermal constant 1 for passive cooling");
+    SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
+		    OID_AUTO, "_TC2", CTLTYPE_INT | CTLFLAG_RW,
+		    sc, offsetof(struct acpi_tz_softc, tz_zone.tc2),
+		    acpi_tz_passive_sysctl, "I",
+		    "thermal constant 2 for passive cooling");
+    SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
+		    OID_AUTO, "_TSP", CTLTYPE_INT | CTLFLAG_RW,
+		    sc, offsetof(struct acpi_tz_softc, tz_zone.tsp),
+		    acpi_tz_passive_sysctl, "I",
+		    "thermal sampling period for passive cooling");
 
     /*
      * Create thread to service all of the thermal zones.  Register
@@ -748,6 +764,30 @@
     return (0);
 }
 
+static int
+acpi_tz_passive_sysctl(SYSCTL_HANDLER_ARGS)
+{
+    struct acpi_tz_softc	*sc;
+    int				val, *val_ptr;
+    int				error;
+
+    sc = oidp->oid_arg1;
+    val_ptr = (int *)((uintptr_t)sc + oidp->oid_arg2);
+    val = *val_ptr;
+    error = sysctl_handle_int(oidp, &val, 0, req);
+
+    /* Error or no new value */
+    if (error != 0 || req->newptr == NULL)
+	return (error);
+
+    /* Only allow changing settings if override is set. */
+    if (!acpi_tz_override)
+	return (EPERM);
+
+    *val_ptr = val;
+    return (0);
+}
+
 static void
 acpi_tz_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context)
 {

==== //depot/projects/zcopybpf/src/sys/dev/snp/snp.c#5 (text+ko) ====

@@ -15,7 +15,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/snp/snp.c,v 1.106 2007/12/03 14:02:27 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/snp/snp.c,v 1.107 2007/12/24 13:47:16 kib Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -466,7 +466,8 @@
 	free(snp->snp_buf, M_SNP);
 	snp->snp_flags &= ~SNOOP_OPEN;
 	dev->si_drv1 = NULL;
-	destroy_dev_sched_cb(dev, snp_detach, snp);
+	snp_detach(snp);
+	destroy_dev_sched(dev);
 
 	return (0);
 }
@@ -491,7 +492,7 @@
     struct thread *td)
 {
 	struct snoop *snp;
-	struct tty *tp, *tpo;
+	struct tty *tp;
 	struct cdev *tdev;
 	struct file *fp;
 	int s;
@@ -502,8 +503,6 @@
 		s = *(int *)data;
 		if (s < 0)
 			return (snp_down(snp));
-		if (snp->snp_tty != NULL)
-			return (EBUSY);
 
 		if (fget(td, s, &fp) != 0)
 			return (EINVAL);
@@ -516,6 +515,9 @@
 		tdev = fp->f_vnode->v_rdev;
 		fdrop(fp, td);
 
+		if (snp->snp_tty != NULL)
+			return (EBUSY);
+
 		tp = snpdevtotty(tdev);
 		if (!tp)
 			return (EINVAL);
@@ -523,13 +525,6 @@
 			return (EBUSY);
 
 		s = spltty();
-
-		if (snp->snp_target == NULL) {
-			tpo = snp->snp_tty;
-			if (tpo)
-				tpo->t_state &= ~TS_SNOOP;
-		}
-
 		tp->t_state |= TS_SNOOP;
 		snp->snp_olddisc = tp->t_line;
 		tp->t_line = snooplinedisc;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712241804.lBOI4hh9085251>