Files
android_kernel_xiaomi_sm8450/include/linux/ion.h
Isaac J. Manjarres 389e2406d3 ANDROID: staging: android: ion: Expose ion_alloc() to kernel space
Expose ion_alloc() to kernel space clients. Users of this
function will receive a dma-buf structure for sharing
the ION buffer that was allocated.

Bug: 133508579
Test: ion-unit-tests
Change-Id: I410044127ba92a759a79c65e422b0b75b74e2159
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-08-01 07:18:48 -07:00

27 lines
550 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
*/
#ifndef _ION_KERNEL_H
#define _ION_KERNEL_H
#include <linux/dma-buf.h>
#include <linux/err.h>
#ifdef CONFIG_ION
/*
* Allocates an ION buffer.
*/
struct dma_buf *ion_alloc(size_t len, unsigned int heap_id_mask,
unsigned int flags);
#else
static inline struct dma_buf *ion_alloc(size_t len, unsigned int heap_id_mask,
unsigned int flags)
{
return ERR_PTR(-ENOMEM);
}
#endif /* CONFIG_ION */
#endif /* _ION_KERNEL_H */