From: Vladimir 'phcoder' Serbinenko Date: Tue, 22 Dec 2009 09:41:53 +0000 (+0100) Subject: 2009-12-22 Vladimir Serbinenko X-Git-Tag: 1.98~277 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc77a799590ff9d1acad040e542f7c5e0be15e4f;p=thirdparty%2Fgrub.git 2009-12-22 Vladimir Serbinenko * commands/lspci.c (grub_pci_classes): Add "USB Controller". (options): New variable. (iospace): Likewise. (grub_lspci_iter): List IO spaces if "-i" was given. (grub_cmd_lspci): Parse options. (GRUB_MOD_INIT(lspci)): Use extcmd. (GRUB_MOD_FINI(lspci)): Likewise. --- dc77a799590ff9d1acad040e542f7c5e0be15e4f diff --cc ChangeLog index b81bf53cf,744b7a9ab..c041a685c --- a/ChangeLog +++ b/ChangeLog @@@ -1,66 -1,6 +1,76 @@@ ++2009-12-22 Vladimir Serbinenko ++ ++ * commands/lspci.c (grub_pci_classes): Add "USB Controller". ++ (options): New variable. ++ (iospace): Likewise. ++ (grub_lspci_iter): List IO spaces if "-i" was given. ++ (grub_cmd_lspci): Parse options. ++ (GRUB_MOD_INIT(lspci)): Use extcmd. ++ (GRUB_MOD_FINI(lspci)): Likewise. ++ +2009-12-22 Felix Zielcke + + * util/grub.d/30_os-prober.in (osx_entry): Remove non POSIX compliant + `function' keyword. + Patch by Tony Mancill . + +2009-12-22 Vladimir Serbinenko + + * bus/usb/uhci.c (grub_uhci_transfer): Set a limit transaction time. + (grub_uhci_portstatus): Likewise. + (grub_uhci_portstatus): Add necessary delay. + * bus/usb/usbhub.c (grub_usb_hub_add_dev): Fix loop-break condition. + +2009-12-21 Carles Pina i Estany + + * commands/acpi.c (options): Fix capitalizations and/or full stops. + (GRUB_MOD_INIT): Likewise. + * commands/boot.c (GRUB_MOD_INIT): Likewise. + * commands/cmp.c (grub_cmd_cmp): Improve the help message. + * commands/echo.c (options): Fix capitalizations and/or full stops. + * commands/efi/loadbios.c (enable_rom_area): Likewise. + (enable_rom_area): Likewise. + (GRUB_MOD_INIT): Likewise. + * commands/gptsync.c (GRUB_MOD_INIT): Likewise. + * commands/halt.c (GRUB_MOD_INIT): Improve the help message. + * commands/handler.c (GRUB_MOD_INIT): Likewise. + * commands/hdparm.c (options): Fix capitalizations and/or full stops. + * commands/hexdump.c (options): Likewise. + * commands/i386/cpuid.c (options): Likewise. + (GRUB_MOD_INIT): Likewise. + * commands/i386/pc/drivemap.c (options): Likewise. + (GRUB_MOD_INIT): Likewise. + * commands/i386/pc/halt (options): Likewise. + (GRUB_MOD_INIT): Likewise. + * commands/i386/pc/play.c (GRUB_MOD_INIT): Likewise. + * commands/i386/pc/pxecmd.c (options): Likewise. + * commands/i386/pc/vbetest.c (GRUB_MOD_INIT): Likewise. + * commands/ieee1275/suspend.c (GRUB_MOD_INIT): Likewise. + * commands/keystatus.c (options): Likewise. + (GRUB_MOD_INIT): Likewise. + * commands/loadenv.c (options): Likewise. + * commands/ls.c (options): Likewise. + * commands/lspci.c (GRUB_MOD_INIT): Likewise. + * commands/memrw.c (GRUB_MOD_INIT): Likewise. + * commands/minicmd.c (GRUB_MOD_INIT): Likewise. + * commands/parttool.c (helpmsg): Likewise. + * commands/probe.c (options): Likewise. + * commands/read.c (GRUB_MOD_INIT): Likewise. + * commands/reboot.c (GRUB_MOD_INIT): Likewise. + * commands/search.c (options): Likewise. + * commands/sleep.c (options): Likewise. + * commands/test.c (GRUB_MOD_INIT): Likewise. + * commands/true.c (GRUB_MOD_INIT): Likewise. + * commands/usbtest.c (GRUB_MOD_INIT): Likewise. + * commands/videotest.c (GRUB_MOD_INIT): Likewise. + * lib/arg.c (help_options): Likewise. + * Makefile.in ($(srcdir)/po/$(PACKAGE).pot): Pass -ctranslate to + `$(XGETTEXT)'. + * po/POTFILES: Add `commands/loadenv.c'. + 2009-12-21 Felix Zielcke - * util/grub-mkrescue.in: (process_input_dir): Copy `*.lst' files + * util/grub-mkrescue.in (process_input_dir): Copy `*.lst' files instead of specifying them explicit. 2009-12-21 Robert Millan diff --cc commands/lspci.c index 507355687,ddfeb7873..559bb8242 --- a/commands/lspci.c +++ b/commands/lspci.c @@@ -120,6 -129,7 +129,7 @@@ grub_lspci_iter (grub_pci_device_t dev grub_uint32_t class; const char *sclass; grub_pci_address_t addr; - int i, reg; ++ int reg; grub_printf ("%02x:%02x.%x %04x:%04x", grub_pci_get_bus (dev), grub_pci_get_device (dev), grub_pci_get_function (dev), @@@ -143,6 -153,52 +153,53 @@@ grub_printf ("\n"); + if (iospace) + { + reg = 4; - for (i = 0; i < 6; i++) ++ while (reg < 10) + { + grub_uint64_t space; + addr = grub_pci_make_address (dev, reg); + space = grub_pci_read (addr); + + reg++; + + if (space == 0) + continue; + + switch (space & GRUB_PCI_ADDR_SPACE_MASK) + { + case GRUB_PCI_ADDR_SPACE_IO: - grub_printf ("\tIO space %d at 0x%llx\n", i, (unsigned long long) ++ grub_printf ("\tIO space %d at 0x%llx\n", (reg - 1) - 4, ++ (unsigned long long) + (space & GRUB_PCI_ADDR_IO_MASK)); + break; + case GRUB_PCI_ADDR_SPACE_MEMORY: + if ((space & GRUB_PCI_ADDR_MEM_TYPE_MASK) + == GRUB_PCI_ADDR_MEM_TYPE_64) + { + addr = grub_pci_make_address (dev, reg); + space |= ((grub_uint64_t) grub_pci_read (addr)) << 32; + reg++; + grub_printf ("\t64-bit memory space %d at 0x%016llx [%s]\n", - i, (unsigned long long) ++ (reg - 2) - 4, (unsigned long long) + (space & GRUB_PCI_ADDR_MEM_MASK), + space & GRUB_PCI_ADDR_MEM_PREFETCH + ? "prefetchable" : "non-prefetchable"); + + } + else - grub_printf ("\t32-bit memory space %d at 0x%016llx [%s]\n", i, - (unsigned long long) ++ grub_printf ("\t32-bit memory space %d at 0x%016llx [%s]\n", ++ (reg - 1) - 4, (unsigned long long) + (space & GRUB_PCI_ADDR_MEM_MASK), + space & GRUB_PCI_ADDR_MEM_PREFETCH + ? "prefetchable" : "non-prefetchable"); + break; + } + } + } + + return 0; } @@@ -159,8 -216,8 +217,8 @@@ static grub_extcmd_t cmd GRUB_MOD_INIT(lspci) { - cmd = grub_register_command ("lspci", grub_cmd_lspci, - 0, "List PCI devices."); + cmd = grub_register_extcmd ("lspci", grub_cmd_lspci, GRUB_COMMAND_FLAG_BOTH, - "lspci [-i]", "List PCI devices", options); ++ "lspci [-i]", "List PCI devices.", options); } GRUB_MOD_FINI(lspci)