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.
(param: profile step/bucket size as a power of 2 for
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
before loading.
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,16 +456,10 @@ 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.
*/
if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
static u16 irq_mask;
extern void eisa_set_level_irq(unsigned int irq);
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);
if (edge_level == ACPI_LEVEL_SENSITIVE)
eisa_set_level_irq(gsi);
}
}
}
#endif
......
......@@ -514,13 +514,27 @@ static struct {
unsigned int apic_thmr;
} apic_pm_state;
static int lapic_suspend(struct sys_device *dev, u32 state)
static int lapic_shutdown(struct sys_device *dev)
{
unsigned long flags;
if (!apic_pm_state.active)
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_taskpri = apic_read(APIC_TASKPRI);
apic_pm_state.apic_ldr = apic_read(APIC_LDR);
......@@ -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_thmr = apic_read(APIC_LVTTHMR);
local_irq_save(flags);
disable_local_APIC();
local_irq_restore(flags);
return 0;
return lapic_shutdown(dev);
}
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 = {
set_kset_name("lapic"),
.shutdown = lapic_shutdown,
.resume = lapic_resume,
.suspend = lapic_suspend,
};
......
......@@ -308,21 +308,6 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"),
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", {
MATCH(DMI_SYS_VENDOR, "Compaq"),
MATCH(DMI_PRODUCT_NAME, "Workstation W8000"),
......
......@@ -1069,8 +1069,11 @@ static int pin_2_irq(int idx, int apic, int pin)
while (i < apic)
irq += nr_ioapic_registers[i++];
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;
}
default:
......
......@@ -808,6 +808,7 @@ void __init find_smp_config (void)
smp_scan_config(address, 0x400);
}
int (*platform_rename_gsi)(int ioapic, int gsi);
/* --------------------------------------------------------------------------
ACPI-based MP Configuration
......@@ -996,6 +997,12 @@ void __init mp_config_acpi_legacy_irqs (void)
mp_bus_id_to_type[MP_ISA_BUS] = MP_BUS_ISA;
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).
*/
......@@ -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)
{
int ioapic = -1;
......
......@@ -57,6 +57,9 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
int hlt_counter;
unsigned long boot_option_idle_override = 0;
EXPORT_SYMBOL(boot_option_idle_override);
/*
* Return saved PC of a blocked thread.
*/
......@@ -214,6 +217,7 @@ static int __init idle_setup (char *str)
pm_idle = default_idle;
}
boot_option_idle_override = 1;
return 1;
}
......
......@@ -52,72 +52,27 @@ int mip_port;
unsigned long mip_addr, host_addr;
#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.
*/
static int __init
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);
}
static unsigned int base;
return gsi;
}
static int __init
static int
es7000_rename_gsi(int ioapic, int gsi)
{
static int initialized = 0;
int 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 (!base) {
int i;
for (i = 0; i < nr_ioapics; i++)
base += nr_ioapic_registers[i];
}
if (!ioapic && (gsi < 16))
gsi += base;
return gsi;
}
#endif // (CONFIG_X86_IO_APIC) && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT)
/*
......
......@@ -17,6 +17,7 @@
#include <asm/smp.h>
#include <asm/io_apic.h>
#include <asm/hw_irq.h>
#include <linux/acpi.h>
#include "pci.h"
......@@ -127,8 +128,15 @@ void eisa_set_level_irq(unsigned int irq)
{
unsigned char mask = 1 << (irq & 7);
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)) {
DBG(" -> edge");
outb(val | mask, port);
......@@ -989,13 +997,24 @@ static int __init pcibios_irq_init(void)
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
* IRQ's, we try to avoid assigning it to PCI devices.
*/
pirq_penalty[irq] += 100;
if (irq < 16)
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)
......
......@@ -47,6 +47,8 @@
void (*ia64_mark_idle)(int);
unsigned long boot_option_idle_override = 0;
EXPORT_SYMBOL(boot_option_idle_override);
void
ia64_do_show_stack (struct unw_frame_info *info, void *arg)
......
......@@ -54,6 +54,9 @@ unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED;
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..
*/
......@@ -196,6 +199,7 @@ static int __init idle_setup (char *str)
pm_idle = poll_idle;
}
boot_option_idle_override = 1;
return 1;
}
......
......@@ -110,6 +110,21 @@ config ACPI_BUTTON
down the system. Until then, you can cat it, and see output when
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
tristate "Fan"
depends on ACPI_INTERPRETER
......@@ -176,6 +191,20 @@ config ACPI_ASUS
something works not quite as expected, please use the mailing list
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
tristate "Toshiba Laptop Extras"
depends on X86
......@@ -206,7 +235,7 @@ config ACPI_TOSHIBA
config ACPI_CUSTOM_DSDT
bool "Include Custom DSDT"
depends on X86 && ACPI_INTERPRETER && !STANDALONE
depends on ACPI_INTERPRETER && !STANDALONE
default n
help
Thist option is to load a custom ACPI DSDT
......
......@@ -38,6 +38,7 @@ obj-$(CONFIG_ACPI_BATTERY) += battery.o
obj-$(CONFIG_ACPI_BUTTON) += button.o
obj-$(CONFIG_ACPI_EC) += ec.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_POWER) += power.o
obj-$(CONFIG_ACPI_PROCESSOR) += processor.o
......@@ -46,5 +47,6 @@ obj-$(CONFIG_ACPI_SYSTEM) += system.o event.o
obj-$(CONFIG_ACPI_DEBUG) += debug.o
obj-$(CONFIG_ACPI_NUMA) += numa.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_BUS) += scan.o motherboard.o
......@@ -117,11 +117,11 @@ int acpi_ac_seq_show(struct seq_file *seq, void *offset)
ACPI_FUNCTION_TRACE("acpi_ac_seq_show");
if (!ac)
return 0;
return_VALUE(0);
if (acpi_ac_get_state(ac)) {
seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
return 0;
return_VALUE(0);
}
seq_puts(seq, "state: ");
......@@ -137,7 +137,7 @@ int acpi_ac_seq_show(struct seq_file *seq, void *offset)
break;
}
return 0;
return_VALUE(0);
}
static int acpi_ac_open_fs(struct inode *inode, struct file *file)
......@@ -212,7 +212,7 @@ acpi_ac_notify (
ACPI_FUNCTION_TRACE("acpi_ac_notify");
if (!ac)
return;
return_VOID;
if (acpi_bus_get_device(ac->handle, &device))
return_VOID;
......
......@@ -332,7 +332,7 @@ acpi_bus_receive_event (
ACPI_FUNCTION_TRACE("acpi_bus_receive_event");
if (!event)
return -EINVAL;
return_VALUE(-EINVAL);
if (list_empty(&acpi_bus_event_list)) {
......@@ -599,7 +599,7 @@ acpi_early_init (void)
ACPI_FUNCTION_TRACE("acpi_early_init");
if (acpi_disabled)
return;
return_VOID;
/* enable workarounds, unless strict ACPI spec. compliance */
if (!acpi_strict)
......@@ -652,11 +652,11 @@ acpi_early_init (void)
goto error0;
}
return;
return_VOID;
error0:
disable_acpi();
return;
return_VOID;
}
static int __init
......@@ -743,7 +743,7 @@ static int __init acpi_init (void)
if (acpi_disabled) {
printk(KERN_INFO PREFIX "Interpreter disabled.\n");
return -ENODEV;
return_VALUE(-ENODEV);
}
firmware_register(&acpi_subsys);
......
......@@ -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");
if (!button || !button->device)
return 0;
return_VALUE(0);
seq_printf(seq, "type: %s\n",
acpi_device_name(button->device));
return 0;
return_VALUE(0);
}
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)
ACPI_FUNCTION_TRACE("acpi_button_state_seq_show");
if (!button || !button->device)
return 0;
return_VALUE(0);
status = acpi_evaluate_integer(button->handle,"_LID",NULL,&state);
if (ACPI_FAILURE(status)) {
......@@ -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"));
}
return 0;
return_VALUE(0);
}
static int acpi_button_state_open_fs(struct inode *inode, struct file *file)
......
......@@ -312,7 +312,7 @@ acpi_ds_method_data_set_value (
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,
acpi_ut_get_type_name (object->common.type)));
......@@ -448,7 +448,22 @@ acpi_ds_method_data_get_value (
* was referenced by the method (via the ASL)
* 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:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Arg[%d] at node %p\n",
......@@ -572,7 +587,7 @@ acpi_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));
/* Parameter validation */
......
......@@ -333,7 +333,7 @@ acpi_ds_clear_operands (
u32 i;
ACPI_FUNCTION_TRACE_PTR ("acpi_ds_clear_operands", walk_state);
ACPI_FUNCTION_TRACE_PTR ("ds_clear_operands", walk_state);
/*
......
......@@ -60,17 +60,18 @@
* Dispatch table for opcode classes
*/
static ACPI_EXECUTE_OP acpi_gbl_op_type_dispatch [] = {
acpi_ex_opcode_1A_0T_0R,
acpi_ex_opcode_1A_0T_1R,
acpi_ex_opcode_1A_1T_0R,
acpi_ex_opcode_1A_1T_1R,
acpi_ex_opcode_2A_0T_0R,
acpi_ex_opcode_2A_0T_1R,
acpi_ex_opcode_2A_1T_1R,
acpi_ex_opcode_2A_2T_1R,
acpi_ex_opcode_3A_0T_0R,
acpi_ex_opcode_3A_1T_1R,
acpi_ex_opcode_6A_0T_1R};
acpi_ex_opcode_0A_0T_1R,
acpi_ex_opcode_1A_0T_0R,
acpi_ex_opcode_1A_0T_1R,
acpi_ex_opcode_1A_1T_0R,
acpi_ex_opcode_1A_1T_1R,
acpi_ex_opcode_2A_0T_0R,
acpi_ex_opcode_2A_0T_1R,
acpi_ex_opcode_2A_1T_1R,
acpi_ex_opcode_2A_2T_1R,
acpi_ex_opcode_3A_0T_0R,
acpi_ex_opcode_3A_1T_1R,
acpi_ex_opcode_6A_0T_1R};
/*****************************************************************************
*
......@@ -413,7 +414,7 @@ acpi_ds_exec_end_op (
* routine. There is one routine per opcode "type" based upon the
* 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 {
/*
......@@ -425,7 +426,9 @@ acpi_ds_exec_end_op (
(walk_state->operands[0]->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[1]->reference.opcode)) {
walk_state->operands[1]->reference.opcode) &&
(walk_state->operands[0]->reference.offset ==
walk_state->operands[1]->reference.offset)) {
status = AE_OK;
}
else {
......@@ -639,7 +642,8 @@ acpi_ds_exec_end_op (
* conditional predicate
*/
if ((walk_state->control_state) &&
if ((ACPI_SUCCESS (status)) &&
(walk_state->control_state) &&
(walk_state->control_state->common.state ==
ACPI_CONTROL_PREDICATE_EXECUTING) &&
(walk_state->control_state->control.predicate_op == op)) {
......@@ -649,6 +653,19 @@ acpi_ds_exec_end_op (
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) {
/* Break to debugger to display result */
......
......@@ -182,18 +182,20 @@ acpi_ds_load1_begin_op (
*/
status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
if (ACPI_FAILURE (status)) {
#ifdef _ACPI_ASL_COMPILER
if (status == AE_NOT_FOUND) {
acpi_dm_add_to_external_list (path);
status = AE_OK;
}
else {
ACPI_REPORT_NSERROR (path, status);
}
#else
ACPI_REPORT_NSERROR (path, status);
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);
status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
}
#endif
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (path, status);
return (status);
}
......
......@@ -867,6 +867,7 @@ acpi_ds_create_walk_state (
status = acpi_ds_result_stack_push (walk_state);
if (ACPI_FAILURE (status)) {
acpi_ut_release_to_cache (ACPI_MEM_LIST_WALK, walk_state);
return_PTR (NULL);
}
......
......@@ -434,13 +434,8 @@ acpi_ev_gpe_detect (
}
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
"GPE pair: Status %8.8X%8.8X = %02X, Enable %8.8X%8.8X = %02X\n",
ACPI_FORMAT_UINT64 (
gpe_register_info->status_address.address),
status_reg,
ACPI_FORMAT_UINT64 (
gpe_register_info->enable_address.address),
enable_reg));
"Read GPE Register at GPE%X: Status=%02X, Enable=%02X\n",
gpe_register_info->base_gpe_number, status_reg, enable_reg));
/* First check if there is anything active at all in this register */
......
......@@ -970,16 +970,14 @@ acpi_ev_create_gpe_block (
/* Dump info about this GPE block */
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 +
((gpe_block->register_count * ACPI_GPE_REGISTER_WIDTH) -1)),
gpe_device->name.ascii,
gpe_block->register_count,
ACPI_FORMAT_UINT64 (gpe_block->block_address.address),
interrupt_level));
/* Enable all valid GPEs found above */
status = acpi_hw_enable_runtime_gpe_block (NULL, gpe_block);
......
......@@ -51,6 +51,51 @@
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
......
This diff is collapsed.
This diff is collapsed.
......@@ -139,7 +139,7 @@ acpi_ex_setup_region (
if (ACPI_ROUND_UP (rgn_desc->region.length,
obj_desc->common_field.access_byte_width) >=
(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)) {
return_ACPI_STATUS (AE_OK);
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -199,7 +199,8 @@ acpi_ex_opcode_2A_2T_1R (
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 (
/* Quotient to return_desc1, remainder to return_desc2 */
status = acpi_ut_divide (&operand[0]->integer.value, &operand[1]->integer.value,
&return_desc1->integer.value, &return_desc2->integer.value);
status = acpi_ut_divide (operand[0]->integer.value,
operand[1]->integer.value,
&return_desc1->integer.value,
&return_desc2->integer.value);
if (ACPI_FAILURE (status)) {
goto cleanup;
}
......@@ -292,13 +295,13 @@ acpi_ex_opcode_2A_1T_1R (
{
union acpi_operand_object **operand = &walk_state->operands[0];
union acpi_operand_object *return_desc = NULL;
union acpi_operand_object *temp_desc = NULL;
u32 index;
acpi_status status = AE_OK;
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 (
/* return_desc will contain the remainder */
status = acpi_ut_divide (&operand[0]->integer.value, &operand[1]->integer.value,
NULL, &return_desc->integer.value);
status = acpi_ut_divide (operand[0]->integer.value,
operand[1]->integer.value,
NULL,
&return_desc->integer.value);
break;
case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
/*
* Convert the second operand if necessary. The first operand
* 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);
}
status = acpi_ex_do_concatenate (operand[0], operand[1],
&return_desc, walk_state);
break;
......@@ -387,55 +355,45 @@ acpi_ex_opcode_2A_1T_1R (
* 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;
if (operand[1]->integer.value == 0) {
/* Handle optional length value */
operand[1]->integer.value = ACPI_INTEGER_MAX;
}
while ((length < operand[0]->buffer.length) &&
(length < operand[1]->integer.value) &&
(operand[0]->buffer.pointer[length])) {
length++;
if (length > ACPI_MAX_STRING_CONVERSION) {
status = AE_AML_STRING_LIMIT;
goto cleanup;
}
}
if (length > ACPI_MAX_STRING_CONVERSION) {
status = AE_AML_STRING_LIMIT;
goto cleanup;
}
/* Create the internal return object */
/* Allocate a new string object */
return_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING);
return_desc = acpi_ut_create_string_object (length);
if (!return_desc) {
status = AE_NO_MEMORY;
goto cleanup;
}
/* Allocate a new string buffer (Length + 1 for null terminator) */
return_desc->string.pointer = ACPI_MEM_CALLOCATE (length + 1);
if (!return_desc->string.pointer) {
status = AE_NO_MEMORY;
goto cleanup;
}
/* Copy the raw buffer data with no transform */
ACPI_MEMCPY (return_desc->string.pointer, operand[0]->buffer.pointer, length);
/* Copy the raw buffer data with no transform. NULL terminated already. */
/* Set the string length */
return_desc->string.length = (u32) length;
ACPI_MEMCPY (return_desc->string.pointer,
operand[0]->buffer.pointer, length);
break;
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;
......@@ -458,7 +416,8 @@ acpi_ex_opcode_2A_1T_1R (
/* Object to be indexed is a Package */
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));
status = AE_AML_PACKAGE_LIMIT;
goto cleanup;
......@@ -472,7 +431,8 @@ acpi_ex_opcode_2A_1T_1R (
/* Object to be indexed is a Buffer */
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));
status = AE_AML_BUFFER_LIMIT;
goto cleanup;
......@@ -558,7 +518,8 @@ acpi_ex_opcode_2A_0T_1R (
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 */
......@@ -572,18 +533,15 @@ acpi_ex_opcode_2A_0T_1R (
/*
* Execute the Opcode
*/
if (walk_state->op_info->flags & AML_LOGICAL) /* logical_op (Operand0, Operand1) */ {
/* Both operands must be of the same type */
if (ACPI_GET_OBJECT_TYPE (operand[0]) !=
ACPI_GET_OBJECT_TYPE (operand[1])) {
status = AE_AML_OPERAND_TYPE;
goto cleanup;
}
logical_result = acpi_ex_do_logical_op (walk_state->opcode,
operand[0],
operand[1]);
if (walk_state->op_info->flags & AML_LOGICAL_NUMERIC) /* logical_op (Operand0, Operand1) */ {
status = acpi_ex_do_logical_numeric_op (walk_state->opcode,
operand[0]->integer.value, operand[1]->integer.value,
&logical_result);
goto store_logical_result;
}
else if (walk_state->op_info->flags & AML_LOGICAL) /* logical_op (Operand0, Operand1) */ {
status = acpi_ex_do_logical_op (walk_state->opcode, operand[0],
operand[1], &logical_result);
goto store_logical_result;
}
......
......@@ -508,6 +508,7 @@ acpi_ex_prep_field_value (
if (!obj_desc->index_field.data_obj || !obj_desc->index_field.index_obj) {
ACPI_REPORT_ERROR (("Null Index Object during field prep\n"));
acpi_ut_delete_object_desc (obj_desc);
return_ACPI_STATUS (AE_AML_INTERNAL);
}
......
......@@ -121,7 +121,7 @@ acpi_ex_system_memory_space_handler (
* Hardware does not support non-aligned data transfers, we must verify
* 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) {
return_ACPI_STATUS (AE_AML_ALIGNMENT);
}
......
......@@ -327,11 +327,44 @@ acpi_ex_resolve_multiple (
union acpi_operand_object *obj_desc = (void *) operand;
struct acpi_namespace_node *node;
acpi_object_type type;
acpi_status status;
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,
* we need to get to the base object (as per the ACPI specification
......@@ -424,6 +457,33 @@ acpi_ex_resolve_multiple (
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:
/* The Debug Object is of type "debug_object" */
......
......@@ -160,7 +160,7 @@ acpi_ex_resolve_operands (
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));
/*
......@@ -227,12 +227,13 @@ acpi_ex_resolve_operands (
case AML_LOAD_OP: /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */
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;
default:
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,
(acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name));
......@@ -398,7 +399,7 @@ acpi_ex_resolve_operands (
* But we can implicitly convert from a STRING or BUFFER
* 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 (status == AE_TYPE) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
......@@ -420,7 +421,7 @@ acpi_ex_resolve_operands (
* But we can implicitly convert from a STRING or INTEGER
* 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 (status == AE_TYPE) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
......@@ -442,7 +443,8 @@ acpi_ex_resolve_operands (
* But we can implicitly convert from a BUFFER or INTEGER
* 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 (status == AE_TYPE) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
......@@ -494,7 +496,7 @@ acpi_ex_resolve_operands (
/* 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)) {
return_ACPI_STATUS (status);
}
......
......@@ -129,7 +129,8 @@ acpi_ex_store (
/* Destination is not a Reference object */
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 (dest_desc);
......@@ -182,23 +183,37 @@ acpi_ex_store (
* Storing to the Debug object causes the value stored to be
* 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_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)) {
case ACPI_TYPE_INTEGER:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%8.8X%8.8X\n",
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_FORMAT_UINT64 (source_desc->integer.value)));
}
break;
case ACPI_TYPE_BUFFER:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length 0x%.2X",
(u32) source_desc->buffer.length));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X]",
(u32) source_desc->buffer.length));
ACPI_DUMP_BUFFER (source_desc->buffer.pointer,
(source_desc->buffer.length < 32) ? source_desc->buffer.length : 32);
break;
......@@ -206,22 +221,22 @@ acpi_ex_store (
case ACPI_TYPE_STRING:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length 0x%.2X, \"%s\"\n",
source_desc->string.length, source_desc->string.pointer));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X] \"%s\"\n",
source_desc->string.length, source_desc->string.pointer));
break;
case ACPI_TYPE_PACKAGE:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Size 0x%.2X Elements Ptr - %p\n",
source_desc->package.count, source_desc->package.elements));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X] Elements Ptr - %p\n",
source_desc->package.count, source_desc->package.elements));
break;
default:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%p\n",
source_desc));
source_desc));
break;
}
......
......@@ -167,7 +167,7 @@ acpi_ex_system_do_stall (
acpi_status
acpi_ex_system_do_suspend (
u32 how_long)
acpi_integer how_long)
{
acpi_status status;
......@@ -179,8 +179,7 @@ acpi_ex_system_do_suspend (
acpi_ex_exit_interpreter ();
acpi_os_sleep ((u16) (how_long / (u32) 1000),
(u16) (how_long % (u32) 1000));
acpi_os_sleep (how_long);
/* And now we must get the interpreter again */
......
......@@ -280,25 +280,25 @@ acpi_ex_digits_needed (
{
u32 num_digits;
acpi_integer current_value;
acpi_integer quotient;
ACPI_FUNCTION_TRACE ("ex_digits_needed");
/*
* acpi_integer is unsigned, so we don't worry about a '-'
*/
if ((current_value = value) == 0) {
/* acpi_integer is unsigned, so we don't worry about a '-' prefix */
if (value == 0) {
return_VALUE (1);
}
current_value = value;
num_digits = 0;
/* Count the digits in the requested base */
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++;
current_value = quotient;
}
return_VALUE (num_digits);
......@@ -361,7 +361,6 @@ acpi_ex_unsigned_integer_to_string (
u32 count;
u32 digits_needed;
u32 remainder;
acpi_integer quotient;
ACPI_FUNCTION_ENTRY ();
......@@ -371,9 +370,8 @@ acpi_ex_unsigned_integer_to_string (
out_string[digits_needed] = 0;
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);\
value = quotient;
}
}
......
......@@ -709,6 +709,7 @@ acpi_hw_low_level_read (
u32 *value,
struct acpi_generic_address *reg)
{
u64 address;
acpi_status status;
......@@ -720,8 +721,14 @@ acpi_hw_low_level_read (
* a non-zero address within. However, don't return an error
* because the PM1A/B code must not fail if B isn't present.
*/
if ((!reg) ||
(!reg->address)) {
if (!reg) {
return (AE_OK);
}
/* Get a local copy of the address. Handles possible alignment issues */
ACPI_MOVE_64_TO_64 (&address, &reg->address);
if (!address) {
return (AE_OK);
}
*value = 0;
......@@ -734,14 +741,14 @@ acpi_hw_low_level_read (
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
status = acpi_os_read_memory (
(acpi_physical_address) reg->address,
(acpi_physical_address) address,
value, width);
break;
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);
break;
......@@ -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",
*value, width,
ACPI_FORMAT_UINT64 (reg->address),
ACPI_FORMAT_UINT64 (address),
acpi_ut_get_region_name (reg->address_space_id)));
return (status);
......@@ -781,6 +788,7 @@ acpi_hw_low_level_write (
u32 value,
struct acpi_generic_address *reg)
{
u64 address;
acpi_status status;
......@@ -792,8 +800,14 @@ acpi_hw_low_level_write (
* a non-zero address within. However, don't return an error
* because the PM1A/B code must not fail if B isn't present.
*/
if ((!reg) ||
(!reg->address)) {
if (!reg) {
return (AE_OK);
}
/* Get a local copy of the address. Handles possible alignment issues */
ACPI_MOVE_64_TO_64 (&address, &reg->address);
if (!address) {
return (AE_OK);
}
......@@ -805,14 +819,14 @@ acpi_hw_low_level_write (
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
status = acpi_os_write_memory (
(acpi_physical_address) reg->address,
(acpi_physical_address) address,
value, width);
break;
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);
break;
......@@ -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",
value, width,
ACPI_FORMAT_UINT64 (reg->address),
ACPI_FORMAT_UINT64 (address),
acpi_ut_get_region_name (reg->address_space_id)));
return (status);
......
......@@ -149,10 +149,9 @@ acpi_get_timer_duration (
u32 end_ticks,
u32 *time_elapsed)
{
u32 delta_ticks = 0;
union uint64_overlay normalized_ticks;
acpi_status status;
acpi_integer out_quotient;
u32 delta_ticks;
acpi_integer quotient;
ACPI_FUNCTION_TRACE ("acpi_get_timer_duration");
......@@ -164,7 +163,7 @@ acpi_get_timer_duration (
/*
* 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) {
delta_ticks = end_ticks - start_ticks;
......@@ -181,22 +180,20 @@ acpi_get_timer_duration (
delta_ticks = (0xFFFFFFFF - start_ticks) + end_ticks;
}
}
else {
else /* start_ticks == end_ticks */ {
*time_elapsed = 0;
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;
*/
normalized_ticks.full = ((u64) delta_ticks) * 1000000;
status = acpi_ut_short_divide (&normalized_ticks.full, PM_TIMER_FREQUENCY,
&out_quotient, NULL);
status = acpi_ut_short_divide (((u64) delta_ticks) * 1000000,
PM_TIMER_FREQUENCY, &quotient, NULL);
*time_elapsed = (u32) out_quotient;
*time_elapsed = (u32) quotient;
return_ACPI_STATUS (status);
}
......
This diff is collapsed.
......@@ -62,7 +62,7 @@ acpi_reserve_io_ranges (struct acpi_resource *res, void *data)
struct acpi_resource_io *io_res = &res->data.io;
if (io_res->min_base_address != io_res->max_base_address)
return AE_OK;
return_VALUE(AE_OK);
if (IS_RESERVED_ADDR(io_res->min_base_address, io_res->range_length)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Motherboard resources 0x%08x - 0x%08x\n",
io_res->min_base_address,
......@@ -86,7 +86,7 @@ acpi_reserve_io_ranges (struct acpi_resource *res, void *data)
if (requested_res)
requested_res->flags &= ~IORESOURCE_BUSY;
return AE_OK;
return_VALUE(AE_OK);
}
static int acpi_motherboard_add (struct acpi_device *device)
......
......@@ -161,8 +161,10 @@ acpi_ns_root_initialize (void)
#if defined (_ACPI_ASL_COMPILER) || defined (_ACPI_DUMP_App)
/* i_aSL Compiler cheats by putting parameter count in the owner_iD */
/*
* i_aSL Compiler cheats by putting parameter count
* in the owner_iD
*/
new_node->owner_id = obj_desc->method.param_count;
#else
/* Mark this as a very SPECIAL method */
......@@ -204,6 +206,7 @@ acpi_ns_root_initialize (void)
status = acpi_os_create_semaphore (ACPI_NO_UNIT_LIMIT,
1, &obj_desc->mutex.semaphore);
if (ACPI_FAILURE (status)) {
acpi_ut_remove_reference (obj_desc);
goto unlock_and_exit;
}
......@@ -219,6 +222,7 @@ acpi_ns_root_initialize (void)
status = acpi_os_create_semaphore (1, 1,
&obj_desc->mutex.semaphore);
if (ACPI_FAILURE (status)) {
acpi_ut_remove_reference (obj_desc);
goto unlock_and_exit;
}
}
......@@ -236,7 +240,8 @@ acpi_ns_root_initialize (void)
/* Store pointer to value descriptor in the Node */
status = acpi_ns_attach_object (new_node, obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc));
status = acpi_ns_attach_object (new_node, obj_desc,
ACPI_GET_OBJECT_TYPE (obj_desc));
/* Remove local reference to the object */
......@@ -462,7 +467,8 @@ acpi_ns_lookup (
type = this_node->type;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Prefix-only Pathname (Zero name segments), Flags=%X\n", flags));
"Prefix-only Pathname (Zero name segments), Flags=%X\n",
flags));
break;
case AML_DUAL_NAME_PREFIX:
......@@ -554,7 +560,7 @@ acpi_ns_lookup (
/* Try to find the single (4 character) ACPI name */
status = acpi_ns_search_and_enter (simple_name, walk_state, current_node,
interpreter_mode, this_search_type, local_flags, &this_node);
interpreter_mode, this_search_type, local_flags, &this_node);
if (ACPI_FAILURE (status)) {
if (status == AE_NOT_FOUND) {
/* Name not found in ACPI namespace */
......
......@@ -502,8 +502,8 @@ acpi_ns_delete_namespace_subtree (
* visit the node
*/
level++;
parent_node = child_node;
child_node = NULL;
parent_node = child_node;
child_node = NULL;
}
}
else {
......@@ -650,8 +650,8 @@ acpi_ns_delete_namespace_by_owner (
* visit the node
*/
level++;
parent_node = child_node;
child_node = NULL;
parent_node = child_node;
child_node = NULL;
}
else if (child_node->owner_id == owner_id) {
deletion_node = child_node;
......
......@@ -198,7 +198,8 @@ acpi_ns_dump_one_object (
}
if (!acpi_ut_valid_acpi_name (this_node->name.integer)) {
ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n", this_node->name.integer));
ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n",
this_node->name.integer));
}
/*
......@@ -226,9 +227,8 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_PROCESSOR:
acpi_os_printf ("ID %X Len %.4X Addr %p\n",
obj_desc->processor.proc_id,
obj_desc->processor.length,
(char *) obj_desc->processor.address);
obj_desc->processor.proc_id, obj_desc->processor.length,
(char *) obj_desc->processor.address);
break;
......@@ -241,16 +241,15 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_METHOD:
acpi_os_printf ("Args %X Len %.4X Aml %p\n",
(u32) obj_desc->method.param_count,
obj_desc->method.aml_length,
obj_desc->method.aml_start);
(u32) obj_desc->method.param_count,
obj_desc->method.aml_length, obj_desc->method.aml_start);
break;
case ACPI_TYPE_INTEGER:
acpi_os_printf ("= %8.8X%8.8X\n",
ACPI_FORMAT_UINT64 (obj_desc->integer.value));
ACPI_FORMAT_UINT64 (obj_desc->integer.value));
break;
......@@ -258,7 +257,7 @@ acpi_ns_dump_one_object (
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
acpi_os_printf ("Elements %.2X\n",
obj_desc->package.count);
obj_desc->package.count);
}
else {
acpi_os_printf ("[Length not yet evaluated]\n");
......@@ -298,11 +297,12 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_REGION:
acpi_os_printf ("[%s]", acpi_ut_get_region_name (obj_desc->region.space_id));
acpi_os_printf ("[%s]",
acpi_ut_get_region_name (obj_desc->region.space_id));
if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
acpi_os_printf (" Addr %8.8X%8.8X Len %.4X\n",
ACPI_FORMAT_UINT64 (obj_desc->region.address),
obj_desc->region.length);
ACPI_FORMAT_UINT64 (obj_desc->region.address),
obj_desc->region.length);
}
else {
acpi_os_printf (" [Address/Length not yet evaluated]\n");
......@@ -313,7 +313,7 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_LOCAL_REFERENCE:
acpi_os_printf ("[%s]\n",
acpi_ps_get_opcode_name (obj_desc->reference.opcode));
acpi_ps_get_opcode_name (obj_desc->reference.opcode));
break;
......@@ -322,7 +322,7 @@ acpi_ns_dump_one_object (
if (obj_desc->buffer_field.buffer_obj &&
obj_desc->buffer_field.buffer_obj->buffer.node) {
acpi_os_printf ("Buf [%4.4s]",
acpi_ut_get_node_name (obj_desc->buffer_field.buffer_obj->buffer.node));
acpi_ut_get_node_name (obj_desc->buffer_field.buffer_obj->buffer.node));
}
break;
......@@ -330,30 +330,31 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_LOCAL_REGION_FIELD:
acpi_os_printf ("Rgn [%4.4s]",
acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node));
acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node));
break;
case ACPI_TYPE_LOCAL_BANK_FIELD:
acpi_os_printf ("Rgn [%4.4s] Bnk [%4.4s]",
acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node),
acpi_ut_get_node_name (obj_desc->bank_field.bank_obj->common_field.node));
acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node),
acpi_ut_get_node_name (obj_desc->bank_field.bank_obj->common_field.node));
break;
case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_os_printf ("Idx [%4.4s] Dat [%4.4s]",
acpi_ut_get_node_name (obj_desc->index_field.index_obj->common_field.node),
acpi_ut_get_node_name (obj_desc->index_field.data_obj->common_field.node));
acpi_ut_get_node_name (obj_desc->index_field.index_obj->common_field.node),
acpi_ut_get_node_name (obj_desc->index_field.data_obj->common_field.node));
break;
case ACPI_TYPE_LOCAL_ALIAS:
case ACPI_TYPE_LOCAL_METHOD_ALIAS:
acpi_os_printf ("Target %4.4s (%p)\n", acpi_ut_get_node_name (obj_desc), obj_desc);
acpi_os_printf ("Target %4.4s (%p)\n",
acpi_ut_get_node_name (obj_desc), obj_desc);
break;
default:
......@@ -371,10 +372,10 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_os_printf (" Off %.3X Len %.2X Acc %.2hd\n",
(obj_desc->common_field.base_byte_offset * 8)
+ obj_desc->common_field.start_field_bit_offset,
obj_desc->common_field.bit_length,
obj_desc->common_field.access_byte_width);
(obj_desc->common_field.base_byte_offset * 8)
+ obj_desc->common_field.start_field_bit_offset,
obj_desc->common_field.bit_length,
obj_desc->common_field.access_byte_width);
break;
default:
......@@ -471,12 +472,13 @@ acpi_ns_dump_one_object (
obj_type = ACPI_GET_OBJECT_TYPE (obj_desc);
if (obj_type > ACPI_TYPE_LOCAL_MAX) {
acpi_os_printf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", obj_type);
acpi_os_printf ("(Ptr to ACPI Object type %X [UNKNOWN])\n",
obj_type);
bytes_to_dump = 32;
}
else {
acpi_os_printf ("(Ptr to ACPI Object type %s, %X)\n",
acpi_ut_get_type_name (obj_type), obj_type);
acpi_ut_get_type_name (obj_type), obj_type);
bytes_to_dump = sizeof (union acpi_operand_object);
}
break;
......@@ -484,8 +486,9 @@ acpi_ns_dump_one_object (
default:
acpi_os_printf ("(String or Buffer ptr - not an object descriptor) [%s]\n",
acpi_ut_get_descriptor_name (obj_desc));
acpi_os_printf (
"(String or Buffer ptr - not an object descriptor) [%s]\n",
acpi_ut_get_descriptor_name (obj_desc));
bytes_to_dump = 16;
break;
}
......@@ -552,7 +555,7 @@ acpi_ns_dump_one_object (
* FUNCTION: acpi_ns_dump_objects
*
* PARAMETERS: Type - Object type to be dumped
* max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX
* max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX
* for an effectively unlimited depth.
* owner_id - Dump only objects owned by this ID. Use
* ACPI_UINT32_MAX to match all owners.
......
......@@ -91,10 +91,10 @@ acpi_ns_dump_one_device (
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " "));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %s, ADR: %8.8X%8.8X, Status: %X\n",
info->hardware_id.value,
ACPI_FORMAT_UINT64 (info->address),
info->current_status));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES,
" HID: %s, ADR: %8.8X%8.8X, Status: %X\n",
info->hardware_id.value, ACPI_FORMAT_UINT64 (info->address),
info->current_status));
ACPI_MEM_FREE (info);
}
......@@ -133,7 +133,8 @@ acpi_ns_dump_root_devices (void)
return;
}
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Display of all devices in the namespace:\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
"Display of all devices in the namespace:\n"));
status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, sys_bus_handle,
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
......
......@@ -57,14 +57,9 @@
*
* FUNCTION: acpi_ns_evaluate_relative
*
* PARAMETERS: Handle - The relative containing object
* Pathname - Name of method to execute, If NULL, the
* PARAMETERS: Pathname - Name of method to execute, If NULL, the
* handle is the object to execute
* Params - List of parameters to pass to the method,
* terminated by NULL. Params itself may be
* NULL if no parameters are being passed.
* return_object - Where to put method's return value (if
* any). If NULL, no value is returned.
* Info - Method info block
*
* RETURN: Status
*
......@@ -138,8 +133,7 @@ acpi_ns_evaluate_relative (
}
/*
* Now that we have a handle to the object, we can attempt
* to evaluate it.
* Now that we have a handle to the object, we can attempt to evaluate it.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n",
pathname, node, acpi_ns_get_attached_object (node)));
......@@ -165,9 +159,9 @@ acpi_ns_evaluate_relative (
*
* PARAMETERS: Pathname - Fully qualified pathname to the object
* Info - Contains:
* return_object - Where to put method's return value (if
* return_object - Where to put method's return value (if
* any). If NULL, no value is returned.
* Params - List of parameters to pass to the method,
* Params - List of parameters to pass to the method,
* terminated by NULL. Params itself may be
* NULL if no parameters are being passed.
*
......@@ -213,14 +207,14 @@ acpi_ns_evaluate_by_name (
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Object at [%s] was not found, status=%.4X\n",
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Object at [%s] was not found, status=%.4X\n",
pathname, status));
goto cleanup;
}
/*
* Now that we have a handle to the object, we can attempt
* to evaluate it.
* Now that we have a handle to the object, we can attempt to evaluate it.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n",
pathname, info->node, acpi_ns_get_attached_object (info->node)));
......@@ -303,9 +297,8 @@ acpi_ns_evaluate_by_handle (
}
/*
* For a method alias, we must grab the actual method node
* so that proper scoping context will be established
* before execution.
* For a method alias, we must grab the actual method node so that proper
* scoping context will be established before execution.
*/
if (acpi_ns_get_type (info->node) == ACPI_TYPE_LOCAL_METHOD_ALIAS) {
info->node = ACPI_CAST_PTR (struct acpi_namespace_node, info->node->object);
......@@ -314,11 +307,9 @@ acpi_ns_evaluate_by_handle (
/*
* Two major cases here:
* 1) The object is an actual control method -- execute it.
* 2) The object is not a method -- just return it's current
* value
* 2) The object is not a method -- just return it's current value
*
* In both cases, the namespace is unlocked by the
* acpi_ns* procedure
* In both cases, the namespace is unlocked by the acpi_ns* procedure
*/
if (acpi_ns_get_type (info->node) == ACPI_TYPE_METHOD) {
/*
......@@ -328,15 +319,13 @@ acpi_ns_evaluate_by_handle (
}
else {
/*
* Case 2) Object is NOT a method, just return its
* current value
* Case 2) Object is NOT a method, just return its current value
*/
status = acpi_ns_get_object_value (info);
}
/*
* Check if there is a return value on the stack that must
* be dealt with
* Check if there is a return value on the stack that must be dealt with
*/
if (status == AE_CTRL_RETURN_VALUE) {
/* Map AE_CTRL_RETURN_VALUE to AE_OK, we are done with it */
......@@ -345,8 +334,8 @@ acpi_ns_evaluate_by_handle (
}
/*
* Namespace was unlocked by the handling acpi_ns* function,
* so we just return
* Namespace was unlocked by the handling acpi_ns* function, so we
* just return
*/
return_ACPI_STATUS (status);
}
......@@ -356,12 +345,7 @@ acpi_ns_evaluate_by_handle (
*
* FUNCTION: acpi_ns_execute_control_method
*
* PARAMETERS: method_node - The method to execute
* Params - List of parameters to pass to the method,
* terminated by NULL. Params itself may be
* NULL if no parameters are being passed.
* return_obj_desc - List of result objects to be returned
* from the method.
* PARAMETERS: Info - Method info block (w/params)
*
* RETURN: Status
*
......@@ -430,8 +414,7 @@ acpi_ns_execute_control_method (
*
* FUNCTION: acpi_ns_get_object_value
*
* PARAMETERS: Node - The object
* return_obj_desc - Where the objects value is returned
* PARAMETERS: Info - Method info block (w/params)
*
* RETURN: Status
*
......@@ -453,28 +436,25 @@ acpi_ns_get_object_value (
/*
* Objects require additional resolution steps (e.g., the
* Node may be a field that must be read, etc.) -- we can't just grab
* the object out of the node.
* Objects require additional resolution steps (e.g., the Node may be a
* field that must be read, etc.) -- we can't just grab the object out of
* the node.
*/
/*
* Use resolve_node_to_value() to get the associated value. This call
* always deletes obj_desc (allocated above).
* Use resolve_node_to_value() to get the associated value. This call always
* deletes obj_desc (allocated above).
*
* NOTE: we can get away with passing in NULL for a walk state
* because obj_desc is guaranteed to not be a reference to either
* a method local or a method argument (because this interface can only be
* called from the acpi_evaluate external interface, never called from
* a running control method.)
* NOTE: we can get away with passing in NULL for a walk state because
* obj_desc is guaranteed to not be a reference to either a method local or
* a method argument (because this interface can only be called from the
* acpi_evaluate external interface, never called from a running method.)
*
* Even though we do not directly invoke the interpreter
* for this, we must enter it because we could access an opregion.
* The opregion access code assumes that the interpreter
* is locked.
* Even though we do not directly invoke the interpreter for this, we must
* enter it because we could access an opregion. The opregion access code
* assumes that the interpreter is locked.
*
* We must release the namespace lock before entering the
* intepreter.
* We must release the namespace lock before entering the intepreter.
*/
status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (status)) {
......@@ -485,16 +465,18 @@ acpi_ns_get_object_value (
if (ACPI_SUCCESS (status)) {
status = acpi_ex_resolve_node_to_value (&resolved_node, NULL);
/*
* If acpi_ex_resolve_node_to_value() succeeded, the return value was
* placed in resolved_node.
* If acpi_ex_resolve_node_to_value() succeeded, the return value was placed
* in resolved_node.
*/
acpi_ex_exit_interpreter ();
if (ACPI_SUCCESS (status)) {
status = AE_CTRL_RETURN_VALUE;
info->return_object = ACPI_CAST_PTR (union acpi_operand_object, resolved_node);
info->return_object = ACPI_CAST_PTR
(union acpi_operand_object, resolved_node);
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returning object %p [%s]\n",
info->return_object, acpi_ut_get_object_type_name (info->return_object)));
info->return_object,
acpi_ut_get_object_type_name (info->return_object)));
}
}
......
......@@ -77,7 +77,8 @@ acpi_ns_initialize_objects (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Completing Region/Field/Buffer/Package initialization:"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
"Completing Region/Field/Buffer/Package initialization:"));
/* Set all init info to zero */
......@@ -142,7 +143,8 @@ acpi_ns_initialize_devices (
info.num_STA = 0;
info.num_INI = 0;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Executing all Device _STA and_INI methods:"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
"Executing all Device _STA and_INI methods:"));
status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (status)) {
......@@ -257,8 +259,8 @@ acpi_ns_init_one_object (
}
/*
* Each of these types can contain executable AML code within
* the declaration.
* Each of these types can contain executable AML code within the
* declaration.
*/
switch (type) {
case ACPI_TYPE_REGION:
......@@ -267,21 +269,18 @@ acpi_ns_init_one_object (
status = acpi_ds_get_region_arguments (obj_desc);
break;
case ACPI_TYPE_BUFFER_FIELD:
info->field_init++;
status = acpi_ds_get_buffer_field_arguments (obj_desc);
break;
case ACPI_TYPE_BUFFER:
info->buffer_init++;
status = acpi_ds_get_buffer_arguments (obj_desc);
break;
case ACPI_TYPE_PACKAGE:
info->package_init++;
......@@ -301,15 +300,17 @@ acpi_ns_init_one_object (
acpi_format_exception (status)));
}
/* Print a dot for each object unless we are going to print the entire pathname */
/*
* Print a dot for each object unless we are going to print the entire
* pathname
*/
if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
}
/*
* We ignore errors from above, and always return OK, since
* we don't want to abort the walk on any single error.
* We ignore errors from above, and always return OK, since we don't want
* to abort the walk on any single error.
*/
acpi_ex_exit_interpreter ();
return (AE_OK);
......@@ -363,7 +364,8 @@ acpi_ns_init_one_device (
return_ACPI_STATUS (AE_OK);
}
if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) && (!(acpi_dbg_level & ACPI_LV_INFO))) {
if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) &&
(!(acpi_dbg_level & ACPI_LV_INFO))) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
}
......@@ -429,6 +431,5 @@ acpi_ns_init_one_device (
status = acpi_gbl_init_handler (pinfo.node, ACPI_INIT_DEVICE_INI);
}
return_ACPI_STATUS (status);
}
......@@ -92,12 +92,14 @@ acpi_ns_load_table (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AML block at %p\n", table_desc->aml_start));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AML block at %p\n",
table_desc->aml_start));
/* Ignore table if there is no AML contained within */
if (!table_desc->aml_length) {
ACPI_REPORT_WARNING (("Zero-length AML block in table [%4.4s]\n", table_desc->pointer->signature));
ACPI_REPORT_WARNING (("Zero-length AML block in table [%4.4s]\n",
table_desc->pointer->signature));
return_ACPI_STATUS (AE_OK);
}
......@@ -110,7 +112,8 @@ acpi_ns_load_table (
* to another control method, we can't continue parsing
* because we don't know how many arguments to parse next!
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Loading table into namespace ****\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"**** Loading table into namespace ****\n"));
status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (status)) {
......@@ -196,7 +199,6 @@ acpi_ns_load_table_by_type (
if (ACPI_SUCCESS (status)) {
table_desc->loaded_into_namespace = TRUE;
}
break;
......@@ -252,7 +254,6 @@ acpi_ns_load_table_by_type (
table_desc = table_desc->next;
}
break;
......
......@@ -202,7 +202,11 @@ acpi_ns_get_pathname_length (
next_node = acpi_ns_get_parent_node (next_node);
}
return (size + 1);
if (!size) {
size = 1; /* Root node case */
}
return (size + 1); /* +1 for null string terminator */
}
......@@ -253,7 +257,8 @@ acpi_ns_handle_to_pathname (
acpi_ns_build_external_path (node, required_size, buffer->pointer);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X] \n", (char *) buffer->pointer, (u32) required_size));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X] \n",
(char *) buffer->pointer, (u32) required_size));
return_ACPI_STATUS (AE_OK);
}
......
......@@ -96,8 +96,10 @@ acpi_ns_search_node (
scope_name = acpi_ns_get_external_pathname (node);
if (scope_name) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s (%p) For [%4.4s] (%s)\n",
scope_name, node, (char *) &target_name, acpi_ut_get_type_name (type)));
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Searching %s (%p) For [%4.4s] (%s)\n",
scope_name, node, (char *) &target_name,
acpi_ut_get_type_name (type)));
ACPI_MEM_FREE (scope_name);
}
......@@ -164,7 +166,7 @@ acpi_ns_search_node (
* PARAMETERS: *target_name - Ascii ACPI name to search for
* *Node - Starting node where search will begin
* Type - Object type to match
* **return_node - Where the matched Named Obj is returned
* **return_node - Where the matched Node is returned
*
* RETURN: Status
*
......@@ -199,13 +201,13 @@ acpi_ns_search_parent_tree (
parent_node = acpi_ns_get_parent_node (node);
/*
* If there is no parent (i.e., we are at the root) or
* type is "local", we won't be searching the parent tree.
* If there is no parent (i.e., we are at the root) or type is "local",
* we won't be searching the parent tree.
*/
if (!parent_node) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] has no parent\n",
(char *) &target_name));
return_ACPI_STATUS (AE_NOT_FOUND);
return_ACPI_STATUS (AE_NOT_FOUND);
}
if (acpi_ns_local (type)) {
......@@ -217,11 +219,12 @@ acpi_ns_search_parent_tree (
/* Search the parent tree */
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching parent for %4.4s\n", (char *) &target_name));
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Searching parent [%4.4s] for [%4.4s]\n",
acpi_ut_get_node_name (parent_node), (char *) &target_name));
/*
* Search parents until found the target or we have backed up to
* the root
* Search parents until target is found or we have backed up to the root
*/
while (parent_node) {
/*
......@@ -230,7 +233,7 @@ acpi_ns_search_parent_tree (
* the actual name we are searching for. Typechecking comes later.
*/
status = acpi_ns_search_node (target_name, parent_node,
ACPI_TYPE_ANY, return_node);
ACPI_TYPE_ANY, return_node);
if (ACPI_SUCCESS (status)) {
return_ACPI_STATUS (status);
}
......@@ -293,7 +296,8 @@ acpi_ns_search_and_enter (
/* Parameter validation */
if (!node || !target_name || !return_node) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null param: Node %p Name %X return_node %p\n",
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Null param: Node %p Name %X return_node %p\n",
node, target_name, return_node));
ACPI_REPORT_ERROR (("ns_search_and_enter: Null parameter\n"));
......@@ -330,22 +334,20 @@ acpi_ns_search_and_enter (
}
/*
* The name was not found. If we are NOT performing the
* first pass (name entry) of loading the namespace, search
* the parent tree (all the way to the root if necessary.)
* We don't want to perform the parent search when the
* namespace is actually being loaded. We want to perform
* the search when namespace references are being resolved
* (load pass 2) and during the execution phase.
* The name was not found. If we are NOT performing the first pass
* (name entry) of loading the namespace, search the parent tree (all the
* way to the root if necessary.) We don't want to perform the parent
* search when the namespace is actually being loaded. We want to perform
* the search when namespace references are being resolved (load pass 2)
* and during the execution phase.
*/
if ((interpreter_mode != ACPI_IMODE_LOAD_PASS1) &&
(flags & ACPI_NS_SEARCH_PARENT)) {
/*
* Not found at this level - search parent tree according
* to ACPI specification
* Not found at this level - search parent tree according to the
* ACPI specification
*/
status = acpi_ns_search_parent_tree (target_name, node,
type, return_node);
status = acpi_ns_search_parent_tree (target_name, node, type, return_node);
if (ACPI_SUCCESS (status)) {
return_ACPI_STATUS (status);
}
......@@ -355,7 +357,8 @@ acpi_ns_search_and_enter (
* In execute mode, just search, never add names. Exit now.
*/
if (interpreter_mode == ACPI_IMODE_EXECUTE) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s Not found in %p [Not adding]\n",
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"%4.4s Not found in %p [Not adding]\n",
(char *) &target_name, node));
return_ACPI_STATUS (AE_NOT_FOUND);
......
......@@ -85,12 +85,14 @@ acpi_ns_report_error (
if (lookup_status == AE_BAD_CHARACTER) {
/* There is a non-ascii character in the name */
acpi_os_printf ("[0x%4.4X] (NON-ASCII)\n", *(ACPI_CAST_PTR (u32, internal_name)));
acpi_os_printf ("[0x%4.4X] (NON-ASCII)\n",
*(ACPI_CAST_PTR (u32, internal_name)));
}
else {
/* Convert path to external format */
status = acpi_ns_externalize_name (ACPI_UINT32_MAX, internal_name, NULL, &name);
status = acpi_ns_externalize_name (ACPI_UINT32_MAX,
internal_name, NULL, &name);
/* Print target name */
......@@ -141,7 +143,8 @@ acpi_ns_report_method_error (
if (path) {
status = acpi_ns_get_node_by_path (path, prefix_node, ACPI_NS_NO_UPSEARCH, &node);
status = acpi_ns_get_node_by_path (path, prefix_node,
ACPI_NS_NO_UPSEARCH, &node);
if (ACPI_FAILURE (status)) {
acpi_os_printf ("report_method_error: Could not get node\n");
return;
......@@ -180,7 +183,7 @@ acpi_ns_print_node_pathname (
return;
}
/* Convert handle to a full pathname and print it (with supplied message) */
/* Convert handle to full pathname and print it (with supplied message) */
buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
......@@ -324,13 +327,11 @@ acpi_ns_get_internal_name_length (
info->fully_qualified = FALSE;
/*
* For the internal name, the required length is 4 bytes
* per segment, plus 1 each for root_prefix, multi_name_prefix_op,
* segment count, trailing null (which is not really needed,
* but no there's harm in putting it there)
* For the internal name, the required length is 4 bytes per segment, plus
* 1 each for root_prefix, multi_name_prefix_op, segment count, trailing null
* (which is not really needed, but no there's harm in putting it there)
*
* strlen() + 1 covers the first name_seg, which has no
* path separator
* strlen() + 1 covers the first name_seg, which has no path separator
*/
if (acpi_ns_valid_root_prefix (next_external_char[0])) {
info->fully_qualified = TRUE;
......@@ -347,10 +348,9 @@ acpi_ns_get_internal_name_length (
}
/*
* Determine the number of ACPI name "segments" by counting
* the number of path separators within the string. Start
* with one segment since the segment count is (# separators)
* + 1, and zero separators is ok.
* Determine the number of ACPI name "segments" by counting the number of
* path separators within the string. Start with one segment since the
* segment count is [(# separators) + 1], and zero separators is ok.
*/
if (*next_external_char) {
info->num_segments = 1;
......@@ -625,7 +625,8 @@ acpi_ns_externalize_name (
/* <count> 4-byte names */
names_index = prefix_length + 2;
num_segments = (acpi_native_uint) (u8) internal_name[(acpi_native_uint) (prefix_length + 1)];
num_segments = (acpi_native_uint) (u8)
internal_name[(acpi_native_uint) (prefix_length + 1)];
break;
case AML_DUAL_NAME_PREFIX:
......@@ -672,7 +673,7 @@ acpi_ns_externalize_name (
}
/*
* Build converted_name...
* Build converted_name
*/
*converted_name = ACPI_MEM_CALLOCATE (required_length);
if (!(*converted_name)) {
......@@ -756,7 +757,7 @@ acpi_ns_map_handle_to_node (
*
* PARAMETERS: Node - Node to be converted to a Handle
*
* RETURN: An USER acpi_handle
* RETURN: A user handle
*
* DESCRIPTION: Convert a real Node to a namespace handle
*
......@@ -976,7 +977,8 @@ acpi_ns_find_parent_name (
parent_node = acpi_ns_get_parent_node (child_node);
if (parent_node) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Parent of %p [%4.4s] is %p [%4.4s]\n",
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Parent of %p [%4.4s] is %p [%4.4s]\n",
child_node, acpi_ut_get_node_name (child_node),
parent_node, acpi_ut_get_node_name (parent_node)));
......@@ -985,7 +987,8 @@ acpi_ns_find_parent_name (
}
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n",
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Unable to find parent of %p (%4.4s)\n",
child_node, acpi_ut_get_node_name (child_node)));
}
......@@ -1018,11 +1021,9 @@ acpi_ns_get_parent_node (
}
/*
* Walk to the end of this peer list.
* The last entry is marked with a flag and the peer
* pointer is really a pointer back to the parent.
* This saves putting a parent back pointer in each and
* every named object!
* Walk to the end of this peer list. The last entry is marked with a flag
* and the peer pointer is really a pointer back to the parent. This saves
* putting a parent back pointer in each and every named object!
*/
while (!(node->flags & ANOBJ_END_OF_PEER_LIST)) {
node = node->peer;
......@@ -1039,8 +1040,8 @@ acpi_ns_get_parent_node (
*
* PARAMETERS: Node - Current table entry
*
* RETURN: Next valid Node in the linked node list. NULL if no more valid
* nodess
* RETURN: Next valid Node in the linked node list. NULL if no more valid
* nodes.
*
* DESCRIPTION: Find the next valid node within a name table.
* Useful for implementing NULL-end-of-list loops.
......
......@@ -264,8 +264,8 @@ acpi_ns_walk_namespace (
* node, visit the onde
*/
level++;
parent_node = child_node;
child_node = NULL;
parent_node = child_node;
child_node = NULL;
}
}
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -129,10 +129,9 @@ union acpi_parse_object*
acpi_ps_alloc_op (
u16 opcode)
{
union acpi_parse_object *op = NULL;
u32 size;
u8 flags;
union acpi_parse_object *op;
const struct acpi_opcode_info *op_info;
u8 flags = ACPI_PARSEOP_GENERIC;
ACPI_FUNCTION_ENTRY ();
......@@ -140,32 +139,28 @@ acpi_ps_alloc_op (
op_info = acpi_ps_get_opcode_info (opcode);
/* Allocate the minimum required size object */
/* Determine type of parse_op required */
if (op_info->flags & AML_DEFER) {
size = sizeof (struct acpi_parse_obj_named);
flags = ACPI_PARSEOP_DEFERRED;
}
else if (op_info->flags & AML_NAMED) {
size = sizeof (struct acpi_parse_obj_named);
flags = ACPI_PARSEOP_NAMED;
}
else if (opcode == AML_INT_BYTELIST_OP) {
size = sizeof (struct acpi_parse_obj_named);
flags = ACPI_PARSEOP_BYTELIST;
}
else {
size = sizeof (struct acpi_parse_obj_common);
flags = ACPI_PARSEOP_GENERIC;
}
if (size == sizeof (struct acpi_parse_obj_common)) {
/*
* The generic op is by far the most common (16 to 1)
*/
/* Allocate the minimum required size object */
if (flags == ACPI_PARSEOP_GENERIC) {
/* The generic op (default) is by far the most common (16 to 1) */
op = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_PSNODE);
}
else {
/* Extended parseop */
op = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_PSNODE_EXT);
}
......
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.
......@@ -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-$(CONFIG_PNPACPI) += pnpacpi/
obj-$(CONFIG_PNPBIOS) += pnpbios/
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