Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/ipc/ipc.h

    r10477601 r96b02eb9  
    3333 */
    3434
    35 #if ((defined(LIBC_ASYNC_H_)) && (!defined(LIBC_ASYNC_C_)))
    36         #error Do not intermix low-level IPC interface and async framework
    37 #endif
    38 
    39 #ifndef LIBC_IPC_H_
    40 #define LIBC_IPC_H_
    41 
     35#ifndef LIBIPC_IPC_H_
     36#define LIBIPC_IPC_H_
     37
     38#include <task.h>
     39#include <kernel/ipc/ipc.h>
     40#include <kernel/ddi/irq.h>
    4241#include <sys/types.h>
    43 #include <ipc/common.h>
    4442#include <kernel/synch/synch.h>
    45 #include <task.h>
    46 
    47 typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *);
     43
     44#define IPC_FLAG_BLOCKING  0x01
     45
     46typedef struct {
     47        sysarg_t args[IPC_CALL_LEN];
     48        sysarg_t in_phone_hash;
     49} ipc_call_t;
     50
     51typedef sysarg_t ipc_callid_t;
     52
     53typedef void (* ipc_async_callback_t)(void *, int, ipc_call_t *);
    4854
    4955/*
     
    5359 * possible, the fast version is used.
    5460 */
    55 
    5661#define ipc_call_sync_0_0(phoneid, method) \
    5762        ipc_call_sync_fast((phoneid), (method), 0, 0, 0, 0, 0, 0, 0, 0)
     
    183188    sysarg_t *);
    184189
    185 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, sysarg_t, unsigned int);
     190extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, uint32_t, int);
     191extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *, uint32_t);
    186192extern void ipc_poke(void);
    187193
    188 #define ipc_wait_for_call(data) \
    189         ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT);
    190 
    191 extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *, sysarg_t);
     194static inline ipc_callid_t ipc_wait_for_call(ipc_call_t *data)
     195{
     196        return ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT);
     197}
     198
    192199extern ipc_callid_t ipc_trywait_for_call(ipc_call_t *);
    193200
     
    198205 * to m.
    199206 */
    200 
    201207#define ipc_answer_0(callid, retval) \
    202208        ipc_answer_fast((callid), (retval), 0, 0, 0, 0)
     
    223229 * to m.
    224230 */
    225 
    226231#define ipc_call_async_0(phoneid, method, private, callback, can_preempt) \
    227232        ipc_call_async_fast((phoneid), (method), 0, 0, 0, 0, (private), \
     
    249254
    250255extern void ipc_call_async_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    251     sysarg_t, void *, ipc_async_callback_t, bool);
     256    sysarg_t, void *, ipc_async_callback_t, int);
    252257extern void ipc_call_async_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    253     sysarg_t, sysarg_t, void *, ipc_async_callback_t, bool);
    254 
    255 extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t *,
    256     sysarg_t *);
    257 extern int ipc_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
    258 extern int ipc_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
    259 
     258    sysarg_t, sysarg_t, void *, ipc_async_callback_t, int);
     259
     260extern int ipc_connect_to_me(int, int, int, int, sysarg_t *);
     261extern int ipc_connect_me_to(int, int, int, int);
     262extern int ipc_connect_me_to_blocking(int, int, int, int);
    260263extern int ipc_hangup(int);
    261 
    262 extern int ipc_forward_fast(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
    263     unsigned int);
    264 extern int ipc_forward_slow(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
    265     sysarg_t, sysarg_t, sysarg_t, unsigned int);
     264extern int ipc_register_irq(int, int, int, irq_code_t *);
     265extern int ipc_unregister_irq(int, int);
     266extern int ipc_forward_fast(ipc_callid_t, int, int, sysarg_t, sysarg_t, int);
     267extern int ipc_forward_slow(ipc_callid_t, int, int, sysarg_t, sysarg_t,
     268    sysarg_t, sysarg_t, sysarg_t, int);
    266269
    267270/*
    268271 * User-friendly wrappers for ipc_share_in_start().
    269272 */
    270 
    271273#define ipc_share_in_start_0_0(phoneid, dst, size) \
    272274        ipc_share_in_start((phoneid), (dst), (size), 0, NULL)
     
    278280        ipc_share_in_start((phoneid), (dst), (size), (arg), (flags))
    279281
    280 extern int ipc_share_in_start(int, void *, size_t, sysarg_t, unsigned int *);
    281 extern int ipc_share_in_finalize(ipc_callid_t, void *, unsigned int);
    282 extern int ipc_share_out_start(int, void *, unsigned int);
     282extern int ipc_share_in_start(int, void *, size_t, sysarg_t, int *);
     283extern int ipc_share_in_finalize(ipc_callid_t, void *, int );
     284extern int ipc_share_out_start(int, void *, int);
    283285extern int ipc_share_out_finalize(ipc_callid_t, void *);
    284286extern int ipc_data_read_start(int, void *, size_t);
Note: See TracChangeset for help on using the changeset viewer.