7 * generic/non-specific Messages
11 #define IPM_TAG_WDOG 2
12 #define IPM_NTAGS (IPM_TAG_WDOG + 1) /* bump when you add new ones */
14 typedef struct ipm_desc
{
21 * void *gemini_ipm_register(uint8_t tag, unsigned int ipl, size_t quota,
22 * void (*consume)(void *arg, const void *desc),
23 * void (*counter)(void *arg, size_t n),
26 * - register an IPM service, identified by 'tag'
27 * - callback functions may be dispatched using softint at indicated 'ipl'
28 * using softint_establish(), softint_disestablish()
29 * for now they are called directly at IPL_NET
30 * - reserve 'quota' descriptors; minimum is 1.
31 * - 'consume' function is called for each message received
32 * - 'counter' function is called to update count of
33 * of completed produced (sent) descriptors since last update
34 * - 'arg' is private to the service
35 * - return value is an IPM handle ('ipmh') that can be used
37 * - if the 'tag' is already in use, or if 'quota' descriptors are not available,
38 * then NULL is returned.
40 void *gemini_ipm_register(uint8_t, unsigned int, size_t,
41 void (*)(void *, const void *),
42 void (*)(void *, size_t),
46 * void gemini_ipm_deregister(void *ipmh);
48 * - tear down a service
49 * - 'ipmh' is handle returned from priot call to gemini_ipm_register()
51 void gemini_ipm_deregister(void *);
54 * void gemini_ipm_produce(const void *desc, unsigned size_t ndesc);
56 * - service produces (sends) 'ndesc' messages described by the array of
58 * - if not all messages can be sent due to lack of descriptor queue resources,
59 * then the calling service has exceeded it's quota and the system will panic.
60 * - after return the descriptors at 'desc' revert to the caller
61 * caller can recycle or free as he likes.
63 int gemini_ipm_produce(const void *, size_t);
66 * void gemini_ipm_copyin(void *dest, bus_addr_t ba, size_t len);
68 * - service copies in (receives) message 'len' bytes of data to be copied
69 * from bus address 'ba' to virtual address 'dest'
70 * - this function is meant to be called from the service's registered
71 * 'consume' callback function
73 void gemini_ipm_copyin(void *, bus_addr_t
, size_t);
76 #endif /* _GEMINI_IPM_H_ */