Home | History | Annotate | Download | only in sysmon

Lines Matching defs:smw

161 	struct sysmon_wdog *smw;
172 if ((smw = sysmon_armed_wdog) != NULL) {
173 if ((smw->smw_mode & WDOG_MODE_MASK) == WDOG_MODE_UTICKLE) {
174 error = sysmon_wdog_setmode(smw,
175 WDOG_MODE_DISARMED, smw->smw_period);
179 smw->smw_name);
199 struct sysmon_wdog *smw;
208 smw = sysmon_wdog_find(wm->wm_name);
209 if (smw == NULL) {
214 wm->wm_mode = smw->smw_mode;
215 wm->wm_period = smw->smw_period;
216 sysmon_wdog_release(smw);
230 smw = sysmon_wdog_find(wm->wm_name);
231 if (smw == NULL) {
240 error = sysmon_wdog_setmode(smw, wm->wm_mode,
245 sysmon_wdog_release(smw);
254 if ((smw = sysmon_armed_wdog) != NULL) {
255 strcpy(wm->wm_name, smw->smw_name);
256 wm->wm_mode = smw->smw_mode;
257 wm->wm_period = smw->smw_period;
271 if ((smw = sysmon_armed_wdog) != NULL) {
272 error = (*smw->smw_tickle)(smw);
274 smw->smw_tickler = l->l_proc->p_pid;
281 if ((smw = sysmon_armed_wdog) != NULL)
282 *(pid_t *)data = smw->smw_tickler;
298 smw = LIST_FIRST(&sysmon_wdog_list);
299 i < sysmon_wdog_count && smw != NULL && error == 0;
301 smw = LIST_NEXT(smw, smw_list))
302 error = copyout(smw->smw_name, cp,
303 strlen(smw->smw_name) + 1);
323 sysmon_wdog_register(struct sysmon_wdog *smw)
333 if (strcmp(lsmw->smw_name, smw->smw_name) == 0) {
339 smw->smw_mode = WDOG_MODE_DISARMED;
340 smw->smw_tickler = (pid_t) -1;
341 smw->smw_refcnt = 0;
343 LIST_INSERT_HEAD(&sysmon_wdog_list, smw, smw_list);
356 sysmon_wdog_unregister(struct sysmon_wdog *smw)
361 while (smw->smw_refcnt > 0 && rc == 0) {
362 aprint_debug("%s: %d users remain\n", smw->smw_name,
363 smw->smw_refcnt);
368 LIST_REMOVE(smw, smw_list);
382 struct sysmon_wdog *smw = sysmon_armed_wdog;
384 if (smw == NULL)
387 if ((smw->smw_mode & WDOG_MODE_MASK) == WDOG_MODE_KTICKLE) {
388 if ((*smw->smw_tickle)(smw) != 0) {
390 "FAILED!\n", smw->smw_name);
404 struct sysmon_wdog *smw;
408 LIST_FOREACH(smw, &sysmon_wdog_list, smw_list) {
409 if (strcmp(smw->smw_name, name) == 0)
413 if (smw != NULL)
414 smw->smw_refcnt++;
417 return smw;
426 sysmon_wdog_release(struct sysmon_wdog *smw)
430 KASSERT(smw->smw_refcnt != 0);
431 smw->smw_refcnt--;
437 sysmon_wdog_ref(struct sysmon_wdog *smw)
440 smw->smw_refcnt++;
450 sysmon_wdog_setmode(struct sysmon_wdog *smw, int mode, u_int period)
452 u_int operiod = smw->smw_period;
453 int omode = smw->smw_mode;
456 smw->smw_period = period;
457 smw->smw_mode = mode;
461 if (smw != sysmon_armed_wdog) {
481 error = (*smw->smw_setmode)(smw);
485 smw->smw_period = operiod;
486 smw->smw_mode = omode;
490 smw->smw_tickler = (pid_t) -1;
491 sysmon_wdog_release(smw);
495 sysmon_armed_wdog = smw;
496 sysmon_wdog_ref(smw);
499 WDOG_PERIOD_TO_TICKS(smw->smw_period) / 2,
515 struct sysmon_wdog *smw;
518 if ((smw = sysmon_armed_wdog) != NULL) {
519 if ((*smw->smw_tickle)(smw) != 0) {
521 "FAILED!\n", smw->smw_name);
527 WDOG_PERIOD_TO_TICKS(smw->smw_period) / 2,
541 struct sysmon_wdog *smw;
547 if ((smw = sysmon_armed_wdog) != NULL) {
548 if (sysmon_wdog_setmode(smw, WDOG_MODE_DISARMED,
549 smw->smw_period))
551 smw->smw_name);