On Dec 19, 2012 2:13 AM, "Dmitry Antipov" dmitry.antipov@linaro.org wrote:
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...
So, I'll double check aosp common.bit, but I think the Google kernel and k.org are consistent. Not sure why the arm kernel would be different.
Given the confusion we should check w android devs. I suspect the issue is no one really uses the is pinned/get status interfaces, so this inconsistency has gone unnoticed.
Thanks -john