Lines Matching refs:cons
66 static int check_indexes(XENSTORE_RING_IDX cons, XENSTORE_RING_IDX prod) in check_indexes() argument
68 return ((prod - cons) <= XENSTORE_RING_SIZE); in check_indexes()
71 static void *get_output_chunk(XENSTORE_RING_IDX cons, in get_output_chunk() argument
76 if ((XENSTORE_RING_SIZE - (prod - cons)) < *len) in get_output_chunk()
77 *len = XENSTORE_RING_SIZE - (prod - cons); in get_output_chunk()
81 static const void *get_input_chunk(XENSTORE_RING_IDX cons, in get_input_chunk() argument
85 *len = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(cons); in get_input_chunk()
86 if ((prod - cons) < *len) in get_input_chunk()
87 *len = prod - cons; in get_input_chunk()
88 return buf + MASK_XENSTORE_IDX(cons); in get_input_chunk()
109 XENSTORE_RING_IDX cons, prod; in xb_write() local
117 cons = intf->req_cons; in xb_write()
119 if (!check_indexes(cons, prod)) { in xb_write()
129 dst = get_output_chunk(cons, prod, intf->req, &avail); in xb_write()
161 XENSTORE_RING_IDX cons, prod; in xb_read() local
169 cons = intf->rsp_cons; in xb_read()
171 if (cons == prod) in xb_read()
174 if (!check_indexes(cons, prod)) { in xb_read()
179 src = get_input_chunk(cons, prod, intf->rsp, &avail); in xb_read()
198 if (intf->rsp_prod - cons >= XENSTORE_RING_SIZE) in xb_read()