1 /* 2 * 3 * Copyright 2021 Rockchip Electronics Co., LTD. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 19 #ifndef __MPP_CLUSTER_H__ 20 #define __MPP_CLUSTER_H__ 21 22 #include "mpp_err.h" 23 #include "mpp_list.h" 24 #include "mpp_thread.h" 25 #include "mpp_dev_defs.h" 26 27 #define MAX_PRIORITY 1 28 29 typedef void* MppNode; 30 31 typedef MPP_RET (*TaskProc)(void *param); 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 MPP_RET mpp_node_init(MppNode *node); 38 MPP_RET mpp_node_deinit(MppNode node); 39 40 MPP_RET mpp_node_set_func(MppNode node, TaskProc proc, void *param); 41 42 MPP_RET mpp_node_attach(MppNode node, MppClientType type); 43 MPP_RET mpp_node_detach(MppNode node); 44 45 #define mpp_node_trigger(node, trigger) mpp_node_trigger_f(__FUNCTION__, node, trigger) 46 47 MPP_RET mpp_node_trigger_f(const char *caller, MppNode node, RK_S32 trigger); 48 49 #ifdef __cplusplus 50 } 51 #endif 52 53 #endif /* __MPP_CLUSTER_H__ */ 54