7 * Library side headers that define the abstraction layer's
8 * responsibilities and interfaces
11 #include <portals/lib-types.h>
15 * Per interface portal table, access control table
16 * and NAL private data field;
21 * send: Sends a preformatted header and user data to a
22 * specified remote process.
25 int (*cb_send) (nal_cb_t * nal, void *private, lib_msg_t * cookie,
26 ptl_hdr_t * hdr, int type, ptl_nid_t nid, ptl_pid_t pid,
27 unsigned int niov, struct iovec *iov, size_t mlen);
29 /* as send, but with a set of page fragments (NULL if not supported) */
30 int (*cb_send_pages) (nal_cb_t * nal, void *private, lib_msg_t * cookie,
31 ptl_hdr_t * hdr, int type, ptl_nid_t nid, ptl_pid_t pid,
32 unsigned int niov, ptl_kiov_t *iov, size_t mlen);
34 * recv: Receives an incoming message from a remote process
35 * Type of iov depends on options. Can overwrite iov.
37 int (*cb_recv) (nal_cb_t * nal, void *private, lib_msg_t * cookie,
38 unsigned int niov, struct iovec *iov, size_t mlen,
41 /* as recv, but with a set of page fragments (NULL if not supported) */
42 int (*cb_recv_pages) (nal_cb_t * nal, void *private, lib_msg_t * cookie,
43 unsigned int niov, ptl_kiov_t *iov, size_t mlen,
46 * read: Reads a block of data from a specified user address
48 int (*cb_read) (nal_cb_t * nal, void *private, void *dst_addr,
49 user_ptr src_addr, size_t len);
52 * write: Writes a block of data into a specified user address
54 int (*cb_write) (nal_cb_t * nal, void *private, user_ptr dsr_addr,
55 void *src_addr, size_t len);
58 * callback: Calls an event callback
60 int (*cb_callback) (nal_cb_t * nal, void *private, lib_eq_t *eq,
64 * malloc: Acquire a block of memory in a system independent
67 void *(*cb_malloc) (nal_cb_t * nal, size_t len);
69 void (*cb_free) (nal_cb_t * nal, void *buf, size_t len);
72 * (un)map: Tell the NAL about some memory it will access.
73 * *addrkey passed to cb_unmap() is what cb_map() set it to.
74 * type of *iov depends on options.
75 * Set to NULL if not required.
77 int (*cb_map) (nal_cb_t * nal, unsigned int niov, struct iovec *iov,
79 void (*cb_unmap) (nal_cb_t * nal, unsigned int niov, struct iovec *iov,
82 /* as (un)map, but with a set of page fragments */
83 int (*cb_map_pages) (nal_cb_t * nal, unsigned int niov, ptl_kiov_t *iov,
85 void (*cb_unmap_pages) (nal_cb_t * nal, unsigned int niov, ptl_kiov_t *iov,
88 void (*cb_printf) (nal_cb_t * nal, const char *fmt, ...);
90 /* Turn interrupts off (begin of protected area) */
91 void (*cb_cli) (nal_cb_t * nal, unsigned long *flags);
93 /* Turn interrupts on (end of protected area) */
94 void (*cb_sti) (nal_cb_t * nal, unsigned long *flags);
97 * Calculate a network "distance" to given node
99 int (*cb_dist) (nal_cb_t * nal, ptl_nid_t nid, unsigned long *dist);