Skip to content

Commit

Permalink
Merge branch 'acpica'
Browse files Browse the repository at this point in the history
* acpica:
  ACPICA: Update version to 20170831
  ACPICA: Update acpi_get_timer for 64-bit interface to acpi_hw_read
  ACPICA: String conversions: Update to add new behaviors
  ACPICA: String conversions: Cleanup/format comments. No functional changes
  ACPICA: Restructure/cleanup all string-to-integer conversion functions
  ACPICA: Header support for the PDTT ACPI table
  ACPICA: acpiexec: Add testability of deferred table verification
  ACPICA: Hardware: Enable 64-bit support of hardware accesses
  • Loading branch information
rafaeljw committed Nov 13, 2017
2 parents 1be9c3a + d954f94 commit 60764eb
Show file tree
Hide file tree
Showing 25 changed files with 834 additions and 412 deletions.
1 change: 1 addition & 0 deletions drivers/acpi/acpica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ acpi-y += \
utresrc.o \
utstate.o \
utstring.o \
utstrsuppt.o \
utstrtoul64.o \
utxface.o \
utxfinit.o \
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/achware.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ acpi_status
acpi_hw_validate_register(struct acpi_generic_address *reg,
u8 max_bit_width, u64 *address);

acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg);
acpi_status acpi_hw_read(u64 *value, struct acpi_generic_address *reg);

acpi_status acpi_hw_write(u32 value, struct acpi_generic_address *reg);
acpi_status acpi_hw_write(u64 value, struct acpi_generic_address *reg);

struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id);

Expand Down
6 changes: 2 additions & 4 deletions drivers/acpi/acpica/acinterp.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ typedef const struct acpi_exdump_info {
*/
acpi_status
acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
union acpi_operand_object **result_desc, u32 flags);
union acpi_operand_object **result_desc,
u32 implicit_conversion);

acpi_status
acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
Expand Down Expand Up @@ -424,9 +425,6 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
struct acpi_walk_state *walk_state,
u8 implicit_conversion);

#define ACPI_IMPLICIT_CONVERSION TRUE
#define ACPI_NO_IMPLICIT_CONVERSION FALSE

/*
* exstoren - resolve/store object
*/
Expand Down
33 changes: 27 additions & 6 deletions drivers/acpi/acpica/acutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ extern const char *acpi_gbl_ptyp_decode[];
#define ACPI_MSG_SUFFIX \
acpi_os_printf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, module_name, line_number)

/* Flags to indicate implicit or explicit string-to-integer conversion */

#define ACPI_IMPLICIT_CONVERSION TRUE
#define ACPI_NO_IMPLICIT_CONVERSION FALSE

/* Types for Resource descriptor entries */

#define ACPI_INVALID_RESOURCE 0
Expand Down Expand Up @@ -197,15 +202,31 @@ void acpi_ut_strlwr(char *src_string);

int acpi_ut_stricmp(char *string1, char *string2);

acpi_status acpi_ut_strtoul64(char *string, u32 flags, u64 *ret_integer);
/*
* utstrsuppt - string-to-integer conversion support functions
*/
acpi_status acpi_ut_convert_octal_string(char *string, u64 *return_value);

acpi_status acpi_ut_convert_decimal_string(char *string, u64 *return_value_ptr);

acpi_status acpi_ut_convert_hex_string(char *string, u64 *return_value_ptr);

char acpi_ut_remove_whitespace(char **string);

char acpi_ut_remove_leading_zeros(char **string);

u8 acpi_ut_detect_hex_prefix(char **string);

u8 acpi_ut_detect_octal_prefix(char **string);

/*
* Values for Flags above
* Note: LIMIT values correspond to acpi_gbl_integer_byte_width values (4/8)
* utstrtoul64 - string-to-integer conversion functions
*/
#define ACPI_STRTOUL_32BIT 0x04 /* 4 bytes */
#define ACPI_STRTOUL_64BIT 0x08 /* 8 bytes */
#define ACPI_STRTOUL_BASE16 0x10 /* Default: Base10/16 */
acpi_status acpi_ut_strtoul64(char *string, u64 *ret_integer);

u64 acpi_ut_explicit_strtoul64(char *string);

u64 acpi_ut_implicit_strtoul64(char *string);

/*
* utglobal - Global data structures and procedures
Expand Down
5 changes: 1 addition & 4 deletions drivers/acpi/acpica/dbconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,7 @@ acpi_db_convert_to_object(acpi_object_type type,
default:

object->type = ACPI_TYPE_INTEGER;
status = acpi_ut_strtoul64(string,
(acpi_gbl_integer_byte_width |
ACPI_STRTOUL_BASE16),
&object->integer.value);
status = acpi_ut_strtoul64(string, &object->integer.value);
break;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/dswexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
* object. Implicitly convert the argument if necessary.
*/
status = acpi_ex_convert_to_integer(obj_desc, &local_obj_desc,
ACPI_STRTOUL_BASE16);
ACPI_IMPLICIT_CONVERSION);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/acpica/evgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
struct acpi_gpe_handler_info *gpe_handler_info;
u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
u8 enabled_status_byte;
u32 status_reg;
u32 enable_reg;
u64 status_reg;
u64 enable_reg;
acpi_cpu_flags flags;
u32 i;
u32 j;
Expand Down Expand Up @@ -472,7 +472,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
gpe_register_info->base_gpe_number,
gpe_register_info->base_gpe_number +
(ACPI_GPE_REGISTER_WIDTH - 1),
status_reg, enable_reg,
(u32)status_reg, (u32)enable_reg,
gpe_register_info->enable_for_run,
gpe_register_info->enable_for_wake));

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/exconcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,

status =
acpi_ex_convert_to_integer(local_operand1, &temp_operand1,
ACPI_STRTOUL_BASE16);
ACPI_IMPLICIT_CONVERSION);
break;

case ACPI_TYPE_BUFFER:
Expand Down
30 changes: 18 additions & 12 deletions drivers/acpi/acpica/exconvrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 max_length);
*
* FUNCTION: acpi_ex_convert_to_integer
*
* PARAMETERS: obj_desc - Object to be converted. Must be an
* Integer, Buffer, or String
* result_desc - Where the new Integer object is returned
* flags - Used for string conversion
* PARAMETERS: obj_desc - Object to be converted. Must be an
* Integer, Buffer, or String
* result_desc - Where the new Integer object is returned
* implicit_conversion - Used for string conversion
*
* RETURN: Status
*
Expand All @@ -70,14 +70,14 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 max_length);

acpi_status
acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
union acpi_operand_object **result_desc, u32 flags)
union acpi_operand_object **result_desc,
u32 implicit_conversion)
{
union acpi_operand_object *return_desc;
u8 *pointer;
u64 result;
u32 i;
u32 count;
acpi_status status;

ACPI_FUNCTION_TRACE_PTR(ex_convert_to_integer, obj_desc);

Expand Down Expand Up @@ -123,12 +123,18 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
* hexadecimal as per the ACPI specification. The only exception (as
* of ACPI 3.0) is that the to_integer() operator allows both decimal
* and hexadecimal strings (hex prefixed with "0x").
*
* Explicit conversion is used only by to_integer.
* All other string-to-integer conversions are implicit conversions.
*/
status = acpi_ut_strtoul64(ACPI_CAST_PTR(char, pointer),
(acpi_gbl_integer_byte_width |
flags), &result);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
if (implicit_conversion) {
result =
acpi_ut_implicit_strtoul64(ACPI_CAST_PTR
(char, pointer));
} else {
result =
acpi_ut_explicit_strtoul64(ACPI_CAST_PTR
(char, pointer));
}
break;

Expand Down Expand Up @@ -631,7 +637,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
*/
status =
acpi_ex_convert_to_integer(source_desc, result_desc,
ACPI_STRTOUL_BASE16);
ACPI_IMPLICIT_CONVERSION);
break;

case ACPI_TYPE_STRING:
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/exmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ acpi_ex_do_logical_op(u16 opcode,
case ACPI_TYPE_INTEGER:

status = acpi_ex_convert_to_integer(operand1, &local_operand1,
ACPI_STRTOUL_BASE16);
ACPI_IMPLICIT_CONVERSION);
break;

case ACPI_TYPE_STRING:
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/exresop.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ acpi_ex_resolve_operands(u16 opcode,
* Known as "Implicit Source Operand Conversion"
*/
status = acpi_ex_convert_to_integer(obj_desc, stack_ptr,
ACPI_STRTOUL_BASE16);
ACPI_IMPLICIT_CONVERSION);
if (ACPI_FAILURE(status)) {
if (status == AE_TYPE) {
ACPI_ERROR((AE_INFO,
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/hwgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action)
{
struct acpi_gpe_register_info *gpe_register_info;
acpi_status status = AE_OK;
u32 enable_mask;
u64 enable_mask;
u32 register_bit;

ACPI_FUNCTION_ENTRY();
Expand Down Expand Up @@ -214,7 +214,7 @@ acpi_status
acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
acpi_event_status *event_status)
{
u32 in_byte;
u64 in_byte;
u32 register_bit;
struct acpi_gpe_register_info *gpe_register_info;
acpi_event_status local_event_status = 0;
Expand Down
Loading

0 comments on commit 60764eb

Please sign in to comment.