Chameleon

Chameleon Commit Details

Date:2013-02-01 02:04:35 (6 years 11 months ago)
Author:Evan Lojewski
Commit:2181
Parents: 2180
Message:When reading in a rom file, malloc the size of the files.
Changes:
M/trunk/i386/libsaio/nvidia.c

File differences

trunk/i386/libsaio/nvidia.c
16331633
16341634
16351635
1636
1636
16371637
16381638
16391639
......
16441644
16451645
16461646
1647
1648
1649
1650
1651
1652
1653
1654
1647
1648
1649
1650
1651
16551652
16561653
16571654
......
18311828
18321829
18331830
1834
18351831
18361832
18371833
18381834
18391835
18401836
1841
1837
18421838
18431839
18441840
......
18531849
18541850
18551851
1852
1853
18561854
18571855
18581856
return nvidia_card_generic[0].name;
}
static uint32_t load_nvidia_bios_file(const char *filename, uint8_t *buf, int bufsize)
static uint32_t load_nvidia_bios_file(const char *filename, uint8_t **buf)
{
int fd;
int size;
}
size = file_size(fd);
if (size > bufsize)
{
printf("Filesize of %s is bigger than expected! Truncating to 0x%x Bytes!\n",
filename, bufsize);
size = bufsize;
}
size = read(fd, (char *)buf, size);
if(size)
{
*buf = malloc(size);
size = read(fd, (char *)buf, size);
}
close(fd);
return size > 0 ? size : 0;
// Amount of VRAM in kilobytes
videoRam = mem_detect(regs, nvCardType, nvda_dev,((nvda_dev->vendor_id << 16) | nvda_dev->device_id),((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id) );
rom = malloc(NVIDIA_ROM_SIZE);
sprintf(nvFilename, "/Extra/%04x_%04x.rom", (uint16_t)nvda_dev->vendor_id,
(uint16_t)nvda_dev->device_id);
if (getBoolForKey(kUseNvidiaROM, &doit, &bootInfo->chameleonConfig) && doit)
{
verbose("Looking for nvidia video bios file %s\n", nvFilename);
nvBiosOveride = load_nvidia_bios_file(nvFilename, rom, NVIDIA_ROM_SIZE);
nvBiosOveride = load_nvidia_bios_file(nvFilename, &rom);
if (nvBiosOveride > 0)
{
}
else
{
rom = malloc(NVIDIA_ROM_SIZE);
// Otherwise read bios from card
nvBiosOveride = 0;

Archive Download the corresponding diff file

Revision: 2181