Ignore:
File:
1 edited

Legend:

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

    rcd529c4 rc33f39f  
    7272typedef struct answerbox {
    7373        IRQ_SPINLOCK_DECLARE(lock);
     74
     75        /** Answerbox is active until it enters cleanup. */
     76        bool active;
    7477       
    7578        struct task *task;
     
    106109
    107110typedef struct {
    108         link_t link;
     111        /**
     112         * Task link.
     113         * Valid only when the call is not forgotten.
     114         * Protected by the task's active_calls_lock.
     115         */
     116        link_t ta_link;
     117
     118        /** Answerbox link. */
     119        link_t ab_link;
    109120       
    110121        unsigned int flags;
     122
     123        /** Protects the forget member. */
     124        SPINLOCK_DECLARE(forget_lock);
     125
     126        /**
     127         * True if the caller 'forgot' this call and donated it to the callee.
     128         * Forgotten calls are discarded upon answering (the answer is not
     129         * delivered) and answered calls cannot be forgotten. Forgotten calls
     130         * also do not figure on the task's active call list.
     131         *
     132         * We keep this separate from the flags so that it is not necessary
     133         * to take a lock when accessing them.
     134         */
     135        bool forget;
     136
     137        /** True if the call is in the active list. */
     138        bool active;
    111139       
    112         /** Identification of the caller. */
     140        /**
     141         * Identification of the caller.
     142         * Valid only when the call is not forgotten.
     143         */
    113144        struct task *sender;
     145       
     146        /** Phone which was used to send the call. */
     147        phone_t *caller_phone;
    114148       
    115149        /** Private data to internal IPC. */
     
    118152        /** Data passed from/to userspace. */
    119153        ipc_data_t data;
    120        
     154
     155        /** Method as it was sent in the request. */
     156        sysarg_t request_method;
     157
    121158        /** Buffer for IPC_M_DATA_WRITE and IPC_M_DATA_READ. */
    122159        uint8_t *buffer;
    123        
    124         /*
    125          * The forward operation can masquerade the caller phone. For those
    126          * cases, we must keep it aside so that the answer is processed
    127          * correctly.
    128          */
    129         phone_t *caller_phone;
    130160} call_t;
    131161
     
    141171extern int ipc_forward(call_t *, phone_t *, answerbox_t *, unsigned int);
    142172extern void ipc_answer(answerbox_t *, call_t *);
     173extern void _ipc_answer_free_call(call_t *, bool);
    143174
    144175extern void ipc_phone_init(phone_t *);
    145 extern void ipc_phone_connect(phone_t *, answerbox_t *);
     176extern bool ipc_phone_connect(phone_t *, answerbox_t *);
    146177extern int ipc_phone_hangup(phone_t *);
    147178
     
    151182extern void ipc_backsend_err(phone_t *, call_t *, sysarg_t);
    152183extern void ipc_answerbox_slam_phones(answerbox_t *, bool);
    153 extern void ipc_cleanup_call_list(list_t *);
     184extern void ipc_cleanup_call_list(answerbox_t *, list_t *);
    154185
    155186extern void ipc_print_task(task_id_t);
Note: See TracChangeset for help on using the changeset viewer.