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)
77 lines
2.2 KiB
C
77 lines
2.2 KiB
C
/*
|
|
* Copyright (C) 2015 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.
|
|
*/
|
|
|
|
/*
|
|
* Header files for basic KREE functions.
|
|
*/
|
|
|
|
#ifndef __KREE_H__
|
|
#define __KREE_H__
|
|
|
|
#if defined(CONFIG_MTK_IN_HOUSE_TEE_SUPPORT) || defined(CONFIG_TRUSTY)
|
|
|
|
#include "trustzone/tz_cross/trustzone.h"
|
|
|
|
/* / KREE session handle type. */
|
|
typedef uint32_t KREE_SESSION_HANDLE;
|
|
|
|
typedef uint32_t KREE_SHAREDMEM_HANDLE;
|
|
|
|
|
|
/* Session Management */
|
|
/**
|
|
* Create a new TEE sesssion
|
|
*
|
|
* @param ta_uuid UUID of the TA to connect to.
|
|
* @param pHandle Handle for the new session.
|
|
* Return KREE_SESSION_HANDLE_FAIL if fail.
|
|
* @return return code
|
|
*/
|
|
int KREE_CreateSession(const char *ta_uuid, KREE_SESSION_HANDLE *pHandle);
|
|
|
|
/**
|
|
* Create a new TEE sesssion with tag for debug purpose
|
|
*
|
|
* @param ta_uuid UUID of the TA to connect to.
|
|
* @param pHandle Handle for the new session.
|
|
* Return KREE_SESSION_HANDLE_FAIL if fail.
|
|
* @param tag string can be printed when querying memory usage.
|
|
* @return return code
|
|
*/
|
|
int KREE_CreateSessionWithTag(const char *ta_uuid,
|
|
KREE_SESSION_HANDLE *pHandle, const char *tag);
|
|
|
|
/**
|
|
* Close TEE session
|
|
*
|
|
* @param handle Handle for session to close.
|
|
* @return return code
|
|
*/
|
|
int KREE_CloseSession(KREE_SESSION_HANDLE handle);
|
|
|
|
|
|
/**
|
|
* Make a TEE service call
|
|
*
|
|
* @param handle Session handle to make the call
|
|
* @param command The command to call.
|
|
* @param paramTypes Types for the parameters, construct by TZ_ParamTypes().
|
|
* @param param The parameters to pass to TEE. Maximum 4 params.
|
|
* @return Return value from TEE service.
|
|
*/
|
|
int KREE_TeeServiceCall(KREE_SESSION_HANDLE handle, uint32_t command,
|
|
uint32_t paramTypes, union MTEEC_PARAM param[4]);
|
|
|
|
#endif /* CONFIG_MTK_IN_HOUSE_TEE_SUPPORT || CONFIG_TRUSTY */
|
|
#endif /* __KREE_H__ */
|