RDK Documentation (Open Sourced RDK Components)
rdk_moca_hal.h
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 #ifndef RDK_MOCA_HAL_H
21 #define RDK_MOCA_HAL_H
22 
23 /***************************************************************************************************************************
24 RMH_API_IMPLEMENTATION_SOC_ONLY:
25 
26  Use this macro to define an RMH API which is only implemented in the SoC RMH library
27 
28  Notes:
29  1) The SoC library shuld implement the fuction DECLARATION. The function name must be identical to DECLARATION
30  2) If no API is provided by the SoC libaray RMH_UNIMPLEMENTED will be returned
31 ***************************************************************************************************************************/
32 #ifndef RMH_API_IMPLEMENTATION_SOC_ONLY
33 #define RMH_API_IMPLEMENTATION_SOC_ONLY(DECLARATION, ...) DECLARATION;
34 #endif
35 
36 
37 /***************************************************************************************************************************
38 RMH_API_IMPLEMENTATION_GENERIC_ONLY:
39 
40  Use this macro to define an RMH API which is only implemented in the generic RMH library
41 
42  Notes:
43  1) The generic library must implement the fuction described by DECLARATION. The function name must be prefixed by 'GENERIC_IMPL__'
44  2) No calls to the SoC library will be made
45 ***************************************************************************************************************************/
46 #ifndef RMH_API_IMPLEMENTATION_GENERIC_ONLY
47 #define RMH_API_IMPLEMENTATION_GENERIC_ONLY(DECLARATION, ...) DECLARATION;
48 #endif
49 
50 
51 /***************************************************************************************************************************
52 RMH_API_IMPLEMENTATION_GENERIC_THEN_SOC:
53 
54  Use this macro to define an RMH API which is implemented in both the generic and the SoC RMH libraries. The generic API
55  will be called first.
56 
57  Notes:
58  1) The SoC API is called only if the gneric function succeeds
59  2) The generic library must implement the fuction described by DECLARATION. The function name must be prefixed by 'GENERIC_IMPL__'
60  3) The SoC library shuld implement the fuction DECLARATION. The function name must be identical to DECLARATION
61  4) If no SoC function is defined no call to the SoC library is made and the result of the generic function is returned
62 ***************************************************************************************************************************/
63 #ifndef RMH_API_IMPLEMENTATION_GENERIC_THEN_SOC
64 #define RMH_API_IMPLEMENTATION_GENERIC_THEN_SOC(DECLARATION, ...) DECLARATION;
65 #endif
66 
67 
68 /***************************************************************************************************************************
69 RMH_API_IMPLEMENTATION_SOC_THEN_GENERIC:
70 
71  Use this macro to define an RMH API which is implemented in both the generic and the SoC RMH libraries. The SoC API
72  will be called first.
73 
74  Notes:
75  1) The generic API is called only if the SoC function exists and succeeds
76  2) The generic library must implement the fuction described by DECLARATION. The function name must be prefixed by 'GENERIC_IMPL__'
77  3) The SoC library shuld implement the fuction DECLARATION. The function name must be identical to DECLARATION
78  4) When the generic API is called, the parameters will be preloaded with the output of the SoC version of the API
79 ***************************************************************************************************************************/
80 #ifndef RMH_API_IMPLEMENTATION_SOC_THEN_GENERIC
81 #define RMH_API_IMPLEMENTATION_SOC_THEN_GENERIC(DECLARATION, ...) DECLARATION;
82 #endif
83 
84 
85 /***************************************************************************************************************************
86 RMH_API_IMPLEMENTATION_NO_WRAP:
87 
88  Use this macro to define an RMH API which will not be wrapped or automatically executed in any way.
89 
90  Notes:
91  1) The generic library shuld implement the fuction DECLARATION. The function name must be identical to DECLARATION
92  2) The generic fuction implementation will manually call the SoC libary if it so chooses
93  3) The generic fuction will decide how and what the return value will be
94 ***************************************************************************************************************************/
95 #ifndef RMH_API_IMPLEMENTATION_NO_WRAP
96 #define RMH_API_IMPLEMENTATION_NO_WRAP(DECLARATION, ...) DECLARATION;
97 #endif
98 
99 
100 #include "rmh_type.h"
101 #include "rmh_api.h"
102 
103 #endif /*RDK_MOCA_HAL_H*/