Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1005 → Rev 1027

/kernel/trunk/generic/include/ipc/ns.h
File deleted
/kernel/trunk/generic/include/ipc/sysipc.h
0,0 → 1,47
/*
* Copyright (C) 2006 Ondrej Palkovsky
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __SYSIPC_H__
#define __SYSIPC_H__
 
__native sys_ipc_call_sync_fast(__native phoneid, __native method,
__native arg1, __native *data);
__native sys_ipc_call_sync(__native phoneid, __native *question,
__native *reply);
__native sys_ipc_call_async_fast(__native phoneid, __native method,
__native arg1, __native arg2);
__native sys_ipc_call_async(__native phoneid, __native *data);
__native sys_ipc_answer_fast(__native callid, __native retval,
__native arg1, __native arg2);
__native sys_ipc_answer(__native callid, __native *data);
__native sys_ipc_connect_to_me(__native phoneid, __native arg1,
__native arg2, task_id_t *taskid);
__native sys_ipc_wait_for_call(ipc_data_t *calldata, task_id_t *taskid,
__native flags);
 
#endif
/kernel/trunk/generic/include/ipc/ipc.h
68,6 → 68,37
/* Well known phone descriptors */
#define PHONE_NS 0
 
/* 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:
* - 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
* - passes call to userspace. If userspace
* 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 caller obtains taskid of the called thread
*/
#define IPC_M_CONNECTTOME 1
#define IPC_M_CONNECTMETO 2
 
 
/* Well-known methods */
#define IPC_M_FIRST_USER 512
#define IPC_M_PING 512
/* User methods */
#define FIRST_USER_METHOD 1024
 
#ifdef KERNEL
 
#include <synch/mutex.h>
76,8 → 107,8
 
#define IPC_MAX_PHONES 16
 
 
typedef struct answerbox answerbox_t;
typedef __native ipc_data_t[IPC_CALL_LEN];
 
typedef struct {
link_t list;
84,12 → 115,14
answerbox_t *callerbox;
int flags;
task_t *sender;
__native data[IPC_CALL_LEN];
ipc_data_t data;
} call_t;
 
struct answerbox {
SPINLOCK_DECLARE(lock);
 
task_t *task;
 
mutex_t mutex;
condvar_t cv;