void dc21285_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
{
	switch (map->buswidth) {
		case 4:
			while (len > 0) {
				__u32 d = *((__u32*)from)++;
				dc21285_write32(map, d, to);
				to += 4;
				len -= 4;
			}
			break;
		case 2:
			while (len > 0) {
				__u16 d = *((__u16*)from)++;
				dc21285_write16(map, d, to);
				to += 2;
				len -= 2;
			}
			break;
		case 1:
			while (len > 0) {
				__u8 d = *((__u8*)from)++;
				dc21285_write8(map, d, to);
				to++;
				len--;
			}
			break;
	}
}
Esempio n. 2
0
static void dc21285_copy_to_32(struct map_info *map, unsigned long to, const void *from, ssize_t len)
{
	while (len > 0) {
		uint32_t d = *((uint32_t*)from)++;
		dc21285_write32(map, d, to);
		to += 4;
		len -= 4;
	}
}