diff options
author | Ben Cheng <bccheng@google.com> | 2013-03-11 15:24:27 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-03-11 15:24:27 -0700 |
commit | 2de9c3263aa57c89ba36b88c304f9c5658bfbfb5 (patch) | |
tree | f6973d004da28d3bf448623ee193b9097bab4b00 | |
parent | 7f92fce427043d9904c9e52d21bc548be1d78e3c (diff) | |
parent | 87392821575ceb19dbf92b02c8e4ded0e7dcf4fc (diff) | |
download | valgrind-2de9c3263aa57c89ba36b88c304f9c5658bfbfb5.tar.gz |
am 87392821: Merge "Add missing ioctl wrappers for Nexus 10."
* commit '87392821575ceb19dbf92b02c8e4ded0e7dcf4fc':
Add missing ioctl wrappers for Nexus 10.
-rw-r--r-- | main/Android.mk | 12 | ||||
-rw-r--r-- | main/coregrind/m_syswrap/syswrap-linux.c | 30 | ||||
-rw-r--r-- | main/include/vki/vki-linux.h | 2 |
3 files changed, 42 insertions, 2 deletions
diff --git a/main/Android.mk b/main/Android.mk index 744b6ed11..35057e22f 100644 --- a/main/Android.mk +++ b/main/Android.mk @@ -14,6 +14,8 @@ LOCAL_PATH:= $(call my-dir) +ANDROID_HARDWARE := ANDROID_HARDWARE_generic + ifneq ($(filter arm x86,$(TARGET_ARCH)),) common_cflags := \ @@ -26,8 +28,7 @@ common_cflags := \ -DVGPV_$(TARGET_ARCH)_linux_android=1 \ -DVG_PLATFORM=\"$(TARGET_ARCH)-linux\" \ -DVG_LIBDIR=\"/system/lib/valgrind\" \ - -DANDROID_SYMBOLS_DIR=\"/data/local/symbols\" \ - -DANDROID_HARDWARE_nexus_s + -DANDROID_SYMBOLS_DIR=\"/data/local/symbols\" common_includes := \ external/valgrind/main \ @@ -39,6 +40,13 @@ vex_ldflags := -nodefaultlibs ifeq ($(TARGET_ARCH),arm) tool_ldflags := -static -Wl,--build-id=none,-Ttext=0x38000000 -nodefaultlibs -nostartfiles -u _start -e_start + +# ioctl/syscall wrappers are device dependent +ifeq ($(TARGET_BOOTLOADER_BOARD_NAME),manta) +ANDROID_HARDWARE := ANDROID_HARDWARE_nexus_10 +endif +common_cflags += -D$(ANDROID_HARDWARE) + else tool_ldflags := -static -Wl,-Ttext=0x38000000 -nodefaultlibs -nostartfiles -u _start -e_start endif diff --git a/main/coregrind/m_syswrap/syswrap-linux.c b/main/coregrind/m_syswrap/syswrap-linux.c index fbee4f8d8..89c8c7733 100644 --- a/main/coregrind/m_syswrap/syswrap-linux.c +++ b/main/coregrind/m_syswrap/syswrap-linux.c @@ -4317,6 +4317,18 @@ PRE(sys_ioctl) break; } + +# if defined(ANDROID_HARDWARE_nexus_10) + + /* undocumented ioctl ids noted on the device */ + if (ARG2 >= 0xc0108000 && ARG2 <= 0xc1e8820b && ARG3 != 0) { + int size = (ARG2 >> 16) & 0x3fff; + PRE_MEM_WRITE("ioctl(GL_UNDOCUMENTED)", (Addr)ARG3, size); + return; + } + +# endif + // We now handle those that do look at ARG3 (and unknown ones fall into // this category). Nb: some of these may well belong in the // doesn't-use-ARG3 switch above. @@ -5520,6 +5532,7 @@ PRE(sys_ioctl) PRE_FIELD_WRITE("ioctl(BINDER_VERSION)", bv->protocol_version); } break; + # endif /* defined(VGPV_*_linux_android) */ case VKI_HCIINQUIRY: @@ -5542,6 +5555,9 @@ PRE(sys_ioctl) case VKI_KVM_RUN: break; + case VKI_EVIOCSSUSPENDBLOCK: + break; + default: /* EVIOC* are variable length and return size written on success */ switch (ARG2 & ~(_VKI_IOC_SIZEMASK << _VKI_IOC_SIZESHIFT)) { @@ -5649,6 +5665,15 @@ POST(sys_ioctl) /* END generic/emulator specific ioctls */ +# elif defined(ANDROID_HARDWARE_nexus_10) + + /* undocumented ioctl ids noted on the device */ + if (ARG2 >= 0xc0108000 && ARG2 <= 0xc1e8820b && ARG3 != 0) { + int size = (ARG2 >> 16) & 0x3fff; + POST_MEM_WRITE(ARG3, size); + } + + # else /* no ANDROID_HARDWARE_anything defined */ # warning "" @@ -5657,6 +5682,7 @@ POST(sys_ioctl) # warning "building for. Currently known values are" # warning "" # warning " ANDROID_HARDWARE_nexus_s Samsung Nexus S" +# warning " ANDROID_HARDWARE_nexus_10 Samsung Nexus 10" # warning " ANDROID_HARDWARE_generic Generic device (eg, Pandaboard)" # warning " ANDROID_HARDWARE_emulator x86 or arm emulator" # warning "" @@ -6539,6 +6565,10 @@ POST(sys_ioctl) case VKI_KVM_S390_INITIAL_RESET: break; + case VKI_EVIOCSSUSPENDBLOCK: + POST_MEM_WRITE( ARG3, sizeof(int) ); + break; + default: /* EVIOC* are variable length and return size written on success */ switch (ARG2 & ~(_VKI_IOC_SIZEMASK << _VKI_IOC_SIZESHIFT)) { diff --git a/main/include/vki/vki-linux.h b/main/include/vki/vki-linux.h index c18195e8e..8cefd8f63 100644 --- a/main/include/vki/vki-linux.h +++ b/main/include/vki/vki-linux.h @@ -2813,6 +2813,8 @@ struct vki_getcpu_cache { #define VKI_EVIOCGBIT(ev,len) _VKI_IOC(_VKI_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ +#define VKI_EVIOCSSUSPENDBLOCK _VKI_IOW('E', 0x91, int) /* set suspend block enable */ + /* * Event types */ |