Changeset e74cb73 in mainline for generic/include/ipc/ipc.h


Ignore:
Timestamp:
2006-03-14T09:30:07Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d1f8a87
Parents:
27810c5
Message:

Added skeleton name service.
Cleanup for IPC to use mutexes instead of spinlocks.

File:
1 edited

Legend:

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

    r27810c5 re74cb73  
    3030#define __IPC_H__
    3131
    32 #define IPC_CALL_LEN    2
     32/* Length of data being transfered with IPC call */
     33/* - the uspace may not be able to utilize full length */
     34#define IPC_CALL_LEN    4
    3335
    3436/* Flags for calls */
    35 #define IPC_CALL_ANSWERED    1
     37#define IPC_CALL_ANSWERED      1 /**< This is answer to a call */
     38#define IPC_CALL_STATIC_ALLOC  2 /**< This call will not be freed on error */
     39
    3640/* Flags for ipc_wait_for_call */
    37 #define IPC_WAIT_NONBLOCKING 1
     41#define IPC_WAIT_NONBLOCKING   1
     42
     43/* Flags of callid */
     44#define IPC_CALLID_ANSWERED  1
     45
     46/* Return values from IPC_ASYNC */
     47#define IPC_CALLRET_FATAL         -1
     48#define IPC_CALLRET_TEMPORARY     -2
     49
     50
     51/* Macros for manipulating calling data */
     52#define IPC_SET_RETVAL(data, retval)   ((data)[0] = (retval))
     53#define IPC_SET_METHOD(data, val)   ((data)[0] = (val))
     54#define IPC_SET_ARG1(data, val)   ((data)[1] = (val))
     55#define IPC_SET_ARG2(data, val)   ((data)[2] = (val))
     56#define IPC_SET_ARG3(data, val)   ((data)[3] = (val))
     57
     58#define IPC_GET_METHOD(data)           ((data)[0])
     59#define IPC_GET_RETVAL(data)           ((data)[0])
     60
     61#define IPC_GET_ARG1(data)              ((data)[1])
     62#define IPC_GET_ARG2(data)              ((data)[2])
     63#define IPC_GET_ARG3(data)              ((data)[3])
     64
     65/* Well known phone descriptors */
     66#define PHONE_NS              0
    3867
    3968#ifdef KERNEL
    4069
    41 #include <synch/waitq.h>
    42 #include <synch/spinlock.h>
     70#include <synch/mutex.h>
     71#include <synch/condvar.h>
    4372#include <adt/list.h>
    4473
     
    5887        SPINLOCK_DECLARE(lock);
    5988
    60         waitq_t wq;
     89        mutex_t mutex;
     90        condvar_t cv;
    6191
    6292        link_t connected_phones; /**< Phones connected to this answerbox */
     
    73103} phone_t;
    74104
    75 extern void ipc_create_phonecompany(void);
    76105extern void ipc_init(void);
    77106extern call_t * ipc_wait_for_call(answerbox_t *box, int flags);
     
    83112extern void ipc_call_free(call_t *call);
    84113extern call_t * ipc_call_alloc(void);
    85 void ipc_answerbox_init(answerbox_t *box);
    86 void ipc_phone_init(phone_t *phone, answerbox_t *box);
     114extern void ipc_answerbox_init(answerbox_t *box);
     115extern void ipc_phone_init(phone_t *phone, answerbox_t *box);
     116extern void ipc_call_init(call_t *call);
    87117
    88 extern answerbox_t *ipc_central_box;
     118extern answerbox_t *ipc_phone_0;
    89119
    90120#endif
Note: See TracChangeset for help on using the changeset viewer.