Rev 1360 | Rev 1365 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1360 | Rev 1363 | ||
---|---|---|---|
Line 40... | Line 40... | ||
40 | #include <as.h> |
40 | #include <as.h> |
41 | #include <ddi.h> |
41 | #include <ddi.h> |
42 | #include <string.h> |
42 | #include <string.h> |
43 | #include <errno.h> |
43 | #include <errno.h> |
44 | #include <kbd.h> |
44 | #include <kbd.h> |
- | 45 | #include <ipc/fb.h> |
|
45 | 46 | ||
46 | int a; |
47 | int a; |
47 | atomic_t ftx; |
48 | atomic_t ftx; |
48 | 49 | ||
49 | int __thread stage; |
50 | int __thread stage; |
Line 346... | Line 347... | ||
346 | return 0; |
347 | return 0; |
347 | } |
348 | } |
348 | printf("Done\n"); |
349 | printf("Done\n"); |
349 | } |
350 | } |
350 | 351 | ||
- | 352 | static void test_fb() |
|
- | 353 | { |
|
- | 354 | int res; |
|
- | 355 | ipcarg_t result; |
|
- | 356 | int phoneid; |
|
- | 357 | ||
- | 358 | // printf("Test: Starting connect...\n"); |
|
- | 359 | ||
- | 360 | phoneid = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0); |
|
- | 361 | ||
- | 362 | while ((phoneid = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0)) < 0) { |
|
- | 363 | volatile int a; |
|
- | 364 | for(a=0;a<1048576;a++); |
|
- | 365 | }; |
|
- | 366 | ||
- | 367 | // printf("Test: Connected: %d\n", res); |
|
- | 368 | // printf("Test: pinging.\n"); |
|
- | 369 | while (1) { |
|
- | 370 | res = ipc_call_sync(phoneid, FB_GET_VFB, 0xbeef,&result); |
|
- | 371 | // printf("Test: Retval: %d - received: %c\n", res, result); |
|
- | 372 | // printf("%c", result); |
|
- | 373 | } |
|
- | 374 | ||
- | 375 | // printf("Test: Hangin up\n"); |
|
- | 376 | ipc_hangup(phoneid); |
|
- | 377 | } |
|
- | 378 | ||
- | 379 | ||
351 | int main(int argc, char *argv[]) |
380 | int main(int argc, char *argv[]) |
352 | { |
381 | { |
353 | pstid_t ptid; |
382 | pstid_t ptid; |
354 | int tid; |
383 | int tid; |
355 | 384 | ||
356 | version_print(); |
385 | // version_print(); |
357 | 386 | ||
358 | // test_printf(); |
387 | // test_printf(); |
359 | // test_printf2(); |
388 | // test_printf2(); |
360 | // test_ping(); |
389 | // test_ping(); |
361 | // test_async_ipc(); |
390 | // test_async_ipc(); |
Line 363... | Line 392... | ||
363 | // test_connection_ipc(); |
392 | // test_connection_ipc(); |
364 | // test_hangup(); |
393 | // test_hangup(); |
365 | // test_slam(); |
394 | // test_slam(); |
366 | // test_as_send(); |
395 | // test_as_send(); |
367 | // test_pci(); |
396 | // test_pci(); |
368 | test_kbd(); |
397 | // test_kbd(); |
- | 398 | // test_fb(); |
|
- | 399 | ||
- | 400 | printf("Hello\nThis is Init\n\nBye."); |
|
- | 401 | ||
369 | 402 | ||
370 | /* |
403 | /* |
371 | printf("Userspace task, taskid=%llX\n", task_get_id()); |
404 | printf("Userspace task, taskid=%llX\n", task_get_id()); |
372 | 405 | ||
373 | futex_initialize(&ftx, 1); |
406 | futex_initialize(&ftx, 1); |