diff mbox

[1/2] Porting to Android system

Message ID 1338360432-13377-1-git-send-email-kejun.zhou@linaro.org
State New
Headers show

Commit Message

Kejun ZHOU May 30, 2012, 6:47 a.m. UTC
From: kejun.zhou <dp583@stebjsxu0119.(none)>

Signed-off-by: kejun.zhou <kejun.zhou@linaro.org>
---
 cpuidle/cpuidle_killer.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

Comments

Amit Kucheria May 30, 2012, 7:11 a.m. UTC | #1
Just some nits below:

On Wed, May 30, 2012 at 2:47 PM, kejun.zhou <kejun.zhou@linaro.org> wrote:
> From: kejun.zhou <dp583@stebjsxu0119.(none)>
>
> Signed-off-by: kejun.zhou <kejun.zhou@linaro.org>
> ---
>  cpuidle/cpuidle_killer.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/cpuidle/cpuidle_killer.c b/cpuidle/cpuidle_killer.c
> index 67a675e..c8910f4 100644
> --- a/cpuidle/cpuidle_killer.c
> +++ b/cpuidle/cpuidle_killer.c
> @@ -2,7 +2,17 @@
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <unistd.h>
> +#ifndef ANDROID
>  #include <sys/timex.h>
> +#else
> +// As of 4.0.4, Bionic doesn't provide the timex/adjtimex interface
> +// However, the kernel does...

Please use C-style comments everywhere /* */

> +#include <linux/timex.h> // for struct timex
> +#include <asm/unistd.h> // for __NR_adjtimex
> +static int adjtimex(struct timex *buf) {
> +       return syscall(__NR_adjtimex, buf);
> +}
> +#endif
>  #include <sys/types.h>
>  #include <sys/wait.h>
>  #include <sys/param.h>
> --
> 1.7.0.4
diff mbox

Patch

diff --git a/cpuidle/cpuidle_killer.c b/cpuidle/cpuidle_killer.c
index 67a675e..c8910f4 100644
--- a/cpuidle/cpuidle_killer.c
+++ b/cpuidle/cpuidle_killer.c
@@ -2,7 +2,17 @@ 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#ifndef ANDROID
 #include <sys/timex.h>
+#else
+// As of 4.0.4, Bionic doesn't provide the timex/adjtimex interface
+// However, the kernel does...
+#include <linux/timex.h> // for struct timex
+#include <asm/unistd.h> // for __NR_adjtimex
+static int adjtimex(struct timex *buf) {
+       return syscall(__NR_adjtimex, buf);
+}
+#endif
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/param.h>