Skip to content

Commit

Permalink
Fix exception code class checks
Browse files Browse the repository at this point in the history
The macros to classify different AML exception codes are broken. For
instance,

  ACPI_ENV_EXCEPTION(Status)

will always evaluate to zero due to

  #define AE_CODE_ENVIRONMENTAL      0x0000
  #define ACPI_ENV_EXCEPTION(Status) (Status & AE_CODE_ENVIRONMENTAL)

Similarly, ACPI_AML_EXCEPTION(Status) will evaluate to a non-zero value
for error codes of type AE_CODE_PROGRAMMER, AE_CODE_ACPI_TABLES, as well
as AE_CODE_AML, and not just AE_CODE_AML as the name suggests.

This commit fixes those checks.

Fixes: e884d78 ("AML Parser: ignore all exceptions that result from incorrect AML during table load")
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
  • Loading branch information
qzed committed Oct 18, 2020
1 parent 05c19a3 commit 1a3a549
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/include/acexcep.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ typedef struct acpi_exception_info

#define AE_OK (ACPI_STATUS) 0x0000

#define ACPI_ENV_EXCEPTION(Status) (Status & AE_CODE_ENVIRONMENTAL)
#define ACPI_AML_EXCEPTION(Status) (Status & AE_CODE_AML)
#define ACPI_PROG_EXCEPTION(Status) (Status & AE_CODE_PROGRAMMER)
#define ACPI_TABLE_EXCEPTION(Status) (Status & AE_CODE_ACPI_TABLES)
#define ACPI_CNTL_EXCEPTION(Status) (Status & AE_CODE_CONTROL)
#define ACPI_ENV_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_ENVIRONMENTAL)
#define ACPI_AML_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_AML)
#define ACPI_PROG_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_PROGRAMMER)
#define ACPI_TABLE_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_ACPI_TABLES)
#define ACPI_CNTL_EXCEPTION(Status) (((Status) & AE_CODE_MASK) == AE_CODE_CONTROL)


/*
Expand Down

0 comments on commit 1a3a549

Please sign in to comment.