centos 6
obsolete weakness #36

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

xf86-video-rendition-4.2.6/src/vmodes.c

Context:

The highlighted line of code below is the trigger point of this particular Centos 6 obsolete weakness.

     verite_restoredac (pScreenInfo, reg);
    /*
     * If this is a Verite 1000, restore the MODEREG
     * register now.  The MODEREG gets restored later
     * for the Verite 2x00 because restoring it here
     * has been confirmed to cause intermittent
     * system locks.
     */
    if (pRendition->board.chip == V1000_DEVICE) {
	verite_out32(iob+MODEREG,reg->mode);
    }
    verite_out8(iob+MEMENDIAN,reg->memendian);
    verite_out32(iob+DRAMCTL,reg->dramctl);
    verite_out32(iob+SCLKPLL,reg->sclkpll);
    if (pRendition->board.chip == V1000_DEVICE) {
	/* fixme */
        set_PLL(iob, reg->pclkpll);
	usleep(10000);
    } else { 
	verite_out32(iob+PCLKPLL,reg->pclkpll);
	/* 
	 * Need to wait 200uS for PLL to stabilize --
	 * let's play it safe with 500 
	 */
	usleep(10000);
	/* wait until VBLANK */
	while ((verite_in32(iob+CRTCSTATUS)&CRTCSTATUS_VERT_MASK) !=
	       CRTCSTATUS_VERT_ACTIVE);
	while ((verite_in32(iob+CRTCSTATUS)&CRTCSTATUS_VERT_MASK) ==
	       CRTCSTATUS_VERT_ACTIVE);
    }

    /*
     * If this is a Verite 2x00, restore the MODEREG
     * register now.  The MODEREG register is restored
     * earlier for the Verite 1000, but is restored
     * here for the Verite 2x00 to prevent system
     * locks.
     */
    if (pRendition->board.chip != V1000_DEVICE) {
	verite_out32(iob+MODEREG,reg->mode);
    }

    verite_out32(iob+CRTCHORZ,reg->crtch);
    verite_out32(iob+CRTCVERT,reg->crtcv);
    verite_out32(iob+FRAMEBASEA, reg->vbasea);
    verite_out32(iob+CRTCOFFSET,reg->crtcoff);
    verite_out32(iob+CRTCCTL,reg->crtcctl);
}
 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.