Example #1
0
static void vmax301_write8(struct map_info *map, map_word d, unsigned long adr)
{
	spin_lock(&vmax301_spin);
	vmax301_page(map, adr);
	writeb(d.x[0], map->map_priv_2 + (adr & WINDOW_MASK));
	spin_unlock(&vmax301_spin);
}
Example #2
0
static void vmax301_write32(struct map_info *map, __u32 d, unsigned long adr)
{
	spin_lock(&vmax301_spin);
	vmax301_page(map, adr);
	writel(d, map->map_priv_2 + (adr & WINDOW_MASK));
	spin_unlock(&vmax301_spin);
}
Example #3
0
static map_word vmax301_read8(struct map_info *map, unsigned long ofs)
{
	map_word ret;
	spin_lock(&vmax301_spin);
	vmax301_page(map, ofs);
	ret.x[0] = readb(map->map_priv_2 + (ofs & WINDOW_MASK));
	spin_unlock(&vmax301_spin);
	return ret;
}
Example #4
0
static __u32 vmax301_read32(struct map_info *map, unsigned long ofs)
{
	__u32 ret;
	spin_lock(&vmax301_spin);
	vmax301_page(map, ofs);
	ret =  readl(map->map_priv_2 + (ofs & WINDOW_MASK));
	spin_unlock(&vmax301_spin);
	return ret;
}
Example #5
0
static void vmax301_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
{
	while(len) {
		unsigned long thislen = len;
		if (len > (WINDOW_LENGTH - (from & WINDOW_MASK)))
			thislen = WINDOW_LENGTH-(from & WINDOW_MASK);
		spin_lock(&vmax301_spin);
		vmax301_page(map, from);
		memcpy_fromio(to, map->map_priv_2 + from, thislen);
		spin_unlock(&vmax301_spin);
		to += thislen;
		from += thislen;
		len -= thislen;
	}
}
Example #6
0
static void vmax301_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
{
	while(len) {
		unsigned long thislen = len;
		if (len > (WINDOW_LENGTH - (to & WINDOW_MASK)))
			thislen = WINDOW_LENGTH-(to & WINDOW_MASK);

		spin_lock(&vmax301_spin);
		vmax301_page(map, to);
		memcpy_toio(map->map_priv_2 + to, from, thislen);
		spin_unlock(&vmax301_spin);
		to += thislen;
		from += thislen;
		len -= thislen;
	}
}