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.
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;
* 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);
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;
#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");
}
------ -----/*
------ ----- * 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;
}
#include <asm/processor.h>
#include <asm/cpufeature.h>
-----------#include "speedstep-est-common.h"
-----------
#define PFX "speedstep-centrino: "
#define MAINTAINER "Jeremy Fitzhardinge <jeremy@goop.org>"
*/
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");
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;
}
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;
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;
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.
*/
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);
*/
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:
#include <asm/proto.h>
#include <asm/mach_apic.h>
#include <asm/acpi.h>
+++++++++++#include <asm/dma.h>
#define __apicdebuginit __init
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);
/*
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
/*
* 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
* 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);
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);
}
/*
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)
*/
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();
}
-------- ---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);
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
config ACPI_EC
bool
----- ------ depends on X86
default y
help
This driver is required on some systems for the proper operation of
#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,
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);
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);
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 ?
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);
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;
}
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))
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;
}
__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);
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
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
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;
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);
}
{
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);
}
{
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;
* _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);
}
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;
}
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) {
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);
}
}
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,
}
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},
{},
};
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;
}
}
-- 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?
* ----------
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;
{
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 */
{
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);
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;
}
/* 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
}
}
------ ----- acpi_processor_power_init_pdc(&(pr->power), pr->id);
------ ----- acpi_processor_set_pdc(pr, pr->power.pdc);
acpi_processor_get_power_info(pr);
/*
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,
"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;
}
.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,
}
/* --------------------------------------------------------------------------
------ - 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);
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.
*/
}
/**
----------- * 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.
*/
}
/**
----------- * 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
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.
*/
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.
*/
* ----
* 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);
*
* TBD: Assumes LDM provides driver hot-plug capability.
*/
- --- result = acpi_bus_find_driver(device);
+ +++ acpi_bus_find_driver(device);
end:
if (!result)
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 */
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 */
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 {
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)
/* 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 */
/* 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
#define default_console_loglevel (console_printk[3])
struct completion;
+++++++++++struct pt_regs;
+++++++++++struct user;
/**
* might_sleep - annotation for functions that can sleep
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)));
SYSTEM_HALT,
SYSTEM_POWER_OFF,
SYSTEM_RESTART,
++ +++++++++ SYSTEM_SUSPEND_DISK,
} system_state;
#define TAINT_PROPRIETARY_MODULE (1<<0)
((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
#endif
/* Trap pasters of __FUNCTION__ at compile-time */
-----------#if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
#define __FUNCTION__ (__func__)
-----------#endif
#endif
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);
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) {
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();
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 {
pr_debug("PM: Reading swsusp image.\n");
------ - if ((error = swsusp_read())) {
++++++ + if ((error = swsusp_read(&pagedir_nosave))) {
swsusp_free();
goto Thaw;
}
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,
};
#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>
* 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;
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;
}
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
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:
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;
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);
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)