summaryrefslogtreecommitdiff
path: root/arch/um/include/linux
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2021-01-15 13:12:18 +0100
committerRichard Weinberger <richard@nod.at>2021-02-12 21:38:52 +0100
commitdde8b58d512703d396e02427de1053b4d912aa42 (patch)
tree1536dfa429585580bdc252afb9bc0639d937d830 /arch/um/include/linux
parentbfc58e2b98e99737409cd9f4d86a79677c5b887c (diff)
um: add a pseudo RTC
Add a pseudo RTC that simply is able to send an alarm signal waking up the system at a given time in the future. Since apparently timerfd_create() FDs don't support SIGIO, we use the sigio-creating helper thread, which just learned to do suspend/resume properly in the previous patch. For time-travel mode, OTOH, just add an event at the specified time in the future, and that's already sufficient to wake up the system at that point in time since suspend will just be in an "endless wait". For s2idle support also call pm_system_wakeup(). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/include/linux')
-rw-r--r--arch/um/include/linux/time-internal.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/um/include/linux/time-internal.h b/arch/um/include/linux/time-internal.h
index 8688e16e832b..759956ab0108 100644
--- a/arch/um/include/linux/time-internal.h
+++ b/arch/um/include/linux/time-internal.h
@@ -55,6 +55,9 @@ static inline void time_travel_wait_readable(int fd)
}
void time_travel_add_irq_event(struct time_travel_event *e);
+void time_travel_add_event_rel(struct time_travel_event *e,
+ unsigned long long delay_ns);
+bool time_travel_del_event(struct time_travel_event *e);
#else
struct time_travel_event {
};
@@ -80,6 +83,14 @@ static inline void time_travel_add_irq_event(struct time_travel_event *e)
{
WARN_ON(1);
}
+
+/*
+ * not inlines so the data structure need not exist,
+ * cause linker failures
+ */
+extern void time_travel_not_configured(void);
+#define time_travel_add_event_rel(...) time_travel_not_configured()
+#define time_travel_del_event(...) time_travel_not_configured()
#endif /* CONFIG_UML_TIME_TRAVEL_SUPPORT */
/*