Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sysmon Flags for existence of limit values need to b...



details:   https://anonhg.NetBSD.org/src/rev/b7c08e267825
branches:  trunk
changeset: 750484:b7c08e267825
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Jan 02 19:02:39 2010 +0000

description:
Flags for existence of limit values need to be propagated to the
event data.  Otherwise, they're not processed.

XXX This needs to be rethought.  While fixing it this way makes things
XXX "work", we really shouldn't need to replicate these flags.  The
XXX limits and their flags should be kept as part of the sensor data,
XXX and not part of the event-monitor data.  I'll work on this in the
XXX near future.

diffstat:

 sys/dev/sysmon/sysmon_envsys_events.c |  19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diffs (91 lines):

diff -r c855cc38d01f -r b7c08e267825 sys/dev/sysmon/sysmon_envsys_events.c
--- a/sys/dev/sysmon/sysmon_envsys_events.c     Sat Jan 02 18:06:57 2010 +0000
+++ b/sys/dev/sysmon/sysmon_envsys_events.c     Sat Jan 02 19:02:39 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.73 2010/01/01 15:41:25 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.74 2010/01/02 19:02:39 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.73 2010/01/01 15:41:25 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.74 2010/01/02 19:02:39 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -209,6 +209,7 @@
                if (error && error != EEXIST)
                        goto out;
                see->see_edata->upropset |= PROP_CRITMAX;
+               see->see_lims.sel_flags |= PROP_CRITMAX;
        }
 
        if (lims->sel_flags & PROP_WARNMAX) {
@@ -229,6 +230,7 @@
                if (error && error != EEXIST)
                        goto out;
                see->see_edata->upropset |= PROP_WARNMAX;
+               see->see_lims.sel_flags |= PROP_WARNMAX;
        }
 
        if (lims->sel_flags & PROP_WARNMIN) {
@@ -249,6 +251,7 @@
                if (error && error != EEXIST)
                        goto out;
                see->see_edata->upropset |= PROP_WARNMIN;
+               see->see_lims.sel_flags |= PROP_WARNMIN;
        }
 
        if (lims->sel_flags & PROP_CRITMIN) {
@@ -269,6 +272,7 @@
                if (error && error != EEXIST)
                        goto out;
                see->see_edata->upropset |= PROP_CRITMIN;
+               see->see_lims.sel_flags |= PROP_CRITMIN;
        }
 
        if (lims->sel_flags & PROP_BATTWARN) {
@@ -289,6 +293,7 @@
                if (error && error != EEXIST)
                        goto out;
                see->see_edata->upropset |= PROP_BATTWARN;
+               see->see_lims.sel_flags |= PROP_BATTWARN;
        }
 
        if (lims->sel_flags & PROP_BATTCAP) {
@@ -309,8 +314,12 @@
                if (error && error != EEXIST)
                        goto out;
                see->see_edata->upropset |= PROP_BATTCAP;
+               see->see_lims.sel_flags |= PROP_BATTCAP;
        }
 
+       if (lims->sel_flags & PROP_DRIVER_LIMITS)
+               see->see_lims.sel_flags |= PROP_DRIVER_LIMITS;
+
        DPRINTF(("%s: (%s) event registered (sensor=%s snum=%d type=%d "
            "critmin=%" PRIu32 " warnmin=%" PRIu32 " warnmax=%" PRIu32
            " critmax=%" PRIu32 " props 0x%04x)\n", __func__,
@@ -482,7 +491,7 @@
 
        /*
         * If driver provides a method to retrieve its internal limit
-        * values, call it and use thoe returned values as initial
+        * values, call it and use those returned values as initial
         * limits for event monitoring.
         */
        lims.sel_flags = 0;
@@ -503,8 +512,8 @@
         * If driver doesn't provide a way to "absorb" user-specified
         * limit values, we must monitor all limits ourselves
         */
-       else if (sed_t->sed_sme->sme_get_limits == NULL)
-               lims.sel_flags |= PROP_DRIVER_LIMITS;
+       else if (sed_t->sed_sme->sme_set_limits == NULL)
+               lims.sel_flags &= ~PROP_DRIVER_LIMITS;
 
        /* Register the events that were specified */
 



Home | Main Index | Thread Index | Old Index