r2074 broke ata module
Hi there,
I tried to use the ata module today in combination with grub2's coreboot code, but found that it broke in r2074, specifically by this hunk:
------------------------------------------------------------------------
grub/pci.h +2 -2
@@ -36,8 +36,8 @@#define GRUB_PCI_ADDR_IO_MASK ~0x03typedef grub_uint32_t grub_pci_id_t ; -typedef int (*grub_pci_iteratefunc_t ) (int bus,int device,int func, -grub_pci_id_t pciid); +typedef int NESTED_FUNC_ATTR (*grub_pci_iteratefunc_t) + (int bus,int device,int func,grub_pci_id_t pciid);typedef grub_uint32_t grub_pci_address_t ; grub_pci_address_t EXPORT_FUNC(grub_pci_make_address) (int bus, int device,
------------------------------------------------------------------------
Reverting that hunk fixes ata for me. The symptom of a broken ata module is that it does not see any ATA disks.
I'm testing on qemu, and start qemu like this:
qemu -m 1024 -serial stdio -L qemu-cbv2-grub2/ -hda path-to-image
Up to r2073, that image shows up as ata0, from r2074 it's simply not detected.
Thoughts?
Thanks,
Ward.
Quoted 4 lines · Ward Vandewege
Hi there,
I tried to use the ata module today in combination with grub2's coreboot code, but found that it broke in r2074, specifically by this hunk:
Actually, I was looking at the warnings, and it looks like the warnings about grub_pci_iterate() are directly related to this problem.
This patch should help.
ata.c +1 -1
@@ -375,7 +375,7 @@return 0 ; } -static int +static int NESTED_FUNC_ATTRgrub_ata_pciinit (int bus,int device,int func,grub_pci_id_t pciid __attribute__((unused))) {
usb/ohci.c +3 -2
@@ -112,8 +112,9 @@/* Iterate over all PCI devices. Determine if a device is an OHCI controller. If this is the case, initialize it. */ -static int grub_ohci_pci_iter (int bus,int device,int func, -grub_pci_id_t pciid __attribute__((unused))) +static int NESTED_FUNC_ATTR +grub_ohci_pci_iter (int bus,int device,int func, +grub_pci_id_t pciid __attribute__((unused))) {grub_uint32_t class;grub_uint32_t subclass;
usb/uhci.c +3 -2
@@ -137,8 +137,9 @@/* Iterate over all PCI devices. Determine if a device is an UHCI controller. If this is the case, initialize it. */ -static int grub_uhci_pci_iter (int bus,int device,int func, -grub_pci_id_t pciid __attribute__((unused))) +static int NESTED_FUNC_ATTR +grub_uhci_pci_iter (int bus,int device,int func, +grub_pci_id_t pciid __attribute__((unused))) {grub_uint32_t class;grub_uint32_t subclass;
lspci.c +1 -1
@@ -114,7 +114,7 @@return 0 ; } -static int +static int NESTED_FUNC_ATTR grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) {grub_uint32_t class;
Signature · 2 lines
Regards, Pavel Roskin
Quoted 10 lines · Pavel Roskin
Quoted 4 lines · Ward Vandewege
Hi there,
I tried to use the ata module today in combination with grub2's coreboot code, but found that it broke in r2074, specifically by this hunk:
Actually, I was looking at the warnings, and it looks like the warnings about
grub_pci_iterate()are directly related to this problem.This patch should help.
Confirmed, this fixes ata for me.
Thanks!
Ward.
Quoted 7 lines · Ward Vandewege
Quoted 6 lines · Pavel Roskin
Quoted 4 lines · Ward Vandewege
Hi there,
I tried to use the ata module today in combination with grub2's coreboot code, but found that it broke in r2074, specifically by this hunk:
Quoted 6 lines
Quoted 4 lines
Actually, I was looking at the warnings, and it looks like the warnings about
grub_pci_iterate()are directly related to this problem.This patch should help.
Confirmed, this fixes ata for me.
Committed.
Signature · 2 lines
Regards, Pavel Roskin