• Johannes Berg's avatar
    um: Simplify os_idle_sleep() and sleep longer · 49da38a3
    Johannes Berg authored
    There really is no reason to pass the amount of time we should
    sleep, especially since it's just hard-coded to one second.
    
    Additionally, one second isn't really all that long, and as we
    are expecting to be woken up by a signal, we can sleep longer
    and avoid doing some work every second, so replace the current
    clock_nanosleep() with just an empty select() that can _only_
    be woken up by a signal.
    
    We can also remove the deliver_alarm() since we don't need to
    do that when we got e.g. SIGIO that woke us up, and if we got
    SIGALRM the signal handler will actually (have) run, so it's
    just unnecessary extra work.
    
    Similarly, in time-travel mode, just program the wakeup event
    from idle to be S64_MAX, which is basically the most you could
    ever simulate to. Of course, you should already have an event
    in the list that's earlier and will cause a wakeup, normally
    that's the regular timer interrupt, though in suspend it may
    (later) also be an RTC event. Since actually getting to this
    point would be a bug and you can't ever get out again, panic()
    on it in the time control code.
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    Acked-By: default avatarAnton Ivanov <anton.ivanov@cambridgegreys.com>
    Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
    49da38a3
os.h 11.1 KB