You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.8 KiB
64 lines
1.8 KiB
/*
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2020. All rights reserved.
|
|
* Description: SSM function file for Huanglong SSM
|
|
* Author: ssm group
|
|
* Create: 2019/12/11
|
|
*/
|
|
|
|
#ifndef __DRV_SSM_H__
|
|
#define __DRV_SSM_H__
|
|
|
|
#include "drv_ssm_ext.h"
|
|
#include "soc_log.h"
|
|
#include "osal_ext.h"
|
|
|
|
#undef LOG_MODULE_ID
|
|
#define LOG_MODULE_ID SOC_ID_SSM
|
|
|
|
#define ssm_check_pointer_return_if_fail(pointer) \
|
|
do { \
|
|
if ((pointer) == TD_NULL) { \
|
|
soc_log_err("pointer %s is null\n", #pointer); \
|
|
return TD_FAILURE; \
|
|
} \
|
|
} while (0)
|
|
|
|
typedef struct {
|
|
td_u64 buf_addr_begin;
|
|
td_u64 buf_addr_end;
|
|
} ssm_teec_buf_addr;
|
|
|
|
typedef td_s32 (*fn_ssm_proc_read)(td_void *pf, td_void *data);
|
|
|
|
td_void drv_ssm_error_handler(struct file *ssm_filp);
|
|
|
|
td_s32 drv_ssm_teec_init(td_void);
|
|
|
|
td_void drv_ssm_teec_deinit(td_void);
|
|
|
|
td_s32 drv_ssm_teec_create(struct file *ssm_filp, ext_ssm_intent intent, td_handle *handle);
|
|
|
|
td_s32 drv_ssm_teec_destroy(td_handle ssm_handle);
|
|
|
|
td_s32 drv_ssm_teec_add_resource(td_handle ssm_handle, ext_ssm_module_resource res_info);
|
|
|
|
td_s32 drv_ssm_teec_attach_buffer(ext_ssm_buffer_attach_info attach_info, td_u64 *addr);
|
|
|
|
td_s32 drv_ssm_teec_get_intent(td_handle ssm_handle, ext_ssm_intent *get_intent);
|
|
|
|
#ifdef SSM_TEST_SUPPORT
|
|
td_s32 drv_ssm_teec_check_buffer(ext_ssm_buffer_check_info check_info);
|
|
|
|
td_s32 drv_ssm_teec_send_tbl(td_handle session_handle, ext_ssm_send_policy_tbl *p);
|
|
#endif
|
|
|
|
td_s32 drv_ssm_proc_read(td_void *fp);
|
|
|
|
td_s32 drv_ssm_create_proc(td_char *name, fn_ssm_proc_read read_fn, osal_proc_cmd *cmd_list, td_u32 cmd_cnt);
|
|
|
|
td_void drv_ssm_destroy_proc(td_char *name);
|
|
|
|
td_s32 drv_ssm_set_tee_log_level(td_u32 level);
|
|
|
|
#endif
|