Lines Matching refs:miter

11 static bool sg_dwiter_next(struct sg_mapping_iter *miter)  in sg_dwiter_next()  argument
13 if (sg_miter_next(miter)) { in sg_dwiter_next()
14 miter->consumed = 0; in sg_dwiter_next()
20 static bool sg_dwiter_is_at_end(struct sg_mapping_iter *miter) in sg_dwiter_is_at_end() argument
22 return miter->length == miter->consumed && !sg_dwiter_next(miter); in sg_dwiter_is_at_end()
25 static uint32_t sg_dwiter_read_buffer(struct sg_mapping_iter *miter) in sg_dwiter_read_buffer() argument
32 len = min(miter->length - miter->consumed, left); in sg_dwiter_read_buffer()
33 memcpy(addr, miter->addr + miter->consumed, len); in sg_dwiter_read_buffer()
34 miter->consumed += len; in sg_dwiter_read_buffer()
39 } while (sg_dwiter_next(miter)); in sg_dwiter_read_buffer()
54 static bool sg_dwiter_get_next_block(struct sg_mapping_iter *miter, uint32_t **ptr) in sg_dwiter_get_next_block() argument
58 if (sg_dwiter_is_at_end(miter)) in sg_dwiter_get_next_block()
61 len = miter->length - miter->consumed; in sg_dwiter_get_next_block()
64 miter->addr + miter->consumed))) { in sg_dwiter_get_next_block()
65 *ptr = miter->addr + miter->consumed; in sg_dwiter_get_next_block()
66 miter->consumed += 4; in sg_dwiter_get_next_block()
90 uint32_t cb710_sg_dwiter_read_next_block(struct sg_mapping_iter *miter) in cb710_sg_dwiter_read_next_block() argument
94 if (likely(sg_dwiter_get_next_block(miter, &ptr))) in cb710_sg_dwiter_read_next_block()
97 return sg_dwiter_read_buffer(miter); in cb710_sg_dwiter_read_next_block()
101 static void sg_dwiter_write_slow(struct sg_mapping_iter *miter, uint32_t data) in sg_dwiter_write_slow() argument
107 len = min(miter->length - miter->consumed, left); in sg_dwiter_write_slow()
108 memcpy(miter->addr, addr, len); in sg_dwiter_write_slow()
109 miter->consumed += len; in sg_dwiter_write_slow()
114 } while (sg_dwiter_next(miter)); in sg_dwiter_write_slow()
131 void cb710_sg_dwiter_write_next_block(struct sg_mapping_iter *miter, uint32_t data) in cb710_sg_dwiter_write_next_block() argument
135 if (likely(sg_dwiter_get_next_block(miter, &ptr))) { in cb710_sg_dwiter_write_next_block()
141 sg_dwiter_write_slow(miter, data); in cb710_sg_dwiter_write_next_block()