Beispiel #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);
    }
}
Beispiel #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);
	}
}
Beispiel #3
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);
	}
}