Skip to content

Commit

Permalink
Merge back earlier ACPICA material for v4.10.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael J. Wysocki committed Dec 1, 2016
2 parents e2174b0 + 69d4e42 commit d0ab671
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 18 deletions.
5 changes: 1 addition & 4 deletions drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,6 @@ ACPI_INIT_GLOBAL(u32, acpi_gbl_nesting_level, 0);

ACPI_GLOBAL(struct acpi_thread_state *, acpi_gbl_current_walk_list);

/* Maximum number of While() loop iterations before forced abort */

ACPI_GLOBAL(u16, acpi_gbl_max_loop_iterations);

/* Control method single step flag */

ACPI_GLOBAL(u8, acpi_gbl_cm_single_step);
Expand Down Expand Up @@ -318,6 +314,7 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_cstyle_disassembly, TRUE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_force_aml_disassembly, FALSE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_opt_verbose, TRUE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_emit_external_opcodes, FALSE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_do_disassembler_optimizations, TRUE);

ACPI_GLOBAL(u8, acpi_gbl_dm_opt_disasm);
ACPI_GLOBAL(u8, acpi_gbl_dm_opt_listing);
Expand Down
19 changes: 10 additions & 9 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ union acpi_parse_value {
union acpi_parse_value value; /* Value or args associated with the opcode */\
u8 arg_list_length; /* Number of elements in the arg list */\
ACPI_DISASM_ONLY_MEMBERS (\
u8 disasm_flags; /* Used during AML disassembly */\
u16 disasm_flags; /* Used during AML disassembly */\
u8 disasm_opcode; /* Subtype used for disassembly */\
char *operator_symbol;/* Used for C-style operator name strings */\
char aml_op_name[16]) /* Op name (debug only) */
Expand Down Expand Up @@ -868,14 +868,15 @@ struct acpi_parse_state {

/* Parse object disasm_flags */

#define ACPI_PARSEOP_IGNORE 0x01
#define ACPI_PARSEOP_PARAMETER_LIST 0x02
#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
#define ACPI_PARSEOP_PREDEFINED_CHECKED 0x08
#define ACPI_PARSEOP_CLOSING_PAREN 0x10
#define ACPI_PARSEOP_COMPOUND_ASSIGNMENT 0x20
#define ACPI_PARSEOP_ASSIGNMENT 0x40
#define ACPI_PARSEOP_ELSEIF 0x80
#define ACPI_PARSEOP_IGNORE 0x0001
#define ACPI_PARSEOP_PARAMETER_LIST 0x0002
#define ACPI_PARSEOP_EMPTY_TERMLIST 0x0004
#define ACPI_PARSEOP_PREDEFINED_CHECKED 0x0008
#define ACPI_PARSEOP_CLOSING_PAREN 0x0010
#define ACPI_PARSEOP_COMPOUND_ASSIGNMENT 0x0020
#define ACPI_PARSEOP_ASSIGNMENT 0x0040
#define ACPI_PARSEOP_ELSEIF 0x0080
#define ACPI_PARSEOP_LEGACY_ASL_ONLY 0x0100

/*****************************************************************************
*
Expand Down
6 changes: 5 additions & 1 deletion drivers/acpi/acpica/tbxfload.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ acpi_status acpi_tb_load_namespace(void)
}

if (!tables_failed) {
ACPI_INFO(("%u ACPI AML tables successfully acquired and loaded\n", tables_loaded));
ACPI_INFO(("%u ACPI AML tables successfully acquired and loaded", tables_loaded));
} else {
ACPI_ERROR((AE_INFO,
"%u table load failures, %u successful",
Expand All @@ -250,6 +250,10 @@ acpi_status acpi_tb_load_namespace(void)
status = AE_CTRL_TERMINATE;
}

#ifdef ACPI_APPLICATION
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "\n"));
#endif

unlock_and_exit:
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
return_ACPI_STATUS(status);
Expand Down
2 changes: 1 addition & 1 deletion include/acpi/acconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@

/* Maximum number of While() loops before abort */

#define ACPI_MAX_LOOP_COUNT 0xFFFF
#define ACPI_MAX_LOOP_COUNT 0x000FFFFF

/******************************************************************************
*
Expand Down
9 changes: 8 additions & 1 deletion include/acpi/acpixf.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

/* Current ACPICA subsystem version in YYYYMMDD format */

#define ACPI_CA_VERSION 0x20160831
#define ACPI_CA_VERSION 0x20160930

#include <acpi/acconfig.h>
#include <acpi/actypes.h>
Expand Down Expand Up @@ -258,6 +258,13 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0);
*/
ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE);

/*
* Maximum number of While() loop iterations before forced method abort.
* This mechanism is intended to prevent infinite loops during interpreter
* execution within a host kernel.
*/
ACPI_INIT_GLOBAL(u32, acpi_gbl_max_loop_iterations, ACPI_MAX_LOOP_COUNT);

/*
* This mechanism is used to trace a specified AML method. The method is
* traced each time it is executed.
Expand Down
13 changes: 11 additions & 2 deletions tools/power/acpi/os_specific/service_layers/osunixxf.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,12 @@ acpi_os_create_semaphore(u32 max_units,
}
#ifdef __APPLE__
{
char *semaphore_name = tmpnam(NULL);
static int semaphore_count = 0;
char semaphore_name[32];

snprintf(semaphore_name, sizeof(semaphore_name), "acpi_sem_%d",
semaphore_count++);
printf("%s\n", semaphore_name);
sem =
sem_open(semaphore_name, O_EXCL | O_CREAT, 0755,
initial_units);
Expand Down Expand Up @@ -692,10 +696,15 @@ acpi_status acpi_os_delete_semaphore(acpi_handle handle)
if (!sem) {
return (AE_BAD_PARAMETER);
}

#ifdef __APPLE__
if (sem_close(sem) == -1) {
return (AE_BAD_PARAMETER);
}
#else
if (sem_destroy(sem) == -1) {
return (AE_BAD_PARAMETER);
}
#endif

return (AE_OK);
}
Expand Down

0 comments on commit d0ab671

Please sign in to comment.