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/*
30 * Aplicable for abbu only
31 */
32
33Name(z172, 172)
34
35Method(dvf2,, Serialized)
36{
37	Name(ts, "dvf2")
38	Device(d000) {
39		Name(i000, 0x00000001)
40	}
41
42	Method(m001)
43	{
44		Method(m002)
45		{
46			Method(m003)
47			{
48				Return (0xabcd0000)
49			}
50			Return (Add(\_SB_.ABBU.dvf2.d000.i000, m003()))
51		}
52		Return (Add(\_SB_.ABBU.dvf2.d000.i000, m002()))
53	}
54
55	Store(Add(\_SB_.ABBU.dvf2.d000.i000, m001()), Local0)
56	if (LNotEqual(Local0, 0xabcd0003)) {
57		err(ts, z172, __LINE__, 0, 0, Local0, 0xabcd0003)
58	}
59}
60
61/*
62 * Named object as element of Package
63 *
64 *   Named element of Package, perhaps, is not implemented by MS,
65 *   i000 in Package(){i000} is, on MS, the same as Package(){"i000"}.
66 *
67 * fail
68 */
69Method(mf26,, Serialized)
70{
71	Name(ts, "mf26")
72	Name(i000, 0xabcd0000)
73	Name(i001, 0xabcd0001)
74	Name(i002, 0xabcd0002)
75	Name(i003, 0xabcd0003)
76
77	Name(ii00, 0x11112222)
78
79	Name(p000, Package() {
80		i000,
81		i001,
82		i002,
83		"i000",
84		\_SB_.ABBU.mf26.i003,
85		0xabcd0004
86		})
87
88	Method(m001, 2)
89	{
90		Store(DerefOf(Index(arg0, 0)), Local0)
91		if (LNotEqual(Local0, 0xabcd0000)) {
92			err(ts, z164, __LINE__, 0, 0, Local0, 0xabcd0000)
93		}
94		Store(DerefOf(Index(arg0, 1)), Local0)
95		if (LNotEqual(Local0, 0xabcd0001)) {
96			err(ts, z164, __LINE__, 0, 0, Local0, 0xabcd0001)
97		}
98		Store(DerefOf(Index(arg0, 2)), Local0)
99		if (LNotEqual(Local0, 0xabcd0002)) {
100			err(ts, z164, __LINE__, 0, 0, Local0, 0xabcd0002)
101		}
102		Store(DerefOf(Index(arg0, 3)), Local0)
103		if (LNotEqual(Local0, "i000")) {
104			err(ts, z164, __LINE__, 0, 0, Local0, "i000")
105		}
106		Store(DerefOf(Index(arg0, 4)), Local0)
107		if (LNotEqual(Local0, 0xabcd0003)) {
108			err(ts, z164, __LINE__, 0, 0, Local0, 0xabcd0003)
109		}
110		Store(DerefOf(Index(arg0, 5)), Local0)
111		if (LNotEqual(Local0, 0xabcd0004)) {
112			err(ts, z164, __LINE__, 0, 0, Local0, 0xabcd0004)
113		}
114
115		Store(ii00, Index(arg0, 0))
116
117		Store(DerefOf(Index(arg0, 0)), Local0)
118		if (LNotEqual(Local0, 0x11112222)) {
119			err(ts, z164, __LINE__, 0, 0, Local0, 0x11112222)
120		}
121	}
122
123	if (0) {
124		Store(DerefOf(Index(p000, 0)), Local0)
125		OUTP(Local0)
126		Store(DerefOf(Index(p000, 1)), Local0)
127		OUTP(Local0)
128		Store(DerefOf(Index(p000, 2)), Local0)
129		OUTP(Local0)
130		Store(DerefOf(Index(p000, 3)), Local0)
131		OUTP(Local0)
132		Store(DerefOf(Index(p000, 4)), Local0)
133		OUTP(Local0)
134		Store(DerefOf(Index(p000, 5)), Local0)
135		OUTP(Local0)
136	}
137
138	m001(p000, RefOf(p000))
139
140	Store(DerefOf(Index(p000, 0)), Local0)
141	if (LNotEqual(Local0, 0x11112222)) {
142		err(ts, z164, __LINE__, 0, 0, Local0, 0x11112222)
143	}
144	Store(DerefOf(Index(p000, 1)), Local0)
145	if (LNotEqual(Local0, 0xabcd0001)) {
146		err(ts, z164, __LINE__, 0, 0, Local0, 0xabcd0001)
147	}
148
149	Store(DerefOf(Index(p000, 2)), Local0)
150	if (LNotEqual(Local0, 0xabcd0002)) {
151		err(ts, z164, __LINE__, 0, 0, Local0, 0xabcd0002)
152	}
153
154	Store(DerefOf(Index(p000, 3)), Local0)
155	if (LNotEqual(Local0, "i000")) {
156		err(ts, z164, __LINE__, 0, 0, Local0, "i000")
157	}
158
159	Store(DerefOf(Index(p000, 4)), Local0)
160	if (LNotEqual(Local0, 0xabcd0003)) {
161		err(ts, z164, __LINE__, 0, 0, Local0, 0xabcd0003)
162	}
163
164	Store(DerefOf(Index(p000, 5)), Local0)
165	if (LNotEqual(Local0, 0xabcd0004)) {
166		err(ts, z164, __LINE__, 0, 0, Local0, 0xabcd0004)
167	}
168}
169