Merge from trunk
This commit is contained in:
commit
37ba589a4e
90 changed files with 2241 additions and 3762 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);
|
||||
|
|
|
@ -19,15 +19,7 @@
|
|||
|
||||
#include <grub/dl.h>
|
||||
#include <grub/command.h>
|
||||
|
||||
#if defined(GRUB_MACHINE_IEEE1275)
|
||||
#include <grub/machine/kernel.h>
|
||||
#elif defined(GRUB_MACHINE_EFI)
|
||||
#include <grub/efi/efi.h>
|
||||
#else
|
||||
/* Platforms shipping standalone halt, such as coreboot. */
|
||||
#include <grub/cpu/halt.h>
|
||||
#endif
|
||||
#include <grub/misc.h>
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_halt (grub_command_t cmd __attribute__ ((unused)),
|
||||
|
|
|
@ -38,18 +38,18 @@ grub_cmd_hexdump (grub_extcmd_t cmd, int argc, char **args)
|
|||
struct grub_arg_list *state = cmd->state;
|
||||
char buf[GRUB_DISK_SECTOR_SIZE * 4];
|
||||
grub_ssize_t size, length;
|
||||
grub_addr_t skip;
|
||||
grub_disk_addr_t skip;
|
||||
int namelen;
|
||||
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
|
||||
|
||||
namelen = grub_strlen (args[0]);
|
||||
skip = (state[0].set) ? grub_strtoul (state[0].arg, 0, 0) : 0;
|
||||
skip = (state[0].set) ? grub_strtoull (state[0].arg, 0, 0) : 0;
|
||||
length = (state[1].set) ? grub_strtoul (state[1].arg, 0, 0) : 256;
|
||||
|
||||
if (!grub_strcmp (args[0], "(mem)"))
|
||||
hexdump (skip, (char *) skip, length);
|
||||
hexdump (skip, (char *) (grub_addr_t) skip, length);
|
||||
else if ((args[0][0] == '(') && (args[0][namelen - 1] == ')'))
|
||||
{
|
||||
grub_disk_t disk;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
#include <grub/dl.h>
|
||||
#include <grub/machine/init.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/extcmd.h>
|
||||
|
||||
static const struct grub_arg_option options[] =
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -19,18 +19,7 @@
|
|||
|
||||
#include <grub/dl.h>
|
||||
#include <grub/command.h>
|
||||
|
||||
#if defined(GRUB_MACHINE_IEEE1275)
|
||||
#include <grub/machine/kernel.h>
|
||||
#elif defined(GRUB_MACHINE_EFI)
|
||||
#include <grub/efi/efi.h>
|
||||
#elif defined(GRUB_MACHINE_PCBIOS)
|
||||
#include <grub/machine/init.h>
|
||||
#else
|
||||
/* Platforms shipping standalone reboot, such as coreboot. */
|
||||
#include <grub/cpu/reboot.h>
|
||||
#endif
|
||||
|
||||
#include <grub/misc.h>
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_reboot (grub_command_t cmd __attribute__ ((unused)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue