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.
78 lines
2.2 KiB
78 lines
2.2 KiB
/*
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd. 2012-2019. All rights reserved.
|
|
* Description: drv_rm.h
|
|
* Author: sm_rm
|
|
* Create: 2012-11-25
|
|
*/
|
|
|
|
#ifndef __DRV_RM_H__
|
|
#define __DRV_RM_H__
|
|
|
|
#include <linux/huanglong/securec.h>
|
|
#include "drv_rm_define.h"
|
|
#include "drv_rm_ext.h"
|
|
#include "osal_ext.h"
|
|
#include "td_type.h"
|
|
|
|
#ifdef __cplusplus
|
|
#if __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#endif
|
|
|
|
/* RM上下文数据结构 */
|
|
typedef struct {
|
|
td_handle rm_handle;
|
|
td_void *event_handle_p;
|
|
td_bool chn_enable;
|
|
td_bool list_empty;
|
|
td_u32 cur_index;
|
|
td_u32 queue_cnt;
|
|
td_u32 try_queue_cnt;
|
|
td_u32 free_node;
|
|
td_u32 used_node;
|
|
td_u32 cur_pid;
|
|
ext_drv_rm_win_event cur_event;
|
|
osal_wait wait_queue;
|
|
td_u32 cur_query_time;
|
|
td_u32 lst_query_time;
|
|
td_u32 query_time_diff;
|
|
td_bool idle;
|
|
} rm_drv_path_ctx;
|
|
|
|
typedef struct {
|
|
td_u32 rm_path_count;
|
|
td_u32 wake_up_cnt;
|
|
td_u32 wake_up_time;
|
|
td_u32 normal_cnt;
|
|
td_u32 path_recycle_cnt;
|
|
td_u32 win_owner_id;
|
|
td_u32 chn_create_cnt[RM_DRV_CHN_MAX_NUM];
|
|
td_u32 chn_destroy_cnt[RM_DRV_CHN_MAX_NUM];
|
|
td_s32 rm_available_win_count;
|
|
osal_wait wait_queue;
|
|
td_bool wake_up_flags;
|
|
td_bool waiting_event;
|
|
ext_drv_win_owner wind_owner;
|
|
} rm_drv_golbal_ctx;
|
|
|
|
#define check_rm_null_ptr(pointer) \
|
|
do { \
|
|
if ((pointer) == TD_NULL) { \
|
|
soc_log_err("pointer %s is null ptr.\n", #pointer); \
|
|
return SOC_ERR_RM_NULL_PTR; \
|
|
} \
|
|
} while (0)
|
|
|
|
td_void rm_drv_comm_get_golbal_ctx(rm_drv_golbal_ctx **rm_drv_golbal_ctx_p);
|
|
td_void rm_drv_comm_get_path_ctx(td_u32 rm_path_id, rm_drv_path_ctx **rm_drv_path_ctx_p);
|
|
|
|
#ifdef __cplusplus
|
|
#if __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
#endif /* __DRV_RM_H__ */
|
|
|