Changeset 7048773 in mainline for init/init.c
- Timestamp:
- 2006-03-19T12:43:37Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4c61e60
- Parents:
- 0a862b65
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
init/init.c
r0a862b65 r7048773 35 35 #include <thread.h> 36 36 37 int a; 38 37 39 extern void utest(void *arg); 38 40 void utest(void *arg) … … 170 172 ipc_answer(callid, 0, 0, 0); 171 173 } 172 callid = ipc_wait_for_call(&data, NULL);174 // callid = ipc_wait_for_call(&data, NULL); 173 175 } 174 176 … … 183 185 printf("pinging.\n"); 184 186 res = ipc_call_sync(res, NS_PING, 0xbeef,&result); 185 printf("Retval: %d - received: % zd\n", res, result);187 printf("Retval: %d - received: %X\n", res, result); 186 188 189 } 190 191 static void test_hangup(void) 192 { 193 int phoneid; 194 ipc_call_t data; 195 ipc_callid_t callid; 196 int i; 197 198 printf("Starting connect...\n"); 199 phoneid = ipc_connect_me_to(PHONE_NS, 10, 20); 200 printf("Phoneid: %d, pinging\n", phoneid); 201 ipc_call_async_2(PHONE_NS, NS_PING, 1, 0xbeefbee2, 202 "Pong1", got_answer); 203 printf("Hangin up\n"); 204 ipc_hangup(phoneid); 205 printf("Connecting\n"); 206 phoneid = ipc_connect_me_to(PHONE_NS, 10, 20); 207 printf("Newphid: %d\n", phoneid); 208 for (i=0; i < 1000; i++) { 209 if ((callid=ipc_wait_for_call(&data, IPC_WAIT_NONBLOCKING))) 210 printf("callid: %d\n"); 211 } 212 printf("New new phoneid: %d\n", ipc_connect_me_to(PHONE_NS, 10, 20)); 213 } 214 215 static void test_slam(void) 216 { 217 int i; 218 ipc_call_t data; 219 ipc_callid_t callid; 220 221 printf("ping"); 222 ipc_call_async_2(PHONE_NS, NS_PING, 1, 0xbeefbee2, 223 "Pong1", got_answer); 224 printf("slam"); 225 ipc_call_async_2(PHONE_NS, NS_HANGUP, 1, 0xbeefbee2, 226 "Hang", got_answer); 227 printf("ping2\n"); 228 ipc_call_async_2(PHONE_NS, NS_PING, 1, 0xbeefbee2, 229 "Ping2", got_answer); 230 231 for (i=0; i < 1000; i++) { 232 if ((callid=ipc_wait_for_call(&data, IPC_WAIT_NONBLOCKING))) 233 printf("callid: %d\n"); 234 } 235 ipc_call_async_2(PHONE_NS, NS_PING, 1, 0xbeefbee2, 236 "Pong1", got_answer); 237 printf("Closing file\n"); 238 ipc_hangup(PHONE_NS); 239 ipc_call_async_2(PHONE_NS, NS_PING, 1, 0xbeefbee2, 240 "Pong1", got_answer); 241 ipc_wait_for_call(&data, 0); 187 242 } 188 243 … … 196 251 // test_async_ipc(); 197 252 // test_advanced_ipc(); 198 test_connection_ipc(); 199 200 if ((tid = thread_create(utest, NULL, "utest") != -1)) { 201 printf("Created thread tid=%d\n", tid); 202 } 203 253 // test_connection_ipc(); 254 // test_hangup(); 255 test_slam(); 256 257 // if ((tid = thread_create(utest, NULL, "utest") != -1)) { 258 // printf("Created thread tid=%d\n", tid); 259 // } 204 260 return 0; 205 261 }
Note:
See TracChangeset
for help on using the changeset viewer.