/*
 * Copyright (c) 2019, 2021, 2023 Qualcomm Technologies, Inc.
 * All Rights Reserved.
 * Confidential and Proprietary - Qualcomm Technologies, Inc.
 */

#pragma once
/**
  @brief APIs to create a simulated ION buffer.
  @file  BufferAllocatorWrapperSim.h

  @addtogroup client_api_ion_sim
  @{
*/
#include <sys/types.h>
#include <stddef.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
typedef class BufferAllocatorSimHandle BufferAllocatorSimHandle;
#else
typedef struct BufferAllocatorSimHandle BufferAllocatorSimHandle;
#endif

BufferAllocatorSimHandle* CreateDmabufHeapBufferAllocatorSim(void);

void DmabufHeapBufferFreeSim(BufferAllocatorSimHandle* buffer_allocator);

int32_t mapGetFd(BufferAllocatorSimHandle *buffer_allocator);

void *mapGetBuffer(BufferAllocatorSimHandle *buffer_allocator);

size_t mapGetBufferSize(BufferAllocatorSimHandle *buffer_allocator);

int DmabufHeapAllocSim(BufferAllocatorSimHandle *buffer_allocator, size_t size, size_t alignment);

void freeSim(int32_t fd);

void* mapGetAddrFromFd(int32_t fd);

#ifdef __cplusplus
}
#endif

