Commit 6912897d authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branch 'acpica' into linux-next

* acpica: (22 commits)
  ACPI: Set length even for TYPE_END_TAG acpi resource
  ACPICA: Update version to 20130214
  ACPICA: Object repair: Allow 0-length packages for variable-length packages
  ACPICA: Disassembler: Add warnings for unresolved control methods
  ACPICA: Return object repair: Add resource template repairs
  ACPICA: Return object repair: Add string-to-unicode conversion
  ACPICA: Split object conversion functions to a new file
  ACPICA: Add mechanism for early object repairs on a per-name basis
  ACPICA: Remove trailing comma in enum declarations
  ACPICA: Add exception descriptions to exception info table
  ACPICA: Add macros to exception code definitions
  ACPICA: Regression fix: reinstate safe exit macros
  ACPICA: Update for ACPI 5 hardware-reduced feature
  ACPICA: Add parens within macros around parameter names
  ACPICA: Add macros to access pointer to next object in the descriptor list
  ACPICA: Update error/debug messages for fixed events
  ACPICA: Fix a long-standing bug in local cache
  ACPICA: iASL/Disassembler: Add support for MTMR table
  ACPICA: iASL/Disassembler: Add support for VRTC table
  ACPICA: Update RASF table definition
  ...
parents 16b53e7e f084dbb9
...@@ -83,6 +83,7 @@ acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o ...@@ -83,6 +83,7 @@ acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o
acpi-y += \ acpi-y += \
nsaccess.o \ nsaccess.o \
nsalloc.o \ nsalloc.o \
nsconvert.o \
nsdump.o \ nsdump.o \
nseval.o \ nseval.o \
nsinit.o \ nsinit.o \
......
...@@ -413,10 +413,12 @@ ACPI_EXTERN u8 acpi_gbl_db_output_flags; ...@@ -413,10 +413,12 @@ ACPI_EXTERN u8 acpi_gbl_db_output_flags;
#ifdef ACPI_DISASSEMBLER #ifdef ACPI_DISASSEMBLER
u8 ACPI_INIT_GLOBAL(acpi_gbl_ignore_noop_operator, FALSE); ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_ignore_noop_operator, FALSE);
ACPI_EXTERN u8 acpi_gbl_db_opt_disasm; ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
ACPI_EXTERN u8 acpi_gbl_num_external_methods;
ACPI_EXTERN u32 acpi_gbl_resolved_external_methods;
ACPI_EXTERN struct acpi_external_list *acpi_gbl_external_list; ACPI_EXTERN struct acpi_external_list *acpi_gbl_external_list;
ACPI_EXTERN struct acpi_external_file *acpi_gbl_external_file_list; ACPI_EXTERN struct acpi_external_file *acpi_gbl_external_file_list;
#endif #endif
......
...@@ -363,6 +363,7 @@ struct acpi_predefined_data { ...@@ -363,6 +363,7 @@ struct acpi_predefined_data {
union acpi_operand_object *parent_package; union acpi_operand_object *parent_package;
struct acpi_namespace_node *node; struct acpi_namespace_node *node;
u32 flags; u32 flags;
u32 return_btype;
u8 node_flags; u8 node_flags;
}; };
...@@ -371,6 +372,20 @@ struct acpi_predefined_data { ...@@ -371,6 +372,20 @@ struct acpi_predefined_data {
#define ACPI_OBJECT_REPAIRED 1 #define ACPI_OBJECT_REPAIRED 1
#define ACPI_OBJECT_WRAPPED 2 #define ACPI_OBJECT_WRAPPED 2
/* Return object auto-repair info */
typedef acpi_status(*acpi_object_converter) (union acpi_operand_object
*original_object,
union acpi_operand_object
**converted_object);
struct acpi_simple_repair_info {
char name[ACPI_NAME_SIZE];
u32 unexpected_btypes;
u32 package_index;
acpi_object_converter object_converter;
};
/* /*
* Bitmapped return value types * Bitmapped return value types
* Note: the actual data types must be contiguous, a loop in nspredef.c * Note: the actual data types must be contiguous, a loop in nspredef.c
...@@ -1037,6 +1052,7 @@ struct acpi_external_list { ...@@ -1037,6 +1052,7 @@ struct acpi_external_list {
u16 length; u16 length;
u8 type; u8 type;
u8 flags; u8 flags;
u8 resolved;
}; };
/* Values for Flags field above */ /* Values for Flags field above */
......
...@@ -322,10 +322,12 @@ ...@@ -322,10 +322,12 @@
* where a pointer to an object of type union acpi_operand_object can also * where a pointer to an object of type union acpi_operand_object can also
* appear. This macro is used to distinguish them. * appear. This macro is used to distinguish them.
* *
* The "Descriptor" field is the first field in both structures. * The "DescriptorType" field is the second field in both structures.
*/ */
#define ACPI_GET_DESCRIPTOR_PTR(d) (((union acpi_descriptor *)(void *)(d))->common.common_pointer)
#define ACPI_SET_DESCRIPTOR_PTR(d, p) (((union acpi_descriptor *)(void *)(d))->common.common_pointer = (p))
#define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type) #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type)
#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t) #define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = (t))
/* /*
* Macros for the master AML opcode table * Macros for the master AML opcode table
......
...@@ -166,6 +166,29 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent); ...@@ -166,6 +166,29 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent);
int acpi_ns_compare_names(char *name1, char *name2); int acpi_ns_compare_names(char *name1, char *name2);
/*
* nsconvert - Dynamic object conversion routines
*/
acpi_status
acpi_ns_convert_to_integer(union acpi_operand_object *original_object,
union acpi_operand_object **return_object);
acpi_status
acpi_ns_convert_to_string(union acpi_operand_object *original_object,
union acpi_operand_object **return_object);
acpi_status
acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
union acpi_operand_object **return_object);
acpi_status
acpi_ns_convert_to_unicode(union acpi_operand_object *original_object,
union acpi_operand_object **return_object);
acpi_status
acpi_ns_convert_to_resource(union acpi_operand_object *original_object,
union acpi_operand_object **return_object);
/* /*
* nsdump - Namespace dump/print utilities * nsdump - Namespace dump/print utilities
*/ */
...@@ -289,7 +312,7 @@ acpi_ns_get_attached_data(struct acpi_namespace_node *node, ...@@ -289,7 +312,7 @@ acpi_ns_get_attached_data(struct acpi_namespace_node *node,
* predefined methods/objects * predefined methods/objects
*/ */
acpi_status acpi_status
acpi_ns_repair_object(struct acpi_predefined_data *data, acpi_ns_simple_repair(struct acpi_predefined_data *data,
u32 expected_btypes, u32 expected_btypes,
u32 package_index, u32 package_index,
union acpi_operand_object **return_object_ptr); union acpi_operand_object **return_object_ptr);
......
...@@ -483,7 +483,8 @@ acpi_ut_short_divide(u64 in_dividend, ...@@ -483,7 +483,8 @@ acpi_ut_short_divide(u64 in_dividend,
/* /*
* utmisc * utmisc
*/ */
const char *acpi_ut_validate_exception(acpi_status status); const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status
status);
u8 acpi_ut_is_pci_root_bridge(char *id); u8 acpi_ut_is_pci_root_bridge(char *id);
......
...@@ -178,7 +178,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op, ...@@ -178,7 +178,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
if (!op) { if (!op) {
ACPI_ERROR((AE_INFO, "Null Op")); ACPI_ERROR((AE_INFO, "Null Op"));
return_VALUE(TRUE); return_UINT8(TRUE);
} }
/* /*
...@@ -210,7 +210,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op, ...@@ -210,7 +210,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
"At Method level, result of [%s] not used\n", "At Method level, result of [%s] not used\n",
acpi_ps_get_opcode_name(op->common. acpi_ps_get_opcode_name(op->common.
aml_opcode))); aml_opcode)));
return_VALUE(FALSE); return_UINT8(FALSE);
} }
/* Get info on the parent. The root_op is AML_SCOPE */ /* Get info on the parent. The root_op is AML_SCOPE */
...@@ -219,7 +219,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op, ...@@ -219,7 +219,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
acpi_ps_get_opcode_info(op->common.parent->common.aml_opcode); acpi_ps_get_opcode_info(op->common.parent->common.aml_opcode);
if (parent_info->class == AML_CLASS_UNKNOWN) { if (parent_info->class == AML_CLASS_UNKNOWN) {
ACPI_ERROR((AE_INFO, "Unknown parent opcode Op=%p", op)); ACPI_ERROR((AE_INFO, "Unknown parent opcode Op=%p", op));
return_VALUE(FALSE); return_UINT8(FALSE);
} }
/* /*
...@@ -307,7 +307,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op, ...@@ -307,7 +307,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
acpi_ps_get_opcode_name(op->common.parent->common. acpi_ps_get_opcode_name(op->common.parent->common.
aml_opcode), op)); aml_opcode), op));
return_VALUE(TRUE); return_UINT8(TRUE);
result_not_used: result_not_used:
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
...@@ -316,7 +316,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op, ...@@ -316,7 +316,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
acpi_ps_get_opcode_name(op->common.parent->common. acpi_ps_get_opcode_name(op->common.parent->common.
aml_opcode), op)); aml_opcode), op));
return_VALUE(FALSE); return_UINT8(FALSE);
} }
/******************************************************************************* /*******************************************************************************
......
...@@ -257,6 +257,8 @@ u32 acpi_ev_fixed_event_detect(void) ...@@ -257,6 +257,8 @@ u32 acpi_ev_fixed_event_detect(void)
* *
* DESCRIPTION: Clears the status bit for the requested event, calls the * DESCRIPTION: Clears the status bit for the requested event, calls the
* handler that previously registered for the event. * handler that previously registered for the event.
* NOTE: If there is no handler for the event, the event is
* disabled to prevent futher interrupts.
* *
******************************************************************************/ ******************************************************************************/
...@@ -271,17 +273,17 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event) ...@@ -271,17 +273,17 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event)
status_register_id, ACPI_CLEAR_STATUS); status_register_id, ACPI_CLEAR_STATUS);
/* /*
* Make sure we've got a handler. If not, report an error. The event is * Make sure that a handler exists. If not, report an error
* disabled to prevent further interrupts. * and disable the event to prevent further interrupts.
*/ */
if (NULL == acpi_gbl_fixed_event_handlers[event].handler) { if (!acpi_gbl_fixed_event_handlers[event].handler) {
(void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event]. (void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event].
enable_register_id, enable_register_id,
ACPI_DISABLE_EVENT); ACPI_DISABLE_EVENT);
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"No installed handler for fixed event [0x%08X]", "No installed handler for fixed event - %s (%u), disabling",
event)); acpi_ut_get_event_name(event), event));
return (ACPI_INTERRUPT_NOT_HANDLED); return (ACPI_INTERRUPT_NOT_HANDLED);
} }
......
...@@ -707,7 +707,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, ...@@ -707,7 +707,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, ACPI_EXCEPTION((AE_INFO, status,
"Unable to clear GPE%02X", gpe_number)); "Unable to clear GPE%02X", gpe_number));
return_VALUE(ACPI_INTERRUPT_NOT_HANDLED); return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
} }
} }
...@@ -724,7 +724,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, ...@@ -724,7 +724,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, ACPI_EXCEPTION((AE_INFO, status,
"Unable to disable GPE%02X", gpe_number)); "Unable to disable GPE%02X", gpe_number));
return_VALUE(ACPI_INTERRUPT_NOT_HANDLED); return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
} }
/* /*
...@@ -784,7 +784,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, ...@@ -784,7 +784,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
break; break;
} }
return_VALUE(ACPI_INTERRUPT_HANDLED); return_UINT32(ACPI_INTERRUPT_HANDLED);
} }
#endif /* !ACPI_REDUCED_HARDWARE */ #endif /* !ACPI_REDUCED_HARDWARE */
...@@ -89,7 +89,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context) ...@@ -89,7 +89,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context)
*/ */
interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list); interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
return_VALUE(interrupt_handled); return_UINT32(interrupt_handled);
} }
/******************************************************************************* /*******************************************************************************
...@@ -120,7 +120,7 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context) ...@@ -120,7 +120,7 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context)
interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list); interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
return_VALUE(interrupt_handled); return_UINT32(interrupt_handled);
} }
/****************************************************************************** /******************************************************************************
......
...@@ -467,9 +467,9 @@ acpi_install_fixed_event_handler(u32 event, ...@@ -467,9 +467,9 @@ acpi_install_fixed_event_handler(u32 event,
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
/* Don't allow two handlers. */ /* Do not allow multiple handlers */
if (NULL != acpi_gbl_fixed_event_handlers[event].handler) { if (acpi_gbl_fixed_event_handlers[event].handler) {
status = AE_ALREADY_EXISTS; status = AE_ALREADY_EXISTS;
goto cleanup; goto cleanup;
} }
...@@ -483,8 +483,9 @@ acpi_install_fixed_event_handler(u32 event, ...@@ -483,8 +483,9 @@ acpi_install_fixed_event_handler(u32 event,
if (ACPI_SUCCESS(status)) if (ACPI_SUCCESS(status))
status = acpi_enable_event(event, 0); status = acpi_enable_event(event, 0);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_WARNING((AE_INFO, "Could not enable fixed event 0x%X", ACPI_WARNING((AE_INFO,
event)); "Could not enable fixed event - %s (%u)",
acpi_ut_get_event_name(event), event));
/* Remove the handler */ /* Remove the handler */
...@@ -492,7 +493,8 @@ acpi_install_fixed_event_handler(u32 event, ...@@ -492,7 +493,8 @@ acpi_install_fixed_event_handler(u32 event,
acpi_gbl_fixed_event_handlers[event].context = NULL; acpi_gbl_fixed_event_handlers[event].context = NULL;
} else { } else {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Enabled fixed event %X, Handler=%p\n", event, "Enabled fixed event %s (%X), Handler=%p\n",
acpi_ut_get_event_name(event), event,
handler)); handler));
} }
...@@ -544,11 +546,12 @@ acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler) ...@@ -544,11 +546,12 @@ acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_WARNING((AE_INFO, ACPI_WARNING((AE_INFO,
"Could not write to fixed event enable register 0x%X", "Could not disable fixed event - %s (%u)",
event)); acpi_ut_get_event_name(event), event));
} else { } else {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n", ACPI_DEBUG_PRINT((ACPI_DB_INFO,
event)); "Disabled fixed event - %s (%X)\n",
acpi_ut_get_event_name(event), event));
} }
(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
......
...@@ -74,6 +74,12 @@ acpi_status acpi_enable(void) ...@@ -74,6 +74,12 @@ acpi_status acpi_enable(void)
return_ACPI_STATUS(AE_NO_ACPI_TABLES); return_ACPI_STATUS(AE_NO_ACPI_TABLES);
} }
/* If the Hardware Reduced flag is set, machine is always in acpi mode */
if (acpi_gbl_reduced_hardware) {
return_ACPI_STATUS(AE_OK);
}
/* Check current mode */ /* Check current mode */
if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) { if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) {
...@@ -126,6 +132,12 @@ acpi_status acpi_disable(void) ...@@ -126,6 +132,12 @@ acpi_status acpi_disable(void)
ACPI_FUNCTION_TRACE(acpi_disable); ACPI_FUNCTION_TRACE(acpi_disable);
/* If the Hardware Reduced flag is set, machine is always in acpi mode */
if (acpi_gbl_reduced_hardware) {
return_ACPI_STATUS(AE_OK);
}
if (acpi_hw_get_mode() == ACPI_SYS_MODE_LEGACY) { if (acpi_hw_get_mode() == ACPI_SYS_MODE_LEGACY) {
ACPI_DEBUG_PRINT((ACPI_DB_INIT, ACPI_DEBUG_PRINT((ACPI_DB_INIT,
"System is already in legacy (non-ACPI) mode\n")); "System is already in legacy (non-ACPI) mode\n"));
......
...@@ -276,7 +276,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc, ...@@ -276,7 +276,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
/* Invalid field access type */ /* Invalid field access type */
ACPI_ERROR((AE_INFO, "Unknown field access type 0x%X", access)); ACPI_ERROR((AE_INFO, "Unknown field access type 0x%X", access));
return_VALUE(0); return_UINT32(0);
} }
if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) { if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) {
...@@ -289,7 +289,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc, ...@@ -289,7 +289,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
} }
*return_byte_alignment = byte_alignment; *return_byte_alignment = byte_alignment;
return_VALUE(bit_length); return_UINT32(bit_length);
} }
/******************************************************************************* /*******************************************************************************
......
...@@ -340,7 +340,7 @@ static u32 acpi_ex_digits_needed(u64 value, u32 base) ...@@ -340,7 +340,7 @@ static u32 acpi_ex_digits_needed(u64 value, u32 base)
/* u64 is unsigned, so we don't worry about a '-' prefix */ /* u64 is unsigned, so we don't worry about a '-' prefix */
if (value == 0) { if (value == 0) {
return_VALUE(1); return_UINT32(1);
} }
current_value = value; current_value = value;
...@@ -354,7 +354,7 @@ static u32 acpi_ex_digits_needed(u64 value, u32 base) ...@@ -354,7 +354,7 @@ static u32 acpi_ex_digits_needed(u64 value, u32 base)
num_digits++; num_digits++;
} }
return_VALUE(num_digits); return_UINT32(num_digits);
} }
/******************************************************************************* /*******************************************************************************
......
...@@ -66,6 +66,12 @@ acpi_status acpi_hw_set_mode(u32 mode) ...@@ -66,6 +66,12 @@ acpi_status acpi_hw_set_mode(u32 mode)
ACPI_FUNCTION_TRACE(hw_set_mode); ACPI_FUNCTION_TRACE(hw_set_mode);
/* If the Hardware Reduced flag is set, machine is always in acpi mode */
if (acpi_gbl_reduced_hardware) {
return_ACPI_STATUS(AE_OK);
}
/* /*
* ACPI 2.0 clarified that if SMI_CMD in FADT is zero, * ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
* system does not support mode transition. * system does not support mode transition.
...@@ -146,23 +152,29 @@ u32 acpi_hw_get_mode(void) ...@@ -146,23 +152,29 @@ u32 acpi_hw_get_mode(void)
ACPI_FUNCTION_TRACE(hw_get_mode); ACPI_FUNCTION_TRACE(hw_get_mode);
/* If the Hardware Reduced flag is set, machine is always in acpi mode */
if (acpi_gbl_reduced_hardware) {
return_UINT32(ACPI_SYS_MODE_ACPI);
}
/* /*
* ACPI 2.0 clarified that if SMI_CMD in FADT is zero, * ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
* system does not support mode transition. * system does not support mode transition.
*/ */
if (!acpi_gbl_FADT.smi_command) { if (!acpi_gbl_FADT.smi_command) {
return_VALUE(ACPI_SYS_MODE_ACPI); return_UINT32(ACPI_SYS_MODE_ACPI);
} }
status = acpi_read_bit_register(ACPI_BITREG_SCI_ENABLE, &value); status = acpi_read_bit_register(ACPI_BITREG_SCI_ENABLE, &value);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_VALUE(ACPI_SYS_MODE_LEGACY); return_UINT32(ACPI_SYS_MODE_LEGACY);
} }
if (value) { if (value) {
return_VALUE(ACPI_SYS_MODE_ACPI); return_UINT32(ACPI_SYS_MODE_ACPI);
} else { } else {
return_VALUE(ACPI_SYS_MODE_LEGACY); return_UINT32(ACPI_SYS_MODE_LEGACY);
} }
} }
......
This diff is collapsed.
...@@ -78,6 +78,8 @@ acpi_ns_check_reference(struct acpi_predefined_data *data, ...@@ -78,6 +78,8 @@ acpi_ns_check_reference(struct acpi_predefined_data *data,
static void acpi_ns_get_expected_types(char *buffer, u32 expected_btypes); static void acpi_ns_get_expected_types(char *buffer, u32 expected_btypes);
static u32 acpi_ns_get_bitmapped_type(union acpi_operand_object *return_object);
/* /*
* Names for the types that can be returned by the predefined objects. * Names for the types that can be returned by the predefined objects.
* Used for warning messages. Must be in the same order as the ACPI_RTYPEs * Used for warning messages. Must be in the same order as the ACPI_RTYPEs
...@@ -112,7 +114,6 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node, ...@@ -112,7 +114,6 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
acpi_status return_status, acpi_status return_status,
union acpi_operand_object **return_object_ptr) union acpi_operand_object **return_object_ptr)
{ {
union acpi_operand_object *return_object = *return_object_ptr;
acpi_status status = AE_OK; acpi_status status = AE_OK;
const union acpi_predefined_info *predefined; const union acpi_predefined_info *predefined;
char *pathname; char *pathname;
...@@ -151,25 +152,6 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node, ...@@ -151,25 +152,6 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
goto cleanup; goto cleanup;
} }
/*
* If there is no return value, check if we require a return value for
* this predefined name. Either one return value is expected, or none,
* for both methods and other objects.
*
* Exit now if there is no return object. Warning if one was expected.
*/
if (!return_object) {
if ((predefined->info.expected_btypes) &&
(!(predefined->info.expected_btypes & ACPI_RTYPE_NONE))) {
ACPI_WARN_PREDEFINED((AE_INFO, pathname,
ACPI_WARN_ALWAYS,
"Missing expected return value"));
status = AE_AML_NO_RETURN_VALUE;
}
goto cleanup;
}
/* /*
* Return value validation and possible repair. * Return value validation and possible repair.
* *
...@@ -410,28 +392,12 @@ acpi_ns_check_object_type(struct acpi_predefined_data *data, ...@@ -410,28 +392,12 @@ acpi_ns_check_object_type(struct acpi_predefined_data *data,
{ {
union acpi_operand_object *return_object = *return_object_ptr; union acpi_operand_object *return_object = *return_object_ptr;
acpi_status status = AE_OK; acpi_status status = AE_OK;
u32 return_btype;
char type_buffer[48]; /* Room for 5 types */ char type_buffer[48]; /* Room for 5 types */
/*
* If we get a NULL return_object here, it is a NULL package element.
* Since all extraneous NULL package elements were removed earlier by a
* call to acpi_ns_remove_null_elements, this is an unexpected NULL element.
* We will attempt to repair it.
*/
if (!return_object) {
status = acpi_ns_repair_null_element(data, expected_btypes,
package_index,
return_object_ptr);
if (ACPI_SUCCESS(status)) {
return (AE_OK); /* Repair was successful */
}
goto type_error_exit;
}
/* A Namespace node should not get here, but make sure */ /* A Namespace node should not get here, but make sure */
if (ACPI_GET_DESCRIPTOR_TYPE(return_object) == ACPI_DESC_TYPE_NAMED) { if (return_object &&
ACPI_GET_DESCRIPTOR_TYPE(return_object) == ACPI_DESC_TYPE_NAMED) {
ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, data->node_flags, ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, data->node_flags,
"Invalid return type - Found a Namespace node [%4.4s] type %s", "Invalid return type - Found a Namespace node [%4.4s] type %s",
return_object->node.name.ascii, return_object->node.name.ascii,
...@@ -448,53 +414,25 @@ acpi_ns_check_object_type(struct acpi_predefined_data *data, ...@@ -448,53 +414,25 @@ acpi_ns_check_object_type(struct acpi_predefined_data *data,
* from all of the predefined names (including elements of returned * from all of the predefined names (including elements of returned
* packages) * packages)
*/ */
switch (return_object->common.type) { data->return_btype = acpi_ns_get_bitmapped_type(return_object);
case ACPI_TYPE_INTEGER: if (data->return_btype == ACPI_RTYPE_ANY) {
return_btype = ACPI_RTYPE_INTEGER;
break;
case ACPI_TYPE_BUFFER:
return_btype = ACPI_RTYPE_BUFFER;
break;
case ACPI_TYPE_STRING:
return_btype = ACPI_RTYPE_STRING;
break;
case ACPI_TYPE_PACKAGE:
return_btype = ACPI_RTYPE_PACKAGE;
break;
case ACPI_TYPE_LOCAL_REFERENCE:
return_btype = ACPI_RTYPE_REFERENCE;
break;
default:
/* Not one of the supported objects, must be incorrect */ /* Not one of the supported objects, must be incorrect */
goto type_error_exit; goto type_error_exit;
} }
/* Is the object one of the expected types? */ /* For reference objects, check that the reference type is correct */
if (return_btype & expected_btypes) {
/* For reference objects, check that the reference type is correct */
if (return_object->common.type == ACPI_TYPE_LOCAL_REFERENCE) {
status = acpi_ns_check_reference(data, return_object);
}
if ((data->return_btype & expected_btypes) == ACPI_RTYPE_REFERENCE) {
status = acpi_ns_check_reference(data, return_object);
return (status); return (status);
} }
/* Type mismatch -- attempt repair of the returned object */ /* Attempt simple repair of the returned object if necessary */
status = acpi_ns_repair_object(data, expected_btypes, status = acpi_ns_simple_repair(data, expected_btypes,
package_index, return_object_ptr); package_index, return_object_ptr);
if (ACPI_SUCCESS(status)) { return (status);
return (AE_OK); /* Repair was successful */
}
type_error_exit: type_error_exit:
...@@ -556,6 +494,61 @@ acpi_ns_check_reference(struct acpi_predefined_data *data, ...@@ -556,6 +494,61 @@ acpi_ns_check_reference(struct acpi_predefined_data *data,
return (AE_AML_OPERAND_TYPE); return (AE_AML_OPERAND_TYPE);
} }
/*******************************************************************************
*
* FUNCTION: acpi_ns_get_bitmapped_type
*
* PARAMETERS: return_object - Object returned from method/obj evaluation
*
* RETURN: Object return type. ACPI_RTYPE_ANY indicates that the object
* type is not supported. ACPI_RTYPE_NONE indicates that no
* object was returned (return_object is NULL).
*
* DESCRIPTION: Convert object type into a bitmapped object return type.
*
******************************************************************************/
static u32 acpi_ns_get_bitmapped_type(union acpi_operand_object *return_object)
{
u32 return_btype;
if (!return_object) {
return (ACPI_RTYPE_NONE);
}
/* Map acpi_object_type to internal bitmapped type */
switch (return_object->common.type) {
case ACPI_TYPE_INTEGER:
return_btype = ACPI_RTYPE_INTEGER;
break;
case ACPI_TYPE_BUFFER:
return_btype = ACPI_RTYPE_BUFFER;
break;
case ACPI_TYPE_STRING:
return_btype = ACPI_RTYPE_STRING;
break;
case ACPI_TYPE_PACKAGE:
return_btype = ACPI_RTYPE_PACKAGE;
break;
case ACPI_TYPE_LOCAL_REFERENCE:
return_btype = ACPI_RTYPE_REFERENCE;
break;
default:
/* Not one of the supported objects, must be incorrect */
return_btype = ACPI_RTYPE_ANY;
break;
}
return (return_btype);
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_ns_get_expected_types * FUNCTION: acpi_ns_get_expected_types
......
...@@ -112,9 +112,15 @@ acpi_ns_check_package(struct acpi_predefined_data *data, ...@@ -112,9 +112,15 @@ acpi_ns_check_package(struct acpi_predefined_data *data,
elements = return_object->package.elements; elements = return_object->package.elements;
count = return_object->package.count; count = return_object->package.count;
/* The package must have at least one element, else invalid */ /*
* Most packages must have at least one element. The only exception
* is the variable-length package (ACPI_PTYPE1_VAR).
*/
if (!count) { if (!count) {
if (package->ret_info.type == ACPI_PTYPE1_VAR) {
return (AE_OK);
}
ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, data->node_flags, ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, data->node_flags,
"Return Package has no elements (empty)")); "Return Package has no elements (empty)"));
......
This diff is collapsed.
...@@ -66,9 +66,9 @@ typedef struct acpi_repair_info { ...@@ -66,9 +66,9 @@ typedef struct acpi_repair_info {
/* Local prototypes */ /* Local prototypes */
static const struct acpi_repair_info *acpi_ns_match_repairable_name(struct static const struct acpi_repair_info *acpi_ns_match_complex_repair(struct
acpi_namespace_node acpi_namespace_node
*node); *node);
static acpi_status static acpi_status
acpi_ns_repair_ALR(struct acpi_predefined_data *data, acpi_ns_repair_ALR(struct acpi_predefined_data *data,
...@@ -175,7 +175,7 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data, ...@@ -175,7 +175,7 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data,
/* Check if this name is in the list of repairable names */ /* Check if this name is in the list of repairable names */
predefined = acpi_ns_match_repairable_name(node); predefined = acpi_ns_match_complex_repair(node);
if (!predefined) { if (!predefined) {
return (validate_status); return (validate_status);
} }
...@@ -186,7 +186,7 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data, ...@@ -186,7 +186,7 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data,
/****************************************************************************** /******************************************************************************
* *
* FUNCTION: acpi_ns_match_repairable_name * FUNCTION: acpi_ns_match_complex_repair
* *
* PARAMETERS: node - Namespace node for the method/object * PARAMETERS: node - Namespace node for the method/object
* *
...@@ -196,9 +196,9 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data, ...@@ -196,9 +196,9 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data,
* *
*****************************************************************************/ *****************************************************************************/
static const struct acpi_repair_info *acpi_ns_match_repairable_name(struct static const struct acpi_repair_info *acpi_ns_match_complex_repair(struct
acpi_namespace_node acpi_namespace_node
*node) *node)
{ {
const struct acpi_repair_info *this_name; const struct acpi_repair_info *this_name;
......
...@@ -112,10 +112,10 @@ acpi_object_type acpi_ns_get_type(struct acpi_namespace_node * node) ...@@ -112,10 +112,10 @@ acpi_object_type acpi_ns_get_type(struct acpi_namespace_node * node)
if (!node) { if (!node) {
ACPI_WARNING((AE_INFO, "Null Node parameter")); ACPI_WARNING((AE_INFO, "Null Node parameter"));
return_VALUE(ACPI_TYPE_ANY); return_UINT8(ACPI_TYPE_ANY);
} }
return_VALUE(node->type); return_UINT8(node->type);
} }
/******************************************************************************* /*******************************************************************************
...@@ -140,10 +140,10 @@ u32 acpi_ns_local(acpi_object_type type) ...@@ -140,10 +140,10 @@ u32 acpi_ns_local(acpi_object_type type)
/* Type code out of range */ /* Type code out of range */
ACPI_WARNING((AE_INFO, "Invalid Object Type 0x%X", type)); ACPI_WARNING((AE_INFO, "Invalid Object Type 0x%X", type));
return_VALUE(ACPI_NS_NORMAL); return_UINT32(ACPI_NS_NORMAL);
} }
return_VALUE(acpi_gbl_ns_properties[type] & ACPI_NS_LOCAL); return_UINT32(acpi_gbl_ns_properties[type] & ACPI_NS_LOCAL);
} }
/******************************************************************************* /*******************************************************************************
......
...@@ -108,7 +108,7 @@ acpi_ps_get_next_package_length(struct acpi_parse_state *parser_state) ...@@ -108,7 +108,7 @@ acpi_ps_get_next_package_length(struct acpi_parse_state *parser_state)
/* Byte 0 is a special case, either bits [0:3] or [0:5] are used */ /* Byte 0 is a special case, either bits [0:3] or [0:5] are used */
package_length |= (aml[0] & byte_zero_mask); package_length |= (aml[0] & byte_zero_mask);
return_VALUE(package_length); return_UINT32(package_length);
} }
/******************************************************************************* /*******************************************************************************
......
...@@ -202,6 +202,12 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) ...@@ -202,6 +202,12 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE); return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
} }
/* Sanity check the length. It must not be zero, or we loop forever */
if (!resource->length) {
return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
}
/* Get the base size of the (external stream) resource descriptor */ /* Get the base size of the (external stream) resource descriptor */
total_size = acpi_gbl_aml_resource_sizes[resource->type]; total_size = acpi_gbl_aml_resource_sizes[resource->type];
......
...@@ -385,6 +385,14 @@ void acpi_rs_dump_resource_list(struct acpi_resource *resource_list) ...@@ -385,6 +385,14 @@ void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
return; return;
} }
/* Sanity check the length. It must not be zero, or we loop forever */
if (!resource_list->length) {
acpi_os_printf
("Invalid zero length descriptor in resource list\n");
return;
}
/* Dump the resource descriptor */ /* Dump the resource descriptor */
if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) { if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
......
...@@ -178,6 +178,14 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, ...@@ -178,6 +178,14 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
return_ACPI_STATUS(AE_BAD_DATA); return_ACPI_STATUS(AE_BAD_DATA);
} }
/* Sanity check the length. It must not be zero, or we loop forever */
if (!resource->length) {
ACPI_ERROR((AE_INFO,
"Invalid zero length descriptor in resource list\n"));
return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
}
/* Perform the conversion */ /* Perform the conversion */
if (resource->type == ACPI_RESOURCE_TYPE_SERIAL_BUS) { if (resource->type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
......
...@@ -563,13 +563,19 @@ acpi_walk_resource_buffer(struct acpi_buffer * buffer, ...@@ -563,13 +563,19 @@ acpi_walk_resource_buffer(struct acpi_buffer * buffer,
while (resource < resource_end) { while (resource < resource_end) {
/* Sanity check the resource */ /* Sanity check the resource type */
if (resource->type > ACPI_RESOURCE_TYPE_MAX) { if (resource->type > ACPI_RESOURCE_TYPE_MAX) {
status = AE_AML_INVALID_RESOURCE_TYPE; status = AE_AML_INVALID_RESOURCE_TYPE;
break; break;
} }
/* Sanity check the length. It must not be zero, or we loop forever */
if (!resource->length) {
return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
}
/* Invoke the user function, abort on any error returned */ /* Invoke the user function, abort on any error returned */
status = user_function(resource, context); status = user_function(resource, context);
......
...@@ -214,7 +214,7 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id, ...@@ -214,7 +214,7 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id,
if ((space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) && if ((space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
(space_id != ACPI_ADR_SPACE_SYSTEM_IO)) { (space_id != ACPI_ADR_SPACE_SYSTEM_IO)) {
return_VALUE(0); return_UINT32(0);
} }
range_info = acpi_gbl_address_range_list[space_id]; range_info = acpi_gbl_address_range_list[space_id];
...@@ -256,7 +256,7 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id, ...@@ -256,7 +256,7 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id,
range_info = range_info->next; range_info = range_info->next;
} }
return_VALUE(overlap_count); return_UINT32(overlap_count);
} }
/******************************************************************************* /*******************************************************************************
......
...@@ -85,7 +85,6 @@ acpi_os_create_cache(char *cache_name, ...@@ -85,7 +85,6 @@ acpi_os_create_cache(char *cache_name,
/* Populate the cache object and return it */ /* Populate the cache object and return it */
ACPI_MEMSET(cache, 0, sizeof(struct acpi_memory_list)); ACPI_MEMSET(cache, 0, sizeof(struct acpi_memory_list));
cache->link_offset = 8;
cache->list_name = cache_name; cache->list_name = cache_name;
cache->object_size = object_size; cache->object_size = object_size;
cache->max_depth = max_depth; cache->max_depth = max_depth;
...@@ -108,7 +107,7 @@ acpi_os_create_cache(char *cache_name, ...@@ -108,7 +107,7 @@ acpi_os_create_cache(char *cache_name,
acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache) acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache)
{ {
char *next; void *next;
acpi_status status; acpi_status status;
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
...@@ -128,10 +127,7 @@ acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache) ...@@ -128,10 +127,7 @@ acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache)
/* Delete and unlink one cached state object */ /* Delete and unlink one cached state object */
next = *(ACPI_CAST_INDIRECT_PTR(char, next = ACPI_GET_DESCRIPTOR_PTR(cache->list_head);
&(((char *)cache->
list_head)[cache->
link_offset])));
ACPI_FREE(cache->list_head); ACPI_FREE(cache->list_head);
cache->list_head = next; cache->list_head = next;
...@@ -221,10 +217,7 @@ acpi_os_release_object(struct acpi_memory_list * cache, void *object) ...@@ -221,10 +217,7 @@ acpi_os_release_object(struct acpi_memory_list * cache, void *object)
/* Put the object at the head of the cache list */ /* Put the object at the head of the cache list */
*(ACPI_CAST_INDIRECT_PTR(char, ACPI_SET_DESCRIPTOR_PTR(object, cache->list_head);
&(((char *)object)[cache->
link_offset]))) =
cache->list_head;
cache->list_head = object; cache->list_head = object;
cache->current_depth++; cache->current_depth++;
...@@ -272,10 +265,7 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache) ...@@ -272,10 +265,7 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
/* There is an object available, use it */ /* There is an object available, use it */
object = cache->list_head; object = cache->list_head;
cache->list_head = *(ACPI_CAST_INDIRECT_PTR(char, cache->list_head = ACPI_GET_DESCRIPTOR_PTR(object);
&(((char *)
object)[cache->
link_offset])));
cache->current_depth--; cache->current_depth--;
......
...@@ -64,7 +64,7 @@ ACPI_MODULE_NAME("utexcep") ...@@ -64,7 +64,7 @@ ACPI_MODULE_NAME("utexcep")
******************************************************************************/ ******************************************************************************/
const char *acpi_format_exception(acpi_status status) const char *acpi_format_exception(acpi_status status)
{ {
const char *exception = NULL; const struct acpi_exception_info *exception;
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
...@@ -76,10 +76,10 @@ const char *acpi_format_exception(acpi_status status) ...@@ -76,10 +76,10 @@ const char *acpi_format_exception(acpi_status status)
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Unknown exception code: 0x%8.8X", status)); "Unknown exception code: 0x%8.8X", status));
exception = "UNKNOWN_STATUS_CODE"; return ("UNKNOWN_STATUS_CODE");
} }
return (ACPI_CAST_PTR(const char, exception)); return (exception->name);
} }
ACPI_EXPORT_SYMBOL(acpi_format_exception) ACPI_EXPORT_SYMBOL(acpi_format_exception)
...@@ -97,10 +97,10 @@ ACPI_EXPORT_SYMBOL(acpi_format_exception) ...@@ -97,10 +97,10 @@ ACPI_EXPORT_SYMBOL(acpi_format_exception)
* an ASCII string. * an ASCII string.
* *
******************************************************************************/ ******************************************************************************/
const char *acpi_ut_validate_exception(acpi_status status) const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status status)
{ {
u32 sub_status; u32 sub_status;
const char *exception = NULL; const struct acpi_exception_info *exception = NULL;
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
...@@ -113,35 +113,35 @@ const char *acpi_ut_validate_exception(acpi_status status) ...@@ -113,35 +113,35 @@ const char *acpi_ut_validate_exception(acpi_status status)
case AE_CODE_ENVIRONMENTAL: case AE_CODE_ENVIRONMENTAL:
if (sub_status <= AE_CODE_ENV_MAX) { if (sub_status <= AE_CODE_ENV_MAX) {
exception = acpi_gbl_exception_names_env[sub_status]; exception = &acpi_gbl_exception_names_env[sub_status];
} }
break; break;
case AE_CODE_PROGRAMMER: case AE_CODE_PROGRAMMER:
if (sub_status <= AE_CODE_PGM_MAX) { if (sub_status <= AE_CODE_PGM_MAX) {
exception = acpi_gbl_exception_names_pgm[sub_status]; exception = &acpi_gbl_exception_names_pgm[sub_status];
} }
break; break;
case AE_CODE_ACPI_TABLES: case AE_CODE_ACPI_TABLES:
if (sub_status <= AE_CODE_TBL_MAX) { if (sub_status <= AE_CODE_TBL_MAX) {
exception = acpi_gbl_exception_names_tbl[sub_status]; exception = &acpi_gbl_exception_names_tbl[sub_status];
} }
break; break;
case AE_CODE_AML: case AE_CODE_AML:
if (sub_status <= AE_CODE_AML_MAX) { if (sub_status <= AE_CODE_AML_MAX) {
exception = acpi_gbl_exception_names_aml[sub_status]; exception = &acpi_gbl_exception_names_aml[sub_status];
} }
break; break;
case AE_CODE_CONTROL: case AE_CODE_CONTROL:
if (sub_status <= AE_CODE_CTRL_MAX) { if (sub_status <= AE_CODE_CTRL_MAX) {
exception = acpi_gbl_exception_names_ctrl[sub_status]; exception = &acpi_gbl_exception_names_ctrl[sub_status];
} }
break; break;
...@@ -149,5 +149,9 @@ const char *acpi_ut_validate_exception(acpi_status status) ...@@ -149,5 +149,9 @@ const char *acpi_ut_validate_exception(acpi_status status)
break; break;
} }
return (ACPI_CAST_PTR(const char, exception)); if (!exception || !exception->name) {
return (NULL);
}
return (exception);
} }
...@@ -359,6 +359,8 @@ acpi_status acpi_ut_init_globals(void) ...@@ -359,6 +359,8 @@ acpi_status acpi_ut_init_globals(void)
#ifdef ACPI_DISASSEMBLER #ifdef ACPI_DISASSEMBLER
acpi_gbl_external_list = NULL; acpi_gbl_external_list = NULL;
acpi_gbl_num_external_methods = 0;
acpi_gbl_resolved_external_methods = 0;
#endif #endif
#ifdef ACPI_DEBUG_OUTPUT #ifdef ACPI_DEBUG_OUTPUT
......
...@@ -354,6 +354,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) ...@@ -354,6 +354,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
} }
resource->end.type = ACPI_RESOURCE_TYPE_END_TAG; resource->end.type = ACPI_RESOURCE_TYPE_END_TAG;
resource->end.length = sizeof(struct acpi_resource);
/* Attempt to set the resource */ /* Attempt to set the resource */
status = acpi_set_current_resources(link->device->handle, &buffer); status = acpi_set_current_resources(link->device->handle, &buffer);
......
...@@ -4121,7 +4121,7 @@ static int sony_pic_enable(struct acpi_device *device, ...@@ -4121,7 +4121,7 @@ static int sony_pic_enable(struct acpi_device *device,
resource->res3.data.irq.sharable = ACPI_SHARED; resource->res3.data.irq.sharable = ACPI_SHARED;
resource->res4.type = ACPI_RESOURCE_TYPE_END_TAG; resource->res4.type = ACPI_RESOURCE_TYPE_END_TAG;
resource->res4.length = sizeof(struct acpi_resource);
} }
/* setup Type 2/3 resources */ /* setup Type 2/3 resources */
else { else {
...@@ -4140,6 +4140,7 @@ static int sony_pic_enable(struct acpi_device *device, ...@@ -4140,6 +4140,7 @@ static int sony_pic_enable(struct acpi_device *device,
resource->res2.data.irq.sharable = ACPI_SHARED; resource->res2.data.irq.sharable = ACPI_SHARED;
resource->res3.type = ACPI_RESOURCE_TYPE_END_TAG; resource->res3.type = ACPI_RESOURCE_TYPE_END_TAG;
resource->res3.length = sizeof(struct acpi_resource);
} }
/* Attempt to set the resource */ /* Attempt to set the resource */
......
...@@ -634,6 +634,7 @@ int pnpacpi_build_resource_template(struct pnp_dev *dev, ...@@ -634,6 +634,7 @@ int pnpacpi_build_resource_template(struct pnp_dev *dev,
} }
/* resource will pointer the end resource now */ /* resource will pointer the end resource now */
resource->type = ACPI_RESOURCE_TYPE_END_TAG; resource->type = ACPI_RESOURCE_TYPE_END_TAG;
resource->length = sizeof(struct acpi_resource);
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -324,9 +324,9 @@ ...@@ -324,9 +324,9 @@
/* Helper macro */ /* Helper macro */
#define ACPI_TRACE_ENTRY(name, function, cast, param) \ #define ACPI_TRACE_ENTRY(name, function, type, param) \
ACPI_FUNCTION_NAME (name) \ ACPI_FUNCTION_NAME (name) \
function (ACPI_DEBUG_PARAMETERS, cast (param)) function (ACPI_DEBUG_PARAMETERS, (type) (param))
/* The actual entry trace macros */ /* The actual entry trace macros */
...@@ -335,13 +335,13 @@ ...@@ -335,13 +335,13 @@
acpi_ut_trace (ACPI_DEBUG_PARAMETERS) acpi_ut_trace (ACPI_DEBUG_PARAMETERS)
#define ACPI_FUNCTION_TRACE_PTR(name, pointer) \ #define ACPI_FUNCTION_TRACE_PTR(name, pointer) \
ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer) ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, void *, pointer)
#define ACPI_FUNCTION_TRACE_U32(name, value) \ #define ACPI_FUNCTION_TRACE_U32(name, value) \
ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value) ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, u32, value)
#define ACPI_FUNCTION_TRACE_STR(name, string) \ #define ACPI_FUNCTION_TRACE_STR(name, string) \
ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string) ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, char *, string)
#define ACPI_FUNCTION_ENTRY() \ #define ACPI_FUNCTION_ENTRY() \
acpi_ut_track_stack_ptr() acpi_ut_track_stack_ptr()
...@@ -355,16 +355,37 @@ ...@@ -355,16 +355,37 @@
* *
* One of the FUNCTION_TRACE macros above must be used in conjunction * One of the FUNCTION_TRACE macros above must be used in conjunction
* with these macros so that "_AcpiFunctionName" is defined. * with these macros so that "_AcpiFunctionName" is defined.
*
* There are two versions of most of the return macros. The default version is
* safer, since it avoids side-effects by guaranteeing that the argument will
* not be evaluated twice.
*
* A less-safe version of the macros is provided for optional use if the
* compiler uses excessive CPU stack (for example, this may happen in the
* debug case if code optimzation is disabled.)
*/ */
/* Exit trace helper macro */ /* Exit trace helper macro */
#define ACPI_TRACE_EXIT(function, cast, param) \ #ifndef ACPI_SIMPLE_RETURN_MACROS
#define ACPI_TRACE_EXIT(function, type, param) \
ACPI_DO_WHILE0 ({ \
register type _param = (type) (param); \
function (ACPI_DEBUG_PARAMETERS, _param); \
return (_param); \
})
#else /* Use original less-safe macros */
#define ACPI_TRACE_EXIT(function, type, param) \
ACPI_DO_WHILE0 ({ \ ACPI_DO_WHILE0 ({ \
function (ACPI_DEBUG_PARAMETERS, cast (param)); \ function (ACPI_DEBUG_PARAMETERS, (type) (param)); \
return ((param)); \ return (param); \
}) })
#endif /* ACPI_SIMPLE_RETURN_MACROS */
/* The actual exit macros */ /* The actual exit macros */
#define return_VOID \ #define return_VOID \
...@@ -374,13 +395,19 @@ ...@@ -374,13 +395,19 @@
}) })
#define return_ACPI_STATUS(status) \ #define return_ACPI_STATUS(status) \
ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status) ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status)
#define return_PTR(pointer) \ #define return_PTR(pointer) \
ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer) ACPI_TRACE_EXIT (acpi_ut_ptr_exit, void *, pointer)
#define return_VALUE(value) \ #define return_VALUE(value) \
ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value) ACPI_TRACE_EXIT (acpi_ut_value_exit, u64, value)
#define return_UINT32(value) \
ACPI_TRACE_EXIT (acpi_ut_value_exit, u32, value)
#define return_UINT8(value) \
ACPI_TRACE_EXIT (acpi_ut_value_exit, u8, value)
/* Conditional execution */ /* Conditional execution */
...@@ -428,8 +455,10 @@ ...@@ -428,8 +455,10 @@
#define return_VOID return #define return_VOID return
#define return_ACPI_STATUS(s) return(s) #define return_ACPI_STATUS(s) return(s)
#define return_VALUE(s) return(s)
#define return_PTR(s) return(s) #define return_PTR(s) return(s)
#define return_VALUE(s) return(s)
#define return_UINT8(s) return(s)
#define return_UINT32(s) return(s)
#endif /* ACPI_DEBUG_OUTPUT */ #endif /* ACPI_DEBUG_OUTPUT */
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */ /* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20130117 #define ACPI_CA_VERSION 0x20130214
#include <acpi/acconfig.h> #include <acpi/acconfig.h>
#include <acpi/actypes.h> #include <acpi/actypes.h>
......
...@@ -72,11 +72,13 @@ ...@@ -72,11 +72,13 @@
#define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */ #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */ #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */
#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */ #define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */
#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ #define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
#define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */ #define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */
#define ACPI_SIG_VRTC "VRTC" /* Virtual Real Time Clock Table */
#define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */ #define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */
#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */ #define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */ #define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
...@@ -850,6 +852,29 @@ struct acpi_table_mchi { ...@@ -850,6 +852,29 @@ struct acpi_table_mchi {
u8 pci_function; u8 pci_function;
}; };
/*******************************************************************************
*
* MTMR - MID Timer Table
* Version 1
*
* Conforms to "Simple Firmware Interface Specification",
* Draft 0.8.2, Oct 19, 2010
* NOTE: The ACPI MTMR is equivalent to the SFI MTMR table.
*
******************************************************************************/
struct acpi_table_mtmr {
struct acpi_table_header header; /* Common ACPI table header */
};
/* MTMR entry */
struct acpi_mtmr_entry {
struct acpi_generic_address physical_address;
u32 frequency;
u32 irq;
};
/******************************************************************************* /*******************************************************************************
* *
* SLIC - Software Licensing Description Table * SLIC - Software Licensing Description Table
...@@ -1023,6 +1048,28 @@ struct acpi_table_uefi { ...@@ -1023,6 +1048,28 @@ struct acpi_table_uefi {
u16 data_offset; /* Offset of remaining data in table */ u16 data_offset; /* Offset of remaining data in table */
}; };
/*******************************************************************************
*
* VRTC - Virtual Real Time Clock Table
* Version 1
*
* Conforms to "Simple Firmware Interface Specification",
* Draft 0.8.2, Oct 19, 2010
* NOTE: The ACPI VRTC is equivalent to The SFI MRTC table.
*
******************************************************************************/
struct acpi_table_vrtc {
struct acpi_table_header header; /* Common ACPI table header */
};
/* VRTC entry */
struct acpi_vrtc_entry {
struct acpi_generic_address physical_address;
u32 irq;
};
/******************************************************************************* /*******************************************************************************
* *
* WAET - Windows ACPI Emulated devices Table * WAET - Windows ACPI Emulated devices Table
......
...@@ -174,7 +174,7 @@ struct acpi_fpdt_header { ...@@ -174,7 +174,7 @@ struct acpi_fpdt_header {
enum acpi_fpdt_type { enum acpi_fpdt_type {
ACPI_FPDT_TYPE_BOOT = 0, ACPI_FPDT_TYPE_BOOT = 0,
ACPI_FPDT_TYPE_S3PERF = 1, ACPI_FPDT_TYPE_S3PERF = 1
}; };
/* /*
...@@ -223,7 +223,7 @@ struct acpi_s3pt_header { ...@@ -223,7 +223,7 @@ struct acpi_s3pt_header {
enum acpi_s3pt_type { enum acpi_s3pt_type {
ACPI_S3PT_TYPE_RESUME = 0, ACPI_S3PT_TYPE_RESUME = 0,
ACPI_S3PT_TYPE_SUSPEND = 1, ACPI_S3PT_TYPE_SUSPEND = 1
}; };
struct acpi_s3pt_resume { struct acpi_s3pt_resume {
...@@ -505,26 +505,59 @@ struct acpi_rasf_shared_memory { ...@@ -505,26 +505,59 @@ struct acpi_rasf_shared_memory {
u32 signature; u32 signature;
u16 command; u16 command;
u16 status; u16 status;
u64 requested_address; u16 version;
u64 requested_length; u8 capabilities[16];
u64 actual_address; u8 set_capabilities[16];
u64 actual_length; u16 num_parameter_blocks;
u32 set_capabilities_status;
};
/* RASF Parameter Block Structure Header */
struct acpi_rasf_parameter_block {
u16 type;
u16 version;
u16 length;
};
/* RASF Parameter Block Structure for PATROL_SCRUB */
struct acpi_rasf_patrol_scrub_parameter {
struct acpi_rasf_parameter_block header;
u16 patrol_scrub_command;
u64 requested_address_range[2];
u64 actual_address_range[2];
u16 flags; u16 flags;
u8 speed; u8 requested_speed;
}; };
/* Masks for Flags and Speed fields above */ /* Masks for Flags and Speed fields above */
#define ACPI_RASF_SCRUBBER_RUNNING 1 #define ACPI_RASF_SCRUBBER_RUNNING 1
#define ACPI_RASF_SPEED (7<<1) #define ACPI_RASF_SPEED (7<<1)
#define ACPI_RASF_SPEED_SLOW (0<<1)
#define ACPI_RASF_SPEED_MEDIUM (4<<1)
#define ACPI_RASF_SPEED_FAST (7<<1)
/* Channel Commands */ /* Channel Commands */
enum acpi_rasf_commands { enum acpi_rasf_commands {
ACPI_RASF_GET_RAS_CAPABILITIES = 1, ACPI_RASF_EXECUTE_RASF_COMMAND = 1
ACPI_RASF_GET_PATROL_PARAMETERS = 2, };
ACPI_RASF_START_PATROL_SCRUBBER = 3,
ACPI_RASF_STOP_PATROL_SCRUBBER = 4 /* Platform RAS Capabilities */
enum acpi_rasf_capabiliities {
ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
ACPI_SW_PATROL_SCRUB_EXPOSED = 1
};
/* Patrol Scrub Commands */
enum acpi_rasf_patrol_scrub_commands {
ACPI_RASF_GET_PATROL_PARAMETERS = 1,
ACPI_RASF_START_PATROL_SCRUBBER = 2,
ACPI_RASF_STOP_PATROL_SCRUBBER = 3
}; };
/* Channel Command flags */ /* Channel Command flags */
......
...@@ -1128,7 +1128,6 @@ struct acpi_memory_list { ...@@ -1128,7 +1128,6 @@ struct acpi_memory_list {
u16 object_size; u16 object_size;
u16 max_depth; u16 max_depth;
u16 current_depth; u16 current_depth;
u16 link_offset;
#ifdef ACPI_DBG_TRACK_ALLOCATIONS #ifdef ACPI_DBG_TRACK_ALLOCATIONS
......
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