Subversion Repositories HelenOS

Rev

Rev 2588 | Rev 2618 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2588 Rev 2615
Line 49... Line 49...
49
typedef sysarg_t ipc_callid_t;
49
typedef sysarg_t ipc_callid_t;
50
 
50
 
51
typedef void (* ipc_async_callback_t)(void *private, int retval,
51
typedef void (* ipc_async_callback_t)(void *private, int retval,
52
    ipc_call_t *data);
52
    ipc_call_t *data);
53
 
53
 
-
 
54
/*
-
 
55
 * User-friendly wrappers for ipc_call_sync_fast() and ipc_call_sync_slow().
-
 
56
 * They are in the form ipc_call_sync_m_n(), where m denotes the number of
-
 
57
 * arguments of payload and n denotes number of return values. Whenever
-
 
58
 * possible, the fast version is used.
-
 
59
 */
-
 
60
#define ipc_call_sync_0_0(phoneid, method) \
-
 
61
    ipc_call_sync_fast((phoneid), (method), 0, 0, 0, 0, 0, 0, 0, 0)
-
 
62
#define ipc_call_sync_0_1(phoneid, method, res1) \
-
 
63
    ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), 0, 0, 0, 0)
-
 
64
#define ipc_call_sync_0_2(phoneid, method, res1, res2) \
-
 
65
    ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), 0, 0, 0)
-
 
66
#define ipc_call_sync_0_3(phoneid, method, res1, res2, res3) \
-
 
67
    ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \
-
 
68
        0, 0)
-
 
69
#define ipc_call_sync_0_4(phoneid, method, res1, res2, res3, res4) \
-
 
70
    ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \
-
 
71
        (res4), 0)
-
 
72
#define ipc_call_sync_0_5(phoneid, method, res1, res2, res3, res4, res5) \
-
 
73
    ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \
-
 
74
        (res4), (res5))
-
 
75
#define ipc_call_sync_1_0(phoneid, method, arg1) \
-
 
76
    ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, 0, 0, 0, 0, 0)
-
 
77
#define ipc_call_sync_1_1(phoneid, method, arg1, res1) \
-
 
78
    ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), 0, 0, 0, 0)
-
 
79
#define ipc_call_sync_1_2(phoneid, method, arg1, res1, res2) \
-
 
80
    ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), 0, \
-
 
81
    0, 0)
-
 
82
#define ipc_call_sync_1_3(phoneid, method, arg1, res1, res2, res3) \
-
 
83
    ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \
-
 
84
    (res3), 0, 0)
-
 
85
#define ipc_call_sync_1_4(phoneid, method, arg1, res1, res2, res3, res4) \
-
 
86
    ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \
-
 
87
    (res3), (res4), 0)
-
 
88
#define ipc_call_sync_1_5(phoneid, method, arg1, res1, res2, res3, res4, \
-
 
89
    res5) \
-
 
90
    ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \
-
 
91
        (res3), (res4), (res5))
-
 
92
#define ipc_call_sync_2_0(phoneid, method, arg1, arg2) \
-
 
93
    ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, 0, 0, 0, \
-
 
94
    0, 0)
-
 
95
#define ipc_call_sync_2_1(phoneid, method, arg1, arg2, res1) \
-
 
96
    ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), 0, 0, \
-
 
97
    0, 0)
54
#define ipc_call_sync_2(phoneid, method, arg1, arg2, res1, res2) \
98
#define ipc_call_sync_2_2(phoneid, method, arg1, arg2, res1, res2) \
-
 
99
    ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \
-
 
100
    (res2), 0, 0, 0)
-
 
101
#define ipc_call_sync_2_3(phoneid, method, arg1, arg2, res1, res2, res3) \
-
 
102
    ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \
-
 
103
    (res2), (res3), 0, 0)
-
 
104
#define ipc_call_sync_2_4(phoneid, method, arg1, arg2, res1, res2, res3, \
-
 
105
    res4) \
-
 
106
    ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \
-
 
107
        (res2), (res3), (res4), 0)
-
 
108
#define ipc_call_sync_2_5(phoneid, method, arg1, arg2, res1, res2, res3, \
-
 
109
    res4, res5)\
55
    ipc_call_sync_3((phoneid), (method), (arg1), (arg2), 0, (res1), \
110
    ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \
-
 
111
        (res2), (res3), (res4), (res5))
-
 
112
#define ipc_call_sync_3_0(phoneid, method, arg1, arg2, arg3) \
-
 
113
    ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, 0, 0, \
-
 
114
    0, 0)
-
 
115
#define ipc_call_sync_3_1(phoneid, method, arg1, arg2, arg3, res1) \
-
 
116
    ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), (res1), \
-
 
117
    0, 0, 0, 0)
-
 
118
#define ipc_call_sync_3_2(phoneid, method, arg1, arg2, arg3, res1, res2) \
-
 
119
    ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), (res1), \
-
 
120
    (res2), 0, 0, 0)
-
 
121
#define ipc_call_sync_3_3(phoneid, method, arg1, arg2, arg3, res1, res2, \
-
 
122
    res3) \
-
 
123
    ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \
-
 
124
        (res1), (res2), (res3), 0, 0)
-
 
125
#define ipc_call_sync_3_4(phoneid, method, arg1, arg2, arg3, res1, res2, \
-
 
126
    res3, res4) \
-
 
127
    ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \
-
 
128
        (res1), (res2), (res3), (res4), 0)
-
 
129
#define ipc_call_sync_3_5(phoneid, method, arg1, arg2, arg3, res1, res2, \
-
 
130
    res3, res4, res5) \
-
 
131
    ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \
-
 
132
        (res1), (res2), (res3), (res4), (res5))
-
 
133
#define ipc_call_sync_4_0(phoneid, method, arg1, arg2, arg3, arg4) \
-
 
134
    ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
-
 
135
    0, 0, 0, 0, 0)
-
 
136
#define ipc_call_sync_4_1(phoneid, method, arg1, arg2, arg3, arg4, res1) \
-
 
137
    ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
-
 
138
    (res1), 0, 0, 0, 0)
-
 
139
#define ipc_call_sync_4_2(phoneid, method, arg1, arg2, arg3, arg4, res1, res2) \
-
 
140
    ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
-
 
141
    (res1), (res2), 0, 0, 0)
-
 
142
#define ipc_call_sync_4_3(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \
-
 
143
    res3) \
-
 
144
    ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-
 
145
        (arg4), (res1), (res2), (res3), 0, 0)
-
 
146
#define ipc_call_sync_4_4(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \
-
 
147
    res3, res4) \
-
 
148
    ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-
 
149
        (arg4), (res1), (res2), (res3), (res4), 0)
-
 
150
#define ipc_call_sync_4_5(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \
-
 
151
    res3, res4, res5) \
-
 
152
    ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-
 
153
        (arg4), (res1), (res2), (res3), (res4), (res5))
-
 
154
#define ipc_call_sync_5_0(phoneid, method, arg1, arg2, arg3, arg4, arg5) \
-
 
155
    ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
-
 
156
        (arg5), 0, 0, 0, 0, 0)
-
 
157
#define ipc_call_sync_5_1(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1) \
-
 
158
    ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
-
 
159
        (arg5), (res1), 0, 0, 0, 0)
-
 
160
#define ipc_call_sync_5_2(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \
56
        (res2), 0)
161
    res2) \
-
 
162
    ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-
 
163
        (arg4), (arg5), (res1), (res2), 0, 0, 0)
-
 
164
#define ipc_call_sync_5_3(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \
-
 
165
    res2, res3) \
-
 
166
    ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-
 
167
        (arg4), (arg5), (res1), (res2), (res3), 0, 0)
-
 
168
#define ipc_call_sync_5_4(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \
-
 
169
    res2, res3, res4) \
-
 
170
    ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-
 
171
        (arg4), (arg5), (res1), (res2), (res3), (res4), 0)
-
 
172
#define ipc_call_sync_5_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \
-
 
173
    res2, res3, res4, res5) \
-
 
174
    ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-
 
175
        (arg4), (arg5), (res1), (res2), (res3), (res4), (res5))
-
 
176
 
57
extern int ipc_call_sync_3(int phoneid, ipcarg_t method, ipcarg_t arg1,
177
extern int ipc_call_sync_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
58
    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t *result1, ipcarg_t *result2,
178
    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t *result1, ipcarg_t *result2,
-
 
179
    ipcarg_t *result3, ipcarg_t *result4, ipcarg_t *result5);
-
 
180
 
-
 
181
extern int ipc_call_sync_slow(int phoneid, ipcarg_t method, ipcarg_t arg1,
-
 
182
    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5,
-
 
183
    ipcarg_t *result1, ipcarg_t *result2, ipcarg_t *result3, ipcarg_t *result4,
59
    ipcarg_t *result3);
184
    ipcarg_t *result5);
60
 
185
 
61
extern int ipc_call_sync(int phoneid, ipcarg_t method, ipcarg_t arg1,
-
 
62
    ipcarg_t *result);
-
 
63
 
186
 
64
extern ipc_callid_t ipc_wait_cycle(ipc_call_t *call, uint32_t usec, int flags);
187
extern ipc_callid_t ipc_wait_cycle(ipc_call_t *call, uint32_t usec, int flags);
65
extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *data, uint32_t usec);
188
extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *data, uint32_t usec);
66
static inline ipc_callid_t ipc_wait_for_call(ipc_call_t *data)
189
static inline ipc_callid_t ipc_wait_for_call(ipc_call_t *data)
67
{
190
{