Subversion Repositories HelenOS

Rev

Rev 2801 | Rev 2806 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include <stdio.h>
  2. #include <unistd.h>
  3. #include <ipc/ipc.h>
  4. #include "../tester.h"
  5.  
  6.  
  7. char * test_debug1(bool quiet)
  8. {
  9.     int taskid;
  10.     int rc;
  11.     int phoneid;
  12.     int i;
  13.     unsigned sc_args[6];
  14.     unsigned copied;
  15.     unsigned ev_type;
  16.     unsigned sc_id;
  17.     int sc_rc;
  18.  
  19.     printf("running debug1 test\n");
  20.     taskid = 12;
  21.     printf("ipc_connect_task(%d)...\n", taskid);
  22.     rc = ipc_connect_task(taskid);
  23.     printf("-> %d\n", rc);
  24.     phoneid = rc;
  25.  
  26.     printf("send IPC_M_DEBUG_BEGIN message\n");
  27.     rc = ipc_call_sync_0_0(phoneid, IPC_M_DEBUG_BEGIN);
  28.     printf("-> %d\n", rc);
  29.  
  30.     while (1) {
  31.         rc = ipc_call_sync_0_3(phoneid, IPC_M_DEBUG_GO, &ev_type,
  32.             &sc_id, &sc_rc);
  33.         rc = ipc_call_sync_3_1(phoneid, IPC_M_DEBUG_ARGS_READ, NULL,
  34.             sc_args, 6 * sizeof(unsigned), &copied);
  35.         if (rc >= 0) {
  36.             printf("id %u(%u, %u, %u, %u, %u, %u) -> %d\n",
  37.                 sc_id,
  38.                 sc_args[0], sc_args[1], sc_args[2],
  39.                 sc_args[3], sc_args[4], sc_args[5],
  40.                 sc_rc);
  41.         }
  42.     }
  43.  
  44.     printf("done\n");
  45.     return NULL;
  46. }
  47.