Ignore:
File:
1 edited

Legend:

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

    r03a8a8e r4e5dabf  
    6565        mutex_t lock;
    6666        link_t link;
    67         struct task *caller;
    6867        struct answerbox *callee;
    6968        ipc_phone_state_t state;
     
    7372typedef struct answerbox {
    7473        IRQ_SPINLOCK_DECLARE(lock);
    75 
    76         /** Answerbox is active until it enters cleanup. */
    77         bool active;
    7874       
    7975        struct task *task;
    8076       
    8177        waitq_t wq;
     78       
     79        /** Linkage for the list of task's synchronous answerboxes. */
     80        link_t sync_box_link;
    8281       
    8382        /** Phones connected to this answerbox. */
     
    110109
    111110typedef struct {
    112         /**
    113          * Task link.
    114          * Valid only when the call is not forgotten.
    115          * Protected by the task's active_calls_lock.
    116          */
    117         link_t ta_link;
    118 
    119         atomic_t refcnt;
    120 
    121         /** Answerbox link. */
    122         link_t ab_link;
     111        link_t link;
    123112       
    124113        unsigned int flags;
    125 
    126         /** Protects the forget member. */
    127         SPINLOCK_DECLARE(forget_lock);
    128 
    129         /**
    130          * True if the caller 'forgot' this call and donated it to the callee.
    131          * Forgotten calls are discarded upon answering (the answer is not
    132          * delivered) and answered calls cannot be forgotten. Forgotten calls
    133          * also do not figure on the task's active call list.
    134          *
    135          * We keep this separate from the flags so that it is not necessary
    136          * to take a lock when accessing them.
    137          */
    138         bool forget;
    139 
    140         /** True if the call is in the active list. */
    141         bool active;
    142114       
    143         /**
    144          * Identification of the caller.
    145          * Valid only when the call is not forgotten.
    146          */
     115        /** Identification of the caller. */
    147116        struct task *sender;
    148117       
    149         /** Phone which was used to send the call. */
    150         phone_t *caller_phone;
     118        /*
     119         * The caller box is different from sender->answerbox
     120         * for synchronous calls.
     121         */
     122        answerbox_t *callerbox;
    151123       
    152124        /** Private data to internal IPC. */
     
    155127        /** Data passed from/to userspace. */
    156128        ipc_data_t data;
    157 
    158         /** Method as it was sent in the request. */
    159         sysarg_t request_method;
    160 
     129       
    161130        /** Buffer for IPC_M_DATA_WRITE and IPC_M_DATA_READ. */
    162131        uint8_t *buffer;
     132       
     133        /*
     134         * The forward operation can masquerade the caller phone. For those
     135         * cases, we must keep it aside so that the answer is processed
     136         * correctly.
     137         */
     138        phone_t *caller_phone;
    163139} call_t;
    164140
     
    169145extern call_t *ipc_call_alloc(unsigned int);
    170146extern void ipc_call_free(call_t *);
    171 extern void ipc_call_hold(call_t *);
    172 extern void ipc_call_release(call_t *);
    173147
    174148extern int ipc_call(phone_t *, call_t *);
     149extern int ipc_call_sync(phone_t *, call_t *);
    175150extern call_t *ipc_wait_for_call(answerbox_t *, uint32_t, unsigned int);
    176151extern int ipc_forward(call_t *, phone_t *, answerbox_t *, unsigned int);
    177152extern void ipc_answer(answerbox_t *, call_t *);
    178 extern void _ipc_answer_free_call(call_t *, bool);
    179153
    180 extern void ipc_phone_init(phone_t *, struct task *);
    181 extern bool ipc_phone_connect(phone_t *, answerbox_t *);
     154extern void ipc_phone_init(phone_t *);
     155extern void ipc_phone_connect(phone_t *, answerbox_t *);
    182156extern int ipc_phone_hangup(phone_t *);
    183157
     
    187161extern void ipc_backsend_err(phone_t *, call_t *, sysarg_t);
    188162extern void ipc_answerbox_slam_phones(answerbox_t *, bool);
    189 extern void ipc_cleanup_call_list(answerbox_t *, list_t *);
     163extern void ipc_cleanup_call_list(list_t *);
    190164
    191165extern void ipc_print_task(task_id_t);
Note: See TracChangeset for help on using the changeset viewer.