Changeset b1f51f0 in mainline for init/init.c
- Timestamp:
- 2006-06-02T16:09:18Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b917098
- Parents:
- a116ef22
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
init/init.c
ra116ef22 rb1f51f0 160 160 IPC_GET_ARG1(*data), IPC_GET_ARG2(*data)); 161 161 } 162 static void test_async_ipc(void)163 {164 ipc_call_t data;165 int i;166 167 printf("Sending ping\n");168 ipc_call_async_2(PHONE_NS, NS_PING, 1, 0xbeefbee2,169 "Pong1", got_answer);170 ipc_call_async_2(PHONE_NS, NS_PING, 2, 0xbeefbee4,171 "Pong2", got_answer);172 ipc_call_async_2(PHONE_NS, NS_PING, 3, 0xbeefbee4,173 "Pong3", got_answer);174 ipc_call_async_2(PHONE_NS, NS_PING, 4, 0xbeefbee4,175 "Pong4", got_answer);176 ipc_call_async_2(PHONE_NS, NS_PING, 5, 0xbeefbee4,177 "Pong5", got_answer);178 ipc_call_async_2(PHONE_NS, NS_PING, 6, 0xbeefbee4,179 "Pong6", got_answer);180 printf("Waiting forever...\n");181 for (i=0; i<100;i++)182 printf(".");183 printf("\n");184 ipc_wait_for_call(&data);185 printf("Received call???\n");186 }187 162 188 163 … … 190 165 { 191 166 printf("Pong\n"); 192 }193 static void test_advanced_ipc(void)194 {195 int res;196 ipcarg_t phonead;197 ipc_callid_t callid;198 ipc_call_t data;199 int i;200 201 printf("Asking 0 to connect to me...\n");202 res = ipc_connect_to_me(0, 1, 2, &phonead);203 printf("Result: %d - phonead: %llu\n", res, phonead);204 for (i=0; i < 100; i++) {205 printf("----------------\n");206 ipc_call_async(PHONE_NS, NS_PING_SVC, 0, "prov",207 got_answer_2);208 callid = ipc_wait_for_call(&data);209 printf("Received ping\n");210 ipc_answer_fast(callid, 0, 0, 0);211 }212 // callid = ipc_wait_for_call(&data, NULL);213 167 } 214 168 … … 226 180 printf("Retval: %d - received: %X\n", res, result); 227 181 228 }229 230 static void test_hangup(void)231 {232 int phoneid;233 ipc_call_t data;234 ipc_callid_t callid;235 int i;236 237 printf("Starting connect...\n");238 phoneid = ipc_connect_me_to(PHONE_NS, 10, 20);239 printf("Phoneid: %d, pinging\n", phoneid);240 ipc_call_async_2(PHONE_NS, NS_PING, 1, 0xbeefbee2,241 "Pong1", got_answer);242 printf("Hangin up\n");243 ipc_hangup(phoneid);244 printf("Connecting\n");245 phoneid = ipc_connect_me_to(PHONE_NS, 10, 20);246 printf("Newphid: %d\n", phoneid);247 for (i=0; i < 1000; i++) {248 if ((callid=ipc_trywait_for_call(&data)))249 printf("callid: %d\n");250 }251 printf("New new phoneid: %d\n", ipc_connect_me_to(PHONE_NS, 10, 20));252 }253 254 static void test_slam(void)255 {256 int i;257 ipc_call_t data;258 ipc_callid_t callid;259 260 printf("ping");261 ipc_call_async_2(PHONE_NS, NS_PING, 1, 0xbeefbee2,262 "Pong1", got_answer);263 printf("slam");264 ipc_call_async_2(PHONE_NS, NS_HANGUP, 1, 0xbeefbee2,265 "Hang", got_answer);266 printf("ping2\n");267 ipc_call_async_2(PHONE_NS, NS_PING, 1, 0xbeefbee2,268 "Ping2", got_answer);269 270 for (i=0; i < 1000; i++) {271 if ((callid=ipc_trywait_for_call(&data)))272 printf("callid: %d\n");273 }274 ipc_call_async_2(PHONE_NS, NS_PING, 1, 0xbeefbee2,275 "Pong1", got_answer);276 printf("Closing file\n");277 ipc_hangup(PHONE_NS);278 ipc_call_async_2(PHONE_NS, NS_PING, 1, 0xbeefbee2,279 "Pong1", got_answer);280 ipc_wait_for_call(&data);281 182 } 282 183
Note:
See TracChangeset
for help on using the changeset viewer.