/* this may fail if the RTC hasn't been initialized */
repeat:
status = rtc_read_time(rtc, &alm.time); if (status < 0) {
printk(err_readtime, dev_name(&rtc->dev), status); return;
}
now = rtc_tm_to_time64(&alm.time);
status = rtc_set_alarm(rtc, &alm); if (status < 0) {
printk(err_wakealarm, dev_name(&rtc->dev), status); return;
}
if (state == PM_SUSPEND_MEM) {
printk(info_test, pm_states[state]);
status = pm_suspend(state); if (status == -ENODEV)
state = PM_SUSPEND_STANDBY;
} if (state == PM_SUSPEND_STANDBY) {
printk(info_test, pm_states[state]);
status = pm_suspend(state); if (status < 0)
state = PM_SUSPEND_TO_IDLE;
} if (state == PM_SUSPEND_TO_IDLE) {
printk(info_test, pm_states[state]);
status = pm_suspend(state);
}
if (status < 0)
printk(err_suspend, status);
test_repeat_count_current++; if (test_repeat_count_current < test_repeat_count_max) goto repeat;
/* Some platforms can't detect that the alarm triggered the *wakeup,or(accordingly)disableitafteritafterwards. *It'ssupposedtogiveoneshotbehavior;cope.
*/
alm.enabled = false;
rtc_set_alarm(rtc, &alm);
}
if (state_label && !strcmp(test_state_label, state_label)) break;
} if (test_state == PM_SUSPEND_MAX) {
printk(warn_bad_state, test_state_label); return0;
}
/* RTCs have initialized by now too ... can we use one? */
dev = class_find_device(&rtc_class, NULL, NULL, has_wakealarm); if (dev) {
rtc = rtc_class_open(dev_name(dev));
put_device(dev);
} if (!rtc) {
printk(warn_no_rtc); return0;
}
/* go for it */
test_wakealarm(rtc, test_state);
rtc_class_close(rtc); return0;
}
late_initcall(test_suspend);
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-09-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.