Rev 1330 | Rev 1343 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1330 | Rev 1339 | ||
---|---|---|---|
Line 37... | Line 37... | ||
37 | #include <psthread.h> |
37 | #include <psthread.h> |
38 | #include <futex.h> |
38 | #include <futex.h> |
39 | #include <as.h> |
39 | #include <as.h> |
40 | #include <ddi.h> |
40 | #include <ddi.h> |
41 | #include <string.h> |
41 | #include <string.h> |
- | 42 | #include <kbd.h> |
|
42 | 43 | ||
43 | int a; |
44 | int a; |
44 | atomic_t ftx; |
45 | atomic_t ftx; |
45 | 46 | ||
46 | int __thread stage; |
47 | int __thread stage; |
Line 290... | Line 291... | ||
290 | psthread_schedule_next(); |
291 | psthread_schedule_next(); |
291 | printf("Pseudo thread exiting.\n"); |
292 | printf("Pseudo thread exiting.\n"); |
292 | return 0; |
293 | return 0; |
293 | } |
294 | } |
294 | 295 | ||
- | 296 | static void test_kbd() |
|
- | 297 | { |
|
- | 298 | int res; |
|
- | 299 | ipcarg_t result; |
|
- | 300 | int phoneid; |
|
- | 301 | ||
- | 302 | printf("Test: Starting connect...\n"); |
|
- | 303 | while ((phoneid = ipc_connect_me_to(PHONE_NS, 30, 60)) < 0) { |
|
- | 304 | }; |
|
- | 305 | ||
- | 306 | printf("Test: Connected: %d\n", res); |
|
- | 307 | printf("Test: pinging.\n"); |
|
- | 308 | while (1) { |
|
- | 309 | res = ipc_call_sync(phoneid, KBD_GETCHAR, 0xbeef,&result); |
|
- | 310 | // printf("Test: Retval: %d - received: %c\n", res, result); |
|
- | 311 | printf("%c", result); |
|
- | 312 | } |
|
- | 313 | ||
- | 314 | printf("Test: Hangin up\n"); |
|
- | 315 | ipc_hangup(phoneid); |
|
- | 316 | } |
|
- | 317 | ||
295 | static int test_as_send() |
318 | static int test_as_send() |
296 | { |
319 | { |
297 | char *as; |
320 | char *as; |
298 | int retval; |
321 | int retval; |
299 | ipcarg_t result; |
322 | ipcarg_t result; |
Line 328... | Line 351... | ||
328 | // test_async_ipc(); |
351 | // test_async_ipc(); |
329 | // test_advanced_ipc(); |
352 | // test_advanced_ipc(); |
330 | // test_connection_ipc(); |
353 | // test_connection_ipc(); |
331 | // test_hangup(); |
354 | // test_hangup(); |
332 | // test_slam(); |
355 | // test_slam(); |
333 | test_as_send(); |
356 | // test_as_send(); |
- | 357 | test_kbd(); |
|
- | 358 | ||
334 | /* |
359 | /* |
335 | printf("Userspace task, taskid=%llX\n", task_get_id()); |
360 | printf("Userspace task, taskid=%llX\n", task_get_id()); |
336 | 361 | ||
337 | futex_initialize(&ftx, 1); |
362 | futex_initialize(&ftx, 1); |
338 | if (futex_down(&ftx) < 0) |
363 | if (futex_down(&ftx) < 0) |