/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2012-2019. All rights reserved. * Description: iapi_rm.c * Author: Hisilicon * Create: 2012-12-01 */ #include "soc_errno.h" #include "mpi_rm_ext.h" #include "uapi_rm.h" td_s32 uapi_rm_init(td_void) { td_s32 ret; ret = ext_mpi_rm_init(); return ret; } td_s32 uapi_rm_deinit(td_void) { td_s32 ret; ret = ext_mpi_rm_deinit(); return ret; } td_s32 uapi_rm_register_callback(const td_void *client, uapi_rm_event_cb_fn fn, td_u32 event_mask) { td_s32 ret; ret = ext_mpi_rm_register_callback(client, (ext_rm_event_cb_fn)fn, event_mask); return ret; } td_s32 uapi_rm_unregister_callback(const td_void *client, uapi_rm_event_cb_fn fn) { td_s32 ret; ret = ext_mpi_rm_unregister_callback(client, (ext_rm_event_cb_fn)fn); return ret; } td_s32 uapi_rm_request_resource(uapi_rm_resource_type resource_type) { td_s32 ret; /* current only support window resource */ if (resource_type >= UAPI_RM_RESOURCE_MAX) { return SOC_ERR_RM_INVALID_PARA; } else if ((resource_type == UAPI_RM_RESOURCE_TYPE_ALL) || (resource_type == UAPI_RM_RESOURCE_TYPE_WIN)) { ret = ext_mpi_rm_acquire_window_handle(); return ret; } return TD_SUCCESS; }