Lines Matching refs:cons
62 static int check_indexes(XENSTORE_RING_IDX cons, XENSTORE_RING_IDX prod) in check_indexes() argument
64 return ((prod - cons) <= XENSTORE_RING_SIZE); in check_indexes()
67 static void *get_output_chunk(XENSTORE_RING_IDX cons, in get_output_chunk() argument
72 if ((XENSTORE_RING_SIZE - (prod - cons)) < *len) in get_output_chunk()
73 *len = XENSTORE_RING_SIZE - (prod - cons); in get_output_chunk()
77 static const void *get_input_chunk(XENSTORE_RING_IDX cons, in get_input_chunk() argument
81 *len = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(cons); in get_input_chunk()
82 if ((prod - cons) < *len) in get_input_chunk()
83 *len = prod - cons; in get_input_chunk()
84 return buf + MASK_XENSTORE_IDX(cons); in get_input_chunk()
97 XENSTORE_RING_IDX cons, prod; in xb_write() local
112 cons = intf->req_cons; in xb_write()
114 if (!check_indexes(cons, prod)) { in xb_write()
119 dst = get_output_chunk(cons, prod, intf->req, &avail); in xb_write()
157 XENSTORE_RING_IDX cons, prod; in xb_read() local
169 cons = intf->rsp_cons; in xb_read()
171 if (!check_indexes(cons, prod)) { in xb_read()
176 src = get_input_chunk(cons, prod, intf->rsp, &avail); in xb_read()