VSF Documented
vsf_component_cfg.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18
20#include "vsf_cfg.h"
21
22#ifndef __VSF_COMPONENT_CFG_H__
23#define __VSF_COMPONENT_CFG_H__
24
26
27/*============================ INCLUDES ======================================*/
28/*============================ MACROS ========================================*/
29
30#ifndef VSF_COMPONENT_ASSERT
31# define VSF_COMPONENT_ASSERT VSF_ASSERT
32#endif
33
34/*============================ MACROFIED FUNCTIONS ===========================*/
35
36// internal use only
37#define vsf_peda_evthandler_t vsf_param_eda_evthandler_t
38
39#define __vsf_component_peda_ifs0(__ifs_name) \
40 dcl_vsf_peda_ctx(__ifs_name) \
41 def_vsf_peda_ctx(__ifs_name) \
42 end_def_vsf_peda_ctx(__ifs_name)
43
44#define __vsf_component_peda_ifs1(__ifs_name, __args) \
45 dcl_vsf_peda_ctx(__ifs_name) \
46 def_vsf_peda_ctx(__ifs_name, def_args(__args)) \
47 end_def_vsf_peda_ctx(__ifs_name)
48
49#define __vsf_component_peda_ifs2(__ifs_name, __params, __args) \
50 dcl_vsf_peda_ctx(__ifs_name) \
51 def_vsf_peda_ctx(__ifs_name, __params, __args) \
52 end_def_vsf_peda_ctx(__ifs_name)
53
54#define __vsf_component_peda_ifs3(__ifs_name, __params, __args, __locals) \
55 dcl_vsf_peda_ctx(__ifs_name) \
56 def_vsf_peda_ctx(__ifs_name, __params, __args, __locals) \
57 end_def_vsf_peda_ctx(__ifs_name)
58
59//prototype:
60// __vsf_component_peda_ifs(__peda_name)
61// __vsf_component_peda_ifs(__peda_name, __args)
62#define __vsf_component_peda_ifs(__peda_name, ...) \
63 __PLOOC_EVAL(__vsf_component_peda_ifs, __VA_ARGS__) \
64 (__peda_name, ##__VA_ARGS__)
65
66//prototype:
67// __vsf_component_peda_ifs_entry(__peda_name, __ifs_name)
68// __vsf_component_peda_ifs_entry(__peda_name, __ifs_name, __locals)
69#define __vsf_component_peda_ifs_entry(__peda_name, __ifs_name, ...) \
70 dcl_vsf_peda_ctx(__peda_name) \
71 def_vsf_peda_ctx(__peda_name, \
72 def_args( \
73 implement(vsf_peda_arg(__ifs_name)) \
74 ) \
75 def_locals( \
76 __VA_ARGS__ \
77 ) \
78 ) \
79 end_def_vsf_peda_ctx(__peda_name) \
80 static imp_vsf_peda(__peda_name)
81
82#define __vsf_component_peda_entry0(__peda_name, __decoration) \
83 __vsf_component_peda_ifs(__peda_name) \
84 __decoration imp_vsf_peda(__peda_name)
85
86#define __vsf_component_peda_entry1(__peda_name, __decoration, __args) \
87 __vsf_component_peda_ifs(__peda_name, __args) \
88 __decoration imp_vsf_peda(__peda_name)
89
90#define __vsf_component_peda_entry2(__peda_name, __decoration, __params, __args)\
91 __vsf_component_peda_ifs(__peda_name, __params, __args) \
92 __decoration imp_vsf_peda(__peda_name)
93
94#define __vsf_component_peda_entry3(__peda_name, __decoration, __params, __args, __locals)\
95 __vsf_component_peda_ifs(__peda_name, __params, __args, __locals) \
96 __decoration imp_vsf_peda(__peda_name)
97
98//prototype:
99// __vsf_component_peda_xxxx_entry(__peda_name)
100// __vsf_component_peda_xxxx_entry(__peda_name, __args)
101// __vsf_component_peda_xxxx_entry(__peda_name, __params, __args)
102// __vsf_component_peda_xxxx_entry(__peda_name, __params, __args, __locals)
103#define __vsf_component_peda_public_entry(__peda_name, ...) \
104 __PLOOC_EVAL(__vsf_component_peda_entry, __VA_ARGS__) \
105 (__peda_name, , ##__VA_ARGS__)
106
107#define __vsf_component_peda_private_entry(__peda_name, ...) \
108 __PLOOC_EVAL(__vsf_component_peda_entry, __VA_ARGS__) \
109 (__peda_name, static, ##__VA_ARGS__)
110
111#define __vsf_component_call_peda_ifs0( __peda_name, \
112 __err, \
113 __entry, \
114 __extra_local_size, \
115 __param) \
116 { \
117 *(&(__err)) = vsf_call_peda(__peda_name, \
118 (uintptr_t)(__entry), \
119 (__extra_local_size), \
120 (uintptr_t)(__param)); \
121 }
122
123#define __vsf_component_call_peda_ifsn( __peda_name, \
124 __err, \
125 __entry, \
126 __extra_local_size, \
127 __param, \
128 ...) \
129 { \
130 vsf_peda_arg(__peda_name) _ = { __VA_ARGS__ }; \
131 *(&(__err)) = vsf_call_peda(__peda_name, \
132 (uintptr_t)(__entry), \
133 (__extra_local_size), \
134 (uintptr_t)(__param), \
135 (uintptr_t)&_); \
136 }
137
138#define __vsf_component_call_peda_ifs1 __vsf_component_call_peda_ifsn
139#define __vsf_component_call_peda_ifs2 __vsf_component_call_peda_ifsn
140#define __vsf_component_call_peda_ifs3 __vsf_component_call_peda_ifsn
141#define __vsf_component_call_peda_ifs4 __vsf_component_call_peda_ifsn
142#define __vsf_component_call_peda_ifs5 __vsf_component_call_peda_ifsn
143#define __vsf_component_call_peda_ifs6 __vsf_component_call_peda_ifsn
144#define __vsf_component_call_peda_ifs7 __vsf_component_call_peda_ifsn
145#define __vsf_component_call_peda_ifs8 __vsf_component_call_peda_ifsn
146#define __vsf_component_call_peda_ifs9 __vsf_component_call_peda_ifsn
147#define __vsf_component_call_peda_ifs10 __vsf_component_call_peda_ifsn
148#define __vsf_component_call_peda_ifs11 __vsf_component_call_peda_ifsn
149#define __vsf_component_call_peda_ifs12 __vsf_component_call_peda_ifsn
150#define __vsf_component_call_peda_ifs13 __vsf_component_call_peda_ifsn
151#define __vsf_component_call_peda_ifs14 __vsf_component_call_peda_ifsn
152#define __vsf_component_call_peda_ifs15 __vsf_component_call_peda_ifsn
153
154//prototype:
155// __vsf_component_call_peda_ifs(__peda_name, __ret, __entry, __local_size, __param)
156// __vsf_component_call_peda_ifs(__peda_name, __ret, __entry, __local_size, __param, __local_initializer)
157#define __vsf_component_call_peda_ifs(__peda_name, __ret, __entry, __local_size, __param, ...)\
158 __PLOOC_EVAL(__vsf_component_call_peda_ifs, __VA_ARGS__) \
159 (__peda_name, (__ret), __entry, (__local_size), (__param), ##__VA_ARGS__)
160
161// prototype:
162// __vsf_component_call_peda(__peda_name, __ret, __param)
163// __vsf_component_call_peda(__peda_name, __ret, __param, __args)
164#define __vsf_component_call_peda(__peda_name, __ret, __param, ...) \
165 __vsf_component_call_peda_ifs(__peda_name, __ret, vsf_peda_func(__peda_name), 0, (__param), ##__VA_ARGS__)
166
167// public use
168#define vsf_component_peda_ifs_entry __vsf_component_peda_ifs_entry
169
170/*============================ TYPES =========================================*/
171/*============================ GLOBAL VARIABLES ==============================*/
172/*============================ LOCAL VARIABLES ===============================*/
173/*============================ PROTOTYPES ====================================*/
174
175
176#endif
177/* EOF */