[178] | 1 | #ifndef SRL_ARGS_H |
---|
| 2 | #define SRL_ARGS_H |
---|
| 3 | |
---|
| 4 | |
---|
| 5 | |
---|
[228] | 6 | #define SRL_GET_MWMR(port) (srl_mwmr_t) APP_GET_ARG(port, VOBJ_TYPE_MWMR) |
---|
| 7 | #define SRL_GET_BARRIER(port) (srl_barrier_t) APP_GET_ARG(port, VOBJ_TYPE_BARRIER) |
---|
| 8 | #define SRL_GET_LOCK(port) APP_GET_ARG(port, VOBJ_TYPE_LOCK) |
---|
| 9 | #define SRL_GET_MEMSPACE(port) (srl_memspace_t) APP_GET_ARG(port, VOBJ_TYPE_MEMSPACE) |
---|
[178] | 10 | |
---|
| 11 | |
---|
[215] | 12 | # define SRL_GET_VBASE(task_name, port, type) \ |
---|
| 13 | ({ \ |
---|
[213] | 14 | unsigned int vbase; \ |
---|
[230] | 15 | if (giet_vobj_get_vbase(APP_NAME , args->port, type, &vbase)) \ |
---|
[215] | 16 | { \ |
---|
[228] | 17 | srl_log_printf(NONE, "\n[ERROR] in "#task_name" task :\n"); \ |
---|
| 18 | srl_log_printf(NONE, " undefined port <"#port"> for channel \"%s\": %x\n", \ |
---|
[230] | 19 | args->port, vbase); \ |
---|
[228] | 20 | srl_log_printf(TRACE, "*** &"#port" = %x\n\n", vbase); \ |
---|
[215] | 21 | srl_exit(); \ |
---|
[228] | 22 | } \ |
---|
| 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, vbase); \ |
---|
| 26 | vbase; \ |
---|
[178] | 27 | }) |
---|
| 28 | |
---|
| 29 | |
---|
[230] | 30 | #define SRL_GET_CONST(port) \ |
---|
| 31 | ({ \ |
---|
| 32 | unsigned int vbase; \ |
---|
| 33 | if (giet_vobj_get_vbase(APP_NAME, args->port, VOBJ_TYPE_CONST, &vbase)) { \ |
---|
| 34 | srl_log_printf(NONE, "\n[ERROR] in some task :\n"); \ |
---|
| 35 | srl_log_printf(NONE, " undefined port <"#port"> for channel \"%s\": %x\n", \ |
---|
| 36 | args->port, vbase); \ |
---|
| 37 | srl_log_printf(TRACE, "*** &"#port" = %x\n\n", vbase); \ |
---|
| 38 | srl_exit(); \ |
---|
| 39 | } \ |
---|
| 40 | else \ |
---|
| 41 | srl_log_printf(TRACE, "%s:%d: arg of %s, from %s; &"#port" = %x\n\n", \ |
---|
| 42 | __FILE__, __LINE__, APP_NAME, #port, vbase); \ |
---|
| 43 | *(int *) vbase; \ |
---|
| 44 | }) |
---|
[178] | 45 | |
---|
[230] | 46 | |
---|
[178] | 47 | #endif |
---|