diff options
author | Dmitry Antipov <dmitry.antipov@linaro.org> | 2013-02-14 17:23:32 +0400 |
---|---|---|
committer | Dmitry Antipov <dmitry.antipov@linaro.org> | 2013-02-14 17:23:32 +0400 |
commit | 49923809689076225ab0c1c9df74f031b9d4310e (patch) | |
tree | 041c3c5d0e3f61ba953309e2124b915c4986716b | |
parent | 007c4ba9da5b52bc41d3d6385b1b92ff88e0ff1e (diff) | |
download | linaro-android-kernel-test-49923809689076225ab0c1c9df74f031b9d4310e.tar.gz |
Sync-up with the latest juice-aosp kernel (as of build 121).
Since frameworks/native/include/utils/ashmem.h is a subject to removal,
do not rely on this header and use the same header as bionic.
Adjust ioctl names to match ones in kernel header.
-rw-r--r-- | ashmemtest-basic/Android.mk | 1 | ||||
-rw-r--r-- | ashmemtest-basic/ashmem.h | 6 | ||||
-rw-r--r-- | ashmemtest-basic/ashmemtest.c | 18 | ||||
-rw-r--r-- | ashmemtest-expanded/Android.mk | 1 | ||||
-rw-r--r-- | ashmemtest-expanded/ashmem.h | 6 | ||||
-rw-r--r-- | ashmemtest-expanded/ashmemtest-expanded.l | 2 |
6 files changed, 16 insertions, 18 deletions
diff --git a/ashmemtest-basic/Android.mk b/ashmemtest-basic/Android.mk index e6d401c..0c70ebf 100644 --- a/ashmemtest-basic/Android.mk +++ b/ashmemtest-basic/Android.mk @@ -4,6 +4,5 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := ashmemtest.c LOCAL_MODULE := ashmemtest LOCAL_MODULE_TAGS := optional tests -LOCAL_C_INCLUDES := $(TOP)/frameworks/native/include include $(BUILD_EXECUTABLE) diff --git a/ashmemtest-basic/ashmem.h b/ashmemtest-basic/ashmem.h index 519fcfb..7218ec5 100644 --- a/ashmemtest-basic/ashmem.h +++ b/ashmemtest-basic/ashmem.h @@ -26,8 +26,8 @@ #define ASHMEM_WAS_REAPED 1 /* Return values from ASHMEM_ISPINNED: Is the mapping now pinned or unpinned? */ -#define ASHMEM_NOW_UNPINNED 0 -#define ASHMEM_NOW_PINNED 1 +#define ASHMEM_IS_UNPINNED 0 +#define ASHMEM_IS_PINNED 1 #define __ASHMEMIOC 0x77 @@ -39,7 +39,7 @@ #define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6) #define ASHMEM_PIN _IOW(__ASHMEMIOC, 7, struct ashmem_pin) #define ASHMEM_UNPIN _IOW(__ASHMEMIOC, 8, struct ashmem_pin) -#define ASHMEM_ISPINNED _IOW(__ASHMEMIOC, 9, struct ashmem_pin) +#define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9) #define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10) #endif /* _UTILS_ASHMEM_H */ diff --git a/ashmemtest-basic/ashmemtest.c b/ashmemtest-basic/ashmemtest.c index 0b20952..8d1be39 100644 --- a/ashmemtest-basic/ashmemtest.c +++ b/ashmemtest-basic/ashmemtest.c @@ -16,8 +16,8 @@ #include <stdarg.h> #ifdef ANDROID -/* In-tree compilation, use frameworks/native/include/utils/ashmem.h */ -#include <utils/ashmem.h> +/* In-tree compilation */ +#include <linux/ashmem.h> #else /* Freestanding compilation, use local copy */ #include "ashmem.h" @@ -275,26 +275,26 @@ void ashmem_pin_status (void) /* make sure we can examine zero-sized region (means everything onward) */ pin.offset = 0, pin.len = 0; - ret = ioctl (fd, ASHMEM_ISPINNED, &pin); + ret = ioctl (fd, ASHMEM_GET_PIN_STATUS, &pin); if (ret < 0) fatal (errno, "should be able to ask status of zero-sized region"); /* make sure we can't examine across page boundaries */ pin.offset = pagesize + 11, pin.len = pagesize + 17; - ret = ioctl (fd, ASHMEM_ISPINNED, &pin); + ret = ioctl (fd, ASHMEM_GET_PIN_STATUS, &pin); if (ret >= 0) fatal (errno, "should not be able to ask across page boundaries"); /* make sure we can't examine beyond the region */ pin.offset = size * 2, pin.len = pagesize; - ret = ioctl (fd, ASHMEM_ISPINNED, &pin); + ret = ioctl (fd, ASHMEM_GET_PIN_STATUS, &pin); if (ret >= 0) fatal (errno, "should not be able to ask beyond the region"); /* make sure it's initially pinned */ pin.offset = 0, pin.len = size; - ret = ioctl (fd, ASHMEM_ISPINNED, &pin); - if (ret != ASHMEM_NOW_PINNED) + ret = ioctl (fd, ASHMEM_GET_PIN_STATUS, &pin); + if (ret != ASHMEM_IS_PINNED) fatal (0, "expect initially pinned region"); /* unpin it */ @@ -305,8 +305,8 @@ void ashmem_pin_status (void) /* make sure it's not pinned now */ pin.offset = 0, pin.len = size; - ret = ioctl (fd, ASHMEM_ISPINNED, &pin); - if (ret != ASHMEM_NOW_UNPINNED) + ret = ioctl (fd, ASHMEM_GET_PIN_STATUS, &pin); + if (ret != ASHMEM_IS_UNPINNED) fatal (0, "expect unpinned region"); if (munmap (mem, size)) diff --git a/ashmemtest-expanded/Android.mk b/ashmemtest-expanded/Android.mk index 75aa6ef..33df3ef 100644 --- a/ashmemtest-expanded/Android.mk +++ b/ashmemtest-expanded/Android.mk @@ -4,6 +4,5 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := ashmemtest-expanded.l LOCAL_MODULE := ashmemtest-expanded LOCAL_MODULE_TAGS := optional tests -LOCAL_C_INCLUDES := $(TOP)/frameworks/native/include include $(BUILD_EXECUTABLE) diff --git a/ashmemtest-expanded/ashmem.h b/ashmemtest-expanded/ashmem.h index 519fcfb..7218ec5 100644 --- a/ashmemtest-expanded/ashmem.h +++ b/ashmemtest-expanded/ashmem.h @@ -26,8 +26,8 @@ #define ASHMEM_WAS_REAPED 1 /* Return values from ASHMEM_ISPINNED: Is the mapping now pinned or unpinned? */ -#define ASHMEM_NOW_UNPINNED 0 -#define ASHMEM_NOW_PINNED 1 +#define ASHMEM_IS_UNPINNED 0 +#define ASHMEM_IS_PINNED 1 #define __ASHMEMIOC 0x77 @@ -39,7 +39,7 @@ #define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6) #define ASHMEM_PIN _IOW(__ASHMEMIOC, 7, struct ashmem_pin) #define ASHMEM_UNPIN _IOW(__ASHMEMIOC, 8, struct ashmem_pin) -#define ASHMEM_ISPINNED _IOW(__ASHMEMIOC, 9, struct ashmem_pin) +#define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9) #define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10) #endif /* _UTILS_ASHMEM_H */ diff --git a/ashmemtest-expanded/ashmemtest-expanded.l b/ashmemtest-expanded/ashmemtest-expanded.l index f13c7a5..8372be6 100644 --- a/ashmemtest-expanded/ashmemtest-expanded.l +++ b/ashmemtest-expanded/ashmemtest-expanded.l @@ -15,7 +15,7 @@ #include <sys/sysinfo.h> #ifdef ANDROID -#include <utils/ashmem.h> +#include <linux/ashmem.h> #else #include "ashmem.h" #endif |