Rev 1353 | Rev 1363 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1353 | Rev 1360 | ||
---|---|---|---|
Line 75... | Line 75... | ||
75 | 75 | ||
76 | int main(int argc, char **argv) |
76 | int main(int argc, char **argv) |
77 | { |
77 | { |
78 | ipc_call_t call; |
78 | ipc_call_t call; |
79 | ipc_callid_t callid; |
79 | ipc_callid_t callid; |
80 | char *as; |
80 | char *as_area; |
81 | 81 | ||
82 | ipcarg_t retval, arg1, arg2; |
82 | ipcarg_t retval, arg1, arg2; |
83 | 83 | ||
84 | printf("%s: Naming service started.\n", NAME); |
84 | printf("%s: Naming service started.\n", NAME); |
85 | 85 | ||
Line 90... | Line 90... | ||
90 | 90 | ||
91 | while (1) { |
91 | while (1) { |
92 | callid = ipc_wait_for_call(&call, 0); |
92 | callid = ipc_wait_for_call(&call, 0); |
93 | // printf("NS: Call in_phone_hash=%lX...", call.in_phone_hash); |
93 | // printf("NS: Call in_phone_hash=%lX...", call.in_phone_hash); |
94 | switch (IPC_GET_METHOD(call)) { |
94 | switch (IPC_GET_METHOD(call)) { |
95 | case IPC_M_AS_SEND: |
95 | case IPC_M_AS_AREA_SEND: |
96 | as = (char *)IPC_GET_ARG2(call); |
96 | as_area = (char *)IPC_GET_ARG2(call); |
97 | printf("Received as: %P, size:%d\n", as, IPC_GET_ARG3(call)); |
97 | printf("Received as_area: %P, size:%d\n", as_area, IPC_GET_ARG3(call)); |
98 | retval = ipc_answer_fast(callid, 0,(sysarg_t)(1024*1024), 0); |
98 | retval = ipc_answer_fast(callid, 0,(sysarg_t)(1024*1024), 0); |
99 | if (!retval) { |
99 | if (!retval) { |
100 | printf("Reading shared memory..."); |
100 | printf("Reading shared memory..."); |
101 | printf("Text: %s", as); |
101 | printf("Text: %s", as_area); |
102 | } else |
102 | } else |
103 | printf("Failed answer: %d\n", retval); |
103 | printf("Failed answer: %d\n", retval); |
104 | continue; |
104 | continue; |
105 | break; |
105 | break; |
106 | case IPC_M_INTERRUPT: |
106 | case IPC_M_INTERRUPT: |