Lines Matching +full:x +full:- +full:origin
1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
4 * Module Name: pstree - Parser op tree manipulation/traversal/search
6 * Copyright (C) 2000 - 2025, Intel Corp.
28 * PARAMETERS: op - Get an argument for this op
29 * argn - Nth argument to get
45 if (Op->Common.aml_opcode == AML_INT_CONNECTION_OP) in acpi_ps_get_arg()
47 return (Op->Common.Value.Arg); in acpi_ps_get_arg()
52 op_info = acpi_ps_get_opcode_info(op->common.aml_opcode); in acpi_ps_get_arg()
53 if (op_info->class == AML_CLASS_UNKNOWN) { in acpi_ps_get_arg()
60 /* Check if this opcode requires argument sub-objects */ in acpi_ps_get_arg()
62 if (!(op_info->flags & AML_HAS_ARGS)) { in acpi_ps_get_arg()
71 arg = op->common.value.arg; in acpi_ps_get_arg()
73 argn--; in acpi_ps_get_arg()
74 arg = arg->common.next; in acpi_ps_get_arg()
84 * PARAMETERS: op - Append an argument to this Op.
85 * arg - Argument Op to append
107 op_info = acpi_ps_get_opcode_info(op->common.aml_opcode); in acpi_ps_append_arg()
108 if (op_info->class == AML_CLASS_UNKNOWN) { in acpi_ps_append_arg()
112 ACPI_ERROR((AE_INFO, "Invalid AML Opcode: 0x%2.2X", in acpi_ps_append_arg()
113 op->common.aml_opcode)); in acpi_ps_append_arg()
117 /* Check if this opcode requires argument sub-objects */ in acpi_ps_append_arg()
119 if (!(op_info->flags & AML_HAS_ARGS)) { in acpi_ps_append_arg()
128 if (op->common.value.arg) { in acpi_ps_append_arg()
132 prev_arg = op->common.value.arg; in acpi_ps_append_arg()
133 while (prev_arg->common.next) { in acpi_ps_append_arg()
134 prev_arg = prev_arg->common.next; in acpi_ps_append_arg()
136 prev_arg->common.next = arg; in acpi_ps_append_arg()
140 op->common.value.arg = arg; in acpi_ps_append_arg()
146 arg->common.parent = op; in acpi_ps_append_arg()
147 arg = arg->common.next; in acpi_ps_append_arg()
149 op->common.arg_list_length++; in acpi_ps_append_arg()
159 * PARAMETERS: origin - Root of subtree to search
160 * op - Last (previous) Op that was found
164 * DESCRIPTION: Get next op in tree (walking the tree in depth-first order)
165 * Return NULL when reaching "origin" or when walking up from root
169 union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin, in acpi_ps_get_depth_next() argument
192 next = op->common.next; in acpi_ps_get_depth_next()
200 parent = op->common.parent; in acpi_ps_get_depth_next()
204 while (arg && (arg != origin) && (arg != op)) { in acpi_ps_get_depth_next()
207 arg = arg->common.next; in acpi_ps_get_depth_next()
210 if (arg == origin) { in acpi_ps_get_depth_next()
212 /* Reached parent of origin, end search */ in acpi_ps_get_depth_next()
217 if (parent->common.next) { in acpi_ps_get_depth_next()
221 ASL_CV_LABEL_FILENODE(parent->common.next); in acpi_ps_get_depth_next()
222 return (parent->common.next); in acpi_ps_get_depth_next()
226 parent = parent->common.parent; in acpi_ps_get_depth_next()
238 * PARAMETERS: op - Get the child of this Op
252 switch (op->common.aml_opcode) { in acpi_ps_get_child()