From patchwork Fri May 7 10:09:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 51909 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AA345B7D81 for ; Fri, 7 May 2010 23:27:00 +1000 (EST) Received: from localhost ([127.0.0.1]:34184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OANZx-0001IB-Ct for incoming@patchwork.ozlabs.org; Fri, 07 May 2010 09:26:57 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OANXZ-0001EL-PJ for qemu-devel@nongnu.org; Fri, 07 May 2010 09:24:30 -0400 Received: from [140.186.70.92] (port=47582 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OANXS-0006Kb-RU for qemu-devel@nongnu.org; Fri, 07 May 2010 09:24:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OAKVG-0003qH-RP for qemu-devel@nongnu.org; Fri, 07 May 2010 06:10:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22307) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAKVG-0003pc-HN; Fri, 07 May 2010 06:09:54 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o47A9rCq001879 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 7 May 2010 06:09:53 -0400 Received: from zweiblum.home.kraxel.org (vpn1-6-164.ams2.redhat.com [10.36.6.164]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o47A9oSH020555; Fri, 7 May 2010 06:09:50 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id CA32D12003; Fri, 7 May 2010 12:09:47 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org, vgabios-developers@nongnu.org Date: Fri, 7 May 2010 12:09:44 +0200 Message-Id: <1273226987-10066-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1273226987-10066-1-git-send-email-kraxel@redhat.com> References: <1273226987-10066-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 2/5] Add defines for PCI IDs. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 f925c35..f9a77f0 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 3b09c92..a575b7b 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