Subversion Repositories HelenOS

Compare Revisions

Regard whitespace Rev 2105 → Rev 2106

/trunk/kernel/generic/include/ipc/sysipc.h
49,11 → 49,13
unative_t sys_ipc_answer_fast(unative_t callid, unative_t retval,
unative_t arg1, unative_t arg2);
unative_t sys_ipc_answer(unative_t callid, ipc_data_t *data);
unative_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec, int nonblocking);
unative_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec,
int nonblocking);
unative_t sys_ipc_forward_fast(unative_t callid, unative_t phoneid,
unative_t method, unative_t arg1);
unative_t sys_ipc_hangup(int phoneid);
unative_t sys_ipc_register_irq(inr_t inr, devno_t devno, unative_t method, irq_code_t *ucode);
unative_t sys_ipc_register_irq(inr_t inr, devno_t devno, unative_t method,
irq_code_t *ucode);
unative_t sys_ipc_unregister_irq(inr_t inr, devno_t devno);
 
#endif
/trunk/kernel/generic/include/ipc/ipc.h
47,18 → 47,27
#endif
 
/* Flags for calls */
#define IPC_CALL_ANSWERED (1<<0) /**< This is answer to a call */
#define IPC_CALL_STATIC_ALLOC (1<<1) /**< This call will not be freed on error */
#define IPC_CALL_DISCARD_ANSWER (1<<2) /**< Answer will not be passed to userspace, will be discarded */
#define IPC_CALL_FORWARDED (1<<3) /**< Call was forwarded */
#define IPC_CALL_CONN_ME_TO (1<<4) /**< Identify connect_me_to answer */
#define IPC_CALL_NOTIF (1<<5) /**< Interrupt notification */
 
/** This is answer to a call */
#define IPC_CALL_ANSWERED (1 << 0)
/** This call will not be freed on error */
#define IPC_CALL_STATIC_ALLOC (1 << 1)
/** Answer will not be passed to userspace, will be discarded */
#define IPC_CALL_DISCARD_ANSWER (1 << 2)
/** Call was forwarded */
#define IPC_CALL_FORWARDED (1 << 3)
/** Identify connect_me_to answer */
#define IPC_CALL_CONN_ME_TO (1 << 4)
/** Interrupt notification */
#define IPC_CALL_NOTIF (1 << 5)
 
/* Flags of callid (the addresses are aligned at least to 4,
* that is why we can use bottom 2 bits of the call address
*/
#define IPC_CALLID_ANSWERED 1 /**< Type of this msg is 'answer' */
#define IPC_CALLID_NOTIFICATION 2 /**< Type of this msg is 'notification' */
/** Type of this msg is 'answer' */
#define IPC_CALLID_ANSWERED 1
/** Type of this msg is 'notification' */
#define IPC_CALLID_NOTIFICATION 2
 
/* Return values from IPC_ASYNC */
#define IPC_CALLRET_FATAL -1
166,11 → 175,16
struct task;
 
typedef enum {
IPC_PHONE_FREE = 0, /**< Phone is free and can be allocated */
IPC_PHONE_CONNECTING, /**< Phone is connecting somewhere */
IPC_PHONE_CONNECTED, /**< Phone is connected */
IPC_PHONE_HUNGUP, /**< Phone is hung up, waiting for answers to come */
IPC_PHONE_SLAMMED /**< Phone was hungup from server */
/** Phone is free and can be allocated */
IPC_PHONE_FREE = 0,
/** Phone is connecting somewhere */
IPC_PHONE_CONNECTING,
/** Phone is connected */
IPC_PHONE_CONNECTED,
/** Phone is hung up, waiting for answers to come */
IPC_PHONE_HUNGUP,
/** Phone was hungup from server */
IPC_PHONE_SLAMMED
} ipc_phone_state_t;
 
/** Structure identifying phone (in TASK structure) */
189,15 → 203,20
 
waitq_t wq;
 
link_t connected_phones; /**< Phones connected to this answerbox */
link_t calls; /**< Received calls */
/** Phones connected to this answerbox */
link_t connected_phones;
/** Received calls */
link_t calls;
link_t dispatched_calls; /* Should be hash table in the future */
 
link_t answers; /**< Answered calls */
/** Answered calls */
link_t answers;
 
SPINLOCK_DECLARE(irq_lock);
link_t irq_notifs; /**< Notifications from IRQ handlers */
link_t irq_head; /**< IRQs with notifications to this answerbox. */
/** Notifications from IRQ handlers */
link_t irq_notifs;
/** IRQs with notifications to this answerbox. */
link_t irq_head;
} answerbox_t;
 
typedef struct {
217,9 → 236,11
*/
answerbox_t *callerbox;
 
unative_t priv; /**< Private data to internal IPC */
/** Private data to internal IPC */
unative_t priv;
 
ipc_data_t data; /**< Data passed from/to userspace */
/** Data passed from/to userspace */
ipc_data_t data;
} call_t;
 
extern void ipc_init(void);
/trunk/kernel/generic/include/ipc/irq.h
43,8 → 43,8
#include <arch/types.h>
#include <adt/list.h>
 
extern int ipc_irq_register(answerbox_t *box, inr_t inr, devno_t devno, unative_t method,
irq_code_t *ucode);
extern int ipc_irq_register(answerbox_t *box, inr_t inr, devno_t devno,
unative_t method, irq_code_t *ucode);
extern void ipc_irq_send_notif(irq_t *irq);
extern void ipc_irq_send_msg(irq_t *irq, unative_t a1, unative_t a2, unative_t a3);
extern void ipc_irq_unregister(answerbox_t *box, inr_t inr, devno_t devno);