سؤال

I'm currently implementing suspend/resume for embedded Linux on some non-android network device. The requirement is to implement a sleep manager task in kernel which would trigger system suspend in case that no task is currently running and there's no traffic pending. I guess there should be some similar implementation existing already but failed to find. Can anyone refer me to some kind of similar project on this subject? Thanks a lot

هل كانت مفيدة؟

المحلول

If you don't mind doing some porting, the wakelocks from the Android kernel is exactly what you seem to need. User space acquires a wakelock when it needs to remain active (e.g. a task is running or traffic is taking place) and releases it when it doesn't anymore. When the number of held wakelocks reaches zero, the kernel enters suspend mode.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top