From: Palmer Dabbelt <[email protected]>
Some systems (like 32-bit RISC-V) only have the 64-bit time_t versions
of syscalls. So handle the 32-bit time_t version of those being
undefined.
Fixes: f74f8bb246cf ("rv: Add rtapp_sleep monitor")
Signed-off-by: Palmer Dabbelt <[email protected]>
---
This seems a little ugly, as it'll blow up when neither is defined. Some
#if/#error type stuff seemed uglier, though, and that's the best I could come
up with. I figure anyone without either flavor of futex call is probably deep
enough in the weeds to just figure what blows up here...
---
kernel/trace/rv/monitors/sleep/sleep.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/trace/rv/monitors/sleep/sleep.c
b/kernel/trace/rv/monitors/sleep/sleep.c
index eea447b06907..c1347da69e9d 100644
--- a/kernel/trace/rv/monitors/sleep/sleep.c
+++ b/kernel/trace/rv/monitors/sleep/sleep.c
@@ -127,7 +127,9 @@ static void handle_sys_enter(void *data, struct pt_regs
*regs, long id)
mon = ltl_get_monitor(current);
switch (id) {
+#ifdef __NR_clock_nanosleep
case __NR_clock_nanosleep:
+#endif
#ifdef __NR_clock_nanosleep_time64
case __NR_clock_nanosleep_time64:
#endif
@@ -138,7 +140,9 @@ static void handle_sys_enter(void *data, struct pt_regs
*regs, long id)
ltl_atom_update(current, LTL_CLOCK_NANOSLEEP, true);
break;
+#ifdef __NR_futex
case __NR_futex:
+#endif
#ifdef __NR_futex_time64
case __NR_futex_time64:
#endif
--
2.50.1