dumprom update

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8230 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen 2004-06-29 11:29:39 +00:00
parent 39ffb98012
commit 07abc06fd2
4 changed files with 9 additions and 19 deletions

View File

@ -31,7 +31,7 @@ typedef struct {
int32 ben; int32 ben;
} benaphore; } benaphore;
#define INIT_BEN(x) x.sem = create_sem(0, "G400 "#x" benaphore"); x.ben = 0; #define INIT_BEN(x) x.sem = create_sem(0, "NV "#x" benaphore"); x.ben = 0;
#define AQUIRE_BEN(x) if((atomic_add(&(x.ben), 1)) >= 1) acquire_sem(x.sem); #define AQUIRE_BEN(x) if((atomic_add(&(x.ben), 1)) >= 1) acquire_sem(x.sem);
#define RELEASE_BEN(x) if((atomic_add(&(x.ben), -1)) > 1) release_sem(x.sem); #define RELEASE_BEN(x) if((atomic_add(&(x.ben), -1)) > 1) release_sem(x.sem);
#define DELETE_BEN(x) delete_sem(x.sem); #define DELETE_BEN(x) delete_sem(x.sem);
@ -267,11 +267,7 @@ typedef struct {
} ps; } ps;
/* mirror of the ROM (copied in driver, because may not be mapped permanently) */ /* mirror of the ROM (copied in driver, because may not be mapped permanently) */
struct uint8 rom_mirror[65536];
{
uint8 mirror[128 * 1024];
uint32 size;
} rom;
/* some configuration settings from ~/config/settings/kernel/drivers/nv.settings if exists */ /* some configuration settings from ~/config/settings/kernel/drivers/nv.settings if exists */
settings settings; settings settings;

View File

@ -80,7 +80,7 @@ status_t nv_general_powerup()
{ {
status_t status; status_t status;
LOG(1,("POWERUP: nVidia (open)BeOS Accelerant 0.15 running.\n")); LOG(1,("POWERUP: nVidia (open)BeOS Accelerant 0.16 running.\n"));
/* preset no laptop */ /* preset no laptop */
si->ps.laptop = false; si->ps.laptop = false;

View File

@ -33,11 +33,9 @@ status_t parse_pins ()
/* preset PINS read status to failed */ /* preset PINS read status to failed */
si->ps.pins_status = B_ERROR; si->ps.pins_status = B_ERROR;
LOG(2,("INFO: cardROM size: %dKb\n", (si->rom.size / 1024)));
/* check the validity of PINS */ /* check the validity of PINS */
LOG(2,("INFO: Reading PINS info\n")); LOG(2,("INFO: Reading PINS info\n"));
rom = (uint8 *) si->rom.mirror; rom = (uint8 *) si->rom_mirror;
/* check BIOS signature - this is defined in the PCI standard */ /* check BIOS signature - this is defined in the PCI standard */
if (rom[0]!=0x55 || rom[1]!=0xaa) if (rom[0]!=0x55 || rom[1]!=0xaa)
{ {

View File

@ -456,7 +456,6 @@ static status_t map_device(device_info *di)
/* variables for making copy of ROM */ /* variables for making copy of ROM */
char * rom_temp; char * rom_temp;
area_id rom_area; area_id rom_area;
uint32 rom_size;
/* Nvidia cards have registers in [0] and framebuffer in [1] */ /* Nvidia cards have registers in [0] and framebuffer in [1] */
int registers = 0; int registers = 0;
@ -529,14 +528,11 @@ static status_t map_device(device_info *di)
return rom_area; return rom_area;
} }
/* dump ROM to file if selected in nv.settings */ /* dump ROM to file if selected in nv.settings
if (current_settings.dumprom) dumprom (rom_temp, di->pcii.u.h0.rom_size); * (ROM is always 64Kb: checked TNT1 - FX5950) */
/* we reserved 128Kb for the ROM mirror, but note actual size for reference */ if (current_settings.dumprom) dumprom (rom_temp, 65536);
si->rom.size = di->pcii.u.h0.rom_size; /* make a copy of ROM for future reference */
/* make a copy of ROM for future reference, but truncate our mirror if needed */ memcpy (si->rom_mirror, rom_temp, 65536);
rom_size = si->rom.size;
if (rom_size > (128 * 1024)) rom_size = (128 * 1024);
memcpy (si->rom.mirror, rom_temp, rom_size);
/* disable ROM decoding - this is defined in the PCI standard, and delete the area */ /* disable ROM decoding - this is defined in the PCI standard, and delete the area */
tmpUlong = get_pci(PCI_rom_base, 4); tmpUlong = get_pci(PCI_rom_base, 4);