Ignore:
File:
1 edited

Legend:

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

    rcd671c3 r466e95f7  
    3838#include <ipc/ipc.h>
    3939
     40#define SYSIPC_OP(op, call, ...) \
     41        ({ \
     42                int rc = EOK; \
     43                \
     44                sysipc_ops_t *ops; \
     45                ops = sysipc_ops_get((call)->request_method); \
     46                if (ops->op) \
     47                        rc = ops->op((call), ##__VA_ARGS__); \
     48                rc; \
     49        })
     50
     51/**
     52 * This header declares the per-method IPC callbacks. Using these callbacks,
     53 * each IPC method (but system methods in particular), can define actions that
     54 * will be called at specific moments in the call life-cycle.
     55 *
     56 * Normally, the kernel will attempt to invoke the following callbacks in the
     57 * following order on each call:
     58 *
     59 * request_preprocess()
     60 * request_process()
     61 * answer_preprocess()
     62 * answer_process()
     63 *
     64 * This callback invocation sequence is a natural order of processing. Note,
     65 * however, that due to various special circumstances, callbacks may be called
     66 * also in a different than natural order of processing. This means that some
     67 * callbacks may be skipped and some others may be called instead.
     68 *
     69 * The additional callbacks that may be called are as follows:
     70 *
     71 * request_forget()
     72 * answer_cleanup()
     73 *
     74 * There are several notable scenarios in which some callbacks of the natural
     75 * order of processing will be skipped.
     76 *
     77 * The request_process(), answer_preprocess() and answer_process() callbacks
     78 * will be skipped if the call cannot be delivered to the callee. This may
     79 * happen when e.g. the request_preprocess() callback fails or the connection
     80 * to the callee is not functional. The next callback that will be invoked on
     81 * the call is request_forget().
     82 *
     83 * The comments for each callback type describe the specifics of each callback
     84 * such as the context in which it is invoked and various constraints.
     85 */
     86
    4087typedef struct {
    4188        /**
     
    59106         * Invoked on:          all forgotten calls
    60107         */     
    61         void (* request_forget)(call_t *);
     108        int (* request_forget)(call_t *);
    62109
    63110        /**
     
    67114         * Caller alive:        no guarantee
    68115         * Races with:          request_forget()
    69          * Invoked on:          calls that are received by the callee
     116         * Invoked on:          all calls delivered to the callee
    70117         */     
    71118        int (* request_process)(call_t *, answerbox_t *);
     
    80127         * Invoked on:          all forgotten calls
    81128         */
    82         void (* answer_cleanup)(call_t *, ipc_data_t *);
     129        int (* answer_cleanup)(call_t *, ipc_data_t *);
    83130
    84131        /**
     
    107154
    108155extern int null_request_preprocess(call_t *, phone_t *);
    109 extern void null_request_forget(call_t *);
     156extern int null_request_forget(call_t *);
    110157extern int null_request_process(call_t *, answerbox_t *);
    111 extern void null_answer_cleanup(call_t *, ipc_data_t *);
     158extern int null_answer_cleanup(call_t *, ipc_data_t *);
    112159extern int null_answer_preprocess(call_t *, ipc_data_t *);
    113160extern int null_answer_process(call_t *);
Note: See TracChangeset for help on using the changeset viewer.