• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/acpica/tests/aslts/src/runtime/collections/functional/module/
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 * Module level execution under Device/Processor/ThermalZone/PowerResource
31 */
32
33/*
34 * Verify if Type1Opcode (ex., If) is allowed under Device, PowerResource,
35 * Processor, or ThermalZone
36 *
37 * ASL spec state:
38 * 1. DeviceTerm supports ObjectList for ACPI 1.0 ~ ACPI 6.1.
39 * 2. PwerResTerm supports ObjectList for ACPI 1.0 ~ ACPI 6.1.
40 * 3. ProcessorTerm supports ObjectList for ACPI 1.0 ~ ACPI 6.1.
41 * 4. ThermalZoneTerm supports ObjectList for ACPI 1.0 ~ ACPI 6.1.
42 *
43 * AML spec state:
44 * 1. DefDevice supports ObjectList for ACPI 1.0 ~ ACPI 6.0.
45 * 2. DefPowerRes supports ObjectList for ACPI 1.0 ~ ACPI 6.0.
46 * 3. DefProcessor supports ObjectList for ACPI 1.0 ~ ACPI 6.0.
47 * 4. DefThermalZone supports ObjectList for ACPI 1.0 ~ ACPI 6.0.
48 *
49 * It appears the AML interpreter shouldn't support TermList for these
50 * objects as both the ASL grammar and AML grammar doesn't allow it. But
51 * the real world apears not.
52 */
53
54Name(z181, 181)
55
56/* Tests for Type1Opcode */
57
58Name(ml10, 0)
59Name(ml11, 0)
60Name(ml12, 0)
61Name(ml13, 0)
62
63Scope(\_SB)
64{
65	Device(dev0)
66	{
67		if (LEqual(ml10, 0)) {
68			Store(2, ml10)
69		}
70		PowerResource(pr00, 1, 0)
71		{
72			if (LEqual(ml13, 0)) {
73				Store(2, ml13)
74			}
75		}
76	}
77}
78Scope(\_PR)
79{
80	Processor(cpu0, 0, 0xFFFFFFFF, 0)
81	{
82		if (LEqual(ml11, 0)) {
83			Store(2, ml11)
84		}
85	}
86}
87Scope(\_TZ)
88{
89	ThermalZone(thz0)
90	{
91		if (LEqual(ml12, 0)) {
92			Store(2, ml12)
93		}
94	}
95}
96
97Method(MLO0,, Serialized)
98{
99	Name(ts, "MLO0")
100
101	Store("TEST: MLO0, Type1Opcode is executable under objects", Debug)
102
103	if (LNotEqual(ml10, 2)) {
104		err(ts, z181, 0, z181, 0, ml10, 2)
105	}
106	if (LNotEqual(ml11, 2)) {
107		err(ts, z181, 1, z181, 1, ml11, 2)
108	}
109	if (LNotEqual(ml12, 2)) {
110		err(ts, z181, 2, z181, 2, ml12, 2)
111	}
112	if (LNotEqual(ml13, 2)) {
113		err(ts, z181, 3, z181, 3, ml13, 2)
114	}
115}
116