FreeBSD/sys/dev/fb/vga.c
/*
 * read_hw_cursor():
 * Read the position of the hardware text cursor.
 *
 * all adapters
 */
Read the position of the hardware text cursor.

all adapters
Read the position of the hardware text cursor . all adapters
static int
vga_read_hw_cursor(video_adapter_t *adp, int *col, int *row)
{
    u_int16_t off;
    int s;
    if (!vga_init_done)
	return ENXIO;
    if (adp->va_info.vi_flags & V_INFO_GRAPHICS)
	return ENODEV;
    s = spltty();
    outb(adp->va_crtc_addr, 14);
    off = inb(adp->va_crtc_addr + 1);
    outb(adp->va_crtc_addr, 15);
    off = (off << 8) | inb(adp->va_crtc_addr + 1);
    splx(s);
    *row = off / adp->va_info.vi_width;
    *col = off % adp->va_info.vi_width;
    return 0;
}
static int vga_read_hw_cursor ( video_adapter_t * adp , int * col , int * row ) { u_int16_t off ; int s ; if ( ! vga_init_done ) return ENXIO ; if ( adp -> va_info . vi_flags & V_INFO_GRAPHICS ) return ENODEV ; s = spltty ( ) ; outb ( adp -> va_crtc_addr , 14 ) ; off = inb ( adp -> va_crtc_addr + 1 ) ; outb ( adp -> va_crtc_addr , 15 ) ; off = ( off << 8 ) | inb ( adp -> va_crtc_addr + 1 ) ; splx ( s ) ; * row = off / adp -> va_info . vi_width ; * col = off % adp -> va_info . vi_width ; return 0 ; }
read_hw_cursor():
 Read the position of the hardware text cursor.
read_hw_cursor () : Read the position of the hardware text cursor .