Changeset 2d5a54f3 in mainline for generic/include/ipc


Ignore:
Timestamp:
2006-03-16T00:25:50Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2fb49101
Parents:
c23502d
Message:

Implemented callback IPC call (connect_to_me).

Location:
generic/include/ipc
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • generic/include/ipc/ipc.h

    rc23502d r2d5a54f3  
    6969#define PHONE_NS              0
    7070
     71/* System-specific methods - only through special syscalls
     72 * These methods have special behaviour
     73 */
     74#define IPC_M_IAMCONNECTING   0
     75/** Protocol for CONNECT - TO - ME
     76 *
     77 * Calling process asks the callee to create a callback connection,
     78 * so that it can start initiating new messages.
     79 *
     80 * The protocol for negotiating is as follows:
     81 * - sys_connecttome - sends a message IPC_M_CONNECTTOME
     82 * - sys_wait_for_call - upon receipt tries to allocate new phone
     83 *                       - if it fails, responds with ELIMIT
     84 *                     - passes call to userspace. If userspace
     85 *                       responds with error, phone is deallocated and
     86 *                       error is sent back to caller. Otherwise
     87 *                       the call is accepted and the response is sent back.
     88 *                     - the allocated phoneid is passed to userspace as
     89 *                       ARG3 of the call.
     90 *                     - the caller obtains taskid of the called thread
     91 */
     92#define IPC_M_CONNECTTOME     1
     93#define IPC_M_CONNECTMETO     2
     94
     95
     96/* Well-known methods */
     97#define IPC_M_FIRST_USER      512
     98#define IPC_M_PING            512
     99/* User methods */
     100#define FIRST_USER_METHOD     1024
     101
    71102#ifdef KERNEL
    72103
     
    77108#define IPC_MAX_PHONES  16
    78109
    79 
    80110typedef struct answerbox answerbox_t;
     111typedef __native ipc_data_t[IPC_CALL_LEN];
    81112
    82113typedef struct {
     
    85116        int flags;
    86117        task_t *sender;
    87         __native data[IPC_CALL_LEN];
     118        ipc_data_t data;
    88119} call_t;
    89120
    90121struct answerbox {
    91122        SPINLOCK_DECLARE(lock);
     123
     124        task_t *task;
    92125
    93126        mutex_t mutex;
  • generic/include/ipc/sysipc.h

    rc23502d r2d5a54f3  
    2727 */
    2828
    29 #ifndef __NS_H_
    30 #define __NS_H_
     29#ifndef __SYSIPC_H__
     30#define __SYSIPC_H__
    3131
    32 /* NameService methods */
    33 
    34 /** Ping name service */
    35 #define NS_PING   1
    36 
    37 
    38 #ifdef KERNEL
    39 
    40 #include <ipc/ipc.h>
    41 
    42 extern void ns_start(void);
     32__native sys_ipc_call_sync_fast(__native phoneid, __native method,
     33                                __native arg1, __native *data);
     34__native sys_ipc_call_sync(__native phoneid, __native *question,
     35                           __native *reply);
     36__native sys_ipc_call_async_fast(__native phoneid, __native method,
     37                                 __native arg1, __native arg2);
     38__native sys_ipc_call_async(__native phoneid, __native *data);
     39__native sys_ipc_answer_fast(__native callid, __native retval,
     40                             __native arg1, __native arg2);
     41__native sys_ipc_answer(__native callid, __native *data);
     42__native sys_ipc_connect_to_me(__native phoneid, __native arg1,
     43                               __native arg2, task_id_t *taskid);
     44__native sys_ipc_wait_for_call(ipc_data_t *calldata, task_id_t *taskid,
     45                               __native flags);
    4346
    4447#endif
    45 
    46 #endif
Note: See TracChangeset for help on using the changeset viewer.