Squashed backup commit (no shallow-clone history issues) of xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream commit 9eece662e) plus all fixes applied to get everpal_defconfig building clean against a modern (GCC 15.2.0) toolchain -- see the previous commit message on the lineage-23.2 branch (also in this repo history is not available here since this is a squashed snapshot; full incremental history lives in the local DL380 checkout and the upstream GitHub remote). Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
48 lines
1.8 KiB
C
48 lines
1.8 KiB
C
/*
|
|
* Copyright (C) 2018 MediaTek Inc.
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#ifndef TRUSTED_MEM_API_H
|
|
#define TRUSTED_MEM_API_H
|
|
|
|
enum TRUSTED_MEM_REQ_TYPE {
|
|
TRUSTED_MEM_REQ_SVP = 0,
|
|
TRUSTED_MEM_REQ_PROT = 1,
|
|
TRUSTED_MEM_REQ_WFD = 2,
|
|
TRUSTED_MEM_REQ_HAPP = 3,
|
|
TRUSTED_MEM_REQ_HAPP_EXTRA = 4,
|
|
TRUSTED_MEM_REQ_SDSP = 5,
|
|
TRUSTED_MEM_REQ_SDSP_SHARED = 6,
|
|
TRUSTED_MEM_REQ_2D_FR = 7,
|
|
};
|
|
|
|
/**********************************************************/
|
|
/**** Trusted Memory Common APIs for ION kernel driver ****/
|
|
/**********************************************************/
|
|
#ifdef CONFIG_MTK_TRUSTED_MEMORY_SUBSYSTEM
|
|
int trusted_mem_api_alloc(enum TRUSTED_MEM_REQ_TYPE mem_type, u32 alignment,
|
|
u32 size, u32 *refcount, u32 *sec_handle,
|
|
uint8_t *owner, uint32_t id);
|
|
int trusted_mem_api_alloc_zero(enum TRUSTED_MEM_REQ_TYPE mem_type,
|
|
u32 alignment, u32 size, u32 *refcount,
|
|
u32 *sec_handle, uint8_t *owner, uint32_t id);
|
|
int trusted_mem_api_unref(enum TRUSTED_MEM_REQ_TYPE mem_type, u32 sec_handle,
|
|
uint8_t *owner, uint32_t id);
|
|
bool trusted_mem_api_get_region_info(enum TRUSTED_MEM_REQ_TYPE mem_type,
|
|
u64 *pa, u32 *size);
|
|
int trusted_mem_api_query_pa(enum TRUSTED_MEM_REQ_TYPE mem_type, u32 alignment,
|
|
u32 size, u32 *refcount, u32 *gz_handle,
|
|
u8 *owner, u32 id, u32 clean, uint64_t *phy_addr);
|
|
#endif
|
|
|
|
#endif /* end of TRUSTED_MEM_API_H */
|