Commit 50eca3eb authored by Bob Moore's avatar Bob Moore Committed by Len Brown

[ACPI] ACPICA 20050930

Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)

All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".

The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available.  Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)

Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.

acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 3d5271f9
......@@ -33,33 +33,33 @@ acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
struct acpi_vendor_info *info = (struct acpi_vendor_info *)context;
struct acpi_resource_vendor *vendor;
struct acpi_vendor_descriptor *descriptor;
u32 length;
u32 byte_length;
if (resource->type != ACPI_RSTYPE_VENDOR)
if (resource->type != ACPI_RESOURCE_TYPE_VENDOR)
return AE_OK;
vendor = (struct acpi_resource_vendor *)&resource->data;
descriptor = (struct acpi_vendor_descriptor *)vendor->reserved;
if (vendor->length <= sizeof(*info->descriptor) ||
descriptor = (struct acpi_vendor_descriptor *)vendor->byte_data;
if (vendor->byte_length <= sizeof(*info->descriptor) ||
descriptor->guid_id != info->descriptor->guid_id ||
efi_guidcmp(descriptor->guid, info->descriptor->guid))
return AE_OK;
length = vendor->length - sizeof(struct acpi_vendor_descriptor);
info->data = acpi_os_allocate(length);
byte_length = vendor->byte_length - sizeof(struct acpi_vendor_descriptor);
info->data = acpi_os_allocate(byte_length);
if (!info->data)
return AE_NO_MEMORY;
memcpy(info->data,
vendor->reserved + sizeof(struct acpi_vendor_descriptor),
length);
info->length = length;
vendor->byte_data + sizeof(struct acpi_vendor_descriptor),
byte_length);
info->length = byte_length;
return AE_CTRL_TERMINATE;
}
acpi_status
acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor * id,
u8 ** data, u32 * length)
u8 ** data, u32 * byte_length)
{
struct acpi_vendor_info info;
......@@ -72,7 +72,7 @@ acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor * id,
return AE_NOT_FOUND;
*data = info.data;
*length = info.length;
*byte_length = info.length;
return AE_OK;
}
......
......@@ -193,12 +193,12 @@ add_io_space (struct pci_root_info *info, struct acpi_resource_address64 *addr)
goto free_resource;
}
min = addr->min_address_range;
min = addr->minimum;
max = min + addr->address_length - 1;
if (addr->attribute.io.translation_attribute == ACPI_SPARSE_TRANSLATION)
sparse = 1;
space_nr = new_space(addr->address_translation_offset, sparse);
space_nr = new_space(addr->translation_offset, sparse);
if (space_nr == ~0)
goto free_name;
......@@ -285,7 +285,7 @@ static __devinit acpi_status add_window(struct acpi_resource *res, void *data)
if (addr.resource_type == ACPI_MEMORY_RANGE) {
flags = IORESOURCE_MEM;
root = &iomem_resource;
offset = addr.address_translation_offset;
offset = addr.translation_offset;
} else if (addr.resource_type == ACPI_IO_RANGE) {
flags = IORESOURCE_IO;
root = &ioport_resource;
......@@ -298,7 +298,7 @@ static __devinit acpi_status add_window(struct acpi_resource *res, void *data)
window = &info->controller->window[info->controller->windows++];
window->resource.name = info->name;
window->resource.flags = flags;
window->resource.start = addr.min_address_range + offset;
window->resource.start = addr.minimum + offset;
window->resource.end = window->resource.start + addr.address_length - 1;
window->resource.child = NULL;
window->offset = offset;
......
......@@ -1956,7 +1956,7 @@ int __init io_apic_get_redir_entries (int ioapic)
}
int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low)
int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int polarity)
{
struct IO_APIC_route_entry entry;
unsigned long flags;
......@@ -1978,8 +1978,8 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
entry.delivery_mode = INT_DELIVERY_MODE;
entry.dest_mode = INT_DEST_MODE;
entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
entry.trigger = edge_level;
entry.polarity = active_high_low;
entry.trigger = triggering;
entry.polarity = polarity;
entry.mask = 1; /* Disabled (masked) */
irq = gsi_irq_sharing(irq);
......@@ -1994,9 +1994,9 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
apic_printk(APIC_VERBOSE,KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> "
"IRQ %d Mode:%i Active:%i)\n", ioapic,
mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
edge_level, active_high_low);
triggering, polarity);
ioapic_register_intr(irq, entry.vector, edge_level);
ioapic_register_intr(irq, entry.vector, triggering);
if (!ioapic && (irq < 16))
disable_8259A_irq(irq);
......
......@@ -915,7 +915,7 @@ void __init mp_config_acpi_legacy_irqs (void)
#define MAX_GSI_NUM 4096
int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
int mp_register_gsi(u32 gsi, int triggering, int polarity)
{
int ioapic = -1;
int ioapic_pin = 0;
......@@ -964,7 +964,7 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit);
if (edge_level) {
if (triggering) {
/*
* For PCI devices assign IRQs in order, avoiding gaps
* due to unused I/O APIC pins.
......@@ -986,8 +986,8 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
}
io_apic_set_pci_routing(ioapic, ioapic_pin, gsi,
edge_level == ACPI_EDGE_SENSITIVE ? 0 : 1,
active_high_low == ACPI_ACTIVE_HIGH ? 0 : 1);
triggering == ACPI_EDGE_SENSITIVE ? 0 : 1,
polarity == ACPI_ACTIVE_HIGH ? 0 : 1);
return gsi;
}
......
......@@ -101,8 +101,8 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
address64.attribute.memory.cache_attribute;
mem_device->read_write_attribute =
address64.attribute.memory.read_write_attribute;
mem_device->start_addr = address64.min_address_range;
mem_device->end_addr = address64.max_address_range;
mem_device->start_addr = address64.minimum;
mem_device->end_addr = address64.maximum;
}
}
......
......@@ -177,7 +177,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
if (!op) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Null Op\n"));
return_VALUE(TRUE);
return_UINT8(TRUE);
}
/*
......@@ -208,7 +208,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
"At Method level, result of [%s] not used\n",
acpi_ps_get_opcode_name(op->common.
aml_opcode)));
return_VALUE(FALSE);
return_UINT8(FALSE);
}
/* Get info on the parent. The root_op is AML_SCOPE */
......@@ -218,7 +218,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
if (parent_info->class == AML_CLASS_UNKNOWN) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unknown parent opcode. Op=%p\n", op));
return_VALUE(FALSE);
return_UINT8(FALSE);
}
/*
......@@ -304,7 +304,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
acpi_ps_get_opcode_name(op->common.parent->common.
aml_opcode), op));
return_VALUE(TRUE);
return_UINT8(TRUE);
result_not_used:
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
......@@ -313,7 +313,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
acpi_ps_get_opcode_name(op->common.parent->common.
aml_opcode), op));
return_VALUE(FALSE);
return_UINT8(FALSE);
}
/*******************************************************************************
......@@ -616,7 +616,7 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
if (op_info->flags & AML_HAS_RETVAL) {
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"Argument previously created, already stacked \n"));
"Argument previously created, already stacked\n"));
ACPI_DEBUGGER_EXEC(acpi_db_display_argument_object
(walk_state->
......
......@@ -1151,7 +1151,7 @@ acpi_ec_io_ports(struct acpi_resource *resource, void *context)
union acpi_ec *ec = (union acpi_ec *)context;
struct acpi_generic_address *addr;
if (resource->type != ACPI_RSTYPE_IO) {
if (resource->type != ACPI_RESOURCE_TYPE_IO) {
return AE_OK;
}
......@@ -1171,7 +1171,7 @@ acpi_ec_io_ports(struct acpi_resource *resource, void *context)
addr->address_space_id = ACPI_ADR_SPACE_SYSTEM_IO;
addr->register_bit_width = 8;
addr->register_bit_offset = 0;
addr->address = resource->data.io.min_base_address;
addr->address = resource->data.io.minimum;
return AE_OK;
}
......
......@@ -600,7 +600,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
status = acpi_hw_clear_gpe(gpe_event_info);
if (ACPI_FAILURE(status)) {
ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to clear GPE[%2X]\n", acpi_format_exception(status), gpe_number));
return_VALUE(ACPI_INTERRUPT_NOT_HANDLED);
return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
}
}
......@@ -638,7 +638,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
status = acpi_hw_clear_gpe(gpe_event_info);
if (ACPI_FAILURE(status)) {
ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to clear GPE[%2X]\n", acpi_format_exception(status), gpe_number));
return_VALUE(ACPI_INTERRUPT_NOT_HANDLED);
return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
}
}
break;
......@@ -652,7 +652,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
status = acpi_ev_disable_gpe(gpe_event_info);
if (ACPI_FAILURE(status)) {
ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to disable GPE[%2X]\n", acpi_format_exception(status), gpe_number));
return_VALUE(ACPI_INTERRUPT_NOT_HANDLED);
return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
}
/*
......@@ -680,12 +680,12 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
status = acpi_ev_disable_gpe(gpe_event_info);
if (ACPI_FAILURE(status)) {
ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to disable GPE[%2X]\n", acpi_format_exception(status), gpe_number));
return_VALUE(ACPI_INTERRUPT_NOT_HANDLED);
return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
}
break;
}
return_VALUE(ACPI_INTERRUPT_HANDLED);
return_UINT32(ACPI_INTERRUPT_HANDLED);
}
#ifdef ACPI_GPE_NOTIFY_CHECK
......
......@@ -88,7 +88,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context)
*/
interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
return_VALUE(interrupt_handled);
return_UINT32(interrupt_handled);
}
/*******************************************************************************
......@@ -121,7 +121,7 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context)
*/
interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
return_VALUE(interrupt_handled);
return_UINT32(interrupt_handled);
}
/******************************************************************************
......
......@@ -214,7 +214,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
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.pointer);
......@@ -320,17 +320,17 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
case ACPI_TYPE_BUFFER_FIELD:
acpi_os_printf("buffer_field: %X bits at byte %X bit %X of \n",
acpi_os_printf("buffer_field: %X bits at byte %X bit %X of\n",
obj_desc->buffer_field.bit_length,
obj_desc->buffer_field.base_byte_offset,
obj_desc->buffer_field.start_field_bit_offset);
if (!obj_desc->buffer_field.buffer_obj) {
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "*NULL* \n"));
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "*NULL*\n"));
} else
if (ACPI_GET_OBJECT_TYPE(obj_desc->buffer_field.buffer_obj)
!= ACPI_TYPE_BUFFER) {
acpi_os_printf("*not a Buffer* \n");
acpi_os_printf("*not a Buffer*\n");
} else {
acpi_ex_dump_operand(obj_desc->buffer_field.buffer_obj,
depth + 1);
......@@ -618,7 +618,7 @@ acpi_ex_dump_package(union acpi_operand_object *obj_desc, u32 level, u32 index)
case ACPI_TYPE_PACKAGE:
acpi_os_printf("[Package] Contains %d Elements: \n",
acpi_os_printf("[Package] Contains %d Elements:\n",
obj_desc->package.count);
for (i = 0; i < obj_desc->package.count; i++) {
......
......@@ -191,10 +191,10 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
if (name_string) {
ACPI_STRCAT(name_string, char_buf);
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
"Appended to - %s \n", name_string));
"Appended to - %s\n", name_string));
} else {
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
"No Name string - %s \n", char_buf));
"No Name string - %s\n", char_buf));
}
} else if (index == 0) {
/*
......
......@@ -276,7 +276,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unknown field access type %X\n", access));
return_VALUE(0);
return_UINT32(0);
}
if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_BUFFER_FIELD) {
......@@ -289,7 +289,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
}
*return_byte_alignment = byte_alignment;
return_VALUE(bit_length);
return_UINT32(bit_length);
}
/*******************************************************************************
......
......@@ -157,7 +157,7 @@ acpi_ex_resolve_operands(u16 opcode,
}
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"Opcode %X [%s] required_operand_types=%8.8X \n",
"Opcode %X [%s] required_operand_types=%8.8X\n",
opcode, op_info->name, arg_types));
/*
......
......@@ -206,7 +206,7 @@ u8 acpi_ex_acquire_global_lock(u32 field_flags)
}
}
return_VALUE(locked);
return_UINT8(locked);
}
/*******************************************************************************
......@@ -268,7 +268,7 @@ static u32 acpi_ex_digits_needed(acpi_integer value, u32 base)
/* acpi_integer is unsigned, so we don't worry about a '-' prefix */
if (value == 0) {
return_VALUE(1);
return_UINT32(1);
}
current_value = value;
......@@ -282,7 +282,7 @@ static u32 acpi_ex_digits_needed(acpi_integer value, u32 base)
num_digits++;
}
return_VALUE(num_digits);
return_UINT32(num_digits);
}
/*******************************************************************************
......
......@@ -99,15 +99,15 @@ do_root_bridge_busnr_callback(struct acpi_resource *resource, void *data)
unsigned long *busnr = (unsigned long *)data;
struct acpi_resource_address64 address;
if (resource->type != ACPI_RSTYPE_ADDRESS16 &&
resource->type != ACPI_RSTYPE_ADDRESS32 &&
resource->type != ACPI_RSTYPE_ADDRESS64)
if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 &&
resource->type != ACPI_RESOURCE_TYPE_ADDRESS32 &&
resource->type != ACPI_RESOURCE_TYPE_ADDRESS64)
return AE_OK;
acpi_resource_to_address64(resource, &address);
if ((address.address_length > 0) &&
(address.resource_type == ACPI_BUS_NUMBER_RANGE))
*busnr = address.min_address_range;
*busnr = address.minimum;
return AE_OK;
}
......
......@@ -204,18 +204,18 @@ u32 acpi_hw_get_mode(void)
* system does not support mode transition.
*/
if (!acpi_gbl_FADT->smi_cmd) {
return_VALUE(ACPI_SYS_MODE_ACPI);
return_UINT32(ACPI_SYS_MODE_ACPI);
}
status =
acpi_get_register(ACPI_BITREG_SCI_ENABLE, &value, ACPI_MTX_LOCK);
if (ACPI_FAILURE(status)) {
return_VALUE(ACPI_SYS_MODE_LEGACY);
return_UINT32(ACPI_SYS_MODE_LEGACY);
}
if (value) {
return_VALUE(ACPI_SYS_MODE_ACPI);
return_UINT32(ACPI_SYS_MODE_ACPI);
} else {
return_VALUE(ACPI_SYS_MODE_LEGACY);
return_UINT32(ACPI_SYS_MODE_LEGACY);
}
}
......@@ -54,36 +54,36 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data)
ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges");
if (res->type == ACPI_RSTYPE_IO) {
if (res->type == ACPI_RESOURCE_TYPE_IO) {
struct acpi_resource_io *io_res = &res->data.io;
if (io_res->min_base_address != io_res->max_base_address)
if (io_res->minimum != io_res->maximum)
return_VALUE(AE_OK);
if (IS_RESERVED_ADDR
(io_res->min_base_address, io_res->range_length)) {
(io_res->minimum, io_res->address_length)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Motherboard resources 0x%08x - 0x%08x\n",
io_res->min_base_address,
io_res->min_base_address +
io_res->range_length));
io_res->minimum,
io_res->minimum +
io_res->address_length));
requested_res =
request_region(io_res->min_base_address,
io_res->range_length, "motherboard");
request_region(io_res->minimum,
io_res->address_length, "motherboard");
}
} else if (res->type == ACPI_RSTYPE_FIXED_IO) {
} else if (res->type == ACPI_RESOURCE_TYPE_FIXED_IO) {
struct acpi_resource_fixed_io *fixed_io_res =
&res->data.fixed_io;
if (IS_RESERVED_ADDR
(fixed_io_res->base_address, fixed_io_res->range_length)) {
(fixed_io_res->address, fixed_io_res->address_length)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Motherboard resources 0x%08x - 0x%08x\n",
fixed_io_res->base_address,
fixed_io_res->base_address +
fixed_io_res->range_length));
fixed_io_res->address,
fixed_io_res->address +
fixed_io_res->address_length));
requested_res =
request_region(fixed_io_res->base_address,
fixed_io_res->range_length,
request_region(fixed_io_res->address,
fixed_io_res->address_length,
"motherboard");
}
} else {
......
......@@ -498,7 +498,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
path++;
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
"Multi Pathname (%d Segments, Flags=%X) \n",
"Multi Pathname (%d Segments, Flags=%X)\n",
num_segments, flags));
break;
......
......@@ -241,7 +241,7 @@ acpi_ns_handle_to_pathname(acpi_handle target_handle,
acpi_ns_build_external_path(node, required_size, buffer->pointer);
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X] \n",
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X]\n",
(char *)buffer->pointer, (u32) required_size));
return_ACPI_STATUS(AE_OK);
}
......@@ -249,10 +249,10 @@ acpi_object_type acpi_ns_get_type(struct acpi_namespace_node * node)
if (!node) {
ACPI_REPORT_WARNING(("ns_get_type: Null Node input pointer\n"));
return_VALUE(ACPI_TYPE_ANY);
return_UINT32(ACPI_TYPE_ANY);
}
return_VALUE((acpi_object_type) node->type);
return_UINT32((acpi_object_type) node->type);
}
/*******************************************************************************
......@@ -276,10 +276,10 @@ u32 acpi_ns_local(acpi_object_type type)
/* Type code out of range */
ACPI_REPORT_WARNING(("ns_local: Invalid Object Type\n"));
return_VALUE(ACPI_NS_NORMAL);
return_UINT32(ACPI_NS_NORMAL);
}
return_VALUE((u32) acpi_gbl_ns_properties[type] & ACPI_NS_LOCAL);
return_UINT32((u32) acpi_gbl_ns_properties[type] & ACPI_NS_LOCAL);
}
/*******************************************************************************
......@@ -805,10 +805,10 @@ u32 acpi_ns_opens_scope(acpi_object_type type)
ACPI_REPORT_WARNING(("ns_opens_scope: Invalid Object Type %X\n",
type));
return_VALUE(ACPI_NS_NORMAL);
return_UINT32(ACPI_NS_NORMAL);
}
return_VALUE(((u32) acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
return_UINT32(((u32) acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
}
/*******************************************************************************
......
......@@ -116,7 +116,7 @@ acpi_ps_get_next_package_length(struct acpi_parse_state *parser_state)
break;
}
return_VALUE(length);
return_UINT32(length);
}
/*******************************************************************************
......
......@@ -50,11 +50,145 @@
ACPI_MODULE_NAME("psxface")
/* Local Prototypes */
static void acpi_ps_start_trace(struct acpi_parameter_info *info);
static void acpi_ps_stop_trace(struct acpi_parameter_info *info);
static acpi_status acpi_ps_execute_pass(struct acpi_parameter_info *info);
static void
acpi_ps_update_parameter_list(struct acpi_parameter_info *info, u16 action);
/*******************************************************************************
*
* FUNCTION: acpi_debug_trace
*
* PARAMETERS: method_name - Valid ACPI name string
* debug_level - Optional level mask. 0 to use default
* debug_layer - Optional layer mask. 0 to use default
* Flags - bit 1: one shot(1) or persistent(0)
*
* RETURN: Status
*
* DESCRIPTION: External interface to enable debug tracing during control
* method execution
*
******************************************************************************/
acpi_status
acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags)
{
acpi_status status;
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) {
return (status);
}
/* TBDs: Validate name, allow full path or just nameseg */
acpi_gbl_trace_method_name = *(u32 *) name;
acpi_gbl_trace_flags = flags;
if (debug_level) {
acpi_gbl_trace_dbg_level = debug_level;
}
if (debug_layer) {
acpi_gbl_trace_dbg_layer = debug_layer;
}
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: acpi_ps_start_trace
*
* PARAMETERS: Info - Method info struct
*
* RETURN: None
*
* DESCRIPTION: Start control method execution trace
*
******************************************************************************/
static void acpi_ps_start_trace(struct acpi_parameter_info *info)
{
acpi_status status;
ACPI_FUNCTION_ENTRY();
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) {
return;
}
if ((!acpi_gbl_trace_method_name) ||
(acpi_gbl_trace_method_name != info->node->name.integer)) {
goto exit;
}
acpi_gbl_original_dbg_level = acpi_dbg_level;
acpi_gbl_original_dbg_layer = acpi_dbg_layer;
acpi_dbg_level = 0x00FFFFFF;
acpi_dbg_layer = ACPI_UINT32_MAX;
if (acpi_gbl_trace_dbg_level) {
acpi_dbg_level = acpi_gbl_trace_dbg_level;
}
if (acpi_gbl_trace_dbg_layer) {
acpi_dbg_layer = acpi_gbl_trace_dbg_layer;
}
exit:
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
}
/*******************************************************************************
*
* FUNCTION: acpi_ps_stop_trace
*
* PARAMETERS: Info - Method info struct
*
* RETURN: None
*
* DESCRIPTION: Stop control method execution trace
*
******************************************************************************/
static void acpi_ps_stop_trace(struct acpi_parameter_info *info)
{
acpi_status status;
ACPI_FUNCTION_ENTRY();
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) {
return;
}
if ((!acpi_gbl_trace_method_name) ||
(acpi_gbl_trace_method_name != info->node->name.integer)) {
goto exit;
}
/* Disable further tracing if type is one-shot */
if (acpi_gbl_trace_flags & 1) {
acpi_gbl_trace_method_name = 0;
acpi_gbl_trace_dbg_level = 0;
acpi_gbl_trace_dbg_layer = 0;
}
acpi_dbg_level = acpi_gbl_original_dbg_level;
acpi_dbg_layer = acpi_gbl_original_dbg_layer;
exit:
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
}
/*******************************************************************************
*
* FUNCTION: acpi_ps_execute_method
......@@ -104,6 +238,10 @@ acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info)
*/
acpi_ps_update_parameter_list(info, REF_INCREMENT);
/* Begin tracing if requested */
acpi_ps_start_trace(info);
/*
* 1) Perform the first pass parse of the method to enter any
* named objects that it creates into the namespace
......@@ -129,6 +267,10 @@ acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info)
status = acpi_ps_execute_pass(info);
cleanup:
/* End optional tracing */
acpi_ps_stop_trace(info);
/* Take away the extra reference that we gave the parameters above */
acpi_ps_update_parameter_list(info, REF_DECREMENT);
......
......@@ -258,7 +258,7 @@ typedef int (*irq_lookup_func) (struct acpi_prt_entry *, int *, int *, char **);
static int
acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
int *edge_level, int *active_high_low, char **link)
int *triggering, int *polarity, char **link)
{
int irq;
......@@ -266,8 +266,8 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
if (entry->link.handle) {
irq = acpi_pci_link_allocate_irq(entry->link.handle,
entry->link.index, edge_level,
active_high_low, link);
entry->link.index, triggering,
polarity, link);
if (irq < 0) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Invalid IRQ link routing entry\n"));
......@@ -275,8 +275,8 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
}
} else {
irq = entry->link.index;
*edge_level = ACPI_LEVEL_SENSITIVE;
*active_high_low = ACPI_ACTIVE_LOW;
*triggering = ACPI_LEVEL_SENSITIVE;
*polarity = ACPI_ACTIVE_LOW;
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq));
......@@ -285,7 +285,7 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
static int
acpi_pci_free_irq(struct acpi_prt_entry *entry,
int *edge_level, int *active_high_low, char **link)
int *triggering, int *polarity, char **link)
{
int irq;
......@@ -307,8 +307,8 @@ static int
acpi_pci_irq_lookup(struct pci_bus *bus,
int device,
int pin,
int *edge_level,
int *active_high_low, char **link, irq_lookup_func func)
int *triggering,
int *polarity, char **link, irq_lookup_func func)
{
struct acpi_prt_entry *entry = NULL;
int segment = pci_domain_nr(bus);
......@@ -327,7 +327,7 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
return_VALUE(-1);
}
ret = func(entry, edge_level, active_high_low, link);
ret = func(entry, triggering, polarity, link);
return_VALUE(ret);
}
......@@ -339,8 +339,8 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
static int
acpi_pci_irq_derive(struct pci_dev *dev,
int pin,
int *edge_level,
int *active_high_low, char **link, irq_lookup_func func)
int *triggering,
int *polarity, char **link, irq_lookup_func func)
{
struct pci_dev *bridge = dev;
int irq = -1;
......@@ -375,7 +375,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,
}
irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn),
pin, edge_level, active_high_low,
pin, triggering, polarity,
link, func);
}
......@@ -402,8 +402,8 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
{
int irq = 0;
u8 pin = 0;
int edge_level = ACPI_LEVEL_SENSITIVE;
int active_high_low = ACPI_ACTIVE_LOW;
int triggering = ACPI_LEVEL_SENSITIVE;
int polarity = ACPI_ACTIVE_LOW;
char *link = NULL;
int rc;
......@@ -432,7 +432,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
* values override any BIOS-assigned IRQs set during boot.
*/
irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
&edge_level, &active_high_low, &link,
&triggering, &polarity, &link,
acpi_pci_allocate_irq);
/*
......@@ -440,8 +440,8 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
* device's parent bridge.
*/
if (irq < 0)
irq = acpi_pci_irq_derive(dev, pin, &edge_level,
&active_high_low, &link,
irq = acpi_pci_irq_derive(dev, pin, &triggering,
&polarity, &link,
acpi_pci_allocate_irq);
/*
......@@ -463,7 +463,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
}
}
rc = acpi_register_gsi(irq, edge_level, active_high_low);
rc = acpi_register_gsi(irq, triggering, polarity);
if (rc < 0) {
printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed "
"to register GSI\n", pci_name(dev), ('A' + pin));
......@@ -478,8 +478,8 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
printk("Link [%s] -> ", link);
printk("GSI %u (%s, %s) -> IRQ %d\n", irq,
(edge_level == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
(active_high_low == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);
(triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
(polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);
return_VALUE(0);
}
......@@ -495,8 +495,8 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
{
int gsi = 0;
u8 pin = 0;
int edge_level = ACPI_LEVEL_SENSITIVE;
int active_high_low = ACPI_ACTIVE_LOW;
int triggering = ACPI_LEVEL_SENSITIVE;
int polarity = ACPI_ACTIVE_LOW;
ACPI_FUNCTION_TRACE("acpi_pci_irq_disable");
......@@ -512,7 +512,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
* First we check the PCI IRQ routing table (PRT) for an IRQ.
*/
gsi = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
&edge_level, &active_high_low, NULL,
&triggering, &polarity, NULL,
acpi_pci_free_irq);
/*
* If no PRT entry was found, we'll try to derive an IRQ from the
......@@ -520,7 +520,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
*/
if (gsi < 0)
gsi = acpi_pci_irq_derive(dev, pin,
&edge_level, &active_high_low, NULL,
&triggering, &polarity, NULL,
acpi_pci_free_irq);
if (gsi < 0)
return_VOID;
......
......@@ -70,8 +70,8 @@ static struct acpi_driver acpi_pci_link_driver = {
*/
struct acpi_pci_link_irq {
u8 active; /* Current IRQ */
u8 edge_level; /* All IRQs */
u8 active_high_low; /* All IRQs */
u8 triggering; /* All IRQs */
u8 polarity; /* All IRQs */
u8 resource_type;
u8 possible_count;
u8 possible[ACPI_PCI_LINK_MAX_POSSIBLE];
......@@ -109,18 +109,18 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
ACPI_FUNCTION_TRACE("acpi_pci_link_check_possible");
switch (resource->type) {
case ACPI_RSTYPE_START_DPF:
case ACPI_RESOURCE_TYPE_START_DEPENDENT:
return_ACPI_STATUS(AE_OK);
case ACPI_RSTYPE_IRQ:
case ACPI_RESOURCE_TYPE_IRQ:
{
struct acpi_resource_irq *p = &resource->data.irq;
if (!p || !p->number_of_interrupts) {
if (!p || !p->interrupt_count) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Blank IRQ resource\n"));
return_ACPI_STATUS(AE_OK);
}
for (i = 0;
(i < p->number_of_interrupts
(i < p->interrupt_count
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
if (!p->interrupts[i]) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
......@@ -131,22 +131,22 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
link->irq.possible[i] = p->interrupts[i];
link->irq.possible_count++;
}
link->irq.edge_level = p->edge_level;
link->irq.active_high_low = p->active_high_low;
link->irq.resource_type = ACPI_RSTYPE_IRQ;
link->irq.triggering = p->triggering;
link->irq.polarity = p->polarity;
link->irq.resource_type = ACPI_RESOURCE_TYPE_IRQ;
break;
}
case ACPI_RSTYPE_EXT_IRQ:
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
{
struct acpi_resource_ext_irq *p =
struct acpi_resource_extended_irq *p =
&resource->data.extended_irq;
if (!p || !p->number_of_interrupts) {
if (!p || !p->interrupt_count) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Blank EXT IRQ resource\n"));
return_ACPI_STATUS(AE_OK);
}
for (i = 0;
(i < p->number_of_interrupts
(i < p->interrupt_count
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
if (!p->interrupts[i]) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
......@@ -157,9 +157,9 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
link->irq.possible[i] = p->interrupts[i];
link->irq.possible_count++;
}
link->irq.edge_level = p->edge_level;
link->irq.active_high_low = p->active_high_low;
link->irq.resource_type = ACPI_RSTYPE_EXT_IRQ;
link->irq.triggering = p->triggering;
link->irq.polarity = p->polarity;
link->irq.resource_type = ACPI_RESOURCE_TYPE_EXTENDED_IRQ;
break;
}
default:
......@@ -202,10 +202,10 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
ACPI_FUNCTION_TRACE("acpi_pci_link_check_current");
switch (resource->type) {
case ACPI_RSTYPE_IRQ:
case ACPI_RESOURCE_TYPE_IRQ:
{
struct acpi_resource_irq *p = &resource->data.irq;
if (!p || !p->number_of_interrupts) {
if (!p || !p->interrupt_count) {
/*
* IRQ descriptors may have no IRQ# bits set,
* particularly those those w/ _STA disabled
......@@ -217,11 +217,11 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
*irq = p->interrupts[0];
break;
}
case ACPI_RSTYPE_EXT_IRQ:
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
{
struct acpi_resource_ext_irq *p =
struct acpi_resource_extended_irq *p =
&resource->data.extended_irq;
if (!p || !p->number_of_interrupts) {
if (!p || !p->interrupt_count) {
/*
* extended IRQ descriptors must
* return at least 1 IRQ
......@@ -325,36 +325,36 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
buffer.pointer = resource;
switch (link->irq.resource_type) {
case ACPI_RSTYPE_IRQ:
resource->res.type = ACPI_RSTYPE_IRQ;
case ACPI_RESOURCE_TYPE_IRQ:
resource->res.type = ACPI_RESOURCE_TYPE_IRQ;
resource->res.length = sizeof(struct acpi_resource);
resource->res.data.irq.edge_level = link->irq.edge_level;
resource->res.data.irq.active_high_low =
link->irq.active_high_low;
if (link->irq.edge_level == ACPI_EDGE_SENSITIVE)
resource->res.data.irq.shared_exclusive =
resource->res.data.irq.triggering = link->irq.triggering;
resource->res.data.irq.polarity =
link->irq.polarity;
if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
resource->res.data.irq.sharable =
ACPI_EXCLUSIVE;
else
resource->res.data.irq.shared_exclusive = ACPI_SHARED;
resource->res.data.irq.number_of_interrupts = 1;
resource->res.data.irq.sharable = ACPI_SHARED;
resource->res.data.irq.interrupt_count = 1;
resource->res.data.irq.interrupts[0] = irq;
break;
case ACPI_RSTYPE_EXT_IRQ:
resource->res.type = ACPI_RSTYPE_EXT_IRQ;
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
resource->res.type = ACPI_RESOURCE_TYPE_EXTENDED_IRQ;
resource->res.length = sizeof(struct acpi_resource);
resource->res.data.extended_irq.producer_consumer =
ACPI_CONSUMER;
resource->res.data.extended_irq.edge_level =
link->irq.edge_level;
resource->res.data.extended_irq.active_high_low =
link->irq.active_high_low;
if (link->irq.edge_level == ACPI_EDGE_SENSITIVE)
resource->res.data.irq.shared_exclusive =
resource->res.data.extended_irq.triggering =
link->irq.triggering;
resource->res.data.extended_irq.polarity =
link->irq.polarity;
if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
resource->res.data.irq.sharable =
ACPI_EXCLUSIVE;
else
resource->res.data.irq.shared_exclusive = ACPI_SHARED;
resource->res.data.extended_irq.number_of_interrupts = 1;
resource->res.data.irq.sharable = ACPI_SHARED;
resource->res.data.extended_irq.interrupt_count = 1;
resource->res.data.extended_irq.interrupts[0] = irq;
/* ignore resource_source, it's optional */
break;
......@@ -364,7 +364,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
goto end;
}
resource->end.type = ACPI_RSTYPE_END_TAG;
resource->end.type = ACPI_RESOURCE_TYPE_END_TAG;
/* Attempt to set the resource */
status = acpi_set_current_resources(link->handle, &buffer);
......@@ -613,7 +613,7 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
int
acpi_pci_link_allocate_irq(acpi_handle handle,
int index,
int *edge_level, int *active_high_low, char **name)
int *triggering, int *polarity, char **name)
{
int result = 0;
struct acpi_device *device = NULL;
......@@ -653,10 +653,10 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
link->refcnt++;
up(&acpi_link_lock);
if (edge_level)
*edge_level = link->irq.edge_level;
if (active_high_low)
*active_high_low = link->irq.active_high_low;
if (triggering)
*triggering = link->irq.triggering;
if (polarity)
*polarity = link->irq.polarity;
if (name)
*name = acpi_device_bid(link->device);
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
......
......@@ -122,15 +122,15 @@ get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data)
int *busnr = (int *)data;
struct acpi_resource_address64 address;
if (resource->type != ACPI_RSTYPE_ADDRESS16 &&
resource->type != ACPI_RSTYPE_ADDRESS32 &&
resource->type != ACPI_RSTYPE_ADDRESS64)
if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 &&
resource->type != ACPI_RESOURCE_TYPE_ADDRESS32 &&
resource->type != ACPI_RESOURCE_TYPE_ADDRESS64)
return AE_OK;
acpi_resource_to_address64(resource, &address);
if ((address.address_length > 0) &&
(address.resource_type == ACPI_BUS_NUMBER_RANGE))
*busnr = address.min_address_range;
*busnr = address.minimum;
return AE_OK;
}
......
......@@ -2,7 +2,7 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-y := rsaddr.o rscreate.o rsio.o rslist.o rsmisc.o rsxface.o \
obj-y := rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \
rscalc.o rsirq.o rsmemory.o rsutils.o
obj-$(ACPI_FUTURE_USAGE) += rsdump.o
......
This diff is collapsed.
This diff is collapsed.
......@@ -53,10 +53,10 @@ ACPI_MODULE_NAME("rscreate")
*
* FUNCTION: acpi_rs_create_resource_list
*
* PARAMETERS: byte_stream_buffer - Pointer to the resource byte stream
* output_buffer - Pointer to the user's buffer
* PARAMETERS: aml_buffer - Pointer to the resource byte stream
* output_buffer - Pointer to the user's buffer
*
* RETURN: Status - AE_OK if okay, else a valid acpi_status code
* RETURN: Status: AE_OK if okay, else a valid acpi_status code
* If output_buffer is not large enough, output_buffer_length
* indicates how large output_buffer should be, else it
* indicates how may u8 elements of output_buffer are valid.
......@@ -67,33 +67,30 @@ ACPI_MODULE_NAME("rscreate")
*
******************************************************************************/
acpi_status
acpi_rs_create_resource_list(union acpi_operand_object *byte_stream_buffer,
acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
struct acpi_buffer *output_buffer)
{
acpi_status status;
u8 *byte_stream_start;
u8 *aml_start;
acpi_size list_size_needed = 0;
u32 byte_stream_buffer_length;
u32 aml_buffer_length;
ACPI_FUNCTION_TRACE("rs_create_resource_list");
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "byte_stream_buffer = %p\n",
byte_stream_buffer));
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "aml_buffer = %p\n", aml_buffer));
/* Params already validated, so we don't re-validate here */
byte_stream_buffer_length = byte_stream_buffer->buffer.length;
byte_stream_start = byte_stream_buffer->buffer.pointer;
aml_buffer_length = aml_buffer->buffer.length;
aml_start = aml_buffer->buffer.pointer;
/*
* Pass the byte_stream_buffer into a module that can calculate
* Pass the aml_buffer into a module that can calculate
* the buffer size needed for the linked list
*/
status =
acpi_rs_get_list_length(byte_stream_start,
byte_stream_buffer_length,
&list_size_needed);
status = acpi_rs_get_list_length(aml_start, aml_buffer_length,
&list_size_needed);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Status=%X list_size_needed=%X\n",
status, (u32) list_size_needed));
......@@ -110,10 +107,8 @@ acpi_rs_create_resource_list(union acpi_operand_object *byte_stream_buffer,
/* Do the conversion */
status =
acpi_rs_byte_stream_to_list(byte_stream_start,
byte_stream_buffer_length,
output_buffer->pointer);
status = acpi_rs_convert_aml_to_resources(aml_start, aml_buffer_length,
output_buffer->pointer);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
......@@ -360,7 +355,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
/*******************************************************************************
*
* FUNCTION: acpi_rs_create_byte_stream
* FUNCTION: acpi_rs_create_aml_resources
*
* PARAMETERS: linked_list_buffer - Pointer to the resource linked list
* output_buffer - Pointer to the user's buffer
......@@ -377,13 +372,13 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
******************************************************************************/
acpi_status
acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer,
struct acpi_buffer *output_buffer)
acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
struct acpi_buffer *output_buffer)
{
acpi_status status;
acpi_size byte_stream_size_needed = 0;
acpi_size aml_size_needed = 0;
ACPI_FUNCTION_TRACE("rs_create_byte_stream");
ACPI_FUNCTION_TRACE("rs_create_aml_resources");
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "linked_list_buffer = %p\n",
linked_list_buffer));
......@@ -394,11 +389,10 @@ acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer,
* Pass the linked_list_buffer into a module that calculates
* the buffer size needed for the byte stream.
*/
status = acpi_rs_get_byte_stream_length(linked_list_buffer,
&byte_stream_size_needed);
status = acpi_rs_get_aml_length(linked_list_buffer, &aml_size_needed);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "byte_stream_size_needed=%X, %s\n",
(u32) byte_stream_size_needed,
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "aml_size_needed=%X, %s\n",
(u32) aml_size_needed,
acpi_format_exception(status)));
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
......@@ -406,8 +400,7 @@ acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer,
/* Validate/Allocate/Clear caller buffer */
status =
acpi_ut_initialize_buffer(output_buffer, byte_stream_size_needed);
status = acpi_ut_initialize_buffer(output_buffer, aml_size_needed);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
......@@ -415,9 +408,9 @@ acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer,
/* Do the conversion */
status =
acpi_rs_list_to_byte_stream(linked_list_buffer,
byte_stream_size_needed,
output_buffer->pointer);
acpi_rs_convert_resources_to_aml(linked_list_buffer,
aml_size_needed,
output_buffer->pointer);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
......
This diff is collapsed.
......@@ -207,7 +207,7 @@ struct acpi_resource_info acpi_gbl_lg_resource_info[] = {
{0, ACPI_RLARGE(struct aml_resource_memory24),
ACPI_SIZEOF_RESOURCE(struct acpi_resource_memory24)},
{0, ACPI_RLARGE(struct aml_resource_generic_register),
ACPI_SIZEOF_RESOURCE(struct acpi_resource_generic_registerister)},
ACPI_SIZEOF_RESOURCE(struct acpi_resource_generic_register)},
{0, 0, 0},
{1, ACPI_RLARGE(struct aml_resource_vendor_large),
ACPI_SIZEOF_RESOURCE(struct acpi_resource_vendor)},
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -59,9 +59,9 @@ ACPI_MODULE_NAME("rsxface")
ACPI_COPY_FIELD(out, in, max_address_fixed); \
ACPI_COPY_FIELD(out, in, attribute); \
ACPI_COPY_FIELD(out, in, granularity); \
ACPI_COPY_FIELD(out, in, min_address_range); \
ACPI_COPY_FIELD(out, in, max_address_range); \
ACPI_COPY_FIELD(out, in, address_translation_offset); \
ACPI_COPY_FIELD(out, in, minimum); \
ACPI_COPY_FIELD(out, in, maximum); \
ACPI_COPY_FIELD(out, in, translation_offset); \
ACPI_COPY_FIELD(out, in, address_length); \
ACPI_COPY_FIELD(out, in, resource_source);
/*******************************************************************************
......@@ -269,7 +269,7 @@ acpi_walk_resources(acpi_handle device_handle,
/* Walk the resource list */
for (;;) {
if (!resource || resource->type == ACPI_RSTYPE_END_TAG) {
if (!resource || resource->type == ACPI_RESOURCE_TYPE_END_TAG) {
break;
}
......@@ -382,19 +382,19 @@ acpi_resource_to_address64(struct acpi_resource *resource,
struct acpi_resource_address32 *address32;
switch (resource->type) {
case ACPI_RSTYPE_ADDRESS16:
case ACPI_RESOURCE_TYPE_ADDRESS16:
address16 = (struct acpi_resource_address16 *)&resource->data;
ACPI_COPY_ADDRESS(out, address16);
break;
case ACPI_RSTYPE_ADDRESS32:
case ACPI_RESOURCE_TYPE_ADDRESS32:
address32 = (struct acpi_resource_address32 *)&resource->data;
ACPI_COPY_ADDRESS(out, address32);
break;
case ACPI_RSTYPE_ADDRESS64:
case ACPI_RESOURCE_TYPE_ADDRESS64:
/* Simple copy for 64 bit source */
......
......@@ -251,7 +251,7 @@ acpi_status acpi_tb_get_table_rsdt(void)
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"RSDP located at %p, points to RSDT physical=%8.8X%8.8X \n",
"RSDP located at %p, points to RSDT physical=%8.8X%8.8X\n",
acpi_gbl_RSDP,
ACPI_FORMAT_UINT64(address.pointer.value)));
......
......@@ -251,7 +251,7 @@ acpi_get_firmware_table(acpi_string signature,
acpi_tb_get_rsdt_address(&address);
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"RSDP located at %p, RSDT physical=%8.8X%8.8X \n",
"RSDP located at %p, RSDT physical=%8.8X%8.8X\n",
acpi_gbl_RSDP,
ACPI_FORMAT_UINT64(address.pointer.value)));
......
......@@ -304,7 +304,7 @@ void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line)
if (!size) {
_ACPI_REPORT_ERROR(module, line, component,
("ut_allocate: Attempt to allocate zero bytes\n"));
("ut_allocate: Attempt to allocate zero bytes, allocating 1 byte\n"));
size = 1;
}
......@@ -347,8 +347,8 @@ void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line)
if (!size) {
_ACPI_REPORT_ERROR(module, line, component,
("ut_callocate: Attempt to allocate zero bytes\n"));
return_PTR(NULL);
("ut_callocate: Attempt to allocate zero bytes, allocating 1 byte\n"));
size = 1;
}
allocation = acpi_os_allocate(size);
......
......@@ -825,6 +825,9 @@ void acpi_ut_init_globals(void)
acpi_gbl_ps_find_count = 0;
acpi_gbl_acpi_hardware_present = TRUE;
acpi_gbl_owner_id_mask = 0;
acpi_gbl_trace_method_name = 0;
acpi_gbl_trace_dbg_level = 0;
acpi_gbl_trace_dbg_layer = 0;
acpi_gbl_debugger_configuration = DEBUGGER_THREADING;
acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -63,7 +63,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20050916
#define ACPI_CA_VERSION 0x20050930
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
......
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