From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [VGABIOS PATCH 2/6] Add defines for PCI IDs.
Date: Thu, 19 Aug 2010 12:45:43 +0200 [thread overview]
Message-ID: <1282214747-9190-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1282214747-9190-1-git-send-email-kraxel@redhat.com>
This patch allows to set PCI vendor and device IDs using defines
(PCI_VID and PCI_DID). Use it for vgabios.bin.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
Makefile | 4 ++--
vbe.c | 6 +++++-
vgabios.c | 5 +++++
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index c3c744c..d440b93 100644
--- a/Makefile
+++ b/Makefile
@@ -31,8 +31,8 @@ VGA_FILES := vgabios.c vgabios.h vgafonts.h vgatables.h
VBE_FILES := vbe.h vbe.c vbetables.h
# build flags
-vgabios.bin : VGAFLAGS := -DVBE
-vgabios.debug.bin : VGAFLAGS := -DVBE -DDEBUG
+vgabios.bin : VGAFLAGS := -DVBE -DPCI_VID=0x1234
+vgabios.debug.bin : VGAFLAGS := -DVBE -DPCI_VID=0x1234 -DDEBUG
vgabios-cirrus.bin : VGAFLAGS := -DCIRRUS -DPCIBIOS
vgabios-cirrus.debug.bin : VGAFLAGS := -DCIRRUS -DPCIBIOS -DCIRRUS_DEBUG
diff --git a/vbe.c b/vbe.c
index ecff90d..1fab2f9 100644
--- a/vbe.c
+++ b/vbe.c
@@ -925,7 +925,11 @@ Bit16u *AX;Bit16u CX; Bit16u ES;Bit16u DI;
if (using_lfb) {
info.NumberOfBanks = 1;
}
- lfb_addr = pci_get_lfb_addr(0x1234); // experimental vendor
+#ifdef PCI_VID
+ lfb_addr = pci_get_lfb_addr(PCI_VID);
+#else
+ lfb_addr = 0;
+#endif
if (lfb_addr > 0) {
info.PhysBasePtr = ((Bit32u)lfb_addr << 16);
}
diff --git a/vgabios.c b/vgabios.c
index ea3aae8..2e8b5d7 100644
--- a/vgabios.c
+++ b/vgabios.c
@@ -210,8 +210,13 @@ vgabios_pci_data:
.word 0x1013
.word 0x00b8 // CLGD5446
#else
+#ifdef PCI_VID
+.word PCI_VID
+.word PCI_DID
+#else
#error "Unknown PCI vendor and device id"
#endif
+#endif
.word 0 // reserved
.word 0x18 // dlen
.byte 0 // revision
--
1.7.1
next prev parent reply other threads:[~2010-08-19 10:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-19 10:45 [Qemu-devel] [VGABIOS PATCH 0/6] make vgabios usable as pcibios Gerd Hoffmann
2010-08-19 10:45 ` [Qemu-devel] [VGABIOS PATCH 1/6] Makefile cleanup Gerd Hoffmann
2010-08-19 10:45 ` Gerd Hoffmann [this message]
2010-08-19 10:45 ` [Qemu-devel] [VGABIOS PATCH 3/6] Add qemu stdvga pci bios Gerd Hoffmann
2010-08-19 10:45 ` [Qemu-devel] [VGABIOS PATCH 4/6] update pci_get_lfb_addr for vmware vga Gerd Hoffmann
2010-08-19 10:45 ` [Qemu-devel] [VGABIOS PATCH 5/6] Add qemu vmware vga pci bios Gerd Hoffmann
2010-08-19 10:45 ` [Qemu-devel] [VGABIOS PATCH 6/6] Add qemu qxl " Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1282214747-9190-3-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).