void
amiga_contiguous_write_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t v)
{
	/* ARGSUSED */
	* (u_int16_t *) (h + o) = v;
	amiga_bus_reorder_protect();
}
void
amiga_interleaved_wordaccess_write_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t v)
{
	/* ARGSUSED */
	* (u_int16_t *) (h + (o << t->stride)) = v;
	amiga_bus_reorder_protect();
}
Exemple #3
0
/* ARGSUSED */
void
oabs(bsw2_swap_)(bus_space_handle_t handle, bus_size_t offset, unsigned value)
{
	volatile u_int16_t *p;

	p = (volatile u_int16_t *)(handle + offset * AMIGA_SIMPLE_BUS_STRIDE);
	*p = bswap16( (u_int16_t)value );
	amiga_bus_reorder_protect();
}
u_int16_t
amiga_contiguous_read_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o)
{
	/* ARGSUSED */
	u_int16_t x;

	x  = * (u_int16_t *) (h + o); /* only used if t->stride == 0 */
	amiga_bus_reorder_protect();
	return x;
}
u_int16_t
amiga_interleaved_wordaccess_read_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o)
{
	/* ARGSUSED */
	u_int16_t x;

	x = * (u_int16_t *) (h + (o << t->stride));
	amiga_bus_reorder_protect();
	return x;
}
Exemple #6
0
/* ARGSUSED */
u_int32_t
oabs(bsr4_swap_)(bus_space_handle_t handle, bus_size_t offset)
{
	volatile u_int32_t *p;
	u_int32_t x;

	p = (volatile u_int32_t *)(handle + offset * AMIGA_SIMPLE_BUS_STRIDE);
	x = *p;
	amiga_bus_reorder_protect();
	return bswap32(x);
}
void
amiga_contiguous_set_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t v, bus_size_t s)
{
	/* ARGSUSED */
	volatile u_int16_t *q = (volatile u_int16_t *)(h + o);

	while (s-- > 0) {
		*q++ = v;
		amiga_bus_reorder_protect();
	}
}
void
amiga_contiguous_write_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int16_t *p, bus_size_t s)
{
	/* ARGSUSED */
	volatile u_int16_t *q = (volatile u_int16_t *)(h + o);

	while (s-- > 0) {
		*q = *p++;
		amiga_bus_reorder_protect();
	}
}
void
amiga_contiguous_copy_region_2(bus_space_tag_t t, bus_space_handle_t srch, bus_size_t srco, bus_space_handle_t dsth, bus_size_t dsto, bus_size_t s)
{
	/* ARGSUSED */
	volatile u_int16_t *p = (volatile u_int16_t *)(srch + srco);
	volatile u_int16_t *q = (volatile u_int16_t *)(dsth + dsto);

	while (s-- > 0) {
		*q++ = *p++;
		amiga_bus_reorder_protect();
	}
}
u_int16_t
amiga_interleaved_read_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o)
{
	volatile u_int8_t *q;
	u_int16_t x;
	int step;

	step = 1 << t->stride;
	q = (volatile u_int8_t *)(h + (o << t->stride));
	x = ((*q) << 8) | *(q + step);
	amiga_bus_reorder_protect();
	return x;
}
void
amiga_interleaved_wordaccess_write_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int16_t *p, bus_size_t s)
{
	/* ARGSUSED */
	volatile u_int16_t *q;

	q = (volatile u_int16_t *)(h + (o << t->stride));

	while (s-- > 0) {
		*q = *p++;
		amiga_bus_reorder_protect();
	}
}
void
amiga_interleaved_write_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t v)
{
	volatile u_int8_t *q;
	int step;

	step = 1 << t->stride;
	q = (volatile u_int8_t *)(h + (o << t->stride));

	*q = v >> 8;
	*(q+step) = v;
	amiga_bus_reorder_protect();
}
void
amiga_interleaved_set_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t v, bus_size_t s)
{
	int step;
	volatile u_int16_t *q = (volatile u_int16_t *)(h + o);

	step = 1 << t->stride;

	while (s-- > 0) {
		*q = v;
		amiga_bus_reorder_protect();
		q += step;
	}
}
void
amiga_interleaved_read_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t *p, bus_size_t s)
{
	volatile u_int8_t *q;
	int step;

	step = 1 << t->stride;
	q = (volatile u_int8_t *)(h + (o << t->stride));

	while (s-- > 0) {
		*p++ =  ((*q)<<8) | *(q+step);
		amiga_bus_reorder_protect();
	}
}
Exemple #15
0
/* ARGSUSED */
void
oabs(bsrm2_swap_)(bus_space_handle_t handle, bus_size_t offset,
			u_int16_t *pointer, bus_size_t count)
{
	volatile u_int16_t *p;

	p = (volatile u_int16_t *)(handle + offset * AMIGA_SIMPLE_BUS_STRIDE);

	while (count > 0) {
		*pointer++ = bswap16(*p);
		amiga_bus_reorder_protect();
		--count;
	}
}
void
amiga_interleaved_copy_region_2(bus_space_tag_t t, bus_space_handle_t srch, bus_size_t srco, bus_space_handle_t dsth, bus_size_t dsto, bus_size_t s)
{
	int step;
	volatile u_int16_t *p = (volatile u_int16_t *)(srch + srco);
	volatile u_int16_t *q = (volatile u_int16_t *)(dsth + dsto);

	step = 1 << t->stride;

	while (s-- > 0) {
		*q = *p;
		amiga_bus_reorder_protect();
		p += step;
		q += step;
	}
}
void
amiga_interleaved_wordaccess_set_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t v, bus_size_t s)
{
	/* ARGSUSED */
	volatile u_int16_t *q;
	int step;

	q = (volatile u_int16_t *)(h + (o << t->stride));
	step = (1 << t->stride) / sizeof(u_int16_t);

	while (s-- > 0) {
		*q = v;
		amiga_bus_reorder_protect();
		q += step;
	}
}
void
amiga_interleaved_write_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int16_t *p, bus_size_t s)
{
	volatile u_int8_t *q;
	int step;
	u_int16_t v;

	step = 1 << t->stride;
	q = (volatile u_int8_t *)(h + (o << t->stride));

	while (s-- > 0) {
		v = *p++;
		*q 		= v>>8;
		*(q + step)	= v;
		amiga_bus_reorder_protect();
	}
}
static void
empb_bswm4_swap(bus_space_handle_t handle, bus_size_t offset, 
    const u_int32_t *pointer, bus_size_t count)
{
	volatile uint32_t *p;
	bus_addr_t wp; 

	wp = empb_switch_window(empb_sc, handle);
	p = (volatile uint32_t *) ((empb_sc->pci_mem_win_t->base) + 
	    (handle - wp) + offset);

	while (count > 0) {
		*p = bswap32(*pointer++);
 		amiga_bus_reorder_protect();
		--count;
	}
}
static void
empb_bssr2_swap(bus_space_handle_t handle, bus_size_t offset, unsigned value,
    bus_size_t count)
{
	volatile uint16_t *p;
	bus_addr_t wp; 

	wp = empb_switch_window(empb_sc, handle);
	p = (volatile uint16_t *) ((empb_sc->pci_mem_win_t->base) + 
	    (handle - wp) + offset);

 	while (count > 0) {
 		*p = bswap16(value);
		amiga_bus_reorder_protect();
		p++;
		--count;
	}
}
void
amiga_interleaved_wordaccess_copy_region_2(bus_space_tag_t t, bus_space_handle_t srch, bus_size_t srco, bus_space_handle_t dsth, bus_size_t dsto, bus_size_t s)
{
	int step;
	/* ARGSUSED */
	volatile u_int16_t *p;
	volatile u_int16_t *q;

	p = (volatile u_int16_t *)(srch + (srco << t->stride));
	q = (volatile u_int16_t *)(dsth + (dsto << t->stride));
	step = (1 << t->stride) / sizeof(u_int16_t);

	while (s-- > 0) {
		*q = *p;
		amiga_bus_reorder_protect();
		q += step;
		p += step;
	}
}
void
amiga_interleaved_read_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t *p, bus_size_t s)
{
	volatile u_int8_t *q;
	int step;
	u_int16_t v;

	step = 1 << t->stride;
	q = (volatile u_int8_t *)(h + (o << t->stride));

	while (s-- > 0) {
		v = (*q) << 8;
		q += step;
		v |= *q;
		amiga_bus_reorder_protect();
		q += step;
		*p++ =  v;
	}
}
/* XXX: this is broken, rewrite, XXX 2: should we swap here? */
void
empb_bscr4(bus_space_handle_t handlefrom, bus_size_t from, 
    bus_space_handle_t handleto, bus_size_t to, bus_size_t count)
{
	volatile uint32_t *p, *q;
	bus_addr_t wp; 

	wp = empb_switch_window(empb_sc, handlefrom);

	p = (volatile uint32_t *)
	    ( ((empb_sc->pci_mem_win_t->base)+(handlefrom - wp)) + from );
	q = (volatile uint32_t *)
	    ( ((empb_sc->pci_mem_win_t->base)+(handleto - wp)) + to );

	while (count > 0) {
		*q = *p;
		amiga_bus_reorder_protect();
		p++; q++;
		--count;
	}
}