alpine 3.6
obsolete weakness #64

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-i128/src/xf86-video-i128-1.3.6/src/i128IBMDAC.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.6 obsolete weakness.

    if (pI128->DAC8Bit)
	tmp2 |= 0x04;
   if (!((pI128->MemoryType == I128_MEMORY_DRAM) &&
	 (pI128->bitsPerPixel > 16)))
	tmp2 |= 0x40;
   if ((pI128->MemoryType == I128_MEMORY_SGRAM) &&
	 (pI128->bitsPerPixel > 16) &&
         (pI128->RamdacType != SILVER_HAMMER_DAC) )
	tmp2 &= 0x3F;
   pI128->mem.rbase_g[DATA_I] = tmp2;					MB;
   pI128->mem.rbase_g[IDXL_I] = IBMRGB_misc3;				MB;
   pI128->mem.rbase_g[DATA_I] = 0x00;					MB;
   pI128->mem.rbase_g[IDXL_I] = IBMRGB_misc4;				MB;
   pI128->mem.rbase_g[DATA_I] = 0x00;					MB;

   /* ?? There is no write to cursor control register */

   /* Set the memory clock speed to 95 MHz */
   pI128->mem.rbase_g[IDXL_I] = IBMRGB_sysclk_ref_div;		MB;
   pI128->mem.rbase_g[DATA_I] = 0x08;				MB;
   pI128->mem.rbase_g[IDXL_I] = IBMRGB_sysclk_vco_div;		MB;
   pI128->mem.rbase_g[DATA_I] = 0x50;				MB;

   /* should delay at least a millisec so we'll wait 50 */
   usleep(50000);

   switch (pI128->depth) {
   	case 24: /* 32 bit */
   		pI128->mem.rbase_g[IDXL_I] = IBMRGB_pix_fmt;		MB;
   		tmp2 = pI128->mem.rbase_g[DATA_I] & 0xf8;
   		pI128->mem.rbase_g[DATA_I] = tmp2 | 0x06;		MB;
   		pI128->mem.rbase_g[IDXL_I] = IBMRGB_32bpp;		MB;
   		pI128->mem.rbase_g[DATA_I] = 0x03;			MB;
   		break;
	case 16:
   		pI128->mem.rbase_g[IDXL_I] = IBMRGB_pix_fmt;		MB;
   		tmp2 = pI128->mem.rbase_g[DATA_I] & 0xf8;
   		pI128->mem.rbase_g[DATA_I] = tmp2 | 0x04;		MB;
   		pI128->mem.rbase_g[IDXL_I] = IBMRGB_16bpp;		MB;
   		pI128->mem.rbase_g[DATA_I] = 0xC7;			MB;
   		break;
	case 15:
   		pI128->mem.rbase_g[IDXL_I] = IBMRGB_pix_fmt;		MB;
   		tmp2 = pI128->mem.rbase_g[DATA_I] & 0xf8;
   		pI128->mem.rbase_g[DATA_I] = tmp2 | 0x04;		MB;
   		pI128->mem.rbase_g[IDXL_I] = IBMRGB_16bpp;		MB;
   		pI128->mem.rbase_g[DATA_I] = 0xC5;			MB;
   		break;
	default: /* 8 bit */
   		pI128->mem.rbase_g[IDXL_I] = IBMRGB_pix_fmt;		MB; 

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.