static inline void GetRingBufferAvailBytes(RING_BUFFER_INFO *rbi, u32 *read, u32 *write) { u32 read_loc,write_loc; read_loc = rbi->RingBuffer->ReadIndex; write_loc = rbi->RingBuffer->WriteIndex; *write = BYTES_AVAIL_TO_WRITE(read_loc, write_loc, rbi->RingDataSize); *read = rbi->RingDataSize - *write; }
/*++ Name: GetRingBufferAvailBytes() Description: Get number of bytes available to read and to write to for the specified ring buffer --*/ static inline void GetRingBufferAvailBytes(struct hv_ring_buffer_info *rbi, u32 *read, u32 *write) { u32 read_loc, write_loc; /* Capture the read/write indices before they changed */ read_loc = rbi->RingBuffer->ReadIndex; write_loc = rbi->RingBuffer->WriteIndex; *write = BYTES_AVAIL_TO_WRITE(read_loc, write_loc, rbi->RingDataSize); *read = rbi->RingDataSize - *write; }
/* * * hv_get_ringbuffer_availbytes() * * Get number of bytes available to read and to write to * for the specified ring buffer */ static inline void hv_get_ringbuffer_availbytes(struct hv_ring_buffer_info *rbi, u32 *read, u32 *write) { u32 read_loc, write_loc; /* Capture the read/write indices before they changed */ read_loc = rbi->ring_buffer->read_index; write_loc = rbi->ring_buffer->write_index; *write = BYTES_AVAIL_TO_WRITE(read_loc, write_loc, rbi->ring_datasize); *read = rbi->ring_datasize - *write; }