Deleted Added
full compact
1
2/******************************************************************************
3 *
4 * Module Name: exoparg6 - AML execution - opcodes with 6 arguments
5 * $Revision: 4 $
5 * $Revision: 6 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.

--- 109 unchanged lines hidden (view full) ---

123#include "acparser.h"
124#include "amlcode.h"
125
126
127#define _COMPONENT ACPI_EXECUTER
128 MODULE_NAME ("exoparg6")
129
130
131
131/*!
132 * Naming convention for AML interpreter execution routines.
133 *
134 * The routines that begin execution of AML opcodes are named with a common
135 * convention based upon the number of arguments, the number of target operands,
136 * and whether or not a value is returned:
137 *
138 * AcpiExOpcode_xA_yT_zR
139 *
141 * Where:
140 * Where:
141 *
143 * xA - ARGUMENTS: The number of arguments (input operands) that are
142 * xA - ARGUMENTS: The number of arguments (input operands) that are
143 * required for this opcode type (1 through 6 args).
145 * yT - TARGETS: The number of targets (output operands) that are required
144 * yT - TARGETS: The number of targets (output operands) that are required
145 * for this opcode type (0, 1, or 2 targets).
147 * zR - RETURN VALUE: Indicates whether this opcode type returns a value
146 * zR - RETURN VALUE: Indicates whether this opcode type returns a value
147 * as the function return (0 or 1).
148 *
150 * The AcpiExOpcode* functions are called via the Dispatcher component with
149 * The AcpiExOpcode* functions are called via the Dispatcher component with
150 * fully resolved operands.
151!*/
152
153
155
154/*******************************************************************************
155 *
156 * FUNCTION: AcpiExDoMatch
157 *
158 * PARAMETERS: MatchOp - The AML match operand
159 * PackageValue - Value from the target package
160 * MatchValue - Value to be matched
161 *

--- 95 unchanged lines hidden (view full) ---

257 ACPI_OPERAND_OBJECT *ThisElement;
258
259
260 FUNCTION_TRACE_STR ("ExOpcode_6A_0T_1R", AcpiPsGetOpcodeName (WalkState->Opcode));
261
262
263 switch (WalkState->Opcode)
264 {
267 case AML_MATCH_OP:
268 /*
269 * Match (SearchPackage[0], MatchOp1[1], MatchObject1[2],
265 case AML_MATCH_OP:
266 /*
267 * Match (SearchPackage[0], MatchOp1[1], MatchObject1[2],
268 * MatchOp2[3], MatchObject2[4], StartIndex[5])
269 */
270
271 /* Validate match comparison sub-opcodes */
272
273 if ((Operand[1]->Integer.Value > MAX_MATCH_OPERATOR) ||
274 (Operand[3]->Integer.Value > MAX_MATCH_OPERATOR))
275 {

--- 21 unchanged lines hidden (view full) ---

297 /* Default return value if no match found */
298
299 ReturnDesc->Integer.Value = ACPI_INTEGER_MAX;
300
301 /*
302 * Examine each element until a match is found. Within the loop,
303 * "continue" signifies that the current element does not match
304 * and the next should be examined.
305 *
306 * Upon finding a match, the loop will terminate via "break" at
307 * the bottom. If it terminates "normally", MatchValue will be -1
308 * (its initial value) indicating that no match was found. When
309 * returned as a Number, this will produce the Ones value as specified.
310 */
311 for ( ; Index < Operand[0]->Package.Count; Index++)
312 {
313 ThisElement = Operand[0]->Package.Elements[Index];
314
315 /*
316 * Treat any NULL or non-numeric elements as non-matching.
318 * TBD [Unhandled] - if an element is a Name,
319 * should we examine its value?
317 */
318 if (!ThisElement ||
319 ThisElement->Common.Type != ACPI_TYPE_INTEGER)
320 {
321 continue;
322 }
323
327
324 /*
329 * Within these switch statements:
330 * "break" (exit from the switch) signifies a match;
331 * "continue" (proceed to next iteration of enclosing
332 * "for" loop) signifies a non-match.
325 * "continue" (proceed to next iteration of enclosing
326 * "for" loop) signifies a non-match.
327 */
334 if (!AcpiExDoMatch ((UINT32) Operand[1]->Integer.Value,
328 if (!AcpiExDoMatch ((UINT32) Operand[1]->Integer.Value,
329 ThisElement->Integer.Value, Operand[2]->Integer.Value))
330 {
331 continue;
332 }
333
340
341 if (!AcpiExDoMatch ((UINT32) Operand[3]->Integer.Value,
334 if (!AcpiExDoMatch ((UINT32) Operand[3]->Integer.Value,
335 ThisElement->Integer.Value, Operand[4]->Integer.Value))
336 {
337 continue;
338 }
339
340 /* Match found: Index is the return value */
341
342 ReturnDesc->Integer.Value = Index;

--- 37 unchanged lines hidden ---