1010#include <acpi/acpi.h>
1111#include "accommon.h"
1212#include "acinterp.h"
13+ #include <acpi/acoutput.h>
1314#include "acparser.h"
1415#include "amlcode.h"
1516
@@ -51,37 +52,38 @@ ACPI_MODULE_NAME("exoparg3")
5152acpi_status acpi_ex_opcode_3A_0T_0R (struct acpi_walk_state * walk_state )
5253{
5354 union acpi_operand_object * * operand = & walk_state -> operands [0 ];
54- struct acpi_signal_fatal_info * fatal ;
55- acpi_status status = AE_OK ;
55+ struct acpi_signal_fatal_info fatal ;
5656
5757 ACPI_FUNCTION_TRACE_STR (ex_opcode_3A_0T_0R ,
5858 acpi_ps_get_opcode_name (walk_state -> opcode ));
5959
6060 switch (walk_state -> opcode ) {
6161 case AML_FATAL_OP : /* Fatal (fatal_type fatal_code fatal_arg) */
6262
63- ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,
64- "FatalOp: Type %X Code %X Arg %X "
65- "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n" ,
66- (u32 )operand [0 ]-> integer .value ,
67- (u32 )operand [1 ]-> integer .value ,
68- (u32 )operand [2 ]-> integer .value ));
69-
70- fatal = ACPI_ALLOCATE (sizeof (struct acpi_signal_fatal_info ));
71- if (fatal ) {
72- fatal -> type = (u32 ) operand [0 ]-> integer .value ;
73- fatal -> code = (u32 ) operand [1 ]-> integer .value ;
74- fatal -> argument = (u32 ) operand [2 ]-> integer .value ;
75- }
63+ fatal .type = (u32 )operand [0 ]-> integer .value ;
64+ fatal .code = (u32 )operand [1 ]-> integer .value ;
65+ fatal .argument = (u32 )operand [2 ]-> integer .value ;
7666
77- /* Always signal the OS! */
67+ ACPI_BIOS_ERROR ((AE_INFO ,
68+ "Fatal ACPI BIOS error (Type 0x%X Code 0x%X Arg 0x%X)\n" ,
69+ fatal .type , fatal .code , fatal .argument ));
7870
79- status = acpi_os_signal ( ACPI_SIGNAL_FATAL , fatal );
71+ /* Always signal the OS! */
8072
81- /* Might return while OS is shutting down, just continue */
73+ acpi_os_signal ( ACPI_SIGNAL_FATAL , & fatal );
8274
83- ACPI_FREE (fatal );
84- goto cleanup ;
75+ #ifndef ACPI_CONTINUE_ON_FATAL
76+ /*
77+ * Might return while OS is shutting down, so abort the AML execution
78+ * by returning an error.
79+ */
80+ return_ACPI_STATUS (AE_ERROR );
81+ #else
82+ /*
83+ * The alstests require that the Fatal() opcode does not return an error.
84+ */
85+ return_ACPI_STATUS (AE_OK );
86+ #endif
8587
8688 case AML_EXTERNAL_OP :
8789 /*
@@ -93,21 +95,16 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
9395 * wrong if an external opcode ever gets here.
9496 */
9597 ACPI_ERROR ((AE_INFO , "Executed External Op" ));
96- status = AE_OK ;
97- goto cleanup ;
98+
99+ return_ACPI_STATUS ( AE_OK ) ;
98100
99101 default :
100102
101103 ACPI_ERROR ((AE_INFO , "Unknown AML opcode 0x%X" ,
102104 walk_state -> opcode ));
103105
104- status = AE_AML_BAD_OPCODE ;
105- goto cleanup ;
106+ return_ACPI_STATUS (AE_AML_BAD_OPCODE );
106107 }
107-
108- cleanup :
109-
110- return_ACPI_STATUS (status );
111108}
112109
113110/*******************************************************************************
0 commit comments