4 #include "build_check.h"
7 # include <asm/types.h>
8 # if defined(__powerpc__) && !defined(__KERNEL__)
10 # include <asm/timex.h>
13 # include <asm/timex.h>
16 # include <sys/types.h>
17 typedef u_int32_t __u32;
18 typedef u_int64_t __u64;
22 # include <linux/time.h>
24 # include <sys/time.h>
25 # define do_gettimeofday(tv) gettimeofday(tv, NULL);
28 #include <portals/errno.h>
30 /* This implementation uses the same type for API function return codes and
31 * the completion status in an event */
32 #define PTL_NI_OK PTL_OK
33 typedef ptl_err_t ptl_ni_fail_t;
35 typedef __u64 ptl_nid_t;
36 typedef __u32 ptl_pid_t;
37 typedef __u32 ptl_pt_index_t;
38 typedef __u32 ptl_ac_index_t;
39 typedef __u64 ptl_match_bits_t;
40 typedef __u64 ptl_hdr_data_t;
41 typedef __u32 ptl_size_t;
43 #define PTL_TIME_FOREVER (-1)
46 unsigned long nal_idx; /* which network interface */
47 __u64 cookie; /* which thing on that interface */
50 typedef ptl_handle_any_t ptl_handle_ni_t;
51 typedef ptl_handle_any_t ptl_handle_eq_t;
52 typedef ptl_handle_any_t ptl_handle_md_t;
53 typedef ptl_handle_any_t ptl_handle_me_t;
55 #define PTL_INVALID_HANDLE \
56 ((const ptl_handle_any_t){.nal_idx = -1, .cookie = -1})
57 #define PTL_EQ_NONE PTL_INVALID_HANDLE
59 static inline int PtlHandleIsEqual (ptl_handle_any_t h1, ptl_handle_any_t h2)
61 return (h1.nal_idx == h2.nal_idx && h1.cookie == h2.cookie);
64 #define PTL_NID_ANY ((ptl_nid_t) -1)
65 #define PTL_PID_ANY ((ptl_pid_t) -1)
69 ptl_pid_t pid; /* node id / process id */
89 ptl_handle_eq_t eventq;
92 /* Options for the MD structure */
93 #define PTL_MD_OP_PUT (1 << 0)
94 #define PTL_MD_OP_GET (1 << 1)
95 #define PTL_MD_MANAGE_REMOTE (1 << 2)
97 #define PTL_MD_TRUNCATE (1 << 4)
98 #define PTL_MD_ACK_DISABLE (1 << 5)
99 #define PTL_MD_IOVEC (1 << 6)
100 #define PTL_MD_MAX_SIZE (1 << 7)
101 #define PTL_MD_KIOV (1 << 8)
102 #define PTL_MD_EVENT_START_DISABLE (1 << 9)
103 #define PTL_MD_EVENT_END_DISABLE (1 << 10)
105 /* For compatibility with Cray Portals */
106 #define PTL_MD_LUSTRE_COMPLETION_SEMANTICS 0
107 #define PTL_MD_PHYS 0
109 #define PTL_MD_THRESH_INF (-1)
111 /* NB lustre portals uses struct iovec internally! */
112 typedef struct iovec ptl_md_iovec_t;
115 struct page *kiov_page;
116 unsigned int kiov_len;
117 unsigned int kiov_offset;
127 PTL_EVENT_REPLY_START,
132 PTL_EVENT_SEND_START,
138 #define PTL_SEQ_BASETYPE long
139 typedef unsigned PTL_SEQ_BASETYPE ptl_seq_t;
140 #define PTL_SEQ_GT(a,b) (((signed PTL_SEQ_BASETYPE)((a) - (b))) > 0)
143 * cygwin need the pragma line, not clear if it's needed in other places.
147 #pragma pack(push, 4)
150 ptl_event_kind_t type;
151 ptl_process_id_t initiator;
152 ptl_pt_index_t portal;
153 ptl_match_bits_t match_bits;
158 ptl_hdr_data_t hdr_data;
160 ptl_ni_fail_t ni_fail_type;
162 volatile ptl_seq_t sequence;
173 typedef void (*ptl_eq_handler_t)(ptl_event_t *event);
174 #define PTL_EQ_HANDLER_NONE NULL
177 volatile ptl_seq_t sequence;
180 ptl_handle_any_t cb_eq_handle;
211 typedef int ptl_sr_value_t;
213 typedef int ptl_interface_t;
214 #define PTL_IFACE_DEFAULT (-1)