diff options
| author | pgoyette <pgoyette@NetBSD.org> | 2012-12-11 15:39:06 +0000 |
|---|---|---|
| committer | pgoyette <pgoyette@NetBSD.org> | 2012-12-11 15:39:06 +0000 |
| commit | ceb1a073d8d5574941e574e346b91785fbf64850 (patch) | |
| tree | c47a568af1cd8182ace4c732fe6877fc1f4963e2 /sys/dev/sysmon/sysmonvar.h | |
| parent | d4b732cbb248adcc784fd9895820387f4c23d8f5 (diff) | |
Replace a couple of many-line #define with equivalent code loops.
No functional change intended, and atf tests (using swsensor(4)) still
pass 100%
Diffstat (limited to 'sys/dev/sysmon/sysmonvar.h')
| -rw-r--r-- | sys/dev/sysmon/sysmonvar.h | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/sys/dev/sysmon/sysmonvar.h b/sys/dev/sysmon/sysmonvar.h index b17cc08896b..4085a1e517d 100644 --- a/sys/dev/sysmon/sysmonvar.h +++ b/sys/dev/sysmon/sysmonvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: sysmonvar.h,v 1.43 2012/07/16 13:55:01 pgoyette Exp $ */ +/* $NetBSD: sysmonvar.h,v 1.44 2012/12/11 15:39:06 pgoyette Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -63,14 +63,31 @@ struct workqueue; /* * Thresholds/limits that are being monitored */ + +enum envsys_lims { + ENVSYS_LIM_CRITMAX, + ENVSYS_LIM_WARNMAX, + ENVSYS_LIM_WARNMIN, + ENVSYS_LIM_CRITMIN, + ENVSYS_LIM_LASTLIM +}; + struct sysmon_envsys_lim { - int32_t sel_critmax; - int32_t sel_warnmax; - int32_t sel_warnmin; - int32_t sel_critmin; + int32_t critmax; + int32_t warnmax; + int32_t warnmin; + int32_t critmin; }; -typedef struct sysmon_envsys_lim sysmon_envsys_lim_t; +typedef union { + int32_t sel_limit_list[ENVSYS_LIM_LASTLIM]; + struct sysmon_envsys_lim sel_limits; +} sysmon_envsys_lim_t; + +#define sel_critmax sel_limits.critmax +#define sel_warnmax sel_limits.warnmax +#define sel_warnmin sel_limits.warnmin +#define sel_critmin sel_limits.critmin /* struct used by a sensor */ struct envsys_data { |
