Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2636 → Rev 2637

/trunk/kernel/generic/include/ipc/ipc.h
125,7 → 125,7
* error is sent back to caller. Otherwise
* the call is accepted and the response is sent back.
* - the allocated phoneid is passed to userspace
* (on the receiving side) as ARG3 of the call.
* (on the receiving side) as ARG5 of the call.
* - the caller obtains taskid of the called thread
*/
#define IPC_M_CONNECT_TO_ME 1
/trunk/kernel/generic/src/ipc/ipcrsc.c
72,7 → 72,7
*
* *** Connect_me_to ***
* The caller sends IPC_M_CONNECT_ME_TO to an answerbox. The server receives
* 'phoneid' of the connecting phone as an ARG3. If it answers with RETVAL=0,
* 'phoneid' of the connecting phone as an ARG5. If it answers with RETVAL=0,
* the phonecall is accepted, otherwise it is refused.
*
* *** Connect_to_me ***
/trunk/kernel/generic/src/ipc/sysipc.c
177,7 → 177,7
return 0;
 
if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_TO_ME) {
phoneid = IPC_GET_ARG3(*olddata);
phoneid = IPC_GET_ARG5(*olddata);
if (IPC_GET_RETVAL(answer->data)) {
/* The connection was not accepted */
phone_dealloc(phoneid);
185,7 → 185,7
/* The connection was accepted */
phone_connect(phoneid, &answer->sender->answerbox);
/* Set 'phone hash' as arg3 of response */
IPC_SET_ARG3(answer->data,
IPC_SET_ARG5(answer->data,
(unative_t) &TASK->phones[phoneid]);
}
} else if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_ME_TO) {
341,7 → 341,7
ipc_answer(box, call);
return -1;
}
IPC_SET_ARG3(call->data, phoneid);
IPC_SET_ARG5(call->data, phoneid);
}
return 0;
}
/trunk/kernel/generic/src/ipc/ipc.c
568,9 → 568,10
tmp = tmp->next) {
call = list_get_instance(tmp, call_t, link);
printf("Callid: %p Srctask:%llu M:%d A1:%d A2:%d A3:%d "
"Flags:%x\n", call, call->sender->taskid,
"A4:%d A5:%d Flags:%x\n", call, call->sender->taskid,
IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data),
IPC_GET_ARG4(call->data), IPC_GET_ARG5(call->data),
call->flags);
}
/* Print answerbox - calls */
580,9 → 581,10
tmp = tmp->next) {
call = list_get_instance(tmp, call_t, link);
printf("Callid: %p Srctask:%llu M:%d A1:%d A2:%d A3:%d "
"Flags:%x\n", call, call->sender->taskid,
"A4:%d A5:%d Flags:%x\n", call, call->sender->taskid,
IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data),
IPC_GET_ARG4(call->data), IPC_GET_ARG5(call->data),
call->flags);
}
/* Print answerbox - calls */
590,9 → 592,10
for (tmp = task->answerbox.answers.next; tmp != &task->answerbox.answers;
tmp = tmp->next) {
call = list_get_instance(tmp, call_t, link);
printf("Callid:%p M:%d A1:%d A2:%d A3:%d Flags:%x\n", call,
IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
printf("Callid:%p M:%d A1:%d A2:%d A3:%d A4:%d A5:%d Flags:%x\n",
call, IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data),
IPC_GET_ARG4(call->data), IPC_GET_ARG5(call->data),
call->flags);
}
 
/trunk/uspace/app/tester/ipc/register.c
77,7 → 77,7
 
for (i = IPC_TEST_START; i < IPC_TEST_START + 10; i++) {
ipcarg_t phonead;
int res = ipc_connect_to_me(PHONE_NS, i, 0, &phonead);
int res = ipc_connect_to_me(PHONE_NS, i, 0, 0, &phonead);
if (!res)
break;
printf("Failed registering as %d..:%d\n", i, res);
/trunk/uspace/app/tester/devmap/devmap1.c
90,7 → 90,7
return -1;
}
/*
* device_phone = (int) IPC_GET_ARG3(answer);
* device_phone = (int) IPC_GET_ARG5(answer);
*/
printf("Connected to device.\n");
ipc_call_sync_1_0(device_phone, 1024, 1025);
149,7 → 149,7
 
async_set_client_connection(driver_client_connection);
 
ipc_connect_to_me(phone, 0, 0, &callback_phonehash);
ipc_connect_to_me(phone, 0, 0, 0, &callback_phonehash);
/*
if (NULL == async_new_connection(callback_phonehash, 0, NULL,
driver_client_connection)) {
/trunk/uspace/lib/libc/include/ipc/ipc.h
252,7 → 252,8
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, void *private,
ipc_async_callback_t callback, int can_preempt);
 
extern int ipc_connect_to_me(int phoneid, int arg1, int arg2, ipcarg_t *phone);
extern int ipc_connect_to_me(int phoneid, int arg1, int arg2, int arg3,
ipcarg_t *phone);
extern int ipc_connect_me_to(int phoneid, int arg1, int arg2, int arg3);
extern int ipc_hangup(int phoneid);
extern int ipc_register_irq(int inr, int devno, int method, irq_code_t *code);
/trunk/uspace/lib/libc/generic/ipc.c
569,6 → 569,7
* @param phoneid Phone handle used for contacting the other side.
* @param arg1 Service-defined argument.
* @param arg2 Service-defined argument.
* @param arg3 Service-defined argument.
* @param phonehash Storage where the library will store an opaque
* identifier of the phone that will be used for incoming
* calls. This identifier can be used for connection
576,10 → 577,11
*
* @return Zero on success or a negative error code.
*/
int ipc_connect_to_me(int phoneid, int arg1, int arg2, ipcarg_t *phonehash)
int ipc_connect_to_me(int phoneid, int arg1, int arg2, int arg3,
ipcarg_t *phonehash)
{
return ipc_call_sync_2_3(phoneid, IPC_M_CONNECT_TO_ME, arg1, arg2,
NULL, NULL, phonehash);
return ipc_call_sync_3_5(phoneid, IPC_M_CONNECT_TO_ME, arg1, arg2,
arg3, NULL, NULL, NULL, NULL, phonehash);
}
 
/** Ask through phone for a new connection to some service.
/trunk/uspace/srv/kbd/generic/kbd.c
108,7 → 108,7
retval = ELIMIT;
break;
}
phone2cons = IPC_GET_ARG3(call);
phone2cons = IPC_GET_ARG5(call);
retval = 0;
break;
default:
133,7 → 133,7
async_set_client_connection(console_connection);
async_set_interrupt_received(irq_handler);
/* Register service at nameserver */
if (ipc_connect_to_me(PHONE_NS, SERVICE_KEYBOARD, 0, &phonead) != 0)
if (ipc_connect_to_me(PHONE_NS, SERVICE_KEYBOARD, 0, 0, &phonead) != 0)
return -1;
 
async_manager();
/trunk/uspace/srv/ns/ns.c
139,7 → 139,7
* Server requests service registration.
*/
retval = register_service(IPC_GET_ARG1(call),
IPC_GET_ARG3(call), &call);
IPC_GET_ARG5(call), &call);
break;
case IPC_M_CONNECT_ME_TO:
/*
/trunk/uspace/srv/console/console.c
381,7 → 381,7
async_serialize_start();
gcons_notify_connect(consnum);
conn->client_phone = IPC_GET_ARG3(call);
conn->client_phone = IPC_GET_ARG5(*icall);
screenbuffer_clear(&conn->screenbuffer);
/* Accept the connection */
488,7 → 488,7
kbd_phone = ipc_connect_me_to(PHONE_NS, SERVICE_KEYBOARD, 0, 0);
}
if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, &phonehash) != 0)
if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, &phonehash) != 0)
return -1;
async_new_connection(phonehash, 0, NULL, keyboard_events);
550,7 → 550,7
connections[active_console].screenbuffer.is_cursor_visible);
 
/* Register at NS */
if (ipc_connect_to_me(PHONE_NS, SERVICE_CONSOLE, 0, &phonehash) != 0) {
if (ipc_connect_to_me(PHONE_NS, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) {
return -1;
}
/trunk/uspace/srv/rd/rd.c
211,7 → 211,7
async_set_client_connection(rd_connection);
/* Register service at nameserver */
if (ipc_connect_to_me(PHONE_NS, SERVICE_RD, 0, &phonead) != 0)
if (ipc_connect_to_me(PHONE_NS, SERVICE_RD, 0, 0, &phonead) != 0)
return -1;
async_manager();
/trunk/uspace/srv/fb/main.c
72,7 → 72,7
if (!initialized)
sysio_init();
 
if (ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, &phonead) != 0)
if (ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, 0, &phonead) != 0)
return -1;
async_manager();
/trunk/uspace/srv/fs/fat/fat.c
153,7 → 153,7
* Ask VFS for callback connection.
*/
ipcarg_t phonehash;
ipc_connect_to_me(vfs_phone, 0, 0, &phonehash);
ipc_connect_to_me(vfs_phone, 0, 0, 0, &phonehash);
 
/*
* Allocate piece of address space for PLB.
/trunk/uspace/srv/pci/pci.c
57,7 → 57,7
}
 
printf("%s: registering at naming service.\n", NAME);
if (ipc_connect_to_me(PHONE_NS, SERVICE_PCI, 0, &ns_in_phone_hash) != 0) {
if (ipc_connect_to_me(PHONE_NS, SERVICE_PCI, 0, 0, &ns_in_phone_hash) != 0) {
printf("Failed to register %s at naming service.\n", NAME);
return -1;
}
/trunk/uspace/srv/devmap/devmap.c
269,7 → 269,7
return;
}
 
driver->phone = IPC_GET_ARG3(call);
driver->phone = IPC_GET_ARG5(call);
ipc_answer_0(callid, EOK);
735,7 → 735,7
async_set_client_connection(devmap_connection);
 
/* Register device mapper at naming service */
if (ipc_connect_to_me(PHONE_NS, SERVICE_DEVMAP, 0, &phonead) != 0)
if (ipc_connect_to_me(PHONE_NS, SERVICE_DEVMAP, 0, 0, &phonead) != 0)
return -1;
async_manager();
/trunk/uspace/srv/vfs/vfs.c
157,7 → 157,7
/*
* Register at the naming service.
*/
ipc_connect_to_me(PHONE_NS, SERVICE_VFS, 0, &phonead);
ipc_connect_to_me(PHONE_NS, SERVICE_VFS, 0, 0, &phonead);
 
/*
* Start accepting connections.
/trunk/uspace/srv/vfs/vfs_register.c
252,7 → 252,7
ipc_answer_0(rid, EINVAL);
return;
}
fs_info->phone = IPC_GET_ARG3(call);
fs_info->phone = IPC_GET_ARG5(call);
ipc_answer_0(callid, EOK);
 
dprintf("Callback connection to FS created.\n");