History

iosys-map: Add offset to iosys_map_memcpy_to()

In certain situations it's useful to be able to write to an offset of the mapping. Add a dst_offset to iosys_map_memcpy_to().

Lucas De Marchi committed 4 years ago

Commit cccd73d1 parent 2f8a6693 files · +11 −10Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/linux/iosys-map.h+9−8
@@ -220,22 +220,23 @@ static inline void iosys_map_clear(struct iosys_map *map) · 219 unmodified lines
220}220}
221 221
222/**222/**
223 * iosys_map_memcpy_to - Memcpy into iosys mapping223 * iosys_map_memcpy_to - Memcpy into offset of iosys_map
224 * @dst: The iosys_map structure224 * @dst: The iosys_map structure
225 * @dst_offset: The offset from which to copy
225 * @src: The source buffer226 * @src: The source buffer
226 * @len: The number of byte in src227 * @len: The number of byte in src
227 *228 *
228 * Copies data into a iosys mapping. The source buffer is in system229 * Copies data into a iosys_map with an offset. The source buffer is in
229 * memory. Depending on the buffer's location, the helper picks the correct230 * system memory. Depending on the buffer's location, the helper picks the
230 * method of accessing the memory.231 * correct method of accessing the memory.
231 */232 */
232static inline void iosys_map_memcpy_to(struct iosys_map *dst, const void *src,233static inline void iosys_map_memcpy_to(struct iosys_map *dst, size_t dst_offset,
233 size_t len)234 const void *src, size_t len)
234{235{
235 if (dst->is_iomem)236 if (dst->is_iomem)
236 memcpy_toio(dst->vaddr_iomem, src, len);237 memcpy_toio(dst->vaddr_iomem + dst_offset, src, len);
237 else238 else
238 memcpy(dst->vaddr, src, len);239 memcpy(dst->vaddr + dst_offset, src, len);
239}240}
240 241
241/**242/**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t