Changeset 80bcaed in mainline for kernel/generic/include/ipc/ipc.h


Ignore:
Timestamp:
2007-02-03T13:22:24Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f619ec11
Parents:
fa8e7d2
Message:

Merge as_t structure into one and leave the differring parts in as_genarch_t.

Indentation and formatting changes in header files.

File:
1 edited

Legend:

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

    rfa8e7d2 r80bcaed  
    4848
    4949/* Flags for calls */
    50 #define IPC_CALL_ANSWERED       (1<<0) /**< This is answer to a call */
    51 #define IPC_CALL_STATIC_ALLOC   (1<<1) /**< This call will not be freed on error */
    52 #define IPC_CALL_DISCARD_ANSWER (1<<2) /**< Answer will not be passed to userspace, will be discarded */
    53 #define IPC_CALL_FORWARDED      (1<<3) /**< Call was forwarded */
    54 #define IPC_CALL_CONN_ME_TO     (1<<4) /**< Identify connect_me_to answer */
    55 #define IPC_CALL_NOTIF          (1<<5) /**< Interrupt notification */
     50
     51/** This is answer to a call */
     52#define IPC_CALL_ANSWERED       (1 << 0)
     53/** This call will not be freed on error */
     54#define IPC_CALL_STATIC_ALLOC   (1 << 1)
     55/** Answer will not be passed to userspace, will be discarded */
     56#define IPC_CALL_DISCARD_ANSWER (1 << 2)
     57/** Call was forwarded */
     58#define IPC_CALL_FORWARDED      (1 << 3)
     59/** Identify connect_me_to answer */
     60#define IPC_CALL_CONN_ME_TO     (1 << 4)
     61/** Interrupt notification */
     62#define IPC_CALL_NOTIF          (1 << 5)
    5663
    5764/* Flags of callid (the addresses are aligned at least to 4,
    5865 * that is why we can use bottom 2 bits of the call address
    5966 */
    60 #define IPC_CALLID_ANSWERED       1 /**< Type of this msg is 'answer' */
    61 #define IPC_CALLID_NOTIFICATION   2 /**< Type of this msg is 'notification' */
     67/** Type of this msg is 'answer' */
     68#define IPC_CALLID_ANSWERED     1
     69/** Type of this msg is 'notification' */
     70#define IPC_CALLID_NOTIFICATION 2
    6271
    6372/* Return values from IPC_ASYNC */
    64 #define IPC_CALLRET_FATAL         -1
    65 #define IPC_CALLRET_TEMPORARY     -2
     73#define IPC_CALLRET_FATAL       -1
     74#define IPC_CALLRET_TEMPORARY   -2
    6675
    6776
    6877/* Macros for manipulating calling data */
    69 #define IPC_SET_RETVAL(data, retval)   ((data).args[0] = (retval))
    70 #define IPC_SET_METHOD(data, val)   ((data).args[0] = (val))
    71 #define IPC_SET_ARG1(data, val)   ((data).args[1] = (val))
    72 #define IPC_SET_ARG2(data, val)   ((data).args[2] = (val))
    73 #define IPC_SET_ARG3(data, val)   ((data).args[3] = (val))
    74 
    75 #define IPC_GET_METHOD(data)           ((data).args[0])
    76 #define IPC_GET_RETVAL(data)           ((data).args[0])
    77 
    78 #define IPC_GET_ARG1(data)              ((data).args[1])
    79 #define IPC_GET_ARG2(data)              ((data).args[2])
    80 #define IPC_GET_ARG3(data)              ((data).args[3])
     78#define IPC_SET_RETVAL(data, retval)    ((data).args[0] = (retval))
     79#define IPC_SET_METHOD(data, val)       ((data).args[0] = (val))
     80#define IPC_SET_ARG1(data, val)         ((data).args[1] = (val))
     81#define IPC_SET_ARG2(data, val)         ((data).args[2] = (val))
     82#define IPC_SET_ARG3(data, val)         ((data).args[3] = (val))
     83
     84#define IPC_GET_METHOD(data)            ((data).args[0])
     85#define IPC_GET_RETVAL(data)            ((data).args[0])
     86
     87#define IPC_GET_ARG1(data)              ((data).args[1])
     88#define IPC_GET_ARG2(data)              ((data).args[2])
     89#define IPC_GET_ARG3(data)              ((data).args[3])
    8190
    8291/* Well known phone descriptors */
    83 #define PHONE_NS              0
     92#define PHONE_NS        0
    8493
    8594/* System-specific methods - only through special syscalls
     
    167176
    168177typedef enum {
    169         IPC_PHONE_FREE = 0,     /**< Phone is free and can be allocated */
    170         IPC_PHONE_CONNECTING,   /**< Phone is connecting somewhere */
    171         IPC_PHONE_CONNECTED,    /**< Phone is connected */
    172         IPC_PHONE_HUNGUP,       /**< Phone is hung up, waiting for answers to come */
    173         IPC_PHONE_SLAMMED       /**< Phone was hungup from server */
     178        /** Phone is free and can be allocated */
     179        IPC_PHONE_FREE = 0,
     180        /** Phone is connecting somewhere */
     181        IPC_PHONE_CONNECTING,
     182        /** Phone is connected */
     183        IPC_PHONE_CONNECTED,
     184        /** Phone is hung up, waiting for answers to come */
     185        IPC_PHONE_HUNGUP,
     186        /** Phone was hungup from server */
     187        IPC_PHONE_SLAMMED
    174188} ipc_phone_state_t;
    175189
     
    190204        waitq_t wq;
    191205
    192         link_t connected_phones;        /**< Phones connected to this answerbox */
    193         link_t calls;                   /**< Received calls */
     206        /** Phones connected to this answerbox */
     207        link_t connected_phones;
     208        /** Received calls */
     209        link_t calls;                   
    194210        link_t dispatched_calls;        /* Should be hash table in the future */
    195211
    196         link_t answers;                 /**< Answered calls */
     212        /** Answered calls */
     213        link_t answers;
    197214
    198215        SPINLOCK_DECLARE(irq_lock);
    199         link_t irq_notifs;              /**< Notifications from IRQ handlers */
    200         link_t irq_head;                /**< IRQs with notifications to this answerbox. */
     216        /** Notifications from IRQ handlers */
     217        link_t irq_notifs;
     218        /** IRQs with notifications to this answerbox. */
     219        link_t irq_head;
    201220} answerbox_t;
    202221
     
    218237        answerbox_t *callerbox;
    219238
    220         unative_t priv; /**< Private data to internal IPC */
    221 
    222         ipc_data_t data;  /**< Data passed from/to userspace */
     239        /** Private data to internal IPC */
     240        unative_t priv;
     241
     242        /** Data passed from/to userspace */
     243        ipc_data_t data;
    223244} call_t;
    224245
Note: See TracChangeset for help on using the changeset viewer.