Merge pciaccess branch
This commit is contained in:
commit
2a3aa4d570
18 changed files with 354 additions and 53 deletions
|
@ -38,11 +38,11 @@ static struct grub_video_patch
|
|||
};
|
||||
|
||||
static int NESTED_FUNC_ATTR
|
||||
scan_card (int bus, int dev, int func, grub_pci_id_t pciid)
|
||||
scan_card (grub_pci_device_t dev, grub_pci_id_t pciid)
|
||||
{
|
||||
grub_pci_address_t addr;
|
||||
|
||||
addr = grub_pci_make_address (bus, dev, func, 2);
|
||||
addr = grub_pci_make_address (dev, 2);
|
||||
if (grub_pci_read_byte (addr + 3) == 0x3)
|
||||
{
|
||||
struct grub_video_patch *p = video_patches;
|
||||
|
|
|
@ -41,6 +41,7 @@ enable_rom_area (void)
|
|||
{
|
||||
grub_pci_address_t addr;
|
||||
grub_uint32_t *rom_ptr;
|
||||
grub_pci_device_t dev = { .bus = 0, .device = 0, .function = 0};
|
||||
|
||||
rom_ptr = (grub_uint32_t *) VBIOS_ADDR;
|
||||
if (*rom_ptr != BLANK_MEM)
|
||||
|
@ -49,7 +50,7 @@ enable_rom_area (void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
addr = grub_pci_make_address (0, 0, 0, 36);
|
||||
addr = grub_pci_make_address (dev, 36);
|
||||
grub_pci_write_byte (addr++, 0x30);
|
||||
grub_pci_write_byte (addr++, 0x33);
|
||||
grub_pci_write_byte (addr++, 0x33);
|
||||
|
@ -73,8 +74,9 @@ static void
|
|||
lock_rom_area (void)
|
||||
{
|
||||
grub_pci_address_t addr;
|
||||
grub_pci_device_t dev = { .bus = 0, .device = 0, .function = 0};
|
||||
|
||||
addr = grub_pci_make_address (0, 0, 0, 36);
|
||||
addr = grub_pci_make_address (dev, 36);
|
||||
grub_pci_write_byte (addr++, 0x10);
|
||||
grub_pci_write_byte (addr++, 0x11);
|
||||
grub_pci_write_byte (addr++, 0x11);
|
||||
|
|
|
@ -115,15 +115,16 @@ grub_pci_get_class (int class, int subclass)
|
|||
}
|
||||
|
||||
static int NESTED_FUNC_ATTR
|
||||
grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid)
|
||||
grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid)
|
||||
{
|
||||
grub_uint32_t class;
|
||||
const char *sclass;
|
||||
grub_pci_address_t addr;
|
||||
|
||||
grub_printf ("%02x:%02x.%x %04x:%04x", bus, dev, func, pciid & 0xFFFF,
|
||||
pciid >> 16);
|
||||
addr = grub_pci_make_address (bus, dev, func, 2);
|
||||
grub_printf ("%02x:%02x.%x %04x:%04x", grub_pci_get_bus (dev),
|
||||
grub_pci_get_device (dev), grub_pci_get_function (dev),
|
||||
pciid & 0xFFFF, pciid >> 16);
|
||||
addr = grub_pci_make_address (dev, 2);
|
||||
class = grub_pci_read (addr);
|
||||
|
||||
/* Lookup the class name, if there isn't a specific one,
|
||||
|
@ -156,13 +157,13 @@ grub_cmd_lspci (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
static grub_command_t cmd;
|
||||
|
||||
GRUB_MOD_INIT(pci)
|
||||
GRUB_MOD_INIT(lspci)
|
||||
{
|
||||
cmd = grub_register_command ("lspci", grub_cmd_lspci,
|
||||
0, "List PCI devices");
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(pci)
|
||||
GRUB_MOD_FINI(lspci)
|
||||
{
|
||||
grub_unregister_command (cmd);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue