[Android] [PATCH] Add missing eventfd syscall for 2.2
XilasZ
xilasz at gmail.com
Thu Apr 26 10:27:15 CEST 2012
I'll try, this week end, thanks.
On Thu, Apr 26, 2012 at 4:05 AM, Rafaël Carré <funman at videolan.org> wrote:
> ---
> Does this help?
>
> vlc-android/jni/Android.mk | 2 +-
> vlc-android/jni/eventfd.c | 26 ++++++++++++++++++++++++++
> 2 files changed, 27 insertions(+), 1 deletion(-)
> create mode 100644 vlc-android/jni/eventfd.c
>
> diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk
> index d9b8ba5..c6642e6 100644
> --- a/vlc-android/jni/Android.mk
> +++ b/vlc-android/jni/Android.mk
> @@ -3,7 +3,7 @@ include $(CLEAR_VARS)
>
> LOCAL_MODULE := libvlcjni
>
> -LOCAL_SRC_FILES := libvlcjni.c aout.c thumbnailer.c pthread-condattr.c
> pthread-rwlocks.c
> +LOCAL_SRC_FILES := libvlcjni.c aout.c thumbnailer.c pthread-condattr.c
> pthread-rwlocks.c eventfd.c
>
> LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/include
>
> diff --git a/vlc-android/jni/eventfd.c b/vlc-android/jni/eventfd.c
> new file mode 100644
> index 0000000..d58d1d2
> --- /dev/null
> +++ b/vlc-android/jni/eventfd.c
> @@ -0,0 +1,26 @@
> +#include <sys/linux-syscalls.h>
> +#include <errno.h>
> +
> +int eventfd(unsigned int initval, int flags)
> +{
> + int ret;
> + int syscall_nr = __NR_eventfd2;
> +
> + asm(
> + "mov r0, %[initval] \n\t"
> + "mov r1, %[flags] \n\t"
> + "mov r7, %[nr] \n\t"
> + "svc #0 \n\t"
> + "mov %[ret], r0 \n\t"
> + : [ret] "=r" (ret)
> + : [initval] "r" (initval), [flags] "r" (flags), [nr] "r" (syscall_nr)
> + : "r7"
> + );
> +
> + if (ret < 0) {
> + errno = -ret;
> + return -1;
> + }
> +
> + return ret;
> +}
> --
> 1.7.9.5
> _______________________________________________
> Android mailing list
> Android at videolan.org
> http://mailman.videolan.org/listinfo/android
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/android/attachments/20120426/8baa9533/attachment.html>
More information about the Android
mailing list