1/*
2 * Some or all of this work - Copyright (c) 2006 - 2016, 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 * Calls to methods instead of Add
31 */
32
33/*
34SEE:
35do here all the tests ns0-ns... with Add replaced by MAdd
36*/
37
38Name(z158, 158)
39
40Method(m401, 1, Serialized)
41{
42	Name(ts, "m401")
43	Name(i000, 0x00000001)
44	Name(i001, 0)
45	Name(p000, Package() {1,2,3,4})
46
47	CH03(ts, z158, 0x000, 0, 0)
48
49	Store(arg0, i001)
50
51	Method(MAdd, 2)
52	{
53		Add(arg0, arg1, Local0)
54		Return (Local0)
55	}
56
57	Method(m001)
58	{
59		Method(m002)
60		{
61			Method(m003)
62			{
63				Method(m004)
64				{
65					Method(m005)
66					{
67						Method(m006)
68						{
69							Method(m007)
70							{
71								Method(m008)
72								{
73									if (i001)
74									{
75										CopyObject(p000, i000)
76									}
77									Return (0)
78								}
79								Store(0x80000000, i000)
80								Return (MAdd(i000, m008()))
81							}
82							Store(0x07000000, i000)
83							Return (MAdd(i000, m007()))
84						}
85						Store(0x00600000, i000)
86						Return (MAdd(i000, m006()))
87					}
88					Store(0x00050000, i000)
89					Return (MAdd(i000, m005()))
90				}
91				Store(0x00004000, i000)
92				Return (MAdd(i000, m004()))
93			}
94			Store(0x00000300, i000)
95			Return (MAdd(i000, m003()))
96		}
97		Store(0x00000020, i000)
98		Return (MAdd(i000, m002()))
99	}
100	Store(MAdd(i000, m001()), Local0)
101
102	if (LNotEqual(Local0, 0x87654321)) {
103		err(ts, z158, 0x001, 0, 0, Local0, 0x87654321)
104	}
105
106	if (LNotEqual(i000, 0x80000000)) {
107		err(ts, z158, 0x002, 0, 0, i000, 0x80000000)
108	}
109
110	CH03(ts, z158, 0x003, 0, 0)
111}
112
113Method(n004)
114{
115if (1) {
116	SRMT("m401-0")
117	m401(0)
118	SRMT("m401-1")
119	if (y200) {
120		m401(1)
121	} else {
122		BLCK()
123	}
124} else {
125	SRMT("m401-0")
126	m401(0)
127}
128}
129