[ACPI] merge 3549 4320 4485 4588 4980 5483 5651 acpica asus fops pnpacpi branches...
authorLen Brown <len.brown@intel.com>
Tue, 24 Jan 2006 22:52:48 +0000 (17:52 -0500)
committerLen Brown <len.brown@intel.com>
Tue, 24 Jan 2006 22:52:48 +0000 (17:52 -0500)
Signed-off-by: Len Brown <len.brown@intel.com>
18 files changed:
1  2  3  4  5  6  7  8  9  10  11  12 
Documentation/kernel-parameters.txt
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
arch/ia64/pci/pci.c
arch/x86_64/kernel/io_apic.c
drivers/acpi/Kconfig
drivers/acpi/ec.c
drivers/acpi/osl.c
drivers/acpi/pci_irq.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_perflib.c
drivers/acpi/scan.c
include/acpi/processor.h
include/linux/kernel.h
kernel/power/disk.c
kernel/sys.c

index 1cbcf65b764b47137b0db013654e55f224c3c32c,a482fde09bbbe01756627bffb4ce3cd98ebbeed5,5dffcfefc3c715698eca24b519df8eab6d8a799d,5dffcfefc3c715698eca24b519df8eab6d8a799d,5dffcfefc3c715698eca24b519df8eab6d8a799d,2ad64efdf1833a2f28368d7fc016ee037f743c37,5dffcfefc3c715698eca24b519df8eab6d8a799d,5dffcfefc3c715698eca24b519df8eab6d8a799d,a482fde09bbbe01756627bffb4ce3cd98ebbeed5,5dffcfefc3c715698eca24b519df8eab6d8a799d,a482fde09bbbe01756627bffb4ce3cd98ebbeed5,a482fde09bbbe01756627bffb4ce3cd98ebbeed5..84370363da809a67733cd346e429af2e56bef91c
@@@@@@@@@@@@@ -452,6 -452,6 -452,6 -452,6 -452,6 -452,11 -452,6 -452,6 -452,6 -452,6 -452,6 -452,6 +452,11 @@@@@@@@@@@@@ running once the system is up
            
                eata=           [HW,SCSI]
            
+++++ ++++++    ec_intr=        [HW,ACPI] ACPI Embedded Controller interrupt mode
+++++ ++++++                    Format: <int>
+++++ ++++++                    0: polling mode
+++++ ++++++                    non-0: interrupt mode (default)
+++++ ++++++
                eda=            [HW,PS2]
            
                edb=            [HW,PS2]
                                arch/i386/kernel/cpu/cpufreq/elanfreq.c.
            
                elevator=       [IOSCHED]
 -----------                    Format: {"as" | "cfq" | "deadline" | "noop"}
 +++++++++++                    Format: {"anticipatory" | "cfq" | "deadline" | "noop"}
                                See Documentation/block/as-iosched.txt and
                                Documentation/block/deadline-iosched.txt for details.
            
 -----------    elfcorehdr=     [IA-32]
 +++++++++++    elfcorehdr=     [IA-32, X86_64]
                                Specifies physical address of start of kernel core
 -----------                    image elf header.
 -----------                    See Documentation/kdump.txt for details.
 +++++++++++                    image elf header. Generally kexec loader will
 +++++++++++                    pass this option to capture kernel.
 +++++++++++                    See Documentation/kdump/kdump.txt for details.
            
                enforcing       [SELINUX] Set initial enforcing status.
                                Format: {"0" | "1"}
                inport.irq=     [HW] Inport (ATI XL and Microsoft) busmouse driver
                                Format: <irq>
            
  ++++++ +      combined_mode=  [HW] control which driver uses IDE ports in combined
  ++++++ +                      mode: legacy IDE driver, libata, or both
  ++++++ +                      (in the libata case, libata.atapi_enabled=1 may be
  ++++++ +                      useful as well).  Note that using the ide or libata
  ++++++ +                      options may affect your device naming (e.g. by
  ++++++ +                      changing hdc to sdb).
  ++++++ +                      Format: combined (default), ide, or libata
  ++++++ +  
                inttest=        [IA64]
            
                io7=            [HW] IO7 for Marvel based alpha systems
                load_ramdisk=   [RAM] List of ramdisks to load from floppy
                                See Documentation/ramdisk.txt.
            
 -----------    lockd.udpport=  [NFS]
 +++++++++++    lockd.nlm_grace_period=P  [NFS] Assign grace period.
 +++++++++++                    Format: <integer>
 +++++++++++
 +++++++++++    lockd.nlm_tcpport=N     [NFS] Assign TCP port.
 +++++++++++                    Format: <integer>
 ++++ ++++++
     -          lockd.tcpport=  [NFS]
 +++++++++++    lockd.nlm_timeout=T     [NFS] Assign timeout value.
 +++++++++++                    Format: <integer>
     +      
 ---- ------    lockd.tcpport=  [NFS]
 +++++++++++    lockd.nlm_udpport=M     [NFS] Assign UDP port.
 +++++++++++                    Format: <integer>
            
                logibm.irq=     [HW,MOUSE] Logitech Bus Mouse Driver
                                Format: <irq>
                mem=nopentium   [BUGS=IA-32] Disable usage of 4MB pages for kernel
                                memory.
            
 -----------    memmap=exactmap [KNL,IA-32] Enable setting of an exact
 +++++++++++    memmap=exactmap [KNL,IA-32,X86_64] Enable setting of an exact
                                E820 memory map, as specified by the user.
                                Such memmap=exactmap lines can be constructed based on
                                BIOS output or other requirements. See the memmap=nn@ss
            
                mga=            [HW,DRM]
            
 +++++++++++    migration_cost=
 +++++++++++                    [KNL,SMP] debug: override scheduler migration costs
 +++++++++++                    Format: <level-1-usecs>,<level-2-usecs>,...
 +++++++++++                    This debugging option can be used to override the
 +++++++++++                    default scheduler migration cost matrix. The numbers
 +++++++++++                    are indexed by 'CPU domain distance'.
 +++++++++++                    E.g. migration_cost=1000,2000,3000 on an SMT NUMA
 +++++++++++                    box will set up an intra-core migration cost of
 +++++++++++                    1 msec, an inter-core migration cost of 2 msecs,
 +++++++++++                    and an inter-node migration cost of 3 msecs.
 +++++++++++
 +++++++++++                    WARNING: using the wrong values here can break
 +++++++++++                    scheduler performance, so it's only for scheduler
 +++++++++++                    development purposes, not production environments.
 +++++++++++
 +++++++++++    migration_debug=
 +++++++++++                    [KNL,SMP] migration cost auto-detect verbosity
 +++++++++++                    Format=<0|1|2>
 +++++++++++                    If a system's migration matrix reported at bootup
 +++++++++++                    seems erroneous then this option can be used to
 +++++++++++                    increase verbosity of the detection process.
 +++++++++++                    We default to 0 (no extra messages), 1 will print
 +++++++++++                    some more information, and 2 will be really
 +++++++++++                    verbose (probably only useful if you also have a
 +++++++++++                    serial console attached to the system).
 +++++++++++
 +++++++++++    migration_factor=
 +++++++++++                    [KNL,SMP] multiply/divide migration costs by a factor
 +++++++++++                    Format=<percent>
 +++++++++++                    This debug option can be used to proportionally
 +++++++++++                    increase or decrease the auto-detected migration
 +++++++++++                    costs for all entries of the migration matrix.
 +++++++++++                    E.g. migration_factor=150 will increase migration
 +++++++++++                    costs by 50%. (and thus the scheduler will be less
 +++++++++++                    eager migrating cache-hot tasks)
 +++++++++++                    migration_factor=80 will decrease migration costs
 +++++++++++                    by 20%. (thus the scheduler will be more eager to
 +++++++++++                    migrate tasks)
 +++++++++++
 +++++++++++                    WARNING: using the wrong values here can break
 +++++++++++                    scheduler performance, so it's only for scheduler
 +++++++++++                    development purposes, not production environments.
 +++++++++++
                mousedev.tap_time=
                                [MOUSE] Maximum time between finger touching and
                                leaving touchpad surface for touch to be considered
                nfsroot=        [NFS] nfs root filesystem for disk-less boxes.
                                See Documentation/nfsroot.txt.
            
  ++++++ +      nfs.callback_tcpport=
  ++++++ +                      [NFS] set the TCP port on which the NFSv4 callback
  ++++++ +                      channel should listen.
  ++++++ +  
  ++++++ +      nfs.idmap_cache_timeout=
  ++++++ +                      [NFS] set the maximum lifetime for idmapper cache
  ++++++ +                      entries.
  ++++++ +  
                nmi_watchdog=   [KNL,BUGS=IA-32] Debugging features for SMP kernels
            
                no387           [BUGS=IA-32] Tells the kernel to use the 387 maths
            
                nowb            [ARM]
            
 +++++++++++    nr_uarts=       [SERIAL] maximum number of UARTs to be registered.
 +++++++++++
                opl3=           [HW,OSS]
                                Format: <io>
            
                                Limit processor to maximum C-state
                                max_cstate=9 overrides any DMI blacklist limit.
            
 +++++++++++    processor.nocst [HW,ACPI]
 +++++++++++                    Ignore the _CST method to determine C-states,
 +++++++++++                    instead using the legacy FADT method
 +++++++++++
                prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk
                                before loading.
                                See Documentation/ramdisk.txt.
index 2111529dea77821ff595ce4a21edb369102b9b93,447fa9e33ffbeaaca7bbee58621900cbf0ba2b1e,447fa9e33ffbeaaca7bbee58621900cbf0ba2b1e,76b1135d401a6eb3b4851fe344fe6f052f70300f,447fa9e33ffbeaaca7bbee58621900cbf0ba2b1e,76b1135d401a6eb3b4851fe344fe6f052f70300f,76b1135d401a6eb3b4851fe344fe6f052f70300f,76b1135d401a6eb3b4851fe344fe6f052f70300f,1f378df14f34738d1b17dd731132727b0641ae7f,447fa9e33ffbeaaca7bbee58621900cbf0ba2b1e,447fa9e33ffbeaaca7bbee58621900cbf0ba2b1e,447fa9e33ffbeaaca7bbee58621900cbf0ba2b1e..f21fa0d4482f4f5d91d31047c5c402433bb7e8b5
@@@@@@@@@@@@@ -108,7 -108,7 -108,7 -108,7 -108,7 -108,7 -108,7 -108,7 -108,7 -108,7 -108,7 -108,7 +108,7 @@@@@@@@@@@@@ char *__acpi_map_table(unsigned long ph
                if (!phys_addr || !size)
                        return NULL;
            
 -----------    if (phys_addr < (end_pfn_map << PAGE_SHIFT))
 +++++++++++    if (phys_addr+size <= (end_pfn_map << PAGE_SHIFT) + PAGE_SIZE)
                        return __va(phys_addr);
            
                return NULL;
@@@@@@@@@@@@@ -464,7 -464,7 -464,7 -464,7 -464,7 -464,7 -464,7 -464,7 -464,7 -464,7 -464,7 -464,7 +464,7 @@@@@@@@@@@@@ int acpi_gsi_to_irq(u32 gsi, unsigned i
             * success: return IRQ number (>=0)
             * failure: return < 0
             */
-------- ---int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
++++++++ +++int acpi_register_gsi(u32 gsi, int triggering, int polarity)
            {
                unsigned int irq;
                unsigned int plat_gsi = gsi;
                if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
                        extern void eisa_set_level_irq(unsigned int irq);
            
-------- ---            if (edge_level == ACPI_LEVEL_SENSITIVE)
++++++++ +++            if (triggering == ACPI_LEVEL_SENSITIVE)
                                eisa_set_level_irq(gsi);
                }
            #endif
            
            #ifdef CONFIG_X86_IO_APIC
                if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) {
-------- ---            plat_gsi = mp_register_gsi(gsi, edge_level, active_high_low);
++++++++ +++            plat_gsi = mp_register_gsi(gsi, triggering, polarity);
                }
            #endif
                acpi_gsi_to_irq(plat_gsi, &irq);
@@@@@@@@@@@@@ -638,13 -638,13 -638,13 -638,6 -638,13 -638,6 -638,6 -638,6 -638,13 -638,13 -638,13 -638,13 +638,13 @@@@@@@@@@@@@ static int __init acpi_parse_fadt(unsig
                                return 0;
            
                        pmtmr_ioport = fadt->xpm_tmr_blk.address;
   + +++                /*
   + +++                 * "X" fields are optional extensions to the original V1.0
   + +++                 * fields, so we must selectively expand V1.0 fields if the
   + +++                 * corresponding X field is zero.
   + +++                 */
   + +++                if (!pmtmr_ioport)
   + +++                        pmtmr_ioport = fadt->V1_pm_tmr_blk;
                } else {
                        /* FADT rev. 1 */
                        pmtmr_ioport = fadt->V1_pm_tmr_blk;
index 7975e79d5fa4e6e607117bc7b5b2fbd7e0e37389,871366b83b3f40cbc38ee91ec099e6cf3e5e15d0,871366b83b3f40cbc38ee91ec099e6cf3e5e15d0,871366b83b3f40cbc38ee91ec099e6cf3e5e15d0,871366b83b3f40cbc38ee91ec099e6cf3e5e15d0,871366b83b3f40cbc38ee91ec099e6cf3e5e15d0,8a5e159d81855f6326c900bc5ad29148de9318b6,871366b83b3f40cbc38ee91ec099e6cf3e5e15d0,871366b83b3f40cbc38ee91ec099e6cf3e5e15d0,871366b83b3f40cbc38ee91ec099e6cf3e5e15d0,871366b83b3f40cbc38ee91ec099e6cf3e5e15d0,871366b83b3f40cbc38ee91ec099e6cf3e5e15d0..3852d0a4c1b5e2f35dc168399d12b97882ca8938
            #include <linux/acpi.h>
            #include <acpi/processor.h>
            
 -----------#include "speedstep-est-common.h"
 -----------
            #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "acpi-cpufreq", msg)
            
            MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski");
@@@@@@@@@@@@@ -295,68 -297,68 -297,68 -297,68 -297,68 -297,68 -297,6 -297,68 -297,68 -297,68 -297,68 -297,68 +295,6 @@@@@@@@@@@@@ acpi_cpufreq_guess_freq 
            }
            
            
------ -----/* 
------ ----- * acpi_processor_cpu_init_pdc_est - let BIOS know about the SMP capabilities
------ ----- * of this driver
------ ----- * @perf: processor-specific acpi_io_data struct
------ ----- * @cpu: CPU being initialized
------ ----- *
------ ----- * To avoid issues with legacy OSes, some BIOSes require to be informed of
------ ----- * the SMP capabilities of OS P-state driver. Here we set the bits in _PDC 
------ ----- * accordingly, for Enhanced Speedstep. Actual call to _PDC is done in
------ ----- * driver/acpi/processor.c
------ ----- */
------ -----static void 
------ -----acpi_processor_cpu_init_pdc_est(
------ -----            struct acpi_processor_performance *perf, 
------ -----            unsigned int cpu,
------ -----            struct acpi_object_list *obj_list
------ -----            )
------ -----{
------ -----    union acpi_object *obj;
------ -----    u32 *buf;
------ -----    struct cpuinfo_x86 *c = cpu_data + cpu;
------ -----    dprintk("acpi_processor_cpu_init_pdc_est\n");
------ -----
------ -----    if (!cpu_has(c, X86_FEATURE_EST))
------ -----            return;
------ -----
------ -----    /* Initialize pdc. It will be used later. */
------ -----    if (!obj_list)
------ -----            return;
------ -----            
------ -----    if (!(obj_list->count && obj_list->pointer))
------ -----            return;
------ -----
------ -----    obj = obj_list->pointer;
------ -----    if ((obj->buffer.length == 12) && obj->buffer.pointer) {
------ -----            buf = (u32 *)obj->buffer.pointer;
------ -----                    buf[0] = ACPI_PDC_REVISION_ID;
------ -----                    buf[1] = 1;
------ -----                    buf[2] = ACPI_PDC_EST_CAPABILITY_SMP;
------ -----            perf->pdc = obj_list;
------ -----    }
------ -----    return;
------ -----}
------ ----- 
------ -----
------ -----/* CPU specific PDC initialization */
------ -----static void 
------ -----acpi_processor_cpu_init_pdc(
------ -----            struct acpi_processor_performance *perf, 
------ -----            unsigned int cpu,
------ -----            struct acpi_object_list *obj_list
------ -----            )
------ -----{
------ -----    struct cpuinfo_x86 *c = cpu_data + cpu;
------ -----    dprintk("acpi_processor_cpu_init_pdc\n");
------ -----    perf->pdc = NULL;
------ -----    if (cpu_has(c, X86_FEATURE_EST))
------ -----            acpi_processor_cpu_init_pdc_est(perf, cpu, obj_list);
------ -----    return;
------ -----}
------ -----
------ -----
            static int
            acpi_cpufreq_cpu_init (
                struct cpufreq_policy   *policy)
                unsigned int            cpu = policy->cpu;
                struct cpufreq_acpi_io  *data;
                unsigned int            result = 0;
 ----- -----
 ----- -----    union acpi_object               arg0 = {ACPI_TYPE_BUFFER};
 ----- -----    u32                             arg0_buf[3];
 ----- -----    struct acpi_object_list         arg_list = {1, &arg0};
 +++++++++++    struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
            
-               union acpi_object               arg0 = {ACPI_TYPE_BUFFER};
-               u32                             arg0_buf[3];
-               struct acpi_object_list         arg_list = {1, &arg0};
-           
                dprintk("acpi_cpufreq_cpu_init\n");
------ -----    /* setup arg_list for _PDC settings */
------ -----        arg0.buffer.length = 12;
------ -----        arg0.buffer.pointer = (u8 *) arg0_buf;
            
                data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
                if (!data)
            
                acpi_io_data[cpu] = data;
            
------ -----    acpi_processor_cpu_init_pdc(&data->acpi_data, cpu, &arg_list);
                result = acpi_processor_register_performance(&data->acpi_data, cpu);
------ -----    data->acpi_data.pdc = NULL;
            
                if (result)
                        goto err_free;
            
 -----------    if (is_const_loops_cpu(cpu)) {
 +++++++++++    if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) {
                        acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS;
                }
            
index 9a826cde4fd1074838faf4b3890a59567b96a7bf,edb9873e27e37fbb7ee1f66c89c5e87436bec3bd,edb9873e27e37fbb7ee1f66c89c5e87436bec3bd,edb9873e27e37fbb7ee1f66c89c5e87436bec3bd,edb9873e27e37fbb7ee1f66c89c5e87436bec3bd,edb9873e27e37fbb7ee1f66c89c5e87436bec3bd,d93023438c4f594e4d7c68ea9f67035b4c556312,edb9873e27e37fbb7ee1f66c89c5e87436bec3bd,edb9873e27e37fbb7ee1f66c89c5e87436bec3bd,edb9873e27e37fbb7ee1f66c89c5e87436bec3bd,edb9873e27e37fbb7ee1f66c89c5e87436bec3bd,edb9873e27e37fbb7ee1f66c89c5e87436bec3bd..c173c0fa117a927734bf9c2ee389c1d5f7ada91d
            #include <asm/processor.h>
            #include <asm/cpufeature.h>
            
 -----------#include "speedstep-est-common.h"
 -----------
            #define PFX         "speedstep-centrino: "
            #define MAINTAINER  "Jeremy Fitzhardinge <jeremy@goop.org>"
            
@@@@@@@@@@@@@ -362,22 -364,22 -364,22 -364,22 -364,22 -364,22 -364,10 -364,22 -364,22 -364,22 -364,22 -364,22 +362,10 @@@@@@@@@@@@@ static struct acpi_processor_performanc
             */
            static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
            {
------ -----    union acpi_object               arg0 = {ACPI_TYPE_BUFFER};
------ -----    u32                             arg0_buf[3];
------ -----    struct acpi_object_list         arg_list = {1, &arg0};
                unsigned long                   cur_freq;
                int                             result = 0, i;
                unsigned int                    cpu = policy->cpu;
            
------ -----    /* _PDC settings */
------ -----    arg0.buffer.length = 12;
------ -----    arg0.buffer.pointer = (u8 *) arg0_buf;
------ -----    arg0_buf[0] = ACPI_PDC_REVISION_ID;
------ -----    arg0_buf[1] = 1;
------ -----    arg0_buf[2] = ACPI_PDC_EST_CAPABILITY_SMP_MSR;
------ -----
------ -----    p.pdc = &arg_list;
------ -----
                /* register with ACPI core */
                if (acpi_processor_register_performance(&p, cpu)) {
                        dprintk(KERN_INFO PFX "obtaining ACPI data failed\n");
@@@@@@@@@@@@@ -491,13 -493,12 -493,12 -493,12 -493,12 -493,12 -481,12 -493,12 -493,12 -493,12 -493,12 -493,12 +479,13 @@@@@@@@@@@@@ static int centrino_cpu_init(struct cpu
                unsigned l, h;
                int ret;
                int i;
 +++++++++++    struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
            
                /* Only Intel makes Enhanced Speedstep-capable CPUs */
                if (cpu->x86_vendor != X86_VENDOR_INTEL || !cpu_has(cpu, X86_FEATURE_EST))
                        return -ENODEV;
            
 -----------    if (is_const_loops_cpu(policy->cpu)) {
 +++++++++++    if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) {
                        centrino_driver.flags |= CPUFREQ_CONST_LOOPS;
                }
            
diff --combined arch/ia64/pci/pci.c
index d27ecdcb6fca8619405b9ffb1e2004f2186f67ec,30dbc98bf0b38a025b14161f0f088f1e67fcf6a0,20d76fae24e8eaf3ff7eca62b47b49aa4b1947a6,20d76fae24e8eaf3ff7eca62b47b49aa4b1947a6,20d76fae24e8eaf3ff7eca62b47b49aa4b1947a6,20d76fae24e8eaf3ff7eca62b47b49aa4b1947a6,20d76fae24e8eaf3ff7eca62b47b49aa4b1947a6,20d76fae24e8eaf3ff7eca62b47b49aa4b1947a6,337abd50c6ea34eb297d3bac39df4b70af3e7eef,20d76fae24e8eaf3ff7eca62b47b49aa4b1947a6,30dbc98bf0b38a025b14161f0f088f1e67fcf6a0,30dbc98bf0b38a025b14161f0f088f1e67fcf6a0..0b30ca006286429448e418e7358cbfa4e1ab3dae
@@@@@@@@@@@@@ -193,12 -193,12 -193,12 -193,12 -193,12 -193,12 -193,12 -193,12 -193,12 -193,12 -193,12 -193,12 +193,12 @@@@@@@@@@@@@ add_io_space (struct pci_root_info *inf
                        goto free_resource;
                }
            
-------- ---    min = addr->min_address_range;
++++++++ +++    min = addr->minimum;
                max = min + addr->address_length - 1;
-------- ---    if (addr->attribute.io.translation_attribute == ACPI_SPARSE_TRANSLATION)
++++++++ +++    if (addr->info.io.translation_type == ACPI_SPARSE_TRANSLATION)
                        sparse = 1;
            
-------- ---    space_nr = new_space(addr->address_translation_offset, sparse);
++++++++ +++    space_nr = new_space(addr->translation_offset, sparse);
                if (space_nr == ~0)
                        goto free_name;
            
@@@@@@@@@@@@@ -285,7 -285,7 -285,7 -285,7 -285,7 -285,7 -285,7 -285,7 -285,7 -285,7 -285,7 -285,7 +285,7 @@@@@@@@@@@@@ static __devinit acpi_status add_window
                if (addr.resource_type == ACPI_MEMORY_RANGE) {
                        flags = IORESOURCE_MEM;
                        root = &iomem_resource;
-------- ---            offset = addr.address_translation_offset;
++++++++ +++            offset = addr.translation_offset;
                } else if (addr.resource_type == ACPI_IO_RANGE) {
                        flags = IORESOURCE_IO;
                        root = &ioport_resource;
                window = &info->controller->window[info->controller->windows++];
                window->resource.name = info->name;
                window->resource.flags = flags;
-------- ---    window->resource.start = addr.min_address_range + offset;
++++++++ +++    window->resource.start = addr.minimum + offset;
                window->resource.end = window->resource.start + addr.address_length - 1;
                window->resource.child = NULL;
                window->offset = offset;
@@@@@@@@@@@@@ -454,13 -454,14 -454,14 -454,14 -454,14 -454,14 -454,14 -454,14 -454,14 -454,14 -454,14 -454,14 +454,13 @@@@@@@@@@@@@ static int __devinit is_valid_resource(
                return 0;
            }
            
 -----------static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
 +++++++++++static void __devinit
 +++++++++++pcibios_fixup_resources(struct pci_dev *dev, int start, int limit)
            {
                struct pci_bus_region region;
                int i;
 -----------    int limit = (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) ? \
 -----------            PCI_BRIDGE_RESOURCES : PCI_NUM_RESOURCES;
            
 -----------    for (i = 0; i < limit; i++) {
 +++++++++++    for (i = start; i < limit; i++) {
                        if (!dev->resource[i].flags)
                                continue;
                        region.start = dev->resource[i].start;
                }
            }
            
 +++++++++++static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
 +++++++++++{
 +++++++++++    pcibios_fixup_resources(dev, 0, PCI_BRIDGE_RESOURCES);
 +++++++++++}
 +++++++++++
 +++++++++++static void __devinit pcibios_fixup_bridge_resources(struct pci_dev *dev)
 +++++++++++{
 +++++++++++    pcibios_fixup_resources(dev, PCI_BRIDGE_RESOURCES, PCI_NUM_RESOURCES);
 +++++++++++}
 +++++++++++
            /*
             *  Called after each bus is probed, but before its children are examined.
             */
@@@@@@@@@@@@@ -491,7 -482,7 -482,7 -482,7 -482,7 -482,7 -482,7 -482,7 -482,7 -482,7 -482,7 -482,7 +491,7 @@@@@@@@@@@@@ pcibios_fixup_bus (struct pci_bus *b
            
                if (b->self) {
                        pci_read_bridge_bases(b);
 -----------            pcibios_fixup_device_resources(b->self);
 +++++++++++            pcibios_fixup_bridge_resources(b->self);
                }
                list_for_each_entry(dev, &b->devices, bus_list)
                        pcibios_fixup_device_resources(dev);
@@@@@@@@@@@@@ -709,7 -700,7 -700,7 -700,7 -700,7 -700,7 -700,7 -700,7 -700,7 -700,7 -700,7 -700,7 +709,7 @@@@@@@@@@@@@ int ia64_pci_legacy_read(struct pci_bu
             */
            int ia64_pci_legacy_write(struct pci_dev *bus, u16 port, u32 val, u8 size)
            {
  ------ -      int ret = 0;
  ++++++ +      int ret = size;
            
                switch (size) {
                case 1:
index e8cf44ef8778dc50adc3d71a92ba7665155da7ff,97154ab058b470e1e27af7484e6adcf97fa93a06,97154ab058b470e1e27af7484e6adcf97fa93a06,97154ab058b470e1e27af7484e6adcf97fa93a06,97154ab058b470e1e27af7484e6adcf97fa93a06,97154ab058b470e1e27af7484e6adcf97fa93a06,97154ab058b470e1e27af7484e6adcf97fa93a06,97154ab058b470e1e27af7484e6adcf97fa93a06,619767d3ea2bf8d248b893a87d6740a9105b9c42,97154ab058b470e1e27af7484e6adcf97fa93a06,97154ab058b470e1e27af7484e6adcf97fa93a06,97154ab058b470e1e27af7484e6adcf97fa93a06..1a5060b434b8a8858d2be94d3aaa2eb05c4e32fd
            #include <asm/proto.h>
            #include <asm/mach_apic.h>
            #include <asm/acpi.h>
 +++++++++++#include <asm/dma.h>
            
            #define __apicdebuginit  __init
            
@@@@@@@@@@@@@ -47,9 -46,6 -46,6 -46,6 -46,6 -46,6 -46,6 -46,6 -46,6 -46,6 -46,6 -46,6 +47,9 @@@@@@@@@@@@@ static int no_timer_check
            
            int disable_timer_pin_1 __initdata;
            
 +++++++++++/* Where if anywhere is the i8259 connect in external int mode */
 +++++++++++static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
 +++++++++++
            static DEFINE_SPINLOCK(ioapic_lock);
            
            /*
@@@@@@@@@@@@@ -264,6 -260,9 -260,9 -260,9 -260,9 -260,9 -260,9 -260,9 -260,9 -260,9 -260,9 -260,9 +264,6 @@@@@@@@@@@@@ __setup("apic", enable_ioapic_setup)
            void __init check_ioapic(void) 
            { 
                int num,slot,func; 
 -----------    if (ioapic_force) 
 -----------            return; 
 -----------
                /* Poor man's PCI discovery */
                for (num = 0; num < 32; num++) { 
                        for (slot = 0; slot < 32; slot++) { 
                                        switch (vendor) { 
                                        case PCI_VENDOR_ID_VIA:
            #ifdef CONFIG_GART_IOMMU
 -----------                                    if ((end_pfn >= (0xffffffff>>PAGE_SHIFT) ||
 +++++++++++                                    if ((end_pfn > MAX_DMA32_PFN ||
                                                     force_iommu) &&
                                                    !iommu_aperture_allowed) {
                                                        printk(KERN_INFO
@@@@@@@@@@@@@ -364,7 -363,7 -363,7 -363,7 -363,7 -363,7 -363,7 -363,7 -363,7 -363,7 -363,7 -363,7 +364,7 @@@@@@@@@@@@@ static int find_irq_entry(int apic, in
            /*
             * Find the pin to which IRQ[irq] (ISA) is connected
             */
 -----------static int find_isa_irq_pin(int irq, int type)
 +++++++++++static int __init find_isa_irq_pin(int irq, int type)
            {
                int i;
            
                return -1;
            }
            
 +++++++++++static int __init find_isa_irq_apic(int irq, int type)
 +++++++++++{
 +++++++++++    int i;
 +++++++++++
 +++++++++++    for (i = 0; i < mp_irq_entries; i++) {
 +++++++++++            int lbus = mp_irqs[i].mpc_srcbus;
 +++++++++++
 +++++++++++            if ((mp_bus_id_to_type[lbus] == MP_BUS_ISA ||
 +++++++++++                 mp_bus_id_to_type[lbus] == MP_BUS_EISA ||
 +++++++++++                 mp_bus_id_to_type[lbus] == MP_BUS_MCA) &&
 +++++++++++                (mp_irqs[i].mpc_irqtype == type) &&
 +++++++++++                (mp_irqs[i].mpc_srcbusirq == irq))
 +++++++++++                    break;
 +++++++++++    }
 +++++++++++    if (i < mp_irq_entries) {
 +++++++++++            int apic;
 +++++++++++            for(apic = 0; apic < nr_ioapics; apic++) {
 +++++++++++                    if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic)
 +++++++++++                            return apic;
 +++++++++++            }
 +++++++++++    }
 +++++++++++
 +++++++++++    return -1;
 +++++++++++}
 +++++++++++
            /*
             * Find a specific PCI IRQ entry.
             * Not an __init, possibly needed by modules
@@@@@@@@@@@@@ -900,7 -874,7 -874,7 -874,7 -874,7 -874,7 -874,7 -874,7 -874,7 -874,7 -874,7 -874,7 +900,7 @@@@@@@@@@@@@ static void __init setup_IO_APIC_irqs(v
             * Set up the 8259A-master output pin as broadcast to all
             * CPUs.
             */
 -----------static void __init setup_ExtINT_IRQ0_pin(unsigned int pin, int vector)
 +++++++++++static void __init setup_ExtINT_IRQ0_pin(unsigned int apic, unsigned int pin, int vector)
            {
                struct IO_APIC_route_entry entry;
                unsigned long flags;
                disable_8259A_irq(0);
            
                /* mask LVT0 */
 -----------    apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
 +++++++++++    apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
            
                /*
                 * We use logical delivery to get the timer IRQ
                 * Add it to the IO-APIC irq-routing table:
                 */
                spin_lock_irqsave(&ioapic_lock, flags);
 -----------    io_apic_write(0, 0x11+2*pin, *(((int *)&entry)+1));
 -----------    io_apic_write(0, 0x10+2*pin, *(((int *)&entry)+0));
 +++++++++++    io_apic_write(apic, 0x11+2*pin, *(((int *)&entry)+1));
 +++++++++++    io_apic_write(apic, 0x10+2*pin, *(((int *)&entry)+0));
                spin_unlock_irqrestore(&ioapic_lock, flags);
            
                enable_8259A_irq(0);
@@@@@@@@@@@@@ -1214,8 -1188,7 -1188,7 -1188,7 -1188,7 -1188,7 -1188,7 -1188,7 -1188,7 -1188,7 -1188,7 -1188,7 +1214,8 @@@@@@@@@@@@@ void __apicdebuginit print_PIC(void
            static void __init enable_IO_APIC(void)
            {
                union IO_APIC_reg_01 reg_01;
 -----------    int i;
 +++++++++++    int i8259_apic, i8259_pin;
 +++++++++++    int i, apic;
                unsigned long flags;
            
                for (i = 0; i < PIN_MAP_SIZE; i++) {
                /*
                 * The number of IO-APIC IRQ registers (== #pins):
                 */
 -----------    for (i = 0; i < nr_ioapics; i++) {
 +++++++++++    for (apic = 0; apic < nr_ioapics; apic++) {
                        spin_lock_irqsave(&ioapic_lock, flags);
 -----------            reg_01.raw = io_apic_read(i, 1);
 +++++++++++            reg_01.raw = io_apic_read(apic, 1);
                        spin_unlock_irqrestore(&ioapic_lock, flags);
 -----------            nr_ioapic_registers[i] = reg_01.bits.entries+1;
 +++++++++++            nr_ioapic_registers[apic] = reg_01.bits.entries+1;
 +++++++++++    }
 +++++++++++    for(apic = 0; apic < nr_ioapics; apic++) {
 +++++++++++            int pin;
 +++++++++++            /* See if any of the pins is in ExtINT mode */
 +++++++++++            for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) {
 +++++++++++                    struct IO_APIC_route_entry entry;
 +++++++++++                    spin_lock_irqsave(&ioapic_lock, flags);
 +++++++++++                    *(((int *)&entry) + 0) = io_apic_read(apic, 0x10 + 2 * pin);
 +++++++++++                    *(((int *)&entry) + 1) = io_apic_read(apic, 0x11 + 2 * pin);
 +++++++++++                    spin_unlock_irqrestore(&ioapic_lock, flags);
 +++++++++++
 +++++++++++
 +++++++++++                    /* If the interrupt line is enabled and in ExtInt mode
 +++++++++++                     * I have found the pin where the i8259 is connected.
 +++++++++++                     */
 +++++++++++                    if ((entry.mask == 0) && (entry.delivery_mode == dest_ExtINT)) {
 +++++++++++                            ioapic_i8259.apic = apic;
 +++++++++++                            ioapic_i8259.pin  = pin;
 +++++++++++                            goto found_i8259;
 +++++++++++                    }
 +++++++++++            }
 +++++++++++    }
 +++++++++++ found_i8259:
 +++++++++++    /* Look to see what if the MP table has reported the ExtINT */
 +++++++++++    i8259_pin  = find_isa_irq_pin(0, mp_ExtINT);
 +++++++++++    i8259_apic = find_isa_irq_apic(0, mp_ExtINT);
 +++++++++++    /* Trust the MP table if nothing is setup in the hardware */
 +++++++++++    if ((ioapic_i8259.pin == -1) && (i8259_pin >= 0)) {
 +++++++++++            printk(KERN_WARNING "ExtINT not setup in hardware but reported by MP table\n");
 +++++++++++            ioapic_i8259.pin  = i8259_pin;
 +++++++++++            ioapic_i8259.apic = i8259_apic;
 +++++++++++    }
 +++++++++++    /* Complain if the MP table and the hardware disagree */
 +++++++++++    if (((ioapic_i8259.apic != i8259_apic) || (ioapic_i8259.pin != i8259_pin)) &&
 +++++++++++            (i8259_pin >= 0) && (ioapic_i8259.pin >= 0))
 +++++++++++    {
 +++++++++++            printk(KERN_WARNING "ExtINT in hardware and MP table differ\n");
                }
            
                /*
             */
            void disable_IO_APIC(void)
            {
 -----------    int pin;
                /*
                 * Clear the IO-APIC before rebooting:
                 */
                 * Put that IOAPIC in virtual wire mode
                 * so legacy interrupts can be delivered.
                 */
 -----------    pin = find_isa_irq_pin(0, mp_ExtINT);
 -----------    if (pin != -1) {
 +++++++++++    if (ioapic_i8259.pin != -1) {
                        struct IO_APIC_route_entry entry;
                        unsigned long flags;
            
                        entry.polarity        = 0; /* High */
                        entry.delivery_status = 0;
                        entry.dest_mode       = 0; /* Physical */
 -----------            entry.delivery_mode   = 7; /* ExtInt */
 +++++++++++            entry.delivery_mode   = dest_ExtINT; /* ExtInt */
                        entry.vector          = 0;
 -----------            entry.dest.physical.physical_dest = 0;
 -----------
 +++++++++++            entry.dest.physical.physical_dest =
 +++++++++++                                    GET_APIC_ID(apic_read(APIC_ID));
            
                        /*
                         * Add it to the IO-APIC irq-routing table:
                         */
                        spin_lock_irqsave(&ioapic_lock, flags);
 -----------            io_apic_write(0, 0x11+2*pin, *(((int *)&entry)+1));
 -----------            io_apic_write(0, 0x10+2*pin, *(((int *)&entry)+0));
 +++++++++++            io_apic_write(ioapic_i8259.apic, 0x11+2*ioapic_i8259.pin,
 +++++++++++                    *(((int *)&entry)+1));
 +++++++++++            io_apic_write(ioapic_i8259.apic, 0x10+2*ioapic_i8259.pin,
 +++++++++++                    *(((int *)&entry)+0));
                        spin_unlock_irqrestore(&ioapic_lock, flags);
                }
            
 -----------    disconnect_bsp_APIC(pin != -1);
 +++++++++++    disconnect_bsp_APIC(ioapic_i8259.pin != -1);
            }
            
            /*
@@@@@@@@@@@@@ -1635,7 -1571,7 -1571,7 -1571,7 -1571,7 -1571,7 -1571,7 -1571,7 -1571,7 -1571,7 -1571,7 -1571,7 +1635,7 @@@@@@@@@@@@@ static void enable_lapic_irq (unsigned 
                unsigned long v;
            
                v = apic_read(APIC_LVT0);
 -----------    apic_write_around(APIC_LVT0, v & ~APIC_LVT_MASKED);
 +++++++++++    apic_write(APIC_LVT0, v & ~APIC_LVT_MASKED);
            }
            
            static void disable_lapic_irq (unsigned int irq)
                unsigned long v;
            
                v = apic_read(APIC_LVT0);
 -----------    apic_write_around(APIC_LVT0, v | APIC_LVT_MASKED);
 +++++++++++    apic_write(APIC_LVT0, v | APIC_LVT_MASKED);
            }
            
            static void ack_lapic_irq (unsigned int irq)
@@@@@@@@@@@@@ -1690,21 -1626,20 -1626,20 -1626,20 -1626,20 -1626,20 -1626,20 -1626,20 -1626,20 -1626,20 -1626,20 -1626,20 +1690,21 @@@@@@@@@@@@@ static void setup_nmi (void
             */
            static inline void unlock_ExtINT_logic(void)
            {
 -----------    int pin, i;
 +++++++++++    int apic, pin, i;
                struct IO_APIC_route_entry entry0, entry1;
                unsigned char save_control, save_freq_select;
                unsigned long flags;
            
 -----------    pin = find_isa_irq_pin(8, mp_INT);
 +++++++++++    pin  = find_isa_irq_pin(8, mp_INT);
 +++++++++++    apic = find_isa_irq_apic(8, mp_INT);
                if (pin == -1)
                        return;
            
                spin_lock_irqsave(&ioapic_lock, flags);
 -----------    *(((int *)&entry0) + 1) = io_apic_read(0, 0x11 + 2 * pin);
 -----------    *(((int *)&entry0) + 0) = io_apic_read(0, 0x10 + 2 * pin);
 +++++++++++    *(((int *)&entry0) + 1) = io_apic_read(apic, 0x11 + 2 * pin);
 +++++++++++    *(((int *)&entry0) + 0) = io_apic_read(apic, 0x10 + 2 * pin);
                spin_unlock_irqrestore(&ioapic_lock, flags);
 -----------    clear_IO_APIC_pin(0, pin);
 +++++++++++    clear_IO_APIC_pin(apic, pin);
            
                memset(&entry1, 0, sizeof(entry1));
            
                entry1.vector = 0;
            
                spin_lock_irqsave(&ioapic_lock, flags);
 -----------    io_apic_write(0, 0x11 + 2 * pin, *(((int *)&entry1) + 1));
 -----------    io_apic_write(0, 0x10 + 2 * pin, *(((int *)&entry1) + 0));
 +++++++++++    io_apic_write(apic, 0x11 + 2 * pin, *(((int *)&entry1) + 1));
 +++++++++++    io_apic_write(apic, 0x10 + 2 * pin, *(((int *)&entry1) + 0));
                spin_unlock_irqrestore(&ioapic_lock, flags);
            
                save_control = CMOS_READ(RTC_CONTROL);
            
                CMOS_WRITE(save_control, RTC_CONTROL);
                CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
 -----------    clear_IO_APIC_pin(0, pin);
 +++++++++++    clear_IO_APIC_pin(apic, pin);
            
                spin_lock_irqsave(&ioapic_lock, flags);
 -----------    io_apic_write(0, 0x11 + 2 * pin, *(((int *)&entry0) + 1));
 -----------    io_apic_write(0, 0x10 + 2 * pin, *(((int *)&entry0) + 0));
 +++++++++++    io_apic_write(apic, 0x11 + 2 * pin, *(((int *)&entry0) + 1));
 +++++++++++    io_apic_write(apic, 0x10 + 2 * pin, *(((int *)&entry0) + 0));
                spin_unlock_irqrestore(&ioapic_lock, flags);
            }
            
             */
            static inline void check_timer(void)
            {
 -----------    int pin1, pin2;
 +++++++++++    int apic1, pin1, apic2, pin2;
                int vector;
            
                /*
                 * the 8259A which implies the virtual wire has to be
                 * disabled in the local APIC.
                 */
 -----------    apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
 +++++++++++    apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
                init_8259A(1);
                enable_8259A_irq(0);
            
 -----------    pin1 = find_isa_irq_pin(0, mp_INT);
 -----------    pin2 = find_isa_irq_pin(0, mp_ExtINT);
 +++++++++++    pin1  = find_isa_irq_pin(0, mp_INT);
 +++++++++++    apic1 = find_isa_irq_apic(0, mp_INT);
 +++++++++++    pin2  = ioapic_i8259.pin;
 +++++++++++    apic2 = ioapic_i8259.apic;
            
 -----------    apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X pin1=%d pin2=%d\n", vector, pin1, pin2);
 +++++++++++    apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n",
 +++++++++++            vector, apic1, pin1, apic2, pin2);
            
                if (pin1 != -1) {
                        /*
                                        clear_IO_APIC_pin(0, pin1);
                                return;
                        }
 -----------            clear_IO_APIC_pin(0, pin1);
 -----------            apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: 8254 timer not connected to IO-APIC\n");
 +++++++++++            clear_IO_APIC_pin(apic1, pin1);
 +++++++++++            apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: 8254 timer not "
 +++++++++++                            "connected to IO-APIC\n");
                }
            
 -----------    apic_printk(APIC_VERBOSE,KERN_INFO "...trying to set up timer (IRQ0) through the 8259A ... ");
 +++++++++++    apic_printk(APIC_VERBOSE,KERN_INFO "...trying to set up timer (IRQ0) "
 +++++++++++                            "through the 8259A ... ");
                if (pin2 != -1) {
 -----------            apic_printk(APIC_VERBOSE,"\n..... (found pin %d) ...", pin2);
 +++++++++++            apic_printk(APIC_VERBOSE,"\n..... (found apic %d pin %d) ...",
 +++++++++++                    apic2, pin2);
                        /*
                         * legacy devices should be connected to IO APIC #0
                         */
 -----------            setup_ExtINT_IRQ0_pin(pin2, vector);
 +++++++++++            setup_ExtINT_IRQ0_pin(apic2, pin2, vector);
                        if (timer_irq_works()) {
                                printk("works.\n");
                                nmi_watchdog_default();
                        /*
                         * Cleanup, just in case ...
                         */
 -----------            clear_IO_APIC_pin(0, pin2);
 +++++++++++            clear_IO_APIC_pin(apic2, pin2);
                }
                printk(" failed.\n");
            
            
                disable_8259A_irq(0);
                irq_desc[0].handler = &lapic_irq_type;
 -----------    apic_write_around(APIC_LVT0, APIC_DM_FIXED | vector);   /* Fixed mode */
 +++++++++++    apic_write(APIC_LVT0, APIC_DM_FIXED | vector);  /* Fixed mode */
                enable_8259A_irq(0);
            
                if (timer_irq_works()) {
                        apic_printk(APIC_QUIET, " works.\n");
                        return;
                }
 -----------    apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector);
 +++++++++++    apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector);
                apic_printk(APIC_VERBOSE," failed.\n");
            
                apic_printk(APIC_VERBOSE, KERN_INFO "...trying to set up timer as ExtINT IRQ...");
            
                init_8259A(0);
                make_8259A_irq(0);
 -----------    apic_write_around(APIC_LVT0, APIC_DM_EXTINT);
 +++++++++++    apic_write(APIC_LVT0, APIC_DM_EXTINT);
            
                unlock_ExtINT_logic();
            
@@@@@@@@@@@@@ -2027,7 -1956,7 -1956,7 -1956,7 -1956,7 -1956,7 -1956,7 -1956,7 -1956,7 -1956,7 -1956,7 -1956,7 +2027,7 @@@@@@@@@@@@@ int __init io_apic_get_redir_entries (i
            }
            
            
-------- ---int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low)
++++++++ +++int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int polarity)
            {
                struct IO_APIC_route_entry entry;
                unsigned long flags;
                entry.delivery_mode = INT_DELIVERY_MODE;
                entry.dest_mode = INT_DEST_MODE;
                entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
-------- ---    entry.trigger = edge_level;
-------- ---    entry.polarity = active_high_low;
++++++++ +++    entry.trigger = triggering;
++++++++ +++    entry.polarity = polarity;
                entry.mask = 1;                                  /* Disabled (masked) */
            
                irq = gsi_irq_sharing(irq);
                apic_printk(APIC_VERBOSE,KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> "
                        "IRQ %d Mode:%i Active:%i)\n", ioapic, 
                       mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
-------- ---           edge_level, active_high_low);
++++++++ +++           triggering, polarity);
            
-------- ---    ioapic_register_intr(irq, entry.vector, edge_level);
++++++++ +++    ioapic_register_intr(irq, entry.vector, triggering);
            
                if (!ioapic && (irq < 16))
                        disable_8259A_irq(irq);
diff --combined drivers/acpi/Kconfig
index 6d61945260a8d91b86843f0a8050aec9393bfc27,fce21c257523b729c68d29d201b41a7a762b5e31,fce21c257523b729c68d29d201b41a7a762b5e31,fe1e8126fbae836d72ba045744ae5894cbd6d3a3,fce21c257523b729c68d29d201b41a7a762b5e31,0c6abf49528e7a194d1855e7e933ead2e3333b8d,fe1e8126fbae836d72ba045744ae5894cbd6d3a3,fe1e8126fbae836d72ba045744ae5894cbd6d3a3,fce21c257523b729c68d29d201b41a7a762b5e31,fce21c257523b729c68d29d201b41a7a762b5e31,fce21c257523b729c68d29d201b41a7a762b5e31,fce21c257523b729c68d29d201b41a7a762b5e31..0cce28c4025b1814a57e467f1bef98e93fdeadce
@@@@@@@@@@@@@ -168,6 -168,7 -168,7 -168,7 -168,7 -168,7 -168,7 -168,7 -168,7 -168,7 -168,7 -168,7 +168,6 @@@@@@@@@@@@@ config ACPI_NUM
            config ACPI_ASUS
                    tristate "ASUS/Medion Laptop Extras"
                depends on X86
 -----------    default y
                    ---help---
                      This driver provides support for extra features of ACPI-compatible
                      ASUS laptops. As some of Medion laptops are made by ASUS, it may also
            config ACPI_IBM
                tristate "IBM ThinkPad Laptop Extras"
                depends on X86
   - ---        default y
                ---help---
                  This is a Linux ACPI driver for the IBM ThinkPad laptops. It adds
                  support for Fn-Fx key combinations, Bluetooth control, video
            config ACPI_TOSHIBA
                tristate "Toshiba Laptop Extras"
                depends on X86
 -----------    default y
                ---help---
                  This driver adds support for access to certain system settings
                  on "legacy free" Toshiba laptops.  These laptops can be recognized by
@@@@@@@@@@@@@ -267,7 -269,7 -269,7 -270,7 -269,7 -270,6 -270,7 -270,7 -269,7 -269,7 -269,7 -269,7 +267,6 @@@@@@@@@@@@@ config ACPI_DEBU
            
            config ACPI_EC
                bool
----- ------    depends on X86
                default y
                help
                  This driver is required on some systems for the proper operation of
diff --combined drivers/acpi/ec.c
index 3758b558d2b5e9ad1b2905049ea090874f63876a,7e1a445955bc1fd5a747038a4b2b1e867cf42b08,7e1a445955bc1fd5a747038a4b2b1e867cf42b08,7e1a445955bc1fd5a747038a4b2b1e867cf42b08,7e1a445955bc1fd5a747038a4b2b1e867cf42b08,93fcaec6d58925e2baa8fd228045667c7a17631a,7e1a445955bc1fd5a747038a4b2b1e867cf42b08,7e1a445955bc1fd5a747038a4b2b1e867cf42b08,0ecbfa5db1ba66618cd4bf014080c277e6c14720,7e1a445955bc1fd5a747038a4b2b1e867cf42b08,7e1a445955bc1fd5a747038a4b2b1e867cf42b08,7e1a445955bc1fd5a747038a4b2b1e867cf42b08..79b09d76c180204e488a924dc4827572a51d92f1
@@@@@@@@@@@@@ -60,20 -60,20 -60,20 -60,20 -60,20 -60,20 -60,20 -60,20 -60,20 -60,20 -60,20 -60,20 +60,20 @@@@@@@@@@@@@ ACPI_MODULE_NAME("acpi_ec"
            #define ACPI_EC_BURST_ENABLE        0x82
            #define ACPI_EC_BURST_DISABLE       0x83
            #define ACPI_EC_COMMAND_QUERY       0x84
----- ------#define EC_POLLING          0xFF
----- ------#define EC_BURST            0x00
+++++ ++++++#define EC_POLL                     0xFF
+++++ ++++++#define EC_INTR                     0x00
            static int acpi_ec_remove(struct acpi_device *device, int type);
            static int acpi_ec_start(struct acpi_device *device);
            static int acpi_ec_stop(struct acpi_device *device, int type);
----- ------static int acpi_ec_burst_add(struct acpi_device *device);
----- ------static int acpi_ec_polling_add(struct acpi_device *device);
+++++ ++++++static int acpi_ec_intr_add(struct acpi_device *device);
+++++ ++++++static int acpi_ec_poll_add(struct acpi_device *device);
            
            static struct acpi_driver acpi_ec_driver = {
                .name = ACPI_EC_DRIVER_NAME,
                .class = ACPI_EC_CLASS,
                .ids = ACPI_EC_HID,
                .ops = {
----- ------            .add = acpi_ec_polling_add,
+++++ ++++++            .add = acpi_ec_intr_add,
                        .remove = acpi_ec_remove,
                        .start = acpi_ec_start,
                        .stop = acpi_ec_stop,
@@@@@@@@@@@@@ -105,7 -105,7 -105,7 -105,7 -105,7 -105,7 -105,7 -105,7 -105,7 -105,7 -105,7 -105,7 +105,7 @@@@@@@@@@@@@ union acpi_ec 
                        atomic_t pending_gpe;
                        struct semaphore sem;
                        wait_queue_head_t wait;
----- ------    } burst;
+++++ ++++++    } intr;
            
                struct {
                        u32 mode;
                        struct acpi_generic_address data_addr;
                        unsigned long global_lock;
                        spinlock_t lock;
----- ------    } polling;
+++++ ++++++    } poll;
            };
            
----- ------static int acpi_ec_polling_wait(union acpi_ec *ec, u8 event);
----- ------static int acpi_ec_burst_wait(union acpi_ec *ec, unsigned int event);
----- ------static int acpi_ec_polling_read(union acpi_ec *ec, u8 address, u32 * data);
----- ------static int acpi_ec_burst_read(union acpi_ec *ec, u8 address, u32 * data);
----- ------static int acpi_ec_polling_write(union acpi_ec *ec, u8 address, u8 data);
----- ------static int acpi_ec_burst_write(union acpi_ec *ec, u8 address, u8 data);
----- ------static int acpi_ec_polling_query(union acpi_ec *ec, u32 * data);
----- ------static int acpi_ec_burst_query(union acpi_ec *ec, u32 * data);
----- ------static void acpi_ec_gpe_polling_query(void *ec_cxt);
----- ------static void acpi_ec_gpe_burst_query(void *ec_cxt);
----- ------static u32 acpi_ec_gpe_polling_handler(void *data);
----- ------static u32 acpi_ec_gpe_burst_handler(void *data);
+++++ ++++++static int acpi_ec_poll_wait(union acpi_ec *ec, u8 event);
+++++ ++++++static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event);
+++++ ++++++static int acpi_ec_poll_read(union acpi_ec *ec, u8 address, u32 * data);
+++++ ++++++static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data);
+++++ ++++++static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data);
+++++ ++++++static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data);
+++++ ++++++static int acpi_ec_poll_query(union acpi_ec *ec, u32 * data);
+++++ ++++++static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data);
+++++ ++++++static void acpi_ec_gpe_poll_query(void *ec_cxt);
+++++ ++++++static void acpi_ec_gpe_intr_query(void *ec_cxt);
+++++ ++++++static u32 acpi_ec_gpe_poll_handler(void *data);
+++++ ++++++static u32 acpi_ec_gpe_intr_handler(void *data);
            static acpi_status __init
----- ------acpi_fake_ecdt_polling_callback(acpi_handle handle,
+++++ ++++++acpi_fake_ecdt_poll_callback(acpi_handle handle,
                                        u32 Level, void *context, void **retval);
            
            static acpi_status __init
----- ------acpi_fake_ecdt_burst_callback(acpi_handle handle,
+++++ ++++++acpi_fake_ecdt_intr_callback(acpi_handle handle,
                                      u32 Level, void *context, void **retval);
            
----- ------static int __init acpi_ec_polling_get_real_ecdt(void);
----- ------static int __init acpi_ec_burst_get_real_ecdt(void);
+++++ ++++++static int __init acpi_ec_poll_get_real_ecdt(void);
+++++ ++++++static int __init acpi_ec_intr_get_real_ecdt(void);
            /* If we find an EC via the ECDT, we need to keep a ptr to its context */
            static union acpi_ec *ec_ecdt;
            
            /* External interfaces use first EC only, so remember */
            static struct acpi_device *first_ec;
----- ------static int acpi_ec_polling_mode = EC_POLLING;
+++++ ++++++static int acpi_ec_poll_mode = EC_INTR;
            
            /* --------------------------------------------------------------------------
                                         Transaction Management
               -------------------------------------------------------------------------- */
            
 -----------static inline u32 acpi_ec_read_status(union acpi_ec *ec)
 +++++++++++static u32 acpi_ec_read_status(union acpi_ec *ec)
            {
                u32 status = 0;
            
            
            static int acpi_ec_wait(union acpi_ec *ec, u8 event)
            {
----- ------    if (acpi_ec_polling_mode)
----- ------            return acpi_ec_polling_wait(ec, event);
+++++ ++++++    if (acpi_ec_poll_mode)
+++++ ++++++            return acpi_ec_poll_wait(ec, event);
                else
----- ------            return acpi_ec_burst_wait(ec, event);
+++++ ++++++            return acpi_ec_intr_wait(ec, event);
            }
            
----- ------static int acpi_ec_polling_wait(union acpi_ec *ec, u8 event)
+++++ ++++++static int acpi_ec_poll_wait(union acpi_ec *ec, u8 event)
            {
                u32 acpi_ec_status = 0;
                u32 i = ACPI_EC_UDELAY_COUNT;
            
                return -ETIME;
            }
----- ------static int acpi_ec_burst_wait(union acpi_ec *ec, unsigned int event)
+++++ ++++++static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event)
            {
                int result = 0;
            
                ACPI_FUNCTION_TRACE("acpi_ec_wait");
            
----- ------    ec->burst.expect_event = event;
+++++ ++++++    ec->intr.expect_event = event;
                smp_mb();
            
                switch (event) {
----- ------    case ACPI_EC_EVENT_OBF:
----- ------            if (acpi_ec_read_status(ec) & event) {
----- ------                    ec->burst.expect_event = 0;
----- ------                    return_VALUE(0);
----- ------            }
----- ------            break;
----- ------
                case ACPI_EC_EVENT_IBE:
                        if (~acpi_ec_read_status(ec) & event) {
----- ------                    ec->burst.expect_event = 0;
+++++ ++++++                    ec->intr.expect_event = 0;
                                return_VALUE(0);
                        }
                        break;
+++++ ++++++    default:
+++++ ++++++            break;
                }
            
----- ------    result = wait_event_timeout(ec->burst.wait,
----- ------                                !ec->burst.expect_event,
+++++ ++++++    result = wait_event_timeout(ec->intr.wait,
+++++ ++++++                                !ec->intr.expect_event,
                                            msecs_to_jiffies(ACPI_EC_DELAY));
            
----- ------    ec->burst.expect_event = 0;
+++++ ++++++    ec->intr.expect_event = 0;
                smp_mb();
            
                /*
                return_VALUE(-ETIME);
            }
            
----- ------static int acpi_ec_enter_burst_mode(union acpi_ec *ec)
+++++ ++++++#ifdef ACPI_FUTURE_USAGE
+++++ ++++++/*
+++++ ++++++ * Note: samsung nv5000 doesn't work with ec burst mode.
+++++ ++++++ * http://bugzilla.kernel.org/show_bug.cgi?id=4980
+++++ ++++++ */
+++++ ++++++int acpi_ec_enter_burst_mode(union acpi_ec *ec)
            {
                u32 tmp = 0;
                int status = 0;
                        acpi_hw_low_level_write(8, ACPI_EC_BURST_ENABLE,
                                                &ec->common.command_addr);
                        status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
----- ------            if (status)
----- ------                    return_VALUE(-EINVAL);
                        acpi_hw_low_level_read(8, &tmp, &ec->common.data_addr);
                        if (tmp != 0x90) {      /* Burst ACK byte */
                                return_VALUE(-EINVAL);
                        }
                }
            
----- ------    atomic_set(&ec->burst.leaving_burst, 0);
+++++ ++++++    atomic_set(&ec->intr.leaving_burst, 0);
                return_VALUE(0);
                  end:
----- ------    printk("Error in acpi_ec_wait\n");
+++++ ++++++    printk(KERN_WARNING PREFIX "Error in acpi_ec_wait\n");
                return_VALUE(-1);
            }
            
----- ------static int acpi_ec_leave_burst_mode(union acpi_ec *ec)
+++++ ++++++int acpi_ec_leave_burst_mode(union acpi_ec *ec)
            {
+++++ ++++++    int status = 0;
            
                ACPI_FUNCTION_TRACE("acpi_ec_leave_burst_mode");
            
----- ------    atomic_set(&ec->burst.leaving_burst, 1);
+++++ ++++++    status = acpi_ec_read_status(ec);
+++++ ++++++    if (status != -EINVAL && (status & ACPI_EC_FLAG_BURST)){
+++++ ++++++            status = acpi_ec_wait(ec, ACPI_EC_FLAG_IBF);
+++++ ++++++            if(status)
+++++ ++++++                    goto end;
+++++ ++++++            acpi_hw_low_level_write(8, ACPI_EC_BURST_DISABLE, &ec->common.command_addr);
+++++ ++++++            acpi_ec_wait(ec, ACPI_EC_FLAG_IBF);
+++++ ++++++    } 
+++++ ++++++    atomic_set(&ec->intr.leaving_burst, 1);
                return_VALUE(0);
+++++ ++++++end:
+++++ ++++++    printk(KERN_WARNING PREFIX "leave burst_mode:error\n");
+++++ ++++++    return_VALUE(-1);
            }
+++++ ++++++#endif /* ACPI_FUTURE_USAGE */
            
            static int acpi_ec_read(union acpi_ec *ec, u8 address, u32 * data)
            {
----- ------    if (acpi_ec_polling_mode)
----- ------            return acpi_ec_polling_read(ec, address, data);
+++++ ++++++    if (acpi_ec_poll_mode)
+++++ ++++++            return acpi_ec_poll_read(ec, address, data);
                else
----- ------            return acpi_ec_burst_read(ec, address, data);
+++++ ++++++            return acpi_ec_intr_read(ec, address, data);
            }
            static int acpi_ec_write(union acpi_ec *ec, u8 address, u8 data)
            {
----- ------    if (acpi_ec_polling_mode)
----- ------            return acpi_ec_polling_write(ec, address, data);
+++++ ++++++    if (acpi_ec_poll_mode)
+++++ ++++++            return acpi_ec_poll_write(ec, address, data);
                else
----- ------            return acpi_ec_burst_write(ec, address, data);
+++++ ++++++            return acpi_ec_intr_write(ec, address, data);
            }
----- ------static int acpi_ec_polling_read(union acpi_ec *ec, u8 address, u32 * data)
+++++ ++++++static int acpi_ec_poll_read(union acpi_ec *ec, u8 address, u32 * data)
            {
                acpi_status status = AE_OK;
                int result = 0;
                                return_VALUE(-ENODEV);
                }
            
----- ------    spin_lock_irqsave(&ec->polling.lock, flags);
+++++ ++++++    spin_lock_irqsave(&ec->poll.lock, flags);
            
                acpi_hw_low_level_write(8, ACPI_EC_COMMAND_READ,
                                        &ec->common.command_addr);
                                  *data, address));
            
                  end:
----- ------    spin_unlock_irqrestore(&ec->polling.lock, flags);
+++++ ++++++    spin_unlock_irqrestore(&ec->poll.lock, flags);
            
                if (ec->common.global_lock)
                        acpi_release_global_lock(glk);
                return_VALUE(result);
            }
            
----- ------static int acpi_ec_polling_write(union acpi_ec *ec, u8 address, u8 data)
+++++ ++++++static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data)
            {
                int result = 0;
                acpi_status status = AE_OK;
                                return_VALUE(-ENODEV);
                }
            
----- ------    spin_lock_irqsave(&ec->polling.lock, flags);
+++++ ++++++    spin_lock_irqsave(&ec->poll.lock, flags);
            
                acpi_hw_low_level_write(8, ACPI_EC_COMMAND_WRITE,
                                        &ec->common.command_addr);
                                  data, address));
            
                  end:
----- ------    spin_unlock_irqrestore(&ec->polling.lock, flags);
+++++ ++++++    spin_unlock_irqrestore(&ec->poll.lock, flags);
            
                if (ec->common.global_lock)
                        acpi_release_global_lock(glk);
                return_VALUE(result);
            }
            
----- ------static int acpi_ec_burst_read(union acpi_ec *ec, u8 address, u32 * data)
+++++ ++++++static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data)
            {
                int status = 0;
                u32 glk;
                }
            
                WARN_ON(in_interrupt());
----- ------    down(&ec->burst.sem);
+++++ ++++++    down(&ec->intr.sem);
            
----- ------    acpi_ec_enter_burst_mode(ec);
                status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
                if (status) {
----- ------            printk("read EC, IB not empty\n");
+++++ ++++++            printk(KERN_DEBUG PREFIX "read EC, IB not empty\n");
                        goto end;
                }
                acpi_hw_low_level_write(8, ACPI_EC_COMMAND_READ,
                                        &ec->common.command_addr);
                status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
                if (status) {
----- ------            printk("read EC, IB not empty\n");
+++++ ++++++            printk(KERN_DEBUG PREFIX "read EC, IB not empty\n");
                }
            
                acpi_hw_low_level_write(8, address, &ec->common.data_addr);
                status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
                if (status) {
----- ------            printk("read EC, OB not full\n");
+++++ ++++++            printk(KERN_DEBUG PREFIX "read EC, OB not full\n");
                        goto end;
                }
                acpi_hw_low_level_read(8, data, &ec->common.data_addr);
                                  *data, address));
            
                  end:
----- ------    acpi_ec_leave_burst_mode(ec);
----- ------    up(&ec->burst.sem);
+++++ ++++++    up(&ec->intr.sem);
            
                if (ec->common.global_lock)
                        acpi_release_global_lock(glk);
                return_VALUE(status);
            }
            
----- ------static int acpi_ec_burst_write(union acpi_ec *ec, u8 address, u8 data)
+++++ ++++++static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data)
            {
                int status = 0;
                u32 glk;
                }
            
                WARN_ON(in_interrupt());
----- ------    down(&ec->burst.sem);
----- ------
----- ------    acpi_ec_enter_burst_mode(ec);
+++++ ++++++    down(&ec->intr.sem);
            
                status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
                if (status) {
----- ------            printk("write EC, IB not empty\n");
+++++ ++++++            printk(KERN_DEBUG PREFIX "write EC, IB not empty\n");
                }
                acpi_hw_low_level_write(8, ACPI_EC_COMMAND_WRITE,
                                        &ec->common.command_addr);
                status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
                if (status) {
----- ------            printk("write EC, IB not empty\n");
+++++ ++++++            printk(KERN_DEBUG PREFIX "write EC, IB not empty\n");
                }
            
                acpi_hw_low_level_write(8, address, &ec->common.data_addr);
                status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
                if (status) {
----- ------            printk("write EC, IB not empty\n");
+++++ ++++++            printk(KERN_DEBUG PREFIX "write EC, IB not empty\n");
                }
            
                acpi_hw_low_level_write(8, data, &ec->common.data_addr);
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Wrote [%02x] to address [%02x]\n",
                                  data, address));
            
----- ------    acpi_ec_leave_burst_mode(ec);
----- ------    up(&ec->burst.sem);
+++++ ++++++    up(&ec->intr.sem);
            
                if (ec->common.global_lock)
                        acpi_release_global_lock(glk);
@@@@@@@@@@@@@ -553,12 -553,12 -553,12 -553,12 -553,12 -559,12 -553,12 -553,12 -553,12 -553,12 -553,12 -553,12 +559,12 @@@@@@@@@@@@@ EXPORT_SYMBOL(ec_write)
            
            static int acpi_ec_query(union acpi_ec *ec, u32 * data)
            {
----- ------    if (acpi_ec_polling_mode)
----- ------            return acpi_ec_polling_query(ec, data);
+++++ ++++++    if (acpi_ec_poll_mode)
+++++ ++++++            return acpi_ec_poll_query(ec, data);
                else
----- ------            return acpi_ec_burst_query(ec, data);
+++++ ++++++            return acpi_ec_intr_query(ec, data);
            }
----- ------static int acpi_ec_polling_query(union acpi_ec *ec, u32 * data)
+++++ ++++++static int acpi_ec_poll_query(union acpi_ec *ec, u32 * data)
            {
                int result = 0;
                acpi_status status = AE_OK;
                 * Note that successful completion of the query causes the ACPI_EC_SCI
                 * bit to be cleared (and thus clearing the interrupt source).
                 */
----- ------    spin_lock_irqsave(&ec->polling.lock, flags);
+++++ ++++++    spin_lock_irqsave(&ec->poll.lock, flags);
            
                acpi_hw_low_level_write(8, ACPI_EC_COMMAND_QUERY,
                                        &ec->common.command_addr);
                        result = -ENODATA;
            
                  end:
----- ------    spin_unlock_irqrestore(&ec->polling.lock, flags);
+++++ ++++++    spin_unlock_irqrestore(&ec->poll.lock, flags);
            
                if (ec->common.global_lock)
                        acpi_release_global_lock(glk);
            
                return_VALUE(result);
            }
----- ------static int acpi_ec_burst_query(union acpi_ec *ec, u32 * data)
+++++ ++++++static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data)
            {
                int status = 0;
                u32 glk;
                                return_VALUE(-ENODEV);
                }
            
----- ------    down(&ec->burst.sem);
+++++ ++++++    down(&ec->intr.sem);
            
                status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
                if (status) {
----- ------            printk("query EC, IB not empty\n");
+++++ ++++++            printk(KERN_DEBUG PREFIX "query EC, IB not empty\n");
                        goto end;
                }
                /*
                                        &ec->common.command_addr);
                status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
                if (status) {
----- ------            printk("query EC, OB not full\n");
+++++ ++++++            printk(KERN_DEBUG PREFIX "query EC, OB not full\n");
                        goto end;
                }
            
                        status = -ENODATA;
            
                  end:
----- ------    up(&ec->burst.sem);
+++++ ++++++    up(&ec->intr.sem);
            
                if (ec->common.global_lock)
                        acpi_release_global_lock(glk);
@@@@@@@@@@@@@ -664,13 -664,13 -664,13 -664,13 -664,13 -670,13 -664,13 -664,13 -664,13 -664,13 -664,13 -664,13 +670,13 @@@@@@@@@@@@@ union acpi_ec_query_data 
            
            static void acpi_ec_gpe_query(void *ec_cxt)
            {
----- ------    if (acpi_ec_polling_mode)
----- ------            acpi_ec_gpe_polling_query(ec_cxt);
+++++ ++++++    if (acpi_ec_poll_mode)
+++++ ++++++            acpi_ec_gpe_poll_query(ec_cxt);
                else
----- ------            acpi_ec_gpe_burst_query(ec_cxt);
+++++ ++++++            acpi_ec_gpe_intr_query(ec_cxt);
            }
            
----- ------static void acpi_ec_gpe_polling_query(void *ec_cxt)
+++++ ++++++static void acpi_ec_gpe_poll_query(void *ec_cxt)
            {
                union acpi_ec *ec = (union acpi_ec *)ec_cxt;
                u32 value = 0;
                if (!ec_cxt)
                        goto end;
            
----- ------    spin_lock_irqsave(&ec->polling.lock, flags);
+++++ ++++++    spin_lock_irqsave(&ec->poll.lock, flags);
                acpi_hw_low_level_read(8, &value, &ec->common.command_addr);
----- ------    spin_unlock_irqrestore(&ec->polling.lock, flags);
+++++ ++++++    spin_unlock_irqrestore(&ec->poll.lock, flags);
            
                /* TBD: Implement asynch events!
                 * NOTE: All we care about are EC-SCI's.  Other EC events are
                  end:
                acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR);
            }
----- ------static void acpi_ec_gpe_burst_query(void *ec_cxt)
+++++ ++++++static void acpi_ec_gpe_intr_query(void *ec_cxt)
            {
                union acpi_ec *ec = (union acpi_ec *)ec_cxt;
                u32 value;
            
                acpi_evaluate_object(ec->common.handle, object_name, NULL, NULL);
                  end:
----- ------    atomic_dec(&ec->burst.pending_gpe);
+++++ ++++++    atomic_dec(&ec->intr.pending_gpe);
                return;
            }
            
            static u32 acpi_ec_gpe_handler(void *data)
            {
----- ------    if (acpi_ec_polling_mode)
----- ------            return acpi_ec_gpe_polling_handler(data);
+++++ ++++++    if (acpi_ec_poll_mode)
+++++ ++++++            return acpi_ec_gpe_poll_handler(data);
                else
----- ------            return acpi_ec_gpe_burst_handler(data);
+++++ ++++++            return acpi_ec_gpe_intr_handler(data);
            }
----- ------static u32 acpi_ec_gpe_polling_handler(void *data)
+++++ ++++++static u32 acpi_ec_gpe_poll_handler(void *data)
            {
                acpi_status status = AE_OK;
                union acpi_ec *ec = (union acpi_ec *)data;
                else
                        return ACPI_INTERRUPT_NOT_HANDLED;
            }
----- ------static u32 acpi_ec_gpe_burst_handler(void *data)
+++++ ++++++static u32 acpi_ec_gpe_intr_handler(void *data)
            {
                acpi_status status = AE_OK;
                u32 value;
                acpi_clear_gpe(NULL, ec->common.gpe_bit, ACPI_ISR);
                value = acpi_ec_read_status(ec);
            
----- ------    switch (ec->burst.expect_event) {
+++++ ++++++    switch (ec->intr.expect_event) {
                case ACPI_EC_EVENT_OBF:
                        if (!(value & ACPI_EC_FLAG_OBF))
                                break;
                case ACPI_EC_EVENT_IBE:
                        if ((value & ACPI_EC_FLAG_IBF))
                                break;
----- ------            ec->burst.expect_event = 0;
----- ------            wake_up(&ec->burst.wait);
+++++ ++++++            ec->intr.expect_event = 0;
+++++ ++++++            wake_up(&ec->intr.wait);
                        return ACPI_INTERRUPT_HANDLED;
                default:
                        break;
                }
            
                if (value & ACPI_EC_FLAG_SCI) {
----- ------            atomic_add(1, &ec->burst.pending_gpe);
+++++ ++++++            atomic_add(1, &ec->intr.pending_gpe);
                        status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE,
                                                             acpi_ec_gpe_query, ec);
                        return status == AE_OK ?
@@@@@@@@@@@@@ -980,7 -980,7 -980,7 -980,7 -980,7 -986,7 -980,7 -980,7 -980,7 -980,7 -980,7 -980,7 +986,7 @@@@@@@@@@@@@ static int acpi_ec_remove_fs(struct acp
                                           Driver Interface
               -------------------------------------------------------------------------- */
            
----- ------static int acpi_ec_polling_add(struct acpi_device *device)
+++++ ++++++static int acpi_ec_poll_add(struct acpi_device *device)
            {
                int result = 0;
                acpi_status status = AE_OK;
            
                ec->common.handle = device->handle;
                ec->common.uid = -1;
----- ------    spin_lock_init(&ec->polling.lock);
+++++ ++++++    spin_lock_init(&ec->poll.lock);
                strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
                strcpy(acpi_device_class(device), ACPI_EC_CLASS);
                acpi_driver_data(device) = ec;
                if (result)
                        goto end;
            
----- ------    printk(KERN_INFO PREFIX "%s [%s] (gpe %d)\n",
+++++ ++++++    printk(KERN_INFO PREFIX "%s [%s] (gpe %d) polling mode.\n",
                       acpi_device_name(device), acpi_device_bid(device),
                       (u32) ec->common.gpe_bit);
            
            
                return_VALUE(result);
            }
----- ------static int acpi_ec_burst_add(struct acpi_device *device)
+++++ ++++++static int acpi_ec_intr_add(struct acpi_device *device)
            {
                int result = 0;
                acpi_status status = AE_OK;
            
                ec->common.handle = device->handle;
                ec->common.uid = -1;
----- ------    atomic_set(&ec->burst.pending_gpe, 0);
----- ------    atomic_set(&ec->burst.leaving_burst, 1);
----- ------    init_MUTEX(&ec->burst.sem);
----- ------    init_waitqueue_head(&ec->burst.wait);
+++++ ++++++    atomic_set(&ec->intr.pending_gpe, 0);
+++++ ++++++    atomic_set(&ec->intr.leaving_burst, 1);
+++++ ++++++    init_MUTEX(&ec->intr.sem);
+++++ ++++++    init_waitqueue_head(&ec->intr.wait);
                strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
                strcpy(acpi_device_class(device), ACPI_EC_CLASS);
                acpi_driver_data(device) = ec;
                if (result)
                        goto end;
            
----- ------    printk("burst-mode-ec-10-Aug\n");
----- ------    printk(KERN_INFO PREFIX "%s [%s] (gpe %d)\n",
+++++ ++++++    printk(KERN_INFO PREFIX "%s [%s] (gpe %d) interrupt mode.\n",
                       acpi_device_name(device), acpi_device_bid(device),
                       (u32) ec->common.gpe_bit);
            
@@@@@@@@@@@@@ -1151,7 -1151,7 -1151,7 -1151,7 -1151,7 -1156,7 -1151,7 -1151,7 -1151,7 -1151,7 -1151,7 -1151,7 +1156,7 @@@@@@@@@@@@@ acpi_ec_io_ports(struct acpi_resource *
                union acpi_ec *ec = (union acpi_ec *)context;
                struct acpi_generic_address *addr;
            
-------- ---    if (resource->id != ACPI_RSTYPE_IO) {
++++++++ +++    if (resource->type != ACPI_RESOURCE_TYPE_IO) {
                        return AE_OK;
                }
            
                addr->address_space_id = ACPI_ADR_SPACE_SYSTEM_IO;
                addr->register_bit_width = 8;
                addr->register_bit_offset = 0;
-------- ---    addr->address = resource->data.io.min_base_address;
++++++++ +++    addr->address = resource->data.io.minimum;
            
                return AE_OK;
            }
@@@@@@@@@@@@@ -1267,16 -1267,16 -1267,16 -1267,16 -1267,16 -1272,16 -1267,16 -1267,16 -1267,16 -1267,16 -1267,16 -1267,16 +1272,16 @@@@@@@@@@@@@ acpi_fake_ecdt_callback(acpi_handle han
                                u32 Level, void *context, void **retval)
            {
            
----- ------    if (acpi_ec_polling_mode)
----- ------            return acpi_fake_ecdt_polling_callback(handle,
+++++ ++++++    if (acpi_ec_poll_mode)
+++++ ++++++            return acpi_fake_ecdt_poll_callback(handle,
                                                               Level, context, retval);
                else
----- ------            return acpi_fake_ecdt_burst_callback(handle,
+++++ ++++++            return acpi_fake_ecdt_intr_callback(handle,
                                                             Level, context, retval);
            }
            
            static acpi_status __init
----- ------acpi_fake_ecdt_polling_callback(acpi_handle handle,
+++++ ++++++acpi_fake_ecdt_poll_callback(acpi_handle handle,
                                        u32 Level, void *context, void **retval)
            {
                acpi_status status;
                                          &ec_ecdt->common.gpe_bit);
                if (ACPI_FAILURE(status))
                        return status;
----- ------    spin_lock_init(&ec_ecdt->polling.lock);
+++++ ++++++    spin_lock_init(&ec_ecdt->poll.lock);
                ec_ecdt->common.global_lock = TRUE;
                ec_ecdt->common.handle = handle;
            
            }
            
            static acpi_status __init
----- ------acpi_fake_ecdt_burst_callback(acpi_handle handle,
+++++ ++++++acpi_fake_ecdt_intr_callback(acpi_handle handle,
                                      u32 Level, void *context, void **retval)
            {
                acpi_status status;
            
----- ------    init_MUTEX(&ec_ecdt->burst.sem);
----- ------    init_waitqueue_head(&ec_ecdt->burst.wait);
+++++ ++++++    init_MUTEX(&ec_ecdt->intr.sem);
+++++ ++++++    init_waitqueue_head(&ec_ecdt->intr.wait);
                status = acpi_walk_resources(handle, METHOD_NAME__CRS,
                                             acpi_ec_io_ports, ec_ecdt);
                if (ACPI_FAILURE(status))
@@@@@@@@@@@@@ -1380,13 -1380,13 -1380,13 -1380,13 -1380,13 -1385,13 -1380,13 -1380,13 -1380,13 -1380,13 -1380,13 -1380,13 +1385,13 @@@@@@@@@@@@@ static int __init acpi_ec_fake_ecdt(voi
            
            static int __init acpi_ec_get_real_ecdt(void)
            {
----- ------    if (acpi_ec_polling_mode)
----- ------            return acpi_ec_polling_get_real_ecdt();
+++++ ++++++    if (acpi_ec_poll_mode)
+++++ ++++++            return acpi_ec_poll_get_real_ecdt();
                else
----- ------            return acpi_ec_burst_get_real_ecdt();
+++++ ++++++            return acpi_ec_intr_get_real_ecdt();
            }
            
----- ------static int __init acpi_ec_polling_get_real_ecdt(void)
+++++ ++++++static int __init acpi_ec_poll_get_real_ecdt(void)
            {
                acpi_status status;
                struct acpi_table_ecdt *ecdt_ptr;
                ec_ecdt->common.status_addr = ecdt_ptr->ec_control;
                ec_ecdt->common.data_addr = ecdt_ptr->ec_data;
                ec_ecdt->common.gpe_bit = ecdt_ptr->gpe_bit;
----- ------    spin_lock_init(&ec_ecdt->polling.lock);
+++++ ++++++    spin_lock_init(&ec_ecdt->poll.lock);
                /* use the GL just to be safe */
                ec_ecdt->common.global_lock = TRUE;
                ec_ecdt->common.uid = ecdt_ptr->uid;
                return -ENODEV;
            }
            
----- ------static int __init acpi_ec_burst_get_real_ecdt(void)
+++++ ++++++static int __init acpi_ec_intr_get_real_ecdt(void)
            {
                acpi_status status;
                struct acpi_table_ecdt *ecdt_ptr;
                        return -ENOMEM;
                memset(ec_ecdt, 0, sizeof(union acpi_ec));
            
----- ------    init_MUTEX(&ec_ecdt->burst.sem);
----- ------    init_waitqueue_head(&ec_ecdt->burst.wait);
+++++ ++++++    init_MUTEX(&ec_ecdt->intr.sem);
+++++ ++++++    init_waitqueue_head(&ec_ecdt->intr.wait);
                ec_ecdt->common.command_addr = ecdt_ptr->ec_control;
                ec_ecdt->common.status_addr = ecdt_ptr->ec_control;
                ec_ecdt->common.data_addr = ecdt_ptr->ec_data;
@@@@@@@@@@@@@ -1571,22 -1571,22 -1571,22 -1571,22 -1571,22 -1576,22 -1571,22 -1571,22 -1571,22 -1571,22 -1571,22 -1571,22 +1576,22 @@@@@@@@@@@@@ static int __init acpi_fake_ecdt_setup(
            }
            
            __setup("acpi_fake_ecdt", acpi_fake_ecdt_setup);
----- ------static int __init acpi_ec_set_polling_mode(char *str)
+++++ ++++++static int __init acpi_ec_set_intr_mode(char *str)
            {
----- ------    int burst;
+++++ ++++++    int intr;
            
----- ------    if (!get_option(&str, &burst))
+++++ ++++++    if (!get_option(&str, &intr))
                        return 0;
            
----- ------    if (burst) {
----- ------            acpi_ec_polling_mode = EC_BURST;
----- ------            acpi_ec_driver.ops.add = acpi_ec_burst_add;
+++++ ++++++    if (intr) {
+++++ ++++++            acpi_ec_poll_mode = EC_INTR;
+++++ ++++++            acpi_ec_driver.ops.add = acpi_ec_intr_add;
                } else {
----- ------            acpi_ec_polling_mode = EC_POLLING;
----- ------            acpi_ec_driver.ops.add = acpi_ec_polling_add;
+++++ ++++++            acpi_ec_poll_mode = EC_POLL;
+++++ ++++++            acpi_ec_driver.ops.add = acpi_ec_poll_add;
                }
----- ------    printk(KERN_INFO PREFIX "EC %s mode.\n", burst ? "burst" : "polling");
+++++ ++++++    printk(KERN_INFO PREFIX "EC %s mode.\n", intr ? "interrupt" : "polling");
                return 0;
            }
            
----- ------__setup("ec_burst=", acpi_ec_set_polling_mode);
+++++ ++++++__setup("ec_intr=", acpi_ec_set_intr_mode);
diff --combined drivers/acpi/osl.c
index 20c9a37643c73110f0e18fd5efef989906d2bf14,e3cd0b16031ad32c70ee1b47516c23b02856cbcb,e3cd0b16031ad32c70ee1b47516c23b02856cbcb,e3cd0b16031ad32c70ee1b47516c23b02856cbcb,8653dac01a76127b8485d5a07836a124c3d0d759,e3cd0b16031ad32c70ee1b47516c23b02856cbcb,e3cd0b16031ad32c70ee1b47516c23b02856cbcb,e3cd0b16031ad32c70ee1b47516c23b02856cbcb,58e7c47354ee6afac27bf1b6ed157322d35636d9,e3cd0b16031ad32c70ee1b47516c23b02856cbcb,e3cd0b16031ad32c70ee1b47516c23b02856cbcb,e3cd0b16031ad32c70ee1b47516c23b02856cbcb..cc4a4903842a9f5ba78e83dc70d84b021568e74f
@@@@@@@@@@@@@ -204,13 -204,11 -204,11 -204,11 -204,11 -204,11 -204,11 -204,11 -204,11 -204,11 -204,11 -204,11 +204,13 @@@@@@@@@@@@@ acpi_os_map_memory(acpi_physical_addres
            
                return AE_OK;
            }
 +++++++++++EXPORT_SYMBOL_GPL(acpi_os_map_memory);
            
            void acpi_os_unmap_memory(void __iomem * virt, acpi_size size)
            {
                iounmap(virt);
            }
 +++++++++++EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
            
            #ifdef ACPI_FUTURE_USAGE
            acpi_status
@@@@@@@@@@@@@ -838,7 -836,7 -836,7 -836,7 -836,7 -836,7 -836,7 -836,7 -836,7 -836,7 -836,7 -836,7 +838,7 @@@@@@@@@@@@@ acpi_status acpi_os_wait_semaphore(acpi
                                static const int quantum_ms = 1000 / HZ;
            
                                ret = down_trylock(sem);
---- -------                    for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) {
++++ +++++++                    for (i = timeout; (i > 0 && ret != 0); i -= quantum_ms) {
                                        schedule_timeout_interruptible(1);
                                        ret = down_trylock(sem);
                                }
             * Acquire a spinlock.
             *
             * handle is a pointer to the spinlock_t.
-------- --- * flags is *not* the result of save_flags - it is an ACPI-specific flag variable
-------- --- *   that indicates whether we are at interrupt level.
             */
            
-------- ---unsigned long acpi_os_acquire_lock(acpi_handle handle)
++++++++ +++acpi_native_uint acpi_os_acquire_lock(acpi_handle handle)
            {
                unsigned long flags;
                spin_lock_irqsave((spinlock_t *) handle, flags);
             * Release a spinlock. See above.
             */
            
-------- ---void acpi_os_release_lock(acpi_handle handle, unsigned long flags)
++++++++ +++void acpi_os_release_lock(acpi_handle handle, acpi_native_uint flags)
            {
-------- ---    spin_unlock_irqrestore((spinlock_t *) handle, flags);
++++++++ +++    spin_unlock_irqrestore((spinlock_t *) handle, (unsigned long) flags);
            }
            
            #ifndef ACPI_USE_LOCAL_CACHE
diff --combined drivers/acpi/pci_irq.c
index e567c03b238ee608a5ab7cc35268139e39788818,09567c2edcfb5225a67deb44d71cba7249915735,09567c2edcfb5225a67deb44d71cba7249915735,09567c2edcfb5225a67deb44d71cba7249915735,09567c2edcfb5225a67deb44d71cba7249915735,09567c2edcfb5225a67deb44d71cba7249915735,09567c2edcfb5225a67deb44d71cba7249915735,09567c2edcfb5225a67deb44d71cba7249915735,726dda1fce1cfc77edb8bf3ef3ef66a79d17f5c3,09567c2edcfb5225a67deb44d71cba7249915735,09567c2edcfb5225a67deb44d71cba7249915735,09567c2edcfb5225a67deb44d71cba7249915735..65aee79b3971fc02f25b8faa53528ece37b0fd64
@@@@@@@@@@@@@ -258,7 -258,7 -258,7 -258,7 -258,7 -258,7 -258,7 -258,7 -258,7 -258,7 -258,7 -258,7 +258,7 @@@@@@@@@@@@@ typedef int (*irq_lookup_func) (struct 
            
            static int
            acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
-------- ---                  int *edge_level, int *active_high_low, char **link)
++++++++ +++                  int *triggering, int *polarity, char **link)
            {
                int irq;
            
            
                if (entry->link.handle) {
                        irq = acpi_pci_link_allocate_irq(entry->link.handle,
-------- ---                                             entry->link.index, edge_level,
-------- ---                                             active_high_low, link);
++++++++ +++                                             entry->link.index, triggering,
++++++++ +++                                             polarity, link);
                        if (irq < 0) {
                                ACPI_DEBUG_PRINT((ACPI_DB_WARN,
                                                  "Invalid IRQ link routing entry\n"));
                        }
                } else {
                        irq = entry->link.index;
-------- ---            *edge_level = ACPI_LEVEL_SENSITIVE;
-------- ---            *active_high_low = ACPI_ACTIVE_LOW;
++++++++ +++            *triggering = ACPI_LEVEL_SENSITIVE;
++++++++ +++            *polarity = ACPI_ACTIVE_LOW;
                }
            
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq));
            
            static int
            acpi_pci_free_irq(struct acpi_prt_entry *entry,
-------- ---              int *edge_level, int *active_high_low, char **link)
++++++++ +++              int *triggering, int *polarity, char **link)
            {
                int irq;
            
@@@@@@@@@@@@@ -307,8 -307,8 -307,8 -307,8 -307,8 -307,8 -307,8 -307,8 -307,8 -307,8 -307,8 -307,8 +307,8 @@@@@@@@@@@@@ static in
            acpi_pci_irq_lookup(struct pci_bus *bus,
                            int device,
                            int pin,
-------- ---                int *edge_level,
-------- ---                int *active_high_low, char **link, irq_lookup_func func)
++++++++ +++                int *triggering,
++++++++ +++                int *polarity, char **link, irq_lookup_func func)
            {
                struct acpi_prt_entry *entry = NULL;
                int segment = pci_domain_nr(bus);
                        return_VALUE(-1);
                }
            
-------- ---    ret = func(entry, edge_level, active_high_low, link);
++++++++ +++    ret = func(entry, triggering, polarity, link);
                return_VALUE(ret);
            }
            
            static int
            acpi_pci_irq_derive(struct pci_dev *dev,
                            int pin,
-------- ---                int *edge_level,
-------- ---                int *active_high_low, char **link, irq_lookup_func func)
++++++++ +++                int *triggering,
++++++++ +++                int *polarity, char **link, irq_lookup_func func)
            {
                struct pci_dev *bridge = dev;
                int irq = -1;
            
                        if ((bridge->class >> 8) == PCI_CLASS_BRIDGE_CARDBUS) {
                                /* PC card has the same IRQ as its cardbridge */
 -----------                    pci_read_config_byte(bridge, PCI_INTERRUPT_PIN,
 -----------                                         &bridge_pin);
 +++++++++++                    bridge_pin = bridge->pin;
                                if (!bridge_pin) {
                                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                                          "No interrupt pin configured for device %s\n",
                        }
            
                        irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn),
-------- ---                                      pin, edge_level, active_high_low,
++++++++ +++                                      pin, triggering, polarity,
                                                  link, func);
                }
            
@@@@@@@@@@@@@ -401,8 -402,8 -402,8 -402,8 -402,8 -402,8 -402,8 -402,8 -402,8 -402,8 -402,8 -402,8 +401,8 @@@@@@@@@@@@@ int acpi_pci_irq_enable(struct pci_dev 
            {
                int irq = 0;
                u8 pin = 0;
-------- ---    int edge_level = ACPI_LEVEL_SENSITIVE;
-------- ---    int active_high_low = ACPI_ACTIVE_LOW;
++++++++ +++    int triggering = ACPI_LEVEL_SENSITIVE;
++++++++ +++    int polarity = ACPI_ACTIVE_LOW;
                char *link = NULL;
                int rc;
            
                if (!dev)
                        return_VALUE(-EINVAL);
            
 -----------    pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
 +++++++++++    pin = dev->pin;
                if (!pin) {
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                          "No interrupt pin configured for device %s\n",
                 * values override any BIOS-assigned IRQs set during boot.
                 */
                irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
-------- ---                              &edge_level, &active_high_low, &link,
++++++++ +++                              &triggering, &polarity, &link,
                                          acpi_pci_allocate_irq);
            
                /*
                 * device's parent bridge.
                 */
                if (irq < 0)
-------- ---            irq = acpi_pci_irq_derive(dev, pin, &edge_level,
-------- ---                                      &active_high_low, &link,
++++++++ +++            irq = acpi_pci_irq_derive(dev, pin, &triggering,
++++++++ +++                                      &polarity, &link,
                                                  acpi_pci_allocate_irq);
            
                /*
                        }
                }
            
-------- ---    rc = acpi_register_gsi(irq, edge_level, active_high_low);
++++++++ +++    rc = acpi_register_gsi(irq, triggering, polarity);
                if (rc < 0) {
                        printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed "
                               "to register GSI\n", pci_name(dev), ('A' + pin));
                        printk("Link [%s] -> ", link);
            
                printk("GSI %u (%s, %s) -> IRQ %d\n", irq,
-------- ---           (edge_level == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
-------- ---           (active_high_low == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);
++++++++ +++           (triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
++++++++ +++           (polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);
            
                return_VALUE(0);
            }
@@@@@@@@@@@@@ -494,15 -495,15 -495,15 -495,15 -495,15 -495,15 -495,15 -495,15 -495,15 -495,15 -495,15 -495,15 +494,15 @@@@@@@@@@@@@ void acpi_pci_irq_disable(struct pci_de
            {
                int gsi = 0;
                u8 pin = 0;
-------- ---    int edge_level = ACPI_LEVEL_SENSITIVE;
-------- ---    int active_high_low = ACPI_ACTIVE_LOW;
++++++++ +++    int triggering = ACPI_LEVEL_SENSITIVE;
++++++++ +++    int polarity = ACPI_ACTIVE_LOW;
            
                ACPI_FUNCTION_TRACE("acpi_pci_irq_disable");
            
                if (!dev || !dev->bus)
                        return_VOID;
            
 -----------    pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
 +++++++++++    pin = dev->pin;
                if (!pin)
                        return_VOID;
                pin--;
                 * First we check the PCI IRQ routing table (PRT) for an IRQ.
                 */
                gsi = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
-------- ---                              &edge_level, &active_high_low, NULL,
++++++++ +++                              &triggering, &polarity, NULL,
                                          acpi_pci_free_irq);
                /*
                 * If no PRT entry was found, we'll try to derive an IRQ from the
                 */
                if (gsi < 0)
                        gsi = acpi_pci_irq_derive(dev, pin,
-------- ---                                      &edge_level, &active_high_low, NULL,
++++++++ +++                                      &triggering, &polarity, NULL,
                                                  acpi_pci_free_irq);
                if (gsi < 0)
                        return_VOID;
index 1278aca96fe3e05141773eec181742b5b53f1c5c,1278aca96fe3e05141773eec181742b5b53f1c5c,0c561c571f29a40f09dce5e96e9af29f79376fe4,4217925626423db1f39cc76880e95f700fb5d279,0c561c571f29a40f09dce5e96e9af29f79376fe4,4217925626423db1f39cc76880e95f700fb5d279,66bbda78507a34e99b060f71ea9278fe74b51766,4217925626423db1f39cc76880e95f700fb5d279,1278aca96fe3e05141773eec181742b5b53f1c5c,0c561c571f29a40f09dce5e96e9af29f79376fe4,60e550f1f955ac84466a312e87854f4df47dfa45,1278aca96fe3e05141773eec181742b5b53f1c5c..99a3a28594daf333eb8c9355f2a886ed43f5f626
@@@@@@@@@@@@@ -253,31 -253,31 -253,31 -253,31 -253,31 -253,31 -253,21 -253,31 -253,31 -253,31 -253,31 -253,31 +253,21 @@@@@@@@@@@@@ static int acpi_processor_errata(struc
             * _PDC is required for a BIOS-OS handshake for most of the newer
             * ACPI processor features.
             */
------ -----
------ -----int acpi_processor_set_pdc(struct acpi_processor *pr,
------ -----                       struct acpi_object_list *pdc_in)
++++++ +++++static int acpi_processor_set_pdc(struct acpi_processor *pr)
            {
++++++ +++++    struct acpi_object_list *pdc_in = pr->pdc;
                acpi_status status = AE_OK;
------ -----    u32 arg0_buf[3];
------ -----    union acpi_object arg0 = { ACPI_TYPE_BUFFER };
------ -----    struct acpi_object_list no_object = { 1, &arg0 };
------ -----    struct acpi_object_list *pdc;
            
                ACPI_FUNCTION_TRACE("acpi_processor_set_pdc");
            
------ -----    arg0.buffer.length = 12;
------ -----    arg0.buffer.pointer = (u8 *) arg0_buf;
------ -----    arg0_buf[0] = ACPI_PDC_REVISION_ID;
------ -----    arg0_buf[1] = 0;
------ -----    arg0_buf[2] = 0;
------ -----
------ -----    pdc = (pdc_in) ? pdc_in : &no_object;
++++++ +++++    if (!pdc_in)
++++++ +++++            return_VALUE(status);
            
------ -----    status = acpi_evaluate_object(pr->handle, "_PDC", pdc, NULL);
++++++ +++++    status = acpi_evaluate_object(pr->handle, "_PDC", pdc_in, NULL);
            
------ -----    if ((ACPI_FAILURE(status)) && (pdc_in))
++++++ +++++    if (ACPI_FAILURE(status))
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
------ -----                              "Error evaluating _PDC, using legacy perf. control...\n"));
++++++ +++++                "Could not evaluate _PDC, using legacy perf. control...\n"));
            
                return_VALUE(status);
            }
@@@@@@@@@@@@@ -357,7 -357,7 -357,7 -357,7 -357,7 -357,7 -347,7 -357,7 -357,7 -357,7 -357,6 -357,7 +347,6 @@@@@@@@@@@@@ static int acpi_processor_add_fs(struc
                                          ACPI_PROCESSOR_FILE_THROTTLING));
                else {
                        entry->proc_fops = &acpi_processor_throttling_fops;
---------- -            entry->proc_fops->write = acpi_processor_write_throttling;
                        entry->data = acpi_driver_data(device);
                        entry->owner = THIS_MODULE;
                }
                                          ACPI_PROCESSOR_FILE_LIMIT));
                else {
                        entry->proc_fops = &acpi_processor_limit_fops;
---------- -            entry->proc_fops->write = acpi_processor_write_limit;
                        entry->data = acpi_driver_data(device);
                        entry->owner = THIS_MODULE;
                }
@@@@@@@@@@@@@ -543,8 -543,8 -543,8 -543,6 -543,8 -543,6 -533,6 -543,6 -543,8 -543,8 -541,8 -543,8 +531,8 @@@@@@@@@@@@@ static int acpi_processor_get_info(stru
                return_VALUE(0);
            }
            
   + +++    static void *processor_device_array[NR_CPUS];
   + +++    
            static int acpi_processor_start(struct acpi_device *device)
            {
                int result = 0;
            
                BUG_ON((pr->id >= NR_CPUS) || (pr->id < 0));
            
   + +++        /*
   + +++         * Buggy BIOS check
   + +++         * ACPI id of processors can be reported wrongly by the BIOS.
   + +++         * Don't trust it blindly
   + +++         */
   + +++        if (processor_device_array[pr->id] != NULL &&
   + +++            processor_device_array[pr->id] != (void *)device) {
   + +++                ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "BIOS reporting wrong ACPI id"
   + +++                        "for the processor\n"));
   + +++                return_VALUE(-ENODEV);
   + +++        }
   + +++        processor_device_array[pr->id] = (void *)device;
   + +++    
                processors[pr->id] = pr;
            
                result = acpi_processor_add_fs(device);
                                          "Error installing device notify handler\n"));
                }
            
++++++ +++++    /* _PDC call should be done before doing anything else (if reqd.). */
++++++ +++++    arch_acpi_processor_init_pdc(pr);
++++++ +++++    acpi_processor_set_pdc(pr);
++++++ +++++
                acpi_processor_power_init(pr, device);
            
                if (pr->flags.throttling) {
@@@@@@@@@@@@@ -748,7 -748,7 -748,7 -733,7 -748,7 -733,7 -727,7 -733,7 -748,7 -748,7 -746,7 -748,7 +740,7 @@@@@@@@@@@@@ int acpi_processor_device_add(acpi_hand
                        return_VALUE(-ENODEV);
            
                if ((pr->id >= 0) && (pr->id < NR_CPUS)) {
  ------ -              kobject_hotplug(&(*device)->kobj, KOBJ_ONLINE);
  ++++++ +              kobject_uevent(&(*device)->kobj, KOBJ_ONLINE);
                }
                return_VALUE(0);
            }
@@@@@@@@@@@@@ -788,13 -788,13 -788,13 -773,13 -788,13 -773,13 -767,13 -773,13 -788,13 -788,13 -786,13 -788,13 +780,13 @@@@@@@@@@@@@ acpi_processor_hotplug_notify(acpi_hand
                        }
            
                        if (pr->id >= 0 && (pr->id < NR_CPUS)) {
  ------ -                      kobject_hotplug(&device->kobj, KOBJ_OFFLINE);
  ++++++ +                      kobject_uevent(&device->kobj, KOBJ_OFFLINE);
                                break;
                        }
            
                        result = acpi_processor_start(device);
                        if ((!result) && ((pr->id >= 0) && (pr->id < NR_CPUS))) {
  ------ -                      kobject_hotplug(&device->kobj, KOBJ_ONLINE);
  ++++++ +                      kobject_uevent(&device->kobj, KOBJ_ONLINE);
                        } else {
                                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
                                                  "Device [%s] failed to start\n",
                        }
            
                        if ((pr->id < NR_CPUS) && (cpu_present(pr->id)))
  ------ -                      kobject_hotplug(&device->kobj, KOBJ_OFFLINE);
  ++++++ +                      kobject_uevent(&device->kobj, KOBJ_OFFLINE);
                        break;
                default:
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
index cc049338e418b5b968888faafd22a85492752bab,552420e1f890182ff7a04d66c7bd8a37e0144b72,5f51057518b04abd45d10d465ee8c5e95abb4254,40c9f9ca5965c789096eedbde292e7f55af73739,807b0df308f18d6a31fccb0a806cd7c03195c9f7,70d8a6ec0920f1589525395a1550360a26cbd54f,1915c377bfc6be87529ccf74542b213150451ae1,70d8a6ec0920f1589525395a1550360a26cbd54f,807b0df308f18d6a31fccb0a806cd7c03195c9f7,807b0df308f18d6a31fccb0a806cd7c03195c9f7,807b0df308f18d6a31fccb0a806cd7c03195c9f7,807b0df308f18d6a31fccb0a806cd7c03195c9f7..be2dae52f6fa47a6b74dbca63c47a553236cfd27
@@@@@@@@@@@@@ -95,22 -95,57 -95,22 -95,22 -95,22 -95,22 -95,22 -95,22 -95,22 -95,22 -95,22 -95,22 +95,57 @@@@@@@@@@@@@ static int set_max_cstate(struct dmi_sy
            }
            
            static struct dmi_system_id __initdata processor_power_dmi_table[] = {
- ----------    {set_max_cstate, "IBM ThinkPad R40e", {
- ----------                                           DMI_MATCH(DMI_BIOS_VENDOR,
- ----------                                                     "IBM"),
- ----------                                           DMI_MATCH(DMI_BIOS_VERSION,
- ----------                                                     "1SET60WW")},
- ----------     (void *)1},
- ----------    {set_max_cstate, "Medion 41700", {
- ----------                                      DMI_MATCH(DMI_BIOS_VENDOR,
- ----------                                                "Phoenix Technologies LTD"),
- ----------                                      DMI_MATCH(DMI_BIOS_VERSION,
- ----------                                                "R01-A1J")}, (void *)1},
- ----------    {set_max_cstate, "Clevo 5600D", {
- ----------                                     DMI_MATCH(DMI_BIOS_VENDOR,
- ----------                                               "Phoenix Technologies LTD"),
- ----------                                     DMI_MATCH(DMI_BIOS_VERSION,
- ----------                                               "SHE845M0.86C.0013.D.0302131307")},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW")}, (void *)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET43WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET45WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET47WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET50WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET52WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET55WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET56WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET59WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET61WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET62WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET64WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET65WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "IBM ThinkPad R40e", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"1SET68WW") }, (void*)1},
+ ++++++++++    { set_max_cstate, "Medion 41700", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"R01-A1J")}, (void *)1},
+ ++++++++++    { set_max_cstate, "Clevo 5600D", {
+ ++++++++++      DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
+ ++++++++++      DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307")},
                 (void *)2},
                {},
            };
@@@@@@@@@@@@@ -169,11 -204,11 -169,11 -169,15 -169,11 -169,15 -169,15 -169,15 -169,11 -169,11 -169,11 -169,11 +204,11 @@@@@@@@@@@@@ acpi_processor_power_activate(struct ac
            
            static void acpi_safe_halt(void)
            {
   - ---        int polling = test_thread_flag(TIF_POLLING_NRFLAG);
   - ---        if (polling) {
   - ---                clear_thread_flag(TIF_POLLING_NRFLAG);
   - ---                smp_mb__after_clear_bit();
   - ---        }
   + +++        clear_thread_flag(TIF_POLLING_NRFLAG);
   + +++        smp_mb__after_clear_bit();
                if (!need_resched())
                        safe_halt();
   - ---        if (polling)
   - ---                set_thread_flag(TIF_POLLING_NRFLAG);
   + +++        set_thread_flag(TIF_POLLING_NRFLAG);
            }
            
            static atomic_t c3_cpu_count;
@@@@@@@@@@@@@ -274,34 -309,34 -274,33 -278,23 -274,34 -278,13 -278,13 -278,13 -274,34 -274,34 -274,34 -274,34 +309,34 @@@@@@@@@@@@@ static void acpi_processor_idle(void
                        }
                }
            
  --            cx->usage++;
  --        
     +++    #ifdef CONFIG_HOTPLUG_CPU
     +++        /*
     +++         * Check for P_LVL2_UP flag before entering C2 and above on
     +++         * an SMP system. We do it here instead of doing it at _CST/P_LVL
     +++         * detection phase, to work cleanly with logical CPU hotplug.
     +++         */
     +++        if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && 
  --                !pr->flags.has_cst && acpi_fadt.plvl2_up)
  --                    cx->type = ACPI_STATE_C1;
  ++ +++            !pr->flags.has_cst && !acpi_fadt.plvl2_up)
  ++ +++                cx = &pr->power.states[ACPI_STATE_C1];
     +++    #endif
  ++ +++    
  ++            cx->usage++;
  ++        
                /*
                 * Sleep:
                 * ------
                 * Invoke the current Cx state to put the processor to sleep.
                 */
   + +++        if (cx->type == ACPI_STATE_C2 || cx->type == ACPI_STATE_C3) {
   + +++                clear_thread_flag(TIF_POLLING_NRFLAG);
   + +++                smp_mb__after_clear_bit();
   + +++                if (need_resched()) {
   + +++                        set_thread_flag(TIF_POLLING_NRFLAG);
   + +++                        local_irq_enable();
   + +++                        return;
   + +++                }
   + +++        }
   + +++    
                switch (cx->type) {
            
                case ACPI_STATE_C1:
                        t2 = inl(acpi_fadt.xpm_tmr_blk.address);
                        /* Re-enable interrupts */
                        local_irq_enable();
   + +++                set_thread_flag(TIF_POLLING_NRFLAG);
                        /* Compute time (ticks) that we were actually asleep */
                        sleep_ticks =
                            ticks_elapsed(t1, t2) - cx->latency_ticks - C2_OVERHEAD;
            
                        /* Re-enable interrupts */
                        local_irq_enable();
   + +++                set_thread_flag(TIF_POLLING_NRFLAG);
                        /* Compute time (ticks) that we were actually asleep */
                        sleep_ticks =
                            ticks_elapsed(t1, t2) - cx->latency_ticks - C3_OVERHEAD;
            
                next_state = pr->power.state;
            
  ++ +++    #ifdef CONFIG_HOTPLUG_CPU
  ++ +++        /* Don't do promotion/demotion */
  ++ +++        if ((cx->type == ACPI_STATE_C1) && (num_online_cpus() > 1) &&
  ++ +++            !pr->flags.has_cst && !acpi_fadt.plvl2_up) {
  ++ +++                next_state = cx;
  ++ +++                goto end;
  ++ +++        }
  ++ +++    #endif
  ++ +++    
                /*
                 * Promotion?
                 * ----------
@@@@@@@@@@@@@ -550,26 -585,26 -540,26 -532,18 -550,26 -522,17 -522,17 -522,17 -550,26 -550,26 -550,26 -550,26 +585,18 @@@@@@@@@@@@@ static int acpi_processor_get_power_inf
                if (!pr->pblk)
                        return_VALUE(-ENODEV);
            
--- --------    memset(pr->power.states, 0, sizeof(pr->power.states));
--- --------
                /* if info is obtained from pblk/fadt, type equals state */
--- --------    pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1;
                pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2;
                pr->power.states[ACPI_STATE_C3].type = ACPI_STATE_C3;
            
--- --------    /* the C0 state only exists as a filler in our array,
--- --------     * and all processors need to support C1 */
--- --------    pr->power.states[ACPI_STATE_C0].valid = 1;
--- --------    pr->power.states[ACPI_STATE_C1].valid = 1;
--- -   ----
     +++    #ifndef CONFIG_HOTPLUG_CPU
     +++        /*
     +++         * Check for P_LVL2_UP flag before entering C2 and above on
     +++         * an SMP system. 
     +++         */
  --            if ((num_online_cpus() > 1) && acpi_fadt.plvl2_up)
  ++ +++        if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up)
     +++                return_VALUE(-ENODEV);
     +++    #endif
            
                /* determine C2 and C3 address from pblk */
                pr->power.states[ACPI_STATE_C2].address = pr->pblk + 4;
@@@@@@@@@@@@@ -591,12 -626,12 -581,12 -565,11 -591,12 -554,12 -554,12 -554,12 -591,12 -591,12 -591,12 -591,12 +618,11 @@@@@@@@@@@@@ static int acpi_processor_get_power_inf
            {
                ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1");
            
+++ ++++++++    /* Zero initialize all the C-states info. */
                memset(pr->power.states, 0, sizeof(pr->power.states));
            
--- --------    /* if info is obtained from pblk/fadt, type equals state */
+++ ++++++++    /* set the first C-State to C1 */
                pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1;
--- --------    pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2;
--- --------    pr->power.states[ACPI_STATE_C3].type = ACPI_STATE_C3;
            
                /* the C0 state only exists as a filler in our array,
                 * and all processors need to support C1 */
@@@@@@@@@@@@@ -610,6 -645,6 -600,6 -583,7 -610,6 -573,6 -573,6 -573,6 -610,6 -610,6 -610,6 -610,6 +636,7 @@@@@@@@@@@@@ static int acpi_processor_get_power_inf
            {
                acpi_status status = 0;
                acpi_integer count;
+++ ++++++++    int current_count;
                int i;
                struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
                union acpi_object *cst;
                if (nocst)
                        return_VALUE(-ENODEV);
            
--- --------    pr->power.count = 0;
--- --------    for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++)
--- --------            memset(&(pr->power.states[i]), 0,
--- --------                   sizeof(struct acpi_processor_cx));
+++ ++++++++    current_count = 1;
+++ ++++++++
+++ ++++++++    /* Zero initialize C2 onwards and prepare for fresh CST lookup */
+++ ++++++++    for (i = 2; i < ACPI_PROCESSOR_MAX_POWER; i++)
+++ ++++++++            memset(&(pr->power.states[i]), 0, 
+++ ++++++++                            sizeof(struct acpi_processor_cx));
            
                status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer);
                if (ACPI_FAILURE(status)) {
                        goto end;
                }
            
--- --------    /* We support up to ACPI_PROCESSOR_MAX_POWER. */
--- --------    if (count > ACPI_PROCESSOR_MAX_POWER) {
--- --------            printk(KERN_WARNING
--- --------                   "Limiting number of power states to max (%d)\n",
--- --------                   ACPI_PROCESSOR_MAX_POWER);
--- --------            printk(KERN_WARNING
--- --------                   "Please increase ACPI_PROCESSOR_MAX_POWER if needed.\n");
--- --------            count = ACPI_PROCESSOR_MAX_POWER;
--- --------    }
--- --------
                /* Tell driver that at least _CST is supported. */
                pr->flags.has_cst = 1;
            
                            (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO))
                                continue;
            
--- --------            if ((cx.type < ACPI_STATE_C1) || (cx.type > ACPI_STATE_C3))
+++ ++++++++            if ((cx.type < ACPI_STATE_C2) || (cx.type > ACPI_STATE_C3))
                                continue;
            
                        obj = (union acpi_object *)&(element->package.elements[2]);
            
                        cx.power = obj->integer.value;
            
--- --------            (pr->power.count)++;
--- --------            memcpy(&(pr->power.states[pr->power.count]), &cx, sizeof(cx));
+++ ++++++++            current_count++;
+++ ++++++++            memcpy(&(pr->power.states[current_count]), &cx, sizeof(cx));
+++ ++++++++
+++ ++++++++            /*
+++ ++++++++             * We support total ACPI_PROCESSOR_MAX_POWER - 1
+++ ++++++++             * (From 1 through ACPI_PROCESSOR_MAX_POWER - 1)
+++ ++++++++             */
+++ ++++++++            if (current_count >= (ACPI_PROCESSOR_MAX_POWER - 1)) {
+++ ++++++++                    printk(KERN_WARNING
+++ ++++++++                           "Limiting number of power states to max (%d)\n",
+++ ++++++++                           ACPI_PROCESSOR_MAX_POWER);
+++ ++++++++                    printk(KERN_WARNING
+++ ++++++++                           "Please increase ACPI_PROCESSOR_MAX_POWER if needed.\n");
+++ ++++++++                    break;
+++ ++++++++            }
                }
            
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d power states\n",
--- --------                      pr->power.count));
+++ ++++++++                      current_count));
            
                /* Validate number of power states discovered */
--- --------    if (pr->power.count < 2)
     ---                status = -ENODEV;
+++ ++++++++    if (current_count < 2)
     +++                status = -EFAULT;
            
                  end:
                acpi_os_free(buffer.pointer);
@@@@@@@@@@@@@ -843,15 -878,6 -833,6 -822,6 -843,6 -806,6 -806,6 -806,6 -843,6 -843,6 -843,6 -843,6 +875,15 @@@@@@@@@@@@@ static int acpi_processor_power_verify(
                unsigned int i;
                unsigned int working = 0;
            
 +++++++++++#ifdef ARCH_APICTIMER_STOPS_ON_C3
 +++++++++++    struct cpuinfo_x86 *c = cpu_data + pr->id;
 +++++++++++    cpumask_t mask = cpumask_of_cpu(pr->id);
 +++++++++++
 +++++++++++    if (c->x86_vendor == X86_VENDOR_INTEL) {
 +++++++++++            on_each_cpu(switch_ipi_to_APIC_timer, &mask, 1, 1);
 +++++++++++    }
 +++++++++++#endif
 +++++++++++
                for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
                        struct acpi_processor_cx *cx = &pr->power.states[i];
            
            
                        case ACPI_STATE_C3:
                                acpi_processor_power_verify_c3(pr, cx);
 +++++++++++#ifdef ARCH_APICTIMER_STOPS_ON_C3
 +++++++++++                    if (c->x86_vendor == X86_VENDOR_INTEL) {
 +++++++++++                            on_each_cpu(switch_APIC_timer_to_ipi,
 +++++++++++                                            &mask, 1, 1);
 +++++++++++                    }
 +++++++++++#endif
                                break;
                        }
            
@@@@@@@@@@@@@ -892,12 -912,12 -867,12 -856,13 -877,12 -840,12 -840,12 -840,12 -877,12 -877,12 -877,12 -877,12 +924,13 @@@@@@@@@@@@@ static int acpi_processor_get_power_inf
                /* NOTE: the idle thread may not be running while calling
                 * this function */
            
+++ ++++++++    /* Adding C1 state */
+++ ++++++++    acpi_processor_get_power_info_default_c1(pr);
                result = acpi_processor_get_power_info_cst(pr);
     ---        if ((result) || (acpi_processor_power_verify(pr) < 2)) {
     ---                result = acpi_processor_get_power_info_fadt(pr);
     ---                if ((result) || (acpi_processor_power_verify(pr) < 2))
     ---                        result = acpi_processor_get_power_info_default_c1(pr);
     ---        }
     +++        if (result == -ENODEV)
--- -   ----            result = acpi_processor_get_power_info_fadt(pr);
+++ ++++++++            acpi_processor_get_power_info_fadt(pr);
     +++    
--- -   ----    if ((result) || (acpi_processor_power_verify(pr) < 2))
--- -   ----            result = acpi_processor_get_power_info_default_c1(pr);
+++ ++++++++    pr->power.count = acpi_processor_power_verify(pr);
            
                /*
                 * Set Default Policy
@@@@@@@@@@@@@ -1066,8 -1086,8 -1041,8 -1031,8 -1051,8 -1014,8 -1014,6 -1014,8 -1051,8 -1051,8 -1051,8 -1051,8 +1099,6 @@@@@@@@@@@@@ int acpi_processor_power_init(struct ac
                        }
                }
            
------ -----    acpi_processor_power_init_pdc(&(pr->power), pr->id);
------ -----    acpi_processor_set_pdc(pr, pr->power.pdc);
                acpi_processor_get_power_info(pr);
            
                /*
index 22c7bb66c2005c4956a241c7a31a566d9ae6b073,22c7bb66c2005c4956a241c7a31a566d9ae6b073,22c7bb66c2005c4956a241c7a31a566d9ae6b073,22c7bb66c2005c4956a241c7a31a566d9ae6b073,22c7bb66c2005c4956a241c7a31a566d9ae6b073,22c7bb66c2005c4956a241c7a31a566d9ae6b073,532370734c683f4628787e29b2f7faf2e22a6bca,22c7bb66c2005c4956a241c7a31a566d9ae6b073,22c7bb66c2005c4956a241c7a31a566d9ae6b073,22c7bb66c2005c4956a241c7a31a566d9ae6b073,0c0234e18261ba0703019504f5be361c8a776670,22c7bb66c2005c4956a241c7a31a566d9ae6b073..abbdb37a7f5f37e062f58800318d66b67a37c5d1
@@@@@@@@@@@@@ -315,8 -315,8 -315,8 -315,8 -315,8 -315,8 -315,6 -315,8 -315,8 -315,8 -315,8 -315,8 +315,6 @@@@@@@@@@@@@ static int acpi_processor_get_performan
                if (!pr || !pr->performance || !pr->handle)
                        return_VALUE(-EINVAL);
            
------ -----    acpi_processor_set_pdc(pr, pr->performance->pdc);
------ -----
                status = acpi_get_handle(pr->handle, "_PCT", &handle);
                if (ACPI_FAILURE(status)) {
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@@@@@@@@@@@@ -520,8 -520,8 -520,8 -520,8 -520,8 -520,8 -518,8 -520,8 -520,8 -520,8 -520,8 -520,8 +518,8 @@@@@@@@@@@@@ static void acpi_cpufreq_add_file(struc
                                          "Unable to create '%s' fs entry\n",
                                          ACPI_PROCESSOR_FILE_PERFORMANCE));
                else {
++++++++++ +            acpi_processor_perf_fops.write = acpi_processor_write_performance;
                        entry->proc_fops = &acpi_processor_perf_fops;
---------- -            entry->proc_fops->write = acpi_processor_write_performance;
                        entry->data = acpi_driver_data(device);
                        entry->owner = THIS_MODULE;
                }
diff --combined drivers/acpi/scan.c
index 3b26a7104363a6e060ef5524ae19e0e3ce513b9f,0745d20afb8c305348f2d2b9df6d66ab7b1dcf07,31218e1d2a18313a8ea9410c3bbab5934bb7b396,23e2c6968a1164f9f54aa6f9a5493c619965019a,31218e1d2a18313a8ea9410c3bbab5934bb7b396,23e2c6968a1164f9f54aa6f9a5493c619965019a,23e2c6968a1164f9f54aa6f9a5493c619965019a,23e2c6968a1164f9f54aa6f9a5493c619965019a,c60516d0f66b3c02ffc07ed5ded33b38fbe660d6,31218e1d2a18313a8ea9410c3bbab5934bb7b396,0745d20afb8c305348f2d2b9df6d66ab7b1dcf07,0745d20afb8c305348f2d2b9df6d66ab7b1dcf07..9271e5209ac1a310521d47e7213e9d6822b42547
@@@@@@@@@@@@@ -78,7 -78,7 -78,7 -78,7 -78,7 -78,7 -78,7 -78,7 -78,7 -78,7 -78,7 -78,7 +78,7 @@@@@@@@@@@@@ static struct kobj_type ktype_acpi_ns 
                .release = acpi_device_release,
            };
            
  ------ -  static int namespace_hotplug(struct kset *kset, struct kobject *kobj,
  ++++++ +  static int namespace_uevent(struct kset *kset, struct kobject *kobj,
                                     char **envp, int num_envp, char *buffer,
                                     int buffer_size)
            {
                if (!dev->driver)
                        return 0;
            
  ------ -      if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &len,
  ------ -                              "PHYSDEVDRIVER=%s", dev->driver->name))
  ++++++ +      if (add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len,
  ++++++ +                         "PHYSDEVDRIVER=%s", dev->driver->name))
                        return -ENOMEM;
            
                envp[i] = NULL;
                return 0;
            }
            
  ------ -  static struct kset_hotplug_ops namespace_hotplug_ops = {
  ------ -      .hotplug = &namespace_hotplug,
  ++++++ +  static struct kset_uevent_ops namespace_uevent_ops = {
  ++++++ +      .uevent = &namespace_uevent,
            };
            
            static struct kset acpi_namespace_kset = {
                         },
                .subsys = &acpi_subsys,
                .ktype = &ktype_acpi_ns,
  ------ -      .hotplug_ops = &namespace_hotplug_ops,
  ++++++ +      .uevent_ops = &namespace_uevent_ops,
            };
            
            static void acpi_device_register(struct acpi_device *device,
@@@@@@@@@@@@@ -347,7 -347,7 -347,7 -347,7 -347,7 -347,7 -347,7 -347,7 -347,7 -347,7 -347,7 -347,7 +347,7 @@@@@@@@@@@@@ static int acpi_bus_get_wakeup_device_f
            }
            
            /* --------------------------------------------------------------------------
  ------ -              ACPI hotplug sysfs device file support
  ++++++ +              ACPI sysfs device file support
               -------------------------------------------------------------------------- */
            static ssize_t acpi_eject_store(struct acpi_device *device,
                                        const char *buf, size_t count);
@@@@@@@@@@@@@ -475,10 -475,8 -475,8 -475,8 -475,8 -475,8 -475,8 -475,8 -475,8 -475,8 -475,8 -475,8 +475,10 @@@@@@@@@@@@@ static LIST_HEAD(acpi_bus_drivers)
            static DECLARE_MUTEX(acpi_bus_drivers_lock);
            
            /**
 ----------- * acpi_bus_match 
 ----------- * --------------
 +++++++++++ * acpi_bus_match - match device IDs to driver's supported IDs
 +++++++++++ * @device: the device that we are trying to match to a driver
 +++++++++++ * @driver: driver whose device id table is being checked
 +++++++++++ *
             * Checks the device's hardware (_HID) or compatible (_CID) ids to see if it
             * matches the specified driver's criteria.
             */
@@@@@@@@@@@@@ -491,10 -489,8 -489,8 -489,8 -489,8 -489,8 -489,8 -489,8 -489,8 -489,8 -489,8 -489,8 +491,10 @@@@@@@@@@@@@ acpi_bus_match(struct acpi_device *devi
            }
            
            /**
 ----------- * acpi_bus_driver_init 
 ----------- * --------------------
 +++++++++++ * acpi_bus_driver_init - add a device to a driver
 +++++++++++ * @device: the device to add and initialize
 +++++++++++ * @driver: driver for the device
 +++++++++++ *
             * Used to initialize a device via its device driver.  Called whenever a 
             * driver is bound to a device.  Invokes the driver's add() and start() ops.
             */
@@@@@@@@@@@@@ -607,9 -603,8 -603,8 -603,8 -603,8 -603,8 -603,8 -603,8 -603,8 -603,8 -603,8 -603,8 +607,9 @@@@@@@@@@@@@ static int acpi_driver_detach(struct ac
            }
            
            /**
 ----------- * acpi_bus_register_driver 
 ----------- * ------------------------ 
 +++++++++++ * acpi_bus_register_driver - register a driver with the ACPI bus
 +++++++++++ * @driver: driver being registered
 +++++++++++ *
             * Registers a driver with the ACPI bus.  Searches the namespace for all
             * devices that match the driver's criteria and binds.  Returns the
             * number of devices that were claimed by the driver, or a negative
@@@@@@@@@@@@@ -638,9 -633,8 -633,8 -633,8 -633,8 -633,8 -633,8 -633,8 -633,8 -633,8 -633,8 -633,8 +638,9 @@@@@@@@@@@@@ int acpi_bus_register_driver(struct acp
            EXPORT_SYMBOL(acpi_bus_register_driver);
            
            /**
 ----------- * acpi_bus_unregister_driver 
 ----------- * --------------------------
 +++++++++++ * acpi_bus_unregister_driver - unregisters a driver with the APIC bus
 +++++++++++ * @driver: driver to unregister
 +++++++++++ *
             * Unregisters a driver with the ACPI bus.  Searches the namespace for all
             * devices that match the driver's criteria and unbinds.
             */
@@@@@@@@@@@@@ -666,9 -660,8 -660,8 -660,8 -660,8 -660,8 -660,8 -660,8 -660,8 -660,8 -660,8 -660,8 +666,9 @@@@@@@@@@@@@ int acpi_bus_unregister_driver(struct a
            EXPORT_SYMBOL(acpi_bus_unregister_driver);
            
            /**
 ----------- * acpi_bus_find_driver 
 ----------- * --------------------
 +++++++++++ * acpi_bus_find_driver - check if there is a driver installed for the device
 +++++++++++ * @device: device that we are trying to find a supporting driver for
 +++++++++++ *
             * Parses the list of registered drivers looking for a driver applicable for
             * the specified device.
             */
@@@@@@@@@@@@@ -851,7 -844,7 -844,7 -844,7 -844,7 -844,7 -844,7 -844,7 -844,7 -844,7 -844,7 -844,7 +851,7 @@@@@@@@@@@@@ static void acpi_device_set_id(struct a
                 * ----
                 * Fix for the system root bus device -- the only root-level device.
                 */
-------- ---    if ((parent == ACPI_ROOT_OBJECT) && (type == ACPI_BUS_TYPE_DEVICE)) {
++++++++ +++    if (((acpi_handle)parent == ACPI_ROOT_OBJECT) && (type == ACPI_BUS_TYPE_DEVICE)) {
                        hid = ACPI_BUS_HID;
                        strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
                        strcpy(device->pnp.device_class, ACPI_BUS_CLASS);
@@@@@@@@@@@@@ -1117,7 -1110,7 -1110,7 -1110,7 -1110,7 -1110,7 -1110,7 -1110,7 -1110,7 -1110,7 -1110,7 -1110,7 +1117,7 @@@@@@@@@@@@@ acpi_add_single_object(struct acpi_devi
                 *
                 * TBD: Assumes LDM provides driver hot-plug capability.
                 */
   - ---        result = acpi_bus_find_driver(device);
   + +++        acpi_bus_find_driver(device);
            
                  end:
                if (!result)
diff --combined include/acpi/processor.h
index 7a00d5089de983d0fb91f39f410aa60ee152e2e8,7a00d5089de983d0fb91f39f410aa60ee152e2e8,7a00d5089de983d0fb91f39f410aa60ee152e2e8,7a00d5089de983d0fb91f39f410aa60ee152e2e8,7a00d5089de983d0fb91f39f410aa60ee152e2e8,7a00d5089de983d0fb91f39f410aa60ee152e2e8,82a9b7d430ecc0e6e54c0e7c2aa8ba94b4fac433,7a00d5089de983d0fb91f39f410aa60ee152e2e8,7a00d5089de983d0fb91f39f410aa60ee152e2e8,7a00d5089de983d0fb91f39f410aa60ee152e2e8,edb5a8919cb6a03db461562372f82b8964442684,7a00d5089de983d0fb91f39f410aa60ee152e2e8..badf0277b1be7314a59f9b6a8c7836e25b14c314
@@@@@@@@@@@@@ -62,9 -62,9 -62,9 -62,9 -62,9 -62,9 -62,6 -62,9 -62,9 -62,9 -62,9 -62,9 +62,6 @@@@@@@@@@@@@ struct acpi_processor_power 
                u32 bm_activity;
                int count;
                struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
------ -----
------ -----    /* the _PDC objects passed by the driver, if any */
------ -----    struct acpi_object_list *pdc;
            };
            
            /* Performance Management */
@@@@@@@@@@@@@ -96,8 -96,8 -96,8 -96,8 -96,8 -96,8 -93,6 -96,8 -96,8 -96,8 -96,8 -96,8 +93,6 @@@@@@@@@@@@@ struct acpi_processor_performance 
                unsigned int state_count;
                struct acpi_processor_px *states;
            
------ -----    /* the _PDC objects passed by the driver, if any */
------ -----    struct acpi_object_list *pdc;
            };
            
            /* Throttling Control */
@@@@@@@@@@@@@ -151,6 -151,6 -151,6 -151,6 -151,6 -151,6 -146,9 -151,6 -151,6 -151,6 -151,6 -151,6 +146,9 @@@@@@@@@@@@@ struct acpi_processor 
                struct acpi_processor_performance *performance;
                struct acpi_processor_throttling throttling;
                struct acpi_processor_limit limit;
++++++ +++++
++++++ +++++    /* the _PDC objects for this processor, if any */
++++++ +++++    struct acpi_object_list *pdc;
            };
            
            struct acpi_processor_errata {
@@@@@@@@@@@@@ -178,22 -178,22 -178,22 -178,22 -178,22 -178,22 -176,12 -178,22 -178,22 -178,22 -178,22 -178,22 +176,12 @@@@@@@@@@@@@ int acpi_processor_notify_smm(struct mo
            extern struct acpi_processor *processors[NR_CPUS];
            extern struct acpi_processor_errata errata;
            
------ -----int acpi_processor_set_pdc(struct acpi_processor *pr,
------ -----                       struct acpi_object_list *pdc_in);
++++++ +++++void arch_acpi_processor_init_pdc(struct acpi_processor *pr);
            
------ -----#ifdef ARCH_HAS_POWER_PDC_INIT
------ -----void acpi_processor_power_init_pdc(struct acpi_processor_power *pow,
------ -----                               unsigned int cpu);
++++++ +++++#ifdef ARCH_HAS_POWER_INIT
            void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
                                                unsigned int cpu);
            #else
------ -----static inline void acpi_processor_power_init_pdc(struct acpi_processor_power
------ -----                                             *pow, unsigned int cpu)
------ -----{
------ -----    pow->pdc = NULL;
------ -----    return;
------ -----}
------ -----
            static inline void acpi_processor_power_init_bm_check(struct
                                                              acpi_processor_flags
                                                              *flags, unsigned int cpu)
@@@@@@@@@@@@@ -235,9 -235,9 -235,9 -235,9 -235,9 -235,9 -223,9 -235,9 -235,9 -235,9 -235,6 -235,9 +223,6 @@@@@@@@@@@@@ static inline int acpi_processor_ppc_ha
            /* in processor_throttling.c */
            int acpi_processor_get_throttling_info(struct acpi_processor *pr);
            int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
---------- -ssize_t acpi_processor_write_throttling(struct file *file,
---------- -                                    const char __user * buffer,
---------- -                                    size_t count, loff_t * data);
            extern struct file_operations acpi_processor_throttling_fops;
            
            /* in processor_idle.c */
@@@@@@@@@@@@@ -249,9 -249,9 -249,9 -249,9 -249,9 -249,9 -237,9 -249,9 -249,9 -249,9 -246,6 -249,9 +234,6 @@@@@@@@@@@@@ int acpi_processor_power_exit(struct ac
            
            /* in processor_thermal.c */
            int acpi_processor_get_limit_info(struct acpi_processor *pr);
---------- -ssize_t acpi_processor_write_limit(struct file *file,
---------- -                               const char __user * buffer,
---------- -                               size_t count, loff_t * data);
            extern struct file_operations acpi_processor_limit_fops;
            
            #ifdef CONFIG_CPU_FREQ
diff --combined include/linux/kernel.h
index a5363324cf959bcdf8ff21188aee90040e29622a,b1e407a4fbda1ec9b101c5e0bd2c3c4378b7bb5b,73aa55a73334ccda24b8ac09bbd274a5e03d9e9c,b1e407a4fbda1ec9b101c5e0bd2c3c4378b7bb5b,b1e407a4fbda1ec9b101c5e0bd2c3c4378b7bb5b,b1e407a4fbda1ec9b101c5e0bd2c3c4378b7bb5b,b1e407a4fbda1ec9b101c5e0bd2c3c4378b7bb5b,b1e407a4fbda1ec9b101c5e0bd2c3c4378b7bb5b,b1e407a4fbda1ec9b101c5e0bd2c3c4378b7bb5b,b1e407a4fbda1ec9b101c5e0bd2c3c4378b7bb5b,b1e407a4fbda1ec9b101c5e0bd2c3c4378b7bb5b,b1e407a4fbda1ec9b101c5e0bd2c3c4378b7bb5b..b49affa0ac5a4d4b779d2e0b9a8967fec7640bec
@@@@@@@@@@@@@ -47,8 -47,6 -47,6 -47,6 -47,6 -47,6 -47,6 -47,6 -47,6 -47,6 -47,6 -47,6 +47,8 @@@@@@@@@@@@@ extern int console_printk[]
            #define default_console_loglevel (console_printk[3])
            
            struct completion;
 +++++++++++struct pt_regs;
 +++++++++++struct user;
            
            /**
             * might_sleep - annotation for functions that can sleep
@@@@@@@@@@@@@ -125,8 -123,6 -123,6 -123,6 -123,6 -123,6 -123,6 -123,6 -123,6 -123,6 -123,6 -123,6 +125,8 @@@@@@@@@@@@@ extern int __kernel_text_address(unsign
            extern int kernel_text_address(unsigned long addr);
            extern int session_of_pgrp(int pgrp);
            
 +++++++++++extern void dump_thread(struct pt_regs *regs, struct user *dump);
 +++++++++++
            #ifdef CONFIG_PRINTK
            asmlinkage int vprintk(const char *fmt, va_list args)
                __attribute__ ((format (printf, 1, 0)));
@@@@@@@@@@@@@ -185,6 -181,6 -181,7 -181,6 -181,6 -181,6 -181,6 -181,6 -181,6 -181,6 -181,6 -181,6 +185,7 @@@@@@@@@@@@@ extern enum system_states 
                SYSTEM_HALT,
                SYSTEM_POWER_OFF,
                SYSTEM_RESTART,
++ +++++++++    SYSTEM_SUSPEND_DISK,
            } system_state;
            
            #define TAINT_PROPRIETARY_MODULE    (1<<0)
@@@@@@@@@@@@@ -216,7 -212,6 -213,6 -212,6 -212,6 -212,6 -212,6 -212,6 -212,6 -212,6 -212,6 -212,6 +217,7 @@@@@@@@@@@@@ extern void dump_stack(void)
                ((unsigned char *)&addr)[1], \
                ((unsigned char *)&addr)[2], \
                ((unsigned char *)&addr)[3]
 +++++++++++#define NIPQUAD_FMT "%u.%u.%u.%u"
            
            #define NIP6(addr) \
                ntohs((addr).s6_addr16[0]), \
                ntohs((addr).s6_addr16[5]), \
                ntohs((addr).s6_addr16[6]), \
                ntohs((addr).s6_addr16[7])
 +++++++++++#define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x"
 +++++++++++#define NIP6_SEQFMT "%04x%04x%04x%04x%04x%04x%04x%04x"
            
            #if defined(__LITTLE_ENDIAN)
            #define HIPQUAD(addr) \
                1; \
            })
            
 +++++++++++/*
 +++++++++++ * Check at compile time that 'function' is a certain type, or is a pointer
 +++++++++++ * to that type (needs to use typedef for the function type.)
 +++++++++++ */
 +++++++++++#define typecheck_fn(type,function) \
 +++++++++++({  typeof(type) __tmp = function; \
 +++++++++++    (void)__tmp; \
 +++++++++++})
 +++++++++++
            #endif /* __KERNEL__ */
            
            #define SI_LOAD_SHIFT       16
@@@@@@@@@@@@@ -332,6 -316,8 -317,8 -316,8 -316,8 -316,8 -316,8 -316,8 -316,8 -316,8 -316,8 -316,8 +333,6 @@@@@@@@@@@@@ extern int randomize_va_space
            #endif
            
            /* Trap pasters of __FUNCTION__ at compile-time */
 -----------#if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
            #define __FUNCTION__ (__func__)
 -----------#endif
            
            #endif
diff --combined kernel/power/disk.c
index e24446f8d8cde234357837f7bbf9b740b3a88b34,e24446f8d8cde234357837f7bbf9b740b3a88b34,f2cd279d07c79c8b9ee0988490887e3eb85416a4,027322a564f48ac2c79c08ab9240a5db7b42751f,027322a564f48ac2c79c08ab9240a5db7b42751f,027322a564f48ac2c79c08ab9240a5db7b42751f,027322a564f48ac2c79c08ab9240a5db7b42751f,027322a564f48ac2c79c08ab9240a5db7b42751f,e24446f8d8cde234357837f7bbf9b740b3a88b34,027322a564f48ac2c79c08ab9240a5db7b42751f,e24446f8d8cde234357837f7bbf9b740b3a88b34,e24446f8d8cde234357837f7bbf9b740b3a88b34..e03d85e55291c89632d02d3f6880e584e810ab1e
            
            extern suspend_disk_method_t pm_disk_mode;
            
  ++++++ +  extern int swsusp_shrink_memory(void);
            extern int swsusp_suspend(void);
  ------ -  extern int swsusp_write(void);
  ++++++ +  extern int swsusp_write(struct pbe *pblist, unsigned int nr_pages);
            extern int swsusp_check(void);
  ------ -  extern int swsusp_read(void);
  ++++++ +  extern int swsusp_read(struct pbe **pblist_ptr);
            extern void swsusp_close(void);
            extern int swsusp_resume(void);
            
@@@@@@@@@@@@@ -53,7 -53,7 -52,7 -52,7 -52,7 -52,7 -52,7 -52,7 -53,7 -52,7 -53,7 -53,7 +53,7 @@@@@@@@@@@@@ static void power_down(suspend_disk_met
            
                switch(mode) {
                case PM_DISK_PLATFORM:
-- ---------            kernel_power_off_prepare();
++ +++++++++            kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
                        error = pm_ops->enter(PM_SUSPEND_DISK);
                        break;
                case PM_DISK_SHUTDOWN:
            static int in_suspend __nosavedata = 0;
            
            
  ------ -  /**
  ------ -   *  free_some_memory -  Try to free as much memory as possible
  ------ -   *
  ------ -   *  ... but do not OOM-kill anyone
  ------ -   *
  ------ -   *  Notice: all userland should be stopped at this point, or
  ------ -   *  livelock is possible.
  ------ -   */
  ------ -  
  ------ -  static void free_some_memory(void)
  ------ -  {
  ------ -      unsigned int i = 0;
  ------ -      unsigned int tmp;
  ------ -      unsigned long pages = 0;
  ------ -      char *p = "-\\|/";
  ------ -  
  ------ -      printk("Freeing memory...  ");
  ------ -      while ((tmp = shrink_all_memory(10000))) {
  ------ -              pages += tmp;
  ------ -              printk("\b%c", p[i++ % 4]);
  ------ -      }
  ------ -      printk("\bdone (%li pages freed)\n", pages);
  ------ -  }
  ------ -  
  ------ -  
            static inline void platform_finish(void)
            {
                if (pm_disk_mode == PM_DISK_PLATFORM) {
@@@@@@@@@@@@@ -95,16 -95,16 -119,9 -119,16 -119,16 -119,16 -119,16 -119,16 -95,16 -119,16 -95,16 -95,16 +95,9 @@@@@@@@@@@@@ static int prepare_processes(void
                        goto thaw;
                }
            
-- ---------    if (pm_disk_mode == PM_DISK_PLATFORM) {
-- ---------            if (pm_ops && pm_ops->prepare) {
-- ---------                    if ((error = pm_ops->prepare(PM_SUSPEND_DISK)))
-- ---------                            goto thaw;
-- ---------            }
-- ---------    }
-- ---------
                /* Free memory before shutting down devices. */
  ------ -      free_some_memory();
  ------ -      return 0;
  ++++++ +      if (!(error = swsusp_shrink_memory()))
  ++++++ +              return 0;
            thaw:
                thaw_processes();
                enable_nonboot_cpus();
@@@@@@@@@@@@@ -152,7 -152,7 -169,7 -176,7 -176,7 -176,7 -176,7 -176,7 -152,7 -176,7 -152,7 -152,7 +145,7 @@@@@@@@@@@@@ int pm_suspend_disk(void
                if (in_suspend) {
                        device_resume();
                        pr_debug("PM: writing image.\n");
  ------ -              error = swsusp_write();
  ++++++ +              error = swsusp_write(pagedir_nosave, nr_copy_pages);
                        if (!error)
                                power_down(pm_disk_mode);
                        else {
@@@@@@@@@@@@@ -223,7 -223,7 -240,7 -247,7 -247,7 -247,7 -247,7 -247,7 -223,7 -247,7 -223,7 -223,7 +216,7 @@@@@@@@@@@@@ static int software_resume(void
            
                pr_debug("PM: Reading swsusp image.\n");
            
  ------ -      if ((error = swsusp_read())) {
  ++++++ +      if ((error = swsusp_read(&pagedir_nosave))) {
                        swsusp_free();
                        goto Thaw;
                }
@@@@@@@@@@@@@ -339,55 -339,55 -356,37 -363,37 -363,37 -363,37 -363,37 -363,37 -339,55 -363,37 -339,55 -339,55 +332,55 @@@@@@@@@@@@@ static ssize_t resume_show(struct subsy
                               MINOR(swsusp_resume_device));
            }
            
  ------ -  static ssize_t resume_store(struct subsystem * subsys, const char * buf, size_t n)
  ++++++ +  static ssize_t resume_store(struct subsystem *subsys, const char *buf, size_t n)
            {
  ------ -      int len;
  ------ -      char *p;
                unsigned int maj, min;
  ------ -      int error = -EINVAL;
                dev_t res;
  ++++++ +      int ret = -EINVAL;
            
  ------ -      p = memchr(buf, '\n', n);
  ------ -      len = p ? p - buf : n;
  ++++++ +      if (sscanf(buf, "%u:%u", &maj, &min) != 2)
  ++++++ +              goto out;
            
  ------ -      if (sscanf(buf, "%u:%u", &maj, &min) == 2) {
  ------ -              res = MKDEV(maj,min);
  ------ -              if (maj == MAJOR(res) && min == MINOR(res)) {
  ------ -                      down(&pm_sem);
  ------ -                      swsusp_resume_device = res;
  ------ -                      up(&pm_sem);
  ------ -                      printk("Attempting manual resume\n");
  ------ -                      noresume = 0;
  ------ -                      software_resume();
  ------ -              }
  ------ -      }
  ++++++ +      res = MKDEV(maj,min);
  ++++++ +      if (maj != MAJOR(res) || min != MINOR(res))
  ++++++ +              goto out;
            
  ------ -      return error >= 0 ? n : error;
  ++++++ +      down(&pm_sem);
  ++++++ +      swsusp_resume_device = res;
  ++++++ +      up(&pm_sem);
  ++++++ +      printk("Attempting manual resume\n");
  ++++++ +      noresume = 0;
  ++++++ +      software_resume();
  ++++++ +      ret = n;
  ++++++ +  out:
  ++++++ +      return ret;
            }
            
            power_attr(resume);
            
  ++++++ +  static ssize_t image_size_show(struct subsystem * subsys, char *buf)
  ++++++ +  {
  ++++++ +      return sprintf(buf, "%u\n", image_size);
  ++++++ +  }
  ++++++ +  
  ++++++ +  static ssize_t image_size_store(struct subsystem * subsys, const char * buf, size_t n)
  ++++++ +  {
  ++++++ +      unsigned int size;
  ++++++ +  
  ++++++ +      if (sscanf(buf, "%u", &size) == 1) {
  ++++++ +              image_size = size;
  ++++++ +              return n;
  ++++++ +      }
  ++++++ +  
  ++++++ +      return -EINVAL;
  ++++++ +  }
  ++++++ +  
  ++++++ +  power_attr(image_size);
  ++++++ +  
            static struct attribute * g[] = {
                &disk_attr.attr,
                &resume_attr.attr,
  ++++++ +      &image_size_attr.attr,
                NULL,
            };
            
diff --combined kernel/sys.c
index d09cac23fdfd6460daa501f6f549e69f762f2391,eecf84526afeca15c7e82894c5c3e898239fa062,c3b1874661fa54bf4850f29e361e9059833bc82c,bce933ebb29f458908806101dae497332004b2e2,eecf84526afeca15c7e82894c5c3e898239fa062,bce933ebb29f458908806101dae497332004b2e2,bce933ebb29f458908806101dae497332004b2e2,bce933ebb29f458908806101dae497332004b2e2,eecf84526afeca15c7e82894c5c3e898239fa062,eecf84526afeca15c7e82894c5c3e898239fa062,eecf84526afeca15c7e82894c5c3e898239fa062,eecf84526afeca15c7e82894c5c3e898239fa062..0929c698affce76e1d48e52ca456b6c82298f928
            #include <linux/kernel.h>
            #include <linux/kexec.h>
            #include <linux/workqueue.h>
 +++++++++++#include <linux/capability.h>
            #include <linux/device.h>
            #include <linux/key.h>
            #include <linux/times.h>
            
            #include <linux/compat.h>
            #include <linux/syscalls.h>
   + +++    #include <linux/kprobes.h>
            
            #include <asm/uaccess.h>
            #include <asm/io.h>
@@@@@@@@@@@@@ -170,7 -169,7 -169,7 -168,7 -169,7 -168,7 -168,7 -168,7 -169,7 -169,7 -169,7 -169,7 +170,7 @@@@@@@@@@@@@ EXPORT_SYMBOL(notifier_chain_unregister
             *  of the last notifier function called.
             */
             
   - ---    int notifier_call_chain(struct notifier_block **n, unsigned long val, void *v)
   + +++    int __kprobes notifier_call_chain(struct notifier_block **n, unsigned long val, void *v)
            {
                int ret=NOTIFY_DONE;
                struct notifier_block *nb = *n;
@@@@@@@@@@@@@ -224,18 -223,6 -223,6 -222,6 -223,6 -222,6 -222,6 -222,6 -223,6 -223,6 -223,6 -223,6 +224,18 @@@@@@@@@@@@@ int unregister_reboot_notifier(struct n
            
            EXPORT_SYMBOL(unregister_reboot_notifier);
            
 +++++++++++#ifndef CONFIG_SECURITY
 +++++++++++int capable(int cap)
 +++++++++++{
 +++++++++++        if (cap_raised(current->cap_effective, cap)) {
 +++++++++++           current->flags |= PF_SUPERPRIV;
 +++++++++++           return 1;
 +++++++++++        }
 +++++++++++        return 0;
 +++++++++++}
 +++++++++++EXPORT_SYMBOL(capable);
 +++++++++++#endif
 +++++++++++
            static int set_one_prio(struct task_struct *p, int niceval, int error)
            {
                int no_nice;
@@@@@@@@@@@@@ -440,23 -427,23 -427,25 -426,23 -427,23 -426,23 -426,23 -426,23 -427,23 -427,23 -427,23 -427,23 +440,25 @@@@@@@@@@@@@ void kernel_kexec(void
            }
            EXPORT_SYMBOL_GPL(kernel_kexec);
            
++ +++++++++void kernel_shutdown_prepare(enum system_states state)
++ +++++++++{
++ +++++++++    notifier_call_chain(&reboot_notifier_list,
++ +++++++++            (state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
++ +++++++++    system_state = state;
++ +++++++++    device_shutdown();
++ +++++++++}
            /**
             *  kernel_halt - halt the system
             *
             *  Shutdown everything and perform a clean system halt.
             */
-- ---------void kernel_halt_prepare(void)
-- ---------{
-- ---------    notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL);
-- ---------    system_state = SYSTEM_HALT;
-- ---------    device_shutdown();
-- ---------}
            void kernel_halt(void)
            {
-- ---------    kernel_halt_prepare();
++ +++++++++    kernel_shutdown_prepare(SYSTEM_HALT);
                printk(KERN_EMERG "System halted.\n");
                machine_halt();
            }
++ +++++++++
            EXPORT_SYMBOL_GPL(kernel_halt);
            
            /**
             *
             *  Shutdown everything and perform a clean system power_off.
             */
-- ---------void kernel_power_off_prepare(void)
-- ---------{
-- ---------    notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL);
-- ---------    system_state = SYSTEM_POWER_OFF;
-- ---------    device_shutdown();
-- ---------}
            void kernel_power_off(void)
            {
-- ---------    kernel_power_off_prepare();
++ +++++++++    kernel_shutdown_prepare(SYSTEM_POWER_OFF);
                printk(KERN_EMERG "Power down.\n");
                machine_power_off();
            }
            EXPORT_SYMBOL_GPL(kernel_power_off);
-- ---------
            /*
             * Reboot system call: for obvious reasons only root may call it,
             * and even root needs to set up some magic numbers in the registers
@@@@@@@@@@@@@ -502,12 -489,6 -484,6 -488,6 -489,6 -488,6 -488,6 -488,6 -489,6 -489,6 -489,6 -489,6 +497,12 @@@@@@@@@@@@@ asmlinkage long sys_reboot(int magic1, 
                                magic2 != LINUX_REBOOT_MAGIC2C))
                        return -EINVAL;
            
 +++++++++++    /* Instead of trying to make the power_off code look like
 +++++++++++     * halt when pm_power_off is not set do it the easy way.
 +++++++++++     */
 +++++++++++    if ((cmd == LINUX_REBOOT_CMD_POWER_OFF) && !pm_power_off)
 +++++++++++            cmd = LINUX_REBOOT_CMD_HALT;
 +++++++++++
                lock_kernel();
                switch (cmd) {
                case LINUX_REBOOT_CMD_RESTART:
@@@@@@@@@@@@@ -1103,11 -1084,10 -1079,10 -1083,10 -1084,10 -1083,10 -1083,10 -1083,10 -1084,10 -1084,10 -1084,10 -1084,10 +1098,11 @@@@@@@@@@@@@ asmlinkage long sys_times(struct tms __
            asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
            {
                struct task_struct *p;
 +++++++++++    struct task_struct *group_leader = current->group_leader;
                int err = -EINVAL;
            
                if (!pid)
 -----------            pid = current->pid;
 +++++++++++            pid = group_leader->pid;
                if (!pgid)
                        pgid = pid;
                if (pgid < 0)
                if (!thread_group_leader(p))
                        goto out;
            
 -----------    if (p->parent == current || p->real_parent == current) {
 +++++++++++    if (p->real_parent == group_leader) {
                        err = -EPERM;
 -----------            if (p->signal->session != current->signal->session)
 +++++++++++            if (p->signal->session != group_leader->signal->session)
                                goto out;
                        err = -EACCES;
                        if (p->did_exec)
                                goto out;
                } else {
                        err = -ESRCH;
 -----------            if (p != current)
 +++++++++++            if (p != group_leader)
                                goto out;
                }
            
                        struct task_struct *p;
            
                        do_each_task_pid(pgid, PIDTYPE_PGID, p) {
 -----------                    if (p->signal->session == current->signal->session)
 +++++++++++                    if (p->signal->session == group_leader->signal->session)
                                        goto ok_pgid;
                        } while_each_task_pid(pgid, PIDTYPE_PGID, p);
                        goto out;
@@@@@@@@@@@@@ -1228,22 -1208,24 -1203,24 -1207,24 -1208,24 -1207,24 -1207,24 -1207,24 -1208,24 -1208,24 -1208,24 -1208,24 +1223,22 @@@@@@@@@@@@@ asmlinkage long sys_getsid(pid_t pid
            
            asmlinkage long sys_setsid(void)
            {
 +++++++++++    struct task_struct *group_leader = current->group_leader;
                struct pid *pid;
                int err = -EPERM;
            
 -----------    if (!thread_group_leader(current))
 -----------            return -EINVAL;
 -----------
                down(&tty_sem);
                write_lock_irq(&tasklist_lock);
            
 -----------    pid = find_pid(PIDTYPE_PGID, current->pid);
 +++++++++++    pid = find_pid(PIDTYPE_PGID, group_leader->pid);
                if (pid)
                        goto out;
            
 -----------    current->signal->leader = 1;
 -----------    __set_special_pids(current->pid, current->pid);
 -----------    current->signal->tty = NULL;
 -----------    current->signal->tty_old_pgrp = 0;
 -----------    err = process_group(current);
 +++++++++++    group_leader->signal->leader = 1;
 +++++++++++    __set_special_pids(group_leader->pid, group_leader->pid);
 +++++++++++    group_leader->signal->tty = NULL;
 +++++++++++    group_leader->signal->tty_old_pgrp = 0;
 +++++++++++    err = process_group(group_leader);
            out:
                write_unlock_irq(&tasklist_lock);
                up(&tty_sem);
@@@@@@@@@@@@@ -1705,10 -1687,7 -1682,7 -1686,7 -1687,7 -1686,7 -1686,7 -1686,7 -1687,7 -1687,7 -1687,7 -1687,7 +1700,10 @@@@@@@@@@@@@ static void k_getrusage(struct task_str
                if (unlikely(!p->signal))
                        return;
            
 +++++++++++    utime = stime = cputime_zero;
 +++++++++++
                switch (who) {
 +++++++++++            case RUSAGE_BOTH:
                        case RUSAGE_CHILDREN:
                                spin_lock_irqsave(&p->sighand->siglock, flags);
                                utime = p->signal->cutime;
                                r->ru_minflt = p->signal->cmin_flt;
                                r->ru_majflt = p->signal->cmaj_flt;
                                spin_unlock_irqrestore(&p->sighand->siglock, flags);
 -----------                    cputime_to_timeval(utime, &r->ru_utime);
 -----------                    cputime_to_timeval(stime, &r->ru_stime);
 -----------                    break;
 +++++++++++
 +++++++++++                    if (who == RUSAGE_CHILDREN)
 +++++++++++                            break;
 +++++++++++
                        case RUSAGE_SELF:
 -----------                    spin_lock_irqsave(&p->sighand->siglock, flags);
 -----------                    utime = stime = cputime_zero;
 -----------                    goto sum_group;
 -----------            case RUSAGE_BOTH:
 -----------                    spin_lock_irqsave(&p->sighand->siglock, flags);
 -----------                    utime = p->signal->cutime;
 -----------                    stime = p->signal->cstime;
 -----------                    r->ru_nvcsw = p->signal->cnvcsw;
 -----------                    r->ru_nivcsw = p->signal->cnivcsw;
 -----------                    r->ru_minflt = p->signal->cmin_flt;
 -----------                    r->ru_majflt = p->signal->cmaj_flt;
 -----------            sum_group:
                                utime = cputime_add(utime, p->signal->utime);
                                stime = cputime_add(stime, p->signal->stime);
                                r->ru_nvcsw += p->signal->nvcsw;
                                        r->ru_majflt += t->maj_flt;
                                        t = next_thread(t);
                                } while (t != p);
 -----------                    spin_unlock_irqrestore(&p->sighand->siglock, flags);
 -----------                    cputime_to_timeval(utime, &r->ru_utime);
 -----------                    cputime_to_timeval(stime, &r->ru_stime);
                                break;
 +++++++++++
                        default:
                                BUG();
                }
 +++++++++++
 +++++++++++    cputime_to_timeval(utime, &r->ru_utime);
 +++++++++++    cputime_to_timeval(stime, &r->ru_stime);
            }
            
            int getrusage(struct task_struct *p, int who, struct rusage __user *ru)