FreeBSD/sys/dev/fb/vga.c
/*
 * set_hw_cursor_shape():
 * Change the shape of the hardware text cursor. If the height is
 * zero or negative, the cursor won't be shown.
 *
 * all adapters
 */
Change the shape of the hardware text cursor. If the height is
zero or negative, the cursor won't be shown.

all adapters
Change the shape of the hardware text cursor . If the height is zero or negative the cursor won ' t be shown . all adapters
static int
vga_set_hw_cursor_shape(video_adapter_t *adp, int base, int height,
			int celsize, int blink)
{
    int s;
    if (!vga_init_done)
	return ENXIO;
    s = spltty();
    switch (adp->va_type) {
    case KD_VGA:
    case KD_CGA:
    case KD_MONO:
    case KD_HERCULES:
    default:
	if (height <= 0) {
	    outb(adp->va_crtc_addr, 10);
	    outb(adp->va_crtc_addr + 1, 32);
	    outb(adp->va_crtc_addr, 11);
	    outb(adp->va_crtc_addr + 1, 0);
	} else {
	    outb(adp->va_crtc_addr, 10);
	    outb(adp->va_crtc_addr + 1, celsize - base - height);
	    outb(adp->va_crtc_addr, 11);
	    outb(adp->va_crtc_addr + 1, celsize - base - 1);
	}
	break;
    case KD_EGA:
	if (height <= 0) {
	    outb(adp->va_crtc_addr, 10);
	    outb(adp->va_crtc_addr + 1, celsize);
	    outb(adp->va_crtc_addr, 11);
	    outb(adp->va_crtc_addr + 1, 0);
	} else {
	    outb(adp->va_crtc_addr, 10);
	    outb(adp->va_crtc_addr + 1, celsize - base - height);
	    outb(adp->va_crtc_addr, 11);
	    outb(adp->va_crtc_addr + 1, celsize - base);
	}
	break;
    }
    splx(s);
    return 0;
}
static int vga_set_hw_cursor_shape ( video_adapter_t * adp , int base , int height , int celsize , int blink ) { int s ; if ( ! vga_init_done ) return ENXIO ; s = spltty ( ) ; switch ( adp -> va_type ) { case KD_VGA : case KD_CGA : case KD_MONO : case KD_HERCULES : default : if ( height <= 0 ) { outb ( adp -> va_crtc_addr , 10 ) ; outb ( adp -> va_crtc_addr + 1 , 32 ) ; outb ( adp -> va_crtc_addr , 11 ) ; outb ( adp -> va_crtc_addr + 1 , 0 ) ; } else { outb ( adp -> va_crtc_addr , 10 ) ; outb ( adp -> va_crtc_addr + 1 , celsize - base - height ) ; outb ( adp -> va_crtc_addr , 11 ) ; outb ( adp -> va_crtc_addr + 1 , celsize - base - 1 ) ; } break ; case KD_EGA : if ( height <= 0 ) { outb ( adp -> va_crtc_addr , 10 ) ; outb ( adp -> va_crtc_addr + 1 , celsize ) ; outb ( adp -> va_crtc_addr , 11 ) ; outb ( adp -> va_crtc_addr + 1 , 0 ) ; } else { outb ( adp -> va_crtc_addr , 10 ) ; outb ( adp -> va_crtc_addr + 1 , celsize - base - height ) ; outb ( adp -> va_crtc_addr , 11 ) ; outb ( adp -> va_crtc_addr + 1 , celsize - base ) ; } break ; } splx ( s ) ; return 0 ; }
set_hw_cursor_shape():
 Change the shape of the hardware text cursor.
set_hw_cursor_shape () : Change the shape of the hardware text cursor .
/* make the cursor invisible */ /* make the cursor invisible */