On 12/19/2012 04:55 AM, John Stultz wrote:
I was playing with your current ashmem unit test and needed the following trivial patch to get it all (seemingly) working against Linus' head kernel w/ ubuntu userland.
Ashmem unit test currently targets ashmem kernel driver from:
http://linux-arm.org/git?p=linux-2.6-armdroid.git%3Ba=shortlog%3Bh=refs/head...
which is a bit different from k.org version (we use armdroid version for juice-aosp because 64-bit developement goes there). Note that armdroid version has bug: ashmem.c expects that _IOC_SIZE (ioctl_number) == sizeof (struct ashmem_pin) for ASHMEM_GET_PIN_STATUS, but ashmem.h encodes ASHMEM_GET_PIN_STATUS with _IO(XXX), e.g. with zero _IOC_SIZE.
Since ASHMEM_GET_PIN_STATUS ioctl (a.k.a. ASHMEM_ISPINNED in user-space Android headers) uses struct ashmem_pin as 3rd arg, I believe that the correct definition for the user space is:
#define ASHMEM_ISPINNED _IOW(__ASHMEMIOC, 9, struct ashmem_pin)
and for the kernel, respectively:
#define ASHMEM_GET_PIN_STATUS _IOW(__ASHMEMIOC, 9, struct ashmem_pin)
This is the way I make it work in juice-aosp:
http://git.linaro.org/gitweb?p=people/antipov/linux-aarch64.git%3Ba=commit%3...
Dmitry