]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branches 'release', 'bugzilla-11880', 'bugzilla-12037' and 'bugzilla-12257...
authorLen Brown <len.brown@intel.com>
Fri, 9 Jan 2009 08:37:11 +0000 (03:37 -0500)
committerLen Brown <len.brown@intel.com>
Fri, 9 Jan 2009 08:37:11 +0000 (03:37 -0500)
222 files changed:
Documentation/kernel-parameters.txt
MAINTAINERS
Makefile
arch/ia64/include/asm/acpi-ext.h
arch/ia64/include/asm/sn/acpi.h
arch/ia64/sn/kernel/io_acpi_init.c
arch/ia64/sn/kernel/io_common.c
arch/mips/include/asm/byteorder.h
arch/mips/include/asm/elf.h
arch/parisc/include/asm/tlbflush.h
arch/x86/Kconfig.cpu
drivers/acpi/Makefile
drivers/acpi/acpica/Makefile [new file with mode: 0644]
drivers/acpi/acpica/accommon.h [new file with mode: 0644]
drivers/acpi/acpica/acconfig.h [moved from include/acpi/acconfig.h with 98% similarity]
drivers/acpi/acpica/acdebug.h [moved from include/acpi/acdebug.h with 100% similarity]
drivers/acpi/acpica/acdispat.h [moved from include/acpi/acdispat.h with 100% similarity]
drivers/acpi/acpica/acevents.h [moved from include/acpi/acevents.h with 97% similarity]
drivers/acpi/acpica/acglobal.h [moved from include/acpi/acglobal.h with 97% similarity]
drivers/acpi/acpica/achware.h [moved from include/acpi/achware.h with 89% similarity]
drivers/acpi/acpica/acinterp.h [moved from include/acpi/acinterp.h with 100% similarity]
drivers/acpi/acpica/aclocal.h [moved from include/acpi/aclocal.h with 95% similarity]
drivers/acpi/acpica/acmacros.h [moved from include/acpi/acmacros.h with 83% similarity]
drivers/acpi/acpica/acnamesp.h [moved from include/acpi/acnamesp.h with 98% similarity]
drivers/acpi/acpica/acobject.h [moved from include/acpi/acobject.h with 100% similarity]
drivers/acpi/acpica/acopcode.h [moved from include/acpi/acopcode.h with 100% similarity]
drivers/acpi/acpica/acparser.h [moved from include/acpi/acparser.h with 100% similarity]
drivers/acpi/acpica/acpredef.h [moved from include/acpi/acpredef.h with 100% similarity]
drivers/acpi/acpica/acresrc.h [moved from include/acpi/acresrc.h with 100% similarity]
drivers/acpi/acpica/acstruct.h [moved from include/acpi/acstruct.h with 100% similarity]
drivers/acpi/acpica/actables.h [moved from include/acpi/actables.h with 98% similarity]
drivers/acpi/acpica/acutils.h [moved from include/acpi/acutils.h with 93% similarity]
drivers/acpi/acpica/amlcode.h [moved from include/acpi/amlcode.h with 100% similarity]
drivers/acpi/acpica/amlresrc.h [moved from include/acpi/amlresrc.h with 100% similarity]
drivers/acpi/acpica/dsfield.c [moved from drivers/acpi/dispatcher/dsfield.c with 99% similarity]
drivers/acpi/acpica/dsinit.c [moved from drivers/acpi/dispatcher/dsinit.c with 98% similarity]
drivers/acpi/acpica/dsmethod.c [moved from drivers/acpi/dispatcher/dsmethod.c with 98% similarity]
drivers/acpi/acpica/dsmthdat.c [moved from drivers/acpi/dispatcher/dsmthdat.c with 99% similarity]
drivers/acpi/acpica/dsobject.c [moved from drivers/acpi/dispatcher/dsobject.c with 99% similarity]
drivers/acpi/acpica/dsopcode.c [moved from drivers/acpi/dispatcher/dsopcode.c with 96% similarity]
drivers/acpi/acpica/dsutils.c [moved from drivers/acpi/dispatcher/dsutils.c with 99% similarity]
drivers/acpi/acpica/dswexec.c [moved from drivers/acpi/dispatcher/dswexec.c with 99% similarity]
drivers/acpi/acpica/dswload.c [moved from drivers/acpi/dispatcher/dswload.c with 99% similarity]
drivers/acpi/acpica/dswscope.c [moved from drivers/acpi/dispatcher/dswscope.c with 99% similarity]
drivers/acpi/acpica/dswstate.c [moved from drivers/acpi/dispatcher/dswstate.c with 99% similarity]
drivers/acpi/acpica/evevent.c [moved from drivers/acpi/events/evevent.c with 96% similarity]
drivers/acpi/acpica/evgpe.c [moved from drivers/acpi/events/evgpe.c with 94% similarity]
drivers/acpi/acpica/evgpeblk.c [moved from drivers/acpi/events/evgpeblk.c with 94% similarity]
drivers/acpi/acpica/evmisc.c [moved from drivers/acpi/events/evmisc.c with 93% similarity]
drivers/acpi/acpica/evregion.c [moved from drivers/acpi/events/evregion.c with 91% similarity]
drivers/acpi/acpica/evrgnini.c [moved from drivers/acpi/events/evrgnini.c with 95% similarity]
drivers/acpi/acpica/evsci.c [moved from drivers/acpi/events/evsci.c with 95% similarity]
drivers/acpi/acpica/evxface.c [moved from drivers/acpi/events/evxface.c with 99% similarity]
drivers/acpi/acpica/evxfevnt.c [moved from drivers/acpi/events/evxfevnt.c with 81% similarity]
drivers/acpi/acpica/evxfregn.c [moved from drivers/acpi/events/evxfregn.c with 99% similarity]
drivers/acpi/acpica/exconfig.c [moved from drivers/acpi/executer/exconfig.c with 99% similarity]
drivers/acpi/acpica/exconvrt.c [moved from drivers/acpi/executer/exconvrt.c with 99% similarity]
drivers/acpi/acpica/excreate.c [moved from drivers/acpi/executer/excreate.c with 99% similarity]
drivers/acpi/acpica/exdump.c [moved from drivers/acpi/executer/exdump.c with 99% similarity]
drivers/acpi/acpica/exfield.c [moved from drivers/acpi/executer/exfield.c with 99% similarity]
drivers/acpi/acpica/exfldio.c [moved from drivers/acpi/executer/exfldio.c with 98% similarity]
drivers/acpi/acpica/exmisc.c [moved from drivers/acpi/executer/exmisc.c with 99% similarity]
drivers/acpi/acpica/exmutex.c [moved from drivers/acpi/executer/exmutex.c with 99% similarity]
drivers/acpi/acpica/exnames.c [moved from drivers/acpi/executer/exnames.c with 99% similarity]
drivers/acpi/acpica/exoparg1.c [moved from drivers/acpi/executer/exoparg1.c with 99% similarity]
drivers/acpi/acpica/exoparg2.c [moved from drivers/acpi/executer/exoparg2.c with 99% similarity]
drivers/acpi/acpica/exoparg3.c [moved from drivers/acpi/executer/exoparg3.c with 98% similarity]
drivers/acpi/acpica/exoparg6.c [moved from drivers/acpi/executer/exoparg6.c with 99% similarity]
drivers/acpi/acpica/exprep.c [moved from drivers/acpi/executer/exprep.c with 99% similarity]
drivers/acpi/acpica/exregion.c [moved from drivers/acpi/executer/exregion.c with 99% similarity]
drivers/acpi/acpica/exresnte.c [moved from drivers/acpi/executer/exresnte.c with 98% similarity]
drivers/acpi/acpica/exresolv.c [moved from drivers/acpi/executer/exresolv.c with 99% similarity]
drivers/acpi/acpica/exresop.c [moved from drivers/acpi/executer/exresop.c with 99% similarity]
drivers/acpi/acpica/exstore.c [moved from drivers/acpi/executer/exstore.c with 99% similarity]
drivers/acpi/acpica/exstoren.c [moved from drivers/acpi/executer/exstoren.c with 99% similarity]
drivers/acpi/acpica/exstorob.c [moved from drivers/acpi/executer/exstorob.c with 99% similarity]
drivers/acpi/acpica/exsystem.c [moved from drivers/acpi/executer/exsystem.c with 99% similarity]
drivers/acpi/acpica/exutils.c [moved from drivers/acpi/executer/exutils.c with 99% similarity]
drivers/acpi/acpica/hwacpi.c [moved from drivers/acpi/hardware/hwacpi.c with 99% similarity]
drivers/acpi/acpica/hwgpe.c [moved from drivers/acpi/hardware/hwgpe.c with 86% similarity]
drivers/acpi/acpica/hwregs.c [new file with mode: 0644]
drivers/acpi/acpica/hwsleep.c [moved from drivers/acpi/hardware/hwsleep.c with 91% similarity]
drivers/acpi/acpica/hwtimer.c [moved from drivers/acpi/hardware/hwtimer.c with 99% similarity]
drivers/acpi/acpica/hwxface.c [moved from drivers/acpi/hardware/hwregs.c with 62% similarity]
drivers/acpi/acpica/nsaccess.c [moved from drivers/acpi/namespace/nsaccess.c with 98% similarity]
drivers/acpi/acpica/nsalloc.c [moved from drivers/acpi/namespace/nsalloc.c with 99% similarity]
drivers/acpi/acpica/nsdump.c [moved from drivers/acpi/namespace/nsdump.c with 99% similarity]
drivers/acpi/acpica/nsdumpdv.c [moved from drivers/acpi/namespace/nsdumpdv.c with 99% similarity]
drivers/acpi/acpica/nseval.c [moved from drivers/acpi/namespace/nseval.c with 81% similarity]
drivers/acpi/acpica/nsinit.c [moved from drivers/acpi/namespace/nsinit.c with 99% similarity]
drivers/acpi/acpica/nsload.c [moved from drivers/acpi/namespace/nsload.c with 99% similarity]
drivers/acpi/acpica/nsnames.c [moved from drivers/acpi/namespace/nsnames.c with 99% similarity]
drivers/acpi/acpica/nsobject.c [moved from drivers/acpi/namespace/nsobject.c with 99% similarity]
drivers/acpi/acpica/nsparse.c [moved from drivers/acpi/namespace/nsparse.c with 98% similarity]
drivers/acpi/acpica/nspredef.c [moved from drivers/acpi/namespace/nspredef.c with 76% similarity]
drivers/acpi/acpica/nssearch.c [moved from drivers/acpi/namespace/nssearch.c with 99% similarity]
drivers/acpi/acpica/nsutils.c [moved from drivers/acpi/namespace/nsutils.c with 98% similarity]
drivers/acpi/acpica/nswalk.c [moved from drivers/acpi/namespace/nswalk.c with 99% similarity]
drivers/acpi/acpica/nsxfeval.c [moved from drivers/acpi/namespace/nsxfeval.c with 99% similarity]
drivers/acpi/acpica/nsxfname.c [moved from drivers/acpi/namespace/nsxfname.c with 99% similarity]
drivers/acpi/acpica/nsxfobj.c [moved from drivers/acpi/namespace/nsxfobj.c with 99% similarity]
drivers/acpi/acpica/psargs.c [moved from drivers/acpi/parser/psargs.c with 99% similarity]
drivers/acpi/acpica/psloop.c [moved from drivers/acpi/parser/psloop.c with 99% similarity]
drivers/acpi/acpica/psopcode.c [moved from drivers/acpi/parser/psopcode.c with 99% similarity]
drivers/acpi/acpica/psparse.c [moved from drivers/acpi/parser/psparse.c with 97% similarity]
drivers/acpi/acpica/psscope.c [moved from drivers/acpi/parser/psscope.c with 99% similarity]
drivers/acpi/acpica/pstree.c [moved from drivers/acpi/parser/pstree.c with 99% similarity]
drivers/acpi/acpica/psutils.c [moved from drivers/acpi/parser/psutils.c with 99% similarity]
drivers/acpi/acpica/pswalk.c [moved from drivers/acpi/parser/pswalk.c with 98% similarity]
drivers/acpi/acpica/psxface.c [moved from drivers/acpi/parser/psxface.c with 90% similarity]
drivers/acpi/acpica/rsaddr.c [moved from drivers/acpi/resources/rsaddr.c with 99% similarity]
drivers/acpi/acpica/rscalc.c [moved from drivers/acpi/resources/rscalc.c with 99% similarity]
drivers/acpi/acpica/rscreate.c [moved from drivers/acpi/resources/rscreate.c with 99% similarity]
drivers/acpi/acpica/rsdump.c [moved from drivers/acpi/resources/rsdump.c with 99% similarity]
drivers/acpi/acpica/rsinfo.c [moved from drivers/acpi/resources/rsinfo.c with 99% similarity]
drivers/acpi/acpica/rsio.c [moved from drivers/acpi/resources/rsio.c with 99% similarity]
drivers/acpi/acpica/rsirq.c [moved from drivers/acpi/resources/rsirq.c with 99% similarity]
drivers/acpi/acpica/rslist.c [moved from drivers/acpi/resources/rslist.c with 99% similarity]
drivers/acpi/acpica/rsmemory.c [moved from drivers/acpi/resources/rsmemory.c with 99% similarity]
drivers/acpi/acpica/rsmisc.c [moved from drivers/acpi/resources/rsmisc.c with 99% similarity]
drivers/acpi/acpica/rsutils.c [moved from drivers/acpi/resources/rsutils.c with 99% similarity]
drivers/acpi/acpica/rsxface.c [moved from drivers/acpi/resources/rsxface.c with 99% similarity]
drivers/acpi/acpica/tbfadt.c [moved from drivers/acpi/tables/tbfadt.c with 67% similarity]
drivers/acpi/acpica/tbfind.c [moved from drivers/acpi/tables/tbfind.c with 99% similarity]
drivers/acpi/acpica/tbinstal.c [moved from drivers/acpi/tables/tbinstal.c with 99% similarity]
drivers/acpi/acpica/tbutils.c [moved from drivers/acpi/tables/tbutils.c with 96% similarity]
drivers/acpi/acpica/tbxface.c [moved from drivers/acpi/tables/tbxface.c with 99% similarity]
drivers/acpi/acpica/tbxfroot.c [moved from drivers/acpi/tables/tbxfroot.c with 99% similarity]
drivers/acpi/acpica/utalloc.c [moved from drivers/acpi/utilities/utalloc.c with 99% similarity]
drivers/acpi/acpica/utcopy.c [moved from drivers/acpi/utilities/utcopy.c with 99% similarity]
drivers/acpi/acpica/utdebug.c [moved from drivers/acpi/utilities/utdebug.c with 89% similarity]
drivers/acpi/acpica/utdelete.c [moved from drivers/acpi/utilities/utdelete.c with 99% similarity]
drivers/acpi/acpica/uteval.c [moved from drivers/acpi/utilities/uteval.c with 99% similarity]
drivers/acpi/acpica/utglobal.c [moved from drivers/acpi/utilities/utglobal.c with 99% similarity]
drivers/acpi/acpica/utinit.c [moved from drivers/acpi/utilities/utinit.c with 98% similarity]
drivers/acpi/acpica/utmath.c [moved from drivers/acpi/utilities/utmath.c with 99% similarity]
drivers/acpi/acpica/utmisc.c [moved from drivers/acpi/utilities/utmisc.c with 97% similarity]
drivers/acpi/acpica/utmutex.c [moved from drivers/acpi/utilities/utmutex.c with 99% similarity]
drivers/acpi/acpica/utobject.c [moved from drivers/acpi/utilities/utobject.c with 99% similarity]
drivers/acpi/acpica/utresrc.c [moved from drivers/acpi/utilities/utresrc.c with 99% similarity]
drivers/acpi/acpica/utstate.c [moved from drivers/acpi/utilities/utstate.c with 99% similarity]
drivers/acpi/acpica/utxface.c [moved from drivers/acpi/utilities/utxface.c with 97% similarity]
drivers/acpi/battery.c
drivers/acpi/bus.c
drivers/acpi/cm_sbs.c
drivers/acpi/debug.c
drivers/acpi/dispatcher/Makefile [deleted file]
drivers/acpi/ec.c
drivers/acpi/events/Makefile [deleted file]
drivers/acpi/executer/Makefile [deleted file]
drivers/acpi/hardware/Makefile [deleted file]
drivers/acpi/main.c [moved from drivers/acpi/sleep/main.c with 98% similarity]
drivers/acpi/namespace/Makefile [deleted file]
drivers/acpi/numa.c
drivers/acpi/osl.c
drivers/acpi/parser/Makefile [deleted file]
drivers/acpi/power.c
drivers/acpi/proc.c [moved from drivers/acpi/sleep/proc.c with 92% similarity]
drivers/acpi/reboot.c
drivers/acpi/resources/Makefile [deleted file]
drivers/acpi/sbshc.c
drivers/acpi/scan.c
drivers/acpi/sleep.h [moved from drivers/acpi/sleep/sleep.h with 100% similarity]
drivers/acpi/sleep/Makefile [deleted file]
drivers/acpi/system.c
drivers/acpi/tables/Makefile [deleted file]
drivers/acpi/utilities/Makefile [deleted file]
drivers/acpi/utilities/utcache.c [deleted file]
drivers/acpi/video.c
drivers/acpi/wakeup.c [moved from drivers/acpi/sleep/wakeup.c with 96% similarity]
drivers/ata/libata-acpi.c
drivers/ata/pata_acpi.c
drivers/char/tpm/tpm_bios.c
drivers/edac/edac_device.c
drivers/gpu/drm/radeon/radeon_irq.c
drivers/ide/cs5530.c
drivers/ide/ide-acpi.c
drivers/ide/sc1200.c
drivers/media/dvb/b2c2/Kconfig
drivers/media/dvb/b2c2/flexcop-fe-tuner.c
drivers/media/dvb/b2c2/flexcop-i2c.c
drivers/media/dvb/bt8xx/Kconfig
drivers/media/dvb/dvb-usb/Kconfig
drivers/media/dvb/dvb-usb/dib0700_devices.c
drivers/media/dvb/ttpci/Kconfig
drivers/media/video/compat_ioctl32.c
drivers/media/video/cx18/Kconfig
drivers/media/video/cx23885/Kconfig
drivers/media/video/cx88/Kconfig
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/gspca/gspca.c
drivers/media/video/pvrusb2/Kconfig
drivers/media/video/saa7134/Kconfig
drivers/misc/Kconfig
drivers/misc/panasonic-laptop.c
drivers/misc/sony-laptop.c
drivers/misc/tc1100-wmi.c
drivers/misc/thinkpad_acpi.c
drivers/net/ppp_generic.c
drivers/pci/hotplug/acpi_pcihp.c
drivers/pci/hotplug/pciehp.h
drivers/pci/pci-acpi.c
drivers/pnp/pnpacpi/core.c
drivers/rtc/rtc-isl1208.c
drivers/w1/w1_io.c
include/acpi/acdisasm.h [deleted file]
include/acpi/acexcep.h
include/acpi/acoutput.h
include/acpi/acpi.h
include/acpi/acpiosxf.h
include/acpi/acpixf.h
include/acpi/acrestyp.h [new file with mode: 0644]
include/acpi/actbl.h
include/acpi/actbl1.h
include/acpi/actypes.h
include/acpi/platform/acenv.h
include/acpi/platform/aclinux.h
include/linux/pci_hotplug.h
kernel/cgroup.c
net/bluetooth/rfcomm/core.c
net/socket.c
sound/pci/hda/patch_sigmatel.c

index e0f346d201edb70fae654c55f6be842c4465a5ff..c9115c1b672c6e9eadb9ce59c2c198fea024823c 100644 (file)
@@ -220,14 +220,17 @@ and is between 256 and 4096 characters. It is defined in the file
                        Bits in debug_level correspond to a level in
                        ACPI_DEBUG_PRINT statements, e.g.,
                            ACPI_DEBUG_PRINT((ACPI_DB_INFO, ...
-                       See Documentation/acpi/debug.txt for more information
-                       about debug layers and levels.
+                       The debug_level mask defaults to "info".  See
+                       Documentation/acpi/debug.txt for more information about
+                       debug layers and levels.
 
+                       Enable processor driver info messages:
+                           acpi.debug_layer=0x20000000
+                       Enable PCI/PCI interrupt routing info messages:
+                           acpi.debug_layer=0x400000
                        Enable AML "Debug" output, i.e., stores to the Debug
                        object while interpreting AML:
                            acpi.debug_layer=0xffffffff acpi.debug_level=0x2
-                       Enable PCI/PCI interrupt routing info messages:
-                           acpi.debug_layer=0x400000 acpi.debug_level=0x4
                        Enable all messages related to ACPI hardware:
                            acpi.debug_layer=0x2 acpi.debug_level=0xffffffff
 
index c42a567e010c7db73ef761370179e346867aaf3e..fbc8fa58d56d4ec7cd09603341a4941f0a42788c 100644 (file)
@@ -4529,7 +4529,7 @@ S:        Maintained
 USB VIDEO CLASS
 P:     Laurent Pinchart
 M:     laurent.pinchart@skynet.be
-L:     linux-uvc-devel@lists.berlios.de
+L:     linux-uvc-devel@lists.berlios.de (subscribers-only)
 L:     video4linux-list@redhat.com
 W:     http://linux-uvc.berlios.de
 S:     Maintained
index 4c8d79710b84b9c6d58b36cd2269e3c5622765f0..71e98e9e6acd3fd69d868843a000e7d8fc0363f2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 28
-EXTRAVERSION = -rc9
+EXTRAVERSION =
 NAME = Erotic Pickled Herring
 
 # *DOCUMENTATION*
index 734d137dda6ecb22f1f58c9cc09f6925fe605e03..7f8362b379eb9f5661829de36ca93c38a76d0388 100644 (file)
@@ -14,7 +14,6 @@
 #define _ASM_IA64_ACPI_EXT_H
 
 #include <linux/types.h>
-#include <acpi/actypes.h>
 
 extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length);
 
index 9ce2801cbd5725a87fa19953d3eed714889febe6..fd480db255659bfe85d8bc29ae9f3dd5ebb3000e 100644 (file)
@@ -9,8 +9,6 @@
 #ifndef _ASM_IA64_SN_ACPI_H
 #define _ASM_IA64_SN_ACPI_H
 
-#include "acpi/acglobal.h"
-
 extern int sn_acpi_rev;
 #define SN_ACPI_BASE_SUPPORT()   (sn_acpi_rev >= 0x20101)
 
index bc610a6c7851bab9c4a58c639cea8d12778724c9..c5a214026a775c5d82e27fddd1c85cad2d883598 100644 (file)
@@ -13,7 +13,6 @@
 #include <asm/sn/sn_sal.h>
 #include "xtalk/hubdev.h"
 #include <linux/acpi.h>
-#include <acpi/acnamesp.h>
 
 
 /*
@@ -64,6 +63,7 @@ static acpi_status __init
 sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
 {
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        u64 addr;
        struct hubdev_info *hubdev;
        struct hubdev_info *hubdev_ptr;
@@ -77,11 +77,12 @@ sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
        status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
                                          &sn_uuid, &buffer);
        if (ACPI_FAILURE(status)) {
+               acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
                printk(KERN_ERR
                       "sn_acpi_hubdev_init: acpi_get_vendor_resource() "
-                      "(0x%x) failed for: ", status);
-               acpi_ns_print_node_pathname(handle, NULL);
-               printk("\n");
+                      "(0x%x) failed for: %s\n", status,
+                       (char *)name_buffer.pointer);
+               kfree(name_buffer.pointer);
                return AE_OK;           /* Continue walking namespace */
        }
 
@@ -89,11 +90,12 @@ sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
        vendor = &resource->data.vendor_typed;
        if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
            sizeof(struct hubdev_info *)) {
+               acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
                printk(KERN_ERR
-                      "sn_acpi_hubdev_init: Invalid vendor data length: %d for: ",
-                       vendor->byte_length);
-               acpi_ns_print_node_pathname(handle, NULL);
-               printk("\n");
+                      "sn_acpi_hubdev_init: Invalid vendor data length: "
+                      "%d for: %s\n",
+                       vendor->byte_length, (char *)name_buffer.pointer);
+               kfree(name_buffer.pointer);
                goto exit;
        }
 
@@ -120,6 +122,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
 {
        u64 addr;
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        acpi_handle handle;
        struct pcibus_bussoft *prom_bussoft_ptr;
        struct acpi_resource *resource;
@@ -131,11 +134,11 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
        status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
                                          &sn_uuid, &buffer);
        if (ACPI_FAILURE(status)) {
+               acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
                printk(KERN_ERR "%s: "
-                      "acpi_get_vendor_resource() failed (0x%x) for: ",
-                      __func__, status);
-               acpi_ns_print_node_pathname(handle, NULL);
-               printk("\n");
+                      "acpi_get_vendor_resource() failed (0x%x) for: %s\n",
+                      __func__, status, (char *)name_buffer.pointer);
+               kfree(name_buffer.pointer);
                return NULL;
        }
        resource = buffer.pointer;
@@ -168,6 +171,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
 {
        u64 addr;
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        struct sn_irq_info *irq_info, *irq_info_prom;
        struct pcidev_info *pcidev_ptr, *pcidev_prom_ptr;
        struct acpi_resource *resource;
@@ -182,11 +186,11 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
        status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
                                          &sn_uuid, &buffer);
        if (ACPI_FAILURE(status)) {
+               acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
                printk(KERN_ERR
-                      "%s: acpi_get_vendor_resource() failed (0x%x) for: ",
-                       __func__, status);
-               acpi_ns_print_node_pathname(handle, NULL);
-               printk("\n");
+                      "%s: acpi_get_vendor_resource() failed (0x%x) for: %s\n",
+                       __func__, status, (char *)name_buffer.pointer);
+               kfree(name_buffer.pointer);
                return 1;
        }
 
@@ -194,11 +198,12 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
        vendor = &resource->data.vendor_typed;
        if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
            sizeof(struct pci_devdev_info *)) {
+               acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
                printk(KERN_ERR
-                      "%s: Invalid vendor data length: %d for: ",
-                       __func__, vendor->byte_length);
-               acpi_ns_print_node_pathname(handle, NULL);
-               printk("\n");
+                      "%s: Invalid vendor data length: %d for: %s\n",
+                        __func__, vendor->byte_length,
+                       (char *)name_buffer.pointer);
+               kfree(name_buffer.pointer);
                ret = 1;
                goto exit;
        }
@@ -239,6 +244,9 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
        acpi_handle parent;
        int slot;
        acpi_status status;
+       struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+
+       acpi_get_name(device_handle, ACPI_FULL_PATHNAME, &name_buffer);
 
        /*
         * Do an upward search to find the root bus device, and
@@ -249,9 +257,8 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
                status = acpi_get_parent(child, &parent);
                if (ACPI_FAILURE(status)) {
                        printk(KERN_ERR "%s: acpi_get_parent() failed "
-                              "(0x%x) for: ", __func__, status);
-                       acpi_ns_print_node_pathname(child, NULL);
-                       printk("\n");
+                              "(0x%x) for: %s\n", __func__, status,
+                               (char *)name_buffer.pointer);
                        panic("%s: Unable to find host devfn\n", __func__);
                }
                if (parent == rootbus_handle)
@@ -259,22 +266,20 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
                child = parent;
        }
        if (!child) {
-               printk(KERN_ERR "%s: Unable to find root bus for: ",
-                      __func__);
-               acpi_ns_print_node_pathname(device_handle, NULL);
-               printk("\n");
+               printk(KERN_ERR "%s: Unable to find root bus for: %s\n",
+                      __func__, (char *)name_buffer.pointer);
                BUG();
        }
 
        status = acpi_evaluate_integer(child, METHOD_NAME__ADR, NULL, &adr);
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR "%s: Unable to get _ADR (0x%x) for: ",
-                      __func__, status);
-               acpi_ns_print_node_pathname(child, NULL);
-               printk("\n");
+               printk(KERN_ERR "%s: Unable to get _ADR (0x%x) for: %s\n",
+                      __func__, status, (char *)name_buffer.pointer);
                panic("%s: Unable to find host devfn\n", __func__);
        }
 
+       kfree(name_buffer.pointer);
+
        slot = (adr >> 16) & 0xffff;
        function = adr & 0xffff;
        devfn = PCI_DEVFN(slot, function);
@@ -300,27 +305,28 @@ find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv)
        int function;
        int slot;
        struct sn_pcidev_match *info = context;
+       struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
 
         status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
                                        &adr);
         if (ACPI_SUCCESS(status)) {
                status = acpi_get_parent(handle, &parent);
                if (ACPI_FAILURE(status)) {
+                       acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
                        printk(KERN_ERR
-                              "%s: acpi_get_parent() failed (0x%x) for: ",
-                                       __func__, status);
-                       acpi_ns_print_node_pathname(handle, NULL);
-                       printk("\n");
+                              "%s: acpi_get_parent() failed (0x%x) for: %s\n",
+                               __func__, status, (char *)name_buffer.pointer);
+                       kfree(name_buffer.pointer);
                        return AE_OK;
                }
                status = acpi_evaluate_integer(parent, METHOD_NAME__BBN,
                                               NULL, &bbn);
                if (ACPI_FAILURE(status)) {
+                       acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
                        printk(KERN_ERR
-                         "%s: Failed to find _BBN in parent of: ",
-                                       __func__);
-                       acpi_ns_print_node_pathname(handle, NULL);
-                       printk("\n");
+                         "%s: Failed to find _BBN in parent of: %s\n",
+                                       __func__, (char *)name_buffer.pointer);
+                       kfree(name_buffer.pointer);
                        return AE_OK;
                }
 
@@ -350,24 +356,27 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
        acpi_handle rootbus_handle;
        unsigned long long segment;
        acpi_status status;
+       struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
 
        rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle;
         status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL,
                                        &segment);
         if (ACPI_SUCCESS(status)) {
                if (segment != pci_domain_nr(dev)) {
+                       acpi_get_name(rootbus_handle, ACPI_FULL_PATHNAME,
+                               &name_buffer);
                        printk(KERN_ERR
-                              "%s: Segment number mismatch, 0x%llx vs 0x%x for: ",
-                              __func__, segment, pci_domain_nr(dev));
-                       acpi_ns_print_node_pathname(rootbus_handle, NULL);
-                       printk("\n");
+                              "%s: Segment number mismatch, 0x%llx vs 0x%x for: %s\n",
+                              __func__, segment, pci_domain_nr(dev),
+                              (char *)name_buffer.pointer);
+                       kfree(name_buffer.pointer);
                        return 1;
                }
        } else {
-               printk(KERN_ERR "%s: Unable to get __SEG from: ",
-                      __func__);
-               acpi_ns_print_node_pathname(rootbus_handle, NULL);
-               printk("\n");
+               acpi_get_name(rootbus_handle, ACPI_FULL_PATHNAME, &name_buffer);
+               printk(KERN_ERR "%s: Unable to get __SEG from: %s\n",
+                      __func__, (char *)name_buffer.pointer);
+               kfree(name_buffer.pointer);
                return 1;
        }
 
index 8a924a5661ddffff994bb59a74762b9f5bd5555a..0d4ffa4da1da755361b5506c945333a246d6a694 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/acpi.h>
 #include <asm/sn/sn2/sn_hwperf.h>
 #include <asm/sn/acpi.h>
-#include "acpi/acglobal.h"
 
 extern void sn_init_cpei_timer(void);
 extern void register_sn_procfs(void);
@@ -473,7 +472,7 @@ sn_io_early_init(void)
        {
                struct acpi_table_header *header = NULL;
 
-               acpi_get_table_by_index(ACPI_TABLE_INDEX_DSDT, &header);
+               acpi_get_table(ACPI_SIG_DSDT, 1, &header);
                BUG_ON(header == NULL);
                sn_acpi_rev = header->oem_revision;
        }
@@ -505,7 +504,7 @@ sn_io_early_init(void)
 
        {
                struct acpi_table_header *header;
-               (void)acpi_get_table_by_index(ACPI_TABLE_INDEX_DSDT, &header);
+               (void)acpi_get_table(ACPI_SIG_DSDT, 1, &header);
                printk(KERN_INFO "ACPI  DSDT OEM Rev 0x%x\n",
                        header->oem_revision);
        }
index 2988d29a0867f4c0ce187040e710e3c87344030d..33790b9e0cc0d46ee41f0ec8d3f3dbf181c8a9fc 100644 (file)
@@ -50,9 +50,8 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
 static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
 {
        __asm__(
-       "       dsbh    %0, %1                  \n"
-       "       dshd    %0, %0                  \n"
-       "       drotr   %0, %0, 32              \n"
+       "       dsbh    %0, %1\n"
+       "       dshd    %0, %0"
        : "=r" (x)
        : "r" (x));
 
index a8eac1697b3ddcf05dccc71d42267c549cc40904..d58f128aa747be974ac10ffd5fb1749d3292f505 100644 (file)
@@ -232,7 +232,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  */
 #ifdef __MIPSEB__
 #define ELF_DATA       ELFDATA2MSB
-#elif __MIPSEL__
+#elif defined(__MIPSEL__)
 #define ELF_DATA       ELFDATA2LSB
 #endif
 #define ELF_ARCH       EM_MIPS
index b72ec66db699e56f0985ebd6d88d82a7ceb14411..1f6fd4fc05b91b518f4f574b3ada13ddd24b285a 100644 (file)
@@ -44,9 +44,12 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
 {
        BUG_ON(mm == &init_mm); /* Should never happen */
 
-#ifdef CONFIG_SMP
+#if 1 || defined(CONFIG_SMP)
        flush_tlb_all();
 #else
+       /* FIXME: currently broken, causing space id and protection ids
+        *  to go out of sync, resulting in faults on userspace accesses.
+        */
        if (mm) {
                if (mm->context != 0)
                        free_sid(mm->context);
index b815664fe3700b77aa031fab7711be4128c858d1..8e99073b9e0f2cad52d1346fd7a525c835681b1a 100644 (file)
@@ -520,6 +520,7 @@ config X86_PTRACE_BTS
        bool "Branch Trace Store"
        default y
        depends on X86_DEBUGCTLMSR
+       depends on BROKEN
        help
          This adds a ptrace interface to the hardware's branch trace store.
 
index 3c0c93300f127ffe91343f8514e27b174742bdb0..5d23c13ac7d48efe54de227ac337ceea1d75ee4c 100644 (file)
@@ -2,15 +2,8 @@
 # Makefile for the Linux ACPI interpreter
 #
 
-export ACPI_CFLAGS
-
-ACPI_CFLAGS    := -Os
-
-ifdef CONFIG_ACPI_DEBUG
-  ACPI_CFLAGS  += -DACPI_DEBUG_OUTPUT
-endif
-
-EXTRA_CFLAGS   += $(ACPI_CFLAGS)
+ccflags-y                      := -Os
+ccflags-$(CONFIG_ACPI_DEBUG)   += -DACPI_DEBUG_OUTPUT
 
 #
 # ACPI Boot-Time Table Parsing
@@ -22,9 +15,13 @@ obj-$(CONFIG_X86)            += blacklist.o
 # ACPI Core Subsystem (Interpreter)
 #
 obj-y                          += osl.o utils.o reboot.o\
-                                  dispatcher/ events/ executer/ hardware/ \
-                                  namespace/ parser/ resources/ tables/ \
-                                  utilities/
+                                       acpica/
+
+# sleep related files
+obj-y                          += wakeup.o
+obj-y                          += main.o
+obj-$(CONFIG_ACPI_SLEEP)       += proc.o
+
 
 #
 # ACPI Bus and Device Drivers
@@ -35,7 +32,6 @@ ifdef CONFIG_CPU_FREQ
 processor-objs += processor_perflib.o
 endif
 
-obj-y                          += sleep/
 obj-y                          += bus.o glue.o
 obj-y                          += scan.o
 # Keep EC driver first. Initialization of others depend on it.
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile
new file mode 100644 (file)
index 0000000..3f23298
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# Makefile for ACPICA Core interpreter
+#
+
+ccflags-y                      := -Os
+ccflags-$(CONFIG_ACPI_DEBUG)   += -DACPI_DEBUG_OUTPUT
+
+obj-y := dsfield.o   dsmthdat.o  dsopcode.o  dswexec.o  dswscope.o \
+        dsmethod.o  dsobject.o  dsutils.o   dswload.o  dswstate.o \
+        dsinit.o
+
+obj-y += evevent.o  evregion.o  evsci.o    evxfevnt.o \
+        evmisc.o   evrgnini.o  evxface.o  evxfregn.o \
+        evgpe.o    evgpeblk.o
+
+obj-y += exconfig.o  exfield.o  exnames.o   exoparg6.o  exresolv.o  exstorob.o\
+        exconvrt.o  exfldio.o  exoparg1.o  exprep.o    exresop.o   exsystem.o\
+        excreate.o  exmisc.o   exoparg2.o  exregion.o  exstore.o   exutils.o \
+        exdump.o    exmutex.o  exoparg3.o  exresnte.o  exstoren.o
+
+obj-y += hwacpi.o  hwgpe.o  hwregs.o  hwsleep.o hwxface.o
+
+obj-$(ACPI_FUTURE_USAGE) += hwtimer.o
+
+obj-y += nsaccess.o  nsload.o    nssearch.o  nsxfeval.o \
+        nsalloc.o   nseval.o    nsnames.o   nsutils.o   nsxfname.o \
+        nsdump.o    nsinit.o    nsobject.o  nswalk.o    nsxfobj.o  \
+        nsparse.o   nspredef.o
+
+obj-$(ACPI_FUTURE_USAGE) += nsdumpdv.o
+
+obj-y += psargs.o    psparse.o  psloop.o pstree.o   pswalk.o  \
+        psopcode.o  psscope.o  psutils.o  psxface.o
+
+obj-y += rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \
+        rscalc.o  rsirq.o  rsmemory.o  rsutils.o
+
+obj-$(ACPI_FUTURE_USAGE) += rsdump.o
+
+obj-y += tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o
+
+obj-y += utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \
+               utcopy.o utdelete.o utglobal.o utmath.o utobject.o \
+               utstate.o utmutex.o utobject.o utresrc.o
diff --git a/drivers/acpi/acpica/accommon.h b/drivers/acpi/acpica/accommon.h
new file mode 100644 (file)
index 0000000..3b20786
--- /dev/null
@@ -0,0 +1,63 @@
+/******************************************************************************
+ *
+ * Name: accommon.h - Common include files for generation of ACPICA source
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2008, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACCOMMON_H__
+#define __ACCOMMON_H__
+
+/*
+ * Common set of includes for all ACPICA source files.
+ * We put them here because we don't want to duplicate them
+ * in the the source code again and again.
+ *
+ * Note: The order of these include files is important.
+ */
+#include "acconfig.h"          /* Global configuration constants */
+#include "acmacros.h"          /* C macros */
+#include "aclocal.h"           /* Internal data types */
+#include "acobject.h"          /* ACPI internal object */
+#include "acstruct.h"          /* Common structures */
+#include "acglobal.h"          /* All global variables */
+#include "achware.h"           /* Hardware defines and interfaces */
+#include "acutils.h"           /* Utility interfaces */
+
+#endif                         /* __ACCOMMON_H__ */
similarity index 98%
rename from include/acpi/acconfig.h
rename to drivers/acpi/acpica/acconfig.h
index 29feee27f0ea8aeef29352635eb4f6720f55e1f2..e6777fb883d25b59d1e5acac89a7ccd24ab09f21 100644 (file)
  *
  */
 
-/* Current ACPICA subsystem version in YYYYMMDD format */
-
-#define ACPI_CA_VERSION                 0x20080926
-
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
  * but there is a large base of ASL/AML code in existing machines that check
 
 #define ACPI_ROOT_TABLE_SIZE_INCREMENT  4
 
+/* Maximum number of While() loop iterations before forced abort */
+
+#define ACPI_MAX_LOOP_ITERATIONS        0xFFFF
+
 /******************************************************************************
  *
  * ACPI Specification constants (Do not change unless the specification changes)
similarity index 97%
rename from include/acpi/acevents.h
rename to drivers/acpi/acpica/acevents.h
index d5d099bf349cb67c140ae1e73e536c942672af8a..07e20135f01b30873d1f4aca495d7278a81962cd 100644 (file)
@@ -93,11 +93,13 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
  */
 u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info);
 
-acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback);
+acpi_status
+acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback, void *context);
 
 acpi_status
 acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
-                           struct acpi_gpe_block_info *gpe_block);
+                           struct acpi_gpe_block_info *gpe_block,
+                           void *context);
 
 acpi_status
 acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
similarity index 97%
rename from include/acpi/acglobal.h
rename to drivers/acpi/acpica/acglobal.h
index 15dda46b70d1c1e36c949d9555efc7a805ccf321..ddb40f5c68fc25e35e9cab318fb232c4a9015723 100644 (file)
@@ -102,6 +102,12 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, TRUE);
  */
 ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);
 
+/*
+ * Optionally use default values for the ACPI register widths. Set this to
+ * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
+ */
+ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, TRUE);
+
 /*****************************************************************************
  *
  * Debug support
@@ -140,7 +146,7 @@ ACPI_EXTERN u32 acpi_gbl_trace_flags;
  */
 ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list;
 ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT;
-extern u8 acpi_gbl_permanent_mmap;
+ACPI_EXTERN struct acpi_table_facs *acpi_gbl_FACS;
 
 /* These addresses are calculated from FADT address values */
 
@@ -326,6 +332,7 @@ ACPI_EXTERN struct acpi_fixed_event_handler
 ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
 ACPI_EXTERN struct acpi_gpe_block_info
 *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
+ACPI_EXTERN u32 acpi_current_gpe_count;
 
 /*****************************************************************************
  *
similarity index 89%
rename from include/acpi/achware.h
rename to drivers/acpi/acpica/achware.h
index 97a72b19327683843bc95219d643406b04426b59..58c69dc49ab43b62207afde56235a5266834dfb4 100644 (file)
 #ifndef __ACHWARE_H__
 #define __ACHWARE_H__
 
-/* PM Timer ticks per second (HZ) */
-
-#define PM_TIMER_FREQUENCY  3579545
-
-/* Values for the _SST reserved method */
+/* Values for the _SST predefined method */
 
 #define ACPI_SST_INDICATOR_OFF  0
 #define ACPI_SST_WORKING        1
@@ -56,8 +52,6 @@
 #define ACPI_SST_SLEEPING       3
 #define ACPI_SST_SLEEP_CONTEXT  4
 
-/* Prototypes */
-
 /*
  * hwacpi - high level functions
  */
@@ -75,13 +69,6 @@ acpi_hw_register_read(u32 register_id, u32 * return_value);
 
 acpi_status acpi_hw_register_write(u32 register_id, u32 value);
 
-acpi_status
-acpi_hw_low_level_read(u32 width,
-                      u32 * value, struct acpi_generic_address *reg);
-
-acpi_status
-acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg);
-
 acpi_status acpi_hw_clear_acpi_status(void);
 
 /*
@@ -94,13 +81,13 @@ acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info);
 
 acpi_status
 acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
-                         struct acpi_gpe_block_info *gpe_block);
+                         struct acpi_gpe_block_info *gpe_block, void *context);
 
 acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info);
 
 acpi_status
 acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
-                       struct acpi_gpe_block_info *gpe_block);
+                       struct acpi_gpe_block_info *gpe_block, void *context);
 
 acpi_status
 acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
@@ -114,7 +101,8 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void);
 
 acpi_status
 acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
-                                struct acpi_gpe_block_info *gpe_block);
+                                struct acpi_gpe_block_info *gpe_block,
+                                void *context);
 
 #ifdef ACPI_FUTURE_USAGE
 /*
similarity index 95%
rename from include/acpi/aclocal.h
rename to drivers/acpi/acpica/aclocal.h
index ecab527cf78ef72afe33309782bf184a12c13641..492d02761bb7b34a8d2291c2508eb786a98869c8 100644 (file)
@@ -46,8 +46,6 @@
 
 /* acpisrc:struct_defs -- for acpisrc conversion */
 
-#define ACPI_WAIT_FOREVER               0xFFFF /* u16, as per ACPI spec */
-#define ACPI_DO_NOT_WAIT                0
 #define ACPI_SERIALIZED                 0xFF
 
 typedef u32 acpi_mutex_handle;
@@ -120,11 +118,6 @@ static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = {
 #define ACPI_MAX_LOCK                   1
 #define ACPI_NUM_LOCK                   ACPI_MAX_LOCK+1
 
-/* Owner IDs are used to track namespace nodes for selective deletion */
-
-typedef u8 acpi_owner_id;
-#define ACPI_OWNER_ID_MAX               0xFF
-
 /* This Thread ID means that the mutex is not in use (unlocked) */
 
 #define ACPI_MUTEX_NOT_ACQUIRED         (acpi_thread_id) 0
@@ -165,11 +158,6 @@ typedef enum {
        ACPI_IMODE_EXECUTE = 0x03
 } acpi_interpreter_mode;
 
-union acpi_name_union {
-       u32 integer;
-       char ascii[4];
-};
-
 /*
  * The Namespace Node describes a named object that appears in the AML.
  * descriptor_type is used to differentiate between internal descriptors.
@@ -216,26 +204,6 @@ struct acpi_namespace_node {
 #define ANOBJ_IS_BIT_OFFSET             0x40   /* i_aSL only: Reference is a bit offset */
 #define ANOBJ_IS_REFERENCED             0x80   /* i_aSL only: Object was referenced */
 
-/*
- * ACPI Table Descriptor.  One per ACPI table
- */
-struct acpi_table_desc {
-       acpi_physical_address address;
-       struct acpi_table_header *pointer;
-       u32 length;             /* Length fixed at 32 bits */
-       union acpi_name_union signature;
-       acpi_owner_id owner_id;
-       u8 flags;
-};
-
-/* Flags for above */
-
-#define ACPI_TABLE_ORIGIN_UNKNOWN       (0)
-#define ACPI_TABLE_ORIGIN_MAPPED        (1)
-#define ACPI_TABLE_ORIGIN_ALLOCATED     (2)
-#define ACPI_TABLE_ORIGIN_MASK          (3)
-#define ACPI_TABLE_IS_LOADED            (4)
-
 /* One internal RSDT for table management */
 
 struct acpi_internal_rsdt {
@@ -266,15 +234,6 @@ struct acpi_ns_search_data {
        struct acpi_namespace_node *node;
 };
 
-/*
- * Predefined Namespace items
- */
-struct acpi_predefined_names {
-       char *name;
-       u8 type;
-       char *val;
-};
-
 /* Object types used during package copies */
 
 #define ACPI_COPY_TYPE_SIMPLE           0
@@ -487,10 +446,15 @@ struct acpi_gpe_walk_info {
        struct acpi_gpe_block_info *gpe_block;
 };
 
-typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info *
-                                        gpe_xrupt_info,
-                                        struct acpi_gpe_block_info *
-                                        gpe_block);
+struct acpi_gpe_device_info {
+       u32 index;
+       u32 next_block_base_index;
+       acpi_status status;
+       struct acpi_namespace_node *gpe_device;
+};
+
+typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info *gpe_xrupt_info,
+               struct acpi_gpe_block_info *gpe_block, void *context);
 
 /* Information about each particular fixed event */
 
@@ -566,6 +530,7 @@ struct acpi_control_state {
        union acpi_parse_object *predicate_op;
        u8 *aml_predicate_start;        /* Start of if/while predicate */
        u8 *package_end;        /* End of if/while block */
+       u32 loop_count;         /* While() loop counter */
 };
 
 /*
@@ -671,6 +636,12 @@ union acpi_parse_value {
        union acpi_parse_object *arg;   /* arguments and contained ops */
 };
 
+#ifdef ACPI_DISASSEMBLER
+#define ACPI_DISASM_ONLY_MEMBERS(a)     a;
+#else
+#define ACPI_DISASM_ONLY_MEMBERS(a)
+#endif
+
 #define ACPI_PARSE_COMMON \
        union acpi_parse_object         *parent;        /* Parent op */\
        u8                              descriptor_type; /* To differentiate various internal objs */\
@@ -790,9 +761,6 @@ struct acpi_parse_state {
  *
  ****************************************************************************/
 
-#define PCI_ROOT_HID_STRING             "PNP0A03"
-#define PCI_EXPRESS_ROOT_HID_STRING     "PNP0A08"
-
 struct acpi_bit_register_info {
        u8 parent_register;
        u8 bit_position;
@@ -1019,26 +987,4 @@ struct acpi_debug_mem_block {
 #define ACPI_MEM_LIST_MAX               1
 #define ACPI_NUM_MEM_LISTS              2
 
-struct acpi_memory_list {
-       char *list_name;
-       void *list_head;
-       u16 object_size;
-       u16 max_depth;
-       u16 current_depth;
-       u16 link_offset;
-
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
-
-       /* Statistics for debug memory tracking only */
-
-       u32 total_allocated;
-       u32 total_freed;
-       u32 max_occupied;
-       u32 total_size;
-       u32 current_total_size;
-       u32 requests;
-       u32 hits;
-#endif
-};
-
 #endif                         /* __ACLOCAL_H__ */
similarity index 83%
rename from include/acpi/acmacros.h
rename to drivers/acpi/acpica/acmacros.h
index a597207e28352ab4de53a69d9d6eb8d29f6c0a28..c57286a3acebb46c54728118db4bcf24f0688aeb 100644 (file)
 #ifndef __ACMACROS_H__
 #define __ACMACROS_H__
 
-/*
- * Data manipulation macros
- */
-#define ACPI_LOWORD(l)                  ((u16)(u32)(l))
-#define ACPI_HIWORD(l)                  ((u16)((((u32)(l)) >> 16) & 0xFFFF))
-#define ACPI_LOBYTE(l)                  ((u8)(u16)(l))
-#define ACPI_HIBYTE(l)                  ((u8)((((u16)(l)) >> 8) & 0xFF))
-
-#define ACPI_SET_BIT(target,bit)        ((target) |= (bit))
-#define ACPI_CLEAR_BIT(target,bit)      ((target) &= ~(bit))
-#define ACPI_MIN(a,b)                   (((a)<(b))?(a):(b))
-#define ACPI_MAX(a,b)                   (((a)>(b))?(a):(b))
-
-/* Size calculation */
-
-#define ACPI_ARRAY_LENGTH(x)            (sizeof(x) / sizeof((x)[0]))
-
 /*
  * Extract data using a pointer. Any more than a byte and we
  * get into potential aligment issues -- see the STORE macros below.
 #define ACPI_SET32(ptr)                 *ACPI_CAST_PTR (u32, ptr)
 #define ACPI_SET64(ptr)                 *ACPI_CAST_PTR (u64, ptr)
 
-/*
- * Pointer manipulation
- */
-#define ACPI_CAST_PTR(t, p)             ((t *) (acpi_uintptr_t) (p))
-#define ACPI_CAST_INDIRECT_PTR(t, p)    ((t **) (acpi_uintptr_t) (p))
-#define ACPI_ADD_PTR(t, a, b)          ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8, (a)) + (acpi_size)(b)))
-#define ACPI_PTR_DIFF(a, b)            (acpi_size) (ACPI_CAST_PTR (u8, (a)) - ACPI_CAST_PTR (u8, (b)))
-
-/* Pointer/Integer type conversions */
-
-#define ACPI_TO_POINTER(i)             ACPI_ADD_PTR (void, (void *) NULL, (acpi_size) i)
-#define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF (p, (void *) NULL)
-#define ACPI_OFFSET(d, f)               (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL)
-#define ACPI_PHYSADDR_TO_PTR(i)         ACPI_TO_POINTER(i)
-#define ACPI_PTR_TO_PHYSADDR(i)         ACPI_TO_INTEGER(i)
-
-#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
-#define ACPI_COMPARE_NAME(a, b)         (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b)))
-#else
-#define ACPI_COMPARE_NAME(a, b)         (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))
-#endif
-
-/*
- * Full 64-bit integer must be available on both 32-bit and 64-bit platforms
- */
-struct acpi_integer_overlay {
-       u32 lo_dword;
-       u32 hi_dword;
-};
-
-#define ACPI_LODWORD(integer)           (ACPI_CAST_PTR (struct acpi_integer_overlay, &integer)->lo_dword)
-#define ACPI_HIDWORD(integer)           (ACPI_CAST_PTR (struct acpi_integer_overlay, &integer)->hi_dword)
-
 /*
  * printf() format helpers
  */
@@ -209,7 +159,7 @@ struct acpi_integer_overlay {
 /*
  * The hardware does not support unaligned transfers. We must move the
  * data one byte at a time. These macros work whether the source or
- * the destination (or both) is/are unaligned.  (Little-endian move)
+ * the destination (or both) is/are unaligned. (Little-endian move)
  */
 
 /* 16-bit source, 16/32/64 destination */
@@ -357,12 +307,6 @@ struct acpi_integer_overlay {
        {(u32)(Pargs), (u32)(Iargs), (u32)(flags), obj_type, class, type}
 #endif
 
-#ifdef ACPI_DISASSEMBLER
-#define ACPI_DISASM_ONLY_MEMBERS(a)     a;
-#else
-#define ACPI_DISASM_ONLY_MEMBERS(a)
-#endif
-
 #define ARG_TYPE_WIDTH                  5
 #define ARG_1(x)                        ((u32)(x))
 #define ARG_2(x)                        ((u32)(x) << (1 * ARG_TYPE_WIDTH))
@@ -388,32 +332,16 @@ struct acpi_integer_overlay {
 #define GET_CURRENT_ARG_TYPE(list)      (list & ((u32) 0x1F))
 #define INCREMENT_ARG_LIST(list)        (list >>= ((u32) ARG_TYPE_WIDTH))
 
-#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
-/*
- * Module name is include in both debug and non-debug versions primarily for
- * error messages. The __FILE__ macro is not very useful for this, because it
- * often includes the entire pathname to the module
- */
-#define ACPI_MODULE_NAME(name)         static const char ACPI_UNUSED_VAR _acpi_module_name[] = name;
-#else
-#define ACPI_MODULE_NAME(name)
-#endif
-
 /*
  * Ascii error messages can be configured out
  */
 #ifndef ACPI_NO_ERROR_MESSAGES
-#define AE_INFO                         _acpi_module_name, __LINE__
 
 /*
  * Error reporting. Callers module and line number are inserted by AE_INFO,
  * the plist contains a set of parens to allow variable-length lists.
  * These macros are used for both the debug and non-debug versions of the code.
  */
-#define ACPI_INFO(plist)                acpi_ut_info plist
-#define ACPI_WARNING(plist)             acpi_ut_warning plist
-#define ACPI_EXCEPTION(plist)           acpi_ut_exception plist
-#define ACPI_ERROR(plist)               acpi_ut_error plist
 #define ACPI_ERROR_NAMESPACE(s, e)      acpi_ns_report_error (AE_INFO, s, e);
 #define ACPI_ERROR_METHOD(s, n, p, e)   acpi_ns_report_method_error (AE_INFO, s, n, p, e);
 
@@ -421,50 +349,18 @@ struct acpi_integer_overlay {
 
 /* No error messages */
 
-#define ACPI_INFO(plist)
-#define ACPI_WARNING(plist)
-#define ACPI_EXCEPTION(plist)
-#define ACPI_ERROR(plist)
 #define ACPI_ERROR_NAMESPACE(s, e)
 #define ACPI_ERROR_METHOD(s, n, p, e)
-#endif
+#endif         /* ACPI_NO_ERROR_MESSAGES */
 
 /*
  * Debug macros that are conditionally compiled
  */
 #ifdef ACPI_DEBUG_OUTPUT
 
-/*
- * Common parameters used for debug output functions:
- * line number, function name, module(file) name, component ID
- */
-#define ACPI_DEBUG_PARAMETERS           __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
-
 /*
  * Function entry tracing
  */
-
-/*
- * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
- * define it now. This is the case where there the compiler does not support
- * a __func__ macro or equivalent.
- */
-#ifndef ACPI_GET_FUNCTION_NAME
-#define ACPI_GET_FUNCTION_NAME          _acpi_function_name
-/*
- * The Name parameter should be the procedure name as a quoted string.
- * The function name is also used by the function exit macros below.
- * Note: (const char) is used to be compatible with the debug interfaces
- * and macros such as __func__.
- */
-#define ACPI_FUNCTION_NAME(name)       static const char _acpi_function_name[] = #name;
-
-#else
-/* Compiler supports __func__ (or equivalent) -- Ignore this macro */
-
-#define ACPI_FUNCTION_NAME(name)
-#endif
-
 #ifdef CONFIG_ACPI_DEBUG_FUNC_TRACE
 
 #define ACPI_FUNCTION_TRACE(a)          ACPI_FUNCTION_NAME(a) \
@@ -584,15 +480,6 @@ struct acpi_integer_overlay {
 #define ACPI_DUMP_RESOURCE_LIST(a)      acpi_rs_dump_resource_list(a)
 #define ACPI_DUMP_BUFFER(a, b)          acpi_ut_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
 
-/*
- * Master debug print macros
- * Print iff:
- *    1) Debug print for the current component is enabled
- *    2) Debug error level or trace level for the print statement is enabled
- */
-#define ACPI_DEBUG_PRINT(plist)         acpi_ut_debug_print plist
-#define ACPI_DEBUG_PRINT_RAW(plist)     acpi_ut_debug_print_raw plist
-
 #else
 /*
  * This is the non-debug case -- make everything go away,
@@ -603,7 +490,6 @@ struct acpi_integer_overlay {
 
 #define ACPI_DEBUG_DEFINE(a)           do { } while(0)
 #define ACPI_DEBUG_ONLY_MEMBERS(a)     do { } while(0)
-#define ACPI_FUNCTION_NAME(a)          do { } while(0)
 #define ACPI_FUNCTION_TRACE(a)         do { } while(0)
 #define ACPI_FUNCTION_TRACE_PTR(a, b)  do { } while(0)
 #define ACPI_FUNCTION_TRACE_U32(a, b)  do { } while(0)
@@ -619,8 +505,6 @@ struct acpi_integer_overlay {
 #define ACPI_DUMP_PATHNAME(a, b, c, d) do { } while(0)
 #define ACPI_DUMP_RESOURCE_LIST(a)     do { } while(0)
 #define ACPI_DUMP_BUFFER(a, b)         do { } while(0)
-#define ACPI_DEBUG_PRINT(pl)           do { } while(0)
-#define ACPI_DEBUG_PRINT_RAW(pl)       do { } while(0)
 
 #define return_VOID                     return
 #define return_ACPI_STATUS(s)           return(s)
@@ -629,7 +513,7 @@ struct acpi_integer_overlay {
 #define return_UINT32(s)                return(s)
 #define return_PTR(s)                   return(s)
 
-#endif
+#endif                         /* ACPI_DEBUG_OUTPUT */
 
 /*
  * Some code only gets executed when the debugger is built in.
similarity index 98%
rename from include/acpi/acnamesp.h
rename to drivers/acpi/acpica/acnamesp.h
index db4e6f677855293c1533c142ea575ce1a1306b00..46cb5b46d2803fd43bf7691bf0ee065fcf039dfc 100644 (file)
@@ -182,7 +182,9 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);
  */
 acpi_status
 acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
-                              union acpi_operand_object *return_object);
+                              u32 user_param_count,
+                              acpi_status return_status,
+                              union acpi_operand_object **return_object);
 
 const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct
                                                                    acpi_namespace_node
@@ -191,6 +193,7 @@ const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct
 void
 acpi_ns_check_parameter_count(char *pathname,
                              struct acpi_namespace_node *node,
+                             u32 user_param_count,
                              const union acpi_predefined_info *info);
 
 /*
similarity index 98%
rename from include/acpi/actables.h
rename to drivers/acpi/acpica/actables.h
index 0cbe1b9ab52249e38adcd12c5fe0c8009d8ebbd9..7ce6e33c7f781ef71f308bd9ebd35ab33c282da7 100644 (file)
@@ -94,6 +94,8 @@ void acpi_tb_set_table_loaded_flag(u32 table_index, u8 is_loaded);
 /*
  * tbutils - table manager utilities
  */
+acpi_status acpi_tb_initialize_facs(void);
+
 u8 acpi_tb_tables_loaded(void);
 
 void
similarity index 93%
rename from include/acpi/acutils.h
rename to drivers/acpi/acpica/acutils.h
index d8307b2987e371b706ac7e0c96359606fb5cd900..80d8813484fe1ee71cb633e1647644815fc05d6f 100644 (file)
@@ -297,42 +297,6 @@ void acpi_ut_report_info(char *module_name, u32 line_number);
 
 void acpi_ut_report_warning(char *module_name, u32 line_number);
 
-/* Error and message reporting interfaces */
-
-void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_debug_print(u32 requested_debug_level,
-                   u32 line_number,
-                   const char *function_name,
-                   const char *module_name,
-                   u32 component_id,
-                   const char *format, ...) ACPI_PRINTF_LIKE(6);
-
-void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_debug_print_raw(u32 requested_debug_level,
-                       u32 line_number,
-                       const char *function_name,
-                       const char *module_name,
-                       u32 component_id,
-                       const char *format, ...) ACPI_PRINTF_LIKE(6);
-
-void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_error(const char *module_name,
-             u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
-
-void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_exception(const char *module_name,
-                 u32 line_number,
-                 acpi_status status,
-                 const char *format, ...) ACPI_PRINTF_LIKE(4);
-
-void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_warning(const char *module_name,
-               u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
-
-void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_info(const char *module_name,
-            u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
-
 /*
  * utdelete - Object deletion and reference counts
  */
similarity index 99%
rename from drivers/acpi/dispatcher/dsfield.c
rename to drivers/acpi/acpica/dsfield.c
index f988a5e7d2b4f504b62214260788ee28afefa367..53e27bc5a734214cb9b76e2db9fec5cea0fbdf26 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/amlcode.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acparser.h>
+#include "accommon.h"
+#include "amlcode.h"
+#include "acdispat.h"
+#include "acinterp.h"
+#include "acnamesp.h"
+#include "acparser.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsfield")
similarity index 98%
rename from drivers/acpi/dispatcher/dsinit.c
rename to drivers/acpi/acpica/dsinit.c
index 949f7c75029ee05380cc23e01f17c6e2d43e6fe1..eb144b13d8fa434f93618fb953f498771b7e3a87 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acdispat.h>
-#include <acpi/acnamesp.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "acdispat.h"
+#include "acnamesp.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsinit")
similarity index 98%
rename from drivers/acpi/dispatcher/dsmethod.c
rename to drivers/acpi/acpica/dsmethod.c
index 279a5a60a0dd492a2b27f144b12b353b9de78a2a..14b8b8ed802367c15c814f87695372856d3ca1af 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/amlcode.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "amlcode.h"
+#include "acdispat.h"
+#include "acinterp.h"
+#include "acnamesp.h"
+#ifdef ACPI_DISASSEMBLER
 #include <acpi/acdisasm.h>
+#endif
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsmethod")
@@ -412,6 +415,9 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
 
        if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) {
                status = obj_desc->method.implementation(next_walk_state);
+               if (status == AE_OK) {
+                       status = AE_CTRL_TERMINATE;
+               }
        }
 
        return_ACPI_STATUS(status);
similarity index 99%
rename from drivers/acpi/dispatcher/dsmthdat.c
rename to drivers/acpi/acpica/dsmthdat.c
index d03f81bd1bcb01f02cd6704732c37d54a2ae6822..da0f5468184cc15fbc8fd887bf8b6bc09fd06ec6 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acdispat.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acdispat.h"
+#include "acnamesp.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsmthdat")
similarity index 99%
rename from drivers/acpi/dispatcher/dsobject.c
rename to drivers/acpi/acpica/dsobject.c
index 4f08e599d07e2a62eb257fefa2b6ba812b132578..15c628e6aa0032f0a2486c8f6ade61fc3b8f556d 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/amlcode.h>
-#include <acpi/acdispat.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "amlcode.h"
+#include "acdispat.h"
+#include "acnamesp.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsobject")
similarity index 96%
rename from drivers/acpi/dispatcher/dsopcode.c
rename to drivers/acpi/acpica/dsopcode.c
index 69fae5905bb8219af26b0e0684ae22cedc1b84dc..0c3b4dd60e8a5ae9bfdcb2713a33ee8455d1daec 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/amlcode.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acevents.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "amlcode.h"
+#include "acdispat.h"
+#include "acinterp.h"
+#include "acnamesp.h"
+#include "acevents.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsopcode")
@@ -1140,9 +1141,28 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state,
                          op->common.aml_opcode, walk_state));
 
        switch (op->common.aml_opcode) {
-       case AML_IF_OP:
        case AML_WHILE_OP:
 
+               /*
+                * If this is an additional iteration of a while loop, continue.
+                * There is no need to allocate a new control state.
+                */
+               if (walk_state->control_state) {
+                       if (walk_state->control_state->control.aml_predicate_start
+                               == (walk_state->parser_state.aml - 1)) {
+
+                               /* Reset the state to start-of-loop */
+
+                               walk_state->control_state->common.state =
+                                   ACPI_CONTROL_CONDITIONAL_EXECUTING;
+                               break;
+                       }
+               }
+
+               /*lint -fallthrough */
+
+       case AML_IF_OP:
+
                /*
                 * IF/WHILE: Create a new control state to manage these
                 * constructs. We need to manage these as a stack, in order
@@ -1243,13 +1263,36 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
 
                ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "[WHILE_OP] Op=%p\n", op));
 
-               if (walk_state->control_state->common.value) {
+               control_state = walk_state->control_state;
+               if (control_state->common.value) {
 
-                       /* Predicate was true, go back and evaluate it again! */
+                       /* Predicate was true, the body of the loop was just executed */
 
+                       /*
+                        * This loop counter mechanism allows the interpreter to escape
+                        * possibly infinite loops. This can occur in poorly written AML
+                        * when the hardware does not respond within a while loop and the
+                        * loop does not implement a timeout.
+                        */
+                       control_state->control.loop_count++;
+                       if (control_state->control.loop_count >
+                               ACPI_MAX_LOOP_ITERATIONS) {
+                               status = AE_AML_INFINITE_LOOP;
+                               break;
+                       }
+
+                       /*
+                        * Go back and evaluate the predicate and maybe execute the loop
+                        * another time
+                        */
                        status = AE_CTRL_PENDING;
+                       walk_state->aml_last_while =
+                           control_state->control.aml_predicate_start;
+                       break;
                }
 
+               /* Predicate was false, terminate this while loop */
+
                ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
                                  "[WHILE_OP] termination! Op=%p\n", op));
 
@@ -1257,9 +1300,6 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
 
                control_state =
                    acpi_ut_pop_generic_state(&walk_state->control_state);
-
-               walk_state->aml_last_while =
-                   control_state->control.aml_predicate_start;
                acpi_ut_delete_generic_state(control_state);
                break;
 
similarity index 99%
rename from drivers/acpi/dispatcher/dsutils.c
rename to drivers/acpi/acpica/dsutils.c
index b398982f0d8baef2e534efc85108a5b338fa0f1a..dabc23a46176b478d5f5ead5df1adca3d9127ef5 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/amlcode.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acdebug.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "amlcode.h"
+#include "acdispat.h"
+#include "acinterp.h"
+#include "acnamesp.h"
+#include "acdebug.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsutils")
similarity index 99%
rename from drivers/acpi/dispatcher/dswexec.c
rename to drivers/acpi/acpica/dswexec.c
index 396fe12078cd1595f99199c8bf837be59df7f3ae..350e6656bc8963951f7861a1f60ebcb422cd7831 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/amlcode.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acdebug.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "amlcode.h"
+#include "acdispat.h"
+#include "acinterp.h"
+#include "acnamesp.h"
+#include "acdebug.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dswexec")
similarity index 99%
rename from drivers/acpi/dispatcher/dswload.c
rename to drivers/acpi/acpica/dswload.c
index dff7a3e445a88e7dbd694f858536a7fd5dba3612..3023ceaa8d544d8d0c52a53d0dff2dc13facbd6c 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/amlcode.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acevents.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "amlcode.h"
+#include "acdispat.h"
+#include "acinterp.h"
+#include "acnamesp.h"
+#include "acevents.h"
 
 #ifdef ACPI_ASL_COMPILER
 #include <acpi/acdisasm.h>
similarity index 99%
rename from drivers/acpi/dispatcher/dswscope.c
rename to drivers/acpi/acpica/dswscope.c
index 9e60732658734c4c1741f32c3eb1ff236da20e61..908645e72f0320477f1f05e83bd43d5a63135cc0 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acdispat.h>
+#include "accommon.h"
+#include "acdispat.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dswscope")
similarity index 99%
rename from drivers/acpi/dispatcher/dswstate.c
rename to drivers/acpi/acpica/dswstate.c
index b00d4af791aaa7829e4c020fdc19680dba1b1433..40f92bf7dce5cc2e7bf33cd5fd83013d544d4328 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/acdispat.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "acdispat.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dswstate")
similarity index 96%
rename from drivers/acpi/events/evevent.c
rename to drivers/acpi/acpica/evevent.c
index c56c5c6ea77b9d5c8cd0d35cc794aad5ed3ba16b..803edd9e3f6a65f853b31232b07d5719a787c7a2 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acevents.h>
+#include "accommon.h"
+#include "acevents.h"
 
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evevent")
@@ -72,8 +73,8 @@ acpi_status acpi_ev_initialize_events(void)
 
        /*
         * Initialize the Fixed and General Purpose Events. This is done prior to
-        * enabling SCIs to prevent interrupts from occurring before the handlers are
-        * installed.
+        * enabling SCIs to prevent interrupts from occurring before the handlers
+        * are installed.
         */
        status = acpi_ev_fixed_event_initialize();
        if (ACPI_FAILURE(status)) {
@@ -192,8 +193,8 @@ static acpi_status acpi_ev_fixed_event_initialize(void)
        acpi_status status;
 
        /*
-        * Initialize the structure that keeps track of fixed event handlers
-        * and enable the fixed events.
+        * Initialize the structure that keeps track of fixed event handlers and
+        * enable the fixed events.
         */
        for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
                acpi_gbl_fixed_event_handlers[i].handler = NULL;
@@ -237,7 +238,7 @@ u32 acpi_ev_fixed_event_detect(void)
 
        /*
         * Read the fixed feature status and enable registers, as all the cases
-        * depend on their values.  Ignore errors here.
+        * depend on their values. Ignore errors here.
         */
        (void)acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status);
        (void)acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable);
@@ -291,8 +292,8 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event)
                                status_register_id, 1);
 
        /*
-        * Make sure we've got a handler.  If not, report an error.
-        * The event is disabled to prevent further interrupts.
+        * Make sure we've got a handler. If not, report an error. The event is
+        * disabled to prevent further interrupts.
         */
        if (NULL == acpi_gbl_fixed_event_handlers[event].handler) {
                (void)acpi_set_register(acpi_gbl_fixed_event_info[event].
similarity index 94%
rename from drivers/acpi/events/evgpe.c
rename to drivers/acpi/acpica/evgpe.c
index f45c74fe745e59d1aee76512c7abfc4dbf0f6300..f345ced3647731f4365f4e8e657caec8aaac84d8 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acevents.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acevents.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evgpe")
@@ -125,7 +126,7 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info,
            (1 <<
             (gpe_event_info->gpe_number - gpe_register_info->base_gpe_number));
 
-       /* 1) Disable case.  Simply clear all enable bits */
+       /* 1) Disable case. Simply clear all enable bits */
 
        if (type == ACPI_GPE_DISABLE) {
                ACPI_CLEAR_BIT(gpe_register_info->enable_for_wake,
@@ -134,7 +135,7 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info,
                return_ACPI_STATUS(AE_OK);
        }
 
-       /* 2) Enable case.  Set/Clear the appropriate enable bits */
+       /* 2) Enable case. Set/Clear the appropriate enable bits */
 
        switch (gpe_event_info->flags & ACPI_GPE_TYPE_MASK) {
        case ACPI_GPE_TYPE_WAKE:
@@ -295,7 +296,7 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
  *
  * FUNCTION:    acpi_ev_get_gpe_event_info
  *
- * PARAMETERS:  gpe_device          - Device node.  NULL for GPE0/GPE1
+ * PARAMETERS:  gpe_device          - Device node. NULL for GPE0/GPE1
  *              gpe_number          - Raw GPE number
  *
  * RETURN:      A GPE event_info struct. NULL if not a valid GPE
@@ -372,7 +373,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
  *
  * RETURN:      INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
  *
- * DESCRIPTION: Detect if any GP events have occurred.  This function is
+ * DESCRIPTION: Detect if any GP events have occurred. This function is
  *              executed at interrupt level.
  *
  ******************************************************************************/
@@ -400,8 +401,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
 
        /*
         * We need to obtain the GPE lock for both the data structs and registers
-        * Note: Not necessary to obtain the hardware lock, since the GPE registers
-        * are owned by the gpe_lock.
+        * Note: Not necessary to obtain the hardware lock, since the GPE
+        * registers are owned by the gpe_lock.
         */
        flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
 
@@ -410,9 +411,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
        gpe_block = gpe_xrupt_list->gpe_block_list_head;
        while (gpe_block) {
                /*
-                * Read all of the 8-bit GPE status and enable registers
-                * in this GPE block, saving all of them.
-                * Find all currently active GP events.
+                * Read all of the 8-bit GPE status and enable registers in this GPE
+                * block, saving all of them. Find all currently active GP events.
                 */
                for (i = 0; i < gpe_block->register_count; i++) {
 
@@ -423,10 +423,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
                        /* Read the Status Register */
 
                        status =
-                           acpi_hw_low_level_read(ACPI_GPE_REGISTER_WIDTH,
-                                                  &status_reg,
-                                                  &gpe_register_info->
-                                                  status_address);
+                           acpi_read(&status_reg,
+                                     &gpe_register_info->status_address);
                        if (ACPI_FAILURE(status)) {
                                goto unlock_and_exit;
                        }
@@ -434,10 +432,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
                        /* Read the Enable Register */
 
                        status =
-                           acpi_hw_low_level_read(ACPI_GPE_REGISTER_WIDTH,
-                                                  &enable_reg,
-                                                  &gpe_register_info->
-                                                  enable_address);
+                           acpi_read(&enable_reg,
+                                     &gpe_register_info->enable_address);
                        if (ACPI_FAILURE(status)) {
                                goto unlock_and_exit;
                        }
@@ -527,8 +523,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
        (void)acpi_ev_enable_gpe(gpe_event_info, FALSE);
 
        /*
-        * Take a snapshot of the GPE info for this level - we copy the
-        * info to prevent a race condition with remove_handler/remove_block.
+        * Take a snapshot of the GPE info for this level - we copy the info to
+        * prevent a race condition with remove_handler/remove_block.
         */
        ACPI_MEMCPY(&local_gpe_event_info, gpe_event_info,
                    sizeof(struct acpi_gpe_event_info));
@@ -539,8 +535,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
        }
 
        /*
-        * Must check for control method type dispatch one more
-        * time to avoid race with ev_gpe_install_handler
+        * Must check for control method type dispatch one more time to avoid a
+        * race with ev_gpe_install_handler
         */
        if ((local_gpe_event_info.flags & ACPI_GPE_DISPATCH_MASK) ==
            ACPI_GPE_DISPATCH_METHOD) {
@@ -584,8 +580,8 @@ static void acpi_ev_asynch_enable_gpe(void *context)
        if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
            ACPI_GPE_LEVEL_TRIGGERED) {
                /*
-                * GPE is level-triggered, we clear the GPE status bit after
-                * handling the event.
+                * GPE is level-triggered, we clear the GPE status bit after handling
+                * the event.
                 */
                status = acpi_hw_clear_gpe(gpe_event_info);
                if (ACPI_FAILURE(status)) {
@@ -624,7 +620,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
        acpi_os_gpe_count(gpe_number);
 
        /*
-        * If edge-triggered, clear the GPE status bit now.  Note that
+        * If edge-triggered, clear the GPE status bit now. Note that
         * level-triggered events are cleared after the GPE is serviced.
         */
        if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
@@ -650,7 +646,8 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
 
                /*
                 * Invoke the installed handler (at interrupt level)
-                * Ignore return status for now.  TBD: leave GPE disabled on error?
+                * Ignore return status for now.
+                * TBD: leave GPE disabled on error?
                 */
                (void)gpe_event_info->dispatch.handler->address(gpe_event_info->
                                                                dispatch.
@@ -708,7 +705,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
                            gpe_number));
 
                /*
-                * Disable the GPE. The GPE will remain disabled until the ACPI
+                * Disable the GPE. The GPE will remain disabled until the ACPICA
                 * Core Subsystem is restarted, or a handler is installed.
                 */
                status = acpi_ev_disable_gpe(gpe_event_info);
similarity index 94%
rename from drivers/acpi/events/evgpeblk.c
rename to drivers/acpi/acpica/evgpeblk.c
index 73c058e2f5c213b9aa3b8e01f958bc7f81b52d26..484cc0565d5baffd708e93de337da6be4c0f9074 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acevents.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acevents.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evgpeblk")
@@ -124,6 +125,7 @@ u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info)
  * FUNCTION:    acpi_ev_walk_gpe_list
  *
  * PARAMETERS:  gpe_walk_callback   - Routine called for each GPE block
+ *              Context             - Value passed to callback
  *
  * RETURN:      Status
  *
@@ -131,7 +133,8 @@ u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info)
  *
  ******************************************************************************/
 
-acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback)
+acpi_status
+acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback, void *context)
 {
        struct acpi_gpe_block_info *gpe_block;
        struct acpi_gpe_xrupt_info *gpe_xrupt_info;
@@ -154,8 +157,13 @@ acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback)
 
                        /* One callback per GPE block */
 
-                       status = gpe_walk_callback(gpe_xrupt_info, gpe_block);
+                       status =
+                           gpe_walk_callback(gpe_xrupt_info, gpe_block,
+                                             context);
                        if (ACPI_FAILURE(status)) {
+                               if (status == AE_CTRL_END) {    /* Callback abort */
+                                       status = AE_OK;
+                               }
                                goto unlock_and_exit;
                        }
 
@@ -186,7 +194,8 @@ acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback)
 
 acpi_status
 acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
-                           struct acpi_gpe_block_info *gpe_block)
+                           struct acpi_gpe_block_info *gpe_block,
+                           void *context)
 {
        struct acpi_gpe_event_info *gpe_event_info;
        u32 i;
@@ -309,17 +318,17 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
             (gpe_block->block_base_number +
              (gpe_block->register_count * 8)))) {
                /*
-                * Not valid for this GPE block, just ignore it
-                * However, it may be valid for a different GPE block, since GPE0 and GPE1
-                * methods both appear under \_GPE.
+                * Not valid for this GPE block, just ignore it. However, it may be
+                * valid for a different GPE block, since GPE0 and GPE1 methods both
+                * appear under \_GPE.
                 */
                return_ACPI_STATUS(AE_OK);
        }
 
        /*
-        * Now we can add this information to the gpe_event_info block
-        * for use during dispatch of this GPE. Default type is RUNTIME, although
-        * this may change when the _PRW methods are executed later.
+        * Now we can add this information to the gpe_event_info block for use
+        * during dispatch of this GPE. Default type is RUNTIME, although this may
+        * change when the _PRW methods are executed later.
         */
        gpe_event_info =
            &gpe_block->event_info[gpe_number - gpe_block->block_base_number];
@@ -394,8 +403,8 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
        gpe_block = gpe_info->gpe_block;
 
        /*
-        * The _PRW object must return a package, we are only interested
-        * in the first element
+        * The _PRW object must return a package, we are only interested in the
+        * first element
         */
        obj_desc = pkg_desc->package.elements[0];
 
@@ -434,7 +443,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
        /*
         * Is this GPE within this block?
         *
-        * TRUE iff these conditions are true:
+        * TRUE if and only if these conditions are true:
         *     1) The GPE devices match.
         *     2) The GPE index(number) is within the range of the Gpe Block
         *          associated with the GPE device.
@@ -457,6 +466,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
                if (ACPI_FAILURE(status)) {
                        goto cleanup;
                }
+
                status =
                    acpi_ev_update_gpe_enable_masks(gpe_event_info,
                                                    ACPI_GPE_DISABLE);
@@ -476,9 +486,9 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
  * RETURN:      A GPE interrupt block
  *
  * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
- *              block per unique interrupt level used for GPEs.
- *              Should be called only when the GPE lists are semaphore locked
- *              and not subject to change.
+ *              block per unique interrupt level used for GPEs. Should be
+ *              called only when the GPE lists are semaphore locked and not
+ *              subject to change.
  *
  ******************************************************************************/
 
@@ -608,8 +618,9 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)
  *
  * FUNCTION:    acpi_ev_install_gpe_block
  *
- * PARAMETERS:  gpe_block       - New GPE block
- *              interrupt_number - Xrupt to be associated with this GPE block
+ * PARAMETERS:  gpe_block               - New GPE block
+ *              interrupt_number        - Xrupt to be associated with this
+ *                                        GPE block
  *
  * RETURN:      Status
  *
@@ -666,7 +677,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
  *
  * FUNCTION:    acpi_ev_delete_gpe_block
  *
- * PARAMETERS:  gpe_block       - Existing GPE block
+ * PARAMETERS:  gpe_block           - Existing GPE block
  *
  * RETURN:      Status
  *
@@ -688,7 +699,8 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
 
        /* Disable all GPEs in this block */
 
-       status = acpi_hw_disable_gpe_block(gpe_block->xrupt_block, gpe_block);
+       status =
+           acpi_hw_disable_gpe_block(gpe_block->xrupt_block, gpe_block, NULL);
 
        if (!gpe_block->previous && !gpe_block->next) {
 
@@ -715,6 +727,9 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
                acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
        }
 
+       acpi_current_gpe_count -=
+           gpe_block->register_count * ACPI_GPE_REGISTER_WIDTH;
+
        /* Free the gpe_block */
 
        ACPI_FREE(gpe_block->register_info);
@@ -786,9 +801,9 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
 
        /*
         * Initialize the GPE Register and Event structures. A goal of these
-        * tables is to hide the fact that there are two separate GPE register sets
-        * in a given GPE hardware block, the status registers occupy the first half,
-        * and the enable registers occupy the second half.
+        * tables is to hide the fact that there are two separate GPE register
+        * sets in a given GPE hardware block, the status registers occupy the
+        * first half, and the enable registers occupy the second half.
         */
        this_register = gpe_register_info;
        this_event = gpe_event_info;
@@ -816,10 +831,8 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
                    ACPI_GPE_REGISTER_WIDTH;
                this_register->enable_address.bit_width =
                    ACPI_GPE_REGISTER_WIDTH;
-               this_register->status_address.bit_offset =
-                   ACPI_GPE_REGISTER_WIDTH;
-               this_register->enable_address.bit_offset =
-                   ACPI_GPE_REGISTER_WIDTH;
+               this_register->status_address.bit_offset = 0;
+               this_register->enable_address.bit_offset = 0;
 
                /* Init the event_info for each GPE within this register */
 
@@ -832,18 +845,14 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
 
                /* Disable all GPEs within this register */
 
-               status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0x00,
-                                                &this_register->
-                                                enable_address);
+               status = acpi_write(0x00, &this_register->enable_address);
                if (ACPI_FAILURE(status)) {
                        goto error_exit;
                }
 
                /* Clear any pending GPE events within this register */
 
-               status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0xFF,
-                                                &this_register->
-                                                status_address);
+               status = acpi_write(0xFF, &this_register->status_address);
                if (ACPI_FAILURE(status)) {
                        goto error_exit;
                }
@@ -956,6 +965,9 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
                          gpe_device->name.ascii, gpe_block->register_count,
                          interrupt_number));
 
+       /* Update global count of currently available GPEs */
+
+       acpi_current_gpe_count += register_count * ACPI_GPE_REGISTER_WIDTH;
        return_ACPI_STATUS(AE_OK);
 }
 
@@ -1055,7 +1067,7 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
 
        /* Enable all valid runtime GPEs found above */
 
-       status = acpi_hw_enable_runtime_gpe_block(NULL, gpe_block);
+       status = acpi_hw_enable_runtime_gpe_block(NULL, gpe_block, NULL);
        if (ACPI_FAILURE(status)) {
                ACPI_ERROR((AE_INFO, "Could not enable GPEs in GpeBlock %p",
                            gpe_block));
similarity index 93%
rename from drivers/acpi/events/evmisc.c
rename to drivers/acpi/acpica/evmisc.c
index 1d5670be729ab3cc13e8d57c639463adce8788dc..5f893057bcc617909cb08294089e6f0e98f9dc53 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acevents.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acevents.h"
+#include "acnamesp.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evmisc")
 
-/* Pointer to FACS needed for the Global Lock */
-static struct acpi_table_facs *facs = NULL;
-
 /* Local prototypes */
-
 static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context);
 
 static u32 acpi_ev_global_lock_handler(void *context);
@@ -152,7 +149,9 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
                        break;
 
                default:
+
                        /* All other types are not supported */
+
                        return (AE_TYPE);
                }
        }
@@ -193,9 +192,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
                        acpi_ut_delete_generic_state(notify_info);
                }
        } else {
-               /*
-                * There is no notify handler (per-device or system) for this device.
-                */
+               /* There is no notify handler (per-device or system) for this device */
+
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "No notify handler for Notify (%4.4s, %X) node %p\n",
                                  acpi_ut_get_node_name(node), notify_value,
@@ -229,9 +227,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context)
        ACPI_FUNCTION_ENTRY();
 
        /*
-        * We will invoke a global notify handler if installed.
-        * This is done _before_ we invoke the per-device handler attached
-        * to the device.
+        * We will invoke a global notify handler if installed. This is done
+        * _before_ we invoke the per-device handler attached to the device.
         */
        if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) {
 
@@ -299,7 +296,7 @@ static u32 acpi_ev_global_lock_handler(void *context)
         * If we don't get it now, it will be marked pending and we will
         * take another interrupt when it becomes free.
         */
-       ACPI_ACQUIRE_GLOBAL_LOCK(facs, acquired);
+       ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_FACS, acquired);
        if (acquired) {
 
                /* Got the lock, now wake all threads waiting for it */
@@ -336,34 +333,27 @@ acpi_status acpi_ev_init_global_lock_handler(void)
 
        ACPI_FUNCTION_TRACE(ev_init_global_lock_handler);
 
-       status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
-                                        ACPI_CAST_INDIRECT_PTR(struct
-                                                               acpi_table_header,
-                                                               &facs));
-       if (ACPI_FAILURE(status)) {
-               return_ACPI_STATUS(status);
-       }
+       /* Attempt installation of the global lock handler */
 
-       acpi_gbl_global_lock_present = TRUE;
        status = acpi_install_fixed_event_handler(ACPI_EVENT_GLOBAL,
                                                  acpi_ev_global_lock_handler,
                                                  NULL);
 
        /*
-        * If the global lock does not exist on this platform, the attempt
-        * to enable GBL_STATUS will fail (the GBL_ENABLE bit will not stick)
-        * Map to AE_OK, but mark global lock as not present.
-        * Any attempt to actually use the global lock will be flagged
-        * with an error.
+        * If the global lock does not exist on this platform, the attempt to
+        * enable GBL_STATUS will fail (the GBL_ENABLE bit will not stick).
+        * Map to AE_OK, but mark global lock as not present. Any attempt to
+        * actually use the global lock will be flagged with an error.
         */
        if (status == AE_NO_HARDWARE_RESPONSE) {
                ACPI_ERROR((AE_INFO,
                            "No response from Global Lock hardware, disabling lock"));
 
                acpi_gbl_global_lock_present = FALSE;
-               status = AE_OK;
+               return_ACPI_STATUS(AE_OK);
        }
 
+       acpi_gbl_global_lock_present = TRUE;
        return_ACPI_STATUS(status);
 }
 
@@ -462,8 +452,8 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
        }
 
        /*
-        * Make sure that a global lock actually exists. If not, just treat
-        * the lock as a standard mutex.
+        * Make sure that a global lock actually exists. If not, just treat the
+        * lock as a standard mutex.
         */
        if (!acpi_gbl_global_lock_present) {
                acpi_gbl_global_lock_acquired = TRUE;
@@ -472,7 +462,7 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
 
        /* Attempt to acquire the actual hardware lock */
 
-       ACPI_ACQUIRE_GLOBAL_LOCK(facs, acquired);
+       ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_FACS, acquired);
        if (acquired) {
 
                /* We got the lock */
@@ -536,7 +526,7 @@ acpi_status acpi_ev_release_global_lock(void)
 
                /* Allow any thread to release the lock */
 
-               ACPI_RELEASE_GLOBAL_LOCK(facs, pending);
+               ACPI_RELEASE_GLOBAL_LOCK(acpi_gbl_FACS, pending);
 
                /*
                 * If the pending bit was set, we must write GBL_RLS to the control
@@ -582,8 +572,8 @@ void acpi_ev_terminate(void)
 
        if (acpi_gbl_events_initialized) {
                /*
-                * Disable all event-related functionality.
-                * In all cases, on error, print a message but obviously we don't abort.
+                * Disable all event-related functionality. In all cases, on error,
+                * print a message but obviously we don't abort.
                 */
 
                /* Disable all fixed events */
@@ -599,7 +589,7 @@ void acpi_ev_terminate(void)
 
                /* Disable all GPEs in all GPE blocks */
 
-               status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block);
+               status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL);
 
                /* Remove SCI handler */
 
@@ -617,7 +607,7 @@ void acpi_ev_terminate(void)
 
        /* Deallocate all handler objects installed within GPE info structs */
 
-       status = acpi_ev_walk_gpe_list(acpi_ev_delete_gpe_handlers);
+       status = acpi_ev_walk_gpe_list(acpi_ev_delete_gpe_handlers, NULL);
 
        /* Return to original mode if necessary */
 
similarity index 91%
rename from drivers/acpi/events/evregion.c
rename to drivers/acpi/acpica/evregion.c
index 236fbd1ca438ae35c1cff68c76cc0df69556b82f..665c0887ab4de9af51e4414106539058e9bc909b 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acevents.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acevents.h"
+#include "acnamesp.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evregion")
-#define ACPI_NUM_DEFAULT_SPACES     4
-static u8 acpi_gbl_default_address_spaces[ACPI_NUM_DEFAULT_SPACES] = {
-       ACPI_ADR_SPACE_SYSTEM_MEMORY,
-       ACPI_ADR_SPACE_SYSTEM_IO,
-       ACPI_ADR_SPACE_PCI_CONFIG,
-       ACPI_ADR_SPACE_DATA_TABLE
-};
 
 /* Local prototypes */
-
 static acpi_status
 acpi_ev_reg_run(acpi_handle obj_handle,
                u32 level, void *context, void **return_value);
@@ -66,6 +59,17 @@ static acpi_status
 acpi_ev_install_handler(acpi_handle obj_handle,
                        u32 level, void *context, void **return_value);
 
+/* These are the address spaces that will get default handlers */
+
+#define ACPI_NUM_DEFAULT_SPACES     4
+
+static u8 acpi_gbl_default_address_spaces[ACPI_NUM_DEFAULT_SPACES] = {
+       ACPI_ADR_SPACE_SYSTEM_MEMORY,
+       ACPI_ADR_SPACE_SYSTEM_IO,
+       ACPI_ADR_SPACE_PCI_CONFIG,
+       ACPI_ADR_SPACE_DATA_TABLE
+};
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ev_install_region_handlers
@@ -91,18 +95,19 @@ acpi_status acpi_ev_install_region_handlers(void)
        }
 
        /*
-        * All address spaces (PCI Config, EC, SMBus) are scope dependent
-        * and registration must occur for a specific device.
+        * All address spaces (PCI Config, EC, SMBus) are scope dependent and
+        * registration must occur for a specific device.
         *
-        * In the case of the system memory and IO address spaces there is currently
-        * no device associated with the address space.  For these we use the root.
+        * In the case of the system memory and IO address spaces there is
+        * currently no device associated with the address space. For these we
+        * use the root.
         *
-        * We install the default PCI config space handler at the root so
-        * that this space is immediately available even though the we have
-        * not enumerated all the PCI Root Buses yet.  This is to conform
-        * to the ACPI specification which states that the PCI config
-        * space must be always available -- even though we are nowhere
-        * near ready to find the PCI root buses at this point.
+        * We install the default PCI config space handler at the root so that
+        * this space is immediately available even though the we have not
+        * enumerated all the PCI Root Buses yet. This is to conform to the ACPI
+        * specification which states that the PCI config space must be always
+        * available -- even though we are nowhere near ready to find the PCI root
+        * buses at this point.
         *
         * NOTE: We ignore AE_ALREADY_EXISTS because this means that a handler
         * has already been installed (via acpi_install_address_space_handler).
@@ -160,12 +165,11 @@ acpi_status acpi_ev_initialize_op_regions(void)
                return_ACPI_STATUS(status);
        }
 
-       /*
-        * Run the _REG methods for op_regions in each default address space
-        */
-       for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++) {
+       /* Run the _REG methods for op_regions in each default address space */
 
-               /* TBD: Make sure handler is the DEFAULT handler, otherwise
+       for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++) {
+               /*
+                * TBD: Make sure handler is the DEFAULT handler, otherwise
                 * _REG will have already been run.
                 */
                status = acpi_ev_execute_reg_methods(acpi_gbl_root_node,
@@ -318,13 +322,13 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
        }
 
        /*
-        * It may be the case that the region has never been initialized
+        * It may be the case that the region has never been initialized.
         * Some types of regions require special init code
         */
        if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) {
-               /*
-                * This region has not been initialized yet, do it
-                */
+
+               /* This region has not been initialized yet, do it */
+
                region_setup = handler_desc->address_space.setup;
                if (!region_setup) {
 
@@ -339,9 +343,9 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                }
 
                /*
-                * We must exit the interpreter because the region
-                * setup will potentially execute control methods
-                * (e.g., _REG method for this region)
+                * We must exit the interpreter because the region setup will
+                * potentially execute control methods (for example, the _REG method
+                * for this region)
                 */
                acpi_ex_exit_interpreter();
 
@@ -364,9 +368,8 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                        return_ACPI_STATUS(status);
                }
 
-               /*
-                * Region initialization may have been completed by region_setup
-                */
+               /* Region initialization may have been completed by region_setup */
+
                if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) {
                        region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE;
 
@@ -521,8 +524,8 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
                        }
 
                        /*
-                        * If the region has been activated, call the setup handler
-                        * with the deactivate notification
+                        * If the region has been activated, call the setup handler with
+                        * the deactivate notification
                         */
                        if (region_obj->region.flags & AOPOBJ_SETUP_COMPLETE) {
                                region_setup = handler_obj->address_space.setup;
@@ -668,8 +671,8 @@ acpi_ev_install_handler(acpi_handle obj_handle,
        }
 
        /*
-        * We only care about regions.and objects
-        * that are allowed to have address space handlers
+        * We only care about regions and objects that are allowed to have
+        * address space handlers
         */
        if ((node->type != ACPI_TYPE_DEVICE) &&
            (node->type != ACPI_TYPE_REGION) && (node != acpi_gbl_root_node)) {
@@ -710,9 +713,9 @@ acpi_ev_install_handler(acpi_handle obj_handle,
                                /*
                                 * Since the object we found it on was a device, then it
                                 * means that someone has already installed a handler for
-                                * the branch of the namespace from this device on.  Just
+                                * the branch of the namespace from this device on. Just
                                 * bail out telling the walk routine to not traverse this
-                                * branch.  This preserves the scoping rule for handlers.
+                                * branch. This preserves the scoping rule for handlers.
                                 */
                                return (AE_CTRL_DEPTH);
                        }
@@ -723,9 +726,8 @@ acpi_ev_install_handler(acpi_handle obj_handle,
                }
 
                /*
-                * As long as the device didn't have a handler for this
-                * space we don't care about it.  We just ignore it and
-                * proceed.
+                * As long as the device didn't have a handler for this space we
+                * don't care about it. We just ignore it and proceed.
                 */
                return (AE_OK);
        }
@@ -733,16 +735,14 @@ acpi_ev_install_handler(acpi_handle obj_handle,
        /* Object is a Region */
 
        if (obj_desc->region.space_id != handler_obj->address_space.space_id) {
-               /*
-                * This region is for a different address space
-                * -- just ignore it
-                */
+
+               /* This region is for a different address space, just ignore it */
+
                return (AE_OK);
        }
 
        /*
-        * Now we have a region and it is for the handler's address
-        * space type.
+        * Now we have a region and it is for the handler's address space type.
         *
         * First disconnect region for any previous handler (if any)
         */
@@ -786,9 +786,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
        ACPI_FUNCTION_TRACE(ev_install_space_handler);
 
        /*
-        * This registration is valid for only the types below
-        * and the root.  This is where the default handlers
-        * get placed.
+        * This registration is valid for only the types below and the root. This
+        * is where the default handlers get placed.
         */
        if ((node->type != ACPI_TYPE_DEVICE) &&
            (node->type != ACPI_TYPE_PROCESSOR) &&
@@ -848,8 +847,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
        obj_desc = acpi_ns_get_attached_object(node);
        if (obj_desc) {
                /*
-                * The attached device object already exists.
-                * Make sure the handler is not already installed.
+                * The attached device object already exists. Make sure the handler
+                * is not already installed.
                 */
                handler_obj = obj_desc->device.handler;
 
@@ -864,8 +863,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
                                    handler) {
                                        /*
                                         * It is (relatively) OK to attempt to install the SAME
-                                        * handler twice. This can easily happen
-                                        * with PCI_Config space.
+                                        * handler twice. This can easily happen with the
+                                        * PCI_Config space.
                                         */
                                        status = AE_SAME_HANDLER;
                                        goto unlock_and_exit;
@@ -925,9 +924,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
        /*
         * Install the handler
         *
-        * At this point there is no existing handler.
-        * Just allocate the object for the handler and link it
-        * into the list.
+        * At this point there is no existing handler. Just allocate the object
+        * for the handler and link it into the list.
         */
        handler_obj =
            acpi_ut_create_internal_object(ACPI_TYPE_LOCAL_ADDRESS_HANDLER);
@@ -1000,11 +998,10 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
        ACPI_FUNCTION_TRACE(ev_execute_reg_methods);
 
        /*
-        * Run all _REG methods for all Operation Regions for this
-        * space ID.  This is a separate walk in order to handle any
-        * interdependencies between regions and _REG methods.  (i.e. handlers
-        * must be installed for all regions of this Space ID before we
-        * can run any _REG methods)
+        * Run all _REG methods for all Operation Regions for this space ID. This
+        * is a separate walk in order to handle any interdependencies between
+        * regions and _REG methods. (i.e. handlers must be installed for all
+        * regions of this Space ID before we can run any _REG methods)
         */
        status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, node, ACPI_UINT32_MAX,
                                        ACPI_NS_WALK_UNLOCK, acpi_ev_reg_run,
@@ -1042,8 +1039,8 @@ acpi_ev_reg_run(acpi_handle obj_handle,
        }
 
        /*
-        * We only care about regions.and objects
-        * that are allowed to have address space handlers
+        * We only care about regions.and objects that are allowed to have address
+        * space handlers
         */
        if ((node->type != ACPI_TYPE_REGION) && (node != acpi_gbl_root_node)) {
                return (AE_OK);
@@ -1062,10 +1059,9 @@ acpi_ev_reg_run(acpi_handle obj_handle,
        /* Object is a Region */
 
        if (obj_desc->region.space_id != space_id) {
-               /*
-                * This region is for a different address space
-                * -- just ignore it
-                */
+
+               /* This region is for a different address space, just ignore it */
+
                return (AE_OK);
        }
 
similarity index 95%
rename from drivers/acpi/events/evrgnini.c
rename to drivers/acpi/acpica/evrgnini.c
index 6b94b38df07dd30b77580af0459c81e640776d29..f3f1fb45c3dcd542bcbb871960d060fbb15a304b 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acevents.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acevents.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evrgnini")
@@ -233,9 +234,9 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
                                if (ACPI_FAILURE(status)) {
                                        if (status == AE_SAME_HANDLER) {
                                                /*
-                                                * It is OK if the handler is already installed on the root
-                                                * bridge.  Still need to return a context object for the
-                                                * new PCI_Config operation region, however.
+                                                * It is OK if the handler is already installed on the
+                                                * root bridge. Still need to return a context object
+                                                * for the new PCI_Config operation region, however.
                                                 */
                                                status = AE_OK;
                                        } else {
@@ -272,8 +273,8 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
        }
 
        /*
-        * For PCI_Config space access, we need the segment, bus,
-        * device and function numbers.  Acquire them here.
+        * For PCI_Config space access, we need the segment, bus, device and
+        * function numbers. Acquire them here.
         *
         * Find the parent device object. (This allows the operation region to be
         * within a subscope under the device, such as a control method.)
@@ -289,16 +290,16 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
        }
 
        /*
-        * Get the PCI device and function numbers from the _ADR object
-        * contained in the parent's scope.
+        * Get the PCI device and function numbers from the _ADR object contained
+        * in the parent's scope.
         */
        status =
            acpi_ut_evaluate_numeric_object(METHOD_NAME__ADR, pci_device_node,
                                            &pci_value);
 
        /*
-        * The default is zero, and since the allocation above zeroed
-        * the data, just do nothing on failure.
+        * The default is zero, and since the allocation above zeroed the data,
+        * just do nothing on failure.
         */
        if (ACPI_SUCCESS(status)) {
                pci_id->device = ACPI_HIWORD(ACPI_LODWORD(pci_value));
@@ -382,9 +383,8 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
        struct acpi_compatible_id_list *cid;
        u32 i;
 
-       /*
-        * Get the _HID and check for a PCI Root Bridge
-        */
+       /* Get the _HID and check for a PCI Root Bridge */
+
        status = acpi_ut_execute_HID(node, &hid);
        if (ACPI_FAILURE(status)) {
                return (FALSE);
@@ -394,10 +394,8 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
                return (TRUE);
        }
 
-       /*
-        * The _HID did not match.
-        * Get the _CID and check for a PCI Root Bridge
-        */
+       /* The _HID did not match. Get the _CID and check for a PCI Root Bridge */
+
        status = acpi_ut_execute_CID(node, &cid);
        if (ACPI_FAILURE(status)) {
                return (FALSE);
@@ -516,9 +514,9 @@ acpi_ev_default_region_setup(acpi_handle handle,
  *              Get the appropriate address space handler for a newly
  *              created region.
  *
- *              This also performs address space specific initialization.  For
+ *              This also performs address space specific initialization. For
  *              example, PCI regions must have an _ADR object that contains
- *              a PCI address in the scope of the definition.  This address is
+ *              a PCI address in the scope of the definition. This address is
  *              required to perform an access to PCI config space.
  *
  * MUTEX:       Interpreter should be unlocked, because we may run the _REG
@@ -572,7 +570,7 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
        if (ACPI_SUCCESS(status)) {
                /*
                 * The _REG method is optional and there can be only one per region
-                * definition.  This will be executed when the handler is attached
+                * definition. This will be executed when the handler is attached
                 * or removed
                 */
                region_obj2->extra.method_REG = method_node;
@@ -670,10 +668,8 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
                        }
                }
 
-               /*
-                * This node does not have the handler we need;
-                * Pop up one level
-                */
+               /* This node does not have the handler we need; Pop up one level */
+
                node = acpi_ns_get_parent_node(node);
        }
 
similarity index 95%
rename from drivers/acpi/events/evsci.c
rename to drivers/acpi/acpica/evsci.c
index 2a8b77877610a13df05762d10a9a77ce4adf8eb1..567b356c85affb780175f5009ebbb12faa0cb8db 100644 (file)
@@ -43,7 +43,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acevents.h>
+#include "accommon.h"
+#include "acevents.h"
 
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evsci")
@@ -115,10 +116,8 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context)
         * if this interrupt handler is installed, ACPI is enabled.
         */
 
-       /*
-        * GPEs:
-        * Check for and dispatch any GPEs that have occurred
-        */
+       /* GPEs: Check for and dispatch any GPEs that have occurred */
+
        interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
 
        return_UINT32(interrupt_handled);
@@ -158,11 +157,11 @@ u32 acpi_ev_install_sci_handler(void)
  * RETURN:      E_OK if handler uninstalled OK, E_ERROR if handler was not
  *              installed to begin with
  *
- * DESCRIPTION: Remove the SCI interrupt handler.  No further SCIs will be
+ * DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be
  *              taken.
  *
  * Note:  It doesn't seem important to disable all events or set the event
- *        enable registers to their original values.  The OS should disable
+ *        enable registers to their original values. The OS should disable
  *        the SCI interrupt level when the handler is removed, so no more
  *        events will come in.
  *
similarity index 99%
rename from drivers/acpi/events/evxface.c
rename to drivers/acpi/acpica/evxface.c
index 94a6efe020bed116118c408e92f35f30a0d23a2e..3aca9010a11eb16f4ded8775e009ae99cb010bf9 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acevents.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "acevents.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evxface")
@@ -267,7 +268,7 @@ acpi_install_notify_handler(acpi_handle device,
        /*
         * Root Object:
         * Registering a notify handler on the root object indicates that the
-        * caller wishes to receive notifications for all objects.  Note that
+        * caller wishes to receive notifications for all objects. Note that
         * only one <external> global handler can be regsitered (per notify type).
         */
        if (device == ACPI_ROOT_OBJECT) {
similarity index 81%
rename from drivers/acpi/events/evxfevnt.c
rename to drivers/acpi/acpica/evxfevnt.c
index 41554f736b682700b3830a955cfd12e45e13b5a5..35485e4b60a67df4d5a09e8cd8aa1e2cbe3b1000 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acevents.h>
-#include <acpi/acnamesp.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "acevents.h"
+#include "acnamesp.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evxfevnt")
 
+/* Local prototypes */
+acpi_status
+acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
+                      struct acpi_gpe_block_info *gpe_block, void *context);
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_enable
@@ -60,6 +66,7 @@ ACPI_MODULE_NAME("evxfevnt")
  * DESCRIPTION: Transfers the system into ACPI mode.
  *
  ******************************************************************************/
+
 acpi_status acpi_enable(void)
 {
        acpi_status status = AE_OK;
@@ -161,8 +168,8 @@ acpi_status acpi_enable_event(u32 event, u32 flags)
        }
 
        /*
-        * Enable the requested fixed event (by writing a one to the
-        * enable register bit)
+        * Enable the requested fixed event (by writing a one to the enable
+        * register bit)
         */
        status =
            acpi_set_register(acpi_gbl_fixed_event_info[event].
@@ -343,8 +350,8 @@ acpi_status acpi_disable_event(u32 event, u32 flags)
        }
 
        /*
-        * Disable the requested fixed event (by writing a zero to the
-        * enable register bit)
+        * Disable the requested fixed event (by writing a zero to the enable
+        * register bit)
         */
        status =
            acpi_set_register(acpi_gbl_fixed_event_info[event].
@@ -396,8 +403,8 @@ acpi_status acpi_clear_event(u32 event)
        }
 
        /*
-        * Clear the requested fixed event (By writing a one to the
-        * status register bit)
+        * Clear the requested fixed event (By writing a one to the status
+        * register bit)
         */
        status =
            acpi_set_register(acpi_gbl_fixed_event_info[event].
@@ -717,3 +724,148 @@ acpi_status acpi_remove_gpe_block(acpi_handle gpe_device)
 }
 
 ACPI_EXPORT_SYMBOL(acpi_remove_gpe_block)
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_get_gpe_device
+ *
+ * PARAMETERS:  Index               - System GPE index (0-current_gpe_count)
+ *              gpe_device          - Where the parent GPE Device is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Obtain the GPE device associated with the input index. A NULL
+ *              gpe device indicates that the gpe number is contained in one of
+ *              the FADT-defined gpe blocks. Otherwise, the GPE block device.
+ *
+ ******************************************************************************/
+acpi_status
+acpi_get_gpe_device(u32 index, acpi_handle *gpe_device)
+{
+       struct acpi_gpe_device_info info;
+       acpi_status status;
+
+       ACPI_FUNCTION_TRACE(acpi_get_gpe_device);
+
+       if (!gpe_device) {
+               return_ACPI_STATUS(AE_BAD_PARAMETER);
+       }
+
+       if (index >= acpi_current_gpe_count) {
+               return_ACPI_STATUS(AE_NOT_EXIST);
+       }
+
+       /* Setup and walk the GPE list */
+
+       info.index = index;
+       info.status = AE_NOT_EXIST;
+       info.gpe_device = NULL;
+       info.next_block_base_index = 0;
+
+       status = acpi_ev_walk_gpe_list(acpi_ev_get_gpe_device, &info);
+       if (ACPI_FAILURE(status)) {
+               return_ACPI_STATUS(status);
+       }
+
+       *gpe_device = info.gpe_device;
+       return_ACPI_STATUS(info.status);
+}
+
+ACPI_EXPORT_SYMBOL(acpi_get_gpe_device)
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ev_get_gpe_device
+ *
+ * PARAMETERS:  GPE_WALK_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Matches the input GPE index (0-current_gpe_count) with a GPE
+ *              block device. NULL if the GPE is one of the FADT-defined GPEs.
+ *
+ ******************************************************************************/
+acpi_status
+acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
+                      struct acpi_gpe_block_info *gpe_block, void *context)
+{
+       struct acpi_gpe_device_info *info = context;
+
+       /* Increment Index by the number of GPEs in this block */
+
+       info->next_block_base_index +=
+           (gpe_block->register_count * ACPI_GPE_REGISTER_WIDTH);
+
+       if (info->index < info->next_block_base_index) {
+               /*
+                * The GPE index is within this block, get the node. Leave the node
+                * NULL for the FADT-defined GPEs
+                */
+               if ((gpe_block->node)->type == ACPI_TYPE_DEVICE) {
+                       info->gpe_device = gpe_block->node;
+               }
+
+               info->status = AE_OK;
+               return (AE_CTRL_END);
+       }
+
+       return (AE_OK);
+}
+
+/******************************************************************************
+ *
+ * FUNCTION:    acpi_disable_all_gpes
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Disable and clear all GPEs in all GPE blocks
+ *
+ ******************************************************************************/
+
+acpi_status acpi_disable_all_gpes(void)
+{
+       acpi_status status;
+
+       ACPI_FUNCTION_TRACE(acpi_disable_all_gpes);
+
+       status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
+       if (ACPI_FAILURE(status)) {
+               return_ACPI_STATUS(status);
+       }
+
+       status = acpi_hw_disable_all_gpes();
+       (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+
+       return_ACPI_STATUS(status);
+}
+
+/******************************************************************************
+ *
+ * FUNCTION:    acpi_enable_all_runtime_gpes
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks
+ *
+ ******************************************************************************/
+
+acpi_status acpi_enable_all_runtime_gpes(void)
+{
+       acpi_status status;
+
+       ACPI_FUNCTION_TRACE(acpi_enable_all_runtime_gpes);
+
+       status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
+       if (ACPI_FAILURE(status)) {
+               return_ACPI_STATUS(status);
+       }
+
+       status = acpi_hw_enable_all_runtime_gpes();
+       (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+
+       return_ACPI_STATUS(status);
+}
similarity index 99%
rename from drivers/acpi/events/evxfregn.c
rename to drivers/acpi/acpica/evxfregn.c
index e8750807e57d004151fab56cc56198f73acb29b6..479e7a3721be2b59045d97347bf21eea58f03687 100644 (file)
@@ -43,8 +43,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acevents.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "acevents.h"
 
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evxfregn")
similarity index 99%
rename from drivers/acpi/executer/exconfig.c
rename to drivers/acpi/acpica/exconfig.c
index 74da6fa52ef183e4db2b3e9db7b24c7d75da5f12..932bbc26aa048322c843b9be95b355ee1ecb9cbd 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
-#include <acpi/actables.h>
-#include <acpi/acdispat.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "acnamesp.h"
+#include "actables.h"
+#include "acdispat.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exconfig")
similarity index 99%
rename from drivers/acpi/executer/exconvrt.c
rename to drivers/acpi/acpica/exconvrt.c
index 1d1f35adddde65cfd0558ff4a2be97f087759c95..0be10188316e0091fa83d11715eaba690ce19313 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/amlcode.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exconvrt")
similarity index 99%
rename from drivers/acpi/executer/excreate.c
rename to drivers/acpi/acpica/excreate.c
index ad09696d50690c7116a3eb741dd3d92cb9a49f4d..a57ad2564ab0c7c66a1594601efcf161971dd4be 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/amlcode.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "amlcode.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("excreate")
similarity index 99%
rename from drivers/acpi/executer/exdump.c
rename to drivers/acpi/acpica/exdump.c
index d087a7d28aa53f34173cb7d64d688db119017086..aa313574b0df5066eb7e367080b073e82799b698 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/amlcode.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "amlcode.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exdump")
similarity index 99%
rename from drivers/acpi/executer/exfield.c
rename to drivers/acpi/acpica/exfield.c
index 3e440d84226a4e85aea18a5b49156145e1bfbfd7..a352d0233857dbf461c85f96038d9a247107005e 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acdispat.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exfield")
similarity index 98%
rename from drivers/acpi/executer/exfldio.c
rename to drivers/acpi/acpica/exfldio.c
index 9ff9d1f4615d8841eac8650bf4605e7e3cfb24fa..ef58ac4e687b8bd8f0e170647e0d2afe12abc525 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/amlcode.h>
-#include <acpi/acevents.h>
-#include <acpi/acdispat.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "amlcode.h"
+#include "acevents.h"
+#include "acdispat.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exfldio")
@@ -498,14 +499,13 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc,
                        return_ACPI_STATUS(status);
                }
 
-               ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
-                                 "I/O to Data Register: ValuePtr %p\n",
-                                 value));
-
                if (read_write == ACPI_READ) {
 
                        /* Read the datum from the data_register */
 
+                       ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
+                                         "Read from Data Register\n"));
+
                        status =
                            acpi_ex_extract_from_field(obj_desc->index_field.
                                                       data_obj, value,
@@ -513,6 +513,10 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc,
                } else {
                        /* Write the datum to the data_register */
 
+                       ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
+                                         "Write to Data Register: Value %8.8X%8.8X\n",
+                                         ACPI_FORMAT_UINT64(*value)));
+
                        status =
                            acpi_ex_insert_into_field(obj_desc->index_field.
                                                      data_obj, value,
similarity index 99%
rename from drivers/acpi/executer/exmisc.c
rename to drivers/acpi/acpica/exmisc.c
index efb19134005951cb8adce2b7b473c8734b44b610..6b0747ac683b37edf6967c2aaec1790027173e19 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/amlcode.h>
-#include <acpi/amlresrc.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "amlcode.h"
+#include "amlresrc.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exmisc")
similarity index 99%
rename from drivers/acpi/executer/exmutex.c
rename to drivers/acpi/acpica/exmutex.c
index a8bf3d713e2821db5c6e32588f4cc52f38e326bc..d301c1f363ef0fceb3749ee679d8f1366ec7fb32 100644 (file)
@@ -43,8 +43,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/acevents.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "acevents.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exmutex")
similarity index 99%
rename from drivers/acpi/executer/exnames.c
rename to drivers/acpi/acpica/exnames.c
index 817e67be36977c12aa7db442217ecf25c87676f3..ffdae122d94af6e365aca484d95678b77d81e759 100644 (file)
@@ -43,8 +43,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/amlcode.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exnames")
similarity index 99%
rename from drivers/acpi/executer/exoparg1.c
rename to drivers/acpi/acpica/exoparg1.c
index f622f9eac8a1a85bfe0bfb4afbed5854b5435609..b530480cc7d55a7792c644d5d5c7a885a9e28dcd 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
-#include <acpi/amlcode.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "acdispat.h"
+#include "acinterp.h"
+#include "amlcode.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exoparg1")
similarity index 99%
rename from drivers/acpi/executer/exoparg2.c
rename to drivers/acpi/acpica/exoparg2.c
index 368def5dffceb0ffc47be5866d640b83e18f6c53..0b4f513ca885342fc9fc1cffb511d8e1f5e2a6c7 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/acinterp.h>
-#include <acpi/acevents.h>
-#include <acpi/amlcode.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "acinterp.h"
+#include "acevents.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exoparg2")
similarity index 98%
rename from drivers/acpi/executer/exoparg3.c
rename to drivers/acpi/acpica/exoparg3.c
index 9cb4197681af11a6d7e2d59904781cb3e0cee05e..c6520bbf882bae57da1257669a587fb9d4ef4b17 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/acparser.h>
-#include <acpi/amlcode.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "acparser.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exoparg3")
similarity index 99%
rename from drivers/acpi/executer/exoparg6.c
rename to drivers/acpi/acpica/exoparg6.c
index 67d48737af5360011b7facec5aa909d62f2d9425..ae43f7670a6c34fa576a1873c653dbda9151020c 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/acparser.h>
-#include <acpi/amlcode.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "acparser.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exoparg6")
similarity index 99%
rename from drivers/acpi/executer/exprep.c
rename to drivers/acpi/acpica/exprep.c
index 5d438c32989d892be3d41b08e738c167ff1ad3c2..33c66eb3ae39134b1d75181f1da80f9ff7300d36 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/amlcode.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "amlcode.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exprep")
similarity index 99%
rename from drivers/acpi/executer/exregion.c
rename to drivers/acpi/acpica/exregion.c
index 7a41c409ae4d89e14165c8f28bdc131d88d1b5e1..76ec8ff903b8e1f766bf550953303652dfdd85cb 100644 (file)
@@ -43,7 +43,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exregion")
similarity index 98%
rename from drivers/acpi/executer/exresnte.c
rename to drivers/acpi/acpica/exresnte.c
index 423ad3635f3d0aa702e8d5f3652ecf0b572af954..a063a74006f69572d37b7cf4596dea301336b63d 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acdispat.h"
+#include "acinterp.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exresnte")
similarity index 99%
rename from drivers/acpi/executer/exresolv.c
rename to drivers/acpi/acpica/exresolv.c
index 89571b92a52279258812e7cc6f93ad5024acc28b..3673d2b2c4ac07a592479b0585131a5408e8a164 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/amlcode.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "amlcode.h"
+#include "acdispat.h"
+#include "acinterp.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exresolv")
similarity index 99%
rename from drivers/acpi/executer/exresop.c
rename to drivers/acpi/acpica/exresop.c
index 0bb82593da724d62ca766a2a843827a9cf33376c..3c3802764bfbe828dee9a9d1db7c71d37766c634 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/amlcode.h>
-#include <acpi/acparser.h>
-#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "amlcode.h"
+#include "acparser.h"
+#include "acinterp.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exresop")
similarity index 99%
rename from drivers/acpi/executer/exstore.c
rename to drivers/acpi/acpica/exstore.c
index 3318df4cbd989191fc46de95e3cbd209ccf0f525..7c6d7e53e41e7a26ce81f49114da8263db77d003 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
-#include <acpi/amlcode.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acdispat.h"
+#include "acinterp.h"
+#include "amlcode.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exstore")
similarity index 99%
rename from drivers/acpi/executer/exstoren.c
rename to drivers/acpi/acpica/exstoren.c
index eef61a00803edf560bf2917e1cf66d7c8587e9cc..145d15305f70a6d860d668e87cedc7b7e70ba713 100644 (file)
@@ -44,8 +44,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/amlcode.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exstoren")
similarity index 99%
rename from drivers/acpi/executer/exstorob.c
rename to drivers/acpi/acpica/exstorob.c
index 9a75ff09fb0c46b38bf849261d6b860949251cf7..67340cc70142209d1aa97ae360b21587cefc321b 100644 (file)
@@ -43,7 +43,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exstorob")
similarity index 99%
rename from drivers/acpi/executer/exsystem.c
rename to drivers/acpi/acpica/exsystem.c
index 68990f1df371df76886f196ecbc5d42a7a867da3..3d00b9357233a56ee0d4ff00f96cbd54c7b2560a 100644 (file)
@@ -43,7 +43,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exsystem")
similarity index 99%
rename from drivers/acpi/executer/exutils.c
rename to drivers/acpi/acpica/exutils.c
index 86c03880b5233a32a524d7efc5a583c4fb73ea7e..32b85d68e756ffd117e801031acb308086d1f6c3 100644 (file)
@@ -59,8 +59,9 @@
 #define DEFINE_AML_GLOBALS
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/amlcode.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exutils")
similarity index 99%
rename from drivers/acpi/hardware/hwacpi.c
rename to drivers/acpi/acpica/hwacpi.c
index 816894ea839eba7fe21a85bd68f97f9329a715dc..a9d4fea4167f37833e2ef2a855d4748fdd644217 100644 (file)
@@ -43,6 +43,7 @@
  */
 
 #include <acpi/acpi.h>
+#include "accommon.h"
 
 #define _COMPONENT          ACPI_HARDWARE
 ACPI_MODULE_NAME("hwacpi")
similarity index 86%
rename from drivers/acpi/hardware/hwgpe.c
rename to drivers/acpi/acpica/hwgpe.c
index 0b80db9d91979e17ce418f840a56d3096afb5f2d..2013b66745d2c90cf1edb48317cb1235c605e89e 100644 (file)
@@ -43,7 +43,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acevents.h>
+#include "accommon.h"
+#include "acevents.h"
 
 #define _COMPONENT          ACPI_HARDWARE
 ACPI_MODULE_NAME("hwgpe")
@@ -51,7 +52,8 @@ ACPI_MODULE_NAME("hwgpe")
 /* Local prototypes */
 static acpi_status
 acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
-                               struct acpi_gpe_block_info *gpe_block);
+                               struct acpi_gpe_block_info *gpe_block,
+                               void *context);
 
 /******************************************************************************
  *
@@ -80,8 +82,7 @@ acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
 
        /* Get current value of the enable register that contains this GPE */
 
-       status = acpi_hw_low_level_read(ACPI_GPE_REGISTER_WIDTH, &enable_mask,
-                                       &gpe_register_info->enable_address);
+       status = acpi_read(&enable_mask, &gpe_register_info->enable_address);
        if (ACPI_FAILURE(status)) {
                return (status);
        }
@@ -95,9 +96,7 @@ acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
 
        /* Write the updated enable mask */
 
-       status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, enable_mask,
-                                        &gpe_register_info->enable_address);
-
+       status = acpi_write(enable_mask, &gpe_register_info->enable_address);
        return (status);
 }
 
@@ -132,8 +131,8 @@ acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info * gpe_event_info)
 
        /* Write the entire GPE (runtime) enable register */
 
-       status = acpi_hw_low_level_write(8, gpe_register_info->enable_for_run,
-                                        &gpe_register_info->enable_address);
+       status = acpi_write(gpe_register_info->enable_for_run,
+                           &gpe_register_info->enable_address);
 
        return (status);
 }
@@ -166,9 +165,8 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
         * Write a one to the appropriate bit in the status register to
         * clear this GPE.
         */
-       status = acpi_hw_low_level_write(8, register_bit,
-                                        &gpe_event_info->register_info->
-                                        status_address);
+       status = acpi_write(register_bit,
+                           &gpe_event_info->register_info->status_address);
 
        return (status);
 }
@@ -227,9 +225,7 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
 
        /* GPE currently active (status bit == 1)? */
 
-       status =
-           acpi_hw_low_level_read(8, &in_byte,
-                                  &gpe_register_info->status_address);
+       status = acpi_read(&in_byte, &gpe_register_info->status_address);
        if (ACPI_FAILURE(status)) {
                goto unlock_and_exit;
        }
@@ -260,8 +256,8 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
  ******************************************************************************/
 
 acpi_status
-acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
-                         struct acpi_gpe_block_info * gpe_block)
+acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
+                         struct acpi_gpe_block_info *gpe_block, void *context)
 {
        u32 i;
        acpi_status status;
@@ -272,9 +268,9 @@ acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
 
                /* Disable all GPEs in this register */
 
-               status = acpi_hw_low_level_write(8, 0x00,
-                                                &gpe_block->register_info[i].
-                                                enable_address);
+               status =
+                   acpi_write(0x00,
+                              &gpe_block->register_info[i].enable_address);
                if (ACPI_FAILURE(status)) {
                        return (status);
                }
@@ -297,8 +293,8 @@ acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
  ******************************************************************************/
 
 acpi_status
-acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
-                       struct acpi_gpe_block_info * gpe_block)
+acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
+                       struct acpi_gpe_block_info *gpe_block, void *context)
 {
        u32 i;
        acpi_status status;
@@ -309,9 +305,9 @@ acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
 
                /* Clear status on all GPEs in this register */
 
-               status = acpi_hw_low_level_write(8, 0xFF,
-                                                &gpe_block->register_info[i].
-                                                status_address);
+               status =
+                   acpi_write(0xFF,
+                              &gpe_block->register_info[i].status_address);
                if (ACPI_FAILURE(status)) {
                        return (status);
                }
@@ -335,8 +331,8 @@ acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
  ******************************************************************************/
 
 acpi_status
-acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
-                                struct acpi_gpe_block_info * gpe_block)
+acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
+                                struct acpi_gpe_block_info *gpe_block, void *context)
 {
        u32 i;
        acpi_status status;
@@ -352,12 +348,9 @@ acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
 
                /* Enable all "runtime" GPEs in this register */
 
-               status =
-                   acpi_hw_low_level_write(8,
-                                           gpe_block->register_info[i].
-                                           enable_for_run,
-                                           &gpe_block->register_info[i].
-                                           enable_address);
+               status = acpi_write(gpe_block->register_info[i].enable_for_run,
+                                   &gpe_block->register_info[i].
+                                   enable_address);
                if (ACPI_FAILURE(status)) {
                        return (status);
                }
@@ -382,7 +375,8 @@ acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
 
 static acpi_status
 acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
-                               struct acpi_gpe_block_info *gpe_block)
+                               struct acpi_gpe_block_info *gpe_block,
+                               void *context)
 {
        u32 i;
        acpi_status status;
@@ -396,11 +390,9 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
 
                /* Enable all "wake" GPEs in this register */
 
-               status = acpi_hw_low_level_write(8,
-                                                gpe_block->register_info[i].
-                                                enable_for_wake,
-                                                &gpe_block->register_info[i].
-                                                enable_address);
+               status = acpi_write(gpe_block->register_info[i].enable_for_wake,
+                                   &gpe_block->register_info[i].
+                                   enable_address);
                if (ACPI_FAILURE(status)) {
                        return (status);
                }
@@ -427,8 +419,8 @@ acpi_status acpi_hw_disable_all_gpes(void)
 
        ACPI_FUNCTION_TRACE(hw_disable_all_gpes);
 
-       status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block);
-       status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block);
+       status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL);
+       status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block, NULL);
        return_ACPI_STATUS(status);
 }
 
@@ -450,7 +442,7 @@ acpi_status acpi_hw_enable_all_runtime_gpes(void)
 
        ACPI_FUNCTION_TRACE(hw_enable_all_runtime_gpes);
 
-       status = acpi_ev_walk_gpe_list(acpi_hw_enable_runtime_gpe_block);
+       status = acpi_ev_walk_gpe_list(acpi_hw_enable_runtime_gpe_block, NULL);
        return_ACPI_STATUS(status);
 }
 
@@ -472,6 +464,6 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void)
 
        ACPI_FUNCTION_TRACE(hw_enable_all_wakeup_gpes);
 
-       status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block);
+       status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block, NULL);
        return_ACPI_STATUS(status);
 }
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
new file mode 100644 (file)
index 0000000..4dc43b0
--- /dev/null
@@ -0,0 +1,353 @@
+
+/*******************************************************************************
+ *
+ * Module Name: hwregs - Read/write access functions for the various ACPI
+ *                       control and status registers.
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2008, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <acpi/acpi.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "acevents.h"
+
+#define _COMPONENT          ACPI_HARDWARE
+ACPI_MODULE_NAME("hwregs")
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_hw_clear_acpi_status
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Clears all fixed and general purpose status bits
+ *              THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
+ *
+ ******************************************************************************/
+acpi_status acpi_hw_clear_acpi_status(void)
+{
+       acpi_status status;
+       acpi_cpu_flags lock_flags = 0;
+
+       ACPI_FUNCTION_TRACE(hw_clear_acpi_status);
+
+       ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %04X\n",
+                         ACPI_BITMASK_ALL_FIXED_STATUS,
+                         (u16) acpi_gbl_FADT.xpm1a_event_block.address));
+
+       lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock);
+
+       status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS,
+                                       ACPI_BITMASK_ALL_FIXED_STATUS);
+       if (ACPI_FAILURE(status)) {
+               goto unlock_and_exit;
+       }
+
+       /* Clear the fixed events */
+
+       if (acpi_gbl_FADT.xpm1b_event_block.address) {
+               status = acpi_write(ACPI_BITMASK_ALL_FIXED_STATUS,
+                                   &acpi_gbl_FADT.xpm1b_event_block);
+               if (ACPI_FAILURE(status)) {
+                       goto unlock_and_exit;
+               }
+       }
+
+       /* Clear the GPE Bits in all GPE registers in all GPE blocks */
+
+       status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block, NULL);
+
+      unlock_and_exit:
+       acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags);
+       return_ACPI_STATUS(status);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_hw_get_register_bit_mask
+ *
+ * PARAMETERS:  register_id         - Index of ACPI Register to access
+ *
+ * RETURN:      The bitmask to be used when accessing the register
+ *
+ * DESCRIPTION: Map register_id into a register bitmask.
+ *
+ ******************************************************************************/
+
+struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
+{
+       ACPI_FUNCTION_ENTRY();
+
+       if (register_id > ACPI_BITREG_MAX) {
+               ACPI_ERROR((AE_INFO, "Invalid BitRegister ID: %X",
+                           register_id));
+               return (NULL);
+       }
+
+       return (&acpi_gbl_bit_register_info[register_id]);
+}
+
+/******************************************************************************
+ *
+ * FUNCTION:    acpi_hw_register_read
+ *
+ * PARAMETERS:  register_id         - ACPI Register ID
+ *              return_value        - Where the register value is returned
+ *
+ * RETURN:      Status and the value read.
+ *
+ * DESCRIPTION: Read from the specified ACPI register
+ *
+ ******************************************************************************/
+acpi_status
+acpi_hw_register_read(u32 register_id, u32 * return_value)
+{
+       u32 value1 = 0;
+       u32 value2 = 0;
+       acpi_status status;
+
+       ACPI_FUNCTION_TRACE(hw_register_read);
+
+       switch (register_id) {
+       case ACPI_REGISTER_PM1_STATUS:  /* 16-bit access */
+
+               status = acpi_read(&value1, &acpi_gbl_FADT.xpm1a_event_block);
+               if (ACPI_FAILURE(status)) {
+                       goto exit;
+               }
+
+               /* PM1B is optional */
+
+               status = acpi_read(&value2, &acpi_gbl_FADT.xpm1b_event_block);
+               value1 |= value2;
+               break;
+
+       case ACPI_REGISTER_PM1_ENABLE:  /* 16-bit access */
+
+               status = acpi_read(&value1, &acpi_gbl_xpm1a_enable);
+               if (ACPI_FAILURE(status)) {
+                       goto exit;
+               }
+
+               /* PM1B is optional */
+
+               status = acpi_read(&value2, &acpi_gbl_xpm1b_enable);
+               value1 |= value2;
+               break;
+
+       case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */
+
+               status = acpi_read(&value1, &acpi_gbl_FADT.xpm1a_control_block);
+               if (ACPI_FAILURE(status)) {
+                       goto exit;
+               }
+
+               status = acpi_read(&value2, &acpi_gbl_FADT.xpm1b_control_block);
+               value1 |= value2;
+               break;
+
+       case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
+
+               status = acpi_read(&value1, &acpi_gbl_FADT.xpm2_control_block);
+               break;
+
+       case ACPI_REGISTER_PM_TIMER:    /* 32-bit access */
+
+               status = acpi_read(&value1, &acpi_gbl_FADT.xpm_timer_block);
+               break;
+
+       case ACPI_REGISTER_SMI_COMMAND_BLOCK:   /* 8-bit access */
+
+               status =
+                   acpi_os_read_port(acpi_gbl_FADT.smi_command, &value1, 8);
+               break;
+
+       default:
+               ACPI_ERROR((AE_INFO, "Unknown Register ID: %X", register_id));
+               status = AE_BAD_PARAMETER;
+               break;
+       }
+
+      exit:
+
+       if (ACPI_SUCCESS(status)) {
+               *return_value = value1;
+       }
+
+       return_ACPI_STATUS(status);
+}
+
+/******************************************************************************
+ *
+ * FUNCTION:    acpi_hw_register_write
+ *
+ * PARAMETERS:  register_id         - ACPI Register ID
+ *              Value               - The value to write
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Write to the specified ACPI register
+ *
+ * NOTE: In accordance with the ACPI specification, this function automatically
+ * preserves the value of the following bits, meaning that these bits cannot be
+ * changed via this interface:
+ *
+ * PM1_CONTROL[0] = SCI_EN
+ * PM1_CONTROL[9]
+ * PM1_STATUS[11]
+ *
+ * ACPI References:
+ * 1) Hardware Ignored Bits: When software writes to a register with ignored
+ *      bit fields, it preserves the ignored bit fields
+ * 2) SCI_EN: OSPM always preserves this bit position
+ *
+ ******************************************************************************/
+
+acpi_status acpi_hw_register_write(u32 register_id, u32 value)
+{
+       acpi_status status;
+       u32 read_value;
+
+       ACPI_FUNCTION_TRACE(hw_register_write);
+
+       switch (register_id) {
+       case ACPI_REGISTER_PM1_STATUS:  /* 16-bit access */
+
+               /* Perform a read first to preserve certain bits (per ACPI spec) */
+
+               status = acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS,
+                                              &read_value);
+               if (ACPI_FAILURE(status)) {
+                       goto exit;
+               }
+
+               /* Insert the bits to be preserved */
+
+               ACPI_INSERT_BITS(value, ACPI_PM1_STATUS_PRESERVED_BITS,
+                                read_value);
+
+               /* Now we can write the data */
+
+               status = acpi_write(value, &acpi_gbl_FADT.xpm1a_event_block);
+               if (ACPI_FAILURE(status)) {
+                       goto exit;
+               }
+
+               /* PM1B is optional */
+
+               status = acpi_write(value, &acpi_gbl_FADT.xpm1b_event_block);
+               break;
+
+       case ACPI_REGISTER_PM1_ENABLE:  /* 16-bit access */
+
+               status = acpi_write(value, &acpi_gbl_xpm1a_enable);
+               if (ACPI_FAILURE(status)) {
+                       goto exit;
+               }
+
+               /* PM1B is optional */
+
+               status = acpi_write(value, &acpi_gbl_xpm1b_enable);
+               break;
+
+       case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */
+
+               /*
+                * Perform a read first to preserve certain bits (per ACPI spec)
+                */
+               status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL,
+                                              &read_value);
+               if (ACPI_FAILURE(status)) {
+                       goto exit;
+               }
+
+               /* Insert the bits to be preserved */
+
+               ACPI_INSERT_BITS(value, ACPI_PM1_CONTROL_PRESERVED_BITS,
+                                read_value);
+
+               /* Now we can write the data */
+
+               status = acpi_write(value, &acpi_gbl_FADT.xpm1a_control_block);
+               if (ACPI_FAILURE(status)) {
+                       goto exit;
+               }
+
+               status = acpi_write(value, &acpi_gbl_FADT.xpm1b_control_block);
+               break;
+
+       case ACPI_REGISTER_PM1A_CONTROL:        /* 16-bit access */
+
+               status = acpi_write(value, &acpi_gbl_FADT.xpm1a_control_block);
+               break;
+
+       case ACPI_REGISTER_PM1B_CONTROL:        /* 16-bit access */
+
+               status = acpi_write(value, &acpi_gbl_FADT.xpm1b_control_block);
+               break;
+
+       case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
+
+               status = acpi_write(value, &acpi_gbl_FADT.xpm2_control_block);
+               break;
+
+       case ACPI_REGISTER_PM_TIMER:    /* 32-bit access */
+
+               status = acpi_write(value, &acpi_gbl_FADT.xpm_timer_block);
+               break;
+
+       case ACPI_REGISTER_SMI_COMMAND_BLOCK:   /* 8-bit access */
+
+               /* SMI_CMD is currently always in IO space */
+
+               status =
+                   acpi_os_write_port(acpi_gbl_FADT.smi_command, value, 8);
+               break;
+
+       default:
+               status = AE_BAD_PARAMETER;
+               break;
+       }
+
+      exit:
+       return_ACPI_STATUS(status);
+}
similarity index 91%
rename from drivers/acpi/hardware/hwsleep.c
rename to drivers/acpi/acpica/hwsleep.c
index 25dccdf179b9e4814ca52669f268f4409b34ce6b..a2af2a4f2f268d9116098cf926bc81bd92a915db 100644 (file)
@@ -43,7 +43,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_HARDWARE
 ACPI_MODULE_NAME("hwsleep")
@@ -52,31 +53,19 @@ ACPI_MODULE_NAME("hwsleep")
  *
  * FUNCTION:    acpi_set_firmware_waking_vector
  *
- * PARAMETERS:  physical_address    - Physical address of ACPI real mode
+ * PARAMETERS:  physical_address    - 32-bit physical address of ACPI real mode
  *                                    entry point.
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Access function for the firmware_waking_vector field in FACS
+ * DESCRIPTION: Sets the 32-bit firmware_waking_vector field of the FACS
  *
  ******************************************************************************/
 acpi_status
-acpi_set_firmware_waking_vector(acpi_physical_address physical_address)
+acpi_set_firmware_waking_vector(u32 physical_address)
 {
-       struct acpi_table_facs *facs;
-       acpi_status status;
-
        ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector);
 
-       /* Get the FACS */
-
-       status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
-                                        ACPI_CAST_INDIRECT_PTR(struct
-                                                               acpi_table_header,
-                                                               &facs));
-       if (ACPI_FAILURE(status)) {
-               return_ACPI_STATUS(status);
-       }
 
        /*
         * According to the ACPI specification 2.0c and later, the 64-bit
@@ -85,10 +74,16 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address)
         * Protected Mode.  Some systems (for example HP dv5-1004nr) are known
         * to fail to resume if the 64-bit vector is used.
         */
-       if (facs->version >= 1)
-               facs->xfirmware_waking_vector = 0;
 
-       facs->firmware_waking_vector = (u32)physical_address;
+       /* Set the 32-bit vector */
+
+       acpi_gbl_FACS->firmware_waking_vector = physical_address;
+
+       /* Clear the 64-bit vector if it exists */
+
+       if ((acpi_gbl_FACS->length > 32) && (acpi_gbl_FACS->version >= 1)) {
+               acpi_gbl_FACS->xfirmware_waking_vector = 0;
+       }
 
        return_ACPI_STATUS(AE_OK);
 }
@@ -97,48 +92,39 @@ ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector)
 
 /*******************************************************************************
  *
- * FUNCTION:    acpi_get_firmware_waking_vector
+ * FUNCTION:    acpi_set_firmware_waking_vector64
  *
- * PARAMETERS:  *physical_address   - Where the contents of
- *                                    the firmware_waking_vector field of
- *                                    the FACS will be returned.
+ * PARAMETERS:  physical_address    - 64-bit physical address of ACPI protected
+ *                                    mode entry point.
  *
- * RETURN:      Status, vector
+ * RETURN:      Status
  *
- * DESCRIPTION: Access function for the firmware_waking_vector field in FACS
+ * DESCRIPTION: Sets the 64-bit X_firmware_waking_vector field of the FACS, if
+ *              it exists in the table.
  *
  ******************************************************************************/
-#ifdef ACPI_FUTURE_USAGE
 acpi_status
-acpi_get_firmware_waking_vector(acpi_physical_address * physical_address)
+acpi_set_firmware_waking_vector64(u64 physical_address)
 {
-       struct acpi_table_facs *facs;
-       acpi_status status;
+       ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector64);
 
-       ACPI_FUNCTION_TRACE(acpi_get_firmware_waking_vector);
-
-       if (!physical_address) {
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
-       }
 
-       /* Get the FACS */
+       /* Determine if the 64-bit vector actually exists */
 
-       status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
-                                        ACPI_CAST_INDIRECT_PTR(struct
-                                                               acpi_table_header,
-                                                               &facs));
-       if (ACPI_FAILURE(status)) {
-               return_ACPI_STATUS(status);
+       if ((acpi_gbl_FACS->length <= 32) || (acpi_gbl_FACS->version < 1)) {
+               return_ACPI_STATUS(AE_NOT_EXIST);
        }
 
-       /* Get the vector */
-       *physical_address = (acpi_physical_address)facs->firmware_waking_vector;
+       /* Clear 32-bit vector, set the 64-bit X_ vector */
+
+       acpi_gbl_FACS->firmware_waking_vector = 0;
+       acpi_gbl_FACS->xfirmware_waking_vector = physical_address;
 
        return_ACPI_STATUS(AE_OK);
 }
 
-ACPI_EXPORT_SYMBOL(acpi_get_firmware_waking_vector)
-#endif
+ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector64)
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_enter_sleep_state_prep
similarity index 99%
rename from drivers/acpi/hardware/hwtimer.c
rename to drivers/acpi/acpica/hwtimer.c
index b53d575491b908719643dc7b6f02d7405909d5cb..b7f522c8f023d48686d40d7267196d6d296b6e44 100644 (file)
@@ -43,6 +43,7 @@
  */
 
 #include <acpi/acpi.h>
+#include "accommon.h"
 
 #define _COMPONENT          ACPI_HARDWARE
 ACPI_MODULE_NAME("hwtimer")
similarity index 62%
rename from drivers/acpi/hardware/hwregs.c
rename to drivers/acpi/acpica/hwxface.c
index ddf792adcf9619fe581c9067c06761d8b2780955..ae597c0ab53f38da0feb8cc5716fa6c3e41463c0 100644 (file)
@@ -1,10 +1,9 @@
 
-/*******************************************************************************
+/******************************************************************************
  *
- * Module Name: hwregs - Read/write access functions for the various ACPI
- *                       control and status registers.
+ * Module Name: hwxface - Public ACPICA hardware interfaces
  *
- ******************************************************************************/
+ *****************************************************************************/
 
 /*
  * Copyright (C) 2000 - 2008, Intel Corp.
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acevents.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_HARDWARE
-ACPI_MODULE_NAME("hwregs")
+ACPI_MODULE_NAME("hwxface")
 
-/*******************************************************************************
+/******************************************************************************
  *
- * FUNCTION:    acpi_hw_clear_acpi_status
+ * FUNCTION:    acpi_reset
  *
  * PARAMETERS:  None
  *
- * RETURN:      None
+ * RETURN:      Status
  *
- * DESCRIPTION: Clears all fixed and general purpose status bits
- *              THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
+ * DESCRIPTION: Set reset register in memory or IO space. Note: Does not
+ *              support reset register in PCI config space, this must be
+ *              handled separately.
  *
  ******************************************************************************/
-acpi_status acpi_hw_clear_acpi_status(void)
+acpi_status acpi_reset(void)
 {
+       struct acpi_generic_address *reset_reg;
        acpi_status status;
-       acpi_cpu_flags lock_flags = 0;
-
-       ACPI_FUNCTION_TRACE(hw_clear_acpi_status);
-
-       ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %04X\n",
-                         ACPI_BITMASK_ALL_FIXED_STATUS,
-                         (u16) acpi_gbl_FADT.xpm1a_event_block.address));
 
-       lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock);
+       ACPI_FUNCTION_TRACE(acpi_reset);
 
-       status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS,
-                                       ACPI_BITMASK_ALL_FIXED_STATUS);
-       if (ACPI_FAILURE(status)) {
-               goto unlock_and_exit;
-       }
+       reset_reg = &acpi_gbl_FADT.reset_register;
 
-       /* Clear the fixed events */
+       /* Check if the reset register is supported */
 
-       if (acpi_gbl_FADT.xpm1b_event_block.address) {
-               status =
-                   acpi_hw_low_level_write(16, ACPI_BITMASK_ALL_FIXED_STATUS,
-                                           &acpi_gbl_FADT.xpm1b_event_block);
-               if (ACPI_FAILURE(status)) {
-                       goto unlock_and_exit;
-               }
+       if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) ||
+           !reset_reg->address) {
+               return_ACPI_STATUS(AE_NOT_EXIST);
        }
 
-       /* Clear the GPE Bits in all GPE registers in all GPE blocks */
+       /* Write the reset value to the reset register */
 
-       status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block);
-
-      unlock_and_exit:
-       acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags);
+       status = acpi_write(acpi_gbl_FADT.reset_value, reset_reg);
        return_ACPI_STATUS(status);
 }
 
-/*******************************************************************************
+ACPI_EXPORT_SYMBOL(acpi_reset)
+
+/******************************************************************************
  *
- * FUNCTION:    acpi_get_sleep_type_data
+ * FUNCTION:    acpi_read
  *
- * PARAMETERS:  sleep_state         - Numeric sleep state
- *              *sleep_type_a        - Where SLP_TYPa is returned
- *              *sleep_type_b        - Where SLP_TYPb is returned
+ * PARAMETERS:  Value               - Where the value is returned
+ *              Reg                 - GAS register structure
  *
- * RETURN:      Status - ACPI status
+ * RETURN:      Status
  *
- * DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested sleep
- *              state.
+ * DESCRIPTION: Read from either memory or IO space.
  *
  ******************************************************************************/
-
-acpi_status
-acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b)
+acpi_status acpi_read(u32 *value, struct acpi_generic_address *reg)
 {
-       acpi_status status = AE_OK;
-       struct acpi_evaluate_info *info;
-
-       ACPI_FUNCTION_TRACE(acpi_get_sleep_type_data);
-
-       /* Validate parameters */
-
-       if ((sleep_state > ACPI_S_STATES_MAX) || !sleep_type_a || !sleep_type_b) {
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
-       }
+       u32 width;
+       u64 address;
+       acpi_status status;
 
-       /* Allocate the evaluation information block */
+       ACPI_FUNCTION_NAME(acpi_read);
 
-       info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
-       if (!info) {
-               return_ACPI_STATUS(AE_NO_MEMORY);
+       /*
+        * Must have a valid pointer to a GAS structure, and
+        * a non-zero address within. However, don't return an error
+        * because the PM1A/B code must not fail if B isn't present.
+        */
+       if (!reg) {
+               return (AE_OK);
        }
 
-       info->pathname =
-           ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
-
-       /* Evaluate the namespace object containing the values for this state */
-
-       status = acpi_ns_evaluate(info);
-       if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-                                 "%s while evaluating SleepState [%s]\n",
-                                 acpi_format_exception(status),
-                                 info->pathname));
+       /* Get a local copy of the address. Handles possible alignment issues */
 
-               goto cleanup;
+       ACPI_MOVE_64_TO_64(&address, &reg->address);
+       if (!address) {
+               return (AE_OK);
        }
 
-       /* Must have a return object */
+       /* Supported widths are 8/16/32 */
 
-       if (!info->return_object) {
-               ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]",
-                           info->pathname));
-               status = AE_NOT_EXIST;
+       width = reg->bit_width;
+       if ((width != 8) && (width != 16) && (width != 32)) {
+               return (AE_SUPPORT);
        }
 
-       /* It must be of type Package */
+       /* Initialize entire 32-bit return value to zero */
 
-       else if (ACPI_GET_OBJECT_TYPE(info->return_object) != ACPI_TYPE_PACKAGE) {
-               ACPI_ERROR((AE_INFO,
-                           "Sleep State return object is not a Package"));
-               status = AE_AML_OPERAND_TYPE;
-       }
+       *value = 0;
 
        /*
-        * The package must have at least two elements. NOTE (March 2005): This
-        * goes against the current ACPI spec which defines this object as a
-        * package with one encoded DWORD element. However, existing practice
-        * by BIOS vendors seems to be to have 2 or more elements, at least
-        * one per sleep type (A/B).
+        * Two address spaces supported: Memory or IO.
+        * PCI_Config is not supported here because the GAS struct is insufficient
         */
-       else if (info->return_object->package.count < 2) {
-               ACPI_ERROR((AE_INFO,
-                           "Sleep State return package does not have at least two elements"));
-               status = AE_AML_NO_OPERAND;
-       }
+       switch (reg->space_id) {
+       case ACPI_ADR_SPACE_SYSTEM_MEMORY:
 
-       /* The first two elements must both be of type Integer */
+               status = acpi_os_read_memory((acpi_physical_address) address,
+                                            value, width);
+               break;
 
-       else if ((ACPI_GET_OBJECT_TYPE(info->return_object->package.elements[0])
-                 != ACPI_TYPE_INTEGER) ||
-                (ACPI_GET_OBJECT_TYPE(info->return_object->package.elements[1])
-                 != ACPI_TYPE_INTEGER)) {
-               ACPI_ERROR((AE_INFO,
-                           "Sleep State return package elements are not both Integers (%s, %s)",
-                           acpi_ut_get_object_type_name(info->return_object->
-                                                        package.elements[0]),
-                           acpi_ut_get_object_type_name(info->return_object->
-                                                        package.elements[1])));
-               status = AE_AML_OPERAND_TYPE;
-       } else {
-               /* Valid _Sx_ package size, type, and value */
+       case ACPI_ADR_SPACE_SYSTEM_IO:
 
-               *sleep_type_a = (u8)
-                   (info->return_object->package.elements[0])->integer.value;
-               *sleep_type_b = (u8)
-                   (info->return_object->package.elements[1])->integer.value;
-       }
+               status =
+                   acpi_os_read_port((acpi_io_address) address, value, width);
+               break;
 
-       if (ACPI_FAILURE(status)) {
-               ACPI_EXCEPTION((AE_INFO, status,
-                               "While evaluating SleepState [%s], bad Sleep object %p type %s",
-                               info->pathname, info->return_object,
-                               acpi_ut_get_object_type_name(info->
-                                                            return_object)));
+       default:
+               ACPI_ERROR((AE_INFO,
+                           "Unsupported address space: %X", reg->space_id));
+               return (AE_BAD_PARAMETER);
        }
 
-       acpi_ut_remove_reference(info->return_object);
+       ACPI_DEBUG_PRINT((ACPI_DB_IO,
+                         "Read:  %8.8X width %2d from %8.8X%8.8X (%s)\n",
+                         *value, width, ACPI_FORMAT_UINT64(address),
+                         acpi_ut_get_region_name(reg->space_id)));
 
-      cleanup:
-       ACPI_FREE(info);
-       return_ACPI_STATUS(status);
+       return (status);
 }
 
-ACPI_EXPORT_SYMBOL(acpi_get_sleep_type_data)
+ACPI_EXPORT_SYMBOL(acpi_read)
 
-/*******************************************************************************
+/******************************************************************************
  *
- * FUNCTION:    acpi_hw_get_register_bit_mask
+ * FUNCTION:    acpi_write
  *
- * PARAMETERS:  register_id         - Index of ACPI Register to access
+ * PARAMETERS:  Value               - To be written
+ *              Reg                 - GAS register structure
  *
- * RETURN:      The bitmask to be used when accessing the register
+ * RETURN:      Status
  *
- * DESCRIPTION: Map register_id into a register bitmask.
+ * DESCRIPTION: Write to either memory or IO space.
  *
  ******************************************************************************/
-struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
+acpi_status acpi_write(u32 value, struct acpi_generic_address *reg)
 {
-       ACPI_FUNCTION_ENTRY();
+       u32 width;
+       u64 address;
+       acpi_status status;
 
-       if (register_id > ACPI_BITREG_MAX) {
-               ACPI_ERROR((AE_INFO, "Invalid BitRegister ID: %X",
-                           register_id));
-               return (NULL);
+       ACPI_FUNCTION_NAME(acpi_write);
+
+       /*
+        * Must have a valid pointer to a GAS structure, and
+        * a non-zero address within. However, don't return an error
+        * because the PM1A/B code must not fail if B isn't present.
+        */
+       if (!reg) {
+               return (AE_OK);
+       }
+
+       /* Get a local copy of the address. Handles possible alignment issues */
+
+       ACPI_MOVE_64_TO_64(&address, &reg->address);
+       if (!address) {
+               return (AE_OK);
+       }
+
+       /* Supported widths are 8/16/32 */
+
+       width = reg->bit_width;
+       if ((width != 8) && (width != 16) && (width != 32)) {
+               return (AE_SUPPORT);
+       }
+
+       /*
+        * Two address spaces supported: Memory or IO.
+        * PCI_Config is not supported here because the GAS struct is insufficient
+        */
+       switch (reg->space_id) {
+       case ACPI_ADR_SPACE_SYSTEM_MEMORY:
+
+               status = acpi_os_write_memory((acpi_physical_address) address,
+                                             value, width);
+               break;
+
+       case ACPI_ADR_SPACE_SYSTEM_IO:
+
+               status = acpi_os_write_port((acpi_io_address) address, value,
+                                           width);
+               break;
+
+       default:
+               ACPI_ERROR((AE_INFO,
+                           "Unsupported address space: %X", reg->space_id));
+               return (AE_BAD_PARAMETER);
        }
 
-       return (&acpi_gbl_bit_register_info[register_id]);
+       ACPI_DEBUG_PRINT((ACPI_DB_IO,
+                         "Wrote: %8.8X width %2d   to %8.8X%8.8X (%s)\n",
+                         value, width, ACPI_FORMAT_UINT64(address),
+                         acpi_ut_get_region_name(reg->space_id)));
+
+       return (status);
 }
 
+ACPI_EXPORT_SYMBOL(acpi_write)
+
 /*******************************************************************************
  *
- * FUNCTION:    acpi_get_register
+ * FUNCTION:    acpi_get_register_unlocked
  *
  * PARAMETERS:  register_id     - ID of ACPI bit_register to access
  *              return_value    - Value that was read from the register
@@ -254,17 +252,16 @@ struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
  * RETURN:      Status and the value read from specified Register. Value
  *              returned is normalized to bit0 (is shifted all the way right)
  *
- * DESCRIPTION: ACPI bit_register read function.
+ * DESCRIPTION: ACPI bit_register read function. Does not acquire the HW lock.
  *
  ******************************************************************************/
-
-acpi_status acpi_get_register_unlocked(u32 register_id, u32 * return_value)
+acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value)
 {
        u32 register_value = 0;
        struct acpi_bit_register_info *bit_reg_info;
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE(acpi_get_register);
+       ACPI_FUNCTION_TRACE(acpi_get_register_unlocked);
 
        /* Get the info structure corresponding to the requested ACPI Register */
 
@@ -296,14 +293,31 @@ acpi_status acpi_get_register_unlocked(u32 register_id, u32 * return_value)
        return_ACPI_STATUS(status);
 }
 
-acpi_status acpi_get_register(u32 register_id, u32 * return_value)
+ACPI_EXPORT_SYMBOL(acpi_get_register_unlocked)
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_get_register
+ *
+ * PARAMETERS:  register_id     - ID of ACPI bit_register to access
+ *              return_value    - Value that was read from the register
+ *
+ * RETURN:      Status and the value read from specified Register. Value
+ *              returned is normalized to bit0 (is shifted all the way right)
+ *
+ * DESCRIPTION: ACPI bit_register read function.
+ *
+ ******************************************************************************/
+acpi_status acpi_get_register(u32 register_id, u32 *return_value)
 {
        acpi_status status;
        acpi_cpu_flags flags;
+
        flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock);
        status = acpi_get_register_unlocked(register_id, return_value);
        acpi_os_release_lock(acpi_gbl_hardware_lock, flags);
-       return status;
+
+       return (status);
 }
 
 ACPI_EXPORT_SYMBOL(acpi_get_register)
@@ -370,8 +384,9 @@ acpi_status acpi_set_register(u32 register_id, u32 value)
                                                   bit_reg_info->
                                                   access_bit_mask);
                if (value) {
-                       status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS,
-                                                       (u16) value);
+                       status =
+                           acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS,
+                                                  (u16) value);
                        register_value = 0;
                }
                break;
@@ -459,399 +474,120 @@ acpi_status acpi_set_register(u32 register_id, u32 value)
 
 ACPI_EXPORT_SYMBOL(acpi_set_register)
 
-/******************************************************************************
+/*******************************************************************************
  *
- * FUNCTION:    acpi_hw_register_read
+ * FUNCTION:    acpi_get_sleep_type_data
  *
- * PARAMETERS:  register_id         - ACPI Register ID
- *              return_value        - Where the register value is returned
+ * PARAMETERS:  sleep_state         - Numeric sleep state
+ *              *sleep_type_a        - Where SLP_TYPa is returned
+ *              *sleep_type_b        - Where SLP_TYPb is returned
  *
- * RETURN:      Status and the value read.
+ * RETURN:      Status - ACPI status
  *
- * DESCRIPTION: Read from the specified ACPI register
+ * DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested sleep
+ *              state.
  *
  ******************************************************************************/
 acpi_status
-acpi_hw_register_read(u32 register_id, u32 * return_value)
+acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 {
-       u32 value1 = 0;
-       u32 value2 = 0;
-       acpi_status status;
-
-       ACPI_FUNCTION_TRACE(hw_register_read);
+       acpi_status status = AE_OK;
+       struct acpi_evaluate_info *info;
 
-       switch (register_id) {
-       case ACPI_REGISTER_PM1_STATUS:  /* 16-bit access */
+       ACPI_FUNCTION_TRACE(acpi_get_sleep_type_data);
 
-               status =
-                   acpi_hw_low_level_read(16, &value1,
-                                          &acpi_gbl_FADT.xpm1a_event_block);
-               if (ACPI_FAILURE(status)) {
-                       goto exit;
-               }
+       /* Validate parameters */
 
-               /* PM1B is optional */
+       if ((sleep_state > ACPI_S_STATES_MAX) || !sleep_type_a || !sleep_type_b) {
+               return_ACPI_STATUS(AE_BAD_PARAMETER);
+       }
 
-               status =
-                   acpi_hw_low_level_read(16, &value2,
-                                          &acpi_gbl_FADT.xpm1b_event_block);
-               value1 |= value2;
-               break;
+       /* Allocate the evaluation information block */
 
-       case ACPI_REGISTER_PM1_ENABLE:  /* 16-bit access */
+       info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
+       if (!info) {
+               return_ACPI_STATUS(AE_NO_MEMORY);
+       }
 
-               status =
-                   acpi_hw_low_level_read(16, &value1, &acpi_gbl_xpm1a_enable);
-               if (ACPI_FAILURE(status)) {
-                       goto exit;
-               }
+       info->pathname =
+           ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
 
-               /* PM1B is optional */
+       /* Evaluate the namespace object containing the values for this state */
 
-               status =
-                   acpi_hw_low_level_read(16, &value2, &acpi_gbl_xpm1b_enable);
-               value1 |= value2;
-               break;
-
-       case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */
-
-               status =
-                   acpi_hw_low_level_read(16, &value1,
-                                          &acpi_gbl_FADT.xpm1a_control_block);
-               if (ACPI_FAILURE(status)) {
-                       goto exit;
-               }
-
-               status =
-                   acpi_hw_low_level_read(16, &value2,
-                                          &acpi_gbl_FADT.xpm1b_control_block);
-               value1 |= value2;
-               break;
-
-       case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
-
-               status =
-                   acpi_hw_low_level_read(8, &value1,
-                                          &acpi_gbl_FADT.xpm2_control_block);
-               break;
-
-       case ACPI_REGISTER_PM_TIMER:    /* 32-bit access */
-
-               status =
-                   acpi_hw_low_level_read(32, &value1,
-                                          &acpi_gbl_FADT.xpm_timer_block);
-               break;
-
-       case ACPI_REGISTER_SMI_COMMAND_BLOCK:   /* 8-bit access */
-
-               status =
-                   acpi_os_read_port(acpi_gbl_FADT.smi_command, &value1, 8);
-               break;
-
-       default:
-               ACPI_ERROR((AE_INFO, "Unknown Register ID: %X", register_id));
-               status = AE_BAD_PARAMETER;
-               break;
-       }
-
-      exit:
-
-       if (ACPI_SUCCESS(status)) {
-               *return_value = value1;
-       }
-
-       return_ACPI_STATUS(status);
-}
-
-/******************************************************************************
- *
- * FUNCTION:    acpi_hw_register_write
- *
- * PARAMETERS:  register_id         - ACPI Register ID
- *              Value               - The value to write
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Write to the specified ACPI register
- *
- * NOTE: In accordance with the ACPI specification, this function automatically
- * preserves the value of the following bits, meaning that these bits cannot be
- * changed via this interface:
- *
- * PM1_CONTROL[0] = SCI_EN
- * PM1_CONTROL[9]
- * PM1_STATUS[11]
- *
- * ACPI References:
- * 1) Hardware Ignored Bits: When software writes to a register with ignored
- *      bit fields, it preserves the ignored bit fields
- * 2) SCI_EN: OSPM always preserves this bit position
- *
- ******************************************************************************/
-
-acpi_status acpi_hw_register_write(u32 register_id, u32 value)
-{
-       acpi_status status;
-       u32 read_value;
-
-       ACPI_FUNCTION_TRACE(hw_register_write);
-
-       switch (register_id) {
-       case ACPI_REGISTER_PM1_STATUS:  /* 16-bit access */
-
-               /* Perform a read first to preserve certain bits (per ACPI spec) */
-
-               status = acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS,
-                                              &read_value);
-               if (ACPI_FAILURE(status)) {
-                       goto exit;
-               }
-
-               /* Insert the bits to be preserved */
-
-               ACPI_INSERT_BITS(value, ACPI_PM1_STATUS_PRESERVED_BITS,
-                                read_value);
-
-               /* Now we can write the data */
-
-               status =
-                   acpi_hw_low_level_write(16, value,
-                                           &acpi_gbl_FADT.xpm1a_event_block);
-               if (ACPI_FAILURE(status)) {
-                       goto exit;
-               }
-
-               /* PM1B is optional */
-
-               status =
-                   acpi_hw_low_level_write(16, value,
-                                           &acpi_gbl_FADT.xpm1b_event_block);
-               break;
-
-       case ACPI_REGISTER_PM1_ENABLE:  /* 16-bit access */
-
-               status =
-                   acpi_hw_low_level_write(16, value, &acpi_gbl_xpm1a_enable);
-               if (ACPI_FAILURE(status)) {
-                       goto exit;
-               }
-
-               /* PM1B is optional */
-
-               status =
-                   acpi_hw_low_level_write(16, value, &acpi_gbl_xpm1b_enable);
-               break;
-
-       case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */
-
-               /*
-                * Perform a read first to preserve certain bits (per ACPI spec)
-                */
-               status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL,
-                                              &read_value);
-               if (ACPI_FAILURE(status)) {
-                       goto exit;
-               }
-
-               /* Insert the bits to be preserved */
-
-               ACPI_INSERT_BITS(value, ACPI_PM1_CONTROL_PRESERVED_BITS,
-                                read_value);
-
-               /* Now we can write the data */
-
-               status =
-                   acpi_hw_low_level_write(16, value,
-                                           &acpi_gbl_FADT.xpm1a_control_block);
-               if (ACPI_FAILURE(status)) {
-                       goto exit;
-               }
-
-               status =
-                   acpi_hw_low_level_write(16, value,
-                                           &acpi_gbl_FADT.xpm1b_control_block);
-               break;
-
-       case ACPI_REGISTER_PM1A_CONTROL:        /* 16-bit access */
-
-               status =
-                   acpi_hw_low_level_write(16, value,
-                                           &acpi_gbl_FADT.xpm1a_control_block);
-               break;
-
-       case ACPI_REGISTER_PM1B_CONTROL:        /* 16-bit access */
-
-               status =
-                   acpi_hw_low_level_write(16, value,
-                                           &acpi_gbl_FADT.xpm1b_control_block);
-               break;
-
-       case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
-
-               status =
-                   acpi_hw_low_level_write(8, value,
-                                           &acpi_gbl_FADT.xpm2_control_block);
-               break;
-
-       case ACPI_REGISTER_PM_TIMER:    /* 32-bit access */
-
-               status =
-                   acpi_hw_low_level_write(32, value,
-                                           &acpi_gbl_FADT.xpm_timer_block);
-               break;
-
-       case ACPI_REGISTER_SMI_COMMAND_BLOCK:   /* 8-bit access */
-
-               /* SMI_CMD is currently always in IO space */
-
-               status =
-                   acpi_os_write_port(acpi_gbl_FADT.smi_command, value, 8);
-               break;
+       status = acpi_ns_evaluate(info);
+       if (ACPI_FAILURE(status)) {
+               ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+                                 "%s while evaluating SleepState [%s]\n",
+                                 acpi_format_exception(status),
+                                 info->pathname));
 
-       default:
-               status = AE_BAD_PARAMETER;
-               break;
+               goto cleanup;
        }
 
-      exit:
-       return_ACPI_STATUS(status);
-}
-
-/******************************************************************************
- *
- * FUNCTION:    acpi_hw_low_level_read
- *
- * PARAMETERS:  Width               - 8, 16, or 32
- *              Value               - Where the value is returned
- *              Reg                 - GAS register structure
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Read from either memory or IO space.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg)
-{
-       u64 address;
-       acpi_status status;
-
-       ACPI_FUNCTION_NAME(hw_low_level_read);
+       /* Must have a return object */
 
-       /*
-        * Must have a valid pointer to a GAS structure, and
-        * a non-zero address within. However, don't return an error
-        * because the PM1A/B code must not fail if B isn't present.
-        */
-       if (!reg) {
-               return (AE_OK);
+       if (!info->return_object) {
+               ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]",
+                           info->pathname));
+               status = AE_NOT_EXIST;
        }
 
-       /* Get a local copy of the address. Handles possible alignment issues */
+       /* It must be of type Package */
 
-       ACPI_MOVE_64_TO_64(&address, &reg->address);
-       if (!address) {
-               return (AE_OK);
+       else if (ACPI_GET_OBJECT_TYPE(info->return_object) != ACPI_TYPE_PACKAGE) {
+               ACPI_ERROR((AE_INFO,
+                           "Sleep State return object is not a Package"));
+               status = AE_AML_OPERAND_TYPE;
        }
-       *value = 0;
 
        /*
-        * Two address spaces supported: Memory or IO.
-        * PCI_Config is not supported here because the GAS struct is insufficient
+        * The package must have at least two elements. NOTE (March 2005): This
+        * goes against the current ACPI spec which defines this object as a
+        * package with one encoded DWORD element. However, existing practice
+        * by BIOS vendors seems to be to have 2 or more elements, at least
+        * one per sleep type (A/B).
         */
-       switch (reg->space_id) {
-       case ACPI_ADR_SPACE_SYSTEM_MEMORY:
-
-               status = acpi_os_read_memory((acpi_physical_address) address,
-                                            value, width);
-               break;
-
-       case ACPI_ADR_SPACE_SYSTEM_IO:
-
-               status =
-                   acpi_os_read_port((acpi_io_address) address, value, width);
-               break;
-
-       default:
+       else if (info->return_object->package.count < 2) {
                ACPI_ERROR((AE_INFO,
-                           "Unsupported address space: %X", reg->space_id));
-               return (AE_BAD_PARAMETER);
+                           "Sleep State return package does not have at least two elements"));
+               status = AE_AML_NO_OPERAND;
        }
 
-       ACPI_DEBUG_PRINT((ACPI_DB_IO,
-                         "Read:  %8.8X width %2d from %8.8X%8.8X (%s)\n",
-                         *value, width, ACPI_FORMAT_UINT64(address),
-                         acpi_ut_get_region_name(reg->space_id)));
-
-       return (status);
-}
-
-/******************************************************************************
- *
- * FUNCTION:    acpi_hw_low_level_write
- *
- * PARAMETERS:  Width               - 8, 16, or 32
- *              Value               - To be written
- *              Reg                 - GAS register structure
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Write to either memory or IO space.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg)
-{
-       u64 address;
-       acpi_status status;
-
-       ACPI_FUNCTION_NAME(hw_low_level_write);
-
-       /*
-        * Must have a valid pointer to a GAS structure, and
-        * a non-zero address within. However, don't return an error
-        * because the PM1A/B code must not fail if B isn't present.
-        */
-       if (!reg) {
-               return (AE_OK);
-       }
+       /* The first two elements must both be of type Integer */
 
-       /* Get a local copy of the address. Handles possible alignment issues */
+       else if ((ACPI_GET_OBJECT_TYPE(info->return_object->package.elements[0])
+                 != ACPI_TYPE_INTEGER) ||
+                (ACPI_GET_OBJECT_TYPE(info->return_object->package.elements[1])
+                 != ACPI_TYPE_INTEGER)) {
+               ACPI_ERROR((AE_INFO,
+                           "Sleep State return package elements are not both Integers (%s, %s)",
+                           acpi_ut_get_object_type_name(info->return_object->
+                                                        package.elements[0]),
+                           acpi_ut_get_object_type_name(info->return_object->
+                                                        package.elements[1])));
+               status = AE_AML_OPERAND_TYPE;
+       } else {
+               /* Valid _Sx_ package size, type, and value */
 
-       ACPI_MOVE_64_TO_64(&address, &reg->address);
-       if (!address) {
-               return (AE_OK);
+               *sleep_type_a = (u8)
+                   (info->return_object->package.elements[0])->integer.value;
+               *sleep_type_b = (u8)
+                   (info->return_object->package.elements[1])->integer.value;
        }
 
-       /*
-        * Two address spaces supported: Memory or IO.
-        * PCI_Config is not supported here because the GAS struct is insufficient
-        */
-       switch (reg->space_id) {
-       case ACPI_ADR_SPACE_SYSTEM_MEMORY:
-
-               status = acpi_os_write_memory((acpi_physical_address) address,
-                                             value, width);
-               break;
-
-       case ACPI_ADR_SPACE_SYSTEM_IO:
-
-               status = acpi_os_write_port((acpi_io_address) address, value,
-                                           width);
-               break;
-
-       default:
-               ACPI_ERROR((AE_INFO,
-                           "Unsupported address space: %X", reg->space_id));
-               return (AE_BAD_PARAMETER);
+       if (ACPI_FAILURE(status)) {
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "While evaluating SleepState [%s], bad Sleep object %p type %s",
+                               info->pathname, info->return_object,
+                               acpi_ut_get_object_type_name(info->
+                                                            return_object)));
        }
 
-       ACPI_DEBUG_PRINT((ACPI_DB_IO,
-                         "Wrote: %8.8X width %2d   to %8.8X%8.8X (%s)\n",
-                         value, width, ACPI_FORMAT_UINT64(address),
-                         acpi_ut_get_region_name(reg->space_id)));
+       acpi_ut_remove_reference(info->return_object);
 
-       return (status);
+      cleanup:
+       ACPI_FREE(info);
+       return_ACPI_STATUS(status);
 }
+
+ACPI_EXPORT_SYMBOL(acpi_get_sleep_type_data)
similarity index 98%
rename from drivers/acpi/namespace/nsaccess.c
rename to drivers/acpi/acpica/nsaccess.c
index c39a7f68b88929adb1fd86c94c6db3922b6a0829..88303ebe924cb7c5ec6167127edfe2cabae0923a 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/amlcode.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acdispat.h>
+#include "accommon.h"
+#include "amlcode.h"
+#include "acnamesp.h"
+#include "acdispat.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsaccess")
@@ -165,11 +166,8 @@ acpi_status acpi_ns_root_initialize(void)
 
                                obj_desc->method.method_flags =
                                    AML_METHOD_INTERNAL_ONLY;
-
-#ifndef ACPI_DUMP_APP
                                obj_desc->method.implementation =
                                    acpi_ut_osi_implementation;
-#endif
 #endif
                                break;
 
@@ -521,11 +519,11 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
        }
 
        /*
-        * Search namespace for each segment of the name.  Loop through and
+        * Search namespace for each segment of the name. Loop through and
         * verify (or add to the namespace) each name segment.
         *
         * The object type is significant only at the last name
-        * segment.  (We don't care about the types along the path, only
+        * segment. (We don't care about the types along the path, only
         * the type of the final target object.)
         */
        this_search_type = ACPI_TYPE_ANY;
@@ -591,6 +589,10 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                         * segments).
                         */
                        if (this_node->type == ACPI_TYPE_LOCAL_ALIAS) {
+                               if (!this_node->object) {
+                                       return_ACPI_STATUS(AE_NOT_EXIST);
+                               }
+
                                if (acpi_ns_opens_scope
                                    (((struct acpi_namespace_node *)this_node->
                                      object)->type)) {
similarity index 99%
rename from drivers/acpi/namespace/nsalloc.c
rename to drivers/acpi/acpica/nsalloc.c
index 3a1740ac2edcc012a7b51eabe889e03c3bd637d4..f976d848fe8241c0845ad4063d8a86c554aaefec 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsalloc")
similarity index 99%
rename from drivers/acpi/namespace/nsdump.c
rename to drivers/acpi/acpica/nsdump.c
index cc0ae39440e4358838626c73c63d43ccc8e15d01..0da33c8e9ba272d99979e80fd26ccb30255cb21b 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsdump")
similarity index 99%
rename from drivers/acpi/namespace/nsdumpdv.c
rename to drivers/acpi/acpica/nsdumpdv.c
index 428f50fde11a8cbe876d2a130e7cc09b791df75f..41994fe7fbb8a20c95e4505ad6878938a5381a7f 100644 (file)
@@ -42,6 +42,7 @@
  */
 
 #include <acpi/acpi.h>
+#include "accommon.h"
 
 /* TBD: This entire module is apparently obsolete and should be removed */
 
@@ -49,7 +50,7 @@
 ACPI_MODULE_NAME("nsdumpdv")
 #ifdef ACPI_OBSOLETE_FUNCTIONS
 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
-#include <acpi/acnamesp.h>
+#include "acnamesp.h"
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ns_dump_one_device
similarity index 81%
rename from drivers/acpi/namespace/nseval.c
rename to drivers/acpi/acpica/nseval.c
index 4cdf03ac2b467803189d97e8c5b7d11feabc073e..0f3d5f9b59664f1aff2540606bb51660ef8b5328 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "acinterp.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nseval")
@@ -89,6 +90,7 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)
        /* Initialize the return value to an invalid object */
 
        info->return_object = NULL;
+       info->param_count = 0;
 
        /*
         * Get the actual namespace node for the target object. Handles these cases:
@@ -141,41 +143,17 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)
                        return_ACPI_STATUS(AE_NULL_OBJECT);
                }
 
-               /*
-                * Calculate the number of arguments being passed to the method
-                */
+               /* Count the number of arguments being passed to the method */
 
-               info->param_count = 0;
                if (info->parameters) {
-                       while (info->parameters[info->param_count])
+                       while (info->parameters[info->param_count]) {
+                               if (info->param_count > ACPI_METHOD_MAX_ARG) {
+                                       return_ACPI_STATUS(AE_LIMIT);
+                               }
                                info->param_count++;
+                       }
                }
 
-               /*
-                * Warning if too few or too many arguments have been passed by the
-                * caller. We don't want to abort here with an error because an
-                * incorrect number of arguments may not cause the method to fail.
-                * However, the method will fail if there are too few arguments passed
-                * and the method attempts to use one of the missing ones.
-                */
-
-               if (info->param_count < info->obj_desc->method.param_count) {
-                       ACPI_WARNING((AE_INFO,
-                                   "Insufficient arguments - "
-                                   "method [%4.4s] needs %d, found %d",
-                                   acpi_ut_get_node_name(info->resolved_node),
-                                   info->obj_desc->method.param_count,
-                                   info->param_count));
-               } else if (info->param_count >
-                               info->obj_desc->method.param_count) {
-                       ACPI_WARNING((AE_INFO,
-                                     "Excess arguments - "
-                                     "method [%4.4s] needs %d, found %d",
-                                     acpi_ut_get_node_name(info->
-                                                           resolved_node),
-                                     info->obj_desc->method.param_count,
-                                     info->param_count));
-               }
 
                ACPI_DUMP_PATHNAME(info->resolved_node, "Execute Method:",
                                   ACPI_LV_INFO, _COMPONENT);
@@ -264,32 +242,13 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)
                }
        }
 
-       /* Validation of return values for ACPI-predefined methods and objects */
-
-       if ((status == AE_OK) || (status == AE_CTRL_RETURN_VALUE)) {
-               /*
-                * If this is the first evaluation, check the return value. This
-                * ensures that any warnings will only be emitted during the very
-                * first evaluation of the object.
-                */
-               if (!(node->flags & ANOBJ_EVALUATED)) {
-                       /*
-                        * Check for a predefined ACPI name. If found, validate the
-                        * returned object.
-                        *
-                        * Note: Ignore return status for now, emit warnings if there are
-                        * problems with the returned object. May change later to abort
-                        * the method on invalid return object.
-                        */
-                       (void)acpi_ns_check_predefined_names(node,
-                                                            info->
-                                                            return_object);
-               }
-
-               /* Mark the node as having been evaluated */
-
-               node->flags |= ANOBJ_EVALUATED;
-       }
+       /*
+        * Check input argument count against the ASL-defined count for a method.
+        * Also check predefined names: argument count and return value against
+        * the ACPI specification. Some incorrect return value types are repaired.
+        */
+       (void)acpi_ns_check_predefined_names(node, info->param_count,
+               status, &info->return_object);
 
        /* Check if there is a return value that must be dealt with */
 
similarity index 99%
rename from drivers/acpi/namespace/nsinit.c
rename to drivers/acpi/acpica/nsinit.c
index e4c57510d798753cd8366f4a2fbbaecb4d545450..13501cb81863b329f9aaa30dfe5a90e1a7c1d79f 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "acdispat.h"
+#include "acinterp.h"
 #include <linux/nmi.h>
 
 #define _COMPONENT          ACPI_NAMESPACE
similarity index 99%
rename from drivers/acpi/namespace/nsload.c
rename to drivers/acpi/acpica/nsload.c
index a4a412b7c029526faabd771b3742fd65db3ba7a3..a0ba9e12379efa250728e801a6f2eec1ec649401 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acdispat.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "acdispat.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsload")
similarity index 99%
rename from drivers/acpi/namespace/nsnames.c
rename to drivers/acpi/acpica/nsnames.c
index 42a39a7c96e913a519e6b1bf7b5a79d152dd4a4d..ae3dc10a7e817c4c9f11d7c5d6549e7cff2e0f61 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/amlcode.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "amlcode.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsnames")
similarity index 99%
rename from drivers/acpi/namespace/nsobject.c
rename to drivers/acpi/acpica/nsobject.c
index 15fe09e24f71ef3698ac25824c91b5849e567bf3..08a97a57f8f985c998dc5b8c926fab0a6e954093 100644 (file)
@@ -43,7 +43,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsobject")
similarity index 98%
rename from drivers/acpi/namespace/nsparse.c
rename to drivers/acpi/acpica/nsparse.c
index a82271a9dbb3d5b42495f7f10a809313730fc1c3..b9e8d0070b6f0049d9a96b4887237d70ed690609 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acparser.h>
-#include <acpi/acdispat.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "acparser.h"
+#include "acdispat.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsparse")
similarity index 76%
rename from drivers/acpi/namespace/nspredef.c
rename to drivers/acpi/acpica/nspredef.c
index 0f17cf0898c9a564d9e5357838dbdae06efb4a09..452703290d35e81bff9b98d4c706520c5c0a64a8 100644 (file)
@@ -43,8 +43,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acpredef.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "acpredef.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nspredef")
@@ -72,7 +73,7 @@ ACPI_MODULE_NAME("nspredef")
 /* Local prototypes */
 static acpi_status
 acpi_ns_check_package(char *pathname,
-                     union acpi_operand_object *return_object,
+                     union acpi_operand_object **return_object_ptr,
                      const union acpi_predefined_info *predefined);
 
 static acpi_status
@@ -82,13 +83,18 @@ acpi_ns_check_package_elements(char *pathname,
 
 static acpi_status
 acpi_ns_check_object_type(char *pathname,
-                         union acpi_operand_object *return_object,
+                         union acpi_operand_object **return_object_ptr,
                          u32 expected_btypes, u32 package_index);
 
 static acpi_status
 acpi_ns_check_reference(char *pathname,
                        union acpi_operand_object *return_object);
 
+static acpi_status
+acpi_ns_repair_object(u32 expected_btypes,
+                     u32 package_index,
+                     union acpi_operand_object **return_object_ptr);
+
 /*
  * Names for the types that can be returned by the predefined objects.
  * Used for warning messages. Must be in the same order as the ACPI_RTYPEs
@@ -108,8 +114,8 @@ static const char *acpi_rtype_names[] = {
  * FUNCTION:    acpi_ns_check_predefined_names
  *
  * PARAMETERS:  Node            - Namespace node for the method/object
- *              return_object   - Object returned from the evaluation of this
- *                                method/object
+ *              return_object_ptr - Pointer to the object returned from the
+ *                                evaluation of a method or object
  *
  * RETURN:      Status
  *
@@ -119,8 +125,11 @@ static const char *acpi_rtype_names[] = {
 
 acpi_status
 acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
-                              union acpi_operand_object *return_object)
+                              u32 user_param_count,
+                              acpi_status return_status,
+                              union acpi_operand_object **return_object_ptr)
 {
+       union acpi_operand_object *return_object = *return_object_ptr;
        acpi_status status = AE_OK;
        const union acpi_predefined_info *predefined;
        char *pathname;
@@ -128,12 +137,6 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
        /* Match the name for this method/object against the predefined list */
 
        predefined = acpi_ns_check_for_predefined_name(node);
-       if (!predefined) {
-
-               /* Name was not one of the predefined names */
-
-               return (AE_OK);
-       }
 
        /* Get the full pathname to the object, for use in error messages */
 
@@ -143,10 +146,37 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
        }
 
        /*
-        * Check that the parameter count for this method is in accordance
-        * with the ACPI specification.
+        * Check that the parameter count for this method matches the ASL
+        * definition. For predefined names, ensure that both the caller and
+        * the method itself are in accordance with the ACPI specification.
         */
-       acpi_ns_check_parameter_count(pathname, node, predefined);
+       acpi_ns_check_parameter_count(pathname, node, user_param_count,
+                                     predefined);
+
+       /* If not a predefined name, we cannot validate the return object */
+
+       if (!predefined) {
+               goto exit;
+       }
+
+       /* If the method failed, we cannot validate the return object */
+
+       if ((return_status != AE_OK) && (return_status != AE_CTRL_RETURN_VALUE)) {
+               goto exit;
+       }
+
+       /*
+        * Only validate the return value on the first successful evaluation of
+        * the method. This ensures that any warnings will only be emitted during
+        * the very first evaluation of the method/object.
+        */
+       if (node->flags & ANOBJ_EVALUATED) {
+               goto exit;
+       }
+
+       /* Mark the node as having been successfully evaluated */
+
+       node->flags |= ANOBJ_EVALUATED;
 
        /*
         * If there is no return value, check if we require a return value for
@@ -171,7 +201,7 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
         * We have a return value, but if one wasn't expected, just exit, this is
         * not a problem
         *
-        * For example, if "Implicit return value" is enabled, methods will
+        * For example, if the "Implicit Return" feature is enabled, methods will
         * always return a value
         */
        if (!predefined->info.expected_btypes) {
@@ -182,7 +212,7 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
         * Check that the type of the return object is what is expected for
         * this predefined name
         */
-       status = acpi_ns_check_object_type(pathname, return_object,
+       status = acpi_ns_check_object_type(pathname, return_object_ptr,
                                           predefined->info.expected_btypes,
                                           ACPI_NOT_PACKAGE);
        if (ACPI_FAILURE(status)) {
@@ -193,11 +223,12 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
 
        if (ACPI_GET_OBJECT_TYPE(return_object) == ACPI_TYPE_PACKAGE) {
                status =
-                   acpi_ns_check_package(pathname, return_object, predefined);
+                   acpi_ns_check_package(pathname, return_object_ptr,
+                                         predefined);
        }
 
       exit:
-       if (pathname) {
+       if (pathname != predefined->info.name) {
                ACPI_FREE(pathname);
        }
 
@@ -210,6 +241,7 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
  *
  * PARAMETERS:  Pathname        - Full pathname to the node (for error msgs)
  *              Node            - Namespace node for the method/object
+ *              user_param_count - Number of args passed in by the caller
  *              Predefined      - Pointer to entry in predefined name table
  *
  * RETURN:      None
@@ -223,32 +255,76 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
 void
 acpi_ns_check_parameter_count(char *pathname,
                              struct acpi_namespace_node *node,
+                             u32 user_param_count,
                              const union acpi_predefined_info *predefined)
 {
        u32 param_count;
        u32 required_params_current;
        u32 required_params_old;
 
-       /*
-        * Check that the ASL-defined parameter count is what is expected for
-        * this predefined name.
-        *
-        * Methods have 0-7 parameters. All other types have zero.
-        */
+       /* Methods have 0-7 parameters. All other types have zero. */
+
        param_count = 0;
        if (node->type == ACPI_TYPE_METHOD) {
                param_count = node->object->method.param_count;
        }
 
-       /* Validate parameter count - allow two different legal counts (_SCP) */
+       /* Argument count check for non-predefined methods/objects */
+
+       if (!predefined) {
+               /*
+                * Warning if too few or too many arguments have been passed by the
+                * caller. An incorrect number of arguments may not cause the method
+                * to fail. However, the method will fail if there are too few
+                * arguments and the method attempts to use one of the missing ones.
+                */
+               if (user_param_count < param_count) {
+                       ACPI_WARNING((AE_INFO,
+                                     "%s: Insufficient arguments - needs %d, found %d",
+                                     pathname, param_count, user_param_count));
+               } else if (user_param_count > param_count) {
+                       ACPI_WARNING((AE_INFO,
+                                     "%s: Excess arguments - needs %d, found %d",
+                                     pathname, param_count, user_param_count));
+               }
+               return;
+       }
+
+       /* Allow two different legal argument counts (_SCP, etc.) */
 
        required_params_current = predefined->info.param_count & 0x0F;
        required_params_old = predefined->info.param_count >> 4;
 
+       if (user_param_count != ACPI_UINT32_MAX) {
+
+               /* Validate the user-supplied parameter count */
+
+               if ((user_param_count != required_params_current) &&
+                   (user_param_count != required_params_old)) {
+                       ACPI_WARNING((AE_INFO,
+                                     "%s: Parameter count mismatch - caller passed %d, ACPI requires %d",
+                                     pathname, user_param_count,
+                                     required_params_current));
+               }
+       }
+
+       /*
+        * Only validate the argument count on the first successful evaluation of
+        * the method. This ensures that any warnings will only be emitted during
+        * the very first evaluation of the method/object.
+        */
+       if (node->flags & ANOBJ_EVALUATED) {
+               return;
+       }
+
+       /*
+        * Check that the ASL-defined parameter count is what is expected for
+        * this predefined name.
+        */
        if ((param_count != required_params_current) &&
            (param_count != required_params_old)) {
                ACPI_WARNING((AE_INFO,
-                             "%s: Parameter count mismatch - ASL declared %d, expected %d",
+                             "%s: Parameter count mismatch - ASL declared %d, ACPI requires %d",
                              pathname, param_count, required_params_current));
        }
 }
@@ -307,8 +383,8 @@ const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct
  * FUNCTION:    acpi_ns_check_package
  *
  * PARAMETERS:  Pathname        - Full pathname to the node (for error msgs)
- *              return_object   - Object returned from the evaluation of a
- *                                method or object
+ *              return_object_ptr - Pointer to the object returned from the
+ *                                evaluation of a method or object
  *              Predefined      - Pointer to entry in predefined name table
  *
  * RETURN:      Status
@@ -320,9 +396,10 @@ const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct
 
 static acpi_status
 acpi_ns_check_package(char *pathname,
-                     union acpi_operand_object *return_object,
+                     union acpi_operand_object **return_object_ptr,
                      const union acpi_predefined_info *predefined)
 {
+       union acpi_operand_object *return_object = *return_object_ptr;
        const union acpi_predefined_info *package;
        union acpi_operand_object *sub_package;
        union acpi_operand_object **elements;
@@ -408,7 +485,7 @@ acpi_ns_check_package(char *pathname,
                 * elements must be of the same type
                 */
                for (i = 0; i < count; i++) {
-                       status = acpi_ns_check_object_type(pathname, *elements,
+                       status = acpi_ns_check_object_type(pathname, elements,
                                                           package->ret_info.
                                                           object_type1, i);
                        if (ACPI_FAILURE(status)) {
@@ -441,7 +518,7 @@ acpi_ns_check_package(char *pathname,
 
                                status =
                                    acpi_ns_check_object_type(pathname,
-                                                             *elements,
+                                                             elements,
                                                              package->
                                                              ret_info3.
                                                              object_type[i],
@@ -454,7 +531,7 @@ acpi_ns_check_package(char *pathname,
 
                                status =
                                    acpi_ns_check_object_type(pathname,
-                                                             *elements,
+                                                             elements,
                                                              package->
                                                              ret_info3.
                                                              tail_object_type,
@@ -471,7 +548,7 @@ acpi_ns_check_package(char *pathname,
 
                /* First element is the (Integer) count of sub-packages to follow */
 
-               status = acpi_ns_check_object_type(pathname, *elements,
+               status = acpi_ns_check_object_type(pathname, elements,
                                                   ACPI_RTYPE_INTEGER, 0);
                if (ACPI_FAILURE(status)) {
                        return (status);
@@ -509,7 +586,7 @@ acpi_ns_check_package(char *pathname,
                        /* Each sub-object must be of type Package */
 
                        status =
-                           acpi_ns_check_object_type(pathname, sub_package,
+                           acpi_ns_check_object_type(pathname, &sub_package,
                                                      ACPI_RTYPE_PACKAGE, i);
                        if (ACPI_FAILURE(status)) {
                                return (status);
@@ -567,12 +644,8 @@ acpi_ns_check_package(char *pathname,
                                for (j = 0; j < expected_count; j++) {
                                        status =
                                            acpi_ns_check_object_type(pathname,
-                                                                     sub_elements
-                                                                     [j],
-                                                                     package->
-                                                                     ret_info2.
-                                                                     object_type
-                                                                     [j], j);
+                                               &sub_elements[j],
+                                               package->ret_info2.object_type[j], j);
                                        if (ACPI_FAILURE(status)) {
                                                return (status);
                                        }
@@ -611,7 +684,7 @@ acpi_ns_check_package(char *pathname,
 
                                status =
                                    acpi_ns_check_object_type(pathname,
-                                                             *sub_elements,
+                                                             sub_elements,
                                                              ACPI_RTYPE_INTEGER,
                                                              0);
                                if (ACPI_FAILURE(status)) {
@@ -708,7 +781,7 @@ acpi_ns_check_package_elements(char *pathname,
         * The second group can have a count of zero.
         */
        for (i = 0; i < count1; i++) {
-               status = acpi_ns_check_object_type(pathname, *this_element,
+               status = acpi_ns_check_object_type(pathname, this_element,
                                                   type1, i);
                if (ACPI_FAILURE(status)) {
                        return (status);
@@ -717,7 +790,7 @@ acpi_ns_check_package_elements(char *pathname,
        }
 
        for (i = 0; i < count2; i++) {
-               status = acpi_ns_check_object_type(pathname, *this_element,
+               status = acpi_ns_check_object_type(pathname, this_element,
                                                   type2, (i + count1));
                if (ACPI_FAILURE(status)) {
                        return (status);
@@ -733,8 +806,8 @@ acpi_ns_check_package_elements(char *pathname,
  * FUNCTION:    acpi_ns_check_object_type
  *
  * PARAMETERS:  Pathname        - Full pathname to the node (for error msgs)
- *              return_object   - Object return from the execution of this
- *                                method/object
+ *              return_object_ptr - Pointer to the object returned from the
+ *                                evaluation of a method or object
  *              expected_btypes - Bitmap of expected return type(s)
  *              package_index   - Index of object within parent package (if
  *                                applicable - ACPI_NOT_PACKAGE otherwise)
@@ -748,9 +821,10 @@ acpi_ns_check_package_elements(char *pathname,
 
 static acpi_status
 acpi_ns_check_object_type(char *pathname,
-                         union acpi_operand_object *return_object,
+                         union acpi_operand_object **return_object_ptr,
                          u32 expected_btypes, u32 package_index)
 {
+       union acpi_operand_object *return_object = *return_object_ptr;
        acpi_status status = AE_OK;
        u32 return_btype;
        char type_buffer[48];   /* Room for 5 types */
@@ -814,6 +888,14 @@ acpi_ns_check_object_type(char *pathname,
        /* Is the object one of the expected types? */
 
        if (!(return_btype & expected_btypes)) {
+
+               /* Type mismatch -- attempt repair of the returned object */
+
+               status = acpi_ns_repair_object(expected_btypes, package_index,
+                                              return_object_ptr);
+               if (ACPI_SUCCESS(status)) {
+                       return (status);
+               }
                goto type_error_exit;
        }
 
@@ -898,3 +980,86 @@ acpi_ns_check_reference(char *pathname,
 
        return (AE_AML_OPERAND_TYPE);
 }
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ns_repair_object
+ *
+ * PARAMETERS:  Pathname        - Full pathname to the node (for error msgs)
+ *              package_index   - Used to determine if target is in a package
+ *              return_object_ptr - Pointer to the object returned from the
+ *                                evaluation of a method or object
+ *
+ * RETURN:      Status. AE_OK if repair was successful.
+ *
+ * DESCRIPTION: Attempt to repair/convert a return object of a type that was
+ *              not expected.
+ *
+ ******************************************************************************/
+
+static acpi_status
+acpi_ns_repair_object(u32 expected_btypes,
+                     u32 package_index,
+                     union acpi_operand_object **return_object_ptr)
+{
+       union acpi_operand_object *return_object = *return_object_ptr;
+       union acpi_operand_object *new_object;
+       acpi_size length;
+
+       switch (ACPI_GET_OBJECT_TYPE(return_object)) {
+       case ACPI_TYPE_BUFFER:
+
+               if (!(expected_btypes & ACPI_RTYPE_STRING)) {
+                       return (AE_AML_OPERAND_TYPE);
+               }
+
+               /*
+                * Have a Buffer, expected a String, convert. Use a to_string
+                * conversion, no transform performed on the buffer data. The best
+                * example of this is the _BIF method, where the string data from
+                * the battery is often (incorrectly) returned as buffer object(s).
+                */
+               length = 0;
+               while ((length < return_object->buffer.length) &&
+                      (return_object->buffer.pointer[length])) {
+                       length++;
+               }
+
+               /* Allocate a new string object */
+
+               new_object = acpi_ut_create_string_object(length);
+               if (!new_object) {
+                       return (AE_NO_MEMORY);
+               }
+
+               /*
+                * Copy the raw buffer data with no transform. String is already NULL
+                * terminated at Length+1.
+                */
+               ACPI_MEMCPY(new_object->string.pointer,
+                           return_object->buffer.pointer, length);
+
+               /* Install the new return object */
+
+               acpi_ut_remove_reference(return_object);
+               *return_object_ptr = new_object;
+
+               /*
+                * If the object is a package element, we need to:
+                * 1. Decrement the reference count of the orignal object, it was
+                *    incremented when building the package
+                * 2. Increment the reference count of the new object, it will be
+                *    decremented when releasing the package
+                */
+               if (package_index != ACPI_NOT_PACKAGE) {
+                       acpi_ut_remove_reference(return_object);
+                       acpi_ut_add_reference(new_object);
+               }
+               return (AE_OK);
+
+       default:
+               break;
+       }
+
+       return (AE_AML_OPERAND_TYPE);
+}
similarity index 99%
rename from drivers/acpi/namespace/nssearch.c
rename to drivers/acpi/acpica/nssearch.c
index a9a80bf811b3ecca3239006a41e546b6ce1973de..6fea13f3f52dbf88a7ac664f63cc1bc0a47f99b5 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nssearch")
similarity index 98%
rename from drivers/acpi/namespace/nsutils.c
rename to drivers/acpi/acpica/nsutils.c
index b0817e1127b105c15108ae5055240008b3a0ec6d..3e1149bf4aa5838259bc0161621dbf9c36c8d65b 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/amlcode.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "amlcode.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsutils")
@@ -314,9 +315,15 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info)
         *
         * strlen() + 1 covers the first name_seg, which has no path separator
         */
-       if (acpi_ns_valid_root_prefix(next_external_char[0])) {
+       if (acpi_ns_valid_root_prefix(*next_external_char)) {
                info->fully_qualified = TRUE;
                next_external_char++;
+
+               /* Skip redundant root_prefix, like \\_SB.PCI0.SBRG.EC0 */
+
+               while (acpi_ns_valid_root_prefix(*next_external_char)) {
+                       next_external_char++;
+               }
        } else {
                /*
                 * Handle Carat prefixes
similarity index 99%
rename from drivers/acpi/namespace/nswalk.c
rename to drivers/acpi/acpica/nswalk.c
index 3c905ce26d7d209d93b0b28242fc79b851a18bc7..200895fa272886a4b24a70191ea87894b486499d 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nswalk")
similarity index 99%
rename from drivers/acpi/namespace/nsxfeval.c
rename to drivers/acpi/acpica/nsxfeval.c
index a085cc39c055703bea5b144f01fb5db3478cff7e..22a7171ac1ed5888d0642e4ba20315d5b0a61d2a 100644 (file)
@@ -43,8 +43,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsxfeval")
similarity index 99%
rename from drivers/acpi/namespace/nsxfname.c
rename to drivers/acpi/acpica/nsxfname.c
index 5efa4e7ddb0b18088f8cf68a34ba262f9e8aa677..9589fea2499790bc4fc989baeb3700d49137390e 100644 (file)
@@ -43,7 +43,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsxfname")
similarity index 99%
rename from drivers/acpi/namespace/nsxfobj.c
rename to drivers/acpi/acpica/nsxfobj.c
index 2b375ee80cef794f835e699b2ac61330a45751de..1c7efc15225f6a63dcf4fc5e8ff763bbe8f7e327 100644 (file)
@@ -43,7 +43,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsxfobj")
similarity index 99%
rename from drivers/acpi/parser/psargs.c
rename to drivers/acpi/acpica/psargs.c
index d830b29b85b120ceb87f793f4ddde61db98fbd4f..b161f3544b51eaa82ab98350350b155f0669cf68 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/amlcode.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acdispat.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "amlcode.h"
+#include "acnamesp.h"
+#include "acdispat.h"
 
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("psargs")
similarity index 99%
rename from drivers/acpi/parser/psloop.c
rename to drivers/acpi/acpica/psloop.c
index 4647039a0d8a2c7183f1cc25653a673cf7657ff4..c5f6ce19a4019ae87c683f07cc0fbc1ee3b4563d 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/acdispat.h>
-#include <acpi/amlcode.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "acdispat.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("psloop")
similarity index 99%
rename from drivers/acpi/parser/psopcode.c
rename to drivers/acpi/acpica/psopcode.c
index f425ab30eae83b05fabe07ef7a9ff4ef23e5dabd..3bc3a60194d61cdd91ee3b60def0e67377aa6212 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/acopcode.h>
-#include <acpi/amlcode.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "acopcode.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("psopcode")
similarity index 97%
rename from drivers/acpi/parser/psparse.c
rename to drivers/acpi/acpica/psparse.c
index 68e932f215ea5ef73c407a241a4d11d3367897fa..70838e9b608ccb62cf2310f8a3a4c33dced77883 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/acdispat.h>
-#include <acpi/amlcode.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "acdispat.h"
+#include "amlcode.h"
+#include "acnamesp.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("psparse")
@@ -447,10 +448,22 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                          walk_state, walk_state->parser_state.aml,
                          walk_state->parser_state.aml_size));
 
+       if (!walk_state->parser_state.aml) {
+               return_ACPI_STATUS(AE_NULL_OBJECT);
+       }
+
        /* Create and initialize a new thread state */
 
        thread = acpi_ut_create_thread_state();
        if (!thread) {
+               if (walk_state->method_desc) {
+
+                       /* Executing a control method - additional cleanup */
+
+                       acpi_ds_terminate_control_method(
+                               walk_state->method_desc, walk_state);
+               }
+
                acpi_ds_delete_walk_state(walk_state);
                return_ACPI_STATUS(AE_NO_MEMORY);
        }
similarity index 99%
rename from drivers/acpi/parser/psscope.c
rename to drivers/acpi/acpica/psscope.c
index ee50e67c94431d28d9cd7052ce6ada8a92af020e..2feca5ca95811caf12ca6957ee6f0a9fee2ca918 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
+#include "accommon.h"
+#include "acparser.h"
 
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("psscope")
similarity index 99%
rename from drivers/acpi/parser/pstree.c
rename to drivers/acpi/acpica/pstree.c
index 1dd355ddd182da6b2a903b3579589e23564cb35d..4d3389118ec3b481edab739987352d629de53e17 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/amlcode.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("pstree")
similarity index 99%
rename from drivers/acpi/parser/psutils.c
rename to drivers/acpi/acpica/psutils.c
index 7cf1f65cd5bb833a9c328b94ba27fecb0a57af53..e636e078ad3deb7edd07259df902b5f4bb2618e5 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/amlcode.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("psutils")
similarity index 98%
rename from drivers/acpi/parser/pswalk.c
rename to drivers/acpi/acpica/pswalk.c
index 8b86ad5a3201395e47be1801c6721e087f7a8aae..78b8b791f2ae4c3473cbabd111a6bcb881ce7917 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
+#include "accommon.h"
+#include "acparser.h"
 
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("pswalk")
similarity index 90%
rename from drivers/acpi/parser/psxface.c
rename to drivers/acpi/acpica/psxface.c
index 270469aae8429201df4edfae11db91d8c5628133..ff06032c0f061eb0fba27442a13fe5dbb559c214 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
-#include <acpi/acdispat.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acparser.h"
+#include "acdispat.h"
+#include "acinterp.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("psxface")
@@ -278,6 +280,38 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
                goto cleanup;
        }
 
+       /* Invoke an internal method if necessary */
+
+       if (info->obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) {
+               status = info->obj_desc->method.implementation(walk_state);
+               info->return_object = walk_state->return_desc;
+
+               /* Cleanup states */
+
+               acpi_ds_scope_stack_clear(walk_state);
+               acpi_ps_cleanup_scope(&walk_state->parser_state);
+               acpi_ds_terminate_control_method(walk_state->method_desc,
+                                                walk_state);
+               acpi_ds_delete_walk_state(walk_state);
+               goto cleanup;
+       }
+
+       /*
+        * Start method evaluation with an implicit return of zero.
+        * This is done for Windows compatibility.
+        */
+       if (acpi_gbl_enable_interpreter_slack) {
+               walk_state->implicit_return_obj =
+                   acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
+               if (!walk_state->implicit_return_obj) {
+                       status = AE_NO_MEMORY;
+                       acpi_ds_delete_walk_state(walk_state);
+                       goto cleanup;
+               }
+
+               walk_state->implicit_return_obj->integer.value = 0;
+       }
+
        /* Parse the AML */
 
        status = acpi_ps_parse_aml(walk_state);
similarity index 99%
rename from drivers/acpi/resources/rsaddr.c
rename to drivers/acpi/acpica/rsaddr.c
index 7f96332822bf2cff8bab0a3a88d1ed1c19c7329a..1e437bfd8db5c3a1f0e95473d18cec813b673999 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acresrc.h>
+#include "accommon.h"
+#include "acresrc.h"
 
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rsaddr")
similarity index 99%
rename from drivers/acpi/resources/rscalc.c
rename to drivers/acpi/acpica/rscalc.c
index 8eaaecf9200939ea4cb72b9a2f9842e4b80af5a7..52865ee6bc773824065fd9fe2152baafd684fbbb 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acresrc.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acresrc.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rscalc")
similarity index 99%
rename from drivers/acpi/resources/rscreate.c
rename to drivers/acpi/acpica/rscreate.c
index c0bbfa2c419319f92d9f561a98afe0eabb296971..9eb3a2a6840854fa0fcef1f8d1a1ad89fe72c221 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acresrc.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acresrc.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rscreate")
similarity index 99%
rename from drivers/acpi/resources/rsdump.c
rename to drivers/acpi/acpica/rsdump.c
index 6bbbb7b8941a4f77a8456dc308f62f1625670934..3f0ca5a12d345f870cd7c9d3adddce5c6e9f5fae 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acresrc.h>
+#include "accommon.h"
+#include "acresrc.h"
 
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rsdump")
similarity index 99%
rename from drivers/acpi/resources/rsinfo.c
rename to drivers/acpi/acpica/rsinfo.c
index 3f0a1fedbe0ec96a0671f25e4a343f1df07f9dec..77b25fdb459c1e5036026854ed710f28363e21c9 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acresrc.h>
+#include "accommon.h"
+#include "acresrc.h"
 
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rsinfo")
similarity index 99%
rename from drivers/acpi/resources/rsio.c
rename to drivers/acpi/acpica/rsio.c
index b66d42e7402e4430a7f85f951e2b57bafcf8f934..35a49aa956096c8d0d5bf8cb9e4e4c4bab9bdb72 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acresrc.h>
+#include "accommon.h"
+#include "acresrc.h"
 
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rsio")
similarity index 99%
rename from drivers/acpi/resources/rsirq.c
rename to drivers/acpi/acpica/rsirq.c
index a8805efc036658d4622dac5dadfb631fcd6493a6..2e0256983aa60b7edf6ee5a21ad1e5896a8e0902 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acresrc.h>
+#include "accommon.h"
+#include "acresrc.h"
 
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rsirq")
similarity index 99%
rename from drivers/acpi/resources/rslist.c
rename to drivers/acpi/acpica/rslist.c
index b78c7e797a1955ad8be12526d7657d926d98e237..1b1dbc69f08719921cd58a1ff0eb20b0a57ff97f 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acresrc.h>
+#include "accommon.h"
+#include "acresrc.h"
 
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rslist")
similarity index 99%
rename from drivers/acpi/resources/rsmemory.c
rename to drivers/acpi/acpica/rsmemory.c
index 63b21abd90bb42c994a43b7895519344cabad853..ddc76cebdc925c7457ee4632c327caa2a325bb1c 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acresrc.h>
+#include "accommon.h"
+#include "acresrc.h"
 
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rsmemory")
similarity index 99%
rename from drivers/acpi/resources/rsmisc.c
rename to drivers/acpi/acpica/rsmisc.c
index 96a6c0353255fed289e059dab481624f651681a3..5bc49a553284bd3abb7804e73cce1a5bb7e84727 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acresrc.h>
+#include "accommon.h"
+#include "acresrc.h"
 
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rsmisc")
similarity index 99%
rename from drivers/acpi/resources/rsutils.c
rename to drivers/acpi/acpica/rsutils.c
index f7b3bcd59ba788e341c9b5aca199a108aeed873b..bc03d59668298df64502fa3292d22a7e18b25820 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acresrc.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "acresrc.h"
 
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rsutils")
similarity index 99%
rename from drivers/acpi/resources/rsxface.c
rename to drivers/acpi/acpica/rsxface.c
index f59f4c4e034c023c46f99691b09404698b4c8918..69a2aa5b5d831ae83ac0ba901732a121f918ad16 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acresrc.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acresrc.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rsxface")
similarity index 67%
rename from drivers/acpi/tables/tbfadt.c
rename to drivers/acpi/acpica/tbfadt.c
index 2817158fb6a1b7cd8f2b2ad01f522e19af67b9f1..3636e4f8fb7331e66f6b59f6aa059b9b820fb620 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_TABLES
 ACPI_MODULE_NAME("tbfadt")
 
 /* Local prototypes */
-static void inline
+static inline void
 acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
-                            u8 byte_width, u64 address);
+                            u8 space_id, u8 byte_width, u64 address);
 
 static void acpi_tb_convert_fadt(void);
 
@@ -60,9 +61,10 @@ static void acpi_tb_validate_fadt(void);
 
 typedef struct acpi_fadt_info {
        char *name;
-       u8 target;
-       u8 source;
+       u8 address64;
+       u8 address32;
        u8 length;
+       u8 default_length;
        u8 type;
 
 } acpi_fadt_info;
@@ -71,37 +73,61 @@ typedef struct acpi_fadt_info {
 #define ACPI_FADT_SEPARATE_LENGTH   2
 
 static struct acpi_fadt_info fadt_info_table[] = {
-       {"Pm1aEventBlock", ACPI_FADT_OFFSET(xpm1a_event_block),
+       {"Pm1aEventBlock",
+        ACPI_FADT_OFFSET(xpm1a_event_block),
         ACPI_FADT_OFFSET(pm1a_event_block),
-        ACPI_FADT_OFFSET(pm1_event_length), ACPI_FADT_REQUIRED},
+        ACPI_FADT_OFFSET(pm1_event_length),
+        ACPI_PM1_REGISTER_WIDTH * 2,   /* Enable + Status register */
+        ACPI_FADT_REQUIRED},
 
-       {"Pm1bEventBlock", ACPI_FADT_OFFSET(xpm1b_event_block),
+       {"Pm1bEventBlock",
+        ACPI_FADT_OFFSET(xpm1b_event_block),
         ACPI_FADT_OFFSET(pm1b_event_block),
-        ACPI_FADT_OFFSET(pm1_event_length), 0},
+        ACPI_FADT_OFFSET(pm1_event_length),
+        ACPI_PM1_REGISTER_WIDTH * 2,   /* Enable + Status register */
+        0},
 
-       {"Pm1aControlBlock", ACPI_FADT_OFFSET(xpm1a_control_block),
+       {"Pm1aControlBlock",
+        ACPI_FADT_OFFSET(xpm1a_control_block),
         ACPI_FADT_OFFSET(pm1a_control_block),
-        ACPI_FADT_OFFSET(pm1_control_length), ACPI_FADT_REQUIRED},
+        ACPI_FADT_OFFSET(pm1_control_length),
+        ACPI_PM1_REGISTER_WIDTH,
+        ACPI_FADT_REQUIRED},
 
-       {"Pm1bControlBlock", ACPI_FADT_OFFSET(xpm1b_control_block),
+       {"Pm1bControlBlock",
+        ACPI_FADT_OFFSET(xpm1b_control_block),
         ACPI_FADT_OFFSET(pm1b_control_block),
-        ACPI_FADT_OFFSET(pm1_control_length), 0},
+        ACPI_FADT_OFFSET(pm1_control_length),
+        ACPI_PM1_REGISTER_WIDTH,
+        0},
 
-       {"Pm2ControlBlock", ACPI_FADT_OFFSET(xpm2_control_block),
+       {"Pm2ControlBlock",
+        ACPI_FADT_OFFSET(xpm2_control_block),
         ACPI_FADT_OFFSET(pm2_control_block),
-        ACPI_FADT_OFFSET(pm2_control_length), ACPI_FADT_SEPARATE_LENGTH},
+        ACPI_FADT_OFFSET(pm2_control_length),
+        ACPI_PM2_REGISTER_WIDTH,
+        ACPI_FADT_SEPARATE_LENGTH},
 
-       {"PmTimerBlock", ACPI_FADT_OFFSET(xpm_timer_block),
+       {"PmTimerBlock",
+        ACPI_FADT_OFFSET(xpm_timer_block),
         ACPI_FADT_OFFSET(pm_timer_block),
-        ACPI_FADT_OFFSET(pm_timer_length), ACPI_FADT_REQUIRED},
+        ACPI_FADT_OFFSET(pm_timer_length),
+        ACPI_PM_TIMER_WIDTH,
+        ACPI_FADT_REQUIRED},
 
-       {"Gpe0Block", ACPI_FADT_OFFSET(xgpe0_block),
+       {"Gpe0Block",
+        ACPI_FADT_OFFSET(xgpe0_block),
         ACPI_FADT_OFFSET(gpe0_block),
-        ACPI_FADT_OFFSET(gpe0_block_length), ACPI_FADT_SEPARATE_LENGTH},
+        ACPI_FADT_OFFSET(gpe0_block_length),
+        0,
+        ACPI_FADT_SEPARATE_LENGTH},
 
-       {"Gpe1Block", ACPI_FADT_OFFSET(xgpe1_block),
+       {"Gpe1Block",
+        ACPI_FADT_OFFSET(xgpe1_block),
         ACPI_FADT_OFFSET(gpe1_block),
-        ACPI_FADT_OFFSET(gpe1_block_length), ACPI_FADT_SEPARATE_LENGTH}
+        ACPI_FADT_OFFSET(gpe1_block_length),
+        0,
+        ACPI_FADT_SEPARATE_LENGTH}
 };
 
 #define ACPI_FADT_INFO_ENTRIES        (sizeof (fadt_info_table) / sizeof (struct acpi_fadt_info))
@@ -122,9 +148,9 @@ static struct acpi_fadt_info fadt_info_table[] = {
  *
  ******************************************************************************/
 
-static void inline
+static inline void
 acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
-                            u8 byte_width, u64 address)
+                            u8 space_id, u8 byte_width, u64 address)
 {
 
        /*
@@ -135,10 +161,10 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
 
        /* All other fields are byte-wide */
 
-       generic_address->space_id = ACPI_ADR_SPACE_SYSTEM_IO;
-       generic_address->bit_width = byte_width << 3;
+       generic_address->space_id = space_id;
+       generic_address->bit_width = (u8)ACPI_MUL_8(byte_width);
        generic_address->bit_offset = 0;
-       generic_address->access_width = 0;
+       generic_address->access_width = 0;      /* Access width ANY */
 }
 
 /*******************************************************************************
@@ -225,7 +251,8 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
         */
        if (length > sizeof(struct acpi_table_fadt)) {
                ACPI_WARNING((AE_INFO,
-                             "FADT (revision %u) is longer than ACPI 2.0 version, truncating length 0x%X to 0x%zX",
+                             "FADT (revision %u) is longer than ACPI 2.0 version, "
+                             "truncating length 0x%X to 0x%zX",
                              table->revision, (unsigned)length,
                              sizeof(struct acpi_table_fadt)));
        }
@@ -244,7 +271,6 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
         * 2) Validate some of the important values within the FADT
         */
        acpi_tb_convert_fadt();
-       acpi_tb_validate_fadt();
 }
 
 /*******************************************************************************
@@ -278,22 +304,36 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
 
 static void acpi_tb_convert_fadt(void)
 {
-       u8 pm1_register_length;
-       struct acpi_generic_address *target;
+       u8 pm1_register_bit_width;
+       u8 pm1_register_byte_width;
+       struct acpi_generic_address *target64;
        u32 i;
 
        /* Update the local FADT table header length */
 
        acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
 
-       /* Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary */
-
+       /*
+        * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
+        * Later code will always use the X 64-bit field. Also, check for an
+        * address mismatch between the 32-bit and 64-bit address fields
+        * (FIRMWARE_CTRL/X_FIRMWARE_CTRL, DSDT/X_DSDT) which would indicate
+        * the presence of two FACS or two DSDT tables.
+        */
        if (!acpi_gbl_FADT.Xfacs) {
                acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs;
+       } else if (acpi_gbl_FADT.facs &&
+                  (acpi_gbl_FADT.Xfacs != (u64) acpi_gbl_FADT.facs)) {
+               ACPI_WARNING((AE_INFO,
+                   "32/64 FACS address mismatch in FADT - two FACS tables!"));
        }
 
        if (!acpi_gbl_FADT.Xdsdt) {
                acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt;
+       } else if (acpi_gbl_FADT.dsdt &&
+                  (acpi_gbl_FADT.Xdsdt != (u64) acpi_gbl_FADT.dsdt)) {
+               ACPI_WARNING((AE_INFO,
+                   "32/64 DSDT address mismatch in FADT - two DSDT tables!"));
        }
 
        /*
@@ -312,18 +352,23 @@ static void acpi_tb_convert_fadt(void)
        }
 
        /*
-        * Expand the ACPI 1.0 32-bit V1.0 addresses to the ACPI 2.0 64-bit "X"
-        * generic address structures as necessary.
+        * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
+        * generic address structures as necessary. Later code will always use
+        * the 64-bit address structures.
         */
        for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
-               target =
+               target64 =
                    ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT,
-                                fadt_info_table[i].target);
+                                fadt_info_table[i].address64);
 
-               /* Expand only if the X target is null */
+               /* Expand only if the 64-bit X target is null */
 
-               if (!target->address) {
-                       acpi_tb_init_generic_address(target,
+               if (!target64->address) {
+
+                       /* The space_id is always I/O for the 32-bit legacy address fields */
+
+                       acpi_tb_init_generic_address(target64,
+                                                    ACPI_ADR_SPACE_SYSTEM_IO,
                                                     *ACPI_ADD_PTR(u8,
                                                                   &acpi_gbl_FADT,
                                                                   fadt_info_table
@@ -332,10 +377,63 @@ static void acpi_tb_convert_fadt(void)
                                                                          &acpi_gbl_FADT,
                                                                          fadt_info_table
                                                                          [i].
-                                                                         source));
+                                                                         address32));
+               }
+       }
+
+       /* Validate FADT values now, before we make any changes */
+
+       acpi_tb_validate_fadt();
+
+       /*
+        * Optionally check all register lengths against the default values and
+        * update them if they are incorrect.
+        */
+       if (acpi_gbl_use_default_register_widths) {
+               for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
+                       target64 =
+                           ACPI_ADD_PTR(struct acpi_generic_address,
+                                        &acpi_gbl_FADT,
+                                        fadt_info_table[i].address64);
+
+                       /*
+                        * If a valid register (Address != 0) and the (default_length > 0)
+                        * (Not a GPE register), then check the width against the default.
+                        */
+                       if ((target64->address) &&
+                           (fadt_info_table[i].default_length > 0) &&
+                           (fadt_info_table[i].default_length !=
+                            target64->bit_width)) {
+                               ACPI_WARNING((AE_INFO,
+                                             "Invalid length for %s: %d, using default %d",
+                                             fadt_info_table[i].name,
+                                             target64->bit_width,
+                                             fadt_info_table[i].
+                                             default_length));
+
+                               /* Incorrect size, set width to the default */
+
+                               target64->bit_width =
+                                   fadt_info_table[i].default_length;
+                       }
                }
        }
 
+       /*
+        * Get the length of the individual PM1 registers (enable and status).
+        * Each register is defined to be (event block length / 2).
+        */
+       pm1_register_bit_width =
+           (u8)ACPI_DIV_2(acpi_gbl_FADT.xpm1a_event_block.bit_width);
+       pm1_register_byte_width = (u8)ACPI_DIV_8(pm1_register_bit_width);
+
+       /*
+        * Adjust the lengths of the PM1 Event Blocks so that they can be used to
+        * access the PM1 status register(s). Use (width / 2)
+        */
+       acpi_gbl_FADT.xpm1a_event_block.bit_width = pm1_register_bit_width;
+       acpi_gbl_FADT.xpm1b_event_block.bit_width = pm1_register_bit_width;
+
        /*
         * Calculate separate GAS structs for the PM1 Enable registers.
         * These addresses do not appear (directly) in the FADT, so it is
@@ -356,14 +454,14 @@ static void acpi_tb_convert_fadt(void)
                       " PM1_EVT_LEN (%u)\n",
                       acpi_gbl_FADT.xpm1a_event_block.bit_width,
                       acpi_gbl_FADT.pm1_event_length);
-       pm1_register_length = (u8) ACPI_DIV_2(acpi_gbl_FADT.pm1_event_length);
 
        /* The PM1A register block is required */
 
        acpi_tb_init_generic_address(&acpi_gbl_xpm1a_enable,
-                                    pm1_register_length,
+                                    acpi_gbl_FADT.xpm1a_event_block.space_id,
+                                    pm1_register_byte_width,
                                     (acpi_gbl_FADT.xpm1a_event_block.address +
-                                     pm1_register_length));
+                                     pm1_register_byte_width));
        /* Don't forget to copy space_id of the GAS */
        acpi_gbl_xpm1a_enable.space_id =
            acpi_gbl_FADT.xpm1a_event_block.space_id;
@@ -379,9 +477,10 @@ static void acpi_tb_convert_fadt(void)
                               acpi_gbl_FADT.xpm1b_event_block.bit_width,
                               acpi_gbl_FADT.pm1_event_length);
                acpi_tb_init_generic_address(&acpi_gbl_xpm1b_enable,
-                                            pm1_register_length,
+                                            acpi_gbl_FADT.xpm1b_event_block.space_id,
+                                            pm1_register_byte_width,
                                             (acpi_gbl_FADT.xpm1b_event_block.
-                                             address + pm1_register_length));
+                                             address + pm1_register_byte_width));
                /* Don't forget to copy space_id of the GAS */
                acpi_gbl_xpm1b_enable.space_id =
                    acpi_gbl_FADT.xpm1b_event_block.space_id;
@@ -411,26 +510,63 @@ static void acpi_tb_convert_fadt(void)
 
 static void acpi_tb_validate_fadt(void)
 {
+       char *name;
        u32 *address32;
        struct acpi_generic_address *address64;
        u8 length;
        u32 i;
 
-       /* Examine all of the 64-bit extended address fields (X fields) */
+       /*
+        * Check for FACS and DSDT address mismatches. An address mismatch between
+        * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and
+        * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables.
+        */
+       if (acpi_gbl_FADT.facs &&
+           (acpi_gbl_FADT.Xfacs != (u64) acpi_gbl_FADT.facs)) {
+               ACPI_WARNING((AE_INFO,
+                             "32/64X FACS address mismatch in FADT - "
+                             "two FACS tables! %8.8X/%8.8X%8.8X",
+                             acpi_gbl_FADT.facs,
+                             ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs)));
+       }
 
-       for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
+       if (acpi_gbl_FADT.dsdt &&
+           (acpi_gbl_FADT.Xdsdt != (u64) acpi_gbl_FADT.dsdt)) {
+               ACPI_WARNING((AE_INFO,
+                             "32/64X DSDT address mismatch in FADT - "
+                             "two DSDT tables! %8.8X/%8.8X%8.8X",
+                             acpi_gbl_FADT.dsdt,
+                             ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt)));
+       }
 
-               /* Generate pointers to the 32-bit and 64-bit addresses and get the length */
+       /* Examine all of the 64-bit extended address fields (X fields) */
 
-               address64 =
-                   ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT,
-                                fadt_info_table[i].target);
+       for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
+               /*
+                * Generate pointers to the 32-bit and 64-bit addresses, get the
+                * register length (width), and the register name
+                */
+               address64 = ACPI_ADD_PTR(struct acpi_generic_address,
+                                        &acpi_gbl_FADT,
+                                        fadt_info_table[i].address64);
                address32 =
                    ACPI_ADD_PTR(u32, &acpi_gbl_FADT,
-                                fadt_info_table[i].source);
+                                fadt_info_table[i].address32);
                length =
                    *ACPI_ADD_PTR(u8, &acpi_gbl_FADT,
                                  fadt_info_table[i].length);
+               name = fadt_info_table[i].name;
+
+               /*
+                * For each extended field, check for length mismatch between the
+                * legacy length field and the corresponding 64-bit X length field.
+                */
+               if (address64 && (address64->bit_width != ACPI_MUL_8(length))) {
+                       ACPI_WARNING((AE_INFO,
+                                     "32/64X length mismatch in %s: %d/%d",
+                                     name, ACPI_MUL_8(length),
+                                     address64->bit_width));
+               }
 
                if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) {
                        /*
@@ -439,8 +575,8 @@ static void acpi_tb_validate_fadt(void)
                         */
                        if (!address64->address || !length) {
                                ACPI_ERROR((AE_INFO,
-                                           "Required field \"%s\" has zero address and/or length: %8.8X%8.8X/%X",
-                                           fadt_info_table[i].name,
+                                           "Required field %s has zero address and/or length: %8.8X%8.8X/%X",
+                                           name,
                                            ACPI_FORMAT_UINT64(address64->
                                                               address),
                                            length));
@@ -453,8 +589,8 @@ static void acpi_tb_validate_fadt(void)
                        if ((address64->address && !length)
                            || (!address64->address && length)) {
                                ACPI_WARNING((AE_INFO,
-                                             "Optional field \"%s\" has zero address or length: %8.8X%8.8X/%X",
-                                             fadt_info_table[i].name,
+                                             "Optional field %s has zero address or length: %8.8X%8.8X/%X",
+                                             name,
                                              ACPI_FORMAT_UINT64(address64->
                                                                 address),
                                              length));
@@ -466,8 +602,8 @@ static void acpi_tb_validate_fadt(void)
                if (address64->address && *address32 &&
                    (address64->address != (u64) * address32)) {
                        ACPI_ERROR((AE_INFO,
-                                   "32/64X address mismatch in \"%s\": [%8.8X] [%8.8X%8.8X], using 64X",
-                                   fadt_info_table[i].name, *address32,
+                                   "32/64X address mismatch in %s: %8.8X/%8.8X%8.8X, using 64X",
+                                   name, *address32,
                                    ACPI_FORMAT_UINT64(address64->address)));
                }
        }
similarity index 99%
rename from drivers/acpi/tables/tbfind.c
rename to drivers/acpi/acpica/tbfind.c
index 531584defbb826596c742acb2b5c9a90a3b45fc1..1054dfd49207dcc51910ae1846dd2cf16a20b290 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_TABLES
 ACPI_MODULE_NAME("tbfind")
similarity index 99%
rename from drivers/acpi/tables/tbinstal.c
rename to drivers/acpi/acpica/tbinstal.c
index 18747ce8dd2f2b15b83e6e5465fc8b34c8118258..37374b21969d4574c298945a869e3a714795529f 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_TABLES
 ACPI_MODULE_NAME("tbinstal")
similarity index 96%
rename from drivers/acpi/tables/tbutils.c
rename to drivers/acpi/acpica/tbutils.c
index 0cc92ef5236fc261a2167a5a6aa8acb9fbe43d55..3a8d8d2eee9210ee17ce21e2892b722837152f36 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_TABLES
 ACPI_MODULE_NAME("tbutils")
@@ -111,6 +112,30 @@ acpi_tb_check_xsdt(acpi_physical_address address)
                return AE_OK;
 }
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_tb_initialize_facs
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Create a permanent mapping for the FADT and save it in a global
+ *              for accessing the Global Lock and Firmware Waking Vector
+ *
+ ******************************************************************************/
+
+acpi_status acpi_tb_initialize_facs(void)
+{
+       acpi_status status;
+
+       status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
+                                        ACPI_CAST_INDIRECT_PTR(struct
+                                                               acpi_table_header,
+                                                               &acpi_gbl_FACS));
+       return status;
+}
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_tb_tables_loaded
similarity index 99%
rename from drivers/acpi/tables/tbxface.c
rename to drivers/acpi/acpica/tbxface.c
index fd7770aa10618e256816350fe2638b78bb9af450..c3e841f3cde924239ce34f94a75818cfc194a211 100644 (file)
@@ -43,8 +43,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_TABLES
 ACPI_MODULE_NAME("tbxface")
similarity index 99%
rename from drivers/acpi/tables/tbxfroot.c
rename to drivers/acpi/acpica/tbxfroot.c
index 2d157e0f98d2716d3965f4390fcf6db1ae60edba..b7fc8dd43341eba70c124d68a7052b9090f4fdca 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_TABLES
 ACPI_MODULE_NAME("tbxfroot")
similarity index 99%
rename from drivers/acpi/utilities/utalloc.c
rename to drivers/acpi/acpica/utalloc.c
index 241c535c1753bb7f844a14805a8aaea88960e586..7580f6b3069ec5ecaf7303be5ff88eb5087683c4 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acdebug.h>
+#include "accommon.h"
+#include "acdebug.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utalloc")
similarity index 99%
rename from drivers/acpi/utilities/utcopy.c
rename to drivers/acpi/acpica/utcopy.c
index 5b2f7c27b705f2714c9fce18f997837ff8bdf6f3..b0dcfd3c872a453ef06f54950859e6e00fc7434d 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
 
 #define _COMPONENT          ACPI_UTILITIES
similarity index 89%
rename from drivers/acpi/utilities/utdebug.c
rename to drivers/acpi/acpica/utdebug.c
index fd66ecb6741e3a2675a0e2c0358192807c8b2e5e..38821f53042c34c215d6776ba6599434b3273f5f 100644 (file)
@@ -42,6 +42,7 @@
  */
 
 #include <acpi/acpi.h>
+#include "accommon.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utdebug")
@@ -136,7 +137,7 @@ static const char *acpi_ut_trim_function_name(const char *function_name)
 
 /*******************************************************************************
  *
- * FUNCTION:    acpi_ut_debug_print
+ * FUNCTION:    acpi_debug_print
  *
  * PARAMETERS:  requested_debug_level - Requested debug print level
  *              line_number         - Caller's line number (for error output)
@@ -154,11 +155,11 @@ static const char *acpi_ut_trim_function_name(const char *function_name)
  ******************************************************************************/
 
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_debug_print(u32 requested_debug_level,
-                   u32 line_number,
-                   const char *function_name,
-                   const char *module_name,
-                   u32 component_id, const char *format, ...)
+acpi_debug_print(u32 requested_debug_level,
+                u32 line_number,
+                const char *function_name,
+                const char *module_name,
+                u32 component_id, const char *format, ...)
 {
        acpi_thread_id thread_id;
        va_list args;
@@ -205,11 +206,11 @@ acpi_ut_debug_print(u32 requested_debug_level,
        va_end(args);
 }
 
-ACPI_EXPORT_SYMBOL(acpi_ut_debug_print)
+ACPI_EXPORT_SYMBOL(acpi_debug_print)
 
 /*******************************************************************************
  *
- * FUNCTION:    acpi_ut_debug_print_raw
+ * FUNCTION:    acpi_debug_print_raw
  *
  * PARAMETERS:  requested_debug_level - Requested debug print level
  *              line_number         - Caller's line number
@@ -226,11 +227,11 @@ ACPI_EXPORT_SYMBOL(acpi_ut_debug_print)
  *
  ******************************************************************************/
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_debug_print_raw(u32 requested_debug_level,
-                       u32 line_number,
-                       const char *function_name,
-                       const char *module_name,
-                       u32 component_id, const char *format, ...)
+acpi_debug_print_raw(u32 requested_debug_level,
+                    u32 line_number,
+                    const char *function_name,
+                    const char *module_name,
+                    u32 component_id, const char *format, ...)
 {
        va_list args;
 
@@ -244,7 +245,7 @@ acpi_ut_debug_print_raw(u32 requested_debug_level,
        va_end(args);
 }
 
-ACPI_EXPORT_SYMBOL(acpi_ut_debug_print_raw)
+ACPI_EXPORT_SYMBOL(acpi_debug_print_raw)
 
 /*******************************************************************************
  *
@@ -270,9 +271,9 @@ acpi_ut_trace(u32 line_number,
        acpi_gbl_nesting_level++;
        acpi_ut_track_stack_ptr();
 
-       acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
-                           line_number, function_name, module_name,
-                           component_id, "%s\n", acpi_gbl_fn_entry_str);
+       acpi_debug_print(ACPI_LV_FUNCTIONS,
+                        line_number, function_name, module_name, component_id,
+                        "%s\n", acpi_gbl_fn_entry_str);
 }
 
 ACPI_EXPORT_SYMBOL(acpi_ut_trace)
@@ -301,10 +302,9 @@ acpi_ut_trace_ptr(u32 line_number,
        acpi_gbl_nesting_level++;
        acpi_ut_track_stack_ptr();
 
-       acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
-                           line_number, function_name, module_name,
-                           component_id, "%s %p\n", acpi_gbl_fn_entry_str,
-                           pointer);
+       acpi_debug_print(ACPI_LV_FUNCTIONS,
+                        line_number, function_name, module_name, component_id,
+                        "%s %p\n", acpi_gbl_fn_entry_str, pointer);
 }
 
 /*******************************************************************************
@@ -333,10 +333,9 @@ acpi_ut_trace_str(u32 line_number,
        acpi_gbl_nesting_level++;
        acpi_ut_track_stack_ptr();
 
-       acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
-                           line_number, function_name, module_name,
-                           component_id, "%s %s\n", acpi_gbl_fn_entry_str,
-                           string);
+       acpi_debug_print(ACPI_LV_FUNCTIONS,
+                        line_number, function_name, module_name, component_id,
+                        "%s %s\n", acpi_gbl_fn_entry_str, string);
 }
 
 /*******************************************************************************
@@ -365,10 +364,9 @@ acpi_ut_trace_u32(u32 line_number,
        acpi_gbl_nesting_level++;
        acpi_ut_track_stack_ptr();
 
-       acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
-                           line_number, function_name, module_name,
-                           component_id, "%s %08X\n", acpi_gbl_fn_entry_str,
-                           integer);
+       acpi_debug_print(ACPI_LV_FUNCTIONS,
+                        line_number, function_name, module_name, component_id,
+                        "%s %08X\n", acpi_gbl_fn_entry_str, integer);
 }
 
 /*******************************************************************************
@@ -393,9 +391,9 @@ acpi_ut_exit(u32 line_number,
             const char *module_name, u32 component_id)
 {
 
-       acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
-                           line_number, function_name, module_name,
-                           component_id, "%s\n", acpi_gbl_fn_exit_str);
+       acpi_debug_print(ACPI_LV_FUNCTIONS,
+                        line_number, function_name, module_name, component_id,
+                        "%s\n", acpi_gbl_fn_exit_str);
 
        acpi_gbl_nesting_level--;
 }
@@ -426,17 +424,16 @@ acpi_ut_status_exit(u32 line_number,
 {
 
        if (ACPI_SUCCESS(status)) {
-               acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
-                                   line_number, function_name, module_name,
-                                   component_id, "%s %s\n",
-                                   acpi_gbl_fn_exit_str,
-                                   acpi_format_exception(status));
+               acpi_debug_print(ACPI_LV_FUNCTIONS,
+                                line_number, function_name, module_name,
+                                component_id, "%s %s\n", acpi_gbl_fn_exit_str,
+                                acpi_format_exception(status));
        } else {
-               acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
-                                   line_number, function_name, module_name,
-                                   component_id, "%s ****Exception****: %s\n",
-                                   acpi_gbl_fn_exit_str,
-                                   acpi_format_exception(status));
+               acpi_debug_print(ACPI_LV_FUNCTIONS,
+                                line_number, function_name, module_name,
+                                component_id, "%s ****Exception****: %s\n",
+                                acpi_gbl_fn_exit_str,
+                                acpi_format_exception(status));
        }
 
        acpi_gbl_nesting_level--;
@@ -467,10 +464,10 @@ acpi_ut_value_exit(u32 line_number,
                   u32 component_id, acpi_integer value)
 {
 
-       acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
-                           line_number, function_name, module_name,
-                           component_id, "%s %8.8X%8.8X\n",
-                           acpi_gbl_fn_exit_str, ACPI_FORMAT_UINT64(value));
+       acpi_debug_print(ACPI_LV_FUNCTIONS,
+                        line_number, function_name, module_name, component_id,
+                        "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str,
+                        ACPI_FORMAT_UINT64(value));
 
        acpi_gbl_nesting_level--;
 }
@@ -499,9 +496,9 @@ acpi_ut_ptr_exit(u32 line_number,
                 const char *module_name, u32 component_id, u8 *ptr)
 {
 
-       acpi_ut_debug_print(ACPI_LV_FUNCTIONS,
-                           line_number, function_name, module_name,
-                           component_id, "%s %p\n", acpi_gbl_fn_exit_str, ptr);
+       acpi_debug_print(ACPI_LV_FUNCTIONS,
+                        line_number, function_name, module_name, component_id,
+                        "%s %p\n", acpi_gbl_fn_exit_str, ptr);
 
        acpi_gbl_nesting_level--;
 }
similarity index 99%
rename from drivers/acpi/utilities/utdelete.c
rename to drivers/acpi/acpica/utdelete.c
index d197c6b29e170e2381e2fcd0765c4368e090121a..a0be9e39531e0d2eddab79736d0dd6b8e1e56622 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acevents.h>
+#include "accommon.h"
+#include "acinterp.h"
+#include "acnamesp.h"
+#include "acevents.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utdelete")
similarity index 99%
rename from drivers/acpi/utilities/uteval.c
rename to drivers/acpi/acpica/uteval.c
index 352747e49c7a623930fd17491533a436394099ad..da9450bc60f7062e05f0f0ba385572525e5a4f23 100644 (file)
@@ -42,8 +42,9 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acinterp.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("uteval")
@@ -129,7 +130,7 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
 
                        /* The interface is supported */
 
-                       return_ACPI_STATUS(AE_CTRL_TERMINATE);
+                       return_ACPI_STATUS(AE_OK);
                }
        }
 
@@ -143,13 +144,13 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
 
                /* The interface is supported */
 
-               return_ACPI_STATUS(AE_CTRL_TERMINATE);
+               return_ACPI_STATUS(AE_OK);
        }
 
        /* The interface is not supported */
 
        return_desc->integer.value = 0;
-       return_ACPI_STATUS(AE_CTRL_TERMINATE);
+       return_ACPI_STATUS(AE_OK);
 }
 
 /*******************************************************************************
similarity index 99%
rename from drivers/acpi/utilities/utglobal.c
rename to drivers/acpi/acpica/utglobal.c
index 670551b95e56e44fecfc075d9cbd5255a2aebc55..a3ab9d9da29971caf16195765f2058edce83d05c 100644 (file)
 #define DEFINE_ACPI_GLOBALS
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
-ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
 #define _COMPONENT          ACPI_UTILITIES
-    ACPI_MODULE_NAME("utglobal")
+ACPI_MODULE_NAME("utglobal")
 
 /*******************************************************************************
  *
@@ -64,7 +64,7 @@ u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT;
 
 /* Debug switch - layer (component) mask */
 
-u32 acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS;
+u32 acpi_dbg_layer = 0;
 u32 acpi_gbl_nesting_level = 0;
 
 /* Debugger globals */
@@ -352,7 +352,7 @@ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = {
        "PCI_Config",
        "EmbeddedControl",
        "SMBus",
-       "CMOS",
+       "SystemCMOS",
        "PCIBARTarget",
        "DataTable"
 };
@@ -756,6 +756,7 @@ acpi_status acpi_ut_init_globals(void)
        acpi_gbl_gpe_xrupt_list_head = NULL;
        acpi_gbl_gpe_fadt_blocks[0] = NULL;
        acpi_gbl_gpe_fadt_blocks[1] = NULL;
+       acpi_current_gpe_count = 0;
 
        /* Global handlers */
 
@@ -771,6 +772,7 @@ acpi_status acpi_ut_init_globals(void)
        acpi_gbl_global_lock_mutex = NULL;
        acpi_gbl_global_lock_acquired = FALSE;
        acpi_gbl_global_lock_handle = 0;
+       acpi_gbl_global_lock_present = FALSE;
 
        /* Miscellaneous variables */
 
@@ -815,5 +817,7 @@ acpi_status acpi_ut_init_globals(void)
        return_ACPI_STATUS(AE_OK);
 }
 
+ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
 ACPI_EXPORT_SYMBOL(acpi_dbg_level)
 ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
+ACPI_EXPORT_SYMBOL(acpi_current_gpe_count)
similarity index 98%
rename from drivers/acpi/utilities/utinit.c
rename to drivers/acpi/acpica/utinit.c
index cae515fc02d318db0091f1c98591e39549c97256..a54ca84eb3625e15a6fe48fdd0b0469d6b6f5f35 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acevents.h>
-#include <acpi/actables.h>
+#include "accommon.h"
+#include "acnamesp.h"
+#include "acevents.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utinit")
similarity index 99%
rename from drivers/acpi/utilities/utmath.c
rename to drivers/acpi/acpica/utmath.c
index c927324fdd26536a2905088397900a858208079c..c9f682d640efb05edd8ba1b4b18116328ed3ab2b 100644 (file)
@@ -42,6 +42,7 @@
  */
 
 #include <acpi/acpi.h>
+#include "accommon.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utmath")
similarity index 97%
rename from drivers/acpi/utilities/utmisc.c
rename to drivers/acpi/acpica/utmisc.c
index 9089a158a8740c4fd47d5b75d56c6b3d6e350e67..c1f7f4e1a72df52908944cfa49fc0d951fa32343 100644 (file)
@@ -44,7 +44,8 @@
 #include <linux/module.h>
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utmisc")
@@ -1016,7 +1017,7 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object,
 
 /*******************************************************************************
  *
- * FUNCTION:    acpi_ut_error, acpi_ut_warning, acpi_ut_info
+ * FUNCTION:    acpi_error, acpi_exception, acpi_warning, acpi_info
  *
  * PARAMETERS:  module_name         - Caller's module name (for error output)
  *              line_number         - Caller's line number (for error output)
@@ -1029,7 +1030,7 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object,
  ******************************************************************************/
 
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_error(const char *module_name, u32 line_number, const char *format, ...)
+acpi_error(const char *module_name, u32 line_number, const char *format, ...)
 {
        va_list args;
 
@@ -1042,8 +1043,8 @@ acpi_ut_error(const char *module_name, u32 line_number, const char *format, ...)
 }
 
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_exception(const char *module_name,
-                 u32 line_number, acpi_status status, const char *format, ...)
+acpi_exception(const char *module_name,
+              u32 line_number, acpi_status status, const char *format, ...)
 {
        va_list args;
 
@@ -1056,11 +1057,8 @@ acpi_ut_exception(const char *module_name,
        va_end(args);
 }
 
-EXPORT_SYMBOL(acpi_ut_exception);
-
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_warning(const char *module_name,
-               u32 line_number, const char *format, ...)
+acpi_warning(const char *module_name, u32 line_number, const char *format, ...)
 {
        va_list args;
 
@@ -1073,7 +1071,7 @@ acpi_ut_warning(const char *module_name,
 }
 
 void ACPI_INTERNAL_VAR_XFACE
-acpi_ut_info(const char *module_name, u32 line_number, const char *format, ...)
+acpi_info(const char *module_name, u32 line_number, const char *format, ...)
 {
        va_list args;
 
@@ -1088,3 +1086,8 @@ acpi_ut_info(const char *module_name, u32 line_number, const char *format, ...)
        acpi_os_printf("\n");
        va_end(args);
 }
+
+ACPI_EXPORT_SYMBOL(acpi_error)
+ACPI_EXPORT_SYMBOL(acpi_exception)
+ACPI_EXPORT_SYMBOL(acpi_warning)
+ACPI_EXPORT_SYMBOL(acpi_info)
similarity index 99%
rename from drivers/acpi/utilities/utmutex.c
rename to drivers/acpi/acpica/utmutex.c
index 7331dde9e1b3d9dd9b15677cfa410ed82ed2d07e..14eb52c4d647445e7a6346208bde77d2f34cbf7b 100644 (file)
@@ -42,6 +42,7 @@
  */
 
 #include <acpi/acpi.h>
+#include "accommon.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utmutex")
similarity index 99%
rename from drivers/acpi/utilities/utobject.c
rename to drivers/acpi/acpica/utobject.c
index c354e7a42bcde3ea4168ea0a0107a4b9ccfa358d..4279ed3a8782f15c633d87e3e437f22b548f5d6a 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utobject")
similarity index 99%
rename from drivers/acpi/utilities/utresrc.c
rename to drivers/acpi/acpica/utresrc.c
index c3e3e1308edc76a6a572f59090ff448db5187525..91b7c00236f41f5e1d9858d6a1f4cc5ddf8e9909 100644 (file)
@@ -42,7 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/amlresrc.h>
+#include "accommon.h"
+#include "amlresrc.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utresrc")
similarity index 99%
rename from drivers/acpi/utilities/utstate.c
rename to drivers/acpi/acpica/utstate.c
index 63a6d3d77d88fc0c4e9de3105904a2a4302c278c..0440c958f5a47fc9cc001b4b459d967bbc68e07b 100644 (file)
@@ -42,6 +42,7 @@
  */
 
 #include <acpi/acpi.h>
+#include "accommon.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utstate")
similarity index 97%
rename from drivers/acpi/utilities/utxface.c
rename to drivers/acpi/acpica/utxface.c
index c198a4d40583e7f14fc0e1a545d496c118c98b96..078a22728c6b847eb01a6fdb24a64b220d4dfd7e 100644 (file)
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acevents.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acdebug.h>
+#include "accommon.h"
+#include "acevents.h"
+#include "acnamesp.h"
+#include "acdebug.h"
+#include "actables.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utxface")
@@ -147,6 +149,16 @@ acpi_status acpi_enable_subsystem(u32 flags)
                }
        }
 
+       /*
+        * Obtain a permanent mapping for the FACS. This is required for the
+        * Global Lock and the Firmware Waking Vector
+        */
+       status = acpi_tb_initialize_facs();
+       if (ACPI_FAILURE(status)) {
+               ACPI_WARNING((AE_INFO, "Could not map the FACS table"));
+               return_ACPI_STATUS(status);
+       }
+
        /*
         * Install the default op_region handlers. These are installed unless
         * other handlers have already been installed via the
index 1423b0c0cd2eecc6e3c7b2f5c78746cee5fac4eb..65132f9204596eb9908b8e0424531ec682a8b731 100644 (file)
@@ -471,7 +471,7 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
 
 static int acpi_battery_update(struct acpi_battery *battery)
 {
-       int result;
+       int result, old_present = acpi_battery_present(battery);
        result = acpi_battery_get_status(battery);
        if (result)
                return result;
@@ -482,7 +482,8 @@ static int acpi_battery_update(struct acpi_battery *battery)
                return 0;
        }
 #endif
-       if (!battery->update_time) {
+       if (!battery->update_time ||
+           old_present != acpi_battery_present(battery)) {
                result = acpi_battery_get_info(battery);
                if (result)
                        return result;
index 7edf6d913c1318fded1fd4cf6a448b2f799a0849..765fd1c56cd66bc445ab5228f562177b9eb469e1 100644 (file)
@@ -688,14 +688,6 @@ void __init acpi_early_init(void)
        if (acpi_disabled)
                return;
 
-       /*
-        * ACPI CA initializes acpi_dbg_level to non-zero, which means
-        * we get debug output merely by turning on CONFIG_ACPI_DEBUG.
-        * Turn it off so we don't get output unless the user specifies
-        * acpi.debug_level.
-        */
-       acpi_dbg_level = 0;
-
        printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION);
 
        /* enable workarounds, unless strict ACPI spec. compliance */
index 307963bd10436c896e85766f23fc2ad6a6c85ad2..332fe4b217085ea9a188a5b48183df87aafe0636 100644 (file)
@@ -27,9 +27,6 @@
 #include <linux/seq_file.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
-#include <acpi/acmacros.h>
-#include <acpi/actypes.h>
-#include <acpi/acutils.h>
 
 ACPI_MODULE_NAME("cm_sbs");
 #define ACPI_AC_CLASS          "ac_adapter"
index c483968920085f13da610c387fd685ebe07ca654..20223cbd0d1cb3544f27b1da96ecf579566ffb89 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/moduleparam.h>
 #include <asm/uaccess.h>
 #include <acpi/acpi_drivers.h>
-#include <acpi/acglobal.h>
 
 #define _COMPONENT             ACPI_SYSTEM_COMPONENT
 ACPI_MODULE_NAME("debug");
diff --git a/drivers/acpi/dispatcher/Makefile b/drivers/acpi/dispatcher/Makefile
deleted file mode 100644 (file)
index eb7e602..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# Makefile for all Linux ACPI interpreter subdirectories
-#
-
-obj-y := dsfield.o   dsmthdat.o  dsopcode.o  dswexec.o  dswscope.o \
-        dsmethod.o  dsobject.o  dsutils.o   dswload.o  dswstate.o \
-        dsinit.o
-
-EXTRA_CFLAGS += $(ACPI_CFLAGS)
index 30f3ef236ecb1b354548c5bb2570866eaa8ec6be..2e8317bf723e960824a7ec9d8856d369ec10c385 100644 (file)
@@ -42,7 +42,6 @@
 #include <asm/io.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
-#include <acpi/actypes.h>
 
 #define ACPI_EC_CLASS                  "embedded_controller"
 #define ACPI_EC_DEVICE_NAME            "Embedded Controller"
@@ -756,10 +755,15 @@ static acpi_status
 acpi_ec_register_query_methods(acpi_handle handle, u32 level,
                               void *context, void **return_value)
 {
-       struct acpi_namespace_node *node = handle;
+       char node_name[5];
+       struct acpi_buffer buffer = { sizeof(node_name), node_name };
        struct acpi_ec *ec = context;
        int value = 0;
-       if (sscanf(node->name.ascii, "_Q%x", &value) == 1) {
+       acpi_status status;
+
+       status = acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer);
+
+       if (ACPI_SUCCESS(status) && sscanf(node_name, "_Q%x", &value) == 1) {
                acpi_ec_add_query_handler(ec, value, handle, NULL, NULL);
        }
        return AE_OK;
@@ -978,9 +982,9 @@ static const struct acpi_device_id ec_device_ids[] = {
 
 int __init acpi_ec_ecdt_probe(void)
 {
-       int ret;
        acpi_status status;
        struct acpi_table_ecdt *ecdt_ptr;
+       acpi_handle dummy;
 
        boot_ec = make_acpi_ec();
        if (!boot_ec)
@@ -1006,30 +1010,31 @@ int __init acpi_ec_ecdt_probe(void)
                boot_ec->gpe = ecdt_ptr->gpe;
                boot_ec->handle = ACPI_ROOT_OBJECT;
                acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle);
-       } else {
-               /* This workaround is needed only on some broken machines,
-                * which require early EC, but fail to provide ECDT */
-               acpi_handle x;
-               printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
-               status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device,
-                                               boot_ec, NULL);
-               /* Check that acpi_get_devices actually find something */
-               if (ACPI_FAILURE(status) || !boot_ec->handle)
-                       goto error;
-               /* We really need to limit this workaround, the only ASUS,
-                * which needs it, has fake EC._INI method, so use it as flag.
-                * Keep boot_ec struct as it will be needed soon.
-                */
-               if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &x)))
-                       return -ENODEV;
+               /* Add some basic check against completely broken table */
+               if (boot_ec->data_addr != boot_ec->command_addr)
+                       goto install;
+       /* fall through */
        }
-
-       ret = ec_install_handlers(boot_ec);
-       if (!ret) {
+       /* This workaround is needed only on some broken machines,
+        * which require early EC, but fail to provide ECDT */
+       printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
+       status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device,
+                                       boot_ec, NULL);
+       /* Check that acpi_get_devices actually find something */
+       if (ACPI_FAILURE(status) || !boot_ec->handle)
+               goto error;
+       /* We really need to limit this workaround, the only ASUS,
+        * which needs it, has fake EC._INI method, so use it as flag.
+        * Keep boot_ec struct as it will be needed soon.
+        */
+       if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &dummy)))
+               return -ENODEV;
+install:
+       if (!ec_install_handlers(boot_ec)) {
                first_ec = boot_ec;
                return 0;
        }
-      error:
+error:
        kfree(boot_ec);
        boot_ec = NULL;
        return -ENODEV;
diff --git a/drivers/acpi/events/Makefile b/drivers/acpi/events/Makefile
deleted file mode 100644 (file)
index d29f2ee..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# Makefile for all Linux ACPI interpreter subdirectories
-#
-
-obj-y := evevent.o  evregion.o  evsci.o    evxfevnt.o \
-        evmisc.o   evrgnini.o  evxface.o  evxfregn.o \
-        evgpe.o    evgpeblk.o
-
-EXTRA_CFLAGS += $(ACPI_CFLAGS)
diff --git a/drivers/acpi/executer/Makefile b/drivers/acpi/executer/Makefile
deleted file mode 100644 (file)
index e09998a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Makefile for all Linux ACPI interpreter subdirectories
-#
-
-obj-y := exconfig.o  exfield.o  exnames.o   exoparg6.o  exresolv.o  exstorob.o\
-        exconvrt.o  exfldio.o  exoparg1.o  exprep.o    exresop.o   exsystem.o\
-        excreate.o  exmisc.o   exoparg2.o  exregion.o  exstore.o   exutils.o \
-        exdump.o    exmutex.o  exoparg3.o  exresnte.o  exstoren.o
-
-EXTRA_CFLAGS += $(ACPI_CFLAGS)
diff --git a/drivers/acpi/hardware/Makefile b/drivers/acpi/hardware/Makefile
deleted file mode 100644 (file)
index 438ad37..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# Makefile for all Linux ACPI interpreter subdirectories
-#
-
-obj-y := hwacpi.o  hwgpe.o  hwregs.o  hwsleep.o
-
-obj-$(ACPI_FUTURE_USAGE) += hwtimer.o
-
-EXTRA_CFLAGS += $(ACPI_CFLAGS)
similarity index 98%
rename from drivers/acpi/sleep/main.c
rename to drivers/acpi/main.c
index 28a691cc625ebec8827454e98cfaa94b5260b9ce..d8242772de9285767354cac0f568705176761fa1 100644 (file)
@@ -107,7 +107,7 @@ static bool set_sci_en_on_resume;
  */
 static int acpi_pm_disable_gpes(void)
 {
-       acpi_hw_disable_all_gpes();
+       acpi_disable_all_gpes();
        return 0;
 }
 
@@ -135,7 +135,7 @@ static int acpi_pm_prepare(void)
        int error = __acpi_pm_prepare();
 
        if (!error)
-               acpi_hw_disable_all_gpes();
+               acpi_disable_all_gpes();
        return error;
 }
 
@@ -267,7 +267,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
         * (like wakeup GPE) haven't handler, this can avoid such GPE misfire.
         * acpi_leave_sleep_state will reenable specific GPEs later
         */
-       acpi_hw_disable_all_gpes();
+       acpi_disable_all_gpes();
 
        local_irq_restore(flags);
        printk(KERN_DEBUG "Back to C!\n");
@@ -436,7 +436,7 @@ static void acpi_hibernation_leave(void)
 
 static void acpi_pm_enable_gpes(void)
 {
-       acpi_hw_enable_all_runtime_gpes();
+       acpi_enable_all_runtime_gpes();
 }
 
 static struct platform_hibernation_ops acpi_hibernation_ops = {
@@ -622,7 +622,7 @@ static void acpi_power_off_prepare(void)
 {
        /* Prepare to power off the system */
        acpi_sleep_prepare(ACPI_STATE_S5);
-       acpi_hw_disable_all_gpes();
+       acpi_disable_all_gpes();
 }
 
 static void acpi_power_off(void)
@@ -671,7 +671,7 @@ int __init acpi_sleep_init(void)
                sleep_states[ACPI_STATE_S4] = 1;
                printk(" S4");
                if (!nosigcheck) {
-                       acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
+                       acpi_get_table(ACPI_SIG_FACS, 1,
                                (struct acpi_table_header **)&facs);
                        if (facs)
                                s4_hardware_signature =
diff --git a/drivers/acpi/namespace/Makefile b/drivers/acpi/namespace/Makefile
deleted file mode 100644 (file)
index 371a2da..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Makefile for all Linux ACPI interpreter subdirectories
-#
-
-obj-y := nsaccess.o  nsload.o    nssearch.o  nsxfeval.o \
-        nsalloc.o   nseval.o    nsnames.o   nsutils.o   nsxfname.o \
-        nsdump.o    nsinit.o    nsobject.o  nswalk.o    nsxfobj.o  \
-        nsparse.o   nspredef.o
-
-obj-$(ACPI_FUTURE_USAGE) += nsdumpdv.o
-
-EXTRA_CFLAGS += $(ACPI_CFLAGS)
index 25ceae9191ef3f1bed834cd2f88d4094e3ba61cb..c5e292aab0e34c77f94d1089942ebba06ffcd3d8 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/errno.h>
 #include <linux/acpi.h>
 #include <acpi/acpi_bus.h>
-#include <acpi/acmacros.h>
 
 #define ACPI_NUMA      0x80000000
 #define _COMPONENT     ACPI_NUMA
index c8111424dcb88b8a8cdc0e401f025a79149dfaa1..6729a4992f2bd73543a561f36454f037db01298d 100644 (file)
@@ -726,7 +726,7 @@ static acpi_status __acpi_os_execute(acpi_execute_type type,
 
        dpc = kmalloc(sizeof(struct acpi_os_dpc), GFP_ATOMIC);
        if (!dpc)
-               return_ACPI_STATUS(AE_NO_MEMORY);
+               return AE_NO_MEMORY;
 
        dpc->function = function;
        dpc->context = context;
@@ -747,7 +747,7 @@ static acpi_status __acpi_os_execute(acpi_execute_type type,
                status = AE_ERROR;
                kfree(dpc);
        }
-       return_ACPI_STATUS(status);
+       return status;
 }
 
 acpi_status acpi_os_execute(acpi_execute_type type,
diff --git a/drivers/acpi/parser/Makefile b/drivers/acpi/parser/Makefile
deleted file mode 100644 (file)
index db24ee0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Makefile for all Linux ACPI interpreter subdirectories
-#
-
-obj-y := psargs.o    psparse.o  psloop.o pstree.o   pswalk.o  \
-        psopcode.o  psscope.o  psutils.o  psxface.o
-
-EXTRA_CFLAGS += $(ACPI_CFLAGS)
index bb7d50dd28186d3c1d7e5d3d1bdb735aeab1944c..c926e7d4a0d619fd5b16a3b8d4806b05bba5aeeb 100644 (file)
@@ -139,6 +139,8 @@ static int acpi_power_get_state(acpi_handle handle, int *state)
 {
        acpi_status status = AE_OK;
        unsigned long long sta = 0;
+       char node_name[5];
+       struct acpi_buffer buffer = { sizeof(node_name), node_name };
 
 
        if (!handle || !state)
@@ -151,8 +153,10 @@ static int acpi_power_get_state(acpi_handle handle, int *state)
        *state = (sta & 0x01)?ACPI_POWER_RESOURCE_STATE_ON:
                              ACPI_POWER_RESOURCE_STATE_OFF;
 
+       acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer);
+
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
-                         acpi_ut_get_node_name(handle),
+                         node_name,
                                *state ? "on" : "off"));
 
        return 0;
similarity index 92%
rename from drivers/acpi/sleep/proc.c
rename to drivers/acpi/proc.c
index 4dbc2271acf5009cda80e48fdf19048f28b722a7..428c911dba086511281e3b89b80642657a480d90 100644 (file)
@@ -28,8 +28,6 @@ static int acpi_system_sleep_seq_show(struct seq_file *seq, void *offset)
 {
        int i;
 
-       ACPI_FUNCTION_TRACE("acpi_system_sleep_seq_show");
-
        for (i = 0; i <= ACPI_STATE_S5; i++) {
                if (sleep_states[i]) {
                        seq_printf(seq, "S%d ", i);
@@ -86,49 +84,44 @@ acpi_system_write_sleep(struct file *file,
 
 #ifdef HAVE_ACPI_LEGACY_ALARM
 
+static u32 cmos_bcd_read(int offset, int rtc_control);
+
 static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset)
 {
        u32 sec, min, hr;
        u32 day, mo, yr, cent = 0;
+       u32 today = 0;
        unsigned char rtc_control = 0;
        unsigned long flags;
 
-       ACPI_FUNCTION_TRACE("acpi_system_alarm_seq_show");
-
        spin_lock_irqsave(&rtc_lock, flags);
 
-       sec = CMOS_READ(RTC_SECONDS_ALARM);
-       min = CMOS_READ(RTC_MINUTES_ALARM);
-       hr = CMOS_READ(RTC_HOURS_ALARM);
        rtc_control = CMOS_READ(RTC_CONTROL);
+       sec = cmos_bcd_read(RTC_SECONDS_ALARM, rtc_control);
+       min = cmos_bcd_read(RTC_MINUTES_ALARM, rtc_control);
+       hr = cmos_bcd_read(RTC_HOURS_ALARM, rtc_control);
 
        /* If we ever get an FACP with proper values... */
-       if (acpi_gbl_FADT.day_alarm)
+       if (acpi_gbl_FADT.day_alarm) {
                /* ACPI spec: only low 6 its should be cared */
                day = CMOS_READ(acpi_gbl_FADT.day_alarm) & 0x3F;
-       else
-               day = CMOS_READ(RTC_DAY_OF_MONTH);
+               if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
+                       day = bcd2bin(day);
+       } else
+               day = cmos_bcd_read(RTC_DAY_OF_MONTH, rtc_control);
        if (acpi_gbl_FADT.month_alarm)
-               mo = CMOS_READ(acpi_gbl_FADT.month_alarm);
-       else
-               mo = CMOS_READ(RTC_MONTH);
+               mo = cmos_bcd_read(acpi_gbl_FADT.month_alarm, rtc_control);
+       else {
+               mo = cmos_bcd_read(RTC_MONTH, rtc_control);
+               today = cmos_bcd_read(RTC_DAY_OF_MONTH, rtc_control);
+       }
        if (acpi_gbl_FADT.century)
-               cent = CMOS_READ(acpi_gbl_FADT.century);
+               cent = cmos_bcd_read(acpi_gbl_FADT.century, rtc_control);
 
-       yr = CMOS_READ(RTC_YEAR);
+       yr = cmos_bcd_read(RTC_YEAR, rtc_control);
 
        spin_unlock_irqrestore(&rtc_lock, flags);
 
-       if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
-               sec = bcd2bin(sec);
-               min = bcd2bin(min);
-               hr = bcd2bin(hr);
-               day = bcd2bin(day);
-               mo = bcd2bin(mo);
-               yr = bcd2bin(yr);
-               cent = bcd2bin(cent);
-       }
-
        /* we're trusting the FADT (see above) */
        if (!acpi_gbl_FADT.century)
                /* If we're not trusting the FADT, we should at least make it
@@ -153,6 +146,20 @@ static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset)
        else
                yr += cent * 100;
 
+       /*
+        * Show correct dates for alarms up to a month into the future.
+        * This solves issues for nearly all situations with the common
+        * 30-day alarm clocks in PC hardware.
+        */
+       if (day < today) {
+               if (mo < 12) {
+                       mo += 1;
+               } else {
+                       mo = 1;
+                       yr += 1;
+               }
+       }
+
        seq_printf(seq, "%4.4u-", yr);
        (mo > 12) ? seq_puts(seq, "**-") : seq_printf(seq, "%2.2u-", mo);
        (day > 31) ? seq_puts(seq, "** ") : seq_printf(seq, "%2.2u ", day);
@@ -227,13 +234,11 @@ acpi_system_write_alarm(struct file *file,
        int adjust = 0;
        unsigned char rtc_control = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_system_write_alarm");
-
        if (count > sizeof(alarm_string) - 1)
-               return_VALUE(-EINVAL);
+               return -EINVAL;
 
        if (copy_from_user(alarm_string, buffer, count))
-               return_VALUE(-EFAULT);
+               return -EFAULT;
 
        alarm_string[count] = '\0';
 
@@ -334,7 +339,7 @@ acpi_system_write_alarm(struct file *file,
 
        result = 0;
       end:
-       return_VALUE(result ? result : count);
+       return result ? result : count;
 }
 #endif                         /* HAVE_ACPI_LEGACY_ALARM */
 
index a6b662c00b67764d311366963171a1a5b289f73d..93f91142d7ad5ca01fc62b8dc16569660cfa0434 100644 (file)
@@ -42,7 +42,7 @@ void acpi_reboot(void)
        case ACPI_ADR_SPACE_SYSTEM_MEMORY:
        case ACPI_ADR_SPACE_SYSTEM_IO:
                printk(KERN_DEBUG "ACPI MEMORY or I/O RESET_REG.\n");
-               acpi_hw_low_level_write(8, reset_value, rr);
+               acpi_reset();
                break;
        }
        /* Wait ten seconds */
diff --git a/drivers/acpi/resources/Makefile b/drivers/acpi/resources/Makefile
deleted file mode 100644 (file)
index 8de4f69..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Makefile for all Linux ACPI interpreter subdirectories
-#
-
-obj-y := rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \
-        rscalc.o  rsirq.o  rsmemory.o  rsutils.o
-
-obj-$(ACPI_FUTURE_USAGE) += rsdump.o
-
-EXTRA_CFLAGS += $(ACPI_CFLAGS)
index e53e590252c01346e09ab317d6595cc218d3a72f..0619734895b29232d8f3b1e960efb8b777e808c5 100644 (file)
@@ -10,7 +10,6 @@
 
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
-#include <acpi/actypes.h>
 #include <linux/wait.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
index 39b7233c348592670ef86b1df5747f3d90151dc9..c54d7b6c406680b5b82d0df4e0aa9b1a0ac8688d 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/kthread.h>
 
 #include <acpi/acpi_drivers.h>
-#include <acpi/acinterp.h>     /* for acpi_ex_eisa_id_to_string() */
 
 #define _COMPONENT             ACPI_BUS_COMPONENT
 ACPI_MODULE_NAME("scan");
diff --git a/drivers/acpi/sleep/Makefile b/drivers/acpi/sleep/Makefile
deleted file mode 100644 (file)
index f1fb888..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-obj-y                                  := wakeup.o
-obj-y                                  += main.o
-obj-$(CONFIG_ACPI_SLEEP)               += proc.o
-
-EXTRA_CFLAGS += $(ACPI_CFLAGS)
index 6e4107f824039bdee65174c38dbcce06672ee119..391d0358a592ce6ab389687f321bfb8e0e4b62c3 100644 (file)
@@ -192,65 +192,6 @@ static struct attribute_group interrupt_stats_attr_group = {
 };
 static struct kobj_attribute *counter_attrs;
 
-static int count_num_gpes(void)
-{
-       int count = 0;
-       struct acpi_gpe_xrupt_info *gpe_xrupt_info;
-       struct acpi_gpe_block_info *gpe_block;
-       acpi_cpu_flags flags;
-
-       flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
-
-       gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
-       while (gpe_xrupt_info) {
-               gpe_block = gpe_xrupt_info->gpe_block_list_head;
-               while (gpe_block) {
-                       count += gpe_block->register_count *
-                           ACPI_GPE_REGISTER_WIDTH;
-                       gpe_block = gpe_block->next;
-               }
-               gpe_xrupt_info = gpe_xrupt_info->next;
-       }
-       acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
-
-       return count;
-}
-
-static int get_gpe_device(int index, acpi_handle *handle)
-{
-       struct acpi_gpe_xrupt_info *gpe_xrupt_info;
-       struct acpi_gpe_block_info *gpe_block;
-       acpi_cpu_flags flags;
-       struct acpi_namespace_node *node;
-
-       flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
-
-       gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
-       while (gpe_xrupt_info) {
-               gpe_block = gpe_xrupt_info->gpe_block_list_head;
-               node = gpe_block->node;
-               while (gpe_block) {
-                       index -= gpe_block->register_count *
-                           ACPI_GPE_REGISTER_WIDTH;
-                       if (index < 0) {
-                               acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
-                               /* return NULL if it's FADT GPE */
-                               if (node->type != ACPI_TYPE_DEVICE)
-                                       *handle = NULL;
-                               else
-                                       *handle = node;
-                               return 0;
-                       }
-                       node = gpe_block->node;
-                       gpe_block = gpe_block->next;
-               }
-               gpe_xrupt_info = gpe_xrupt_info->next;
-       }
-       acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
-
-       return -ENODEV;
-}
-
 static void delete_gpe_attr_array(void)
 {
        struct event_counter *tmp = all_counters;
@@ -309,7 +250,7 @@ static int get_status(u32 index, acpi_event_status *status, acpi_handle *handle)
                goto end;
 
        if (index < num_gpes) {
-               result = get_gpe_device(index, handle);
+               result = acpi_get_gpe_device(index, handle);
                if (result) {
                        ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND,
                                "Invalid GPE 0x%x\n", index));
@@ -436,7 +377,7 @@ void acpi_irq_stats_init(void)
        if (all_counters)
                return;
 
-       num_gpes = count_num_gpes();
+       num_gpes = acpi_current_gpe_count;
        num_counters = num_gpes + ACPI_NUM_FIXED_EVENTS + NUM_COUNTERS_EXTRA;
 
        all_attrs = kzalloc(sizeof(struct attribute *) * (num_counters + 1),
diff --git a/drivers/acpi/tables/Makefile b/drivers/acpi/tables/Makefile
deleted file mode 100644 (file)
index 7385efa..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Makefile for all Linux ACPI interpreter subdirectories
-#
-
-obj-y := tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o
-
-EXTRA_CFLAGS += $(ACPI_CFLAGS)
diff --git a/drivers/acpi/utilities/Makefile b/drivers/acpi/utilities/Makefile
deleted file mode 100644 (file)
index 88eff14..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# Makefile for all Linux ACPI interpreter subdirectories
-#
-
-obj-y := utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \
-               utcopy.o utdelete.o utglobal.o utmath.o utobject.o \
-               utstate.o utmutex.o utobject.o utcache.o utresrc.o
-
-EXTRA_CFLAGS += $(ACPI_CFLAGS)
diff --git a/drivers/acpi/utilities/utcache.c b/drivers/acpi/utilities/utcache.c
deleted file mode 100644 (file)
index 245fa80..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-/******************************************************************************
- *
- * Module Name: utcache - local cache allocation routines
- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2008, Intel Corp.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- *    substantially similar to the "NO WARRANTY" disclaimer below
- *    ("Disclaimer") and any redistribution must be conditioned upon
- *    including a substantially similar Disclaimer requirement for further
- *    binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- *    of any contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- */
-
-#include <acpi/acpi.h>
-
-#define _COMPONENT          ACPI_UTILITIES
-ACPI_MODULE_NAME("utcache")
-#ifdef ACPI_USE_LOCAL_CACHE
-/*******************************************************************************
- *
- * FUNCTION:    acpi_os_create_cache
- *
- * PARAMETERS:  cache_name      - Ascii name for the cache
- *              object_size     - Size of each cached object
- *              max_depth       - Maximum depth of the cache (in objects)
- *              return_cache    - Where the new cache object is returned
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Create a cache object
- *
- ******************************************************************************/
-acpi_status
-acpi_os_create_cache(char *cache_name,
-                    u16 object_size,
-                    u16 max_depth, struct acpi_memory_list ** return_cache)
-{
-       struct acpi_memory_list *cache;
-
-       ACPI_FUNCTION_ENTRY();
-
-       if (!cache_name || !return_cache || (object_size < 16)) {
-               return (AE_BAD_PARAMETER);
-       }
-
-       /* Create the cache object */
-
-       cache = acpi_os_allocate(sizeof(struct acpi_memory_list));
-       if (!cache) {
-               return (AE_NO_MEMORY);
-       }
-
-       /* Populate the cache object and return it */
-
-       ACPI_MEMSET(cache, 0, sizeof(struct acpi_memory_list));
-       cache->link_offset = 8;
-       cache->list_name = cache_name;
-       cache->object_size = object_size;
-       cache->max_depth = max_depth;
-
-       *return_cache = cache;
-       return (AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_os_purge_cache
- *
- * PARAMETERS:  Cache           - Handle to cache object
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Free all objects within the requested cache.
- *
- ******************************************************************************/
-
-acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache)
-{
-       char *next;
-
-       ACPI_FUNCTION_ENTRY();
-
-       if (!cache) {
-               return (AE_BAD_PARAMETER);
-       }
-
-       /* Walk the list of objects in this cache */
-
-       while (cache->list_head) {
-
-               /* Delete and unlink one cached state object */
-
-               next = *(ACPI_CAST_INDIRECT_PTR(char,
-                                               &(((char *)cache->
-                                                  list_head)[cache->
-                                                             link_offset])));
-               ACPI_FREE(cache->list_head);
-
-               cache->list_head = next;
-               cache->current_depth--;
-       }
-
-       return (AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_os_delete_cache
- *
- * PARAMETERS:  Cache           - Handle to cache object
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Free all objects within the requested cache and delete the
- *              cache object.
- *
- ******************************************************************************/
-
-acpi_status acpi_os_delete_cache(struct acpi_memory_list * cache)
-{
-       acpi_status status;
-
-       ACPI_FUNCTION_ENTRY();
-
-       /* Purge all objects in the cache */
-
-       status = acpi_os_purge_cache(cache);
-       if (ACPI_FAILURE(status)) {
-               return (status);
-       }
-
-       /* Now we can delete the cache object */
-
-       ACPI_FREE(cache);
-       return (AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_os_release_object
- *
- * PARAMETERS:  Cache       - Handle to cache object
- *              Object      - The object to be released
- *
- * RETURN:      None
- *
- * DESCRIPTION: Release an object to the specified cache.  If cache is full,
- *              the object is deleted.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_os_release_object(struct acpi_memory_list * cache, void *object)
-{
-       acpi_status status;
-
-       ACPI_FUNCTION_ENTRY();
-
-       if (!cache || !object) {
-               return (AE_BAD_PARAMETER);
-       }
-
-       /* If cache is full, just free this object */
-
-       if (cache->current_depth >= cache->max_depth) {
-               ACPI_FREE(object);
-               ACPI_MEM_TRACKING(cache->total_freed++);
-       }
-
-       /* Otherwise put this object back into the cache */
-
-       else {
-               status = acpi_ut_acquire_mutex(ACPI_MTX_CACHES);
-               if (ACPI_FAILURE(status)) {
-                       return (status);
-               }
-
-               /* Mark the object as cached */
-
-               ACPI_MEMSET(object, 0xCA, cache->object_size);
-               ACPI_SET_DESCRIPTOR_TYPE(object, ACPI_DESC_TYPE_CACHED);
-
-               /* Put the object at the head of the cache list */
-
-               *(ACPI_CAST_INDIRECT_PTR(char,
-                                        &(((char *)object)[cache->
-                                                           link_offset]))) =
-                   cache->list_head;
-               cache->list_head = object;
-               cache->current_depth++;
-
-               (void)acpi_ut_release_mutex(ACPI_MTX_CACHES);
-       }
-
-       return (AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_os_acquire_object
- *
- * PARAMETERS:  Cache           - Handle to cache object
- *
- * RETURN:      the acquired object.  NULL on error
- *
- * DESCRIPTION: Get an object from the specified cache.  If cache is empty,
- *              the object is allocated.
- *
- ******************************************************************************/
-
-void *acpi_os_acquire_object(struct acpi_memory_list *cache)
-{
-       acpi_status status;
-       void *object;
-
-       ACPI_FUNCTION_NAME(os_acquire_object);
-
-       if (!cache) {
-               return (NULL);
-       }
-
-       status = acpi_ut_acquire_mutex(ACPI_MTX_CACHES);
-       if (ACPI_FAILURE(status)) {
-               return (NULL);
-       }
-
-       ACPI_MEM_TRACKING(cache->requests++);
-
-       /* Check the cache first */
-
-       if (cache->list_head) {
-
-               /* There is an object available, use it */
-
-               object = cache->list_head;
-               cache->list_head = *(ACPI_CAST_INDIRECT_PTR(char,
-                                                           &(((char *)
-                                                              object)[cache->
-                                                                      link_offset])));
-
-               cache->current_depth--;
-
-               ACPI_MEM_TRACKING(cache->hits++);
-               ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-                                 "Object %p from %s cache\n", object,
-                                 cache->list_name));
-
-               status = acpi_ut_release_mutex(ACPI_MTX_CACHES);
-               if (ACPI_FAILURE(status)) {
-                       return (NULL);
-               }
-
-               /* Clear (zero) the previously used Object */
-
-               ACPI_MEMSET(object, 0, cache->object_size);
-       } else {
-               /* The cache is empty, create a new object */
-
-               ACPI_MEM_TRACKING(cache->total_allocated++);
-
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
-               if ((cache->total_allocated - cache->total_freed) >
-                   cache->max_occupied) {
-                       cache->max_occupied =
-                           cache->total_allocated - cache->total_freed;
-               }
-#endif
-
-               /* Avoid deadlock with ACPI_ALLOCATE_ZEROED */
-
-               status = acpi_ut_release_mutex(ACPI_MTX_CACHES);
-               if (ACPI_FAILURE(status)) {
-                       return (NULL);
-               }
-
-               object = ACPI_ALLOCATE_ZEROED(cache->object_size);
-               if (!object) {
-                       return (NULL);
-               }
-       }
-
-       return (object);
-}
-#endif                         /* ACPI_USE_LOCAL_CACHE */
index baa4419297209efd6d79aaedb2dae13c2d1a6f92..38bf8b43fd19eba47111b3a068444927839f3b75 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/backlight.h>
 #include <linux/thermal.h>
 #include <linux/video_output.h>
+#include <linux/sort.h>
 #include <asm/uaccess.h>
 
 #include <acpi/acpi_bus.h>
@@ -625,6 +626,16 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
        return status;
 }
 
+/*
+ * Simple comparison function used to sort backlight levels.
+ */
+
+static int
+acpi_video_cmp_level(const void *a, const void *b)
+{
+       return *(int *)a - *(int *)b;
+}
+
 /*
  *  Arg:       
  *     device  : video output device (LCD, CRT, ..)
@@ -676,6 +687,10 @@ acpi_video_init_brightness(struct acpi_video_device *device)
                count++;
        }
 
+       /* don't sort the first two brightness levels */
+       sort(&br->levels[2], count - 2, sizeof(br->levels[2]),
+               acpi_video_cmp_level, NULL);
+
        if (count < 2)
                goto out_free_levels;
 
similarity index 96%
rename from drivers/acpi/sleep/wakeup.c
rename to drivers/acpi/wakeup.c
index dea4c23df7648bb8ed3781bc455edb835a58b0b8..2d34806d45dd704cf43222bec4ed50e8c33839c0 100644 (file)
@@ -8,7 +8,6 @@
 #include <acpi/acpi_drivers.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
-#include <acpi/acevents.h>
 #include "sleep.h"
 
 #define _COMPONENT             ACPI_SYSTEM_COMPONENT
@@ -28,8 +27,6 @@ void acpi_enable_wakeup_device_prep(u8 sleep_state)
 {
        struct list_head *node, *next;
 
-       ACPI_FUNCTION_TRACE("acpi_enable_wakeup_device_prep");
-
        spin_lock(&acpi_device_lock);
        list_for_each_safe(node, next, &acpi_wakeup_device_list) {
                struct acpi_device *dev = container_of(node,
@@ -61,7 +58,6 @@ void acpi_enable_wakeup_device(u8 sleep_state)
         * Caution: this routine must be invoked when interrupt is disabled 
         * Refer ACPI2.0: P212
         */
-       ACPI_FUNCTION_TRACE("acpi_enable_wakeup_device");
        spin_lock(&acpi_device_lock);
        list_for_each_safe(node, next, &acpi_wakeup_device_list) {
                struct acpi_device *dev =
@@ -103,8 +99,6 @@ void acpi_disable_wakeup_device(u8 sleep_state)
 {
        struct list_head *node, *next;
 
-       ACPI_FUNCTION_TRACE("acpi_disable_wakeup_device");
-
        spin_lock(&acpi_device_lock);
        list_for_each_safe(node, next, &acpi_wakeup_device_list) {
                struct acpi_device *dev =
index c012307d0ba6a726f7a0c9b30eac55f698da5b0b..246987f0b88c0c40d03902f7068525ddc623830e 100644 (file)
 #include "libata.h"
 
 #include <acpi/acpi_bus.h>
-#include <acpi/acnames.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acparser.h>
-#include <acpi/acexcep.h>
-#include <acpi/acmacros.h>
-#include <acpi/actypes.h>
 
 enum {
        ATA_ACPI_FILTER_SETXFER = 1 << 0,
index e2e332d8ff952753940b1f7b7e086e3e1945a073..8b77a9802df16c9f87b19c32a3984c4ca3009333 100644 (file)
 #include <linux/device.h>
 #include <scsi/scsi_host.h>
 #include <acpi/acpi_bus.h>
-#include <acpi/acnames.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acparser.h>
-#include <acpi/acexcep.h>
-#include <acpi/acmacros.h>
-#include <acpi/actypes.h>
 
 #include <linux/libata.h>
 #include <linux/ata.h>
index 68f052b42ed7807e9771761a171778bcd6fc3f1e..ed306eb1057fde9a7b0c66e093fa8d91464eba4d 100644 (file)
@@ -23,8 +23,6 @@
 #include <linux/security.h>
 #include <linux/module.h>
 #include <acpi/acpi.h>
-#include <acpi/actypes.h>
-#include <acpi/actbl.h>
 #include "tpm.h"
 
 #define TCG_EVENT_NAME_LEN_MAX 255
index 5fcd3d89c75d91cda65acd42fe34be8d987e9c67..4041e91432837b2d2cc9b898e10f04f20cc778ce 100644 (file)
@@ -394,6 +394,12 @@ static void edac_device_workq_function(struct work_struct *work_req)
 
        mutex_lock(&device_ctls_mutex);
 
+       /* If we are being removed, bail out immediately */
+       if (edac_dev->op_state == OP_OFFLINE) {
+               mutex_unlock(&device_ctls_mutex);
+               return;
+       }
+
        /* Only poll controllers that are running polled and have a check */
        if ((edac_dev->op_state == OP_RUNNING_POLL) &&
                (edac_dev->edac_check != NULL)) {
@@ -585,14 +591,14 @@ struct edac_device_ctl_info *edac_device_del_device(struct device *dev)
        /* mark this instance as OFFLINE */
        edac_dev->op_state = OP_OFFLINE;
 
-       /* clear workq processing on this instance */
-       edac_device_workq_teardown(edac_dev);
-
        /* deregister from global list */
        del_edac_device_from_global_list(edac_dev);
 
        mutex_unlock(&device_ctls_mutex);
 
+       /* clear workq processing on this instance */
+       edac_device_workq_teardown(edac_dev);
+
        /* Tear down the sysfs entries for this instance */
        edac_device_remove_sysfs(edac_dev);
 
index 99be11418ac2dcecf8b3718ca5e8ba82478dc0b1..8289e16419a8d24566559223489037860809ec54 100644 (file)
@@ -44,7 +44,7 @@ void radeon_irq_set_state(struct drm_device *dev, u32 mask, int state)
        else
                dev_priv->irq_enable_reg &= ~mask;
 
-       if (!dev->irq_enabled)
+       if (dev->irq_enabled)
                RADEON_WRITE(RADEON_GEN_INT_CNTL, dev_priv->irq_enable_reg);
 }
 
@@ -57,7 +57,7 @@ static void r500_vbl_irq_set_state(struct drm_device *dev, u32 mask, int state)
        else
                dev_priv->r500_disp_irq_reg &= ~mask;
 
-       if (!dev->irq_enabled)
+       if (dev->irq_enabled)
                RADEON_WRITE(R500_DxMODE_INT_MASK, dev_priv->r500_disp_irq_reg);
 }
 
index 53f079cc00afc010f2cf62b643fe98432feceea8..d8ede85fe17f4428be6713394e678af59c1457b2 100644 (file)
@@ -81,11 +81,12 @@ static u8 cs5530_udma_filter(ide_drive_t *drive)
 {
        ide_hwif_t *hwif = drive->hwif;
        ide_drive_t *mate = ide_get_pair_dev(drive);
-       u16 *mateid = mate->id;
+       u16 *mateid;
        u8 mask = hwif->ultra_mask;
 
        if (mate == NULL)
                goto out;
+       mateid = mate->id;
 
        if (ata_id_has_dma(mateid) && __ide_dma_bad_drive(mate) == 0) {
                if ((mateid[ATA_ID_FIELD_VALID] & 4) &&
index 244a8a052ce85ff3b7bdbe6a28ab5a234b847359..9e8d52a4f3066b1e1df712f9df407ec25c5b8d89 100644 (file)
 #include <linux/dmi.h>
 
 #include <acpi/acpi_bus.h>
-#include <acpi/acnames.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acparser.h>
-#include <acpi/acexcep.h>
-#include <acpi/acmacros.h>
-#include <acpi/actypes.h>
 
 #define REGS_PER_GTF           7
 struct taskfile_array {
index f1a8758e3a99f7d8b6953782c4150c35fefb8097..ec7f766ef5e44ff6387e962592c5a985282de4c9 100644 (file)
@@ -104,11 +104,12 @@ static u8 sc1200_udma_filter(ide_drive_t *drive)
 {
        ide_hwif_t *hwif = drive->hwif;
        ide_drive_t *mate = ide_get_pair_dev(drive);
-       u16 *mateid = mate->id;
+       u16 *mateid;
        u8 mask = hwif->ultra_mask;
 
        if (mate == NULL)
                goto out;
+       mateid = mate->id;
 
        if (ata_id_has_dma(mateid) && __ide_dma_bad_drive(mate) == 0) {
                if ((mateid[ATA_ID_FIELD_VALID] & 4) &&
index 73dc2ee9b014021a5681d83be1badd96802010bc..b34301d56cd2859f7b248ee0df8c7899317d59d5 100644 (file)
@@ -9,11 +9,11 @@ config DVB_B2C2_FLEXCOP
        select DVB_STV0297 if !DVB_FE_CUSTOMISE
        select DVB_BCM3510 if !DVB_FE_CUSTOMISE
        select DVB_LGDT330X if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE
        select DVB_S5H1420 if !DVB_FE_CUSTOMISE
        select DVB_TUNER_ITD1000 if !DVB_FE_CUSTOMISE
        select DVB_ISL6421 if !DVB_FE_CUSTOMISE
        select DVB_CX24123 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE
        help
          Support for the digital TV receiver chip made by B2C2 Inc. included in
          Technisats PCI cards and USB boxes.
index a127a4175c402a45c1940d7dec586762557544b5..5cded370854167b2d3db6ffec80e7914ad7437f1 100644 (file)
@@ -628,12 +628,14 @@ int flexcop_frontend_init(struct flexcop_device *fc)
        }
 
        /* try the cable dvb (stv0297) */
+       fc->fc_i2c_adap[0].no_base_addr = 1;
        fc->fe = dvb_attach(stv0297_attach, &alps_tdee4_stv0297_config, i2c);
        if (fc->fe != NULL) {
                fc->dev_type = FC_CABLE;
                fc->fe->ops.tuner_ops.set_params = alps_tdee4_stv0297_tuner_set_params;
                goto fe_found;
        }
+       fc->fc_i2c_adap[0].no_base_addr = 0;
 
        /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */
        fc->fe = dvb_attach(mt312_attach,
index 43a112ec6d44f146b260c64cf12446d036e1283a..f13783f08f0f4e09bd054c38806792e1289af3a4 100644 (file)
@@ -47,8 +47,12 @@ static int flexcop_i2c_read4(struct flexcop_i2c_adapter *i2c,
        int len = r100.tw_sm_c_100.total_bytes, /* remember total_bytes is buflen-1 */
                ret;
 
-       r100.tw_sm_c_100.no_base_addr_ack_error = i2c->no_base_addr;
        ret = flexcop_i2c_operation(i2c->fc, &r100);
+       if (ret != 0) {
+               deb_i2c("Retrying operation\n");
+               r100.tw_sm_c_100.no_base_addr_ack_error = i2c->no_base_addr;
+               ret = flexcop_i2c_operation(i2c->fc, &r100);
+       }
        if (ret != 0) {
                deb_i2c("read failed. %d\n", ret);
                return ret;
index 7e9c090fc04ea9ae2e7273890fce6f5c04241db1..27edb0ece58752b0617f9bdb2bd26ef05500f510 100644 (file)
@@ -8,7 +8,7 @@ config DVB_BT8XX
        select DVB_OR51211 if !DVB_FE_CUSTOMISE
        select DVB_LGDT330X if !DVB_FE_CUSTOMISE
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE
        help
          Support for PCI cards based on the Bt8xx PCI bridge. Examples are
          the Nebula cards, the Pinnacle PCTV cards, the Twinhan DST cards,
index 62b68c291d9968636ebe62a2a1605afc9a712d38..49f7b20c25d6f134f883d5c3c1e15cbebeb5a547 100644 (file)
@@ -24,8 +24,8 @@ config DVB_USB_A800
        tristate "AVerMedia AverTV DVB-T USB 2.0 (A800)"
        depends on DVB_USB
        select DVB_DIB3000MC
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
        select DVB_PLL if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the AVerMedia AverTV DVB-T USB 2.0 (A800) receiver.
 
@@ -34,7 +34,7 @@ config DVB_USB_DIBUSB_MB
        depends on DVB_USB
        select DVB_PLL if !DVB_FE_CUSTOMISE
        select DVB_DIB3000MB
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
        help
          Support for USB 1.1 and 2.0 DVB-T receivers based on reference designs made by
          DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-B demodulator.
@@ -55,7 +55,7 @@ config DVB_USB_DIBUSB_MC
        tristate "DiBcom USB DVB-T devices (based on the DiB3000M-C/P) (see help for device list)"
        depends on DVB_USB
        select DVB_DIB3000MC
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
        help
          Support for USB2.0 DVB-T receivers based on reference designs made by
          DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-C/P demodulator.
@@ -73,11 +73,11 @@ config DVB_USB_DIB0700
        select DVB_DIB7000M
        select DVB_DIB3000MC
        select DVB_S5H1411 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MT2266 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMIZE
        select DVB_TUNER_DIB0070
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_MT2266 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_XC5000 if !MEDIA_TUNER_CUSTOMIZE
        help
          Support for USB2.0/1.1 DVB receivers based on the DiB0700 USB bridge. The
          USB bridge is also present in devices having the DiB7700 DVB-T-USB
@@ -95,7 +95,7 @@ config DVB_USB_UMT_010
        depends on DVB_USB
        select DVB_PLL if !DVB_FE_CUSTOMISE
        select DVB_DIB3000MC
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the HanfTek UMT-010 USB2.0 stick-sized DVB-T receiver.
 
@@ -107,11 +107,11 @@ config DVB_USB_CXUSB
        select DVB_LGDT330X if !DVB_FE_CUSTOMISE
        select DVB_MT352 if !DVB_FE_CUSTOMISE
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MXL5005S if !DVB_FE_CUSTOMISE
        select DVB_DIB7000P if !DVB_FE_CUSTOMISE
        select DVB_TUNER_DIB0070 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the Conexant USB2.0 hybrid reference design.
          Currently, only DVB and ATSC modes are supported, analog mode
@@ -124,9 +124,9 @@ config DVB_USB_M920X
        tristate "Uli m920x DVB-T USB2.0 support"
        depends on DVB_USB
        select DVB_MT352 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_QT1010 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_TDA827X if !DVB_FE_CUSTOMISE
        select DVB_TDA1004X if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the MSI Mega Sky 580 USB2.0 DVB-T receiver.
          Currently, only devices with a product id of
@@ -137,7 +137,7 @@ config DVB_USB_GL861
        tristate "Genesys Logic GL861 USB2.0 support"
        depends on DVB_USB
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_QT1010 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the MSI Megasky 580 (55801) DVB-T USB2.0
          receiver with USB ID 0db0:5581.
@@ -146,7 +146,7 @@ config DVB_USB_AU6610
        tristate "Alcor Micro AU6610 USB2.0 support"
        depends on DVB_USB
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_QT1010 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the Sigmatek DVB-110 DVB-T USB2.0 receiver.
 
@@ -198,8 +198,8 @@ config DVB_USB_NOVA_T_USB2
        tristate "Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 support"
        depends on DVB_USB
        select DVB_DIB3000MC
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
        select DVB_PLL if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 receiver.
 
@@ -235,8 +235,8 @@ config DVB_USB_OPERA1
 config DVB_USB_AF9005
        tristate "Afatech AF9005 DVB-T USB1.1 support"
        depends on DVB_USB && EXPERIMENTAL
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_QT1010 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the Afatech AF9005 based DVB-T USB1.1 receiver
          and the TerraTec Cinergy T USB XE (Rev.1)
@@ -284,7 +284,7 @@ config DVB_USB_DTV5100
        tristate "AME DTV-5100 USB2.0 DVB-T support"
        depends on DVB_USB
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_QT1010 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the AME DTV-5100 USB2.0 DVB-T receiver.
 
@@ -293,9 +293,9 @@ config DVB_USB_AF9015
        depends on DVB_USB && EXPERIMENTAL
        select DVB_AF9013
        select DVB_PLL              if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MT2060   if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_QT1010   if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MXL5005S if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060   if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_QT1010   if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_TDA18271 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the Afatech AF9015 based DVB-T USB2.0 receiver
index f28d3ae59e046cd8e9d1d6c74565848ccb4a9833..3917327889117bcff8cf27f315c8a3d70fcb27c7 100644 (file)
@@ -446,13 +446,13 @@ static int stk7700ph_tuner_attach(struct dvb_usb_adapter *adap)
                == NULL ? -ENODEV : 0;
 }
 
-#define DEFAULT_RC_INTERVAL 150
+#define DEFAULT_RC_INTERVAL 50
 
 static u8 rc_request[] = { REQUEST_POLL_RC, 0 };
 
 /* Number of keypresses to ignore before start repeating */
-#define RC_REPEAT_DELAY 2
-#define RC_REPEAT_DELAY_V1_20 5
+#define RC_REPEAT_DELAY 6
+#define RC_REPEAT_DELAY_V1_20 10
 
 
 
index 867027ceab3e71d29ce43b3944104043670eeb99..401a04effc06817befbc4d6772565c430648d78a 100644 (file)
@@ -106,7 +106,7 @@ config DVB_BUDGET_CI
        select DVB_TDA1004X if !DVB_FE_CUSTOMISE
        select DVB_LNBP21 if !DVB_FE_CUSTOMISE
        select DVB_TDA10023 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_TDA827X if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMIZE
        select VIDEO_IR
        help
          Support for simple SAA7146 based DVB cards
index e6ca4012b5f0f78fab90212e546aa1b6f0cd4946..0ea85a05e5c0d86911d9a62fe3445e472cf1e877 100644 (file)
@@ -831,7 +831,7 @@ long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
 {
        int ret = -ENOIOCTLCMD;
 
-       if (!file->f_op->ioctl)
+       if (!file->f_op->ioctl && !file->f_op->unlocked_ioctl)
                return ret;
 
        switch (cmd) {
index ef48565de7f1b7c5fdcd61e69fdb6e78b9ca9f83..8940b5387decc4fda02d8f41a3a86189d2380803 100644 (file)
@@ -9,7 +9,7 @@ config VIDEO_CX18
        select VIDEO_CX2341X
        select VIDEO_CS5345
        select DVB_S5H1409 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MXL5005S if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMIZE
        ---help---
          This is a video4linux driver for Conexant cx23418 based
          PCI combo video recorder devices.
index 8c1b7fa47a41cc36f35d3f4c763ff65c190e792c..00f1e2e8889e7fe23431827e17ce9f8b862d2714 100644 (file)
@@ -11,16 +11,16 @@ config VIDEO_CX23885
        select VIDEO_CX25840
        select VIDEO_CX2341X
        select DVB_DIB7000P if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MT2131 if !DVB_FE_CUSTOMISE
        select DVB_S5H1409 if !DVB_FE_CUSTOMISE
        select DVB_S5H1411 if !DVB_FE_CUSTOMISE
        select DVB_LGDT330X if !DVB_FE_CUSTOMISE
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
+       select DVB_TDA10048 if !DVB_FE_CUSTOMIZE
+       select MEDIA_TUNER_MT2131 if !MEDIA_TUNER_CUSTOMIZE
        select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMIZE
        select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMIZE
        select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE
        select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMIZE
-       select DVB_TDA10048 if !DVB_FE_CUSTOMIZE
        ---help---
          This is a video4linux driver for Conexant 23885 based
          TV cards.
index 0b9e5fac6239f5783e0f42e24f8eb9d1c700dfed..b0f837588e01ee9bb5a8d4c14f7617958a33be19 100644 (file)
@@ -56,12 +56,12 @@ config VIDEO_CX88_DVB
        select DVB_NXT200X if !DVB_FE_CUSTOMISE
        select DVB_CX24123 if !DVB_FE_CUSTOMISE
        select DVB_ISL6421 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE
        select DVB_S5H1411 if !DVB_FE_CUSTOMISE
        select DVB_CX24116 if !DVB_FE_CUSTOMISE
        select DVB_STV0299 if !DVB_FE_CUSTOMISE
        select DVB_STV0288 if !DVB_FE_CUSTOMISE
        select DVB_STB6000 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE
        ---help---
          This adds support for DVB/ATSC cards based on the
          Conexant 2388x chip.
index 610f535a257cd3c47b40d80484ad952177aaec38..4ea1f1e048979e51859652d93e24846a7f39fd3e 100644 (file)
@@ -549,10 +549,11 @@ static int em28xx_config(struct em28xx *dev)
 static void em28xx_config_i2c(struct em28xx *dev)
 {
        struct v4l2_routing route;
+       int zero = 0;
 
        route.input = INPUT(dev->ctl_input)->vmux;
        route.output = 0;
-       em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, NULL);
+       em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, &zero);
        em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route);
        em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL);
 }
index 748a87e82e4423e2b9ecfb4c4ac621a339231e4a..02a6e9ef033740d7401b6bd1ccd5966552add823 100644 (file)
@@ -1264,10 +1264,10 @@ static int vidioc_s_jpegcomp(struct file *file, void *priv,
        struct gspca_dev *gspca_dev = priv;
        int ret;
 
-       if (mutex_lock_interruptible(&gspca_dev->usb_lock))
-               return -ERESTARTSYS;
        if (!gspca_dev->sd_desc->set_jcomp)
                return -EINVAL;
+       if (mutex_lock_interruptible(&gspca_dev->usb_lock))
+               return -ERESTARTSYS;
        ret = gspca_dev->sd_desc->set_jcomp(gspca_dev, jpegcomp);
        mutex_unlock(&gspca_dev->usb_lock);
        return ret;
index 19eb274c9cd09d2f361154ed764d152472df709f..854c2a88535880a3e2a6c2d560303c46faaa8f2f 100644 (file)
@@ -42,7 +42,7 @@ config VIDEO_PVRUSB2_DVB
        select DVB_S5H1411 if !DVB_FE_CUSTOMISE
        select DVB_TDA10048 if !DVB_FE_CUSTOMIZE
        select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE
-       select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE
        select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMIZE
        ---help---
 
index 7021bbf5897b3ac6988fd5d42d28bc70a4231c9f..fc2164e28e76d11bbcb12fa60de4cb69d8acb7f3 100644 (file)
@@ -34,9 +34,9 @@ config VIDEO_SAA7134_DVB
        select DVB_NXT200X if !DVB_FE_CUSTOMISE
        select DVB_TDA10086 if !DVB_FE_CUSTOMISE
        select DVB_TDA826X if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_TDA827X if !DVB_FE_CUSTOMISE
        select DVB_ISL6421 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE
        ---help---
          This adds support for DVB cards based on the
          Philips saa7134 chip.
index fee7304102af8158ca3882bccb854f0f6fcb2bbe..d9aac2e653912624106f69a10624a88b9d41798d 100644 (file)
@@ -428,10 +428,10 @@ config EEEPC_LAPTOP
        tristate "Eee PC Hotkey Driver (EXPERIMENTAL)"
        depends on X86
        depends on ACPI
-       depends on BACKLIGHT_CLASS_DEVICE
-       depends on HWMON
        depends on EXPERIMENTAL
-       depends on RFKILL
+       select BACKLIGHT_CLASS_DEVICE
+       select HWMON
+       select RFKILL
        ---help---
          This driver supports the Fn-Fx keys on Eee PC laptops.
          It also adds the ability to switch camera/wlan on/off.
index 4a1bc64485d5a61523a2eaee5975555c843ac859..f30db367c82eed36540b9db55f7e6b9abb72267b 100644 (file)
@@ -241,8 +241,6 @@ static int acpi_pcc_write_sset(struct pcc_acpi *pcc, int func, int val)
        };
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_TRACE("acpi_pcc_write_sset");
-
        status = acpi_evaluate_object(pcc->handle, METHOD_HKEY_SSET,
                                      &params, NULL);
 
@@ -254,8 +252,6 @@ static inline int acpi_pcc_get_sqty(struct acpi_device *device)
        unsigned long long s;
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("acpi_pcc_get_sqty");
-
        status = acpi_evaluate_integer(device->handle, METHOD_HKEY_SQTY,
                                       NULL, &s);
        if (ACPI_SUCCESS(status))
@@ -274,8 +270,6 @@ static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc, u32 *sinf)
        union acpi_object *hkey = NULL;
        int i;
 
-       ACPI_FUNCTION_TRACE("acpi_pcc_retrieve_biosdata");
-
        status = acpi_evaluate_object(pcc->handle, METHOD_HKEY_SINF, 0,
                                      &buffer);
        if (ACPI_FAILURE(status)) {
@@ -501,8 +495,6 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
        int key_code, hkey_num;
        unsigned long long result;
 
-       ACPI_FUNCTION_TRACE("acpi_pcc_generate_keyinput");
-
        rc = acpi_evaluate_integer(pcc->handle, METHOD_HKEY_QUERY,
                                   NULL, &result);
        if (!ACPI_SUCCESS(rc)) {
@@ -538,8 +530,6 @@ static void acpi_pcc_hotkey_notify(acpi_handle handle, u32 event, void *data)
 {
        struct pcc_acpi *pcc = (struct pcc_acpi *) data;
 
-       ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_notify");
-
        switch (event) {
        case HKEY_NOTIFY:
                acpi_pcc_generate_keyinput(pcc);
@@ -554,8 +544,6 @@ static int acpi_pcc_init_input(struct pcc_acpi *pcc)
 {
        int i, rc;
 
-       ACPI_FUNCTION_TRACE("acpi_pcc_init_input");
-
        pcc->input_dev = input_allocate_device();
        if (!pcc->input_dev) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
@@ -597,8 +585,6 @@ static int acpi_pcc_hotkey_resume(struct acpi_device *device)
        struct pcc_acpi *pcc = acpi_driver_data(device);
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_resume");
-
        if (device == NULL || pcc == NULL)
                return -EINVAL;
 
@@ -616,8 +602,6 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
        struct pcc_acpi *pcc;
        int num_sifr, result;
 
-       ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_add");
-
        if (!device)
                return -EINVAL;
 
@@ -714,8 +698,6 @@ static int __init acpi_pcc_init(void)
 {
        int result = 0;
 
-       ACPI_FUNCTION_TRACE("acpi_pcc_init");
-
        if (acpi_disabled)
                return -ENODEV;
 
@@ -733,8 +715,6 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type)
 {
        struct pcc_acpi *pcc = acpi_driver_data(device);
 
-       ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_remove");
-
        if (!device || !pcc)
                return -EINVAL;
 
@@ -757,8 +737,6 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type)
 
 static void __exit acpi_pcc_exit(void)
 {
-       ACPI_FUNCTION_TRACE("acpi_pcc_exit");
-
        acpi_bus_unregister_driver(&acpi_pcc_driver);
 }
 
index 571b211608d1a7224575d99fe3ca5e27cccd03a2..537959d07148a9c3f1e76ec0637b6de3c65ac1cb 100644 (file)
@@ -935,14 +935,17 @@ static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)
 static acpi_status sony_walk_callback(acpi_handle handle, u32 level,
                                      void *context, void **return_value)
 {
-       struct acpi_namespace_node *node;
-       union acpi_operand_object *operand;
+       struct acpi_device_info *info;
+       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
 
-       node = (struct acpi_namespace_node *)handle;
-       operand = (union acpi_operand_object *)node->object;
+       if (ACPI_SUCCESS(acpi_get_object_info(handle, &buffer))) {
+               info = buffer.pointer;
 
-       printk(KERN_WARNING DRV_PFX "method: name: %4.4s, args %X\n", node->name.ascii,
-              (u32) operand->method.param_count);
+               printk(KERN_WARNING DRV_PFX "method: name: %4.4s, args %X\n",
+                       (char *)&info->name, info->param_count);
+
+               kfree(buffer.pointer);
+       }
 
        return AE_OK;
 }
index f25e4c974dcf9d7f4ff557451d234cd6d2a05428..b4a4aa9ee482edacecb4224b4245ee8db2ba0c7f 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <acpi/acpi.h>
-#include <acpi/actypes.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 #include <linux/platform_device.h>
index 899766e16fa822cdfd7abc240e2ce0ee7ea329e4..3478453eba7a3e8e2997cc25fcdd807f377efb86 100644 (file)
@@ -76,7 +76,6 @@
 #include <linux/workqueue.h>
 
 #include <acpi/acpi_drivers.h>
-#include <acpi/acnamesp.h>
 
 #include <linux/pci_ids.h>
 
index 7e857e938adb582ae432b26d35114e8099d51eb2..714a23035de1980a968c19a835712d587c007c17 100644 (file)
@@ -116,6 +116,7 @@ struct ppp {
        unsigned long   last_xmit;      /* jiffies when last pkt sent 9c */
        unsigned long   last_recv;      /* jiffies when last pkt rcvd a0 */
        struct net_device *dev;         /* network interface device a4 */
+       int             closing;        /* is device closing down? a8 */
 #ifdef CONFIG_PPP_MULTILINK
        int             nxchan;         /* next channel to send something on */
        u32             nxseq;          /* next sequence number to send */
@@ -995,7 +996,7 @@ ppp_xmit_process(struct ppp *ppp)
        struct sk_buff *skb;
 
        ppp_xmit_lock(ppp);
-       if (ppp->dev) {
+       if (!ppp->closing) {
                ppp_push(ppp);
                while (!ppp->xmit_pending
                       && (skb = skb_dequeue(&ppp->file.xq)))
@@ -1463,8 +1464,7 @@ static inline void
 ppp_do_recv(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
 {
        ppp_recv_lock(ppp);
-       /* ppp->dev == 0 means interface is closing down */
-       if (ppp->dev)
+       if (!ppp->closing)
                ppp_receive_frame(ppp, skb, pch);
        else
                kfree_skb(skb);
@@ -2498,18 +2498,16 @@ init_ppp_file(struct ppp_file *pf, int kind)
  */
 static void ppp_shutdown_interface(struct ppp *ppp)
 {
-       struct net_device *dev;
-
        mutex_lock(&all_ppp_mutex);
-       ppp_lock(ppp);
-       dev = ppp->dev;
-       ppp->dev = NULL;
-       ppp_unlock(ppp);
        /* This will call dev_close() for us. */
-       if (dev) {
-               unregister_netdev(dev);
-               free_netdev(dev);
-       }
+       ppp_lock(ppp);
+       if (!ppp->closing) {
+               ppp->closing = 1;
+               ppp_unlock(ppp);
+               unregister_netdev(ppp->dev);
+       } else
+               ppp_unlock(ppp);
+
        cardmap_set(&all_ppp_units, ppp->file.index, NULL);
        ppp->file.dead = 1;
        ppp->owner = NULL;
@@ -2554,7 +2552,7 @@ static void ppp_destroy_interface(struct ppp *ppp)
        if (ppp->xmit_pending)
                kfree_skb(ppp->xmit_pending);
 
-       kfree(ppp);
+       free_netdev(ppp->dev);
 }
 
 /*
@@ -2616,7 +2614,7 @@ ppp_connect_channel(struct channel *pch, int unit)
        if (pch->file.hdrlen > ppp->file.hdrlen)
                ppp->file.hdrlen = pch->file.hdrlen;
        hdrlen = pch->file.hdrlen + 2;  /* for protocol bytes */
-       if (ppp->dev && hdrlen > ppp->dev->hard_header_len)
+       if (hdrlen > ppp->dev->hard_header_len)
                ppp->dev->hard_header_len = hdrlen;
        list_add_tail(&pch->clist, &ppp->channels);
        ++ppp->n_channels;
index e17ef54f0efced2d0173a9f5af250c2f0fa93517..2c981cbb0719c61f6faed445719c5f48f4d523cf 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/pci-acpi.h>
 #include <acpi/acpi.h>
 #include <acpi/acpi_bus.h>
-#include <acpi/actypes.h>
 
 #define MY_NAME        "acpi_pcihp"
 
index b2801a7ee37f8d14864f6275181f2616bd8e7fd1..7072952ea1d28b6337ccc302a8b4d11b470fc1c6 100644 (file)
@@ -217,7 +217,6 @@ struct hpc_ops {
 #ifdef CONFIG_ACPI
 #include <acpi/acpi.h>
 #include <acpi/acpi_bus.h>
-#include <acpi/actypes.h>
 #include <linux/pci-acpi.h>
 
 static inline int pciehp_get_hp_hw_control_from_firmware(struct pci_dev *dev)
index ae5ec76dca77a636bf5b1f1a6cf4c52b03b8d9c8..9d976d51d406ddc5a55d414da87fd382c7b504ec 100644 (file)
@@ -13,8 +13,6 @@
 #include <linux/module.h>
 #include <linux/pci-aspm.h>
 #include <acpi/acpi.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acresrc.h>
 #include <acpi/acpi_bus.h>
 
 #include <linux/pci-acpi.h>
index 383e47c392a4c8ea69fe7459e302e6d76ee77cff..2834846a185dd26a2d94ffd361dba3d6fbbce8a7 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/pnp.h>
 #include <linux/mod_devicetable.h>
 #include <acpi/acpi_bus.h>
-#include <acpi/actypes.h>
 
 #include "../base.h"
 #include "pnpacpi.h"
index 2cd77ab8fc66b06e43d3b908884a9f4fe8603ca1..054e05294af8566e30d3834fc23c793b615239f9 100644 (file)
@@ -328,6 +328,13 @@ isl1208_i2c_set_time(struct i2c_client *client, struct rtc_time const *tm)
        int sr;
        u8 regs[ISL1208_RTC_SECTION_LEN] = { 0, };
 
+       /* The clock has an 8 bit wide bcd-coded register (they never learn)
+        * for the year. tm_year is an offset from 1900 and we are interested
+        * in the 2000-2099 range, so any value less than 100 is invalid.
+        */
+       if (tm->tm_year < 100)
+               return -EINVAL;
+
        regs[ISL1208_REG_SC] = bin2bcd(tm->tm_sec);
        regs[ISL1208_REG_MN] = bin2bcd(tm->tm_min);
        regs[ISL1208_REG_HR] = bin2bcd(tm->tm_hour) | ISL1208_REG_HR_MIL;
index 0d15b0eaf79a7b5a56eb50bb00efc1a9571280e6..5139c25ca96288474cf976cf5577be12c6d6d30b 100644 (file)
@@ -356,7 +356,9 @@ int w1_reset_select_slave(struct w1_slave *sl)
                w1_write_8(sl->master, W1_SKIP_ROM);
        else {
                u8 match[9] = {W1_MATCH_ROM, };
-               memcpy(&match[1], (u8 *)&sl->reg_num, 8);
+               u64 rn = le64_to_cpu(*((u64*)&sl->reg_num));
+
+               memcpy(&match[1], &rn, 8);
                w1_write_block(sl->master, match, 9);
        }
        return 0;
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
deleted file mode 100644 (file)
index 0c1ed38..0000000
+++ /dev/null
@@ -1,445 +0,0 @@
-/******************************************************************************
- *
- * Name: acdisasm.h - AML disassembler
- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2008, Intel Corp.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- *    substantially similar to the "NO WARRANTY" disclaimer below
- *    ("Disclaimer") and any redistribution must be conditioned upon
- *    including a substantially similar Disclaimer requirement for further
- *    binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- *    of any contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- */
-
-#ifndef __ACDISASM_H__
-#define __ACDISASM_H__
-
-#include "amlresrc.h"
-
-#define BLOCK_NONE              0
-#define BLOCK_PAREN             1
-#define BLOCK_BRACE             2
-#define BLOCK_COMMA_LIST        4
-#define ACPI_DEFAULT_RESNAME    *(u32 *) "__RD"
-
-struct acpi_external_list {
-       char *path;
-       char *internal_path;
-       struct acpi_external_list *next;
-       u32 value;
-       u16 length;
-       u8 type;
-};
-
-extern struct acpi_external_list *acpi_gbl_external_list;
-
-typedef const struct acpi_dmtable_info {
-       u8 opcode;
-       u8 offset;
-       char *name;
-
-} acpi_dmtable_info;
-
-/*
- * Values for Opcode above.
- * Note: 0-7 must not change, used as a flag shift value
- */
-#define ACPI_DMT_FLAG0                  0
-#define ACPI_DMT_FLAG1                  1
-#define ACPI_DMT_FLAG2                  2
-#define ACPI_DMT_FLAG3                  3
-#define ACPI_DMT_FLAG4                  4
-#define ACPI_DMT_FLAG5                  5
-#define ACPI_DMT_FLAG6                  6
-#define ACPI_DMT_FLAG7                  7
-#define ACPI_DMT_FLAGS0                 8
-#define ACPI_DMT_FLAGS2                 9
-#define ACPI_DMT_UINT8                  10
-#define ACPI_DMT_UINT16                 11
-#define ACPI_DMT_UINT24                 12
-#define ACPI_DMT_UINT32                 13
-#define ACPI_DMT_UINT56                 14
-#define ACPI_DMT_UINT64                 15
-#define ACPI_DMT_STRING                 16
-#define ACPI_DMT_NAME4                  17
-#define ACPI_DMT_NAME6                  18
-#define ACPI_DMT_NAME8                  19
-#define ACPI_DMT_CHKSUM                 20
-#define ACPI_DMT_SPACEID                21
-#define ACPI_DMT_GAS                    22
-#define ACPI_DMT_ASF                    23
-#define ACPI_DMT_DMAR                   24
-#define ACPI_DMT_HEST                   25
-#define ACPI_DMT_HESTNTFY               26
-#define ACPI_DMT_HESTNTYP               27
-#define ACPI_DMT_MADT                   28
-#define ACPI_DMT_SRAT                   29
-#define ACPI_DMT_EXIT                   30
-#define ACPI_DMT_SIG                    31
-
-typedef
-void (*acpi_dmtable_handler) (struct acpi_table_header * table);
-
-struct acpi_dmtable_data {
-       char *signature;
-       struct acpi_dmtable_info *table_info;
-       acpi_dmtable_handler table_handler;
-       char *name;
-};
-
-struct acpi_op_walk_info {
-       u32 level;
-       u32 last_level;
-       u32 count;
-       u32 bit_offset;
-       u32 flags;
-       struct acpi_walk_state *walk_state;
-};
-
-typedef
-acpi_status(*asl_walk_callback) (union acpi_parse_object * op,
-                                u32 level, void *context);
-
-struct acpi_resource_tag {
-       u32 bit_index;
-       char *tag;
-};
-
-/* Strings used for decoding flags to ASL keywords */
-
-extern const char *acpi_gbl_word_decode[];
-extern const char *acpi_gbl_irq_decode[];
-extern const char *acpi_gbl_lock_rule[];
-extern const char *acpi_gbl_access_types[];
-extern const char *acpi_gbl_update_rules[];
-extern const char *acpi_gbl_match_ops[];
-
-extern struct acpi_dmtable_info acpi_dm_table_info_asf0[];
-extern struct acpi_dmtable_info acpi_dm_table_info_asf1[];
-extern struct acpi_dmtable_info acpi_dm_table_info_asf1a[];
-extern struct acpi_dmtable_info acpi_dm_table_info_asf2[];
-extern struct acpi_dmtable_info acpi_dm_table_info_asf2a[];
-extern struct acpi_dmtable_info acpi_dm_table_info_asf3[];
-extern struct acpi_dmtable_info acpi_dm_table_info_asf4[];
-extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[];
-extern struct acpi_dmtable_info acpi_dm_table_info_boot[];
-extern struct acpi_dmtable_info acpi_dm_table_info_bert[];
-extern struct acpi_dmtable_info acpi_dm_table_info_cpep[];
-extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[];
-extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[];
-extern struct acpi_dmtable_info acpi_dm_table_info_dmar[];
-extern struct acpi_dmtable_info acpi_dm_table_info_dmar_hdr[];
-extern struct acpi_dmtable_info acpi_dm_table_info_dmar_scope[];
-extern struct acpi_dmtable_info acpi_dm_table_info_dmar0[];
-extern struct acpi_dmtable_info acpi_dm_table_info_dmar1[];
-extern struct acpi_dmtable_info acpi_dm_table_info_dmar2[];
-extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
-extern struct acpi_dmtable_info acpi_dm_table_info_einj[];
-extern struct acpi_dmtable_info acpi_dm_table_info_einj0[];
-extern struct acpi_dmtable_info acpi_dm_table_info_erst[];
-extern struct acpi_dmtable_info acpi_dm_table_info_facs[];
-extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[];
-extern struct acpi_dmtable_info acpi_dm_table_info_fadt2[];
-extern struct acpi_dmtable_info acpi_dm_table_info_gas[];
-extern struct acpi_dmtable_info acpi_dm_table_info_header[];
-extern struct acpi_dmtable_info acpi_dm_table_info_hest[];
-extern struct acpi_dmtable_info acpi_dm_table_info_hest9[];
-extern struct acpi_dmtable_info acpi_dm_table_info_hest_notify[];
-extern struct acpi_dmtable_info acpi_dm_table_info_hpet[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt0[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt1[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt2[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt3[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt4[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt5[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt6[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt7[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt8[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt9[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt10[];
-extern struct acpi_dmtable_info acpi_dm_table_info_madt_hdr[];
-extern struct acpi_dmtable_info acpi_dm_table_info_mcfg[];
-extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[];
-extern struct acpi_dmtable_info acpi_dm_table_info_rsdp1[];
-extern struct acpi_dmtable_info acpi_dm_table_info_rsdp2[];
-extern struct acpi_dmtable_info acpi_dm_table_info_sbst[];
-extern struct acpi_dmtable_info acpi_dm_table_info_slic[];
-extern struct acpi_dmtable_info acpi_dm_table_info_slit[];
-extern struct acpi_dmtable_info acpi_dm_table_info_spcr[];
-extern struct acpi_dmtable_info acpi_dm_table_info_spmi[];
-extern struct acpi_dmtable_info acpi_dm_table_info_srat[];
-extern struct acpi_dmtable_info acpi_dm_table_info_srat_hdr[];
-extern struct acpi_dmtable_info acpi_dm_table_info_srat0[];
-extern struct acpi_dmtable_info acpi_dm_table_info_srat1[];
-extern struct acpi_dmtable_info acpi_dm_table_info_srat2[];
-extern struct acpi_dmtable_info acpi_dm_table_info_tcpa[];
-extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[];
-
-/*
- * dmtable
- */
-void acpi_dm_dump_data_table(struct acpi_table_header *table);
-
-acpi_status
-acpi_dm_dump_table(u32 table_length,
-                  u32 table_offset,
-                  void *table,
-                  u32 sub_table_length, struct acpi_dmtable_info *info);
-
-void acpi_dm_line_header(u32 offset, u32 byte_length, char *name);
-
-void acpi_dm_line_header2(u32 offset, u32 byte_length, char *name, u32 value);
-
-/*
- * dmtbdump
- */
-void acpi_dm_dump_asf(struct acpi_table_header *table);
-
-void acpi_dm_dump_cpep(struct acpi_table_header *table);
-
-void acpi_dm_dump_dmar(struct acpi_table_header *table);
-
-void acpi_dm_dump_einj(struct acpi_table_header *table);
-
-void acpi_dm_dump_erst(struct acpi_table_header *table);
-
-void acpi_dm_dump_fadt(struct acpi_table_header *table);
-
-void acpi_dm_dump_hest(struct acpi_table_header *table);
-
-void acpi_dm_dump_mcfg(struct acpi_table_header *table);
-
-void acpi_dm_dump_madt(struct acpi_table_header *table);
-
-u32 acpi_dm_dump_rsdp(struct acpi_table_header *table);
-
-void acpi_dm_dump_rsdt(struct acpi_table_header *table);
-
-void acpi_dm_dump_slit(struct acpi_table_header *table);
-
-void acpi_dm_dump_srat(struct acpi_table_header *table);
-
-void acpi_dm_dump_xsdt(struct acpi_table_header *table);
-
-/*
- * dmwalk
- */
-void
-acpi_dm_disassemble(struct acpi_walk_state *walk_state,
-                   union acpi_parse_object *origin, u32 num_opcodes);
-
-void
-acpi_dm_walk_parse_tree(union acpi_parse_object *op,
-                       asl_walk_callback descending_callback,
-                       asl_walk_callback ascending_callback, void *context);
-
-/*
- * dmopcode
- */
-void
-acpi_dm_disassemble_one_op(struct acpi_walk_state *walk_state,
-                          struct acpi_op_walk_info *info,
-                          union acpi_parse_object *op);
-
-void acpi_dm_decode_internal_object(union acpi_operand_object *obj_desc);
-
-u32 acpi_dm_list_type(union acpi_parse_object *op);
-
-void acpi_dm_method_flags(union acpi_parse_object *op);
-
-void acpi_dm_field_flags(union acpi_parse_object *op);
-
-void acpi_dm_address_space(u8 space_id);
-
-void acpi_dm_region_flags(union acpi_parse_object *op);
-
-void acpi_dm_match_op(union acpi_parse_object *op);
-
-u8 acpi_dm_comma_if_list_member(union acpi_parse_object *op);
-
-void acpi_dm_comma_if_field_member(union acpi_parse_object *op);
-
-/*
- * dmnames
- */
-u32 acpi_dm_dump_name(char *name);
-
-acpi_status
-acpi_ps_display_object_pathname(struct acpi_walk_state *walk_state,
-                               union acpi_parse_object *op);
-
-void acpi_dm_namestring(char *name);
-
-/*
- * dmobject
- */
-void
-acpi_dm_display_internal_object(union acpi_operand_object *obj_desc,
-                               struct acpi_walk_state *walk_state);
-
-void acpi_dm_display_arguments(struct acpi_walk_state *walk_state);
-
-void acpi_dm_display_locals(struct acpi_walk_state *walk_state);
-
-void
-acpi_dm_dump_method_info(acpi_status status,
-                        struct acpi_walk_state *walk_state,
-                        union acpi_parse_object *op);
-
-/*
- * dmbuffer
- */
-void acpi_dm_disasm_byte_list(u32 level, u8 * byte_data, u32 byte_count);
-
-void
-acpi_dm_byte_list(struct acpi_op_walk_info *info, union acpi_parse_object *op);
-
-void acpi_dm_is_eisa_id(union acpi_parse_object *op);
-
-void acpi_dm_eisa_id(u32 encoded_id);
-
-u8 acpi_dm_is_unicode_buffer(union acpi_parse_object *op);
-
-u8 acpi_dm_is_string_buffer(union acpi_parse_object *op);
-
-/*
- * dmresrc
- */
-void acpi_dm_dump_integer8(u8 value, char *name);
-
-void acpi_dm_dump_integer16(u16 value, char *name);
-
-void acpi_dm_dump_integer32(u32 value, char *name);
-
-void acpi_dm_dump_integer64(u64 value, char *name);
-
-void
-acpi_dm_resource_template(struct acpi_op_walk_info *info,
-                         union acpi_parse_object *op,
-                         u8 * byte_data, u32 byte_count);
-
-acpi_status acpi_dm_is_resource_template(union acpi_parse_object *op);
-
-void acpi_dm_indent(u32 level);
-
-void acpi_dm_bit_list(u16 mask);
-
-void acpi_dm_decode_attribute(u8 attribute);
-
-void acpi_dm_descriptor_name(void);
-
-/*
- * dmresrcl
- */
-void
-acpi_dm_word_descriptor(union aml_resource *resource, u32 length, u32 level);
-
-void
-acpi_dm_dword_descriptor(union aml_resource *resource, u32 length, u32 level);
-
-void
-acpi_dm_extended_descriptor(union aml_resource *resource,
-                           u32 length, u32 level);
-
-void
-acpi_dm_qword_descriptor(union aml_resource *resource, u32 length, u32 level);
-
-void
-acpi_dm_memory24_descriptor(union aml_resource *resource,
-                           u32 length, u32 level);
-
-void
-acpi_dm_memory32_descriptor(union aml_resource *resource,
-                           u32 length, u32 level);
-
-void
-acpi_dm_fixed_memory32_descriptor(union aml_resource *resource,
-                                 u32 length, u32 level);
-
-void
-acpi_dm_generic_register_descriptor(union aml_resource *resource,
-                                   u32 length, u32 level);
-
-void
-acpi_dm_interrupt_descriptor(union aml_resource *resource,
-                            u32 length, u32 level);
-
-void
-acpi_dm_vendor_large_descriptor(union aml_resource *resource,
-                               u32 length, u32 level);
-
-void acpi_dm_vendor_common(char *name, u8 * byte_data, u32 length, u32 level);
-
-/*
- * dmresrcs
- */
-void
-acpi_dm_irq_descriptor(union aml_resource *resource, u32 length, u32 level);
-
-void
-acpi_dm_dma_descriptor(union aml_resource *resource, u32 length, u32 level);
-
-void acpi_dm_io_descriptor(union aml_resource *resource, u32 length, u32 level);
-
-void
-acpi_dm_fixed_io_descriptor(union aml_resource *resource,
-                           u32 length, u32 level);
-
-void
-acpi_dm_start_dependent_descriptor(union aml_resource *resource,
-                                  u32 length, u32 level);
-
-void
-acpi_dm_end_dependent_descriptor(union aml_resource *resource,
-                                u32 length, u32 level);
-
-void
-acpi_dm_vendor_small_descriptor(union aml_resource *resource,
-                               u32 length, u32 level);
-
-/*
- * dmutils
- */
-void acpi_dm_add_to_external_list(char *path, u8 type, u32 value);
-
-/*
- * dmrestag
- */
-void acpi_dm_find_resources(union acpi_parse_object *root);
-
-void
-acpi_dm_check_resource_reference(union acpi_parse_object *op,
-                                struct acpi_walk_state *walk_state);
-
-#endif                         /* __ACDISASM_H__ */
index 84f5cb242863c28829c3919b62c57c1e699c68e3..eda04546cdf64c7d8a2c050a48c63c1fee609f6c 100644 (file)
 #define AE_AML_CIRCULAR_REFERENCE       (acpi_status) (0x001E | AE_CODE_AML)
 #define AE_AML_BAD_RESOURCE_LENGTH      (acpi_status) (0x001F | AE_CODE_AML)
 #define AE_AML_ILLEGAL_ADDRESS          (acpi_status) (0x0020 | AE_CODE_AML)
+#define AE_AML_INFINITE_LOOP            (acpi_status) (0x0021 | AE_CODE_AML)
 
-#define AE_CODE_AML_MAX                 0x0020
+#define AE_CODE_AML_MAX                 0x0021
 
 /*
  * Internal exceptions used for control
 
 #define AE_CODE_CTRL_MAX                0x000D
 
+/* Exception strings for acpi_format_exception */
+
 #ifdef DEFINE_ACPI_GLOBALS
 
 /*
@@ -267,6 +270,7 @@ char const *acpi_gbl_exception_names_aml[] = {
        "AE_AML_CIRCULAR_REFERENCE",
        "AE_AML_BAD_RESOURCE_LENGTH",
        "AE_AML_ILLEGAL_ADDRESS",
+       "AE_AML_INFINITE_LOOP"
 };
 
 char const *acpi_gbl_exception_names_ctrl[] = {
index 09d33c7740f0bfbf48f195c57bb209a03297baf4..5c823d5ab7839f003f34f702992411f35d0e0a21 100644 (file)
@@ -45,9 +45,9 @@
 #define __ACOUTPUT_H__
 
 /*
- * Debug levels and component IDs.  These are used to control the
- * granularity of the output of the DEBUG_PRINT macro -- on a per-
- * component basis and a per-exception-type basis.
+ * Debug levels and component IDs. These are used to control the
+ * granularity of the output of the ACPI_DEBUG_PRINT macro -- on a
+ * per-component basis and a per-exception-type basis.
  */
 
 /* Component IDs are used in the global "DebugLayer" */
 
 #define ACPI_COMPILER               0x00001000
 #define ACPI_TOOLS                  0x00002000
+#define ACPI_EXAMPLE                0x00004000
+#define ACPI_DRIVER                 0x00008000
 
-#define ACPI_ALL_COMPONENTS         0x00003FFF
+#define ACPI_ALL_COMPONENTS         0x0000FFFF
 #define ACPI_COMPONENT_DEFAULT      (ACPI_ALL_COMPONENTS)
 
 /* Component IDs reserved for ACPI drivers */
@@ -78,7 +80,7 @@
 #define ACPI_ALL_DRIVERS            0xFFFF0000
 
 /*
- * Raw debug output levels, do not use these in the DEBUG_PRINT macros
+ * Raw debug output levels, do not use these in the ACPI_DEBUG_PRINT macros
  */
 #define ACPI_LV_INIT                0x00000001
 #define ACPI_LV_DEBUG_OBJECT        0x00000002
 
 /* Defaults for debug_level, debug and normal */
 
-#define ACPI_DEBUG_DEFAULT          (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT)
+#define ACPI_DEBUG_DEFAULT          (ACPI_LV_INFO)
 #define ACPI_NORMAL_DEFAULT         (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT)
 #define ACPI_DEBUG_ALL              (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
 
+#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
+/*
+ * Module name is included in both debug and non-debug versions primarily for
+ * error messages. The __FILE__ macro is not very useful for this, because it
+ * often includes the entire pathname to the module
+ */
+#define ACPI_MODULE_NAME(name)          static const char ACPI_UNUSED_VAR _acpi_module_name[] = name;
+#else
+#define ACPI_MODULE_NAME(name)
+#endif
+
+/*
+ * Ascii error messages can be configured out
+ */
+#ifndef ACPI_NO_ERROR_MESSAGES
+#define AE_INFO                         _acpi_module_name, __LINE__
+
+/*
+ * Error reporting. Callers module and line number are inserted by AE_INFO,
+ * the plist contains a set of parens to allow variable-length lists.
+ * These macros are used for both the debug and non-debug versions of the code.
+ */
+#define ACPI_INFO(plist)                acpi_info plist
+#define ACPI_WARNING(plist)             acpi_warning plist
+#define ACPI_EXCEPTION(plist)           acpi_exception plist
+#define ACPI_ERROR(plist)               acpi_error plist
+
+#else
+
+/* No error messages */
+
+#define ACPI_INFO(plist)
+#define ACPI_WARNING(plist)
+#define ACPI_EXCEPTION(plist)
+#define ACPI_ERROR(plist)
+
+#endif                         /* ACPI_NO_ERROR_MESSAGES */
+
+/*
+ * Debug macros that are conditionally compiled
+ */
+#ifdef ACPI_DEBUG_OUTPUT
+
+/*
+ * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
+ * define it now. This is the case where there the compiler does not support
+ * a __FUNCTION__ macro or equivalent.
+ */
+#ifndef ACPI_GET_FUNCTION_NAME
+#define ACPI_GET_FUNCTION_NAME          _acpi_function_name
+
+/*
+ * The Name parameter should be the procedure name as a quoted string.
+ * The function name is also used by the function exit macros below.
+ * Note: (const char) is used to be compatible with the debug interfaces
+ * and macros such as __FUNCTION__.
+ */
+#define ACPI_FUNCTION_NAME(name)        static const char _acpi_function_name[] = #name;
+
+#else
+/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
+
+#define ACPI_FUNCTION_NAME(name)
+#endif                         /* ACPI_GET_FUNCTION_NAME */
+
+/*
+ * Common parameters used for debug output functions:
+ * line number, function name, module(file) name, component ID
+ */
+#define ACPI_DEBUG_PARAMETERS           __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
+
+/*
+ * Master debug print macros
+ * Print message if and only if:
+ *    1) Debug print for the current component is enabled
+ *    2) Debug error level or trace level for the print statement is enabled
+ */
+#define ACPI_DEBUG_PRINT(plist)         acpi_debug_print plist
+#define ACPI_DEBUG_PRINT_RAW(plist)     acpi_debug_print_raw plist
+
+#else
+/*
+ * This is the non-debug case -- make everything go away,
+ * leaving no executable debug code!
+ */
+#define ACPI_FUNCTION_NAME(a)
+#define ACPI_DEBUG_PRINT(pl)
+#define ACPI_DEBUG_PRINT_RAW(pl)
+
+#endif                         /* ACPI_DEBUG_OUTPUT */
+
 #endif                         /* __ACOUTPUT_H__ */
index c515ef6cc89e2c7f23d2267c3bd665b1db601180..472b7bf0c5d4ebe9161d7f4d099169fe615f00b8 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Name: acpi.h - Master include file, Publics and external data.
+ * Name: acpi.h - Master public include file used to interface to ACPICA
  *
  *****************************************************************************/
 
 #define __ACPI_H__
 
 /*
- * Common includes for all ACPI driver files
- * We put them here because we don't want to duplicate them
- * in the rest of the source code again and again.
+ * Public include files for use by code that will interface to ACPICA.
+ *
+ * Information includes the ACPICA data types, names, exceptions, and
+ * external interface prototypes. Also included are the definitions for
+ * all ACPI tables (FADT, MADT, etc.)
+ *
+ * Note: The order of these include files is important.
  */
-#include "acnames.h"           /* Global ACPI names and strings */
-#include "acconfig.h"          /* Configuration constants */
-#include "platform/acenv.h"    /* Target environment specific items */
-#include "actypes.h"           /* Fundamental common data types */
-#include "acexcep.h"           /* ACPI exception codes */
-#include "acmacros.h"          /* C macros */
+#include "platform/acenv.h"    /* Environment-specific items */
+#include "acnames.h"           /* Common ACPI names and strings */
+#include "actypes.h"           /* ACPICA data types and structures */
+#include "acexcep.h"           /* ACPICA exceptions */
 #include "actbl.h"             /* ACPI table definitions */
-#include "aclocal.h"           /* Internal data types */
 #include "acoutput.h"          /* Error output and Debug macros */
-#include "acpiosxf.h"          /* Interfaces to the ACPI-to-OS layer */
+#include "acrestyp.h"          /* Resource Descriptor structs */
+#include "acpiosxf.h"          /* OSL interfaces (ACPICA-to-OS) */
 #include "acpixf.h"            /* ACPI core subsystem external interfaces */
-#include "acobject.h"          /* ACPI internal object */
-#include "acstruct.h"          /* Common structures */
-#include "acglobal.h"          /* All global variables */
-#include "achware.h"           /* Hardware defines and interfaces */
-#include "acutils.h"           /* Utility interfaces */
 
 #endif                         /* __ACPI_H__ */
index b91440ac0d168e0865d0e5e4156d1e7fe8356958..a62720a7edc0165b7b698a5d7a2d14841a78f27f 100644 (file)
@@ -121,8 +121,11 @@ acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout);
 acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units);
 
 /*
- * Mutex primitives
+ * Mutex primitives. May be configured to use semaphores instead via
+ * ACPI_MUTEX_TYPE (see platform/acenv.h)
  */
+#if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
+
 acpi_status acpi_os_create_mutex(acpi_mutex * out_handle);
 
 void acpi_os_delete_mutex(acpi_mutex handle);
@@ -130,13 +133,7 @@ void acpi_os_delete_mutex(acpi_mutex handle);
 acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout);
 
 void acpi_os_release_mutex(acpi_mutex handle);
-
-/* Temporary macros for Mutex* interfaces, map to existing semaphore xfaces */
-
-#define acpi_os_create_mutex(out_handle)    acpi_os_create_semaphore (1, 1, out_handle)
-#define acpi_os_delete_mutex(handle)        (void) acpi_os_delete_semaphore (handle)
-#define acpi_os_acquire_mutex(handle,time)  acpi_os_wait_semaphore (handle, 1, time)
-#define acpi_os_release_mutex(handle)       (void) acpi_os_signal_semaphore (handle, 1)
+#endif
 
 /*
  * Memory allocation and mapping
index 33bc0e3b19546e8c1e8fb4225ec8615162c69d12..7c7074f20087ad1b7073a2f9ba54a790fcc8bb96 100644 (file)
 #ifndef __ACXFACE_H__
 #define __ACXFACE_H__
 
+/* Current ACPICA subsystem version in YYYYMMDD format */
+
+#define ACPI_CA_VERSION                 0x20081204
+
 #include "actypes.h"
 #include "actbl.h"
 
+extern u8 acpi_gbl_permanent_mmap;
+
+/*
+ * Globals that are publically available, allowing for
+ * run time configuration
+ */
+extern u32 acpi_dbg_level;
+extern u32 acpi_dbg_layer;
+extern u8 acpi_gbl_enable_interpreter_slack;
+extern u8 acpi_gbl_all_methods_serialized;
+extern u8 acpi_gbl_create_osi_method;
+extern u8 acpi_gbl_leave_wake_gpes_disabled;
+extern acpi_name acpi_gbl_trace_method_name;
+extern u32 acpi_gbl_trace_flags;
+
+extern u32 acpi_current_gpe_count;
+extern struct acpi_table_fadt acpi_gbl_FADT;
+
 /*
  * Global interfaces
  */
@@ -79,11 +101,6 @@ const char *acpi_format_exception(acpi_status exception);
 
 acpi_status acpi_purge_cached_objects(void);
 
-#ifdef ACPI_FUTURE_USAGE
-acpi_status
-acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
-#endif
-
 /*
  * ACPI Memory management
  */
@@ -193,8 +210,11 @@ acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type);
 acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle);
 
 /*
- * Event handler interfaces
+ * Handler interfaces
  */
+acpi_status
+acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
+
 acpi_status
 acpi_install_fixed_event_handler(u32 acpi_event,
                                 acpi_event_handler handler, void *context);
@@ -227,6 +247,10 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
                         u32 gpe_number,
                         u32 type, acpi_event_handler address, void *context);
 
+acpi_status
+acpi_remove_gpe_handler(acpi_handle gpe_device,
+                       u32 gpe_number, acpi_event_handler address);
+
 #ifdef ACPI_FUTURE_USAGE
 acpi_status acpi_install_exception_handler(acpi_exception_handler handler);
 #endif
@@ -238,10 +262,6 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle);
 
 acpi_status acpi_release_global_lock(u32 handle);
 
-acpi_status
-acpi_remove_gpe_handler(acpi_handle gpe_device,
-                       u32 gpe_number, acpi_event_handler address);
-
 acpi_status acpi_enable_event(u32 event, u32 flags);
 
 acpi_status acpi_disable_event(u32 event, u32 flags);
@@ -250,6 +270,9 @@ acpi_status acpi_clear_event(u32 event);
 
 acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status);
 
+/*
+ * GPE Interfaces
+ */
 acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type);
 
 acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number);
@@ -263,6 +286,12 @@ acpi_get_gpe_status(acpi_handle gpe_device,
                    u32 gpe_number,
                    u32 flags, acpi_event_status * event_status);
 
+acpi_status acpi_disable_all_gpes(void);
+
+acpi_status acpi_enable_all_runtime_gpes(void);
+
+acpi_status acpi_get_gpe_device(u32 gpe_index, acpi_handle *gpe_device);
+
 acpi_status
 acpi_install_gpe_block(acpi_handle gpe_device,
                       struct acpi_generic_address *gpe_block_address,
@@ -313,6 +342,8 @@ acpi_resource_to_address64(struct acpi_resource *resource,
 /*
  * Hardware (ACPI device) interfaces
  */
+acpi_status acpi_reset(void);
+
 acpi_status acpi_get_register(u32 register_id, u32 * return_value);
 
 acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value);
@@ -320,12 +351,14 @@ acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value);
 acpi_status acpi_set_register(u32 register_id, u32 value);
 
 acpi_status
-acpi_set_firmware_waking_vector(acpi_physical_address physical_address);
+acpi_set_firmware_waking_vector(u32 physical_address);
 
-#ifdef ACPI_FUTURE_USAGE
 acpi_status
-acpi_get_firmware_waking_vector(acpi_physical_address * physical_address);
-#endif
+acpi_set_firmware_waking_vector64(u64 physical_address);
+
+acpi_status acpi_read(u32 *value, struct acpi_generic_address *reg);
+
+acpi_status acpi_write(u32 value, struct acpi_generic_address *reg);
 
 acpi_status
 acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b);
@@ -340,4 +373,42 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
 
 acpi_status acpi_leave_sleep_state(u8 sleep_state);
 
+/*
+ * Debug output
+ */
+void ACPI_INTERNAL_VAR_XFACE
+acpi_error(const char *module_name,
+          u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
+
+void ACPI_INTERNAL_VAR_XFACE
+acpi_exception(const char *module_name,
+              u32 line_number,
+              acpi_status status, const char *format, ...) ACPI_PRINTF_LIKE(4);
+
+void ACPI_INTERNAL_VAR_XFACE
+acpi_warning(const char *module_name,
+            u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
+
+void ACPI_INTERNAL_VAR_XFACE
+acpi_info(const char *module_name,
+         u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
+
+#ifdef ACPI_DEBUG_OUTPUT
+
+void ACPI_INTERNAL_VAR_XFACE
+acpi_debug_print(u32 requested_debug_level,
+                u32 line_number,
+                const char *function_name,
+                const char *module_name,
+                u32 component_id, const char *format, ...) ACPI_PRINTF_LIKE(6);
+
+void ACPI_INTERNAL_VAR_XFACE
+acpi_debug_print_raw(u32 requested_debug_level,
+                    u32 line_number,
+                    const char *function_name,
+                    const char *module_name,
+                    u32 component_id,
+                    const char *format, ...) ACPI_PRINTF_LIKE(6);
+#endif
+
 #endif                         /* __ACXFACE_H__ */
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
new file mode 100644 (file)
index 0000000..9ffe00f
--- /dev/null
@@ -0,0 +1,405 @@
+/******************************************************************************
+ *
+ * Name: acrestyp.h - Defines, types, and structures for resource descriptors
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2008, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACRESTYP_H__
+#define __ACRESTYP_H__
+
+/*
+ * Definitions for Resource Attributes
+ */
+typedef u16 acpi_rs_length;    /* Resource Length field is fixed at 16 bits */
+typedef u32 acpi_rsdesc_size;  /* Max Resource Descriptor size is (Length+3) = (64_k-1)+3 */
+
+/*
+ * Memory Attributes
+ */
+#define ACPI_READ_ONLY_MEMORY           (u8) 0x00
+#define ACPI_READ_WRITE_MEMORY          (u8) 0x01
+
+#define ACPI_NON_CACHEABLE_MEMORY       (u8) 0x00
+#define ACPI_CACHABLE_MEMORY            (u8) 0x01
+#define ACPI_WRITE_COMBINING_MEMORY     (u8) 0x02
+#define ACPI_PREFETCHABLE_MEMORY        (u8) 0x03
+
+/*
+ * IO Attributes
+ * The ISA IO ranges are:     n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh.
+ * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh.
+ */
+#define ACPI_NON_ISA_ONLY_RANGES        (u8) 0x01
+#define ACPI_ISA_ONLY_RANGES            (u8) 0x02
+#define ACPI_ENTIRE_RANGE               (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
+
+/* Type of translation - 1=Sparse, 0=Dense */
+
+#define ACPI_SPARSE_TRANSLATION         (u8) 0x01
+
+/*
+ * IO Port Descriptor Decode
+ */
+#define ACPI_DECODE_10                  (u8) 0x00      /* 10-bit IO address decode */
+#define ACPI_DECODE_16                  (u8) 0x01      /* 16-bit IO address decode */
+
+/*
+ * IRQ Attributes
+ */
+#define ACPI_LEVEL_SENSITIVE            (u8) 0x00
+#define ACPI_EDGE_SENSITIVE             (u8) 0x01
+
+#define ACPI_ACTIVE_HIGH                (u8) 0x00
+#define ACPI_ACTIVE_LOW                 (u8) 0x01
+
+#define ACPI_EXCLUSIVE                  (u8) 0x00
+#define ACPI_SHARED                     (u8) 0x01
+
+/*
+ * DMA Attributes
+ */
+#define ACPI_COMPATIBILITY              (u8) 0x00
+#define ACPI_TYPE_A                     (u8) 0x01
+#define ACPI_TYPE_B                     (u8) 0x02
+#define ACPI_TYPE_F                     (u8) 0x03
+
+#define ACPI_NOT_BUS_MASTER             (u8) 0x00
+#define ACPI_BUS_MASTER                 (u8) 0x01
+
+#define ACPI_TRANSFER_8                 (u8) 0x00
+#define ACPI_TRANSFER_8_16              (u8) 0x01
+#define ACPI_TRANSFER_16                (u8) 0x02
+
+/*
+ * Start Dependent Functions Priority definitions
+ */
+#define ACPI_GOOD_CONFIGURATION         (u8) 0x00
+#define ACPI_ACCEPTABLE_CONFIGURATION   (u8) 0x01
+#define ACPI_SUB_OPTIMAL_CONFIGURATION  (u8) 0x02
+
+/*
+ * 16, 32 and 64-bit Address Descriptor resource types
+ */
+#define ACPI_MEMORY_RANGE               (u8) 0x00
+#define ACPI_IO_RANGE                   (u8) 0x01
+#define ACPI_BUS_NUMBER_RANGE           (u8) 0x02
+
+#define ACPI_ADDRESS_NOT_FIXED          (u8) 0x00
+#define ACPI_ADDRESS_FIXED              (u8) 0x01
+
+#define ACPI_POS_DECODE                 (u8) 0x00
+#define ACPI_SUB_DECODE                 (u8) 0x01
+
+#define ACPI_PRODUCER                   (u8) 0x00
+#define ACPI_CONSUMER                   (u8) 0x01
+
+/*
+ * If possible, pack the following structures to byte alignment
+ */
+#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
+#pragma pack(1)
+#endif
+
+/* UUID data structures for use in vendor-defined resource descriptors */
+
+struct acpi_uuid {
+       u8 data[ACPI_UUID_LENGTH];
+};
+
+struct acpi_vendor_uuid {
+       u8 subtype;
+       u8 data[ACPI_UUID_LENGTH];
+};
+
+/*
+ * Structures used to describe device resources
+ */
+struct acpi_resource_irq {
+       u8 descriptor_length;
+       u8 triggering;
+       u8 polarity;
+       u8 sharable;
+       u8 interrupt_count;
+       u8 interrupts[1];
+};
+
+struct acpi_resource_dma {
+       u8 type;
+       u8 bus_master;
+       u8 transfer;
+       u8 channel_count;
+       u8 channels[1];
+};
+
+struct acpi_resource_start_dependent {
+       u8 descriptor_length;
+       u8 compatibility_priority;
+       u8 performance_robustness;
+};
+
+/*
+ * The END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
+ * needed because it has no fields
+ */
+
+struct acpi_resource_io {
+       u8 io_decode;
+       u8 alignment;
+       u8 address_length;
+       u16 minimum;
+       u16 maximum;
+};
+
+struct acpi_resource_fixed_io {
+       u16 address;
+       u8 address_length;
+};
+
+struct acpi_resource_vendor {
+       u16 byte_length;
+       u8 byte_data[1];
+};
+
+/* Vendor resource with UUID info (introduced in ACPI 3.0) */
+
+struct acpi_resource_vendor_typed {
+       u16 byte_length;
+       u8 uuid_subtype;
+       u8 uuid[ACPI_UUID_LENGTH];
+       u8 byte_data[1];
+};
+
+struct acpi_resource_end_tag {
+       u8 checksum;
+};
+
+struct acpi_resource_memory24 {
+       u8 write_protect;
+       u16 minimum;
+       u16 maximum;
+       u16 alignment;
+       u16 address_length;
+};
+
+struct acpi_resource_memory32 {
+       u8 write_protect;
+       u32 minimum;
+       u32 maximum;
+       u32 alignment;
+       u32 address_length;
+};
+
+struct acpi_resource_fixed_memory32 {
+       u8 write_protect;
+       u32 address;
+       u32 address_length;
+};
+
+struct acpi_memory_attribute {
+       u8 write_protect;
+       u8 caching;
+       u8 range_type;
+       u8 translation;
+};
+
+struct acpi_io_attribute {
+       u8 range_type;
+       u8 translation;
+       u8 translation_type;
+       u8 reserved1;
+};
+
+union acpi_resource_attribute {
+       struct acpi_memory_attribute mem;
+       struct acpi_io_attribute io;
+
+       /* Used for the *word_space macros */
+
+       u8 type_specific;
+};
+
+struct acpi_resource_source {
+       u8 index;
+       u16 string_length;
+       char *string_ptr;
+};
+
+/* Fields common to all address descriptors, 16/32/64 bit */
+
+#define ACPI_RESOURCE_ADDRESS_COMMON \
+       u8                                      resource_type; \
+       u8                                      producer_consumer; \
+       u8                                      decode; \
+       u8                                      min_address_fixed; \
+       u8                                      max_address_fixed; \
+       union acpi_resource_attribute           info;
+
+struct acpi_resource_address {
+ACPI_RESOURCE_ADDRESS_COMMON};
+
+struct acpi_resource_address16 {
+       ACPI_RESOURCE_ADDRESS_COMMON u16 granularity;
+       u16 minimum;
+       u16 maximum;
+       u16 translation_offset;
+       u16 address_length;
+       struct acpi_resource_source resource_source;
+};
+
+struct acpi_resource_address32 {
+       ACPI_RESOURCE_ADDRESS_COMMON u32 granularity;
+       u32 minimum;
+       u32 maximum;
+       u32 translation_offset;
+       u32 address_length;
+       struct acpi_resource_source resource_source;
+};
+
+struct acpi_resource_address64 {
+       ACPI_RESOURCE_ADDRESS_COMMON u64 granularity;
+       u64 minimum;
+       u64 maximum;
+       u64 translation_offset;
+       u64 address_length;
+       struct acpi_resource_source resource_source;
+};
+
+struct acpi_resource_extended_address64 {
+       ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD;
+       u64 granularity;
+       u64 minimum;
+       u64 maximum;
+       u64 translation_offset;
+       u64 address_length;
+       u64 type_specific;
+};
+
+struct acpi_resource_extended_irq {
+       u8 producer_consumer;
+       u8 triggering;
+       u8 polarity;
+       u8 sharable;
+       u8 interrupt_count;
+       struct acpi_resource_source resource_source;
+       u32 interrupts[1];
+};
+
+struct acpi_resource_generic_register {
+       u8 space_id;
+       u8 bit_width;
+       u8 bit_offset;
+       u8 access_size;
+       u64 address;
+};
+
+/* ACPI_RESOURCE_TYPEs */
+
+#define ACPI_RESOURCE_TYPE_IRQ                  0
+#define ACPI_RESOURCE_TYPE_DMA                  1
+#define ACPI_RESOURCE_TYPE_START_DEPENDENT      2
+#define ACPI_RESOURCE_TYPE_END_DEPENDENT        3
+#define ACPI_RESOURCE_TYPE_IO                   4
+#define ACPI_RESOURCE_TYPE_FIXED_IO             5
+#define ACPI_RESOURCE_TYPE_VENDOR               6
+#define ACPI_RESOURCE_TYPE_END_TAG              7
+#define ACPI_RESOURCE_TYPE_MEMORY24             8
+#define ACPI_RESOURCE_TYPE_MEMORY32             9
+#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32       10
+#define ACPI_RESOURCE_TYPE_ADDRESS16            11
+#define ACPI_RESOURCE_TYPE_ADDRESS32            12
+#define ACPI_RESOURCE_TYPE_ADDRESS64            13
+#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64   14     /* ACPI 3.0 */
+#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ         15
+#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER     16
+#define ACPI_RESOURCE_TYPE_MAX                  16
+
+/* Master union for resource descriptors */
+
+union acpi_resource_data {
+       struct acpi_resource_irq irq;
+       struct acpi_resource_dma dma;
+       struct acpi_resource_start_dependent start_dpf;
+       struct acpi_resource_io io;
+       struct acpi_resource_fixed_io fixed_io;
+       struct acpi_resource_vendor vendor;
+       struct acpi_resource_vendor_typed vendor_typed;
+       struct acpi_resource_end_tag end_tag;
+       struct acpi_resource_memory24 memory24;
+       struct acpi_resource_memory32 memory32;
+       struct acpi_resource_fixed_memory32 fixed_memory32;
+       struct acpi_resource_address16 address16;
+       struct acpi_resource_address32 address32;
+       struct acpi_resource_address64 address64;
+       struct acpi_resource_extended_address64 ext_address64;
+       struct acpi_resource_extended_irq extended_irq;
+       struct acpi_resource_generic_register generic_reg;
+
+       /* Common fields */
+
+       struct acpi_resource_address address;   /* Common 16/32/64 address fields */
+};
+
+/* Common resource header */
+
+struct acpi_resource {
+       u32 type;
+       u32 length;
+       union acpi_resource_data data;
+};
+
+/* restore default alignment */
+
+#pragma pack()
+
+#define ACPI_RS_SIZE_NO_DATA                8  /* Id + Length fields */
+#define ACPI_RS_SIZE_MIN                    (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
+#define ACPI_RS_SIZE(type)                  (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
+
+#define ACPI_NEXT_RESOURCE(res)             (struct acpi_resource *)((u8 *) res + res->length)
+
+struct acpi_pci_routing_table {
+       u32 length;
+       u32 pin;
+       acpi_integer address;   /* here for 64-bit alignment */
+       u32 source_index;
+       char source[4];         /* pad to 64 bits so sizeof() works in all cases */
+};
+
+#endif                         /* __ACRESTYP_H__ */
index 13a3d9ad92db79f57c2063f60be9302d3525e77c..813e4b6c2c0d2f82aa3251e5b4a65d091c5f2daa 100644 (file)
@@ -288,6 +288,31 @@ enum acpi_prefered_pm_profiles {
 
 #define ACPI_FADT_OFFSET(f)             (u8) ACPI_OFFSET (struct acpi_table_fadt, f)
 
+union acpi_name_union {
+       u32 integer;
+       char ascii[4];
+};
+
+/*
+ * Internal ACPI Table Descriptor. One per ACPI table
+ */
+struct acpi_table_desc {
+       acpi_physical_address address;
+       struct acpi_table_header *pointer;
+       u32 length;             /* Length fixed at 32 bits */
+       union acpi_name_union signature;
+       acpi_owner_id owner_id;
+       u8 flags;
+};
+
+/* Flags for above */
+
+#define ACPI_TABLE_ORIGIN_UNKNOWN       (0)
+#define ACPI_TABLE_ORIGIN_MAPPED        (1)
+#define ACPI_TABLE_ORIGIN_ALLOCATED     (2)
+#define ACPI_TABLE_ORIGIN_MASK          (3)
+#define ACPI_TABLE_IS_LOADED            (4)
+
 /*
  * Get the remaining ACPI tables
  */
index 63f5b4cf4de1e06c9075164ad65cea947b77ed94..18963b9681149dea6546dac30244fa60ad2bf6c5 100644 (file)
@@ -627,7 +627,7 @@ struct acpi_hest_aer_common {
        u32 uncorrectable_error_mask;
        u32 uncorrectable_error_severity;
        u32 correctable_error_mask;
-       u32 advanced_error_cababilities;
+       u32 advanced_error_capabilities;
 };
 
 /* Hardware Error Notification */
index 7220361790b3ce105869e2dddc65c361d27e9d14..03744d28dcf6ed660fc3453244ac05276dc9f9f9 100644 (file)
@@ -204,11 +204,10 @@ typedef u32 acpi_physical_address;
 
 /*******************************************************************************
  *
- * OS-dependent and compiler-dependent types
+ * OS-dependent types
  *
  * If the defaults below are not appropriate for the host system, they can
- * be defined in the compiler-specific or OS-specific header, and this will
- * take precedence.
+ * be defined in the OS-specific header, and this will take precedence.
  *
  ******************************************************************************/
 
@@ -218,12 +217,6 @@ typedef u32 acpi_physical_address;
 #define acpi_thread_id                 acpi_size
 #endif
 
-/* Object returned from acpi_os_create_lock */
-
-#ifndef acpi_spinlock
-#define acpi_spinlock                   void *
-#endif
-
 /* Flags for acpi_os_acquire_lock/acpi_os_release_lock */
 
 #ifndef acpi_cpu_flags
@@ -233,9 +226,51 @@ typedef u32 acpi_physical_address;
 /* Object returned from acpi_os_create_cache */
 
 #ifndef acpi_cache_t
+#ifdef ACPI_USE_LOCAL_CACHE
 #define acpi_cache_t                    struct acpi_memory_list
+#else
+#define acpi_cache_t                    void *
+#endif
+#endif
+
+/*
+ * Synchronization objects - Mutexes, Semaphores, and spin_locks
+ */
+#if (ACPI_MUTEX_TYPE == ACPI_BINARY_SEMAPHORE)
+/*
+ * These macros are used if the host OS does not support a mutex object.
+ * Map the OSL Mutex interfaces to binary semaphores.
+ */
+#define acpi_mutex                      acpi_semaphore
+#define acpi_os_create_mutex(out_handle) acpi_os_create_semaphore (1, 1, out_handle)
+#define acpi_os_delete_mutex(handle)    (void) acpi_os_delete_semaphore (handle)
+#define acpi_os_acquire_mutex(handle,time) acpi_os_wait_semaphore (handle, 1, time)
+#define acpi_os_release_mutex(handle)   (void) acpi_os_signal_semaphore (handle, 1)
+#endif
+
+/* Configurable types for synchronization objects */
+
+#ifndef acpi_spinlock
+#define acpi_spinlock                   void *
+#endif
+
+#ifndef acpi_semaphore
+#define acpi_semaphore                  void *
+#endif
+
+#ifndef acpi_mutex
+#define acpi_mutex                      void *
 #endif
 
+/*******************************************************************************
+ *
+ * Compiler-dependent types
+ *
+ * If the defaults below are not appropriate for the host compiler, they can
+ * be defined in the compiler-specific header, and this will take precedence.
+ *
+ ******************************************************************************/
+
 /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
 
 #ifndef acpi_uintptr_t
@@ -268,6 +303,43 @@ typedef u32 acpi_physical_address;
 #define ACPI_EXPORT_SYMBOL(symbol)
 #endif
 
+/******************************************************************************
+ *
+ * ACPI Specification constants (Do not change unless the specification changes)
+ *
+ *****************************************************************************/
+
+/* Number of distinct FADT-based GPE register blocks (GPE0 and GPE1) */
+
+#define ACPI_MAX_GPE_BLOCKS             2
+
+/* Default ACPI register widths */
+
+#define ACPI_GPE_REGISTER_WIDTH         8
+#define ACPI_PM1_REGISTER_WIDTH         16
+#define ACPI_PM2_REGISTER_WIDTH         8
+#define ACPI_PM_TIMER_WIDTH             32
+
+/* Names within the namespace are 4 bytes long */
+
+#define ACPI_NAME_SIZE                  4
+#define ACPI_PATH_SEGMENT_LENGTH        5      /* 4 chars for name + 1 char for separator */
+#define ACPI_PATH_SEPARATOR             '.'
+
+/* Sizes for ACPI table headers */
+
+#define ACPI_OEM_ID_SIZE                6
+#define ACPI_OEM_TABLE_ID_SIZE          8
+
+/* ACPI/PNP hardware IDs */
+
+#define PCI_ROOT_HID_STRING             "PNP0A03"
+#define PCI_EXPRESS_ROOT_HID_STRING     "PNP0A08"
+
+/* PM Timer ticks per second (HZ) */
+
+#define PM_TIMER_FREQUENCY  3579545
+
 /*******************************************************************************
  *
  * Independent types
@@ -291,13 +363,18 @@ typedef u32 acpi_physical_address;
 #endif
 
 /*
- * Mescellaneous types
+ * Miscellaneous types
  */
 typedef u32 acpi_status;       /* All ACPI Exceptions */
 typedef u32 acpi_name;         /* 4-byte ACPI name */
 typedef char *acpi_string;     /* Null terminated ASCII string */
 typedef void *acpi_handle;     /* Actually a ptr to a NS Node */
 
+/* Owner IDs are used to track namespace nodes for selective deletion */
+
+typedef u8 acpi_owner_id;
+#define ACPI_OWNER_ID_MAX               0xFF
+
 struct uint64_struct {
        u32 lo;
        u32 hi;
@@ -313,13 +390,8 @@ struct uint32_struct {
        u32 hi;
 };
 
-/* Synchronization objects */
-
-#define acpi_mutex                      void *
-#define acpi_semaphore                  void *
-
 /*
- * Acpi integer width. In ACPI version 1, integers are 32 bits.  In ACPI
+ * Acpi integer width. In ACPI version 1, integers are 32 bits. In ACPI
  * version 2, integers are 64 bits. Note that this pertains to the ACPI integer
  * type only, not other integers used in the implementation of the ACPI CA
  * subsystem.
@@ -338,10 +410,75 @@ typedef unsigned long long acpi_integer;
 #define ACPI_MAX16_DECIMAL_DIGITS        5
 #define ACPI_MAX8_DECIMAL_DIGITS         3
 
+/* PM Timer ticks per second (HZ) */
+
+#define PM_TIMER_FREQUENCY  3579545
+
 /*
  * Constants with special meanings
  */
 #define ACPI_ROOT_OBJECT                ACPI_ADD_PTR (acpi_handle, NULL, ACPI_MAX_PTR)
+#define ACPI_WAIT_FOREVER               0xFFFF /* u16, as per ACPI spec */
+#define ACPI_DO_NOT_WAIT                0
+
+/*******************************************************************************
+ *
+ * Commonly used macros
+ *
+ ******************************************************************************/
+
+/* Data manipulation */
+
+#define ACPI_LOWORD(l)                  ((u16)(u32)(l))
+#define ACPI_HIWORD(l)                  ((u16)((((u32)(l)) >> 16) & 0xFFFF))
+#define ACPI_LOBYTE(l)                  ((u8)(u16)(l))
+#define ACPI_HIBYTE(l)                  ((u8)((((u16)(l)) >> 8) & 0xFF))
+
+/* Full 64-bit integer must be available on both 32-bit and 64-bit platforms */
+
+struct acpi_integer_overlay {
+       u32 lo_dword;
+       u32 hi_dword;
+};
+
+#define ACPI_LODWORD(integer)           (ACPI_CAST_PTR (struct acpi_integer_overlay, &integer)->lo_dword)
+#define ACPI_HIDWORD(integer)           (ACPI_CAST_PTR (struct acpi_integer_overlay, &integer)->hi_dword)
+
+#define ACPI_SET_BIT(target,bit)        ((target) |= (bit))
+#define ACPI_CLEAR_BIT(target,bit)      ((target) &= ~(bit))
+#define ACPI_MIN(a,b)                   (((a)<(b))?(a):(b))
+#define ACPI_MAX(a,b)                   (((a)>(b))?(a):(b))
+
+/* Size calculation */
+
+#define ACPI_ARRAY_LENGTH(x)            (sizeof(x) / sizeof((x)[0]))
+
+/* Pointer manipulation */
+
+#define ACPI_CAST_PTR(t, p)             ((t *) (acpi_uintptr_t) (p))
+#define ACPI_CAST_INDIRECT_PTR(t, p)    ((t **) (acpi_uintptr_t) (p))
+#define ACPI_ADD_PTR(t, a, b)           ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8, (a)) + (acpi_size)(b)))
+#define ACPI_PTR_DIFF(a, b)             (acpi_size) (ACPI_CAST_PTR (u8, (a)) - ACPI_CAST_PTR (u8, (b)))
+
+/* Pointer/Integer type conversions */
+
+#define ACPI_TO_POINTER(i)              ACPI_ADD_PTR (void, (void *) NULL,(acpi_size) i)
+#define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF (p, (void *) NULL)
+#define ACPI_OFFSET(d, f)               (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL)
+#define ACPI_PHYSADDR_TO_PTR(i)         ACPI_TO_POINTER(i)
+#define ACPI_PTR_TO_PHYSADDR(i)         ACPI_TO_INTEGER(i)
+
+#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
+#define ACPI_COMPARE_NAME(a,b)          (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b)))
+#else
+#define ACPI_COMPARE_NAME(a,b)          (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))
+#endif
+
+/*******************************************************************************
+ *
+ * Miscellaneous constants
+ *
+ ******************************************************************************/
 
 /*
  * Initialization sequence
@@ -414,7 +551,7 @@ typedef unsigned long long acpi_integer;
 #define ACPI_NOTIFY_MAX                 0x0B
 
 /*
- * Types associated with ACPI names and objects.  The first group of
+ * Types associated with ACPI names and objects. The first group of
  * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
  * of the ACPI object_type() operator (See the ACPI Spec). Therefore,
  * only add to the first group if the spec changes.
@@ -731,6 +868,15 @@ struct acpi_buffer {
 #define ACPI_SINGLE_NAME                1
 #define ACPI_NAME_TYPE_MAX              1
 
+/*
+ * Predefined Namespace items
+ */
+struct acpi_predefined_names {
+       char *name;
+       u8 type;
+       char *val;
+};
+
 /*
  * Structure and flags for acpi_get_system_info
  */
@@ -787,7 +933,7 @@ acpi_status(*acpi_exception_handler) (acpi_status aml_status,
                                      u16 opcode,
                                      u32 aml_offset, void *context);
 
-/* Table Event handler (Load, load_table etc) and types */
+/* Table Event handler (Load, load_table, etc.) and types */
 
 typedef
 acpi_status(*acpi_tbl_handler) (u32 event, void *table, void *context);
@@ -823,6 +969,12 @@ acpi_status(*acpi_walk_callback) (acpi_handle obj_handle,
 #define ACPI_INTERRUPT_NOT_HANDLED      0x00
 #define ACPI_INTERRUPT_HANDLED          0x01
 
+/* Length of _HID, _UID, _CID, and UUID values */
+
+#define ACPI_DEVICE_ID_LENGTH           0x09
+#define ACPI_MAX_CID_LENGTH             48
+#define ACPI_UUID_LENGTH                16
+
 /* Common string version of device HIDs and UIDs */
 
 struct acpica_device_id {
@@ -900,357 +1052,28 @@ struct acpi_mem_space_context {
 };
 
 /*
- * Definitions for Resource Attributes
- */
-typedef u16 acpi_rs_length;    /* Resource Length field is fixed at 16 bits */
-typedef u32 acpi_rsdesc_size;  /* Max Resource Descriptor size is (Length+3) = (64_k-1)+3 */
-
-/*
- *  Memory Attributes
- */
-#define ACPI_READ_ONLY_MEMORY           (u8) 0x00
-#define ACPI_READ_WRITE_MEMORY          (u8) 0x01
-
-#define ACPI_NON_CACHEABLE_MEMORY       (u8) 0x00
-#define ACPI_CACHABLE_MEMORY            (u8) 0x01
-#define ACPI_WRITE_COMBINING_MEMORY     (u8) 0x02
-#define ACPI_PREFETCHABLE_MEMORY        (u8) 0x03
-
-/*
- *  IO Attributes
- *  The ISA IO ranges are:     n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh.
- *  The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh.
+ * struct acpi_memory_list is used only if the ACPICA local cache is enabled
  */
-#define ACPI_NON_ISA_ONLY_RANGES        (u8) 0x01
-#define ACPI_ISA_ONLY_RANGES            (u8) 0x02
-#define ACPI_ENTIRE_RANGE               (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
-
-/* Type of translation - 1=Sparse, 0=Dense */
-
-#define ACPI_SPARSE_TRANSLATION         (u8) 0x01
-
-/*
- *  IO Port Descriptor Decode
- */
-#define ACPI_DECODE_10                  (u8) 0x00      /* 10-bit IO address decode */
-#define ACPI_DECODE_16                  (u8) 0x01      /* 16-bit IO address decode */
-
-/*
- *  IRQ Attributes
- */
-#define ACPI_LEVEL_SENSITIVE            (u8) 0x00
-#define ACPI_EDGE_SENSITIVE             (u8) 0x01
-
-#define ACPI_ACTIVE_HIGH                (u8) 0x00
-#define ACPI_ACTIVE_LOW                 (u8) 0x01
-
-#define ACPI_EXCLUSIVE                  (u8) 0x00
-#define ACPI_SHARED                     (u8) 0x01
-
-/*
- *  DMA Attributes
- */
-#define ACPI_COMPATIBILITY              (u8) 0x00
-#define ACPI_TYPE_A                     (u8) 0x01
-#define ACPI_TYPE_B                     (u8) 0x02
-#define ACPI_TYPE_F                     (u8) 0x03
-
-#define ACPI_NOT_BUS_MASTER             (u8) 0x00
-#define ACPI_BUS_MASTER                 (u8) 0x01
-
-#define ACPI_TRANSFER_8                 (u8) 0x00
-#define ACPI_TRANSFER_8_16              (u8) 0x01
-#define ACPI_TRANSFER_16                (u8) 0x02
-
-/*
- * Start Dependent Functions Priority definitions
- */
-#define ACPI_GOOD_CONFIGURATION         (u8) 0x00
-#define ACPI_ACCEPTABLE_CONFIGURATION   (u8) 0x01
-#define ACPI_SUB_OPTIMAL_CONFIGURATION  (u8) 0x02
-
-/*
- *  16, 32 and 64-bit Address Descriptor resource types
- */
-#define ACPI_MEMORY_RANGE               (u8) 0x00
-#define ACPI_IO_RANGE                   (u8) 0x01
-#define ACPI_BUS_NUMBER_RANGE           (u8) 0x02
-
-#define ACPI_ADDRESS_NOT_FIXED          (u8) 0x00
-#define ACPI_ADDRESS_FIXED              (u8) 0x01
-
-#define ACPI_POS_DECODE                 (u8) 0x00
-#define ACPI_SUB_DECODE                 (u8) 0x01
-
-#define ACPI_PRODUCER                   (u8) 0x00
-#define ACPI_CONSUMER                   (u8) 0x01
-
-/*
- * If possible, pack the following structures to byte alignment
- */
-#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
-#pragma pack(1)
+struct acpi_memory_list {
+       char *list_name;
+       void *list_head;
+       u16 object_size;
+       u16 max_depth;
+       u16 current_depth;
+       u16 link_offset;
+
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+
+       /* Statistics for debug memory tracking only */
+
+       u32 total_allocated;
+       u32 total_freed;
+       u32 max_occupied;
+       u32 total_size;
+       u32 current_total_size;
+       u32 requests;
+       u32 hits;
 #endif
-
-/* UUID data structures for use in vendor-defined resource descriptors */
-
-struct acpi_uuid {
-       u8 data[ACPI_UUID_LENGTH];
-};
-
-struct acpi_vendor_uuid {
-       u8 subtype;
-       u8 data[ACPI_UUID_LENGTH];
-};
-
-/*
- *  Structures used to describe device resources
- */
-struct acpi_resource_irq {
-       u8 descriptor_length;
-       u8 triggering;
-       u8 polarity;
-       u8 sharable;
-       u8 interrupt_count;
-       u8 interrupts[1];
-};
-
-struct acpi_resource_dma {
-       u8 type;
-       u8 bus_master;
-       u8 transfer;
-       u8 channel_count;
-       u8 channels[1];
-};
-
-struct acpi_resource_start_dependent {
-       u8 descriptor_length;
-       u8 compatibility_priority;
-       u8 performance_robustness;
-};
-
-/*
- * END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
- * needed because it has no fields
- */
-
-struct acpi_resource_io {
-       u8 io_decode;
-       u8 alignment;
-       u8 address_length;
-       u16 minimum;
-       u16 maximum;
-};
-
-struct acpi_resource_fixed_io {
-       u16 address;
-       u8 address_length;
-};
-
-struct acpi_resource_vendor {
-       u16 byte_length;
-       u8 byte_data[1];
-};
-
-/* Vendor resource with UUID info (introduced in ACPI 3.0) */
-
-struct acpi_resource_vendor_typed {
-       u16 byte_length;
-       u8 uuid_subtype;
-       u8 uuid[ACPI_UUID_LENGTH];
-       u8 byte_data[1];
-};
-
-struct acpi_resource_end_tag {
-       u8 checksum;
-};
-
-struct acpi_resource_memory24 {
-       u8 write_protect;
-       u16 minimum;
-       u16 maximum;
-       u16 alignment;
-       u16 address_length;
-};
-
-struct acpi_resource_memory32 {
-       u8 write_protect;
-       u32 minimum;
-       u32 maximum;
-       u32 alignment;
-       u32 address_length;
-};
-
-struct acpi_resource_fixed_memory32 {
-       u8 write_protect;
-       u32 address;
-       u32 address_length;
-};
-
-struct acpi_memory_attribute {
-       u8 write_protect;
-       u8 caching;
-       u8 range_type;
-       u8 translation;
-};
-
-struct acpi_io_attribute {
-       u8 range_type;
-       u8 translation;
-       u8 translation_type;
-       u8 reserved1;
-};
-
-union acpi_resource_attribute {
-       struct acpi_memory_attribute mem;
-       struct acpi_io_attribute io;
-
-       /* Used for the *word_space macros */
-
-       u8 type_specific;
-};
-
-struct acpi_resource_source {
-       u8 index;
-       u16 string_length;
-       char *string_ptr;
-};
-
-/* Fields common to all address descriptors, 16/32/64 bit */
-
-#define ACPI_RESOURCE_ADDRESS_COMMON \
-       u8                              resource_type; \
-       u8                              producer_consumer; \
-       u8                              decode; \
-       u8                              min_address_fixed; \
-       u8                              max_address_fixed; \
-       union acpi_resource_attribute   info;
-
-struct acpi_resource_address {
-ACPI_RESOURCE_ADDRESS_COMMON};
-
-struct acpi_resource_address16 {
-       ACPI_RESOURCE_ADDRESS_COMMON u16 granularity;
-       u16 minimum;
-       u16 maximum;
-       u16 translation_offset;
-       u16 address_length;
-       struct acpi_resource_source resource_source;
-};
-
-struct acpi_resource_address32 {
-       ACPI_RESOURCE_ADDRESS_COMMON u32 granularity;
-       u32 minimum;
-       u32 maximum;
-       u32 translation_offset;
-       u32 address_length;
-       struct acpi_resource_source resource_source;
-};
-
-struct acpi_resource_address64 {
-       ACPI_RESOURCE_ADDRESS_COMMON u64 granularity;
-       u64 minimum;
-       u64 maximum;
-       u64 translation_offset;
-       u64 address_length;
-       struct acpi_resource_source resource_source;
-};
-
-struct acpi_resource_extended_address64 {
-       ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD;
-       u64 granularity;
-       u64 minimum;
-       u64 maximum;
-       u64 translation_offset;
-       u64 address_length;
-       u64 type_specific;
-};
-
-struct acpi_resource_extended_irq {
-       u8 producer_consumer;
-       u8 triggering;
-       u8 polarity;
-       u8 sharable;
-       u8 interrupt_count;
-       struct acpi_resource_source resource_source;
-       u32 interrupts[1];
-};
-
-struct acpi_resource_generic_register {
-       u8 space_id;
-       u8 bit_width;
-       u8 bit_offset;
-       u8 access_size;
-       u64 address;
-};
-
-/* ACPI_RESOURCE_TYPEs */
-
-#define ACPI_RESOURCE_TYPE_IRQ                  0
-#define ACPI_RESOURCE_TYPE_DMA                  1
-#define ACPI_RESOURCE_TYPE_START_DEPENDENT      2
-#define ACPI_RESOURCE_TYPE_END_DEPENDENT        3
-#define ACPI_RESOURCE_TYPE_IO                   4
-#define ACPI_RESOURCE_TYPE_FIXED_IO             5
-#define ACPI_RESOURCE_TYPE_VENDOR               6
-#define ACPI_RESOURCE_TYPE_END_TAG              7
-#define ACPI_RESOURCE_TYPE_MEMORY24             8
-#define ACPI_RESOURCE_TYPE_MEMORY32             9
-#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32       10
-#define ACPI_RESOURCE_TYPE_ADDRESS16            11
-#define ACPI_RESOURCE_TYPE_ADDRESS32            12
-#define ACPI_RESOURCE_TYPE_ADDRESS64            13
-#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64   14     /* ACPI 3.0 */
-#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ         15
-#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER     16
-#define ACPI_RESOURCE_TYPE_MAX                  16
-
-union acpi_resource_data {
-       struct acpi_resource_irq irq;
-       struct acpi_resource_dma dma;
-       struct acpi_resource_start_dependent start_dpf;
-       struct acpi_resource_io io;
-       struct acpi_resource_fixed_io fixed_io;
-       struct acpi_resource_vendor vendor;
-       struct acpi_resource_vendor_typed vendor_typed;
-       struct acpi_resource_end_tag end_tag;
-       struct acpi_resource_memory24 memory24;
-       struct acpi_resource_memory32 memory32;
-       struct acpi_resource_fixed_memory32 fixed_memory32;
-       struct acpi_resource_address16 address16;
-       struct acpi_resource_address32 address32;
-       struct acpi_resource_address64 address64;
-       struct acpi_resource_extended_address64 ext_address64;
-       struct acpi_resource_extended_irq extended_irq;
-       struct acpi_resource_generic_register generic_reg;
-
-       /* Common fields */
-
-       struct acpi_resource_address address;   /* Common 16/32/64 address fields */
-};
-
-struct acpi_resource {
-       u32 type;
-       u32 length;
-       union acpi_resource_data data;
-};
-
-/* restore default alignment */
-
-#pragma pack()
-
-#define ACPI_RS_SIZE_NO_DATA                8  /* Id + Length fields */
-#define ACPI_RS_SIZE_MIN                    (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
-#define ACPI_RS_SIZE(type)                  (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
-
-#define ACPI_NEXT_RESOURCE(res)             (struct acpi_resource *)((u8 *) res + res->length)
-
-struct acpi_pci_routing_table {
-       u32 length;
-       u32 pin;
-       acpi_integer address;   /* here for 64-bit alignment */
-       u32 source_index;
-       char source[4];         /* pad to 64 bits so sizeof() works in all cases */
 };
 
 #endif                         /* __ACTYPES_H__ */
index fcd2572e428c1a24a45e2ac0e19abde178654c8e..e62f10d9a7d844e680a265d1f45b547fb00bacfc 100644 (file)
 #ifndef __ACENV_H__
 #define __ACENV_H__
 
-/*
+/* Types for ACPI_MUTEX_TYPE */
+
+#define ACPI_BINARY_SEMAPHORE       0
+#define ACPI_OSL_MUTEX              1
+
+/* Types for DEBUGGER_THREADING */
+
+#define DEBUGGER_SINGLE_THREADED    0
+#define DEBUGGER_MULTI_THREADED     1
+
+/******************************************************************************
+ *
  * Configuration for ACPI tools and utilities
- */
+ *
+ *****************************************************************************/
 
 #ifdef ACPI_LIBRARY
 /*
  * Note: The non-debug version of the acpi_library does not contain any
- * debug support, for minimimal size. The debug version uses ACPI_FULL_DEBUG
+ * debug support, for minimal size. The debug version uses ACPI_FULL_DEBUG
  */
 #define ACPI_USE_LOCAL_CACHE
 #endif
 #define ACPI_DBG_TRACK_ALLOCATIONS
 #endif
 
-#ifdef ACPI_DASM_APP
-#ifndef MSDOS
-#define ACPI_DEBUG_OUTPUT
-#endif
-#define ACPI_APPLICATION
-#define ACPI_DISASSEMBLER
-#define ACPI_NO_METHOD_EXECUTION
-#define ACPI_LARGE_NAMESPACE_NODE
-#define ACPI_DATA_TABLE_DISASSEMBLY
-#endif
-
 #ifdef ACPI_APPLICATION
 #define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_LOCAL_CACHE
 
 /*! [End] no source code translation !*/
 
+/******************************************************************************
+ *
+ * Miscellaneous configuration
+ *
+ *****************************************************************************/
+
+/*
+ * Are mutexes supported by the host? default is no, use binary semaphores.
+ */
+#ifndef ACPI_MUTEX_TYPE
+#define ACPI_MUTEX_TYPE             ACPI_BINARY_SEMAPHORE
+#endif
+
 /*
  * Debugger threading model
  * Use single threaded if the entire subsystem is contained in an application
  * By default the model is single threaded if ACPI_APPLICATION is set,
  * multi-threaded if ACPI_APPLICATION is not set.
  */
-#define DEBUGGER_SINGLE_THREADED    0
-#define DEBUGGER_MULTI_THREADED     1
-
 #ifndef DEBUGGER_THREADING
 #ifdef ACPI_APPLICATION
 #define DEBUGGER_THREADING          DEBUGGER_SINGLE_THREADED
index 029c8c06c151ab4f7153d4aeb143bb51ed4d258c..3cabf888c8af192543afa043bc78a6706314b7c6 100644 (file)
@@ -46,6 +46,7 @@
 
 #define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_DO_WHILE_0
+#define ACPI_MUTEX_TYPE             ACPI_BINARY_SEMAPHORE
 
 #ifdef __KERNEL__
 
@@ -141,6 +142,10 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
 /*
  * We need to show where it is safe to preempt execution of ACPICA
  */
-#define ACPI_PREEMPTION_POINT()        cond_resched()
+#define ACPI_PREEMPTION_POINT()                \
+       do {                            \
+               if (!irqs_disabled())   \
+                       cond_resched(); \
+       } while (0)
 
 #endif                         /* __ACLINUX_H__ */
index a00bd1a0f156d729447d4d06d026f55d2287e930..c2d1a7d1886abc8829452531a703a5b57e959370 100644 (file)
@@ -223,7 +223,6 @@ struct hotplug_params {
 #ifdef CONFIG_ACPI
 #include <acpi/acpi.h>
 #include <acpi/acpi_bus.h>
-#include <acpi/actypes.h>
 extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus,
                                struct hotplug_params *hpp);
 int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags);
index 8185a0f09594fd904ca2ab032dca27013708ff1c..2606d0fb4e54e8f120618328c7b72c01634dc35d 100644 (file)
@@ -1024,7 +1024,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
                if (ret == -EBUSY) {
                        mutex_unlock(&cgroup_mutex);
                        mutex_unlock(&inode->i_mutex);
-                       goto drop_new_super;
+                       goto free_cg_links;
                }
 
                /* EBUSY should be the only error here */
@@ -1073,10 +1073,11 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
 
        return simple_set_mnt(mnt, sb);
 
+ free_cg_links:
+       free_cg_links(&tmp_cg_links);
  drop_new_super:
        up_write(&sb->s_umount);
        deactivate_super(sb);
-       free_cg_links(&tmp_cg_links);
        return ret;
 }
 
@@ -2934,9 +2935,6 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
  again:
        root = subsys->root;
        if (root == &rootnode) {
-               printk(KERN_INFO
-                      "Not cloning cgroup for unused subsystem %s\n",
-                      subsys->name);
                mutex_unlock(&cgroup_mutex);
                return 0;
        }
index ba537fae0a4ca653b4a7eedb7b941deb8aef613b..ce68e046d963840e4a3822972ed33f2a30a86244 100644 (file)
@@ -1786,8 +1786,6 @@ static inline void rfcomm_accept_connection(struct rfcomm_session *s)
        if (err < 0)
                return;
 
-       __module_get(nsock->ops->owner);
-
        /* Set our callbacks */
        nsock->sk->sk_data_ready   = rfcomm_l2data_ready;
        nsock->sk->sk_state_change = rfcomm_l2state_change;
index 92764d836891833e1cb7f8255a38edacad1f3b7f..76ba80aeac1a86217ae77edc0e239084840f90d6 100644 (file)
@@ -2307,6 +2307,7 @@ int kernel_accept(struct socket *sock, struct socket **newsock, int flags)
        }
 
        (*newsock)->ops = sock->ops;
+       __module_get((*newsock)->ops->owner);
 
 done:
        return err;
index 596ceabd6504849b7925bc08c9d7e5ea1bbab136..b77f330d2650b7c13d23d1d0f84d9344d973940a 100644 (file)
@@ -859,6 +859,7 @@ static struct hda_verb stac92hd83xxx_core_init[] = {
 
        /* power state controls amps */
        { 0x01, AC_VERB_SET_EAPD, 1 << 2},
+       {}
 };
 
 static struct hda_verb stac92hd71bxx_core_init[] = {
@@ -870,6 +871,7 @@ static struct hda_verb stac92hd71bxx_core_init[] = {
        { 0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
        { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
        { 0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
+       {}
 };
 
 #define HD_DISABLE_PORTF 2
@@ -1667,6 +1669,7 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
        /* SigmaTel reference board */
        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
                      "DFI LanParty", STAC_92HD71BXX_REF),
+       {} /* terminator */
 };
 
 static unsigned int ref92hd71bxx_pin_configs[11] = {