[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Remove drivers/acpi/motherboard.c from sparse tree to match



# HG changeset patch
# User djm@xxxxxxxxxxxxxxx
# Node ID 450b1224a6acdf35cb29c74a9c3682740b967b44
# Parent  60928c906666d4a0f158bc701aeac2871c0b1761
Remove drivers/acpi/motherboard.c from sparse tree to match
xen-unstable.  For now, copy it from elsewhere (see note
in xen-mkbuildtree-pre)

diff -r 60928c906666 -r 450b1224a6ac 
linux-2.6-xen-sparse/arch/ia64/xen-mkbuildtree-pre
--- a/linux-2.6-xen-sparse/arch/ia64/xen-mkbuildtree-pre        Fri Sep 23 
17:15:48 2005
+++ b/linux-2.6-xen-sparse/arch/ia64/xen-mkbuildtree-pre        Fri Sep 23 
19:49:44 2005
@@ -40,6 +40,13 @@
 cp arch/ia64/xen/drivers/xenia64_init.c drivers/xen/core
 cp arch/ia64/xen/drivers/evtchn_ia64.c drivers/xen/core
 
+#this is a one-line change to avoid a nasty kernel crash resulting
+#from a use of the FADT entry in the ACPI tree.  The fake ACPI
+#tree that Xen sets up for guests has a NULL FADT.  This is a bug
+#that needs to be fixed, at which point this can go away.  In the
+#meantime, this file needs to be updated if the real motherboard.c is
+cp arch/ia64/xen/drivers/evtchn_ia64.c drivers/acpi/motherboard.c
+
 #still a few x86-ism's in various drivers/xen files, patch them
 cd drivers/xen
 if [ ! -e ia64.patch.semaphore ]
diff -r 60928c906666 -r 450b1224a6ac 
linux-2.6-xen-sparse/arch/ia64/xen/drivers/motherboard.c
--- /dev/null   Fri Sep 23 17:15:48 2005
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/motherboard.c  Fri Sep 23 
19:49:44 2005
@@ -0,0 +1,178 @@
+/* 
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+/* Purpose: Prevent PCMCIA cards from using motherboard resources. */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/ioport.h>
+#include <asm/io.h>
+
+#include <acpi/acpi_bus.h>
+#include <acpi/acpi_drivers.h>
+
+#define _COMPONENT             ACPI_SYSTEM_COMPONENT
+ACPI_MODULE_NAME               ("acpi_motherboard")
+
+/* Dell use PNP0C01 instead of PNP0C02 */
+#define ACPI_MB_HID1                   "PNP0C01"
+#define ACPI_MB_HID2                   "PNP0C02"
+
+/**
+ * Doesn't care about legacy IO ports, only IO ports beyond 0x1000 are reserved
+ * Doesn't care about the failure of 'request_region', since other may reserve 
+ * the io ports as well
+ */
+#define IS_RESERVED_ADDR(base, len) \
+       (((len) > 0) && ((base) > 0) && ((base) + (len) < IO_SPACE_LIMIT) \
+       && ((base) + (len) > PCIBIOS_MIN_IO))
+
+/*
+ * Clearing the flag (IORESOURCE_BUSY) allows drivers to use
+ * the io ports if they really know they can use it, while
+ * still preventing hotplug PCI devices from using it. 
+ */
+
+static acpi_status
+acpi_reserve_io_ranges (struct acpi_resource *res, void *data)
+{
+       struct resource *requested_res = NULL;
+
+       ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges");
+
+       if (res->id == ACPI_RSTYPE_IO) {
+               struct acpi_resource_io *io_res = &res->data.io;
+
+               if (io_res->min_base_address != io_res->max_base_address)
+                       return_VALUE(AE_OK);
+               if (IS_RESERVED_ADDR(io_res->min_base_address, 
io_res->range_length)) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Motherboard resources 
0x%08x - 0x%08x\n",
+                               io_res->min_base_address, 
+                               io_res->min_base_address + 
io_res->range_length));
+                       requested_res = 
request_region(io_res->min_base_address, 
+                               io_res->range_length, "motherboard");
+               }
+       } else if (res->id == ACPI_RSTYPE_FIXED_IO) {
+               struct acpi_resource_fixed_io *fixed_io_res = 
&res->data.fixed_io;
+
+               if (IS_RESERVED_ADDR(fixed_io_res->base_address, 
fixed_io_res->range_length)) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Motherboard resources 
0x%08x - 0x%08x\n",
+                               fixed_io_res->base_address, 
+                               fixed_io_res->base_address + 
fixed_io_res->range_length));
+                       requested_res = 
request_region(fixed_io_res->base_address, 
+                               fixed_io_res->range_length, "motherboard");
+               }
+       } else {
+               /* Memory mapped IO? */
+       }
+
+       if (requested_res)
+               requested_res->flags &= ~IORESOURCE_BUSY;
+       return_VALUE(AE_OK);
+}
+
+static int acpi_motherboard_add (struct acpi_device *device)
+{
+       if (!device)
+               return -EINVAL;
+       acpi_walk_resources(device->handle, METHOD_NAME__CRS, 
+               acpi_reserve_io_ranges, NULL);
+
+       return 0;
+}
+
+static struct acpi_driver acpi_motherboard_driver1 = {
+       .name =         "motherboard",
+       .class =        "",
+       .ids =          ACPI_MB_HID1,
+       .ops =  {
+               .add =          acpi_motherboard_add,
+       },
+};
+
+static struct acpi_driver acpi_motherboard_driver2 = {
+       .name =         "motherboard",
+       .class =        "",
+       .ids =          ACPI_MB_HID2,
+       .ops =  {
+               .add =          acpi_motherboard_add,
+       },
+};
+
+static void __init
+acpi_reserve_resources (void)
+{
+       if (!acpi_gbl_FADT) return;
+       if (acpi_gbl_FADT->xpm1a_evt_blk.address && acpi_gbl_FADT->pm1_evt_len)
+               request_region(acpi_gbl_FADT->xpm1a_evt_blk.address, 
+                       acpi_gbl_FADT->pm1_evt_len, "PM1a_EVT_BLK");
+
+       if (acpi_gbl_FADT->xpm1b_evt_blk.address && acpi_gbl_FADT->pm1_evt_len)
+               request_region(acpi_gbl_FADT->xpm1b_evt_blk.address,
+                       acpi_gbl_FADT->pm1_evt_len, "PM1b_EVT_BLK");
+
+       if (acpi_gbl_FADT->xpm1a_cnt_blk.address && acpi_gbl_FADT->pm1_cnt_len)
+               request_region(acpi_gbl_FADT->xpm1a_cnt_blk.address, 
+                       acpi_gbl_FADT->pm1_cnt_len, "PM1a_CNT_BLK");
+
+       if (acpi_gbl_FADT->xpm1b_cnt_blk.address && acpi_gbl_FADT->pm1_cnt_len)
+               request_region(acpi_gbl_FADT->xpm1b_cnt_blk.address, 
+                       acpi_gbl_FADT->pm1_cnt_len, "PM1b_CNT_BLK");
+
+       if (acpi_gbl_FADT->xpm_tmr_blk.address && acpi_gbl_FADT->pm_tm_len == 4)
+               request_region(acpi_gbl_FADT->xpm_tmr_blk.address,
+                       4, "PM_TMR");
+
+       if (acpi_gbl_FADT->xpm2_cnt_blk.address && acpi_gbl_FADT->pm2_cnt_len)
+               request_region(acpi_gbl_FADT->xpm2_cnt_blk.address,
+                       acpi_gbl_FADT->pm2_cnt_len, "PM2_CNT_BLK");
+
+       /* Length of GPE blocks must be a non-negative multiple of 2 */
+
+       if (acpi_gbl_FADT->xgpe0_blk.address && acpi_gbl_FADT->gpe0_blk_len &&
+                       !(acpi_gbl_FADT->gpe0_blk_len & 0x1))
+               request_region(acpi_gbl_FADT->xgpe0_blk.address,
+                       acpi_gbl_FADT->gpe0_blk_len, "GPE0_BLK");
+
+       if (acpi_gbl_FADT->xgpe1_blk.address && acpi_gbl_FADT->gpe1_blk_len &&
+                       !(acpi_gbl_FADT->gpe1_blk_len & 0x1))
+               request_region(acpi_gbl_FADT->xgpe1_blk.address,
+                       acpi_gbl_FADT->gpe1_blk_len, "GPE1_BLK");
+}
+
+static int __init acpi_motherboard_init(void)
+{
+       acpi_bus_register_driver(&acpi_motherboard_driver1);
+       acpi_bus_register_driver(&acpi_motherboard_driver2);
+       /* 
+        * Guarantee motherboard IO reservation first
+        * This module must run after scan.c
+        */
+       if (!acpi_disabled)
+               acpi_reserve_resources ();
+       return 0;
+}
+
+/**
+ * Reserve motherboard resources after PCI claim BARs,
+ * but before PCI assign resources for uninitialized PCI devices
+ */
+fs_initcall(acpi_motherboard_init);
diff -r 60928c906666 -r 450b1224a6ac 
linux-2.6-xen-sparse/drivers/acpi/motherboard.c
--- a/linux-2.6-xen-sparse/drivers/acpi/motherboard.c   Fri Sep 23 17:15:48 2005
+++ /dev/null   Fri Sep 23 19:49:44 2005
@@ -1,178 +0,0 @@
-/* 
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or (at
- *  your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-/* Purpose: Prevent PCMCIA cards from using motherboard resources. */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <linux/ioport.h>
-#include <asm/io.h>
-
-#include <acpi/acpi_bus.h>
-#include <acpi/acpi_drivers.h>
-
-#define _COMPONENT             ACPI_SYSTEM_COMPONENT
-ACPI_MODULE_NAME               ("acpi_motherboard")
-
-/* Dell use PNP0C01 instead of PNP0C02 */
-#define ACPI_MB_HID1                   "PNP0C01"
-#define ACPI_MB_HID2                   "PNP0C02"
-
-/**
- * Doesn't care about legacy IO ports, only IO ports beyond 0x1000 are reserved
- * Doesn't care about the failure of 'request_region', since other may reserve 
- * the io ports as well
- */
-#define IS_RESERVED_ADDR(base, len) \
-       (((len) > 0) && ((base) > 0) && ((base) + (len) < IO_SPACE_LIMIT) \
-       && ((base) + (len) > PCIBIOS_MIN_IO))
-
-/*
- * Clearing the flag (IORESOURCE_BUSY) allows drivers to use
- * the io ports if they really know they can use it, while
- * still preventing hotplug PCI devices from using it. 
- */
-
-static acpi_status
-acpi_reserve_io_ranges (struct acpi_resource *res, void *data)
-{
-       struct resource *requested_res = NULL;
-
-       ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges");
-
-       if (res->id == ACPI_RSTYPE_IO) {
-               struct acpi_resource_io *io_res = &res->data.io;
-
-               if (io_res->min_base_address != io_res->max_base_address)
-                       return_VALUE(AE_OK);
-               if (IS_RESERVED_ADDR(io_res->min_base_address, 
io_res->range_length)) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Motherboard resources 
0x%08x - 0x%08x\n",
-                               io_res->min_base_address, 
-                               io_res->min_base_address + 
io_res->range_length));
-                       requested_res = 
request_region(io_res->min_base_address, 
-                               io_res->range_length, "motherboard");
-               }
-       } else if (res->id == ACPI_RSTYPE_FIXED_IO) {
-               struct acpi_resource_fixed_io *fixed_io_res = 
&res->data.fixed_io;
-
-               if (IS_RESERVED_ADDR(fixed_io_res->base_address, 
fixed_io_res->range_length)) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Motherboard resources 
0x%08x - 0x%08x\n",
-                               fixed_io_res->base_address, 
-                               fixed_io_res->base_address + 
fixed_io_res->range_length));
-                       requested_res = 
request_region(fixed_io_res->base_address, 
-                               fixed_io_res->range_length, "motherboard");
-               }
-       } else {
-               /* Memory mapped IO? */
-       }
-
-       if (requested_res)
-               requested_res->flags &= ~IORESOURCE_BUSY;
-       return_VALUE(AE_OK);
-}
-
-static int acpi_motherboard_add (struct acpi_device *device)
-{
-       if (!device)
-               return -EINVAL;
-       acpi_walk_resources(device->handle, METHOD_NAME__CRS, 
-               acpi_reserve_io_ranges, NULL);
-
-       return 0;
-}
-
-static struct acpi_driver acpi_motherboard_driver1 = {
-       .name =         "motherboard",
-       .class =        "",
-       .ids =          ACPI_MB_HID1,
-       .ops =  {
-               .add =          acpi_motherboard_add,
-       },
-};
-
-static struct acpi_driver acpi_motherboard_driver2 = {
-       .name =         "motherboard",
-       .class =        "",
-       .ids =          ACPI_MB_HID2,
-       .ops =  {
-               .add =          acpi_motherboard_add,
-       },
-};
-
-static void __init
-acpi_reserve_resources (void)
-{
-       if (!acpi_gbl_FADT) return;
-       if (acpi_gbl_FADT->xpm1a_evt_blk.address && acpi_gbl_FADT->pm1_evt_len)
-               request_region(acpi_gbl_FADT->xpm1a_evt_blk.address, 
-                       acpi_gbl_FADT->pm1_evt_len, "PM1a_EVT_BLK");
-
-       if (acpi_gbl_FADT->xpm1b_evt_blk.address && acpi_gbl_FADT->pm1_evt_len)
-               request_region(acpi_gbl_FADT->xpm1b_evt_blk.address,
-                       acpi_gbl_FADT->pm1_evt_len, "PM1b_EVT_BLK");
-
-       if (acpi_gbl_FADT->xpm1a_cnt_blk.address && acpi_gbl_FADT->pm1_cnt_len)
-               request_region(acpi_gbl_FADT->xpm1a_cnt_blk.address, 
-                       acpi_gbl_FADT->pm1_cnt_len, "PM1a_CNT_BLK");
-
-       if (acpi_gbl_FADT->xpm1b_cnt_blk.address && acpi_gbl_FADT->pm1_cnt_len)
-               request_region(acpi_gbl_FADT->xpm1b_cnt_blk.address, 
-                       acpi_gbl_FADT->pm1_cnt_len, "PM1b_CNT_BLK");
-
-       if (acpi_gbl_FADT->xpm_tmr_blk.address && acpi_gbl_FADT->pm_tm_len == 4)
-               request_region(acpi_gbl_FADT->xpm_tmr_blk.address,
-                       4, "PM_TMR");
-
-       if (acpi_gbl_FADT->xpm2_cnt_blk.address && acpi_gbl_FADT->pm2_cnt_len)
-               request_region(acpi_gbl_FADT->xpm2_cnt_blk.address,
-                       acpi_gbl_FADT->pm2_cnt_len, "PM2_CNT_BLK");
-
-       /* Length of GPE blocks must be a non-negative multiple of 2 */
-
-       if (acpi_gbl_FADT->xgpe0_blk.address && acpi_gbl_FADT->gpe0_blk_len &&
-                       !(acpi_gbl_FADT->gpe0_blk_len & 0x1))
-               request_region(acpi_gbl_FADT->xgpe0_blk.address,
-                       acpi_gbl_FADT->gpe0_blk_len, "GPE0_BLK");
-
-       if (acpi_gbl_FADT->xgpe1_blk.address && acpi_gbl_FADT->gpe1_blk_len &&
-                       !(acpi_gbl_FADT->gpe1_blk_len & 0x1))
-               request_region(acpi_gbl_FADT->xgpe1_blk.address,
-                       acpi_gbl_FADT->gpe1_blk_len, "GPE1_BLK");
-}
-
-static int __init acpi_motherboard_init(void)
-{
-       acpi_bus_register_driver(&acpi_motherboard_driver1);
-       acpi_bus_register_driver(&acpi_motherboard_driver2);
-       /* 
-        * Guarantee motherboard IO reservation first
-        * This module must run after scan.c
-        */
-       if (!acpi_disabled)
-               acpi_reserve_resources ();
-       return 0;
-}
-
-/**
- * Reserve motherboard resources after PCI claim BARs,
- * but before PCI assign resources for uninitialized PCI devices
- */
-fs_initcall(acpi_motherboard_init);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.