1 | #ifndef SRL_ARGS_H |
---|
2 | #define SRL_ARGS_H |
---|
3 | |
---|
4 | |
---|
5 | |
---|
6 | #define SRL_GET_MWMR(port) APP_GET_ARG(port, VOBJ_TYPE_MWMR) |
---|
7 | #define SRL_GET_BARRIER(port) APP_GET_ARG(port, VOBJ_TYPE_BARRIER) |
---|
8 | #define SRL_GET_LOCK(port) APP_GET_ARG(port, VOBJ_TYPE_LOCK) |
---|
9 | #define SRL_GET_BUFFER(port) APP_GET_ARG(port, VOBJ_TYPE_BUFFER) |
---|
10 | |
---|
11 | |
---|
12 | /* port, APP_NAME, TASK, #task_name, alias */ |
---|
13 | # define SRL_GET_ARG(task_name, port, type) \ |
---|
14 | ({ \ |
---|
15 | srl_mwmr_t _mwmr; \ |
---|
16 | if( giet_vobj_get_vbase( APP_NAME , alias_##task_name.port, type, (unsigned int*)&_mwmr ) ) \ |
---|
17 | { \ |
---|
18 | srl_log_printf( NONE, "\n[ERROR] in "#task_name" task :\n"); \ |
---|
19 | srl_log_printf( NONE, " undefined port <"#port"> for channel(%s): %d\n", \ |
---|
20 | alias_##task_name.port,_mwmr); \ |
---|
21 | srl_log_printf( TRACE, "*** &"#port" = %x\n\n", (unsigned int)_mwmr ); \ |
---|
22 | srl_exit(); \ |
---|
23 | }else \ |
---|
24 | srl_log_printf( TRACE, "%s:%d: arg of %s for %s,from %s; &"#port" = %x\n\n", \ |
---|
25 | __FILE__, __LINE__, APP_NAME, #task_name,#port, (unsigned int)_mwmr ); \ |
---|
26 | _mwmr;\ |
---|
27 | }) |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | #endif |
---|