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// Operation Regions
30
31
32Method(mb00)
33{
34	//     Field(arg0, ByteAcc, NoLock, Preserve) {...}
35	// Error 1037 - ^ parse error
36	OperationRegion(r000, SystemMemory, 0x100, 0x100)
37	Method(m000, 1)
38	{
39		Field(arg0, ByteAcc, NoLock, Preserve) {f900,8,f901,8,f902,8,f903,8}
40		BankField(arg0, f901, 0, ByteAcc, NoLock, Preserve) {bn90,4}
41		IndexField(f902, f903, ByteAcc, NoLock, Preserve) {if90,8,if91,8}
42	}
43
44	m000(r000)
45
46	// Invalid RegionSpaceKeyword, should cause ASL compiler's
47	// diagnostics like:
48	//     OperationRegion(RGNy, 0x7f, 0, 0x100)
49	// Error    4094 -              ^ Value below valid range 0x80-0xFF
50	// Error    4094 -              ^ Value above valid range 0x80-0xFF
51
52	OperationRegion(RGNx, 0x00, 0, 0x100)
53	OperationRegion(RGNy, 0x7f, 0, 0x100)
54	OperationRegion(RGNz, 0x100, 0, 0x100)
55
56	// Additional Invalid RegionName arguments, should cause
57	// ASL compiler's diagnostics like:
58	//         OperationRegion(0xabcd, SystemMemory, 0, 0x100)
59	// Error    4094 -  parse error ^
60
61	OperationRegion("arg0", SystemMemory, 0, 0x100)
62	OperationRegion(0xabcd, SystemMemory, 0, 0x100)
63
64	// Invalid Field's Offset and Length arguments, should cause
65	// ASL compiler's diagnostics like:
66	//                                    Offset(0x2000000), f000, 1,
67	// Error    4023 - Package length too long to encode ^
68
69/*  Now it below causes crash of iASL compiler, bug 225
70	OperationRegion(OPR0, SystemMemory, 0, 0x2000001)
71
72	Field(OPR0, ByteAcc, NoLock, Preserve) {
73		Offset(0x2000000), f000, 1,
74	}
75
76	Field(OPR0, ByteAcc, NoLock, WriteAsZeros) {
77		, 0xffffffc, f001, 6,
78	}
79
80	Field(OPR0, ByteAcc, NoLock, WriteAsOnes) {
81		f002, 0xffffffc,
82	}
83*/
84}
85