From patchwork Tue Jul 20 07:37:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 59284 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 C3B08B70A6 for ; Tue, 20 Jul 2010 17:42:42 +1000 (EST) Received: from localhost ([127.0.0.1]:35670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ob7TK-00048m-7e for incoming@patchwork.ozlabs.org; Tue, 20 Jul 2010 03:42:38 -0400 Received: from [140.186.70.92] (port=59491 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ob7MY-0000eX-IS for qemu-devel@nongnu.org; Tue, 20 Jul 2010 03:35:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ob7MN-0002lG-VI for qemu-devel@nongnu.org; Tue, 20 Jul 2010 03:35:38 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:58570) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ob7MN-0002kz-Ni for qemu-devel@nongnu.org; Tue, 20 Jul 2010 03:35:27 -0400 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id B9AD510784F; Tue, 20 Jul 2010 16:35:22 +0900 (JST) Received: (nullmailer pid 26778 invoked by uid 1000); Tue, 20 Jul 2010 07:37:19 -0000 From: Isaku Yamahata To: seabios@seabios.org Date: Tue, 20 Jul 2010 16:37:19 +0900 Message-Id: X-Mailer: git-send-email 1.7.1.1 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: yamahata@valinux.co.jp, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 5/5] seabios: acpi: clean up of finding pm device. 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 Make it table driven to other chip set. Signed-off-by: Isaku Yamahata --- src/acpi.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/acpi.c b/src/acpi.c index 5818d4c..e91f8e0 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -522,6 +522,13 @@ build_srat(void) return srat; } +static const struct pci_device_id acpi_find_tbl[] = { + /* PIIX4 Power Management device. */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, NULL), + + PCI_DEVICE_END, +}; + struct rsdp_descriptor *RsdpAddr; #define MAX_ACPI_TABLES 20 @@ -534,8 +541,7 @@ acpi_bios_init(void) dprintf(3, "init ACPI tables\n"); // This code is hardcoded for PIIX4 Power Management device. - int bdf = pci_find_device(PCI_VENDOR_ID_INTEL - , PCI_DEVICE_ID_INTEL_82371AB_3); + int bdf = pci_find_init_device(acpi_find_tbl, NULL); if (bdf < 0) // Device not found return;