From ec1f2815e968bbdaebfd54b62c5b037cc6621d80 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Sat, 1 Dec 2012 08:24:52 -0800 Subject: libion: Support for old ION API * Kernel 3.0 doesn't have heap_mask or SYNC ioctl, so add a board flag so that proprietary code that uses the old kernel API directly still works. Change-Id: I4227c79a5de46c60eeebd2e16ca88dd6d580916a --- libion/Android.mk | 3 +++ libion/ion.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/libion/Android.mk b/libion/Android.mk index e2027cba..0f023d66 100644 --- a/libion/Android.mk +++ b/libion/Android.mk @@ -3,6 +3,9 @@ ifneq ($(TARGET_BOARD_PLATFORM),omap3) LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) +ifeq ($(BOARD_HAVE_OLD_ION_API),true) +LOCAL_CFLAGS += -DOLD_ION_API +endif LOCAL_SRC_FILES := ion.c LOCAL_MODULE := libion LOCAL_MODULE_TAGS := optional diff --git a/libion/ion.c b/libion/ion.c index 020c35bc..4cd1697c 100644 --- a/libion/ion.c +++ b/libion/ion.c @@ -61,7 +61,9 @@ int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, struct ion_allocation_data data = { .len = len, .align = align, +#ifndef OLD_ION_API .heap_mask = heap_mask, +#endif .flags = flags, }; @@ -149,8 +151,12 @@ int ion_import(int fd, int share_fd, struct ion_handle **handle) int ion_sync_fd(int fd, int handle_fd) { +#ifdef OLD_ION_API + return 0; +#else struct ion_fd_data data = { .fd = handle_fd, }; return ion_ioctl(fd, ION_IOC_SYNC, &data); +#endif } -- cgit v1.2.3