Source
/*
* IOAPIC/IOxAPIC/IOSAPIC driver
*
* Copyright (C) 2009 Fujitsu Limited.
* (c) Copyright 2009 Hewlett-Packard Development Company, L.P.
*
* Copyright (C) 2014 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Based on original drivers/pci/ioapic.c
* Yinghai Lu <yinghai@kernel.org>
* Jiang Liu <jiang.liu@intel.com>
*/
/*
* This driver manages I/O APICs added by hotplug after boot.
* We try to claim all I/O APIC devices, but those present at boot were
* registered when we parsed the ACPI MADT.
*/
struct acpi_pci_ioapic {
acpi_handle root_handle;
acpi_handle handle;
u32 gsi_base;
struct resource res;
struct pci_dev *pdev;
struct list_head list;
};
static LIST_HEAD(ioapic_list);
static DEFINE_MUTEX(ioapic_list_lock);
static acpi_status setup_res(struct acpi_resource *acpi_res, void *data)
{
struct resource *res = data;
struct resource_win win;
/*
* We might assign this to 'res' later, make sure all pointers are
* cleared before the resource is added to the global list
*/
memset(&win, 0, sizeof(win));
res->flags = 0;
if (acpi_dev_filter_resource_type(acpi_res, IORESOURCE_MEM))
return AE_OK;
if (!acpi_dev_resource_memory(acpi_res, res)) {
if (acpi_dev_resource_address_space(acpi_res, &win) ||
acpi_dev_resource_ext_address_space(acpi_res, &win))
*res = win.res;
}
if ((res->flags & IORESOURCE_PREFETCH) ||