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
220220 }
221221
222222 /**
223− * iosys_map_memcpy_to - Memcpy into iosys mapping
223+ * iosys_map_memcpy_to - Memcpy into offset of iosys_map
224224 * @dst: The iosys_map structure
225+ * @dst_offset: The offset from which to copy
225226 * @src: The source buffer
226227 * @len: The number of byte in src
227228 *
228− * Copies data into a iosys mapping. The source buffer is in system
229− * memory. Depending on the buffer's location, the helper picks the correct
230− * method of accessing the memory.
229+ * Copies data into a iosys_map with an offset. The source buffer is in
230+ * system memory. Depending on the buffer's location, the helper picks the
231+ * correct method of accessing the memory.
231232 */
232−static inline void iosys_map_memcpy_to(struct iosys_map *dst, const void *src,
233− size_t len)
233+static inline void iosys_map_memcpy_to(struct iosys_map *dst, size_t dst_offset,
234+ const void *src, size_t len)
234235 {
235236 if (dst->is_iomem)
236− memcpy_toio(dst->vaddr_iomem, src, len);
237+ memcpy_toio(dst->vaddr_iomem + dst_offset, src, len);
237238 else
238− memcpy(dst->vaddr, src, len);
239+ memcpy(dst->vaddr + dst_offset, src, len);
239240 }
240241
241242 /**

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