Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1039 → Rev 1040

/kernel/trunk/generic/include/syscall/syscall.h
40,8 → 40,10
SYS_IPC_CALL_ASYNC,
SYS_IPC_ANSWER_FAST,
SYS_IPC_ANSWER,
SYS_IPC_FORWARD_FAST,
SYS_IPC_WAIT,
SYS_IPC_CONNECT_TO_ME,
SYS_IPC_CONNECT_ME_TO,
SYSCALL_END
} syscall_t;
 
/kernel/trunk/generic/include/errno.h
35,5 → 35,7
#define ENOMEM -2 /* Not enough memory */
#define ELIMIT -3 /* Limit exceeded */
#define EREFUSED -4 /* Connection refused */
#define EFORWARD -5 /* Forward error */
#define EPERM -6 /* Permission denied */
 
#endif
/kernel/trunk/generic/include/ipc/sysipc.h
43,5 → 43,10
__native arg2, task_id_t *taskid);
__native sys_ipc_wait_for_call(ipc_data_t *calldata, task_id_t *taskid,
__native flags);
__native sys_ipc_connect_me_to(__native phoneid, __native arg1,
__native arg2);
__native sys_ipc_forward_fast(__native callid, __native phoneid,
__native method, __native arg1);
 
 
#endif
/kernel/trunk/generic/include/ipc/ipc.h
71,13 → 71,12
/* System-specific methods - only through special syscalls
* These methods have special behaviour
*/
#define IPC_M_IAMCONNECTING 0
/** Protocol for CONNECT - TO - ME
*
* Calling process asks the callee to create a callback connection,
* so that it can start initiating new messages.
*
* The protocol for negotiating is as follows:
* The protocol for negotiating is:
* - sys_connecttome - sends a message IPC_M_CONNECTTOME
* - sys_wait_for_call - upon receipt tries to allocate new phone
* - if it fails, responds with ELIMIT
85,16 → 84,34
* responds with error, phone is deallocated and
* error is sent back to caller. Otherwise
* the call is accepted and the response is sent back.
* - the allocated phoneid is passed to userspace as
* ARG3 of the call.
* - the allocated phoneid is passed to userspace
* (on the receiving sid) as ARG3 of the call.
* - the caller obtains taskid of the called thread
*/
#define IPC_M_CONNECTTOME 1
/** Protocol for CONNECT - ME - TO
*
* Calling process asks the callee to create for him a new connection.
* E.g. the caller wants a name server to connect him to print server.
*
* The protocol for negotiating is:
* - sys_connect_me_to - send a synchronous message to name server
* indicating that it wants to be connected to some
* service
* recepient - if ipc_answer == 0, then accept connection
* - otherwise connection refused
* - recepient may forward message. Forwarding
* system message
*
*/
#define IPC_M_CONNECTMETO 2
/* Control messages that the server sends to the processes
* about their connections.
*/
 
 
/* Well-known methods */
#define IPC_M_FIRST_USER 512
#define IPC_M_LAST_SYSTEM 511
#define IPC_M_PING 512
/* User methods */
#define FIRST_USER_METHOD 1024
123,8 → 140,7
 
task_t *task;
 
mutex_t mutex;
condvar_t cv;
waitq_t wq;
 
link_t connected_phones; /**< Phones connected to this answerbox */
link_t calls; /**< Received calls */
137,6 → 153,7
SPINLOCK_DECLARE(lock);
link_t list;
answerbox_t *callee;
int busy;
} phone_t;
 
extern void ipc_init(void);
145,12 → 162,13
extern void ipc_call(phone_t *phone, call_t *request);
extern void ipc_call_sync(phone_t *phone, call_t *request);
extern void ipc_phone_destroy(phone_t *phone);
extern void ipc_phone_init(phone_t *phone, answerbox_t *box);
extern void ipc_phone_init(phone_t *phone);
extern void ipc_phone_connect(phone_t *phone, answerbox_t *box);
extern void ipc_call_free(call_t *call);
extern call_t * ipc_call_alloc(void);
extern void ipc_answerbox_init(answerbox_t *box);
extern void ipc_phone_init(phone_t *phone, answerbox_t *box);
extern void ipc_call_init(call_t *call);
extern void ipc_forward(call_t *call, answerbox_t *newbox,answerbox_t *oldbox);
 
extern answerbox_t *ipc_phone_0;