Commit 42bca133 authored by Len Brown's avatar Len Brown

merge

parents 31a37910 7977cad2
This diff is collapsed.
...@@ -960,6 +960,11 @@ running once the system is up. ...@@ -960,6 +960,11 @@ running once the system is up.
(param: profile step/bucket size as a power of 2 for (param: profile step/bucket size as a power of 2 for
statistical time based profiling) statistical time based profiling)
processor.c2= [HW, ACPI]
processor.c3= [HW, ACPI]
0 - disable C2 or C3 idle power saving state.
1 - enable C2 or C3 (default unless DMI blacklist entry)
prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk
before loading. before loading.
See Documentation/ramdisk.txt. See Documentation/ramdisk.txt.
......
This driver implement the ACPI Extensions For Display Adapters
for integrated graphics devices on motherboard, as specified in
ACPI 2.0 Specification, Appendix B, allowing to perform some basic
control like defining the video POST device, retrieving EDID information
or to setup a video output, etc. Note that this is an ref. implementation only.
It may or may not work for your integrated video device.
Interfaces exposed to userland through /proc/acpi/video:
VGA/info : display the supported video bus device capability like ,Video ROM, CRT/LCD/TV.
VGA/ROM : Used to get a copy of the display devices' ROM data (up to 4k).
VGA/POST_info : Used to determine what options are implemented.
VGA/POST : Used to get/set POST device.
VGA/DOS : Used to get/set ownership of output switching:
Please refer ACPI spec B.4.1 _DOS
VGA/CRT : CRT output
VGA/LCD : LCD output
VGA/TV : TV output
VGA/*/brightness : Used to get/set brightness of output device
Notify event through /proc/acpi/event:
#define ACPI_VIDEO_NOTIFY_SWITCH 0x80
#define ACPI_VIDEO_NOTIFY_PROBE 0x81
#define ACPI_VIDEO_NOTIFY_CYCLE 0x82
#define ACPI_VIDEO_NOTIFY_NEXT_OUTPUT 0x83
#define ACPI_VIDEO_NOTIFY_PREV_OUTPUT 0x84
#define ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS 0x82
#define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x83
#define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x84
#define ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS 0x85
#define ACPI_VIDEO_NOTIFY_DISPLAY_OFF 0x86
...@@ -456,17 +456,11 @@ unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low) ...@@ -456,17 +456,11 @@ unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
* Make sure all (legacy) PCI IRQs are set as level-triggered. * Make sure all (legacy) PCI IRQs are set as level-triggered.
*/ */
if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) { if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
static u16 irq_mask;
extern void eisa_set_level_irq(unsigned int irq); extern void eisa_set_level_irq(unsigned int irq);
if (edge_level == ACPI_LEVEL_SENSITIVE) { if (edge_level == ACPI_LEVEL_SENSITIVE)
if ((gsi < 16) && !((1 << gsi) & irq_mask)) {
Dprintk(KERN_DEBUG PREFIX "Setting GSI %u as level-triggered\n", gsi);
irq_mask |= (1 << gsi);
eisa_set_level_irq(gsi); eisa_set_level_irq(gsi);
} }
}
}
#endif #endif
#ifdef CONFIG_X86_IO_APIC #ifdef CONFIG_X86_IO_APIC
......
...@@ -514,13 +514,27 @@ static struct { ...@@ -514,13 +514,27 @@ static struct {
unsigned int apic_thmr; unsigned int apic_thmr;
} apic_pm_state; } apic_pm_state;
static int lapic_suspend(struct sys_device *dev, u32 state) static int lapic_shutdown(struct sys_device *dev)
{ {
unsigned long flags; unsigned long flags;
if (!apic_pm_state.active) if (!apic_pm_state.active)
return 0; return 0;
local_irq_save(flags);
disable_local_APIC();
local_irq_restore(flags);
return 0;
}
static int lapic_suspend(struct sys_device *dev, u32 state)
{
if (!apic_pm_state.active)
return 0;
apic_pm_state.apic_id = apic_read(APIC_ID); apic_pm_state.apic_id = apic_read(APIC_ID);
apic_pm_state.apic_taskpri = apic_read(APIC_TASKPRI); apic_pm_state.apic_taskpri = apic_read(APIC_TASKPRI);
apic_pm_state.apic_ldr = apic_read(APIC_LDR); apic_pm_state.apic_ldr = apic_read(APIC_LDR);
...@@ -535,10 +549,7 @@ static int lapic_suspend(struct sys_device *dev, u32 state) ...@@ -535,10 +549,7 @@ static int lapic_suspend(struct sys_device *dev, u32 state)
apic_pm_state.apic_tdcr = apic_read(APIC_TDCR); apic_pm_state.apic_tdcr = apic_read(APIC_TDCR);
apic_pm_state.apic_thmr = apic_read(APIC_LVTTHMR); apic_pm_state.apic_thmr = apic_read(APIC_LVTTHMR);
local_irq_save(flags); return lapic_shutdown(dev);
disable_local_APIC();
local_irq_restore(flags);
return 0;
} }
static int lapic_resume(struct sys_device *dev) static int lapic_resume(struct sys_device *dev)
...@@ -587,6 +598,7 @@ static int lapic_resume(struct sys_device *dev) ...@@ -587,6 +598,7 @@ static int lapic_resume(struct sys_device *dev)
static struct sysdev_class lapic_sysclass = { static struct sysdev_class lapic_sysclass = {
set_kset_name("lapic"), set_kset_name("lapic"),
.shutdown = lapic_shutdown,
.resume = lapic_resume, .resume = lapic_resume,
.suspend = lapic_suspend, .suspend = lapic_suspend,
}; };
......
...@@ -308,21 +308,6 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={ ...@@ -308,21 +308,6 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"), MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"),
NO_MATCH, NO_MATCH }}, NO_MATCH, NO_MATCH }},
{ force_acpi_ht, "Compaq ProLiant DL380 G2", {
MATCH(DMI_SYS_VENDOR, "Compaq"),
MATCH(DMI_PRODUCT_NAME, "ProLiant DL380 G2"),
NO_MATCH, NO_MATCH }},
{ force_acpi_ht, "Compaq ProLiant ML530 G2", {
MATCH(DMI_SYS_VENDOR, "Compaq"),
MATCH(DMI_PRODUCT_NAME, "ProLiant ML530 G2"),
NO_MATCH, NO_MATCH }},
{ force_acpi_ht, "Compaq ProLiant ML350 G3", {
MATCH(DMI_SYS_VENDOR, "Compaq"),
MATCH(DMI_PRODUCT_NAME, "ProLiant ML350 G3"),
NO_MATCH, NO_MATCH }},
{ force_acpi_ht, "Compaq Workstation W8000", { { force_acpi_ht, "Compaq Workstation W8000", {
MATCH(DMI_SYS_VENDOR, "Compaq"), MATCH(DMI_SYS_VENDOR, "Compaq"),
MATCH(DMI_PRODUCT_NAME, "Workstation W8000"), MATCH(DMI_PRODUCT_NAME, "Workstation W8000"),
......
...@@ -1069,8 +1069,11 @@ static int pin_2_irq(int idx, int apic, int pin) ...@@ -1069,8 +1069,11 @@ static int pin_2_irq(int idx, int apic, int pin)
while (i < apic) while (i < apic)
irq += nr_ioapic_registers[i++]; irq += nr_ioapic_registers[i++];
irq += pin; irq += pin;
if ((!apic) && (irq < 16)) /*
irq += 16; * For MPS mode, so far only used by ES7000 platform
*/
if (platform_rename_gsi)
irq = platform_rename_gsi(apic, irq);
break; break;
} }
default: default:
......
...@@ -808,6 +808,7 @@ void __init find_smp_config (void) ...@@ -808,6 +808,7 @@ void __init find_smp_config (void)
smp_scan_config(address, 0x400); smp_scan_config(address, 0x400);
} }
int (*platform_rename_gsi)(int ioapic, int gsi);
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
ACPI-based MP Configuration ACPI-based MP Configuration
...@@ -996,6 +997,12 @@ void __init mp_config_acpi_legacy_irqs (void) ...@@ -996,6 +997,12 @@ void __init mp_config_acpi_legacy_irqs (void)
mp_bus_id_to_type[MP_ISA_BUS] = MP_BUS_ISA; mp_bus_id_to_type[MP_ISA_BUS] = MP_BUS_ISA;
Dprintk("Bus #%d is ISA\n", MP_ISA_BUS); Dprintk("Bus #%d is ISA\n", MP_ISA_BUS);
/*
* ES7000 has no legacy identity mappings
*/
if (es7000_plat)
return;
/* /*
* Locate the IOAPIC that manages the ISA IRQs (0-15). * Locate the IOAPIC that manages the ISA IRQs (0-15).
*/ */
...@@ -1049,8 +1056,6 @@ void __init mp_config_acpi_legacy_irqs (void) ...@@ -1049,8 +1056,6 @@ void __init mp_config_acpi_legacy_irqs (void)
} }
} }
int (*platform_rename_gsi)(int ioapic, int gsi);
void mp_register_gsi (u32 gsi, int edge_level, int active_high_low) void mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
{ {
int ioapic = -1; int ioapic = -1;
......
...@@ -57,6 +57,9 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); ...@@ -57,6 +57,9 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
int hlt_counter; int hlt_counter;
unsigned long boot_option_idle_override = 0;
EXPORT_SYMBOL(boot_option_idle_override);
/* /*
* Return saved PC of a blocked thread. * Return saved PC of a blocked thread.
*/ */
...@@ -214,6 +217,7 @@ static int __init idle_setup (char *str) ...@@ -214,6 +217,7 @@ static int __init idle_setup (char *str)
pm_idle = default_idle; pm_idle = default_idle;
} }
boot_option_idle_override = 1;
return 1; return 1;
} }
......
...@@ -52,72 +52,27 @@ int mip_port; ...@@ -52,72 +52,27 @@ int mip_port;
unsigned long mip_addr, host_addr; unsigned long mip_addr, host_addr;
#if defined(CONFIG_X86_IO_APIC) && (defined(CONFIG_ACPI_INTERPRETER) || defined(CONFIG_ACPI_BOOT)) #if defined(CONFIG_X86_IO_APIC) && (defined(CONFIG_ACPI_INTERPRETER) || defined(CONFIG_ACPI_BOOT))
static unsigned long cycle_irqs = 0;
static unsigned long free_irqs = 0;
static int gsi_map[MAX_GSI_MAPSIZE] = { [0 ... MAX_GSI_MAPSIZE-1] = -1 };
/* /*
* GSI override for ES7000 platforms. * GSI override for ES7000 platforms.
*/ */
static int __init static unsigned int base;
es7000_gsi_override(int ioapic, int gsi)
{
static int newgsi = 0;
if (gsi_map[gsi] != -1)
gsi = gsi_map[gsi];
else if (cycle_irqs ^ free_irqs) {
newgsi = find_next_bit(&cycle_irqs, IOAPIC_GSI_BOUND(0), newgsi);
__set_bit(newgsi, &free_irqs);
gsi_map[gsi] = newgsi;
gsi = newgsi;
newgsi++;
Dprintk("es7000_gsi_override: free_irqs = 0x%lx\n", free_irqs);
}
return gsi;
}
static int __init static int
es7000_rename_gsi(int ioapic, int gsi) es7000_rename_gsi(int ioapic, int gsi)
{ {
static int initialized = 0; if (!base) {
int i; int i;
for (i = 0; i < nr_ioapics; i++)
/* base += nr_ioapic_registers[i];
* These should NEVER be true at this point but we'd rather be
* safe than sorry.
*/
if (acpi_disabled || acpi_pci_disabled || acpi_noirq)
return gsi;
if (ioapic)
return gsi;
if (!initialized) {
unsigned long tmp_irqs = 0;
for (i = 0; i < nr_ioapic_registers[0]; i++)
__set_bit(mp_irqs[i].mpc_srcbusirq, &tmp_irqs);
cycle_irqs = (~tmp_irqs & io_apic_irqs & ((1 << IOAPIC_GSI_BOUND(0)) - 1));
initialized = 1;
Dprintk("es7000_rename_gsi: cycle_irqs = 0x%lx\n", cycle_irqs);
}
for (i = 0; i < nr_ioapic_registers[0]; i++) {
if (mp_irqs[i].mpc_srcbusirq == gsi) {
if (mp_irqs[i].mpc_dstirq == gsi)
return gsi;
else
return es7000_gsi_override(0, gsi);
}
} }
if (!ioapic && (gsi < 16))
gsi += base;
return gsi; return gsi;
} }
#endif // (CONFIG_X86_IO_APIC) && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT) #endif // (CONFIG_X86_IO_APIC) && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT)
/* /*
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/io_apic.h> #include <asm/io_apic.h>
#include <asm/hw_irq.h> #include <asm/hw_irq.h>
#include <linux/acpi.h>
#include "pci.h" #include "pci.h"
...@@ -127,8 +128,15 @@ void eisa_set_level_irq(unsigned int irq) ...@@ -127,8 +128,15 @@ void eisa_set_level_irq(unsigned int irq)
{ {
unsigned char mask = 1 << (irq & 7); unsigned char mask = 1 << (irq & 7);
unsigned int port = 0x4d0 + (irq >> 3); unsigned int port = 0x4d0 + (irq >> 3);
unsigned char val = inb(port); unsigned char val;
static u16 eisa_irq_mask;
if (irq >= 16 || (1 << irq) & eisa_irq_mask)
return;
eisa_irq_mask |= (1 << irq);
printk("PCI: setting IRQ %u as level-triggered\n", irq);
val = inb(port);
if (!(val & mask)) { if (!(val & mask)) {
DBG(" -> edge"); DBG(" -> edge");
outb(val | mask, port); outb(val | mask, port);
...@@ -989,15 +997,26 @@ static int __init pcibios_irq_init(void) ...@@ -989,15 +997,26 @@ static int __init pcibios_irq_init(void)
subsys_initcall(pcibios_irq_init); subsys_initcall(pcibios_irq_init);
void pcibios_penalize_isa_irq(int irq) static void pirq_penalize_isa_irq(int irq)
{ {
/* /*
* If any ISAPnP device reports an IRQ in its list of possible * If any ISAPnP device reports an IRQ in its list of possible
* IRQ's, we try to avoid assigning it to PCI devices. * IRQ's, we try to avoid assigning it to PCI devices.
*/ */
if (irq < 16)
pirq_penalty[irq] += 100; pirq_penalty[irq] += 100;
} }
void pcibios_penalize_isa_irq(int irq)
{
#ifdef CONFIG_ACPI_PCI
if (!acpi_noirq)
acpi_penalize_isa_irq(irq);
else
#endif
pirq_penalize_isa_irq(irq);
}
int pirq_enable_irq(struct pci_dev *dev) int pirq_enable_irq(struct pci_dev *dev)
{ {
u8 pin; u8 pin;
......
...@@ -47,6 +47,8 @@ ...@@ -47,6 +47,8 @@
void (*ia64_mark_idle)(int); void (*ia64_mark_idle)(int);
unsigned long boot_option_idle_override = 0;
EXPORT_SYMBOL(boot_option_idle_override);
void void
ia64_do_show_stack (struct unw_frame_info *info, void *arg) ia64_do_show_stack (struct unw_frame_info *info, void *arg)
......
...@@ -54,6 +54,9 @@ unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED; ...@@ -54,6 +54,9 @@ unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED;
atomic_t hlt_counter = ATOMIC_INIT(0); atomic_t hlt_counter = ATOMIC_INIT(0);
unsigned long boot_option_idle_override = 0;
EXPORT_SYMBOL(boot_option_idle_override);
/* /*
* Powermanagement idle function, if any.. * Powermanagement idle function, if any..
*/ */
...@@ -196,6 +199,7 @@ static int __init idle_setup (char *str) ...@@ -196,6 +199,7 @@ static int __init idle_setup (char *str)
pm_idle = poll_idle; pm_idle = poll_idle;
} }
boot_option_idle_override = 1;
return 1; return 1;
} }
......
...@@ -110,6 +110,21 @@ config ACPI_BUTTON ...@@ -110,6 +110,21 @@ config ACPI_BUTTON
down the system. Until then, you can cat it, and see output when down the system. Until then, you can cat it, and see output when
a button is pressed. a button is pressed.
config ACPI_VIDEO
tristate "Video"
depends on ACPI_INTERPRETER
depends on EXPERIMENTAL
depends on !IA64_SGI_SN
default m
help
This driver implement the ACPI Extensions For Display Adapters
for integrated graphics devices on motherboard, as specified in
ACPI 2.0 Specification, Appendix B, allowing to perform some basic
control like defining the video POST device, retrieving EDID information
or to setup a video output, etc.
Note that this is an ref. implementation only. It may or may not work
for your integrated video device.
config ACPI_FAN config ACPI_FAN
tristate "Fan" tristate "Fan"
depends on ACPI_INTERPRETER depends on ACPI_INTERPRETER
...@@ -176,6 +191,20 @@ config ACPI_ASUS ...@@ -176,6 +191,20 @@ config ACPI_ASUS
something works not quite as expected, please use the mailing list something works not quite as expected, please use the mailing list
available on the above page (acpi4asus-user@lists.sourceforge.net) available on the above page (acpi4asus-user@lists.sourceforge.net)
config ACPI_IBM
tristate "IBM ThinkPad Laptop Extras"
depends on X86
depends on ACPI_INTERPRETER
default m
---help---
This is a Linux ACPI driver for the IBM ThinkPad laptops. It adds
support for Fn-Fx key combinations, Bluetooth control, video
output switching, ThinkLight control, UltraBay eject and more.
For more information about this driver see Documentation/ibm-acpi.txt
and http://ibm-acpi.sf.net/ .
If you have an IBM ThinkPad laptop, say Y or M here.
config ACPI_TOSHIBA config ACPI_TOSHIBA
tristate "Toshiba Laptop Extras" tristate "Toshiba Laptop Extras"
depends on X86 depends on X86
...@@ -206,7 +235,7 @@ config ACPI_TOSHIBA ...@@ -206,7 +235,7 @@ config ACPI_TOSHIBA
config ACPI_CUSTOM_DSDT config ACPI_CUSTOM_DSDT
bool "Include Custom DSDT" bool "Include Custom DSDT"
depends on X86 && ACPI_INTERPRETER && !STANDALONE depends on ACPI_INTERPRETER && !STANDALONE
default n default n
help help
Thist option is to load a custom ACPI DSDT Thist option is to load a custom ACPI DSDT
......
...@@ -38,6 +38,7 @@ obj-$(CONFIG_ACPI_BATTERY) += battery.o ...@@ -38,6 +38,7 @@ obj-$(CONFIG_ACPI_BATTERY) += battery.o
obj-$(CONFIG_ACPI_BUTTON) += button.o obj-$(CONFIG_ACPI_BUTTON) += button.o
obj-$(CONFIG_ACPI_EC) += ec.o obj-$(CONFIG_ACPI_EC) += ec.o
obj-$(CONFIG_ACPI_FAN) += fan.o obj-$(CONFIG_ACPI_FAN) += fan.o
obj-$(CONFIG_ACPI_VIDEO) += video.o
obj-$(CONFIG_ACPI_PCI) += pci_root.o pci_link.o pci_irq.o pci_bind.o obj-$(CONFIG_ACPI_PCI) += pci_root.o pci_link.o pci_irq.o pci_bind.o
obj-$(CONFIG_ACPI_POWER) += power.o obj-$(CONFIG_ACPI_POWER) += power.o
obj-$(CONFIG_ACPI_PROCESSOR) += processor.o obj-$(CONFIG_ACPI_PROCESSOR) += processor.o
...@@ -46,5 +47,6 @@ obj-$(CONFIG_ACPI_SYSTEM) += system.o event.o ...@@ -46,5 +47,6 @@ obj-$(CONFIG_ACPI_SYSTEM) += system.o event.o
obj-$(CONFIG_ACPI_DEBUG) += debug.o obj-$(CONFIG_ACPI_DEBUG) += debug.o
obj-$(CONFIG_ACPI_NUMA) += numa.o obj-$(CONFIG_ACPI_NUMA) += numa.o
obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o
obj-$(CONFIG_ACPI_IBM) += ibm_acpi.o
obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o
obj-$(CONFIG_ACPI_BUS) += scan.o motherboard.o obj-$(CONFIG_ACPI_BUS) += scan.o motherboard.o
...@@ -117,11 +117,11 @@ int acpi_ac_seq_show(struct seq_file *seq, void *offset) ...@@ -117,11 +117,11 @@ int acpi_ac_seq_show(struct seq_file *seq, void *offset)
ACPI_FUNCTION_TRACE("acpi_ac_seq_show"); ACPI_FUNCTION_TRACE("acpi_ac_seq_show");
if (!ac) if (!ac)
return 0; return_VALUE(0);
if (acpi_ac_get_state(ac)) { if (acpi_ac_get_state(ac)) {
seq_puts(seq, "ERROR: Unable to read AC Adapter state\n"); seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
return 0; return_VALUE(0);
} }
seq_puts(seq, "state: "); seq_puts(seq, "state: ");
...@@ -137,7 +137,7 @@ int acpi_ac_seq_show(struct seq_file *seq, void *offset) ...@@ -137,7 +137,7 @@ int acpi_ac_seq_show(struct seq_file *seq, void *offset)
break; break;
} }
return 0; return_VALUE(0);
} }
static int acpi_ac_open_fs(struct inode *inode, struct file *file) static int acpi_ac_open_fs(struct inode *inode, struct file *file)
...@@ -212,7 +212,7 @@ acpi_ac_notify ( ...@@ -212,7 +212,7 @@ acpi_ac_notify (
ACPI_FUNCTION_TRACE("acpi_ac_notify"); ACPI_FUNCTION_TRACE("acpi_ac_notify");
if (!ac) if (!ac)
return; return_VOID;
if (acpi_bus_get_device(ac->handle, &device)) if (acpi_bus_get_device(ac->handle, &device))
return_VOID; return_VOID;
......
...@@ -332,7 +332,7 @@ acpi_bus_receive_event ( ...@@ -332,7 +332,7 @@ acpi_bus_receive_event (
ACPI_FUNCTION_TRACE("acpi_bus_receive_event"); ACPI_FUNCTION_TRACE("acpi_bus_receive_event");
if (!event) if (!event)
return -EINVAL; return_VALUE(-EINVAL);
if (list_empty(&acpi_bus_event_list)) { if (list_empty(&acpi_bus_event_list)) {
...@@ -599,7 +599,7 @@ acpi_early_init (void) ...@@ -599,7 +599,7 @@ acpi_early_init (void)
ACPI_FUNCTION_TRACE("acpi_early_init"); ACPI_FUNCTION_TRACE("acpi_early_init");
if (acpi_disabled) if (acpi_disabled)
return; return_VOID;
/* enable workarounds, unless strict ACPI spec. compliance */ /* enable workarounds, unless strict ACPI spec. compliance */
if (!acpi_strict) if (!acpi_strict)
...@@ -652,11 +652,11 @@ acpi_early_init (void) ...@@ -652,11 +652,11 @@ acpi_early_init (void)
goto error0; goto error0;
} }
return; return_VOID;
error0: error0:
disable_acpi(); disable_acpi();
return; return_VOID;
} }
static int __init static int __init
...@@ -743,7 +743,7 @@ static int __init acpi_init (void) ...@@ -743,7 +743,7 @@ static int __init acpi_init (void)
if (acpi_disabled) { if (acpi_disabled) {
printk(KERN_INFO PREFIX "Interpreter disabled.\n"); printk(KERN_INFO PREFIX "Interpreter disabled.\n");
return -ENODEV; return_VALUE(-ENODEV);
} }
firmware_register(&acpi_subsys); firmware_register(&acpi_subsys);
......
...@@ -116,12 +116,12 @@ static int acpi_button_info_seq_show(struct seq_file *seq, void *offset) ...@@ -116,12 +116,12 @@ static int acpi_button_info_seq_show(struct seq_file *seq, void *offset)
ACPI_FUNCTION_TRACE("acpi_button_info_seq_show"); ACPI_FUNCTION_TRACE("acpi_button_info_seq_show");
if (!button || !button->device) if (!button || !button->device)
return 0; return_VALUE(0);
seq_printf(seq, "type: %s\n", seq_printf(seq, "type: %s\n",
acpi_device_name(button->device)); acpi_device_name(button->device));
return 0; return_VALUE(0);
} }
static int acpi_button_info_open_fs(struct inode *inode, struct file *file) static int acpi_button_info_open_fs(struct inode *inode, struct file *file)
...@@ -138,7 +138,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) ...@@ -138,7 +138,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
ACPI_FUNCTION_TRACE("acpi_button_state_seq_show"); ACPI_FUNCTION_TRACE("acpi_button_state_seq_show");
if (!button || !button->device) if (!button || !button->device)
return 0; return_VALUE(0);
status = acpi_evaluate_integer(button->handle,"_LID",NULL,&state); status = acpi_evaluate_integer(button->handle,"_LID",NULL,&state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
...@@ -148,7 +148,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) ...@@ -148,7 +148,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
seq_printf(seq, "state: %s\n", (state ? "open" : "closed")); seq_printf(seq, "state: %s\n", (state ? "open" : "closed"));
} }
return 0; return_VALUE(0);
} }
static int acpi_button_state_open_fs(struct inode *inode, struct file *file) static int acpi_button_state_open_fs(struct inode *inode, struct file *file)
......
...@@ -312,7 +312,7 @@ acpi_ds_method_data_set_value ( ...@@ -312,7 +312,7 @@ acpi_ds_method_data_set_value (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"obj %p op %X, ref count = %d [%s]\n", object, "new_obj %p Opcode %X, Refs=%d [%s]\n", object,
opcode, object->common.reference_count, opcode, object->common.reference_count,
acpi_ut_get_type_name (object->common.type))); acpi_ut_get_type_name (object->common.type)));
...@@ -448,7 +448,22 @@ acpi_ds_method_data_get_value ( ...@@ -448,7 +448,22 @@ acpi_ds_method_data_get_value (
* was referenced by the method (via the ASL) * was referenced by the method (via the ASL)
* before it was initialized. Either case is an error. * before it was initialized. Either case is an error.
*/ */
switch (opcode) {
/* If slack enabled, init the local_x/arg_x to an Integer of value zero */
if (acpi_gbl_enable_interpreter_slack) {
object = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
if (!object) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
object->integer.value = 0;
node->object = object;
}
/* Otherwise, return the error */
else switch (opcode) {
case AML_ARG_OP: case AML_ARG_OP:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Arg[%d] at node %p\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Arg[%d] at node %p\n",
...@@ -572,7 +587,7 @@ acpi_ds_store_object_to_local ( ...@@ -572,7 +587,7 @@ acpi_ds_store_object_to_local (
ACPI_FUNCTION_TRACE ("ds_store_object_to_local"); ACPI_FUNCTION_TRACE ("ds_store_object_to_local");
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%d Idx=%d Obj=%p\n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%X Index=%d Obj=%p\n",
opcode, index, obj_desc)); opcode, index, obj_desc));
/* Parameter validation */ /* Parameter validation */
......
...@@ -333,7 +333,7 @@ acpi_ds_clear_operands ( ...@@ -333,7 +333,7 @@ acpi_ds_clear_operands (
u32 i; u32 i;
ACPI_FUNCTION_TRACE_PTR ("acpi_ds_clear_operands", walk_state); ACPI_FUNCTION_TRACE_PTR ("ds_clear_operands", walk_state);
/* /*
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
* Dispatch table for opcode classes * Dispatch table for opcode classes
*/ */
static ACPI_EXECUTE_OP acpi_gbl_op_type_dispatch [] = { static ACPI_EXECUTE_OP acpi_gbl_op_type_dispatch [] = {
acpi_ex_opcode_0A_0T_1R,
acpi_ex_opcode_1A_0T_0R, acpi_ex_opcode_1A_0T_0R,
acpi_ex_opcode_1A_0T_1R, acpi_ex_opcode_1A_0T_1R,
acpi_ex_opcode_1A_1T_0R, acpi_ex_opcode_1A_1T_0R,
...@@ -413,7 +414,7 @@ acpi_ds_exec_end_op ( ...@@ -413,7 +414,7 @@ acpi_ds_exec_end_op (
* routine. There is one routine per opcode "type" based upon the * routine. There is one routine per opcode "type" based upon the
* number of opcode arguments and return type. * number of opcode arguments and return type.
*/ */
status = acpi_gbl_op_type_dispatch [op_type] (walk_state); status = acpi_gbl_op_type_dispatch[op_type] (walk_state);
} }
else { else {
/* /*
...@@ -425,7 +426,9 @@ acpi_ds_exec_end_op ( ...@@ -425,7 +426,9 @@ acpi_ds_exec_end_op (
(walk_state->operands[0]->common.type == ACPI_TYPE_LOCAL_REFERENCE) && (walk_state->operands[0]->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
(walk_state->operands[1]->common.type == ACPI_TYPE_LOCAL_REFERENCE) && (walk_state->operands[1]->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
(walk_state->operands[0]->reference.opcode == (walk_state->operands[0]->reference.opcode ==
walk_state->operands[1]->reference.opcode)) { walk_state->operands[1]->reference.opcode) &&
(walk_state->operands[0]->reference.offset ==
walk_state->operands[1]->reference.offset)) {
status = AE_OK; status = AE_OK;
} }
else { else {
...@@ -639,7 +642,8 @@ acpi_ds_exec_end_op ( ...@@ -639,7 +642,8 @@ acpi_ds_exec_end_op (
* conditional predicate * conditional predicate
*/ */
if ((walk_state->control_state) && if ((ACPI_SUCCESS (status)) &&
(walk_state->control_state) &&
(walk_state->control_state->common.state == (walk_state->control_state->common.state ==
ACPI_CONTROL_PREDICATE_EXECUTING) && ACPI_CONTROL_PREDICATE_EXECUTING) &&
(walk_state->control_state->control.predicate_op == op)) { (walk_state->control_state->control.predicate_op == op)) {
...@@ -649,6 +653,19 @@ acpi_ds_exec_end_op ( ...@@ -649,6 +653,19 @@ acpi_ds_exec_end_op (
cleanup: cleanup:
/* Invoke exception handler on error */
if (ACPI_FAILURE (status) &&
acpi_gbl_exception_handler &&
!(status & AE_CODE_CONTROL)) {
acpi_ex_exit_interpreter ();
status = acpi_gbl_exception_handler (status,
walk_state->method_node->name.integer, walk_state->opcode,
walk_state->aml_offset, NULL);
acpi_ex_enter_interpreter ();
}
if (walk_state->result_obj) { if (walk_state->result_obj) {
/* Break to debugger to display result */ /* Break to debugger to display result */
......
...@@ -182,18 +182,20 @@ acpi_ds_load1_begin_op ( ...@@ -182,18 +182,20 @@ acpi_ds_load1_begin_op (
*/ */
status = acpi_ns_lookup (walk_state->scope_info, path, object_type, status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node)); ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
if (ACPI_FAILURE (status)) {
#ifdef _ACPI_ASL_COMPILER #ifdef _ACPI_ASL_COMPILER
if (status == AE_NOT_FOUND) { if (status == AE_NOT_FOUND) {
/*
* Table disassembly:
* Target of Scope() not found. Generate an External for it, and
* insert the name into the namespace.
*/
acpi_dm_add_to_external_list (path); acpi_dm_add_to_external_list (path);
status = AE_OK; status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
} ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
else {
ACPI_REPORT_NSERROR (path, status);
} }
#else
ACPI_REPORT_NSERROR (path, status);
#endif #endif
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (path, status);
return (status); return (status);
} }
......
...@@ -867,6 +867,7 @@ acpi_ds_create_walk_state ( ...@@ -867,6 +867,7 @@ acpi_ds_create_walk_state (
status = acpi_ds_result_stack_push (walk_state); status = acpi_ds_result_stack_push (walk_state);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
acpi_ut_release_to_cache (ACPI_MEM_LIST_WALK, walk_state);
return_PTR (NULL); return_PTR (NULL);
} }
......
...@@ -434,13 +434,8 @@ acpi_ev_gpe_detect ( ...@@ -434,13 +434,8 @@ acpi_ev_gpe_detect (
} }
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
"GPE pair: Status %8.8X%8.8X = %02X, Enable %8.8X%8.8X = %02X\n", "Read GPE Register at GPE%X: Status=%02X, Enable=%02X\n",
ACPI_FORMAT_UINT64 ( gpe_register_info->base_gpe_number, status_reg, enable_reg));
gpe_register_info->status_address.address),
status_reg,
ACPI_FORMAT_UINT64 (
gpe_register_info->enable_address.address),
enable_reg));
/* First check if there is anything active at all in this register */ /* First check if there is anything active at all in this register */
......
...@@ -970,16 +970,14 @@ acpi_ev_create_gpe_block ( ...@@ -970,16 +970,14 @@ acpi_ev_create_gpe_block (
/* Dump info about this GPE block */ /* Dump info about this GPE block */
ACPI_DEBUG_PRINT ((ACPI_DB_INIT, ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
"GPE %02X to %02X [%4.4s] %u regs at %8.8X%8.8X on int 0x%X\n", "GPE %02X to %02X [%4.4s] %u regs on int 0x%X\n",
(u32) gpe_block->block_base_number, (u32) gpe_block->block_base_number,
(u32) (gpe_block->block_base_number + (u32) (gpe_block->block_base_number +
((gpe_block->register_count * ACPI_GPE_REGISTER_WIDTH) -1)), ((gpe_block->register_count * ACPI_GPE_REGISTER_WIDTH) -1)),
gpe_device->name.ascii, gpe_device->name.ascii,
gpe_block->register_count, gpe_block->register_count,
ACPI_FORMAT_UINT64 (gpe_block->block_address.address),
interrupt_level)); interrupt_level));
/* Enable all valid GPEs found above */ /* Enable all valid GPEs found above */
status = acpi_hw_enable_runtime_gpe_block (NULL, gpe_block); status = acpi_hw_enable_runtime_gpe_block (NULL, gpe_block);
......
...@@ -51,6 +51,51 @@ ...@@ -51,6 +51,51 @@
ACPI_MODULE_NAME ("evxface") ACPI_MODULE_NAME ("evxface")
/*******************************************************************************
*
* FUNCTION: acpi_install_exception_handler
*
* PARAMETERS: Handler - Pointer to the handler function for the
* event
*
* RETURN: Status
*
* DESCRIPTION: Saves the pointer to the handler function
*
******************************************************************************/
acpi_status
acpi_install_exception_handler (
acpi_exception_handler handler)
{
acpi_status status;
ACPI_FUNCTION_TRACE ("acpi_install_exception_handler");
status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Don't allow two handlers. */
if (acpi_gbl_exception_handler) {
status = AE_ALREADY_EXISTS;
goto cleanup;
}
/* Install the handler */
acpi_gbl_exception_handler = handler;
cleanup:
(void) acpi_ut_release_mutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (status);
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_install_fixed_event_handler * FUNCTION: acpi_install_fixed_event_handler
......
This diff is collapsed.
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
/* /*
* The following routines are used for debug output only * The following routines are used for debug output only
*/ */
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/***************************************************************************** /*****************************************************************************
...@@ -64,7 +63,7 @@ ...@@ -64,7 +63,7 @@
* *
* PARAMETERS: *obj_desc - Pointer to entry to be dumped * PARAMETERS: *obj_desc - Pointer to entry to be dumped
* *
* RETURN: Status * RETURN: None
* *
* DESCRIPTION: Dump an operand object * DESCRIPTION: Dump an operand object
* *
...@@ -72,12 +71,11 @@ ...@@ -72,12 +71,11 @@
void void
acpi_ex_dump_operand ( acpi_ex_dump_operand (
union acpi_operand_object *obj_desc) union acpi_operand_object *obj_desc,
u32 depth)
{ {
u8 *buf = NULL;
u32 length; u32 length;
union acpi_operand_object **element; u32 index;
u16 element_index;
ACPI_FUNCTION_NAME ("ex_dump_operand") ACPI_FUNCTION_NAME ("ex_dump_operand")
...@@ -89,9 +87,9 @@ acpi_ex_dump_operand ( ...@@ -89,9 +87,9 @@ acpi_ex_dump_operand (
if (!obj_desc) { if (!obj_desc) {
/* /*
* This usually indicates that something serious is wrong * This could be a null element of a package
*/ */
acpi_os_printf ("Null Object Descriptor\n"); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n"));
return; return;
} }
...@@ -111,7 +109,11 @@ acpi_ex_dump_operand ( ...@@ -111,7 +109,11 @@ acpi_ex_dump_operand (
/* obj_desc is a valid object */ /* obj_desc is a valid object */
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc)); if (depth > 0) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "%*s[%u] ", depth, " ", depth));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "%p ", obj_desc));
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
case ACPI_TYPE_LOCAL_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
...@@ -125,8 +127,8 @@ acpi_ex_dump_operand ( ...@@ -125,8 +127,8 @@ acpi_ex_dump_operand (
case AML_NAME_OP: case AML_NAME_OP:
ACPI_DUMP_PATHNAME (obj_desc->reference.object, "Reference: Name: ", ACPI_DUMP_PATHNAME (obj_desc->reference.object,
ACPI_LV_INFO, _COMPONENT); "Reference: Name: ", ACPI_LV_INFO, _COMPONENT);
ACPI_DUMP_ENTRY (obj_desc->reference.object, ACPI_LV_INFO); ACPI_DUMP_ENTRY (obj_desc->reference.object, ACPI_LV_INFO);
break; break;
...@@ -194,18 +196,15 @@ acpi_ex_dump_operand ( ...@@ -194,18 +196,15 @@ acpi_ex_dump_operand (
break; break;
} }
break; break;
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
acpi_os_printf ("Buffer len %X @ %p \n", acpi_os_printf ("Buffer len %X @ %p \n",
obj_desc->buffer.length, obj_desc->buffer.length, obj_desc->buffer.pointer);
obj_desc->buffer.pointer);
length = obj_desc->buffer.length; length = obj_desc->buffer.length;
if (length > 64) { if (length > 64) {
length = 64; length = 64;
} }
...@@ -215,12 +214,11 @@ acpi_ex_dump_operand ( ...@@ -215,12 +214,11 @@ acpi_ex_dump_operand (
if (obj_desc->buffer.pointer) { if (obj_desc->buffer.pointer) {
acpi_os_printf ("Buffer Contents: "); acpi_os_printf ("Buffer Contents: ");
for (buf = obj_desc->buffer.pointer; length--; ++buf) { for (index = 0; index < length; index++) {
acpi_os_printf (" %02x", *buf); acpi_os_printf (" %02x", obj_desc->buffer.pointer[index]);
} }
acpi_os_printf ("\n"); acpi_os_printf ("\n");
} }
break; break;
...@@ -233,23 +231,20 @@ acpi_ex_dump_operand ( ...@@ -233,23 +231,20 @@ acpi_ex_dump_operand (
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
acpi_os_printf ("Package count %X @ %p\n", acpi_os_printf ("Package [Len %X] element_array %p\n",
obj_desc->package.count, obj_desc->package.elements); obj_desc->package.count, obj_desc->package.elements);
/* /*
* If elements exist, package vector pointer is valid, * If elements exist, package element pointer is valid,
* and debug_level exceeds 1, dump package's elements. * and debug_level exceeds 1, dump package's elements.
*/ */
if (obj_desc->package.count && if (obj_desc->package.count &&
obj_desc->package.elements && obj_desc->package.elements &&
acpi_dbg_level > 1) { acpi_dbg_level > 1) {
for (element_index = 0, element = obj_desc->package.elements; for (index = 0; index < obj_desc->package.count; index++) {
element_index < obj_desc->package.count; acpi_ex_dump_operand (obj_desc->package.elements[index], depth+1);
++element_index, ++element) {
acpi_ex_dump_operand (*element);
} }
} }
acpi_os_printf ("\n");
break; break;
...@@ -297,7 +292,7 @@ acpi_ex_dump_operand ( ...@@ -297,7 +292,7 @@ acpi_ex_dump_operand (
obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK, obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK,
obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK, obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK,
obj_desc->field.base_byte_offset, obj_desc->field.start_field_bit_offset); obj_desc->field.base_byte_offset, obj_desc->field.start_field_bit_offset);
ACPI_DUMP_STACK_ENTRY (obj_desc->field.region_obj); acpi_ex_dump_operand (obj_desc->field.region_obj, depth+1);
break; break;
...@@ -321,9 +316,8 @@ acpi_ex_dump_operand ( ...@@ -321,9 +316,8 @@ acpi_ex_dump_operand (
acpi_os_printf ("*not a Buffer* \n"); acpi_os_printf ("*not a Buffer* \n");
} }
else { else {
ACPI_DUMP_STACK_ENTRY (obj_desc->buffer_field.buffer_obj); acpi_ex_dump_operand (obj_desc->buffer_field.buffer_obj, depth+1);
} }
break; break;
...@@ -387,10 +381,13 @@ acpi_ex_dump_operand ( ...@@ -387,10 +381,13 @@ acpi_ex_dump_operand (
* *
* FUNCTION: acpi_ex_dump_operands * FUNCTION: acpi_ex_dump_operands
* *
* PARAMETERS: interpreter_mode - Load or Exec * PARAMETERS: Operands - Operand list
* *Ident - Identification * interpreter_mode - Load or Exec
* Ident - Identification
* num_levels - # of stack entries to dump above line * num_levels - # of stack entries to dump above line
* *Note - Output notation * Note - Output notation
* module_name - Caller's module name
* line_number - Caller's invocation line number
* *
* DESCRIPTION: Dump the object stack * DESCRIPTION: Dump the object stack
* *
...@@ -407,7 +404,6 @@ acpi_ex_dump_operands ( ...@@ -407,7 +404,6 @@ acpi_ex_dump_operands (
u32 line_number) u32 line_number)
{ {
acpi_native_uint i; acpi_native_uint i;
union acpi_operand_object **obj_desc;
ACPI_FUNCTION_NAME ("ex_dump_operands"); ACPI_FUNCTION_NAME ("ex_dump_operands");
...@@ -432,8 +428,7 @@ acpi_ex_dump_operands ( ...@@ -432,8 +428,7 @@ acpi_ex_dump_operands (
/* Dump the operand stack starting at the top */ /* Dump the operand stack starting at the top */
for (i = 0; num_levels > 0; i--, num_levels--) { for (i = 0; num_levels > 0; i--, num_levels--) {
obj_desc = &operands[i]; acpi_ex_dump_operand (operands[i], 0);
acpi_ex_dump_operand (*obj_desc);
} }
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
...@@ -489,8 +484,7 @@ acpi_ex_out_address ( ...@@ -489,8 +484,7 @@ acpi_ex_out_address (
#if ACPI_MACHINE_WIDTH == 16 #if ACPI_MACHINE_WIDTH == 16
acpi_os_printf ("%20s : %p\n", title, value); acpi_os_printf ("%20s : %p\n", title, value);
#else #else
acpi_os_printf ("%20s : %8.8X%8.8X\n", title, acpi_os_printf ("%20s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64 (value));
ACPI_FORMAT_UINT64 (value));
#endif #endif
} }
...@@ -563,13 +557,16 @@ acpi_ex_dump_object_descriptor ( ...@@ -563,13 +557,16 @@ acpi_ex_dump_object_descriptor (
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) { if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) {
acpi_ex_dump_node ((struct acpi_namespace_node *) obj_desc, flags); acpi_ex_dump_node ((struct acpi_namespace_node *) obj_desc, flags);
acpi_os_printf ("\nAttached Object (%p):\n", ((struct acpi_namespace_node *) obj_desc)->object); acpi_os_printf ("\nAttached Object (%p):\n",
acpi_ex_dump_object_descriptor (((struct acpi_namespace_node *) obj_desc)->object, flags); ((struct acpi_namespace_node *) obj_desc)->object);
return; acpi_ex_dump_object_descriptor (
((struct acpi_namespace_node *) obj_desc)->object, flags);
return_VOID;
} }
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) { if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
acpi_os_printf ("ex_dump_object_descriptor: %p is not an ACPI operand object: [%s]\n", acpi_os_printf (
"ex_dump_object_descriptor: %p is not an ACPI operand object: [%s]\n",
obj_desc, acpi_ut_get_descriptor_name (obj_desc)); obj_desc, acpi_ut_get_descriptor_name (obj_desc));
return_VOID; return_VOID;
} }
...@@ -621,7 +618,8 @@ acpi_ex_dump_object_descriptor ( ...@@ -621,7 +618,8 @@ acpi_ex_dump_object_descriptor (
for (i = 0; i < obj_desc->package.count; i++) { for (i = 0; i < obj_desc->package.count; i++) {
acpi_os_printf ("[%.3d] %p", i, obj_desc->package.elements[i]); acpi_os_printf ("[%.3d] %p", i, obj_desc->package.elements[i]);
if (obj_desc->package.elements[i]) { if (obj_desc->package.elements[i]) {
acpi_os_printf (" %s", acpi_ut_get_object_type_name (obj_desc->package.elements[i])); acpi_os_printf (" %s",
acpi_ut_get_object_type_name (obj_desc->package.elements[i]));
} }
acpi_os_printf ("\n"); acpi_os_printf ("\n");
} }
...@@ -658,7 +656,7 @@ acpi_ex_dump_object_descriptor ( ...@@ -658,7 +656,7 @@ acpi_ex_dump_object_descriptor (
acpi_ex_out_integer ("sync_level", obj_desc->mutex.sync_level); acpi_ex_out_integer ("sync_level", obj_desc->mutex.sync_level);
acpi_ex_out_pointer ("owner_thread", obj_desc->mutex.owner_thread); acpi_ex_out_pointer ("owner_thread", obj_desc->mutex.owner_thread);
acpi_ex_out_integer ("acquisition_depth",obj_desc->mutex.acquisition_depth); acpi_ex_out_integer ("acquire_depth", obj_desc->mutex.acquisition_depth);
acpi_ex_out_pointer ("Semaphore", obj_desc->mutex.semaphore); acpi_ex_out_pointer ("Semaphore", obj_desc->mutex.semaphore);
break; break;
...@@ -708,13 +706,13 @@ acpi_ex_dump_object_descriptor ( ...@@ -708,13 +706,13 @@ acpi_ex_dump_object_descriptor (
case ACPI_TYPE_LOCAL_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_ex_out_integer ("field_flags", obj_desc->common_field.field_flags); acpi_ex_out_integer ("field_flags", obj_desc->common_field.field_flags);
acpi_ex_out_integer ("access_byte_width", obj_desc->common_field.access_byte_width); acpi_ex_out_integer ("access_byte_width",obj_desc->common_field.access_byte_width);
acpi_ex_out_integer ("bit_length", obj_desc->common_field.bit_length); acpi_ex_out_integer ("bit_length", obj_desc->common_field.bit_length);
acpi_ex_out_integer ("fld_bit_offset", obj_desc->common_field.start_field_bit_offset); acpi_ex_out_integer ("fld_bit_offset", obj_desc->common_field.start_field_bit_offset);
acpi_ex_out_integer ("base_byte_offset", obj_desc->common_field.base_byte_offset); acpi_ex_out_integer ("base_byte_offset", obj_desc->common_field.base_byte_offset);
acpi_ex_out_integer ("datum_valid_bits", obj_desc->common_field.datum_valid_bits); acpi_ex_out_integer ("datum_valid_bits", obj_desc->common_field.datum_valid_bits);
acpi_ex_out_integer ("end_fld_valid_bits", obj_desc->common_field.end_field_valid_bits); acpi_ex_out_integer ("end_fld_valid_bits",obj_desc->common_field.end_field_valid_bits);
acpi_ex_out_integer ("end_buf_valid_bits", obj_desc->common_field.end_buffer_valid_bits); acpi_ex_out_integer ("end_buf_valid_bits",obj_desc->common_field.end_buffer_valid_bits);
acpi_ex_out_pointer ("parent_node", obj_desc->common_field.node); acpi_ex_out_pointer ("parent_node", obj_desc->common_field.node);
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
...@@ -779,7 +777,8 @@ acpi_ex_dump_object_descriptor ( ...@@ -779,7 +777,8 @@ acpi_ex_dump_object_descriptor (
case ACPI_TYPE_LOCAL_DATA: case ACPI_TYPE_LOCAL_DATA:
default: default:
acpi_os_printf ("ex_dump_object_descriptor: Display not implemented for object type %s\n", acpi_os_printf (
"ex_dump_object_descriptor: Display not implemented for object type %s\n",
acpi_ut_get_object_type_name (obj_desc)); acpi_ut_get_object_type_name (obj_desc));
break; break;
} }
......
...@@ -139,7 +139,7 @@ acpi_ex_setup_region ( ...@@ -139,7 +139,7 @@ acpi_ex_setup_region (
if (ACPI_ROUND_UP (rgn_desc->region.length, if (ACPI_ROUND_UP (rgn_desc->region.length,
obj_desc->common_field.access_byte_width) >= obj_desc->common_field.access_byte_width) >=
(obj_desc->common_field.base_byte_offset + (obj_desc->common_field.base_byte_offset +
obj_desc->common_field.access_byte_width + (acpi_native_uint) obj_desc->common_field.access_byte_width +
field_datum_byte_offset)) { field_datum_byte_offset)) {
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -199,7 +199,8 @@ acpi_ex_opcode_2A_2T_1R ( ...@@ -199,7 +199,8 @@ acpi_ex_opcode_2A_2T_1R (
acpi_status status; acpi_status status;
ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_2T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_2T_1R",
acpi_ps_get_opcode_name (walk_state->opcode));
/* /*
...@@ -222,8 +223,10 @@ acpi_ex_opcode_2A_2T_1R ( ...@@ -222,8 +223,10 @@ acpi_ex_opcode_2A_2T_1R (
/* Quotient to return_desc1, remainder to return_desc2 */ /* Quotient to return_desc1, remainder to return_desc2 */
status = acpi_ut_divide (&operand[0]->integer.value, &operand[1]->integer.value, status = acpi_ut_divide (operand[0]->integer.value,
&return_desc1->integer.value, &return_desc2->integer.value); operand[1]->integer.value,
&return_desc1->integer.value,
&return_desc2->integer.value);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
goto cleanup; goto cleanup;
} }
...@@ -292,13 +295,13 @@ acpi_ex_opcode_2A_1T_1R ( ...@@ -292,13 +295,13 @@ acpi_ex_opcode_2A_1T_1R (
{ {
union acpi_operand_object **operand = &walk_state->operands[0]; union acpi_operand_object **operand = &walk_state->operands[0];
union acpi_operand_object *return_desc = NULL; union acpi_operand_object *return_desc = NULL;
union acpi_operand_object *temp_desc = NULL;
u32 index; u32 index;
acpi_status status = AE_OK; acpi_status status = AE_OK;
acpi_size length; acpi_size length;
ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_1T_1R",
acpi_ps_get_opcode_name (walk_state->opcode));
/* /*
...@@ -331,52 +334,17 @@ acpi_ex_opcode_2A_1T_1R ( ...@@ -331,52 +334,17 @@ acpi_ex_opcode_2A_1T_1R (
/* return_desc will contain the remainder */ /* return_desc will contain the remainder */
status = acpi_ut_divide (&operand[0]->integer.value, &operand[1]->integer.value, status = acpi_ut_divide (operand[0]->integer.value,
NULL, &return_desc->integer.value); operand[1]->integer.value,
NULL,
&return_desc->integer.value);
break; break;
case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */ case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
/* status = acpi_ex_do_concatenate (operand[0], operand[1],
* Convert the second operand if necessary. The first operand &return_desc, walk_state);
* determines the type of the second operand, (See the Data Types
* section of the ACPI specification.) Both object types are
* guaranteed to be either Integer/String/Buffer by the operand
* resolution mechanism above.
*/
switch (ACPI_GET_OBJECT_TYPE (operand[0])) {
case ACPI_TYPE_INTEGER:
status = acpi_ex_convert_to_integer (operand[1], &temp_desc, walk_state);
break;
case ACPI_TYPE_STRING:
status = acpi_ex_convert_to_string (operand[1], &temp_desc, 16, ACPI_UINT32_MAX, walk_state);
break;
case ACPI_TYPE_BUFFER:
status = acpi_ex_convert_to_buffer (operand[1], &temp_desc, walk_state);
break;
default:
ACPI_REPORT_ERROR (("Concat - invalid obj type: %X\n",
ACPI_GET_OBJECT_TYPE (operand[0])));
status = AE_AML_INTERNAL;
}
if (ACPI_FAILURE (status)) {
goto cleanup;
}
/*
* Both operands are now known to be the same object type
* (Both are Integer, String, or Buffer), and we can now perform the
* concatenation.
*/
status = acpi_ex_do_concatenate (operand[0], temp_desc, &return_desc, walk_state);
if (temp_desc != operand[1]) {
acpi_ut_remove_reference (temp_desc);
}
break; break;
...@@ -387,55 +355,45 @@ acpi_ex_opcode_2A_1T_1R ( ...@@ -387,55 +355,45 @@ acpi_ex_opcode_2A_1T_1R (
* been converted.) Copy the raw buffer data to a new object of type String. * been converted.) Copy the raw buffer data to a new object of type String.
*/ */
/* Get the length of the new string */ /*
* Get the length of the new string. It is the smallest of:
* 1) Length of the input buffer
* 2) Max length as specified in the to_string operator
* 3) Length of input buffer up to a zero byte (null terminator)
*
* NOTE: A length of zero is ok, and will create a zero-length, null
* terminated string.
*/
length = 0; length = 0;
if (operand[1]->integer.value == 0) {
/* Handle optional length value */
operand[1]->integer.value = ACPI_INTEGER_MAX;
}
while ((length < operand[0]->buffer.length) && while ((length < operand[0]->buffer.length) &&
(length < operand[1]->integer.value) && (length < operand[1]->integer.value) &&
(operand[0]->buffer.pointer[length])) { (operand[0]->buffer.pointer[length])) {
length++; length++;
}
if (length > ACPI_MAX_STRING_CONVERSION) { if (length > ACPI_MAX_STRING_CONVERSION) {
status = AE_AML_STRING_LIMIT; status = AE_AML_STRING_LIMIT;
goto cleanup; goto cleanup;
} }
/* Create the internal return object */
return_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING);
if (!return_desc) {
status = AE_NO_MEMORY;
goto cleanup;
} }
/* Allocate a new string buffer (Length + 1 for null terminator) */ /* Allocate a new string object */
return_desc->string.pointer = ACPI_MEM_CALLOCATE (length + 1); return_desc = acpi_ut_create_string_object (length);
if (!return_desc->string.pointer) { if (!return_desc) {
status = AE_NO_MEMORY; status = AE_NO_MEMORY;
goto cleanup; goto cleanup;
} }
/* Copy the raw buffer data with no transform */ /* Copy the raw buffer data with no transform. NULL terminated already. */
ACPI_MEMCPY (return_desc->string.pointer, operand[0]->buffer.pointer, length);
/* Set the string length */
return_desc->string.length = (u32) length; ACPI_MEMCPY (return_desc->string.pointer,
operand[0]->buffer.pointer, length);
break; break;
case AML_CONCAT_RES_OP: /* concatenate_res_template (Buffer, Buffer, Result) (ACPI 2.0) */ case AML_CONCAT_RES_OP: /* concatenate_res_template (Buffer, Buffer, Result) (ACPI 2.0) */
status = acpi_ex_concat_template (operand[0], operand[1], &return_desc, walk_state); status = acpi_ex_concat_template (operand[0], operand[1],
&return_desc, walk_state);
break; break;
...@@ -458,7 +416,8 @@ acpi_ex_opcode_2A_1T_1R ( ...@@ -458,7 +416,8 @@ acpi_ex_opcode_2A_1T_1R (
/* Object to be indexed is a Package */ /* Object to be indexed is a Package */
if (index >= operand[0]->package.count) { if (index >= operand[0]->package.count) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value (%X) beyond package end (%X)\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Index value (%X) beyond package end (%X)\n",
index, operand[0]->package.count)); index, operand[0]->package.count));
status = AE_AML_PACKAGE_LIMIT; status = AE_AML_PACKAGE_LIMIT;
goto cleanup; goto cleanup;
...@@ -472,7 +431,8 @@ acpi_ex_opcode_2A_1T_1R ( ...@@ -472,7 +431,8 @@ acpi_ex_opcode_2A_1T_1R (
/* Object to be indexed is a Buffer */ /* Object to be indexed is a Buffer */
if (index >= operand[0]->buffer.length) { if (index >= operand[0]->buffer.length) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value (%X) beyond end of buffer (%X)\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Index value (%X) beyond end of buffer (%X)\n",
index, operand[0]->buffer.length)); index, operand[0]->buffer.length));
status = AE_AML_BUFFER_LIMIT; status = AE_AML_BUFFER_LIMIT;
goto cleanup; goto cleanup;
...@@ -558,7 +518,8 @@ acpi_ex_opcode_2A_0T_1R ( ...@@ -558,7 +518,8 @@ acpi_ex_opcode_2A_0T_1R (
u8 logical_result = FALSE; u8 logical_result = FALSE;
ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_0T_1R",
acpi_ps_get_opcode_name (walk_state->opcode));
/* Create the internal return object */ /* Create the internal return object */
...@@ -572,18 +533,15 @@ acpi_ex_opcode_2A_0T_1R ( ...@@ -572,18 +533,15 @@ acpi_ex_opcode_2A_0T_1R (
/* /*
* Execute the Opcode * Execute the Opcode
*/ */
if (walk_state->op_info->flags & AML_LOGICAL) /* logical_op (Operand0, Operand1) */ { if (walk_state->op_info->flags & AML_LOGICAL_NUMERIC) /* logical_op (Operand0, Operand1) */ {
/* Both operands must be of the same type */ status = acpi_ex_do_logical_numeric_op (walk_state->opcode,
operand[0]->integer.value, operand[1]->integer.value,
if (ACPI_GET_OBJECT_TYPE (operand[0]) != &logical_result);
ACPI_GET_OBJECT_TYPE (operand[1])) { goto store_logical_result;
status = AE_AML_OPERAND_TYPE;
goto cleanup;
} }
else if (walk_state->op_info->flags & AML_LOGICAL) /* logical_op (Operand0, Operand1) */ {
logical_result = acpi_ex_do_logical_op (walk_state->opcode, status = acpi_ex_do_logical_op (walk_state->opcode, operand[0],
operand[0], operand[1], &logical_result);
operand[1]);
goto store_logical_result; goto store_logical_result;
} }
......
...@@ -508,6 +508,7 @@ acpi_ex_prep_field_value ( ...@@ -508,6 +508,7 @@ acpi_ex_prep_field_value (
if (!obj_desc->index_field.data_obj || !obj_desc->index_field.index_obj) { if (!obj_desc->index_field.data_obj || !obj_desc->index_field.index_obj) {
ACPI_REPORT_ERROR (("Null Index Object during field prep\n")); ACPI_REPORT_ERROR (("Null Index Object during field prep\n"));
acpi_ut_delete_object_desc (obj_desc);
return_ACPI_STATUS (AE_AML_INTERNAL); return_ACPI_STATUS (AE_AML_INTERNAL);
} }
......
...@@ -121,7 +121,7 @@ acpi_ex_system_memory_space_handler ( ...@@ -121,7 +121,7 @@ acpi_ex_system_memory_space_handler (
* Hardware does not support non-aligned data transfers, we must verify * Hardware does not support non-aligned data transfers, we must verify
* the request. * the request.
*/ */
(void) acpi_ut_short_divide ((acpi_integer *) &address, length, NULL, &remainder); (void) acpi_ut_short_divide ((acpi_integer) address, length, NULL, &remainder);
if (remainder != 0) { if (remainder != 0) {
return_ACPI_STATUS (AE_AML_ALIGNMENT); return_ACPI_STATUS (AE_AML_ALIGNMENT);
} }
......
...@@ -327,11 +327,44 @@ acpi_ex_resolve_multiple ( ...@@ -327,11 +327,44 @@ acpi_ex_resolve_multiple (
union acpi_operand_object *obj_desc = (void *) operand; union acpi_operand_object *obj_desc = (void *) operand;
struct acpi_namespace_node *node; struct acpi_namespace_node *node;
acpi_object_type type; acpi_object_type type;
acpi_status status;
ACPI_FUNCTION_TRACE ("acpi_ex_resolve_multiple"); ACPI_FUNCTION_TRACE ("acpi_ex_resolve_multiple");
/*
* Operand can be either a namespace node or an operand descriptor
*/
switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) {
case ACPI_DESC_TYPE_OPERAND:
type = obj_desc->common.type;
break;
case ACPI_DESC_TYPE_NAMED:
type = ((struct acpi_namespace_node *) obj_desc)->type;
obj_desc = acpi_ns_get_attached_object ((struct acpi_namespace_node *) obj_desc);
/* If we had an Alias node, use the attached object for type info */
if (type == ACPI_TYPE_LOCAL_ALIAS) {
type = ((struct acpi_namespace_node *) obj_desc)->type;
obj_desc = acpi_ns_get_attached_object ((struct acpi_namespace_node *) obj_desc);
}
break;
default:
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
/*
* If type is anything other than a reference, we are done
*/
if (type != ACPI_TYPE_LOCAL_REFERENCE) {
goto exit;
}
/* /*
* For reference objects created via the ref_of or Index operators, * For reference objects created via the ref_of or Index operators,
* we need to get to the base object (as per the ACPI specification * we need to get to the base object (as per the ACPI specification
...@@ -424,6 +457,33 @@ acpi_ex_resolve_multiple ( ...@@ -424,6 +457,33 @@ acpi_ex_resolve_multiple (
break; break;
case AML_LOCAL_OP:
case AML_ARG_OP:
if (return_desc) {
status = acpi_ds_method_data_get_value (obj_desc->reference.opcode,
obj_desc->reference.offset, walk_state, &obj_desc);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
acpi_ut_remove_reference (obj_desc);
}
else {
status = acpi_ds_method_data_get_node (obj_desc->reference.opcode,
obj_desc->reference.offset, walk_state, &node);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
obj_desc = acpi_ns_get_attached_object (node);
if (!obj_desc) {
type = ACPI_TYPE_ANY;
goto exit;
}
}
break;
case AML_DEBUG_OP: case AML_DEBUG_OP:
/* The Debug Object is of type "debug_object" */ /* The Debug Object is of type "debug_object" */
......
...@@ -160,7 +160,7 @@ acpi_ex_resolve_operands ( ...@@ -160,7 +160,7 @@ acpi_ex_resolve_operands (
return_ACPI_STATUS (AE_AML_INTERNAL); return_ACPI_STATUS (AE_AML_INTERNAL);
} }
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode %X [%s] operand_types=%X \n", ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode %X [%s] required_operand_types=%8.8X \n",
opcode, op_info->name, arg_types)); opcode, op_info->name, arg_types));
/* /*
...@@ -227,12 +227,13 @@ acpi_ex_resolve_operands ( ...@@ -227,12 +227,13 @@ acpi_ex_resolve_operands (
case AML_LOAD_OP: /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */ case AML_LOAD_OP: /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */
ACPI_DEBUG_ONLY_MEMBERS (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, ACPI_DEBUG_ONLY_MEMBERS (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Reference Opcode: %s\n", op_info->name))); "Operand is a Reference, ref_opcode [%s]\n",
(acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name)));
break; break;
default: default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Unknown Reference Opcode %X [%s]\n", "Operand is a Reference, Unknown Reference Opcode %X [%s]\n",
obj_desc->reference.opcode, obj_desc->reference.opcode,
(acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name)); (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name));
...@@ -398,7 +399,7 @@ acpi_ex_resolve_operands ( ...@@ -398,7 +399,7 @@ acpi_ex_resolve_operands (
* But we can implicitly convert from a STRING or BUFFER * But we can implicitly convert from a STRING or BUFFER
* Aka - "Implicit Source Operand Conversion" * Aka - "Implicit Source Operand Conversion"
*/ */
status = acpi_ex_convert_to_integer (obj_desc, stack_ptr, walk_state); status = acpi_ex_convert_to_integer (obj_desc, stack_ptr, 16);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
if (status == AE_TYPE) { if (status == AE_TYPE) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
...@@ -420,7 +421,7 @@ acpi_ex_resolve_operands ( ...@@ -420,7 +421,7 @@ acpi_ex_resolve_operands (
* But we can implicitly convert from a STRING or INTEGER * But we can implicitly convert from a STRING or INTEGER
* Aka - "Implicit Source Operand Conversion" * Aka - "Implicit Source Operand Conversion"
*/ */
status = acpi_ex_convert_to_buffer (obj_desc, stack_ptr, walk_state); status = acpi_ex_convert_to_buffer (obj_desc, stack_ptr);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
if (status == AE_TYPE) { if (status == AE_TYPE) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
...@@ -442,7 +443,8 @@ acpi_ex_resolve_operands ( ...@@ -442,7 +443,8 @@ acpi_ex_resolve_operands (
* But we can implicitly convert from a BUFFER or INTEGER * But we can implicitly convert from a BUFFER or INTEGER
* Aka - "Implicit Source Operand Conversion" * Aka - "Implicit Source Operand Conversion"
*/ */
status = acpi_ex_convert_to_string (obj_desc, stack_ptr, 16, ACPI_UINT32_MAX, walk_state); status = acpi_ex_convert_to_string (obj_desc, stack_ptr,
ACPI_IMPLICIT_CONVERT_HEX);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
if (status == AE_TYPE) { if (status == AE_TYPE) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
...@@ -494,7 +496,7 @@ acpi_ex_resolve_operands ( ...@@ -494,7 +496,7 @@ acpi_ex_resolve_operands (
/* Highest priority conversion is to type Buffer */ /* Highest priority conversion is to type Buffer */
status = acpi_ex_convert_to_buffer (obj_desc, stack_ptr, walk_state); status = acpi_ex_convert_to_buffer (obj_desc, stack_ptr);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
......
...@@ -129,7 +129,8 @@ acpi_ex_store ( ...@@ -129,7 +129,8 @@ acpi_ex_store (
/* Destination is not a Reference object */ /* Destination is not a Reference object */
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Destination is not a Reference or Constant object [%p]\n", dest_desc)); "Target is not a Reference or Constant object - %s [%p]\n",
acpi_ut_get_object_type_name (dest_desc), dest_desc));
ACPI_DUMP_STACK_ENTRY (source_desc); ACPI_DUMP_STACK_ENTRY (source_desc);
ACPI_DUMP_STACK_ENTRY (dest_desc); ACPI_DUMP_STACK_ENTRY (dest_desc);
...@@ -182,22 +183,36 @@ acpi_ex_store ( ...@@ -182,22 +183,36 @@ acpi_ex_store (
* Storing to the Debug object causes the value stored to be * Storing to the Debug object causes the value stored to be
* displayed and otherwise has no effect -- see ACPI Specification * displayed and otherwise has no effect -- see ACPI Specification
*/ */
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "**** Write to Debug Object: ****:\n\n")); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"**** Write to Debug Object: Object %p %s ****:\n\n",
source_desc, acpi_ut_get_object_type_name (source_desc)));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %s: ", ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %s: ",
acpi_ut_get_object_type_name (source_desc))); acpi_ut_get_object_type_name (source_desc)));
if (!acpi_ut_valid_internal_object (source_desc)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT,
"%p, Invalid Internal Object!\n", source_desc));
break;
}
switch (ACPI_GET_OBJECT_TYPE (source_desc)) { switch (ACPI_GET_OBJECT_TYPE (source_desc)) {
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
if (acpi_gbl_integer_byte_width == 4) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%8.8X\n",
(u32) source_desc->integer.value));
}
else {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%8.8X%8.8X\n", ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%8.8X%8.8X\n",
ACPI_FORMAT_UINT64 (source_desc->integer.value))); ACPI_FORMAT_UINT64 (source_desc->integer.value)));
}
break; break;
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length 0x%.2X", ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X]",
(u32) source_desc->buffer.length)); (u32) source_desc->buffer.length));
ACPI_DUMP_BUFFER (source_desc->buffer.pointer, ACPI_DUMP_BUFFER (source_desc->buffer.pointer,
(source_desc->buffer.length < 32) ? source_desc->buffer.length : 32); (source_desc->buffer.length < 32) ? source_desc->buffer.length : 32);
...@@ -206,14 +221,14 @@ acpi_ex_store ( ...@@ -206,14 +221,14 @@ acpi_ex_store (
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length 0x%.2X, \"%s\"\n", ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X] \"%s\"\n",
source_desc->string.length, source_desc->string.pointer)); source_desc->string.length, source_desc->string.pointer));
break; break;
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Size 0x%.2X Elements Ptr - %p\n", ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X] Elements Ptr - %p\n",
source_desc->package.count, source_desc->package.elements)); source_desc->package.count, source_desc->package.elements));
break; break;
......
...@@ -167,7 +167,7 @@ acpi_ex_system_do_stall ( ...@@ -167,7 +167,7 @@ acpi_ex_system_do_stall (
acpi_status acpi_status
acpi_ex_system_do_suspend ( acpi_ex_system_do_suspend (
u32 how_long) acpi_integer how_long)
{ {
acpi_status status; acpi_status status;
...@@ -179,8 +179,7 @@ acpi_ex_system_do_suspend ( ...@@ -179,8 +179,7 @@ acpi_ex_system_do_suspend (
acpi_ex_exit_interpreter (); acpi_ex_exit_interpreter ();
acpi_os_sleep ((u16) (how_long / (u32) 1000), acpi_os_sleep (how_long);
(u16) (how_long % (u32) 1000));
/* And now we must get the interpreter again */ /* And now we must get the interpreter again */
......
...@@ -280,25 +280,25 @@ acpi_ex_digits_needed ( ...@@ -280,25 +280,25 @@ acpi_ex_digits_needed (
{ {
u32 num_digits; u32 num_digits;
acpi_integer current_value; acpi_integer current_value;
acpi_integer quotient;
ACPI_FUNCTION_TRACE ("ex_digits_needed"); ACPI_FUNCTION_TRACE ("ex_digits_needed");
/* /* acpi_integer is unsigned, so we don't worry about a '-' prefix */
* acpi_integer is unsigned, so we don't worry about a '-'
*/ if (value == 0) {
if ((current_value = value) == 0) {
return_VALUE (1); return_VALUE (1);
} }
current_value = value;
num_digits = 0; num_digits = 0;
/* Count the digits in the requested base */
while (current_value) { while (current_value) {
(void) acpi_ut_short_divide (&current_value, base, &quotient, NULL); (void) acpi_ut_short_divide (current_value, base, &current_value, NULL);
num_digits++; num_digits++;
current_value = quotient;
} }
return_VALUE (num_digits); return_VALUE (num_digits);
...@@ -361,7 +361,6 @@ acpi_ex_unsigned_integer_to_string ( ...@@ -361,7 +361,6 @@ acpi_ex_unsigned_integer_to_string (
u32 count; u32 count;
u32 digits_needed; u32 digits_needed;
u32 remainder; u32 remainder;
acpi_integer quotient;
ACPI_FUNCTION_ENTRY (); ACPI_FUNCTION_ENTRY ();
...@@ -371,9 +370,8 @@ acpi_ex_unsigned_integer_to_string ( ...@@ -371,9 +370,8 @@ acpi_ex_unsigned_integer_to_string (
out_string[digits_needed] = 0; out_string[digits_needed] = 0;
for (count = digits_needed; count > 0; count--) { for (count = digits_needed; count > 0; count--) {
(void) acpi_ut_short_divide (&value, 10, &quotient, &remainder); (void) acpi_ut_short_divide (value, 10, &value, &remainder);
out_string[count-1] = (char) ('0' + remainder);\ out_string[count-1] = (char) ('0' + remainder);\
value = quotient;
} }
} }
......
...@@ -709,6 +709,7 @@ acpi_hw_low_level_read ( ...@@ -709,6 +709,7 @@ acpi_hw_low_level_read (
u32 *value, u32 *value,
struct acpi_generic_address *reg) struct acpi_generic_address *reg)
{ {
u64 address;
acpi_status status; acpi_status status;
...@@ -720,8 +721,14 @@ acpi_hw_low_level_read ( ...@@ -720,8 +721,14 @@ acpi_hw_low_level_read (
* a non-zero address within. However, don't return an error * a non-zero address within. However, don't return an error
* because the PM1A/B code must not fail if B isn't present. * because the PM1A/B code must not fail if B isn't present.
*/ */
if ((!reg) || if (!reg) {
(!reg->address)) { return (AE_OK);
}
/* Get a local copy of the address. Handles possible alignment issues */
ACPI_MOVE_64_TO_64 (&address, &reg->address);
if (!address) {
return (AE_OK); return (AE_OK);
} }
*value = 0; *value = 0;
...@@ -734,14 +741,14 @@ acpi_hw_low_level_read ( ...@@ -734,14 +741,14 @@ acpi_hw_low_level_read (
case ACPI_ADR_SPACE_SYSTEM_MEMORY: case ACPI_ADR_SPACE_SYSTEM_MEMORY:
status = acpi_os_read_memory ( status = acpi_os_read_memory (
(acpi_physical_address) reg->address, (acpi_physical_address) address,
value, width); value, width);
break; break;
case ACPI_ADR_SPACE_SYSTEM_IO: case ACPI_ADR_SPACE_SYSTEM_IO:
status = acpi_os_read_port ((acpi_io_address) reg->address, status = acpi_os_read_port ((acpi_io_address) address,
value, width); value, width);
break; break;
...@@ -754,7 +761,7 @@ acpi_hw_low_level_read ( ...@@ -754,7 +761,7 @@ acpi_hw_low_level_read (
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n", ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n",
*value, width, *value, width,
ACPI_FORMAT_UINT64 (reg->address), ACPI_FORMAT_UINT64 (address),
acpi_ut_get_region_name (reg->address_space_id))); acpi_ut_get_region_name (reg->address_space_id)));
return (status); return (status);
...@@ -781,6 +788,7 @@ acpi_hw_low_level_write ( ...@@ -781,6 +788,7 @@ acpi_hw_low_level_write (
u32 value, u32 value,
struct acpi_generic_address *reg) struct acpi_generic_address *reg)
{ {
u64 address;
acpi_status status; acpi_status status;
...@@ -792,8 +800,14 @@ acpi_hw_low_level_write ( ...@@ -792,8 +800,14 @@ acpi_hw_low_level_write (
* a non-zero address within. However, don't return an error * a non-zero address within. However, don't return an error
* because the PM1A/B code must not fail if B isn't present. * because the PM1A/B code must not fail if B isn't present.
*/ */
if ((!reg) || if (!reg) {
(!reg->address)) { return (AE_OK);
}
/* Get a local copy of the address. Handles possible alignment issues */
ACPI_MOVE_64_TO_64 (&address, &reg->address);
if (!address) {
return (AE_OK); return (AE_OK);
} }
...@@ -805,14 +819,14 @@ acpi_hw_low_level_write ( ...@@ -805,14 +819,14 @@ acpi_hw_low_level_write (
case ACPI_ADR_SPACE_SYSTEM_MEMORY: case ACPI_ADR_SPACE_SYSTEM_MEMORY:
status = acpi_os_write_memory ( status = acpi_os_write_memory (
(acpi_physical_address) reg->address, (acpi_physical_address) address,
value, width); value, width);
break; break;
case ACPI_ADR_SPACE_SYSTEM_IO: case ACPI_ADR_SPACE_SYSTEM_IO:
status = acpi_os_write_port ((acpi_io_address) reg->address, status = acpi_os_write_port ((acpi_io_address) address,
value, width); value, width);
break; break;
...@@ -825,7 +839,7 @@ acpi_hw_low_level_write ( ...@@ -825,7 +839,7 @@ acpi_hw_low_level_write (
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n", ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n",
value, width, value, width,
ACPI_FORMAT_UINT64 (reg->address), ACPI_FORMAT_UINT64 (address),
acpi_ut_get_region_name (reg->address_space_id))); acpi_ut_get_region_name (reg->address_space_id)));
return (status); return (status);
......
...@@ -149,10 +149,9 @@ acpi_get_timer_duration ( ...@@ -149,10 +149,9 @@ acpi_get_timer_duration (
u32 end_ticks, u32 end_ticks,
u32 *time_elapsed) u32 *time_elapsed)
{ {
u32 delta_ticks = 0;
union uint64_overlay normalized_ticks;
acpi_status status; acpi_status status;
acpi_integer out_quotient; u32 delta_ticks;
acpi_integer quotient;
ACPI_FUNCTION_TRACE ("acpi_get_timer_duration"); ACPI_FUNCTION_TRACE ("acpi_get_timer_duration");
...@@ -164,7 +163,7 @@ acpi_get_timer_duration ( ...@@ -164,7 +163,7 @@ acpi_get_timer_duration (
/* /*
* Compute Tick Delta: * Compute Tick Delta:
* Handle (max one) timer rollovers on 24- versus 32-bit timers. * Handle (max one) timer rollovers on 24-bit versus 32-bit timers.
*/ */
if (start_ticks < end_ticks) { if (start_ticks < end_ticks) {
delta_ticks = end_ticks - start_ticks; delta_ticks = end_ticks - start_ticks;
...@@ -181,22 +180,20 @@ acpi_get_timer_duration ( ...@@ -181,22 +180,20 @@ acpi_get_timer_duration (
delta_ticks = (0xFFFFFFFF - start_ticks) + end_ticks; delta_ticks = (0xFFFFFFFF - start_ticks) + end_ticks;
} }
} }
else { else /* start_ticks == end_ticks */ {
*time_elapsed = 0; *time_elapsed = 0;
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
/* /*
* Compute Duration (Requires a 64-bit divide): * Compute Duration (Requires a 64-bit multiply and divide):
* *
* time_elapsed = (delta_ticks * 1000000) / PM_TIMER_FREQUENCY; * time_elapsed = (delta_ticks * 1000000) / PM_TIMER_FREQUENCY;
*/ */
normalized_ticks.full = ((u64) delta_ticks) * 1000000; status = acpi_ut_short_divide (((u64) delta_ticks) * 1000000,
PM_TIMER_FREQUENCY, &quotient, NULL);
status = acpi_ut_short_divide (&normalized_ticks.full, PM_TIMER_FREQUENCY,
&out_quotient, NULL);
*time_elapsed = (u32) out_quotient; *time_elapsed = (u32) quotient;
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -167,6 +167,9 @@ acpi_tb_get_table_header ( ...@@ -167,6 +167,9 @@ acpi_tb_get_table_header (
return_ACPI_STATUS (AE_BAD_PARAMETER); return_ACPI_STATUS (AE_BAD_PARAMETER);
} }
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Table Signature: [%4.4s]\n",
return_header->signature));
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -4,5 +4,6 @@ ...@@ -4,5 +4,6 @@
obj-y := core.o card.o driver.o resource.o manager.o support.o interface.o quirks.o system.o obj-y := core.o card.o driver.o resource.o manager.o support.o interface.o quirks.o system.o
obj-$(CONFIG_PNPACPI) += pnpacpi/
obj-$(CONFIG_PNPBIOS) += pnpbios/ obj-$(CONFIG_PNPBIOS) += pnpbios/
obj-$(CONFIG_ISAPNP) += isapnp/ obj-$(CONFIG_ISAPNP) += isapnp/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment