1 | #ifndef SRL_ARGS_H |
---|
2 | #define SRL_ARGS_H |
---|
3 | |
---|
4 | |
---|
5 | |
---|
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) |
---|
10 | |
---|
11 | |
---|
12 | # define SRL_GET_VBASE(task_name, port, type) \ |
---|
13 | ({ \ |
---|
14 | unsigned int vbase; \ |
---|
15 | if (giet_vobj_get_vbase(APP_NAME , args->port, type, &vbase)) \ |
---|
16 | { \ |
---|
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", \ |
---|
19 | args->port, vbase); \ |
---|
20 | srl_log_printf(TRACE, "*** &"#port" = %x\n\n", vbase); \ |
---|
21 | srl_exit(); \ |
---|
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; \ |
---|
27 | }) |
---|
28 | |
---|
29 | |
---|
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 | }) |
---|
45 | |
---|
46 | |
---|
47 | #endif |
---|