Power: add an API to log wakeup reasons

Add API log_wakeup_reason() and expose it to userspace via sysfs path
/sys/kernel/wakeup_reasons/last_resume_reason

Change-Id: I5be7f1183b368c968cbde6f8504e74ff68e76ab4
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
POWER: fix compile warnings in log_wakeup_reason

Change I81addaf420f1338255c5d0638b0d244a99d777d1 introduced compile
warnings, fix these.

Change-Id: Ib225cafbe249bef82721e9c52753967bcef5f215
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Power: Changes the permission to read only for sysfs file /sys/kernel/wakeup_reasons/last_resume_reason

Change-Id: Iccb2dc33081f3135e3b860abd4fb84a548df9e03
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
prctl: adds PR_SET_TIMERSLACK_PID for setting timer slack of an arbitrary thread.

Second argument is similar to PR_SET_TIMERSLACK, if non-zero then the
slack is set to that value otherwise sets it to the default for the thread.

Takes PID of the thread as the third argument.

This allows power/performance management software to set timer slack for
other threads according to its policy for the thread (such as when the
thread is designated foreground vs. background activity)

Change-Id: I81af1c2f5a97b9e4273da16fa8a0628f14364a76
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
xt_IDLETIMER: Use uevent instead of new netlink msg type.
Ported from:

commit 70fa6a5d5019638d46406b29789284923b4bf89f
Author: JP Abgrall <jpa@google.com>
Date:   Fri May 4 14:26:57 2012 -0700

    netfilter: xt_IDLETIMER: Use uevent instead of new netlink msg type

    Send netlink message notifications using a uevent with
      subsystem=xt_idletimer
      INTERFACE=...
      STATE={active,inactive}
    instead of needing a new netlink message type.
    Revert the netlink.h change added by commit
      beb914e987cbbd368988d2b94a6661cb907c4d5a

    Change-Id: I6881936bf754f3367ff3c8f6c1e9661cec0357d4
    Signed-off-by: JP Abgrall <jpa@google.com>

commit 43c75b7d23b947539508c8e9deb026333194d444
Author: Ashish Sharma <ashishsharma@google.com>
Date:   Thu Mar 29 13:02:27 2012 -0700

    xt_IDLETIMER: Add new netlink msg type for IDLETIMER.

    Send notifications when the label becomes active after an idle period.
    Send netlink message notifications in addition to sysfs notifications.

    Change-Id: I31677ef00c94b5f82c8457e5bf9e5e584c23c523
    Signed-off-by: Ashish Sharma <ashishsharma@google.com>