ron minnich has uploaded this change for review.

View Change

get vgabios command to build in

This program was broken by f94aed87730. This points to a weakness
in our CI: changes in coreboot itself broke a utility and it
was not caught for a year.

This builds, but in most ways, it seems like it would never work.
Many important bits are unsupported, particularly devfn and
tracing.

It seems the best path forward is to revert the 2015 patch that
converted it to using YABEL. The vgabios code prior to that patch
builds without warning and still works.

But it's probably worth getting this code to build.

Change-Id: I48e13e31deee0100a616a2f1d08ca84b9c470219
Signed-off-by: Ronald G Minnich <rminnich@gmail.com>
---
M src/device/oprom/x86emu/x86emui.h
M src/device/oprom/yabel/device.h
M src/device/oprom/yabel/interrupt.c
M src/device/oprom/yabel/pmm.h
M util/vgabios/device.c
M util/vgabios/testbios.c
6 files changed, 16 insertions(+), 7 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/42235/1
diff --git a/src/device/oprom/x86emu/x86emui.h b/src/device/oprom/x86emu/x86emui.h
index b1647c5..a49a00f 100644
--- a/src/device/oprom/x86emu/x86emui.h
+++ b/src/device/oprom/x86emu/x86emui.h
@@ -41,6 +41,7 @@
#ifndef __X86EMU_X86EMUI_H
#define __X86EMU_X86EMUI_H

+#include <string.h>
/* If we are compiling in C++ mode, we can compile some functions as
* inline to increase performance (however the code size increases quite
* dramatically in this case).
diff --git a/src/device/oprom/yabel/device.h b/src/device/oprom/yabel/device.h
index 4f28a59..57b0533 100644
--- a/src/device/oprom/yabel/device.h
+++ b/src/device/oprom/yabel/device.h
@@ -62,7 +62,7 @@
u16 bev; // Bootstrap Entry Vector
u16 reserved_2;
u16 sriv; // Static Resource Information Vector
-} __packed exp_header_struct_t;
+} __attribute__((packed)) exp_header_struct_t;

// a PCI Data Struct as defined in PCI 2.3 Spec Chapter 6.3.1.2
typedef struct {
@@ -78,7 +78,7 @@
u8 code_type;
u8 indicator;
u16 reserved_2;
-} __packed pci_data_struct_t;
+} __attribute__((packed)) pci_data_struct_t;

typedef struct {
u8 bus;
@@ -118,7 +118,7 @@
u64 address;
u64 address_offset;
u64 size;
-} __packed translate_address_t;
+} __attribute((packed)) translate_address_t;

// array to store address translations for this
// device. Needed for faster address translation, so
@@ -205,4 +205,7 @@
printf("HID4: %016llx\n", (unsigned long long)hid);
}

+// prototypes from coreboot that we can not easily include.
+const char *dev_path(const struct device *dev);
+struct device *dev_find_device(u16 vendor, u16 device, struct device *from);
#endif
diff --git a/src/device/oprom/yabel/interrupt.c b/src/device/oprom/yabel/interrupt.c
index 338156f..ddc9080 100644
--- a/src/device/oprom/yabel/interrupt.c
+++ b/src/device/oprom/yabel/interrupt.c
@@ -373,7 +373,8 @@
dev = bios_device.dev;
M.x86.R_BH = bios_device.bus;
M.x86.R_BL = bios_device.devfn;
- } else if (CONFIG(YABEL_PCI_ACCESS_OTHER_DEVICES)) {
+ } else {
+#if CONFIG(YABEL_PCI_ACCESS_OTHER_DEVICES)
dev = dev_find_device(M.x86.R_DX, M.x86.R_CX, 0);
if (dev != NULL) {
M.x86.R_BH = dev->bus->secondary;
@@ -382,6 +383,7 @@
("%s(): function %x: PCI Find Device --> 0x%04x\n",
__func__, M.x86.R_AX, M.x86.R_BX);
}
+#endif
}
if (dev == NULL) {
DEBUG_PRINTF_INTR
@@ -408,10 +410,12 @@

if ((bus == bios_device.bus) && (devfn == bios_device.devfn)) {
dev = bios_device.dev;
- } else if (CONFIG(YABEL_PCI_ACCESS_OTHER_DEVICES)) {
+ } else {
+#if (CONFIG(YABEL_PCI_ACCESS_OTHER_DEVICES))
dev = pcidev_path_on_bus(bus, devfn);
DEBUG_PRINTF_INTR("%s(): function: %x: pcidev_path_on_bus() returned: %s\n",
__func__, M.x86.R_AX, dev_path(dev));
+#endif
}

if (dev == NULL) {
diff --git a/src/device/oprom/yabel/pmm.h b/src/device/oprom/yabel/pmm.h
index 2ecc36e..ea728f5 100644
--- a/src/device/oprom/yabel/pmm.h
+++ b/src/device/oprom/yabel/pmm.h
@@ -54,7 +54,7 @@
* see interrupt.c) and the INT Handler will do the actual PMM work.
*/
u8 code[3];
-} __packed pmm_information_t;
+} __attribute__((packed)) pmm_information_t;

/* This function is used to setup the PMM struct in virtual memory
* at a certain offset */
diff --git a/util/vgabios/device.c b/util/vgabios/device.c
index d130314..def8c44 100644
--- a/util/vgabios/device.c
+++ b/util/vgabios/device.c
@@ -308,6 +308,7 @@
u8
biosemu_dev_check_exprom(unsigned long rom_base_addr)
{
+ DEBUG_PRINTF("Not checking for exprom at %#lx\n", rom_base_addr);
#if 0
int i = 0;
translate_address_t ta;
diff --git a/util/vgabios/testbios.c b/util/vgabios/testbios.c
index d66c857..7612276 100644
--- a/util/vgabios/testbios.c
+++ b/util/vgabios/testbios.c
@@ -137,7 +137,7 @@
unsigned short initialip = 0, initialcs = 0, devfn = 0;
//X86EMU_intrFuncs intFuncs[256];
int debugflag = 0;
- struct device *dev;
+ struct device *dev = NULL;

//const char *optstring = "vh?b:i:c:s:tpd:";
const char *optstring = "vh?b:i:c:s:tpd:";

To view, visit change 42235. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I48e13e31deee0100a616a2f1d08ca84b9c470219
Gerrit-Change-Number: 42235
Gerrit-PatchSet: 1
Gerrit-Owner: ron minnich <rminnich@gmail.com>
Gerrit-MessageType: newchange