Example #1
0
void
sc_vtb_append(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2, int count)
{
    int len;
    vm_offset_t p1, p2;

    if (vtb2->vtb_type != VTB_RINGBUFFER)
        return;

    while (count > 0) {
        p1 = vtb_pointer(vtb1, from);
        p2 = vtb_pointer(vtb2, vtb2->vtb_tail);
        len = imin(count, vtb2->vtb_size - vtb2->vtb_tail);
        if (vtb1->vtb_type == VTB_FRAMEBUFFER) {
            bcopy_fromio(p1, p2, len*sizeof(u_int16_t));
            bcopy_fromio(p1 + ATTR_OFFSET_FB,
                         p2 + attr_offset(vtb2),
                         len*sizeof(u_int16_t));
        } else {
            bcopy((void *)p1, (void *)p2, len*sizeof(u_int16_t));
            bcopy((void *)(p1 + attr_offset(vtb1)),
                  (void *)(p2 + attr_offset(vtb2)),
                  len*sizeof(u_int16_t));
        }
        from += len;
        count -= len;
        vtb2->vtb_tail = vtb_wrap(vtb2, vtb2->vtb_tail, len);
    }
}
Example #2
0
void
sc_vtb_append(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2, int count)
{
	int len;

	if (vtb2->vtb_type != VTB_RINGBUFFER)
		return;

	while (count > 0) {
		len = imin(count, vtb2->vtb_size - vtb2->vtb_tail);
#ifndef __sparc64__
		if (vtb1->vtb_type == VTB_FRAMEBUFFER)
			bcopy_fromio(sc_vtb_pointer(vtb1, from),
				     sc_vtb_pointer(vtb2, vtb2->vtb_tail),
				     len*sizeof(u_int16_t));
		else
#endif
			bcopy((void *)sc_vtb_pointer(vtb1, from),
			      (void *)sc_vtb_pointer(vtb2, vtb2->vtb_tail),
			      len*sizeof(u_int16_t));
		from += len;
		count -= len;
		vtb2->vtb_tail = vtb_wrap(vtb2, vtb2->vtb_tail, len);
	}
}
Example #3
0
void
sc_vtb_copy(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2, int to, int count)
{
    vm_offset_t p1, p2;

    p1 = vtb_pointer(vtb1, from);
    p2 = vtb_pointer(vtb2, to);
    if (vtb2->vtb_type == VTB_FRAMEBUFFER) {
        bcopy_toio(p1, p2, count*sizeof(u_int16_t));
        bcopy_toio(p1 + attr_offset(vtb1),
                   p2 + ATTR_OFFSET_FB,
                   count*sizeof(u_int16_t));
    } else if (vtb1->vtb_type == VTB_FRAMEBUFFER) {
        bcopy_fromio(p1, p2, count*sizeof(u_int16_t));
        bcopy_fromio(p1 + ATTR_OFFSET_FB,
                     p2 + attr_offset(vtb2),
                     count*sizeof(u_int16_t));
    } else {
        bcopy((void *)p1, (void *)p2, count*sizeof(u_int16_t));
        bcopy((void *)(p1 + attr_offset(vtb1)),
              (void *)(p2 + attr_offset(vtb2)),
              count*sizeof(u_int16_t));
    }
}
Example #4
0
void
sc_vtb_copy(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2, int to, int count)
{
	/* XXX if both are VTB_VRAMEBUFFER... */
	if (vtb2->vtb_type == VTB_FRAMEBUFFER) {
		bcopy_toio(vtb1->vtb_buffer + from, vtb2->vtb_buffer + to,
			   count*sizeof(uint16_t));
	} else if (vtb1->vtb_type == VTB_FRAMEBUFFER) {
		bcopy_fromio(vtb1->vtb_buffer + from, vtb2->vtb_buffer + to,
			     count*sizeof(uint16_t));
	} else {
		bcopy(vtb1->vtb_buffer + from, vtb2->vtb_buffer + to,
		      count*sizeof(uint16_t));
	}
}
Example #5
0
void
sc_vtb_copy(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2, int to, int count)
{
#ifndef __sparc64__
	/* XXX if both are VTB_VRAMEBUFFER... */
	if (vtb2->vtb_type == VTB_FRAMEBUFFER)
		bcopy_toio(sc_vtb_pointer(vtb1, from),
			   sc_vtb_pointer(vtb2, to),
			   count*sizeof(u_int16_t));
	else if (vtb1->vtb_type == VTB_FRAMEBUFFER)
		bcopy_fromio(sc_vtb_pointer(vtb1, from),
			     sc_vtb_pointer(vtb2, to),
			     count*sizeof(u_int16_t));
	else
#endif
		bcopy((void *)sc_vtb_pointer(vtb1, from),
		      (void *)sc_vtb_pointer(vtb2, to),
		      count*sizeof(u_int16_t));
}
Example #6
0
void
sc_vtb_append(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2, int count)
{
	int len;

	if (vtb2->vtb_type != VTB_RINGBUFFER)
		return;

	while (count > 0) {
		len = imin(count, vtb2->vtb_size - vtb2->vtb_tail);
		if (vtb1->vtb_type == VTB_FRAMEBUFFER) {
			bcopy_fromio(vtb1->vtb_buffer + from,
				     vtb2->vtb_buffer + vtb2->vtb_tail,
				     len*sizeof(uint16_t));
		} else {
			bcopy(vtb1->vtb_buffer + from,
			      vtb2->vtb_buffer + vtb2->vtb_tail,
			      len*sizeof(uint16_t));
		}
		from += len;
		count -= len;
		vtb2->vtb_tail = vtb_wrap(vtb2, vtb2->vtb_tail, len);
	}
}