Debian Codegraph @

tests/aslts/src/runtime/collections/bdemo/ACPICA/0301/DECL.asl

raw
1 /*
2 * Some or all of this work - Copyright (c) 2006 - 2021, Intel Corp.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met:
7 *
8 * Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * Neither the name of Intel Corporation nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28 /*
29 * Bug 301:
30 *
31 * SUMMARY: Recursive calls to methods with the internal declarations (and Switches) causes AE_AML_INTERNAL and crash
32 */
33 Method (M1EA, 0, NotSerialized)
34 {
35 Method (M19C, 0, Serialized)
36 {
37 Name (RPT0, 0x00)
38 /*
39 * Total number of calls of the same Recursively Called method (RCM),
40 * the first call is counted there too.
41 */
42 Name (N000, 0x03)
43 Name (CNT0, 0x00) /* how many methods are in progress simultaneously */
44 Name (MAX0, 0x00) /* maximal number of methods being in progress simultaneously */
45 /*
46 * Open method execution
47 *
48 * arg0 - ID of method (1,2,3...)
49 * arg1 - the message to be reported
50 */
51 Method (M800, 2, NotSerialized)
52 {
53 If (RPT0)
54 {
55 Debug = Arg1
56 }
57
58 CNT0++
59 If ((CNT0 > MAX0))
60 {
61 MAX0 = CNT0 /* \M1EA.M19C.CNT0 */
62 }
63 }
64
65 /*
66 * Close method execution
67 *
68 * arg0 - ID of method (1,2,3...)
69 */
70 Method (M801, 1, NotSerialized)
71 {
72 CNT0--
73 }
74
75 /*
76 * Arguments of methods:
77 * arg0 - 0 - the first call, otherwise - recursive calls
78 */
79 Name (C000, 0x03)
80 Method (M100, 0, Serialized)
81 {
82 Name (C100, 0x03)
83 Method (M200, 0, Serialized)
84 {
85 Name (C200, 0x03)
86 Method (M300, 0, Serialized)
87 {
88 Name (C300, 0x03)
89 Method (M400, 0, NotSerialized)
90 {
91 M800 (0x04, "m400")
92 C300--
93 If ((C300 == 0x00))
94 {
95 M300 ()
96 }
97 Else
98 {
99 M400 ()
100 }
101
102 M801 (0x04)
103 }
104
105 M800 (0x03, "m300")
106 C200--
107 If ((C200 == 0x00))
108 {
109 M200 ()
110 }
111 Else
112 {
113 M400 ()
114 }
115
116 M801 (0x03)
117 }
118
119 M800 (0x02, "m200")
120 C100--
121 If ((C100 == 0x00))
122 {
123 M100 ()
124 }
125 Else
126 {
127 M300 ()
128 }
129
130 M801 (0x02)
131 }
132
133 M800 (0x01, "m100")
134 C000--
135 If ((C000 == 0x00)){ /* m000() */
136 }
137 Else
138 {
139 M200 ()
140 }
141
142 M801 (0x01)
143 }
144
145 M100 ()
146 }
147
148 CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
149 M19C ()
150 CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
151 }